Переглянути джерело

Merge branch 'stag' into dev

lxf 1 рік тому
батько
коміт
c56dabc156

+ 25 - 11
src/views/processApproval/components/Contract.vue

@@ -721,17 +721,6 @@ const getDict = () => {
       });
     }
   });
-  proxy.post("/customer/privateSeaPage", { pageNum: 1, pageSize: 999 }).then((res) => {
-    if (res.data.rows && res.data.rows.length > 0) {
-      formConfig[9].data = res.data.rows.map((item) => {
-        return {
-          ...item,
-          label: item.name,
-          value: item.id,
-        };
-      });
-    }
-  });
   proxy.post("/productInfo/page", { pageNum: 1, pageSize: 9999, definition: "1" }).then((res) => {
     if (res.data.rows && res.data.rows.length > 0) {
       formGoodsOption.btnConfig.listConfig[0].data = res.data.rows.map((item) => {
@@ -875,6 +864,31 @@ let status = ref(true);
 watch(
   refProps.queryData,
   () => {
+    if (["10", "20"].includes(route.query.processType)) {
+      proxy.post("/customer/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+        if (res.data.rows && res.data.rows.length > 0) {
+          formConfig[9].data = res.data.rows.map((item) => {
+            return {
+              ...item,
+              label: item.name,
+              value: item.id,
+            };
+          });
+        }
+      });
+    } else {
+      proxy.post("/customer/privateSeaPage", { pageNum: 1, pageSize: 999 }).then((res) => {
+        if (res.data.rows && res.data.rows.length > 0) {
+          formConfig[9].data = res.data.rows.map((item) => {
+            return {
+              ...item,
+              label: item.name,
+              value: item.id,
+            };
+          });
+        }
+      });
+    }
     if (refProps.queryData.value && ["10", "20", "30"].includes(route.query.processType)) {
       for (const key in refProps.queryData.value) {
         formData.data[key] = refProps.queryData.value[key];

+ 25 - 11
src/views/processApproval/components/PriceSheet.vue

@@ -617,17 +617,6 @@ const getDict = () => {
       });
     }
   });
-  proxy.post("/customer/privateSeaPage", { pageNum: 1, pageSize: 999 }).then((res) => {
-    if (res.data.rows && res.data.rows.length > 0) {
-      formConfig[8].data = res.data.rows.map((item) => {
-        return {
-          ...item,
-          label: item.name,
-          value: item.id,
-        };
-      });
-    }
-  });
   proxy.post("/productInfo/page", { pageNum: 1, pageSize: 9999, definition: "1" }).then((res) => {
     if (res.data.rows && res.data.rows.length > 0) {
       formGoodsOption.btnConfig.listConfig[0].data = res.data.rows.map((item) => {
@@ -762,6 +751,31 @@ const status = ref(false);
 watch(
   refProps.queryData,
   () => {
+    if (["10", "20"].includes(route.query.processType)) {
+      proxy.post("/customer/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+        if (res.data.rows && res.data.rows.length > 0) {
+          formConfig[8].data = res.data.rows.map((item) => {
+            return {
+              ...item,
+              label: item.name,
+              value: item.id,
+            };
+          });
+        }
+      });
+    } else {
+      proxy.post("/customer/privateSeaPage", { pageNum: 1, pageSize: 999 }).then((res) => {
+        if (res.data.rows && res.data.rows.length > 0) {
+          formConfig[8].data = res.data.rows.map((item) => {
+            return {
+              ...item,
+              label: item.name,
+              value: item.id,
+            };
+          });
+        }
+      });
+    }
     if (refProps.queryData.value && ["10", "20", "30"].includes(route.query.processType)) {
       for (const key in refProps.queryData.value) {
         formData.data[key] = refProps.queryData.value[key];

+ 2 - 2
src/views/processApproval/components/SendPurchase.vue

@@ -298,12 +298,12 @@ const changeAmount = () => {
     const e = formData.value.purchaseDetailList[i];
     e.amount = (e.count * e.price).toFixed(2);
   }
-  formData.value.amount = formData.value.purchaseDetailList.reduce(
+  formData.value.amount = (formData.value.purchaseDetailList.reduce(
     (total, item) => {
       return total + Number(item.amount);
     },
     0
-  );
+  )).toFixed(2)
 };
 
 const getDetails = (id) => {

+ 9 - 2
src/views/processApproval/components/SendPurchasePayment.vue

@@ -398,7 +398,7 @@ const accountList = ref([]);
 const invoiceType = ref([]);
 const fundsPaymentMethod = ref([]);
 const contractList = ref([]);
-const changeSupply = (val) => {
+const changeSupply = (val, flag) => {
   if (val) {
     proxy.get("/purchase/getListBySupplyId", { supplyId: val }).then((res) => {
       if (res.data && res.data.length > 0) {
@@ -419,6 +419,9 @@ const changeSupply = (val) => {
   } else {
     contractList.value = [];
   }
+  if (flag) {
+    return;
+  }
   formData.data.payDetailList = [];
 };
 const changeMoney = () => {
@@ -545,7 +548,7 @@ const handleSubmit = async () => {
     return { ...formData.data };
   }
 };
-
+const requestNum = ref(1);
 watch(
   refProps.queryData,
   (val) => {
@@ -555,6 +558,10 @@ watch(
       route.query.processType == 30
     ) {
       formData.data = refProps.queryData.value;
+      if (formData.data.supplyId && requestNum.value === 1) {
+        changeSupply(formData.data.supplyId, true);
+        requestNum.value++;
+      }
       formDom.value.formDataShowLabelOne();
       formDom.value.formDataListShowLabelOne();
       formDomOne.value.formDataShowLabelOne();