Sfoglia il codice sorgente

散货 保存报错时 按钮loading没结束加载

qukaidi 2 mesi fa
parent
commit
5e901ce1cd
1 ha cambiato i file con 73 aggiunte e 62 eliminazioni
  1. 73 62
      src/views/landTransportation/bulkCargo/detailPage.vue

+ 73 - 62
src/views/landTransportation/bulkCargo/detailPage.vue

@@ -2926,7 +2926,6 @@ export default {
         '<p style="padding: 5px 0"><span style="color: #a0a0a0">经纬度:</span>' +
         data.location.join(",") +
         "</p>" +
-        
         '<p><span style="color: #a0a0a0">设备状态:</span>' +
         (isCar ? (carData.is_online ? '<span style="color: #67C23A">在线</span>' : '<span style="color: #F56C6C">离线</span>') : "暂无设备") +
         "</p>" +
@@ -3086,47 +3085,51 @@ export default {
       } else {
         ids = this.goodsForm.id;
       }
-      detailDelegationList({ id: ids }).then(res => {
-        this.goodsForm = res.data.data;
-        if (this.findObject(this.paymentOption.column, "fleetId") != -1) {
-          this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.goodsForm.id;
-        }
-        this.tableData = res.data.data.loadingAddressList;
-        this.tableDataTwo = res.data.data.unloadedAddressList;
-        this.entrustList = res.data.data.itemList;
-        this.vehicleList = res.data.data.orderItemList;
-        this.orderFilesList = res.data.data.fileList || [];
-        this.oldgoodsForm = res.data.data;
-        this.oldtableData = this.deepClone(res.data.data.loadingAddressList || []);
-        this.oldtableDataTwo = this.deepClone(res.data.data.unloadedAddressList || []);
-        this.oldentrustList = this.deepClone(res.data.data.itemList);
-        this.oldvehicleList = this.deepClone(res.data.data.orderItemList);
-        this.oldorderFilesList = this.deepClone(res.data.data.fileList || []);
-        if (res.data.data.orderFeeList) {
-          if (res.data.data.orderFeeList.length > 0) {
-            this.collectionList = [];
-            this.paymentList = [];
-            res.data.data.orderFeeList.forEach(item => {
-              if (item.type == 1) {
-                this.collectionList.push(item);
-              } else {
-                this.paymentList.push(item);
-              }
-            });
+      this.type = true;
+      detailDelegationList({ id: ids })
+        .then(res => {
+          this.goodsForm = res.data.data;
+          if (this.findObject(this.paymentOption.column, "fleetId") != -1) {
+            this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.goodsForm.id;
           }
-        }
-        this.goodsOptionFormC.disabled = true;
-        this.goodsOptionForm.disabled = true;
-        this.goodsOptionFormTwo.disabled = true;
-        this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.goodsForm.status >= 1;
-        delete this.goodsForm.orderAddressList;
-        delete this.goodsForm.itemList;
-        delete this.goodsForm.orderFeeList;
-        // this.tableData.forEach(item => {
-        //   if (item.region) item.region = item.region.split(',')
-        // })
-        this.type = false;
-      });
+          this.tableData = res.data.data.loadingAddressList;
+          this.tableDataTwo = res.data.data.unloadedAddressList;
+          this.entrustList = res.data.data.itemList;
+          this.vehicleList = res.data.data.orderItemList;
+          this.orderFilesList = res.data.data.fileList || [];
+          this.oldgoodsForm = res.data.data;
+          this.oldtableData = this.deepClone(res.data.data.loadingAddressList || []);
+          this.oldtableDataTwo = this.deepClone(res.data.data.unloadedAddressList || []);
+          this.oldentrustList = this.deepClone(res.data.data.itemList);
+          this.oldvehicleList = this.deepClone(res.data.data.orderItemList);
+          this.oldorderFilesList = this.deepClone(res.data.data.fileList || []);
+          if (res.data.data.orderFeeList) {
+            if (res.data.data.orderFeeList.length > 0) {
+              this.collectionList = [];
+              this.paymentList = [];
+              res.data.data.orderFeeList.forEach(item => {
+                if (item.type == 1) {
+                  this.collectionList.push(item);
+                } else {
+                  this.paymentList.push(item);
+                }
+              });
+            }
+          }
+          this.goodsOptionFormC.disabled = true;
+          this.goodsOptionForm.disabled = true;
+          this.goodsOptionFormTwo.disabled = true;
+          this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.goodsForm.status >= 1;
+          delete this.goodsForm.orderAddressList;
+          delete this.goodsForm.itemList;
+          delete this.goodsForm.orderFeeList;
+          // this.tableData.forEach(item => {
+          //   if (item.region) item.region = item.region.split(',')
+          // })
+        })
+        .finally(() => {
+          this.type = false;
+        });
     },
     //切换收付费
     handleSelect(tab, event) {
@@ -3306,15 +3309,19 @@ export default {
         fileList: this.orderFilesList,
         itemList: this.entrustList,
         orderFeeList: this.collectionList.concat(this.paymentList)
-      }).then(res => {
-        this.$message.success("保存成功");
-        if (!this.goodsForm.id) {
-          this.id = res.data.data;
-          this.refreshData(res.data.data);
-        } else {
-          this.refreshData();
-        }
-      });
+      })
+        .then(res => {
+          this.$message.success("保存成功");
+          if (!this.goodsForm.id) {
+            this.id = res.data.data;
+            this.refreshData(res.data.data);
+          } else {
+            this.refreshData();
+          }
+        })
+        .finally(() => {
+          this.type = false;
+        });
     },
     updateFee() {
       const loading = this.$loading({
@@ -3518,19 +3525,23 @@ export default {
                   fileList: this.orderFilesList,
                   itemList: this.entrustList,
                   orderFeeList: this.collectionList.concat(this.paymentList)
-                }).then(res => {
-                  saveDelegationList({
-                    id: res.data.data
-                  })
-                    .then(() => {
-                      this.type = false;
-                      this.$message.success("提交成功");
-                      this.refreshData(res.data.data);
+                })
+                  .then(res => {
+                    saveDelegationList({
+                      id: res.data.data
                     })
-                    .finally(() => {
-                      this.type = false;
-                    });
-                });
+                      .then(() => {
+                        this.type = false;
+                        this.$message.success("提交成功");
+                        this.refreshData(res.data.data);
+                      })
+                      .finally(() => {
+                        this.type = false;
+                      });
+                  })
+                  .catch(() => {
+                    this.type = false;
+                  });
               } else {
                 return false;
               }