Sfoglia il codice sorgente

修改审批逻辑/处理零售产品检索异常问题

lph 1 anno fa
parent
commit
0825281d3a

+ 24 - 22
zkqy-ui/src/views/orderMange/approve.vue

@@ -1320,6 +1320,8 @@ export default {
         if (valid) {
           let { status, orderType, saleLeader, finance, production } =
             this.approveForm;
+          let { salePayType } = this.formData;
+          // 付款方式  1:定金   2:赊欠
           let baseFormInfo = {
             saleLeader,
             finance,
@@ -1339,32 +1341,32 @@ export default {
               saleNo: this.approveNo,
             },
           };
+          payload.commMap = {
+            status,
+            saleApprover: this.nickName,
+            ...baseFormInfo,
+          };
           if (status == "7") {
             // 不通过
-            payload.commMap = {
-              status,
-              saleApprover: this.nickName,
-              ...baseFormInfo,
-            };
+            payload.commMap.status = status;
           } else {
             //通过
-            if (orderType == "2") {
-              //生产
-              payload.commMap = {
-                status: this.approveForm.status,
-                orderType,
-                saleApprover: this.nickName,
-                ...baseFormInfo,
-              };
-            } else if (orderType == "1") {
-              //库存
-              payload.commMap = {
-                // status: "5",
-                status: this.approveForm.status,
-                orderType,
-                saleApprover: this.nickName,
-                ...baseFormInfo,
-              };
+            if (salePayType == 1) {
+              // 定金
+              payload.commMap.status = 8;
+              payload.commMap.orderType = orderType;
+            } else {
+              // 赊欠
+
+              if (orderType == "2") {
+                //生产
+                payload.commMap.status = 3;
+                payload.commMap.orderType = orderType;
+              } else if (orderType == "1") {
+                //库存
+                payload.commMap.status = 5;
+                payload.commMap.orderType = orderType;
+              }
             }
           }
           let res = await batchEdit(payload);

+ 8 - 18
zkqy-ui/src/views/orderMange/retailMange/index.vue

@@ -1004,27 +1004,17 @@ export default {
       console.log(value);
       // row.productNo = value;
       if (value) {
-        let target = this.productionOptions.find((item) =>
+        let target = [];
+        // 在全部列表中查找
+        target = this.allProductionOptions.filter((item) =>
           item.productName.includes(value)
         );
         console.log(target);
-        if (target) {
-          this.productionOptions = [target];
-          //找到
+        if (target.length) {
+          this.productionOptions = target;
           return true;
         } else {
-          //前100个没找到
-          // 在全部列表中查找
-          target = this.allProductionOptions.find((item) =>
-            item.productName.includes(value)
-          );
-          console.log(target);
-          if (target) {
-            this.productionOptions = [target];
-            return true;
-          } else {
-            return false;
-          }
+          return false;
         }
       } else {
         this.productionOptions = this.allProductionOptions.slice(0, 500);
@@ -1539,7 +1529,7 @@ export default {
 
           await this.getDropDownData();
           this.productionTableData = sale_products.map((item) => {
-            item.productType = this.productionOptions.find(
+            item.productType = this.allProductionOptions.find(
               (i) => item.productNo == i.productNo
             )?.productType;
             return item;
@@ -2035,7 +2025,7 @@ export default {
         amountTotal += Number(item.productNumber);
         singlTotal += Number(item.productUnitPrice);
         moneyTotal += Number(item.productAmounts);
-        let productData = this.productionOptions.find(
+        let productData = this.allProductionOptions.find(
           (pro) => pro.productNo == item.productNo
         );
         item.sliceTypeLabel =