Forráskód Böngészése

【修改】零售订单、政策订单【修改】设置一张单只能为全直调/非直调
生活电器一个货品选择直调,整单都需要选择直调 (生活电器品类只要有一个勾选直调,其他的产品也一起勾选直调)

howie 2 éve
szülő
commit
38df68de55

+ 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)
+            })
+          }
         }
       })
     },