ソースを参照

考虑异步加载

shaun-sheep 5 年 前
コミット
bf7b3941ba

+ 4 - 4
src/components/dialogs/list/batchDialog.vue

@@ -442,7 +442,7 @@
             }
           })
         } else {
-          if (this.radio === 2) {
+          if (this.radio === 2 && this.information.insuranceFile.InsuranceFile.length) {
             single.InsuranceDoc = {
               InsuranceFile: this.information.insuranceFile.InsuranceFile.length ? this.information.insuranceFile.InsuranceFile : undefined
             }
@@ -489,11 +489,11 @@
 
         }
         if (this.radio === 2) {
-          let {InsuranceDoc, ...multiples} = multiple
+          let {InsuranceDoc, PhotoDoc, Siteinstall} = multiple
           LedgerParam = {
             ...single,
-            ...multiples
-
+            ...PhotoDoc,
+            ...Siteinstall
           };
           let arr3 = this.deepCopy(arr).map(item => ({
             ...Id,

+ 25 - 9
src/components/ledger/handsontables/device.vue

@@ -1281,31 +1281,47 @@
             });
           }
           if (filterParam1) {
-            queryUpdate(param1, res => {
+            setTimeout(() => {
+              queryUpdate(param1, res => {
+              })
             })
-          }
 
+          }
         }
         if (type === 2) {//覆盖
-          updateEquip(param, res => {
-          });
+          let filterParams = this.filterCheck(param, 'all')
+          if (filterParams) {
+            updateEquip(param, res => {
+            });
+          }
         }
-        this.getTableData()
-        this.getAllData()
+        setTimeout(() => {
+          this.getTableData()
+          this.getAllData()
+        }, 10)
       },
       filterCheck(arr, type) {
         if (type === 'sole') {
           for (let i of arr.Content) {
             return Object.keys(i.LedgerParam).length
           }
-        } else {
+        } else if (type === 'multiple') {
           let  nArr = [];
           arr.Content.forEach(i => {
             let {EquipID, ...value} = i
-            nArr.push({val: value})
+            nArr.push({LedgerParam: value})
           })
           for (let j of nArr) {
-            return Object.keys(j.val).length
+            return Object.keys(j.LedgerParam).length
+          }
+        } else {
+          let array = [];
+          arr.Content.forEach(i => {
+            let {EquipID, ...value} = i
+            array.push(value)
+          })
+          for (let j of array) {
+            return Object.keys(j.LedgerParam).length
           }
         }
       }