cz 1 年之前
父節點
當前提交
3288ef5c0b
共有 1 個文件被更改,包括 126 次插入55 次删除
  1. 126 55
      src/views/salesMange/saleContract/contract/index.vue

+ 126 - 55
src/views/salesMange/saleContract/contract/index.vue

@@ -14,10 +14,15 @@
             action: () => newContract(),
           },
         ]"
-        @get-list="getList">
+        @get-list="getList"
+      >
         <template #code="{ item }">
           <div style="width: 100%">
-            <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="openDetails(item)">{{ item.code }}</a>
+            <a
+              style="color: #409eff; cursor: pointer; word-break: break-all"
+              @click="openDetails(item)"
+              >{{ item.code }}</a
+            >
           </div>
         </template>
         <template #amount="{ item }">
@@ -35,17 +40,45 @@
           <div>
             <el-popover :width="400" trigger="hover" @show="recordShow(item)">
               <template #reference>
-                <a style="color: #409eff; cursor: pointer; word-break: break-all">{{ moneyFormat(item.sumClaimMoney, 2) }}</a>
+                <a
+                  style="color: #409eff; cursor: pointer; word-break: break-all"
+                  >{{ moneyFormat(item.sumClaimMoney, 2) }}</a
+                >
               </template>
               <template #default>
-                <div style="width: 100%; max-height: 60vh; overflow-y: auto; overflow-x: hidden" v-if="item.claimRecord && item.claimRecord.length > 0">
-                  <div v-for="(record, index) in item.claimRecord" :key="index" style="margin-bottom: 20px">
+                <div
+                  style="
+                    width: 100%;
+                    max-height: 60vh;
+                    overflow-y: auto;
+                    overflow-x: hidden;
+                  "
+                  v-if="item.claimRecord && item.claimRecord.length > 0"
+                >
+                  <div
+                    v-for="(record, index) in item.claimRecord"
+                    :key="index"
+                    style="margin-bottom: 20px"
+                  >
                     <div style="display: flex; justify-content: space-between">
-                      <span style="color: #909399">{{ record.createTime }}</span>
-                      <span style="color: #909399">{{ dictValueLabel(record.createUser, userList) }}</span>
+                      <span style="color: #909399">{{
+                        record.createTime
+                      }}</span>
+                      <span style="color: #909399">{{
+                        dictValueLabel(record.createUser, userList)
+                      }}</span>
                     </div>
-                    <div style="display: flex; justify-content: space-between; padding: 8px 0">
-                      <span>认领金额: {{ record.currency }} {{ record.money }}</span>
+                    <div
+                      style="
+                        display: flex;
+                        justify-content: space-between;
+                        padding: 8px 0;
+                      "
+                    >
+                      <span
+                        >认领金额: {{ record.currency }}
+                        {{ record.money }}</span
+                      >
                       <span>汇率: {{ record.rate }}</span>
                     </div>
                   </div>
@@ -64,16 +97,23 @@
             <span v-if="item.refundStatus && item.refundStatus !== 0">
               {{ dictValueLabel(item.refundStatus, refundStatusNew) }}
             </span>
-            <span v-else>{{ dictValueLabel(item.refundStatusNew, refundStatusNew) }}</span>
+            <span v-else>{{
+              dictValueLabel(item.refundStatusNew, refundStatusNew)
+            }}</span>
           </div>
         </template>
         <template #status="{ item }">
           <div>
-            <span :style="getStyle(item.status)">{{ dictValueLabel(item.status, status) }}</span>
+            <span :style="getStyle(item.status)">{{
+              dictValueLabel(item.status, status)
+            }}</span>
           </div>
         </template>
         <template #buyCorporationId="{ item }">
-          <div style="cursor: pointer; color: #409eff; word-break: break-all" @click="handleClickName(item)">
+          <div
+            style="cursor: pointer; color: #409eff; word-break: break-all"
+            @click="handleClickName(item)"
+          >
             {{ item.buyCorporationName }}
           </div>
         </template>
@@ -85,11 +125,18 @@
       <template #footer>
         <el-button @click="openPrint = false" size="large">取消</el-button>
         <el-button v-print="printObj" size="large">打印</el-button>
-        <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
+        <el-button type="primary" @click="clickDownload()" size="large"
+          >下载PDF</el-button
+        >
       </template>
     </el-dialog>
 
-    <el-dialog title="合同详情" v-if="openDetailsDialog" v-model="openDetailsDialog" width="1100">
+    <el-dialog
+      title="合同详情"
+      v-if="openDetailsDialog"
+      v-model="openDetailsDialog"
+      width="1100"
+    >
       <ContractDetails :contractId="currentContractId"></ContractDetails>
     </el-dialog>
   </div>
@@ -325,10 +372,12 @@ const config = computed(() => {
                     cancelButtonText: "取消",
                     type: "warning",
                   }).then(() => {
-                    proxy.post("/contract/edit", { id: row.id, issue: 1 }).then(() => {
-                      ElMessage({ message: "下发成功", type: "success" });
-                      getList();
-                    });
+                    proxy
+                      .post("/contract/edit", { id: row.id, issue: 1 })
+                      .then(() => {
+                        ElMessage({ message: "下发成功", type: "success" });
+                        getList();
+                      });
                   });
                 },
               }
@@ -391,38 +440,46 @@ const config = computed(() => {
   ];
 });
 const getDict = () => {
-  proxy.getDictOne(["contract_type", "account_currency", "trade_mode", "shipping_method", "unit"]).then((res) => {
-    if (res.contract_type && res.contract_type.length > 0) {
-      contractType.value = res.contract_type.map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
-    }
-    if (res.account_currency && res.account_currency.length > 0) {
-      accountCurrency.value = res.account_currency.map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
-    }
-    if (res.trade_mode && res.trade_mode.length > 0) {
-      tradeMethods.value = res.trade_mode.map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
-    }
-    if (res.shipping_method && res.shipping_method.length > 0) {
-      shippingMethod.value = res.shipping_method.map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
-    }
-    if (res.unit && res.unit.length > 0) {
-      productUnit.value = res.unit.map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
-    }
-  });
+  proxy
+    .getDictOne([
+      "contract_type",
+      "account_currency",
+      "trade_mode",
+      "shipping_method",
+      "unit",
+    ])
+    .then((res) => {
+      if (res.contract_type && res.contract_type.length > 0) {
+        contractType.value = res.contract_type.map((x) => ({
+          label: x.dictValue,
+          value: x.dictKey,
+        }));
+      }
+      if (res.account_currency && res.account_currency.length > 0) {
+        accountCurrency.value = res.account_currency.map((x) => ({
+          label: x.dictValue,
+          value: x.dictKey,
+        }));
+      }
+      if (res.trade_mode && res.trade_mode.length > 0) {
+        tradeMethods.value = res.trade_mode.map((x) => ({
+          label: x.dictValue,
+          value: x.dictKey,
+        }));
+      }
+      if (res.shipping_method && res.shipping_method.length > 0) {
+        shippingMethod.value = res.shipping_method.map((x) => ({
+          label: x.dictValue,
+          value: x.dictKey,
+        }));
+      }
+      if (res.unit && res.unit.length > 0) {
+        productUnit.value = res.unit.map((x) => ({
+          label: x.dictValue,
+          value: x.dictKey,
+        }));
+      }
+    });
   proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
     corporationList.value = res.rows.map((item) => {
       return {
@@ -519,7 +576,10 @@ const clickDownload = () => {
 };
 const statistics = (label, index) => {
   let num = 0;
-  if (printDetails.value.productInfoList && printDetails.value.productInfoList.length > 0) {
+  if (
+    printDetails.value.productInfoList &&
+    printDetails.value.productInfoList.length > 0
+  ) {
     printDetails.value.productInfoList.map((item) => {
       if (item[label]) {
         num = parseFloat(Number(num) + Number(item[label])).toFixed(index);
@@ -530,7 +590,10 @@ const statistics = (label, index) => {
 };
 const statisticsTwo = (label, index) => {
   let num = 0;
-  if (printDetails.value.contractProjectList && printDetails.value.contractProjectList.length > 0) {
+  if (
+    printDetails.value.contractProjectList &&
+    printDetails.value.contractProjectList.length > 0
+  ) {
     printDetails.value.contractProjectList.map((item) => {
       if (item[label]) {
         num = parseFloat(Number(num) + Number(item[label])).toFixed(index);
@@ -541,8 +604,15 @@ const statisticsTwo = (label, index) => {
 };
 const computeScale = (item) => {
   let text = 0;
-  if (item.sumClaimMoney && Number(item.sumClaimMoney) > 0 && item.amountCNY && Number(item.amountCNY) > 0) {
-    text = parseFloat((Number(item.sumClaimMoney) / Number(item.amountCNY)) * 100).toFixed(2);
+  if (
+    item.sumClaimMoney &&
+    Number(item.sumClaimMoney) > 0 &&
+    item.amountCNY &&
+    Number(item.amountCNY) > 0
+  ) {
+    text = parseFloat(
+      (Number(item.sumClaimMoney) / Number(item.amountCNY)) * 100
+    ).toFixed(2);
   }
   return text + "%";
 };
@@ -572,7 +642,8 @@ const openDetails = (row) => {
 const printObj = ref({
   id: "printMe",
   popTitle: "",
-  extraCss: "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
+  extraCss:
+    "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
   extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
 });
 const clickAlteration = (row) => {