cz 1 rok temu
rodzic
commit
874169de0a
1 zmienionych plików z 47 dodań i 31 usunięć
  1. 47 31
      src/views/WDLY/purchaseManage/payment/index.vue

+ 47 - 31
src/views/WDLY/purchaseManage/payment/index.vue

@@ -897,6 +897,7 @@ watch(selectData, (newVal, oldVal) => {
 });
 const handlePayment = (type, data) => {
   modalType.value = "add";
+  formOption.disabled = false;
   if (type === 10) {
     selectData.value = [data];
   } else if (type === 20) {
@@ -923,6 +924,7 @@ const handlePayment = (type, data) => {
 };
 
 const handleRefund = (row) => {
+  formOption.disabled = false;
   formData.dataOne = {
     type: "2",
     purchaseId: row.id,
@@ -1102,38 +1104,52 @@ const openFile = (item) => {
 };
 
 const handleGetDtl = (row) => {
-  modalType.value = "edit";
-  formOption.disabled = true;
-  dialogVisible.value = true;
-  proxy
-    .post("/purchasePayRecord/detail", {
-      id: row.purchasePayRecordId,
-    })
-    .then((res) => {
-      res.supplyName = currentRow.value.supplyName;
-      formData.data = res;
-      formData.data.purchasePayRecordDetailList =
-        formData.data.purchasePayRecordDetailList.map((x) => ({
-          ...x,
-          code: x.contractCode,
-          waitAmount: x.purchaseAmount,
-          alreadyAmount: x.paidAmount,
-        }));
+  if (row.type == "1") {
+    modalType.value = "edit";
+    formOption.disabled = true;
+    dialogVisible.value = true;
+    proxy
+      .post("/purchasePayRecord/detail", {
+        id: row.purchasePayRecordId,
+      })
+      .then((res) => {
+        res.supplyName = currentRow.value.supplyName;
+        formData.data = res;
+        formData.data.purchasePayRecordDetailList =
+          formData.data.purchasePayRecordDetailList.map((x) => ({
+            ...x,
+            code: x.contractCode,
+            waitAmount: x.purchaseAmount,
+            alreadyAmount: x.paidAmount,
+          }));
 
-      proxy
-        .post("/fileInfo/getList", {
-          businessIdList: [res.id],
-        })
-        .then((fileObj) => {
-          if (fileObj[res.id] && fileObj[res.id].length > 0) {
-            formData.data.fileList = fileObj[res.id].map((x) => ({
-              raw: x,
-              name: x.fileName,
-              url: x.fileUrl,
-            }));
-          }
-        });
-    });
+        proxy
+          .post("/fileInfo/getList", {
+            businessIdList: [res.id],
+          })
+          .then((fileObj) => {
+            if (fileObj[res.id] && fileObj[res.id].length > 0) {
+              formData.data.fileList = fileObj[res.id].map((x) => ({
+                raw: x,
+                name: x.fileName,
+                url: x.fileUrl,
+              }));
+            }
+          });
+      });
+  } else {
+    modalType.value = "edit";
+    formOption.disabled = true;
+    dialogVisibleTwo.value = true;
+    proxy
+      .post("/purchaseRefundRecord/detail", {
+        id: row.id,
+      })
+      .then((res) => {
+        res.supplyName = currentRow.value.supplyName;
+        formData.dataOne = res;
+      });
+  }
 };
 
 const deriveExcel = () => {