shish 5 years ago
parent
commit
8831208005

+ 67 - 28
ghsApp/src/admin/home/order.vue

@@ -69,7 +69,8 @@
             </view>
             <view class="order-info_box">
               <view>开单:</view>
-              <view>{{ item.shopAdminName }}</view>
+              <view v-if="item.shopAdminId > 0">{{ item.shopAdminName}}</view>
+              <view v-else>{{item.customName}}-{{item.customShopAdminName}}</view>
             </view>
             <view class="order-info_box">
               <view>数量:</view>
@@ -126,7 +127,7 @@ import { getCategory, getUsage } from "@/utils/config";
 import { list } from "@/mixins";
 import { mapGetters } from "vuex";
 import { cloudPrintOrder } from "@/api/order";
-import { getListB, freeShipping,confirmFinish } from "@/api/order";
+import { getListB, freeShipping,confirmFinish,cancel } from "@/api/order";
 import AppSearchModule from "@/components/module/app-search";
 import DorpdownSelect from "@/components/module/dorpdownSelect";
 import AppAvatarModule from "@/components/module/app-avatar";
@@ -323,32 +324,70 @@ export default {
           }
         }
 			}else if(s.type == 'confirm'){
-        let that = this
-        uni.showActionSheet({
-            itemList: ['请选择结算方式:', '欠款', '已收款'],
-            success: function (res) {
-              let title = res.tapIndex == 1 ? '确认客户欠款?' : '确认已收款?'
-              let clearType = res.tapIndex == 1 ? 1 : 2;
-              uni.showModal({
-                  title: '完成订单提示',
-                  content: title,
-                  success: function (res) {
-                      if (res.confirm) {
-                        confirmFinish({id:item.id,clearType:clearType}).then((res) => {
-                         that._list();
-                         that.$msg(res.msg);
-                        })
-                      } else if (res.cancel) {
-                          console.log('用户点击取消');
-                      }
-                  }
-              });
-            },
-            fail: function (res) {
-                console.log(res.errMsg);
-            }
-        });
-      }
+				let self = this;
+				uni.showActionSheet({
+					itemList: ['请选择结算方式:', '欠款', '已收款'],
+					success: function (res) {
+						let payWay = 0
+						let title = res.tapIndex == 1 ? '确认客户欠款?' : '确认已收款?'
+						//1欠款 2已收款
+						let clearType = res.tapIndex == 1 ? 1 : 2;
+						//选择的已收款,还需要选择收款方式
+						if(clearType == 2){
+							uni.showActionSheet({
+								itemList: ['请选择收款方式:', '微信', '支付宝','现金','银行卡'],
+								success: function (respond) {
+									let currentIndex = respond.tapIndex
+									let inWay = [{name:"未选择",id:-1},{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}]
+									if (self.$util.isEmpty(inWay[currentIndex].id || inWay[currentIndex].id == -1)) {
+										return false;
+									}
+									payWay = inWay[currentIndex].id
+									let params = {id:item.id,clearType:clearType,payWay:payWay}
+									self.toConfrim(params,title)
+								}
+							})
+						}else{
+							let params = {id:item.id,clearType:clearType,payWay:payWay}
+							self.toConfrim(params,title)
+						}
+					}
+				});
+      }else if(s.type == 'cancel'){
+				let self = this;
+				uni.showModal({
+					title: '提示',
+					content: '确认取消?',
+					success: function (res) {
+						if (res.confirm) {
+
+							cancel({id:item.id}).then((res) => {
+								uni.showToast({title:res.msg,icon:'none'})
+								this._list();
+							})
+
+						}
+					}
+				});
+			}
+
+		},
+		toConfrim(params,title){
+			uni.showModal({
+				title: '完成订单提示',
+				content: title,
+				success: function (res) {
+					if (res.confirm) {
+						self.toConfirmRequest(params)
+					}
+				}
+			});
+		},
+		toConfirmRequest(params){
+			confirmFinish(params).then((res) => {
+				uni.showToast({title:res.msg,icon:'none'})
+				this.init();
+			})
 		},
     selectSussess(val) {
       console.log(val);

+ 4 - 0
ghsApp/src/api/order/index.js

@@ -177,4 +177,8 @@ export const addPrintNum = data => https.get("/order/add-print-num", data);
 //云打印 shish 20210714
 export const cloudPrintOrder = data => https.get("/order/cloud-print-order", data);
 
+//确认完成订单 shish 20210810
 export const confirmFinish = data => https.get("/order/confirm-finish", data);
+
+//取消订单 shish 20210810
+export const cancel = data => https.get("/order/cancel", data);

+ 4 - 1
ghsApp/src/mixins/product.js

@@ -349,7 +349,10 @@ export default {
 			uni.setStorageSync('selectList'+this.pageType, this.selectList)
 
 		},
-
+		//记忆已选的花材
+		rememberProduct(){
+			uni.setStorageSync('selectList'+this.pageType, this.selectList)
+		},
 		addCustomNumEvent(item,params1,type) {
 				const list = this.selectList;
 

+ 54 - 19
ghsApp/src/pagesOrder/detail.vue

@@ -201,7 +201,7 @@
 <script>
 import stepStatus from "./components/stepStatus";
 import TuiListCell from "@/components/plugin/list-cell";
-import { getDetail,debtPay,hasPay, freeShipping,confirmFinish } from "@/api/order/index";
+import { getDetail,debtPay,hasPay, freeShipping,confirmFinish,cancel } from "@/api/order/index";
 import { getOrderProduct } from "@/api/order-item/index";
 import productMins from "@/mixins/product";
 import { ORDER_STATUS } from "@/utils/declare";
@@ -354,29 +354,64 @@ export default {
 				uni.showActionSheet({
 					itemList: ['请选择结算方式:', '欠款', '已收款'],
 					success: function (res) {
-					let title = res.tapIndex == 1 ? '确认客户欠款?' : '确认已收款?'
-					let clearType = res.tapIndex == 1 ? 1 : 2;
-					uni.showModal({
-						title: '完成订单提示',
-						content: title,
-						success: function (res) {
-							if (res.confirm) {
-								confirmFinish({id:item.id,clearType:clearType}).then((res) => {
-									uni.showToast({title:res.msg,icon:'none'})
-									self.init();
-								})
-							} else if (res.cancel) {
-								console.log('用户点击取消');
-							}
+						let payWay = 0
+						let title = res.tapIndex == 1 ? '确认客户欠款?' : '确认已收款?'
+						//1欠款 2已收款
+						let clearType = res.tapIndex == 1 ? 1 : 2;
+						//选择的已收款,还需要选择收款方式
+						if(clearType == 2){
+							uni.showActionSheet({
+								itemList: ['请选择收款方式:', '微信', '支付宝','现金','银行卡'],
+								success: function (respond) {
+									let currentIndex = respond.tapIndex
+									let inWay = [{name:"未选择",id:-1},{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}]
+									if (self.$util.isEmpty(inWay[currentIndex].id || inWay[currentIndex].id == -1)) {
+										return false;
+									}
+									payWay = inWay[currentIndex].id
+									let params = {id:item.id,clearType:clearType,payWay:payWay}
+									self.toConfrim(params,title)
+								}
+							})
+						}else{
+							let params = {id:item.id,clearType:clearType,payWay:payWay}
+							self.toConfrim(params,title)
+						}
+					}
+				});
+			}else if(s.type == 'cancel'){
+				let self = this;
+				uni.showModal({
+					title: '提示',
+					content: '确认取消?',
+					success: function (res) {
+						if (res.confirm) {
+							cancel({id:item.id}).then((res) => {
+								uni.showToast({title:res.msg,icon:'none'})
+								self.init();
+							})
 						}
-					});
-					},
-					fail: function (res) {
-						console.log(res.errMsg);
 					}
 				});
 			}
 		},
+		toConfrim(params,title){
+			uni.showModal({
+				title: '完成订单提示',
+				content: title,
+				success: function (res) {
+					if (res.confirm) {
+						self.toConfirmRequest(params)
+					}
+				}
+			});
+		},
+		toConfirmRequest(params){
+			confirmFinish(params).then((res) => {
+				uni.showToast({title:res.msg,icon:'none'})
+				this.init();
+			})
+		},
 		copy(val) {
 			const self = this;
 			uni.setClipboardData({