Browse Source

样品单详情窗口接口

cz 1 year ago
parent
commit
cbfc48867e

+ 9 - 3
src/components/PDF/contractPDFOne.vue

@@ -1,6 +1,11 @@
 <template>
   <div>
-    <div id="pdfDom" ref="pdfDom" style="padding: 30px 60px">
+    <div
+      id="pdfDom"
+      ref="pdfDom"
+      style="padding: 30px 60px"
+      v-loading="loading"
+    >
       <table border="1" style="width: 100%" class="table">
         <tr>
           <td style="width: 120px">
@@ -280,11 +285,11 @@ const pdfData = ref({});
 const props = defineProps({
   rowData: Object,
 });
-
+const loading = ref(false);
 const getPdfData = (query) => {
+  loading.value = true;
   proxy.post("/contract/getContractPdfInfo", query).then((res) => {
     pdfData.value = res;
-    console.log(res, "daada");
     if (pdfData.value.advanceRatio) {
       pdfData.value.advanceRatio = parseFloat(
         pdfData.value.advanceRatio
@@ -319,6 +324,7 @@ const getPdfData = (query) => {
             });
         });
     }
+    loading.value = false;
     // 拿取产品图
     if (
       pdfData.value.productInfoList &&

+ 4 - 2
src/components/PDF/purchasePDFOne.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <div id="pdfDom" ref="pdfDom" style="width: 840px">
+    <div id="pdfDom" ref="pdfDom" style="width: 840px" v-loading="loading">
       <div style="display: flex; align-items: center">
         <div>
           <img
@@ -260,6 +260,7 @@ const pdfData = ref({});
 const props = defineProps({
   rowData: Object,
 });
+const loading = ref(false);
 const fundsPaymentMethod = ref([]);
 proxy.getDictOne(["unit", "funds_payment_method"]).then((res) => {
   fundsPaymentMethod.value = res["funds_payment_method"].map((x) => ({
@@ -276,9 +277,9 @@ const getHtml = (str) => {
 };
 
 const handlePrintPdf = (row) => {
+  loading.value = true;
   proxy.post("/ehsdPurchase/detail", { id: row.id }).then((res) => {
     pdfData.value = res;
-    console.log(res, "ada");
     // 拿去多公司配置的logo图
     if (pdfData.value.buyCorporationId) {
       proxy
@@ -294,6 +295,7 @@ const handlePrintPdf = (row) => {
             });
         });
     }
+    loading.value = false;
     // 拿取产品图
     let arr = [];
     for (let i = 0; i < pdfData.value.ehsdPurchaseProductList.length; i++) {

+ 11 - 6
src/components/PDF/samplePDF.vue

@@ -1,6 +1,11 @@
 <template>
   <div>
-    <div id="pdfDom" ref="pdfDom" style="padding: 30px 60px">
+    <div
+      id="pdfDom"
+      ref="pdfDom"
+      style="padding: 30px 60px"
+      v-loading="loading"
+    >
       <table border="1" style="width: 100%" class="table">
         <tr>
           <td style="width: 120px">
@@ -190,9 +195,10 @@ const pdfData = ref({});
 const props = defineProps({
   rowData: Object,
 });
+const loading = ref(false);
 const getPdfData = (query) => {
+  loading.value = true;
   proxy.post("/sample/getSamplePdfInfo", query).then((res) => {
-    console.log(res, "ada");
     pdfData.value = res;
     if (pdfData.value.sellCorporationId) {
       proxy
@@ -208,6 +214,7 @@ const getPdfData = (query) => {
             });
         });
     }
+    loading.value = false;
     // 拿取产品图
     if (
       pdfData.value.productInfoList &&
@@ -235,11 +242,9 @@ const getPdfData = (query) => {
     }
   });
 };
-// if (props.rowData && props.rowData.id) {
-//   getPdfData({ id: props.rowData.id });
-// }
+
 watch(
-  props.rowData,
+  () => props.rowData,
   () => {
     if (props.rowData.id) {
       getPdfData({ id: props.rowData.id });

+ 1 - 1
src/components/contractCom/contractDetails.vue

@@ -223,7 +223,7 @@ getDetailsData();
 .content-box {
   display: flex;
   .left {
-    width: 120px;
+    width: 130px;
     // background: #ccc;
     .left-item {
       height: 36px;

+ 16 - 30
src/components/contractCom/contractDetailsOne.vue

@@ -80,7 +80,7 @@ import SamplePDF from "@/components/PDF/samplePDF.vue";
 import byTable from "@/components/byTable/index";
 const { proxy } = getCurrentInstance();
 const props = defineProps({
-  contractId: String,
+  sampleId: String,
   code: String,
 });
 const activeName = ref("first");
@@ -88,7 +88,7 @@ const currentItem = ref({});
 const rowData = ref({});
 const rowDataOne = ref({});
 const leftList = ref([]);
-const contractDataList = ref([]);
+const sampleDataList = ref([]);
 const purchaseDataList = ref([]);
 const tableData = ref([]);
 const transactionType = ref([
@@ -186,12 +186,7 @@ const pushProcessApproval = (row) => {
 };
 const handleChange = (val) => {
   if (val === "first") {
-    // leftList.value = contractDataList.value;
-    leftList.value = [
-      {
-        id: props.contractId,
-      },
-    ];
+    leftList.value = sampleDataList.value;
   }
   if (val === "second") {
     leftList.value = purchaseDataList.value;
@@ -200,46 +195,37 @@ const handleChange = (val) => {
     handleItemClick(leftList.value[0]);
   }
 };
-if (props.contractId) {
-  leftList.value = [
-    {
-      id: props.contractId,
-    },
-  ];
-  handleItemClick(leftList.value[0]);
-}
+
 const getDetailsData = () => {
+  proxy.post("/sample/getVersionList", { id: props.sampleId }).then((res) => {
+    sampleDataList.value = res;
+    leftList.value = sampleDataList.value;
+    if (sampleDataList.value && sampleDataList.value.length > 0) {
+      handleItemClick(sampleDataList.value[0]);
+    }
+  });
   proxy
-    .post("/contract/getVersionList", { id: props.contractId })
-    .then((res) => {
-      contractDataList.value = res;
-      leftList.value = contractDataList.value;
-      if (contractDataList.value && contractDataList.value.length > 0) {
-        handleItemClick(contractDataList.value[0]);
-      }
-    });
-  proxy
-    .post("/contract/getPurchaseListByContractId", { id: props.contractId })
+    .post("/sample/getPurchaseListBySampleId", { id: props.sampleId })
     .then((res) => {
       purchaseDataList.value = res;
     });
 
   proxy
-    .post("/contract/getAccountRunningWaterByContractId", {
-      id: props.contractId,
+    .post("/sample/getAccountRunningWaterBySampleId", {
+      id: props.sampleId,
     })
     .then((res) => {
       tableData.value = res;
     });
 };
-// getDetailsData();
+getDetailsData();
 </script>
 
 <style lang="scss" scoped>
 .content-box {
   display: flex;
   .left {
-    width: 120px;
+    width: 130px;
     // background: #ccc;
     .left-item {
       height: 36px;

+ 3 - 3
src/views/EHSD/saleContract/sampleEHSD/index.vue

@@ -153,7 +153,7 @@
       width="1100"
     >
       <ContractDetailsOne
-        :contractId="currentContractId"
+        :sampleId="currentSampleId"
         :code="currentCode"
       ></ContractDetailsOne>
     </el-dialog>
@@ -744,10 +744,10 @@ const tagClose = (val, item) => {
   });
 };
 
-const currentContractId = ref("");
+const currentSampleId = ref("");
 const currentCode = ref("");
 const openDetails = (row) => {
-  currentContractId.value = row.id;
+  currentSampleId.value = row.id;
   currentCode.value = row.code;
   openDetailsDialog.value = true;
 };