Jelajahi Sumber

采购订单-组织修改之后清空数据

002390 1 tahun lalu
induk
melakukan
5ede9cdd30

+ 29 - 29
src/views/purchase/purchase-order/add/index.vue

@@ -390,37 +390,37 @@ export default {
         
       }
 
-      // // 组织
-      // if(type === 'ORG_PARAM'){
-
-      //     for (const key in this.params) {
-
-      //       // if (Array.isArray(this.params[key])) {
-      //       if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
-
-      //         this.params[key] = [];
-
-      //       }
-      //       else if(key === 'sysFileRecordList'){
-      //         this.params[key] = [];
-      //       }
-      //        else if (
-      //         key != "puOrg" &&
-      //         key != "puOrgName" &&
-      //         key != "buyer" &&
-      //         key != "buyerName" &&
-      //         key != "puDept" &&
-      //         key != "puDeptName" &&
-      //         key != "status" &&
-      //         key != "billDate" 
-      //       ) {
-      //         this.params[key] = "";
-      //       } else {
-      //       }
-      //     }
+      // 组织
+      if(type === 'ORG_PARAM'){
+
+          for (const key in this.params) {
+
+            // if (Array.isArray(this.params[key])) {
+            if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
+
+              this.params[key] = [];
+
+            }
+            else if(key === 'sysFileRecordList'){
+              this.params[key] = [];
+            }
+             else if (
+              key != "puOrg" &&
+              key != "puOrgName" &&
+              key != "buyer" &&
+              key != "buyerName" &&
+              key != "puDept" &&
+              key != "puDeptName" &&
+              key != "status" &&
+              key != "billDate" 
+            ) {
+              this.params[key] = "";
+            } else {
+            }
+          }
         
 
-      // }
+      }
     },
 
     // 下拉框选择改变

+ 5 - 3
src/views/purchase/purchase-order/edit/index.vue

@@ -60,8 +60,9 @@ export default {
     "params.billType":{
       handler(nVal, oVal){
 
-        if((nVal === '21-Cxx-02' || nVal === '21-Cxx-04'  || nVal === '21-Cxx-10' || nVal === '21-Cxx-14')){
-
+        let billList = ['21-Cxx-02','21-Cxx-04','21-Cxx-10','21-Cxx-14','21-Cxx-09','21-Cxx-17','21-Cxx-18'];
+        
+        if(billList.find(item => item === nVal)){
           this.rules.warehouseName = [
             { required: true, message: "WMS入库仓库不能为空", trigger: "change" },
           ];
@@ -73,9 +74,10 @@ export default {
           this.rules.warehouseName = null;
           this.rules.goodsAllocationName = null;
         }
+
         this.count++;
       }
-    },
+    }
   },
   methods: {
     setVisible(prop) {