Browse Source

Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_adminUI

caoliqin 2 days ago
parent
commit
5cdb543732
1 changed files with 17 additions and 13 deletions
  1. 17 13
      src/views/hisStore/components/productOrder.vue

+ 17 - 13
src/views/hisStore/components/productOrder.vue

@@ -595,7 +595,7 @@ export default {
   methods: {
     handleAddress(){
         const id = this.order.id;
-        getStoreOrderAddress(id).then(response =>{
+        return getStoreOrderAddress(id).then(response =>{
             this.order.userAddress = response.address;
         })
       },
@@ -786,19 +786,23 @@ export default {
           this.getOrder(this.order.id);
         }).catch(function() {});
     },
-    editOrder(){
-        this.handleAddress()
-        setTimeout(()=>{
-          this.edit.open=true;
-          this.editForm.id=this.order.id;
-          this.editForm.mark=this.order.mark
-          this.editForm.orderType=this.order.orderType.toString();
-          this.editForm.status = this.order.status.toString();
-          this.editForm.userAddress = this.order.userAddress.toString();
-          this.editForm.scheduleId = this.order.scheduleId;
-        },1000)
-        // this.editForm.extendOrderId = this.order.extendOrderId.toString();
+    async editOrder(){
+      try {
+        // 先获取地址信息
+        await this.handleAddress();
 
+        // 等待地址获取完成后打开编辑对话框
+        this.edit.open = true;
+        this.editForm.id = this.order.id;
+        this.editForm.mark = this.order.mark;
+        this.editForm.orderType = this.order.orderType.toString();
+        this.editForm.status = this.order.status.toString();
+        this.editForm.userAddress = this.order.userAddress.toString();
+        this.editForm.scheduleId = this.order.scheduleId;
+      } catch (error) {
+        console.error('获取地址失败:', error);
+        this.msgError('获取地址信息失败');
+      }
     },
     //推送管易按钮
     addErpOrder(){