lxf 1 жил өмнө
parent
commit
af18c98c83

+ 35 - 15
src/components/PDF/contractPDF.vue

@@ -6,7 +6,7 @@
           {{ printDetails.sellCorporationNameEn }}
         </div>
         <div style="text-align: center">
-          {{ printDetails.sellCountryName }},{{ printDetails.sellProvinceName }},{{ printDetails.sellCityName }},{{ printDetails.sellDetailedAddress }}
+          {{ printDetails.sellDetailedAddress }},{{ printDetails.sellCityName }},{{ printDetails.sellProvinceName }},{{ printDetails.sellCountryName }}
         </div>
         <div style="font-size: 14px; color: #409eff; text-align: center; padding-top: 16px">PROFORMA INVOICE</div>
         <div style="padding-top: 8px">
@@ -18,7 +18,7 @@
             <div style="color: #409eff">VENDOR:</div>
             <div>{{ printDetails.sellCorporationNameEn }}</div>
             <div style="padding: 16px 0">
-              {{ printDetails.sellCountryName }},{{ printDetails.sellProvinceName }},{{ printDetails.sellCityName }},{{ printDetails.sellDetailedAddress }}
+              {{ printDetails.sellDetailedAddress }},{{ printDetails.sellCityName }},{{ printDetails.sellProvinceName }},{{ printDetails.sellCountryName }}
             </div>
             <div>CONTACT: {{ printDetails.sellContactName }}</div>
             <div>TEL.: {{ printDetails.sellContactNumber }}</div>
@@ -188,15 +188,15 @@
 </template>
 
 <script setup>
+import { NumberToChinese } from "@/utils/util.js";
 import { watch } from "vue";
-
 const { proxy } = getCurrentInstance();
 const printDetails = ref({});
 const props = defineProps({
   rowData: Object,
 });
-const getPdfData = (query) => {
-  proxy.post("/contract/getContractPdfInfo", query).then((res) => {
+const getPdfData = (row) => {
+  proxy.post("/contract/getContractPdfInfo", { id: row.id }).then((res) => {
     printDetails.value = res;
   });
 };
@@ -222,18 +222,38 @@ const statisticsTwo = (label, index) => {
   }
   return num;
 };
+
+if (props.rowData && props.rowData.id) {
+  getPdfData(props.rowData);
+}
+
+const productUnit = ref([]);
+const tradeMethods = ref([]);
+const shippingMethod = ref([]);
+
+const getDict = () => {
+  proxy.getDictOne(["trade_mode", "shipping_method", "unit"]).then((res) => {
+    tradeMethods.value = res["trade_mode"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+    shippingMethod.value = res["shipping_method"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+};
+getDict();
 watch(
-  props.rowData,
-  () => {
-    if (props.rowData.id) {
-      getPdfData({ id: props.rowData.id });
-    } else if (props.rowData.code) {
-      getPdfData({ code: props.rowData.code });
+  () => props.rowData.id,
+  (val) => {
+    if (props.rowData && props.rowData.id) {
+      getPdfData(props.rowData);
     }
-  },
-  {
-    immediate: true,
-    deep: true,
   }
 );
 </script>

+ 21 - 3
src/components/process/PurchasePayment.vue

@@ -452,6 +452,24 @@ watch(
       } else {
         fileList.value = [];
       }
+      if (route.query.processType !== "30" && formData.data.payDetailList && formData.data.payDetailList.length) {
+        let ids = formData.data.payDetailList.map((item) => item.purchaseId);
+        if (ids && ids.length > 0) {
+          proxy.post("/purchase/getListInId", ids).then((res) => {
+            if (res && res.length > 0) {
+              contractList.value = res.map((item) => {
+                return {
+                  value: item.id,
+                  label: item.code,
+                };
+              });
+            } else {
+              contractList.value = [];
+            }
+          });
+        }
+      }
+      getDecisionAids();
     }
   },
   {
@@ -459,9 +477,9 @@ watch(
   }
 );
 onMounted(async () => {
-  if (props.queryData.supplyId) {
-    formData.data.supplyId = props.queryData.supplyId;
-    await changeSupply(formData.data.supplyId);
+  if (props.queryData.supplyIdTwo) {
+    formData.data.supplyIdTwo = props.queryData.supplyIdTwo;
+    await changeSupply(formData.data.supplyIdTwo);
     if (props.queryData.ids) {
       let ids = props.queryData.ids.split(",");
       if (ids && ids.length > 0) {

+ 1 - 1
src/views/purchaseManage/purchasePayment/paymentBill/index.vue

@@ -220,7 +220,7 @@ const start = () => {
       query: {
         flowKey: "pay_flow",
         flowName: "采购付款申请",
-        supplyId: selectData.value[0].supplyId,
+        supplyIdTwo: selectData.value[0].supplyId,
         ids,
         random: proxy.random(),
       },