confirm.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. <template>
  2. <view class="app-content">
  3. <view class="affirm-page">
  4. <view class="affirm-view overscroll">
  5. <form>
  6. <view class="module-com">
  7. <view class="commodity-view">
  8. <view class="commodity-list">
  9. <view class="commodity-item" v-for="(item, index) in selectList" :key="index">
  10. <image class="item-icon" :src="item.cover" alt="商品图" />
  11. <view class="item-info">
  12. <view class="info-line">
  13. <text class="item-name">{{ item.itemName }}</text>
  14. <text class="item-price">
  15. <text class="unit"></text>
  16. <text class="price">
  17. <text v-if="item.bigCount > 0">{{`${item.bigCount}`}}扎</text>
  18. <text v-if="item.smallCount > 0">{{`${item.smallCount}`}}支</text>
  19. </text>
  20. </text>
  21. </view>
  22. <view class="info-line">
  23. <text class="item-type"></text>
  24. <text class="item-count">
  25. </text>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="summary-bar">
  31. <view class="operate-view" @click="gobackEvent">
  32. <text class="iconfont icongouwuche"></text>
  33. 返回修改
  34. </view>
  35. <view class="describe-view">
  36. 共{{ selectList.length }}种
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <!-- 登录信息 -->
  42. <view class="module-com input-line-wrap">
  43. <tui-list-cell class="line-cell" :hover="false" :arrow="false">
  44. <view class="tui-title">备注</view>
  45. <input type="text" v-model="form.remark" placeholder="选填"/>
  46. </tui-list-cell>
  47. </view>
  48. </form>
  49. </view>
  50. <view class="under-bar">
  51. <view class="price-view"></view>
  52. <button class="admin-button-com blue big" @click="affirmFormSubmit">提交</button>
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import TuiListCell from "@/components/plugin/list-cell";
  59. import AppAvatarModule from "@/components/module/app-avatar";
  60. import SimpleAddress from "@/components/plugin/simple-address";
  61. import AppAreaSel from "@/components/app-area-sel";
  62. import productMins from "@/mixins/product";
  63. import appFormRadioBtn from "@/components/app-formRadio-btn";
  64. import appAddressGroup from "@/components/app-address-group";
  65. import appSendTime from "@/components/app-send-time";
  66. import appFormSend from "@/components/app-form-send";
  67. import { partItem } from "@/api/part";
  68. import { mapActions, mapGetters } from "vuex";
  69. export default {
  70. name: "confirm",
  71. components: {
  72. TuiListCell,
  73. AppAvatarModule,
  74. SimpleAddress,
  75. AppAreaSel,
  76. appFormRadioBtn,
  77. appAddressGroup,
  78. appSendTime,
  79. appFormSend,
  80. },
  81. mixins: [productMins],
  82. data () {
  83. return {
  84. autoLoad: false,
  85. isBilling: false,
  86. payWayList:[{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}],
  87. payWayindex:0,
  88. form: {
  89. debt: 1,
  90. shopId: "",
  91. shopName: "",
  92. receiveProvince: "",
  93. receiveCity: "",
  94. receiveFloor: "",
  95. receiveAddress: "",
  96. receiveLong: "",
  97. receiveLat: "",
  98. sendType: 2,
  99. sendSide: "2",
  100. sendDate: "",
  101. sendTime: "",
  102. sendCost: "",
  103. customId: "",
  104. product: "",
  105. remark:"",
  106. payWay:0,
  107. needPrint:1,
  108. },
  109. money: "",
  110. showCustomer: false,
  111. selectJobType: "part",
  112. };
  113. },
  114. onLoad (option) {
  115. if (!this.getMerchantInfo) {
  116. this.initMerchantInfo().then((data) => {
  117. uni.setNavigationBarTitle({
  118. title: data.name,
  119. });
  120. });
  121. } else {
  122. uni.setNavigationBarTitle({
  123. title: this.getMerchantInfo.name,
  124. });
  125. }
  126. this.courier(2);
  127. if(option.customId){
  128. this.form.customId = option.customId
  129. }
  130. if(option.customName){
  131. this.form.customName = option.customName
  132. }
  133. },
  134. onShow(){
  135. if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
  136. this.showCustomer = true;
  137. }
  138. },
  139. onUnload(){
  140. uni.removeStorageSync('newClient');
  141. },
  142. computed: {
  143. ...mapGetters(["getMerchantInfo", "getLoginInfo"]),
  144. },
  145. methods: {
  146. ...mapActions(["initMerchantInfo"]),
  147. init () {
  148. this._getDet();
  149. },
  150. payWayChange(e){
  151. let index = e.detail.value
  152. this.payWayindex = index
  153. this.form.payWay = this.payWayList[index].id
  154. },
  155. setPayWay(payWay){
  156. this.form.payWay = payWay
  157. },
  158. courier (type) {
  159. this.form.sendType = type;
  160. if (type === 2) {
  161. this.form.sendCost = "";
  162. } else if(type == 1){
  163. this.form.sendCost = this.money;
  164. }
  165. },
  166. sendCostBlur () {
  167. if (this.form.sendType === 1) {
  168. this.money = this.form.sendCost;
  169. }
  170. },
  171. _getDet () {
  172. let data = uni.getStorageSync("modifyShopB");
  173. if (this.$util.isEmpty(data)) return;
  174. Object.keys(this.form).forEach((i, index) => {
  175. this.form[i] = data[i];
  176. });
  177. },
  178. changeCustomerFn (info) {
  179. const product = this.selectList.map((ele) => {
  180. return {
  181. productId: ele.id,
  182. bigNum: ele.bigCount,
  183. smallNum: ele.smallCount,
  184. classId: ele.classId,
  185. itemId: ele.itemId,
  186. };
  187. });
  188. let params = {
  189. customId: info.id,
  190. product: JSON.stringify(product),
  191. province: info.province,
  192. city: info.city,
  193. address: info.address,
  194. floor: info.floor,
  195. long: info.long,
  196. lat: info.lat,
  197. };
  198. this.form.sendCost = '';
  199. this.form.customId = info.id;
  200. this.form.customName = info.name;
  201. },
  202. affirmFormSubmit () {
  203. let that = this
  204. let product = this.selectList.map((ele) => {
  205. return {
  206. productId: ele.id,
  207. bigNum: ele.bigCount,
  208. smallNum: ele.smallCount,
  209. classId: ele.classId,
  210. itemId: ele.itemId
  211. };
  212. });
  213. that.$util.confirmModal({content:'确认拆散?'},() => {
  214. partItem({product:JSON.stringify(product),remark:that.form.remark}).then((res) => {
  215. //删除记忆
  216. that.removeFromSaveDirect()
  217. const {data: { id, orderSn },} = res;
  218. that.pageTo({url: '/admin/part/result',type:2})
  219. });
  220. })
  221. },
  222. gobackEvent () {
  223. this.pageTo({url: '/admin/part/index',type:2})
  224. },
  225. },
  226. };
  227. </script>
  228. <style lang="scss" scoped>
  229. .admin-button-com {
  230. margin-right: 20upx;
  231. }
  232. .affirm-page {
  233. position: relative;
  234. height: 100%;
  235. display: flex;
  236. flex-direction: column;
  237. .affirm-view {
  238. flex: 1;
  239. margin-bottom:90upx;
  240. padding: 20upx;
  241. background-color: #f0f2f6;
  242. .commodity-view {
  243. display: flex;
  244. flex-direction: column;
  245. .commodity-list {
  246. padding: 20upx;
  247. .commodity-item {
  248. display: flex;
  249. margin-bottom: 20upx;
  250. .item-icon {
  251. flex-shrink: 0;
  252. width: 140upx;
  253. height: 140upx;
  254. }
  255. .item-info {
  256. display: flex;
  257. flex-direction: column;
  258. justify-content: center;
  259. flex: 1;
  260. margin-left: 20upx;
  261. .info-line {
  262. margin-bottom: 20upx;
  263. display: flex;
  264. justify-content: space-between;
  265. align-items: flex-end;
  266. .item-name {
  267. color: #666;
  268. font-size: 28upx;
  269. }
  270. .item-price {
  271. color: #333;
  272. font-size: 22upx;
  273. .price {
  274. font-size: 32upx;
  275. font-weight: bold;
  276. }
  277. }
  278. .item-type {
  279. color: #999;
  280. font-size: 24upx;
  281. }
  282. .item-count {
  283. color: #666;
  284. font-size: 24upx;
  285. }
  286. }
  287. }
  288. }
  289. }
  290. .summary-bar {
  291. padding: 0 20upx;
  292. height: 90upx;
  293. display: flex;
  294. align-items: center;
  295. justify-content: space-between;
  296. border-top: 1upx solid #eeeeee;
  297. .operate-view {
  298. display: flex;
  299. align-items: center;
  300. color: #3385ff;
  301. font-size: 30upx;
  302. font-weight:bold;
  303. .iconfont {
  304. margin-right: 20upx;
  305. font-size: 40upx;
  306. }
  307. }
  308. .describe-view {
  309. display: flex;
  310. align-items: center;
  311. color: #333;
  312. font-size: 24upx;
  313. .price {
  314. font-weight: bold;
  315. font-size: 36upx;
  316. }
  317. }
  318. }
  319. }
  320. .module-com {
  321. background-color: #fff;
  322. margin-bottom: 20upx;
  323. border-radius: 10upx;
  324. overflow: hidden;
  325. .tab-box{
  326. padding: 10upx 30upx 30upx;
  327. .tab{
  328. width: 49%;
  329. height: 70upx;
  330. color: #a2a2a2;
  331. border: 1upx solid #dcdcdc;
  332. border-radius: 10upx;
  333. font-size: 28upx;
  334. font-weight: 700;
  335. &.active{
  336. color: #ff4d4d;
  337. border: 1upx solid #ff4d4d;
  338. }
  339. }
  340. }
  341. .member-wrap {
  342. .member-det {
  343. font-size: 24upx;
  344. margin-left: 20upx;
  345. }
  346. }
  347. .remark-wrap {
  348. align-items: flex-start;
  349. .remark {
  350. height: 240upx;
  351. }
  352. }
  353. // .tui-placeholder,
  354. // .tui-input {
  355. // padding-right: 30upx;
  356. // width: 100%;
  357. // text-align: right;
  358. // }
  359. }
  360. }
  361. .under-bar {
  362. display: flex;
  363. justify-content: space-between;
  364. align-items: center;
  365. padding: 0 20upx;
  366. position: fixed;
  367. bottom:0;
  368. /* 手机mobile屏幕小于1000px */
  369. @media screen and (max-width: 1100px) {
  370. width: 100%;
  371. }
  372. /* 收银台cashier屏幕大于1000px */
  373. @media screen and (min-width:1100px) {
  374. width: 40%;
  375. }
  376. height: 100upx;
  377. background-color: #fff;
  378. box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
  379. .price-view {
  380. display: flex;
  381. align-items: center;
  382. font-size: 24upx;
  383. .price-title {
  384. color: #333;
  385. }
  386. .price-number {
  387. margin: 0 20upx;
  388. color: #ff2842;
  389. .large {
  390. font-size: 40upx;
  391. }
  392. }
  393. }
  394. .admin-button-com {
  395. width: 200upx;
  396. }
  397. }
  398. }
  399. </style>