cmy 1 gadu atpakaļ
vecāks
revīzija
e0ca94fc57
1 mainītis faili ar 12 papildinājumiem un 8 dzēšanām
  1. 12 8
      src/pages/cashier/reservation.vue

+ 12 - 8
src/pages/cashier/reservation.vue

@@ -606,10 +606,10 @@
 			},
 			//现金收款创建订单并支付
 			cashBnt(payNum) {
+				if (this.cashBntLoading) {
+					return;
+				}
 				if (this.pptype == 1) {
-					if (this.cashBntLoading) {
-						return;
-					}
 					this.cashBntLoading = true;
 					if (this.rechargeVisible) {
 						this.rechargeBalance(payNum);
@@ -628,13 +628,19 @@
 						sale_uid: that.payInfo.pay_price == 0 ? '' : that.saleInfo.id,
 						products: arr.join(','),
 						pay_type: that.payType,
-						userCode: payNum,
 						reservation_time: that.selectDay
 					}
+					if(that.payType===''){
+						qdata.authCode=payNum;
+					}else{
+						qdata.userCode=payNum;
+					}
+					
 					this.cashBntLoading = true;
 					createServeItem(qdata).then(res => {
 						that.pptype = 1;
 						let storage = window.localStorage;
+						that.cashBntLoading = false;
 						if (that.payType == "yue") {
 							that.settleVisible = false;
 							that.payNum = "";
@@ -668,7 +674,7 @@
 						}
 						if (that.payType == "") {
 							that.payNum = "";
-							that.createOrder.auth_code = "";
+							that.createOrder.authCode = "";
 							if (res.data.status == "ORDER_CREATE") {
 								that.isOrderCreate = 1;
 								that.orderId = res.data.order_id;
@@ -691,11 +697,9 @@
 							}
 						}
 					}).catch(err => {
+						that.cashBntLoading = false;
 						that.$Message.success(err.msg);
 					})
-					setTimeout(() => {
-						that.cashBntLoading = false;
-					}, 1000);
 				}
 			},
 			//清除计算机输入的数字