소스 검색

采购付款bug

cz 1 년 전
부모
커밋
23d364ff61
2개의 변경된 파일11개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 2
      src/views/processApproval/components/SendPurchase.vue
  2. 9 2
      src/views/processApproval/components/SendPurchasePayment.vue

+ 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();