Przeglądaj źródła

Merge branch 'hotfix/Hotfix-zh-309' into develop

howie 2 lat temu
rodzic
commit
98543a1622

+ 16 - 9
src/views/supply/policy/components/retail_form.vue

@@ -943,16 +943,23 @@ export default {
       this.$set(this.mainForm, 'k3ServiceId', user.adminUserId)
       this.$set(this.mainForm, 'k3ServiceName', user.nickName)
     },
-    hasRak(e, row) {
-      hasRak({ id: row.materialId }).then(res => {
-        if (res.data && e) {
-          this.goodsList.forEach(k => {
-            this.$set(k, 'isDirectTransfer', true)
-          })
+    hasRak(e) {
+      const ids = this.goodsList.map(k => {
+        return k.materialId
+      })
+      hasRak({ id: ids.join(',') }).then(res => {
+        if (e) {
+          if (res.data) {
+            this.goodsList.forEach(i => {
+              this.$set(i, 'isDirectTransfer', true)
+            })
+          }
         } else {
-          this.goodsList.forEach(k => {
-            this.$set(k, 'isDirectTransfer', false)
-          })
+          if (res.data) {
+            this.goodsList.forEach(i => {
+              this.$set(i, 'isDirectTransfer', false)
+            })
+          }
         }
       })
     },

+ 16 - 9
src/views/supply/retail/components/retail_form.vue

@@ -734,16 +734,23 @@ export default {
         this.warehouseList = res.data.records
       })
     },
-    hasRak(e, row) {
-      hasRak({ id: row.materialId }).then(res => {
-        if (res.data && e) {
-          this.goodsList.forEach(k => {
-            this.$set(k, 'isDirectTransfer', true)
-          })
+    hasRak(e) {
+      const ids = this.goodsList.map(k => {
+        return k.materialId
+      })
+      hasRak({ id: ids.join(',') }).then(res => {
+        if (e) {
+          if (res.data) {
+            this.goodsList.forEach(i => {
+              this.$set(i, 'isDirectTransfer', true)
+            })
+          }
         } else {
-          this.goodsList.forEach(k => {
-            this.$set(k, 'isDirectTransfer', false)
-          })
+          if (res.data) {
+            this.goodsList.forEach(i => {
+              this.$set(i, 'isDirectTransfer', false)
+            })
+          }
         }
       })
     },