黄梓星 %!s(int64=2) %!d(string=hai) anos
pai
achega
9815e4b573

+ 20 - 6
src/views/purchase/DemandSummary/index.vue

@@ -700,17 +700,31 @@ export default {
       }
     },
     // 行关闭
+    closeitem() {
+      let param = this.ids.join()
+      shutDownSummary(param).then(res => {
+        if (res.code === 200) {
+          this.$modal.msgSuccess("操作成功");
+          this.getList(this.queryParams)
+        }
+      })
+    },
     closeLine() {
       if (this.ids.length == 0) {
         this.$modal.msgWarning("请选中至少一条数据");
       } else {
-        let param = this.ids.join()
-        shutDownSummary(param).then(res => {
-          if (res.code === 200) {
-            this.$modal.msgSuccess("操作成功");
-            this.getList(this.queryParams)
-          }
+        console.log('选中数组', this.allSelection)
+        let item = this.allSelection.some(item => {
+          return item.demandNum >= 2
         })
+        if (item) {
+          this.$modal.confirm('选中项有多个需求单位,是否确定关闭?').then(function () {
+          }).then(() => {
+            this.closeitem()
+          }).catch(() => {})
+        } else {
+          this.closeitem()
+        }
       }
     },
     // 搜索区参照选择

+ 3 - 0
src/views/purchase/PurchaseDemandList/add.vue

@@ -767,6 +767,9 @@ export default {
           if (item.demandId) {
             delete item.demandId
           }
+          if (item.allotCode) {
+            delete item.allotCode
+          }
         })
       }
     },