Bladeren bron

【采购订单维护】编辑 非手工 数量为0 不允许删行

002390 1 jaar geleden
bovenliggende
commit
fc11208bb6
1 gewijzigde bestanden met toevoegingen van 27 en 24 verwijderingen
  1. 27 24
      src/views/purchase/purchase-order/edit/index.vue

+ 27 - 24
src/views/purchase/purchase-order/edit/index.vue

@@ -287,35 +287,38 @@ export default {
       if (prop.length === 1) {
         this.$alert("订单行不允许为空", "提示", {
           confirmButtonText: "确定",
-          callback: (action) => {
-            // this.$message({
-            //   type: 'info',
-            //   message: `action: ${ action }`
-            // });
-          },
+          callback: (action) => {},
         });
-      } else {
-        for (const key in this.params) {
-          // if (key === "puOrderItemList" || key === "puOrderExecuteList") {
-          if (key === "puOrderItemList") {
-            this.params[key].forEach((item, index) => {
-              let flag = key === "puOrderItemList" ? "rowNo" : "rowno";
+        return;
+      }
 
-              if (item[flag] && item[flag] === row[delNo]) {
-                item.id
-                  ? (item["delFlag"] = "2")
-                  : this.params[key].splice(index, 1);
-              }
-            });
+      // 编辑  非手工 数量为0  不允许删除
+      const { source } = this.params;
+      if (!this.handleIsRevise() && source != "3" && row.qty == 0) {
+        this.$notify.warning("数量为0,不可删除当前行");
+        return;
+      }
 
-            // this.params[key][index].id ?
-            //   (this.params[key][index]['delFlag'] = '2') :
-            //   this.params[key].splice(index, 1);
-          }
-        }
+      for (const key in this.params) {
+        // if (key === "puOrderItemList" || key === "puOrderExecuteList") {
+        if (key === "puOrderItemList") {
+          this.params[key].forEach((item, index) => {
+            let flag = key === "puOrderItemList" ? "rowNo" : "rowno";
 
-        await this.handleGetPrice();
+            if (item[flag] && item[flag] === row[delNo]) {
+              item.id
+                ? (item["delFlag"] = "2")
+                : this.params[key].splice(index, 1);
+            }
+          });
+
+          // this.params[key][index].id ?
+          //   (this.params[key][index]['delFlag'] = '2') :
+          //   this.params[key].splice(index, 1);
+        }
       }
+
+      await this.handleGetPrice();
     },
     // 取消
     handleCancel() {