Przeglądaj źródła

feat:线下订单

Moss 1 rok temu
rodzic
commit
c10c59d6bd

+ 46 - 5
src/views/mallManagement/order/offline_order_list/index.vue

@@ -250,7 +250,7 @@
         </el-descriptions>
         <el-descriptions border title="" :column="4" :colon="false" labelStyle="width: 8%" contentStyle="width: 17%" style="margin-top: -1px">
           <el-descriptions-item label="支付状态">
-            {{detailData.orderStatus == 'NOPAY' || detailData.orderStatus == 'NOPAY' ? '待支付' : '已支付'}}
+            {{detailData.orderStatus == 'NOPAY' || detailData.orderStatus == 'TIMEOUT' ? '待支付' : '已支付'}}
           </el-descriptions-item>
           <el-descriptions-item label="支付方式">
             {{detailData.payType | payTypeFilter}}
@@ -475,6 +475,9 @@ export default {
       },
 
       showCodeDialog: false,
+			timer: '',
+
+      pageType: '',
     }
   },
   computed: {
@@ -582,6 +585,7 @@ export default {
       	label: ({ add: '新增', edit: '编辑' })[type],
       	// 打开时事件
       	triggerEvent: () => {
+          this.pageType = type;
       		this.formCancel()
       		this.$nextTick(()=>{
             this.getGoodsSpecList();
@@ -602,6 +606,7 @@ export default {
       	// 关闭时事件
       	closeEvent: () => {
 			    this.formCancel()
+          this.clear()
       	}
       })
     },
@@ -624,7 +629,7 @@ export default {
                 examineRemark: '',
               }).then(examineRes => {
                 if(examineRes.data.codeUrl) {
-                  this.creatCode(examineRes.data.codeUrl);
+                  this.creatCode(examineRes.data.codeUrl, res.data);
                 }else {
                   this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
                   cancel('list')
@@ -651,6 +656,7 @@ export default {
       	label: ({ detail: '详情', examine: '审核' })[type],
       	// 打开时事件
       	triggerEvent: () => {
+          this.pageType = type;
       		this.formCancel()
       		this.$nextTick(()=>{
             if (type == 'detail') {
@@ -666,6 +672,7 @@ export default {
       	// 关闭时事件
       	closeEvent: () => {
 			    this.detailCancel()
+          this.clear()
       	}
       })
     },
@@ -683,7 +690,7 @@ export default {
             examineRemark: this.examineFormData.remark,
           }).then(res => {
             if(this.examineFormData.status == 'OK' && res.data.codeUrl) {
-              this.creatCode(res.data.codeUrl);
+              this.creatCode(res.data.codeUrl, this.detailData.orderId);
             }else {
               this.$message({ type: 'success', message: `审批成功!` })
               cancel('list')
@@ -849,7 +856,7 @@ export default {
       this.goodsList[index].stockQty = item.stockQty;
     },
 
-    creatCode(data) {
+    creatCode(data, orderId) {
       this.showCodeDialog = true;
       this.$nextTick(() => {
         this.$refs.payQRCode.innerHTML = '';
@@ -861,8 +868,42 @@ export default {
           colorLight: "#ffffff", // 二维码背景色
           correctLevel: QRCode.CorrectLevel.L // 容错率,L/M/H
         })
+        this.checkPay(orderId);
       })
-    }
+    },
+
+    checkPay(orderId){
+      this.timer = setTimeout(()=>{
+        if(this.num === undefined){
+          this.num = 0
+        }
+        if(this.num <=10){
+          this.num++
+        }else{
+          this.clear()
+          this.$refs.tabPage.removeTab(this.pageType);
+          return 
+        }
+        getOfflineOrderDetail({orderId}).then(res => {
+          if(res.data.orderStatus != 'NOPAY' && res.data.orderStatus != 'TIMEOUT'){
+            this.clear()
+            this.$message.success('支付成功!')
+            this.$refs.tabPage.removeTab(this.pageType);
+          }else {
+            this.checkPay(orderId);
+          }
+        })
+      }, 3000)
+    },
+
+    clear(){
+      if(this.$refs.payQRCode) {
+        this.$refs.payQRCode.innerHTML = '';
+      }
+      this.showCodeDialog = false;
+      this.num = 0
+      clearTimeout(this.timer)
+    },
 
   }
 }

+ 2 - 2
src/views/mallManagement/order/order_detail/index.vue

@@ -72,8 +72,8 @@
               <div class="value">{{ orderDetail.workerName }} ({{ orderDetail.workerPhone }})</div>
             </div>
             <div class="item">
-              <div class="label">团长信息:</div>
-              <div class="value">{{ orderDetail.promotionGroupUserName }} ({{ orderDetail.promotionGroupMobile }})</div>
+              <div class="label">业务员信息:</div>
+              <div class="value">{{ orderDetail.saleName }} ({{ orderDetail.saleMobile }})</div>
             </div>
             <div class="item">
               <div class="label">下单渠道:</div>