ソースを参照

部分0.5需求

cz 1 年間 前
コミット
77ddfafe68

+ 408 - 0
src/components/PDF/contractPDF.vue

@@ -0,0 +1,408 @@
+<template>
+  <div>
+    <div id="printMe">
+      <div
+        id="pdfDom"
+        style="width: 800px; padding: 16px; font-size: 12px !important"
+      >
+        <div style="font-size: 18px; text-align: center">
+          {{ printDetails.sellCorporationNameEn }}
+        </div>
+        <div style="text-align: center">
+          {{ printDetails.sellCountryName }},{{
+            printDetails.sellProvinceName
+          }},{{ printDetails.sellCityName }},{{
+            printDetails.sellDetailedAddress
+          }}
+        </div>
+        <div
+          style="
+            font-size: 14px;
+            color: #409eff;
+            text-align: center;
+            padding-top: 16px;
+          "
+        >
+          PROFORMA INVOICE
+        </div>
+        <div style="padding-top: 8px">
+          <div>PI NO. : {{ printDetails.contractCode }}</div>
+          <div>PI DATE: {{ printDetails.createTimeEn }}</div>
+        </div>
+        <div style="border: 1px solid black; display: flex">
+          <div style="width: 50%; border-right: 1px solid black">
+            <div style="color: #409eff">VENDOR:</div>
+            <div>{{ printDetails.sellCorporationNameEn }}</div>
+            <div style="padding: 16px 0">
+              {{ printDetails.sellCountryName }},{{
+                printDetails.sellProvinceName
+              }},{{ printDetails.sellCityName }},{{
+                printDetails.sellDetailedAddress
+              }}
+            </div>
+            <div>CONTACT: {{ printDetails.sellContactName }}</div>
+            <div>TEL.: {{ printDetails.sellContactNumber }}</div>
+          </div>
+          <div style="width: 50%">
+            <div style="color: #409eff">BUYER:</div>
+            <div>{{ printDetails.buyCorporationName }}</div>
+            <div style="padding: 16px 0">
+              {{ printDetails.buyDetailedAddress }},{{
+                printDetails.buyCityName
+              }},{{ printDetails.buyProvinceName }},{{
+                printDetails.buyCountryName
+              }}
+            </div>
+            <div>CONTACT: {{ printDetails.buyContactName }}</div>
+            <div>TEL.: {{ printDetails.buyContactNumber }}</div>
+          </div>
+        </div>
+        <div style="height: 16px"></div>
+        <div style="border: 1px solid black">
+          <div style="display: flex; width: 100%">
+            <div
+              style="
+                width: 33%;
+                border-bottom: 1px solid black;
+                border-right: 1px solid black;
+              "
+            >
+              <div style="color: #409eff">COUNTRY OF ORIGIN:</div>
+              <div>{{ printDetails.sellCountryName }}</div>
+            </div>
+            <div
+              style="
+                width: 34%;
+                border-bottom: 1px solid black;
+                border-right: 1px solid black;
+              "
+            >
+              <div style="color: #409eff">COUNTRY OF DESTINATION:</div>
+              <div>{{ printDetails.buyCountryName }}</div>
+            </div>
+            <div style="width: 33%; border-bottom: 1px solid black">
+              <div style="color: #409eff">PLACE OF DISCHARGE:</div>
+              <div>{{ printDetails.transportRemark }}</div>
+            </div>
+          </div>
+          <div style="display: flex; width: 100%">
+            <div
+              style="
+                width: 33%;
+                border-bottom: 1px solid black;
+                border-right: 1px solid black;
+              "
+            >
+              <div style="color: #409eff">TERMS OF DELIVERY:</div>
+              <div>
+                {{ dictValueLabel(printDetails.tradeMethods, tradeMethods) }}
+              </div>
+            </div>
+            <div
+              style="
+                width: 34%;
+                border-bottom: 1px solid black;
+                border-right: 1px solid black;
+              "
+            >
+              <div style="color: #409eff">CURRENCY:</div>
+              <div>
+                {{ printDetails.currency }}
+              </div>
+            </div>
+            <div style="width: 33%; border-bottom: 1px solid black">
+              <div style="color: #409eff">EXPORT BY/VIA:</div>
+              <div>
+                {{
+                  dictValueLabel(printDetails.transportMethod, shippingMethod)
+                }}
+              </div>
+            </div>
+          </div>
+          <div style="display: flex; width: 100%">
+            <div style="width: 33%; border-right: 1px solid black">
+              <div style="color: #409eff">DELIVERY TIME:</div>
+              <div>{{ printDetails.deliveryTime }}</div>
+            </div>
+            <div style="width: 67%">
+              <div style="color: #409eff">TERMS OF PAYMENT:</div>
+              <div>{{ printDetails.remark }}</div>
+            </div>
+          </div>
+        </div>
+        <div style="height: 16px"></div>
+        <div class="baseRow" style="display: flex; color: #409eff">
+          <div class="contentRow" style="width: 50px; text-align: center">
+            NO.
+          </div>
+          <div
+            class="contentRow"
+            style="width: calc(100% - 450px); text-align: center"
+          >
+            COMMODITY, SPECIFICATION
+          </div>
+          <div class="contentRow" style="width: 100px; text-align: center">
+            UNIT
+          </div>
+          <div class="contentRow" style="width: 100px; text-align: center">
+            QUANTITY
+          </div>
+          <div class="contentRow" style="width: 100px; text-align: center">
+            UNIT PRICE
+          </div>
+          <div class="contentRow" style="width: 100px; text-align: center">
+            TOTAL PRICE
+          </div>
+        </div>
+        <div
+          v-if="
+            printDetails.productInfoList &&
+            printDetails.productInfoList.length > 0
+          "
+        >
+          <div
+            class="baseRow"
+            style="display: flex"
+            v-for="(item, index) in printDetails.productInfoList"
+            :key="item.productId"
+          >
+            <div class="contentRow" style="width: 50px; text-align: center">
+              {{ index + 1 }}
+            </div>
+            <div
+              class="contentRow"
+              style="width: calc(100% - 450px); text-align: center"
+            >
+              {{ item.productName }}
+            </div>
+            <div class="contentRow" style="width: 100px; text-align: center">
+              {{ dictValueLabel(item.productUnit, productUnit) }}
+            </div>
+            <div class="contentRow" style="width: 100px; text-align: center">
+              {{ item.productQuantity }}
+            </div>
+            <div class="contentRow" style="width: 100px; text-align: center">
+              {{ item.productPrice }}
+            </div>
+            <div class="contentRow" style="width: 100px; text-align: center">
+              {{ item.amount }}
+            </div>
+          </div>
+        </div>
+        <div class="baseRow" style="display: flex; color: #409eff">
+          <div
+            class="contentRow"
+            style="width: calc(100% - 400px); text-align: center"
+          >
+            SUBTOTAL:
+          </div>
+          <div
+            class="contentRow"
+            style="width: 100px; text-align: center"
+          ></div>
+          <div class="contentRow" style="width: 100px; text-align: center">
+            {{ statistics("productQuantity", 0) }}
+          </div>
+          <div
+            class="contentRow"
+            style="width: 100px; text-align: center"
+          ></div>
+          <div class="contentRow" style="width: 100px; text-align: center">
+            {{ statistics("amount", 2) }}
+          </div>
+        </div>
+        <!-- <div v-if="printDetails.quotationPayList && printDetails.quotationPayList.length > 0">
+            <div class="baseRow" style="display: flex" v-for="(item, index) in printDetails.quotationPayList" :key="index">
+              <div class="contentRow" style="width: calc(100% - 100px); text-align: right; color: #409eff">{{ item.payName }}:</div>
+              <div class="contentRow" style="width: 100px; text-align: center">{{ item.amount }}</div>
+            </div>
+          </div> -->
+        <div class="baseRow" style="display: flex">
+          <div
+            class="contentRow"
+            style="width: calc(100% - 100px); text-align: right; color: #409eff"
+          >
+            FREIGHT COST:
+          </div>
+          <div class="contentRow" style="width: 100px; text-align: center">
+            {{ statisticsTwo("amount", 2) }}
+          </div>
+        </div>
+        <div class="baseRow" style="display: flex">
+          <div
+            class="contentRow"
+            style="width: calc(100% - 100px); text-align: right; color: #409eff"
+          >
+            TOTAL PRICE:
+          </div>
+          <div class="contentRow" style="width: 100px; text-align: center">
+            {{ printDetails.totalAmount }}
+          </div>
+        </div>
+        <div
+          class="baseRow"
+          style="display: flex; border-bottom: 1px solid black"
+        >
+          <div class="contentRow" style="width: 100%">
+            {{
+              translateIntoEnglish(
+                printDetails.totalAmount,
+                printDetails.currency
+              )
+            }}
+          </div>
+        </div>
+        <div style="height: 16px"></div>
+        <div class="baseRow" style="color: #409eff">
+          <div class="contentRow" style="width: 100%">ACCOUNT INFORMATION:</div>
+        </div>
+        <div class="baseRow" style="border-bottom: 1px solid black">
+          <div class="contentRow" style="width: 100%">
+            <div
+              style="
+                line-height: 24px;
+                padding-left: 4px;
+                word-break: break-all;
+                word-wrap: break-word;
+              "
+            >
+              Beneficiary Name: {{ printDetails.beneficiaryName }}
+            </div>
+            <div
+              style="
+                line-height: 24px;
+                padding-left: 4px;
+                word-break: break-all;
+                word-wrap: break-word;
+              "
+            >
+              Beneficiary Bank: {{ printDetails.beneficiaryBank }}
+            </div>
+            <div
+              style="
+                line-height: 24px;
+                padding-left: 4px;
+                word-break: break-all;
+                word-wrap: break-word;
+              "
+            >
+              Beneficiary Bank Address:
+              {{ printDetails.beneficiaryBankAddress }}
+            </div>
+            <div
+              style="
+                line-height: 24px;
+                padding-left: 4px;
+                word-break: break-all;
+                word-wrap: break-word;
+              "
+            >
+              Beneficiary Account Number:
+              {{ printDetails.beneficiaryAccountNumber }}
+            </div>
+            <div
+              style="
+                line-height: 24px;
+                padding-left: 4px;
+                word-break: break-all;
+                word-wrap: break-word;
+              "
+            >
+              Swift Code: {{ printDetails.swiftCode }}
+            </div>
+            <div
+              style="
+                line-height: 24px;
+                padding-left: 4px;
+                word-break: break-all;
+                word-wrap: break-word;
+              "
+            >
+              Beneficiary Address: {{ printDetails.beneficiaryAddress }}
+            </div>
+          </div>
+        </div>
+        <div style="height: 32px"></div>
+        <div style="display: flex">
+          <div style="width: 50%">
+            <div style="color: #409eff">CONFIRMED BY VENDOR:</div>
+            <div>{{ printDetails.sellCorporationNameEn }}</div>
+          </div>
+          <div style="width: 50%">
+            <div style="color: #409eff">CONFIRMED BY BUYER:</div>
+            <div>{{ printDetails.buyCorporationName }}</div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</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 = (row) => {
+  proxy.post("/contract/getContractPdfInfo", { id: row.id }).then((res) => {
+    printDetails.value = res;
+  });
+};
+const statistics = (label, index) => {
+  let num = 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);
+      }
+    });
+  }
+  return num;
+};
+const statisticsTwo = (label, index) => {
+  let num = 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);
+      }
+    });
+  }
+  return num;
+};
+
+if (props.rowData && props.rowData.id && props.rowData.type === "10") {
+  getPdfData(props.rowData);
+}
+
+watch(
+  () => props.rowData.id,
+  (val) => {
+    if (props.rowData && props.rowData.id && props.rowData.type === "10") {
+      getPdfData(props.rowData);
+    }
+  }
+);
+</script>
+
+<style lang="scss" scoped>
+.baseRow {
+  min-height: 24px;
+  border-top: 1px solid black;
+  border-left: 1px solid black;
+}
+.contentRow {
+  border-right: 1px solid black;
+  line-height: 24px;
+  padding-left: 4px;
+}
+</style>

+ 281 - 0
src/components/PDF/purchasePDF.vue

@@ -0,0 +1,281 @@
+<template>
+  <div>
+    <div id="pdfDom" ref="pdfDom" style="width: 776px">
+      <div style="border: 1px solid #000; border-collapse: collapse">
+        <div style="text-align: right; padding: 2px 4px 0 0">
+          合同号:{{ pdfData.code }}
+        </div>
+        <div class="title">购销合同</div>
+        <div style="display: flex">
+          <div style="display: flex; width: 50%; padding-right: 20px">
+            <div style="width: 60px">买方:</div>
+            <div style="width: calc(100% - 60px)">
+              <div>福建宏星电子科技有限公司</div>
+              <div>福建省福州市鼓楼区软件大道89号福州软件园A区28号楼五层</div>
+            </div>
+          </div>
+          <div style="display: flex; width: 50%; padding-left: 20px">
+            <div style="width: 60px">卖方:</div>
+            <div style="width: calc(100% - 60px)">
+              {{ pdfData.supplyName }}
+            </div>
+          </div>
+        </div>
+        <div style="display: flex">
+          <div style="display: flex; width: 50%; padding-right: 20px">
+            <div style="width: 60px">经手人:</div>
+            <div style="width: calc(100% - 60px)">
+              {{ pdfData.purchaseName }}
+            </div>
+          </div>
+          <div style="display: flex; width: 50%; padding-left: 20px">
+            <div style="width: 60px">经手人:</div>
+            <div style="width: calc(100% - 60px)">
+              {{ pdfData.contactPerson }}
+            </div>
+          </div>
+        </div>
+        <div>买卖双方经协商,一致同意签订以下合同</div>
+        <div>货物名称、规格型号、单位、数量、单价及金额:</div>
+        <table border="1" style="width: 100%" class="table">
+          <tr>
+            <td style="width: 70px">序号</td>
+            <td>品名</td>
+            <td>规格型号</td>
+            <td style="width: 60px">单位</td>
+            <td style="width: 60px">数量</td>
+            <td style="width: 100px">单价</td>
+            <td style="width: 100px">金额</td>
+          </tr>
+          <tr v-for="(row, index) in pdfData.purchaseDetailList" :key="row.id">
+            <td style="width: 70px">{{ index + 1 }}</td>
+            <td>{{ row.productName }}</td>
+            <td>{{ row.productSpec }}</td>
+            <td style="width: 60px">{{ row.productUnitName }}</td>
+            <td style="width: 60px">{{ row.count }}</td>
+            <td style="width: 100px">
+              <span v-if="pdfData.currency">{{ pdfData.currency }}</span
+              >{{ row.price }}
+            </td>
+            <td style="width: 100px">
+              <span v-if="pdfData.currency">{{ pdfData.currency }}</span
+              >{{ row.amount }}
+            </td>
+          </tr>
+          <tr>
+            <td colspan="4" style="text-align: right">其他收费项目:</td>
+            <td></td>
+            <td></td>
+            <td>
+              <span v-if="pdfData.currency">{{ pdfData.currency }}</span
+              >{{ pdfData.otherMoney }}
+            </td>
+          </tr>
+          <tr>
+            <td colspan="4" style="text-align: right">合计:</td>
+            <td>{{ pdfData.countTotal }}</td>
+            <td></td>
+            <td>
+              <span v-if="pdfData.currency">{{ pdfData.currency }}</span
+              >{{ pdfData.amount }}
+            </td>
+          </tr>
+          <tr>
+            <td colspan="7" style="text-align: left">
+              合计人民币金额(大写):{{ pdfData.moneyChinese }}
+            </td>
+          </tr>
+          <tr>
+            <td>交货地点:</td>
+            <td colspan="6" style="text-align: left">
+              福建省福州市鼓楼区软件大道89号福州软件园A区28号楼五层
+            </td>
+          </tr>
+          <!-- <tr>
+              <td>交货时间:</td>
+              <td colspan="6" style="text-align: left"></td>
+            </tr> -->
+          <tr>
+            <td>保修期:</td>
+            <td colspan="6" style="text-align: left">一年</td>
+          </tr>
+          <tr>
+            <td colspan="7" style="text-align: left; padding: 0px">
+              <div style="padding: 2px 0px">
+                一、交货地点:福州软件园A区28座5层。
+              </div>
+              <div style="padding: 2px 0px">二、运输方式及运费:买方承担。</div>
+              <div style="padding: 2px 0px">
+                三、质量要求:样品品质、型号、规格、数量如同买方确认上表规格所示,不符合则由卖方承担责任。
+              </div>
+              <div style="padding: 2px 0px">四、交货时间:2023年4月13日。</div>
+              <div style="padding: 2px 0px">五、付款方式:银行转账。</div>
+              <div style="padding: 2px 0px">六、保修期:一年。</div>
+              <div style="padding: 2px 0px">
+                七、本合同经买卖双方签字盖章后生效,传真件有效。
+              </div>
+              <div style="padding: 2px 0px">
+                八、解决合同纠纷:原双方另有约定外,均按《中华人民共和国合同法》有关规定处理。
+              </div>
+              <div style="padding: 2px 0px">九、其他约定事项:友好解决。</div>
+            </td>
+          </tr>
+        </table>
+        <div style="display: flex">
+          <div style="width: 50%; padding-right: 20px">
+            <div>买方:</div>
+            <div>单位名称:福建宏星电子科技有限公司</div>
+            <div>
+              地址:福建省福州市鼓楼区软件大道89号福州软件园A区28号楼五层
+            </div>
+            <div>电话:</div>
+            <div>传真:</div>
+            <div style="opacity: 0">|</div>
+            <div style="margin-top: auto">代表人签字:</div>
+          </div>
+          <div style="width: 50%; padding-left: 20px">
+            <div>卖方:</div>
+            <div>单位名称:{{ pdfData.supplyName }}</div>
+            <div>统一社会信用代码:</div>
+            <div>开户银行:{{ pdfData.openingBank }}</div>
+            <div>帐号:{{ pdfData.accountOpening }}</div>
+            <div>
+              地址:<span
+                v-if="
+                  pdfData.supplyAddress && pdfData.supplyAddress.countryName
+                "
+                >{{ pdfData.supplyAddress.countryName }}</span
+              >
+              <span
+                v-if="
+                  pdfData.supplyAddress && pdfData.supplyAddress.provinceName
+                "
+                >,{{ pdfData.supplyAddress.provinceName }}</span
+              >
+              <span
+                v-if="pdfData.supplyAddress && pdfData.supplyAddress.cityName"
+                >,{{ pdfData.supplyAddress.cityName }}</span
+              >
+              <span
+                v-if="pdfData.supplyAddress && pdfData.supplyAddress.areaDetail"
+                >,{{ pdfData.supplyAddress.areaDetail }}</span
+              >
+            </div>
+            <div>电话:{{ pdfData.contactNumber }}</div>
+            <div>代表人签字:</div>
+          </div>
+        </div>
+        <div
+          style="
+            padding: 30px 0px 20px 0;
+            text-align: right;
+            border-top: 1px solid #000;
+          "
+        >
+          签订日期:{{ pdfData.approvedDate }}
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { NumberToChinese } from "@/utils/util.js";
+const { proxy } = getCurrentInstance();
+const pdfData = ref({});
+const props = defineProps({
+  rowData: Object,
+});
+const productUnit = ref([]);
+proxy.getDictOne(["unit"]).then((res) => {
+  productUnit.value = res["unit"].map((x) => ({
+    label: x.dictValue,
+    value: x.dictKey,
+  }));
+});
+const handlePrintPdf = (row) => {
+  proxy.post("/purchase/detail", { id: row.id }).then((res) => {
+    proxy
+      .post("/supplierInfo/detail", { id: res.supplyId })
+      .then((supplyData) => {
+        res.contactPerson = supplyData.contactPerson;
+        res.contactNumber = supplyData.contactNumber;
+        res.openingBank = supplyData.openingBank;
+        res.accountOpening = supplyData.accountOpening;
+        let countTotal = 0;
+        let productMoney = 0;
+        for (let i = 0; i < res.purchaseDetailList.length; i++) {
+          const e = res.purchaseDetailList[i];
+          e.productUnitName = proxy.dictValueLabel(
+            e.productUnit,
+            productUnit.value
+          );
+          countTotal += Number(e.count);
+          productMoney += Number(e.amount);
+        }
+        res.countTotal = countTotal;
+        res.productMoney = productMoney;
+        res.otherMoney = res.amount - res.productMoney;
+        res.moneyChinese = NumberToChinese(res.amount);
+        res.supplyAddress = {
+          countryName: supplyData.countryName,
+          provinceName: supplyData.provinceName,
+          cityName: supplyData.cityName,
+          areaDetail: supplyData.areaDetail,
+        };
+        if (res.approvedDate) {
+          res.approvedDate = res.approvedDate.slice(0, 10);
+        }
+        pdfData.value = res;
+      });
+  });
+};
+
+if (props.rowData && props.rowData.id && props.rowData.type === "20") {
+  handlePrintPdf(props.rowData);
+}
+
+watch(
+  () => props.rowData.id,
+  (val) => {
+    if (props.rowData && props.rowData.id && props.rowData.type === "20") {
+      handlePrintPdf(props.rowData);
+    }
+  }
+);
+</script>
+
+<style lang="scss" scoped>
+#pdfDom {
+  font-size: 12px;
+  color: #000000;
+  padding: 60px 30px;
+  .title {
+    font-size: 16px;
+    font-weight: 700;
+    margin-top: 10px;
+    margin-bottom: 20px;
+    text-align: center;
+  }
+  .table {
+    // width: calc(100% + 2px) !important;
+    border-collapse: collapse;
+    border-spacing: 0;
+    // margin-left: -1px;
+    // margin-right: -1px;
+
+    td {
+      text-align: center;
+      padding: 8px 0px;
+    }
+    // tr td:last-child {
+    //   border-right: 0 !important;
+    // }
+  }
+  .flex-top-bottom {
+    display: flex;
+    justify-content: space-between;
+    margin: 5px 0px;
+  }
+}
+</style>

+ 227 - 0
src/components/contractCom/contractDetails.vue

@@ -0,0 +1,227 @@
+<template>
+  <div>
+    <el-tabs
+      v-model="activeName"
+      class="demo-tabs"
+      @tab-click="handleClick"
+      @tab-change="handleChange"
+      stretch
+    >
+      <el-tab-pane label="销售合同" name="first"></el-tab-pane>
+      <el-tab-pane label="采购合同" name="second"></el-tab-pane>
+      <el-tab-pane label="交易明细" name="third"></el-tab-pane>
+    </el-tabs>
+    <div class="content-box" v-show="activeName !== 'third'">
+      <div class="left">
+        <div
+          v-for="i in leftList"
+          :key="i.id"
+          class="left-item"
+          :style="{ color: currentItem.id === i.id ? '#409eff' : '' }"
+          @click="handleItemClick(i)"
+        >
+          v {{ i.version }}
+        </div>
+      </div>
+      <div class="right">
+        <div v-if="leftList && leftList.length > 0">
+          <div style="text-align: right" v-show="activeName === 'first'">
+            <el-button type="primary" @click="pushProcessApproval(currentItem)"
+              >查看详情</el-button
+            >
+          </div>
+          <div v-show="activeName === 'first'">
+            <ContractPDF :rowData="rowData"></ContractPDF>
+          </div>
+          <div v-show="activeName === 'second'">
+            <PurchasePDF :rowData="rowData"></PurchasePDF>
+          </div>
+        </div>
+        <div v-else style="padding-left: 300px">暂无数据</div>
+      </div>
+    </div>
+    <div v-show="activeName === 'third'">
+      <byTable
+        :hidePagination="true"
+        :hideSearch="true"
+        :source="tableData"
+        :config="config"
+        highlight-current-row
+        :action-list="[]"
+      >
+        <template #amount="{ item }">
+          <div>{{ item.currency }} {{ moneyFormat(item.amount, 2) }}</div>
+        </template>
+        <template #accountManagementName="{ item }">
+          <div>
+            {{ item.accountManagementName }} ({{
+              item.accountManagementOpening
+            }})
+          </div>
+        </template>
+      </byTable>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import PurchasePDF from "@/components/PDF/purchasePDF.vue";
+import ContractPDF from "@/components/PDF/contractPDF.vue";
+import byTable from "@/components/byTable/index";
+const { proxy } = getCurrentInstance();
+const props = defineProps({
+  contractId: String,
+});
+const activeName = ref("first");
+const currentItem = ref({});
+const rowData = ref({});
+const leftList = ref([]);
+const contractDataList = ref([]);
+const purchaseDataList = ref([]);
+const tableData = ref([]);
+const transactionType = ref([
+  {
+    label: "请款",
+    value: "1",
+  },
+  {
+    label: "采购付款",
+    value: "20",
+  },
+]);
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "交易时间",
+        prop: "createTime",
+        width: 155,
+      },
+    },
+    {
+      attrs: {
+        label: "交易类型",
+        prop: "type",
+        width: 80,
+      },
+      render(type) {
+        return proxy.dictValueLabel(type, transactionType.value);
+      },
+    },
+    {
+      attrs: {
+        label: "交易金额",
+        prop: "amount",
+        slot: "amount",
+        width: 130,
+      },
+    },
+    {
+      attrs: {
+        label: "摘要",
+        prop: "remarks",
+      },
+    },
+    {
+      attrs: {
+        label: "资金账户",
+        prop: "accountManagementName",
+        slot: "accountManagementName",
+      },
+    },
+    {
+      attrs: {
+        label: "对方账户",
+        prop: "name",
+        width: 120,
+      },
+    },
+  ];
+});
+const handleClick = () => {};
+
+const handleItemClick = (item) => {
+  currentItem.value = item;
+  rowData.value = {
+    type: activeName.value === "first" ? "10" : "20",
+    id: item.id,
+  };
+};
+
+const pushProcessApproval = (row) => {
+  proxy.$router.push({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "contract_flow",
+      id: row.flowId,
+      processType: 20,
+      random: proxy.random(),
+      flowName: "销售合同详情",
+    },
+  });
+  return;
+};
+const handleChange = (val) => {
+  if (val === "first") {
+    leftList.value = contractDataList.value;
+  }
+  if (val === "second") {
+    leftList.value = purchaseDataList.value;
+  }
+};
+const getDetailsData = () => {
+  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 })
+    .then((res) => {
+      purchaseDataList.value = res;
+    });
+
+  proxy
+    .post("/contract/getAccountRunningWaterByContractId", {
+      id: props.contractId,
+    })
+    .then((res) => {
+      tableData.value = res;
+    });
+};
+getDetailsData();
+</script>
+
+<style lang="scss" scoped>
+.content-box {
+  display: flex;
+  .left {
+    width: 100px;
+    // background: #ccc;
+    .left-item {
+      height: 36px;
+      line-height: 36px;
+      text-align: center;
+      cursor: pointer;
+    }
+  }
+  .right {
+    width: calc(100% - 100px);
+    padding-left: 10px;
+  }
+}
+.baseRow {
+  min-height: 24px;
+  border-top: 1px solid black;
+  border-left: 1px solid black;
+}
+.contentRow {
+  border-right: 1px solid black;
+  line-height: 24px;
+  padding-left: 4px;
+}
+</style>

+ 49 - 44
src/views/purchaseManage/purchaseManage/alreadyPurchase/index.vue

@@ -128,7 +128,7 @@
     </el-dialog>
 
     <el-dialog title="打印" v-if="openPdf" v-model="openPdf" width="840px">
-      <div id="pdfDom" ref="pdfDom" style="width: 776px">
+      <!-- <div id="pdfDom" ref="pdfDom" style="width: 776px">
         <div style="border: 1px solid #000; border-collapse: collapse">
           <div style="text-align: right; padding: 2px 4px 0 0">
             合同号:{{ pdfData.code }}
@@ -222,10 +222,6 @@
                 福建省福州市鼓楼区软件大道89号福州软件园A区28号楼五层
               </td>
             </tr>
-            <!-- <tr>
-              <td>交货时间:</td>
-              <td colspan="6" style="text-align: left"></td>
-            </tr> -->
             <tr>
               <td>保修期:</td>
               <td colspan="6" style="text-align: left">一年</td>
@@ -312,7 +308,8 @@
             签订日期:{{ pdfData.approvedDate }}
           </div>
         </div>
-      </div>
+      </div> -->
+      <PurchasePDF :rowData="rowData"></PurchasePDF>
       <template #footer ref="printBtn">
         <el-button @click="openPdf = false" size="large">关闭</el-button>
         <el-button type="primary" v-print="printObj" size="large"
@@ -331,6 +328,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { NumberToChinese } from "@/utils/util.js";
+import PurchasePDF from "@/components/PDF/purchasePDF.vue";
 
 const loading = ref(false);
 const submitLoading = ref(false);
@@ -745,47 +743,54 @@ const handleClickCode = (row) => {
 };
 
 const openPdf = ref(false);
-let pdfData = ref({});
+const pdfData = ref({});
+const rowData = ref({});
 const handlePrintPdf = (row) => {
-  proxy.post("/purchase/detail", { id: row.id }).then((res) => {
-    proxy
-      .post("/supplierInfo/detail", { id: res.supplyId })
-      .then((supplyData) => {
-        res.contactPerson = supplyData.contactPerson;
-        res.contactNumber = supplyData.contactNumber;
-        res.openingBank = supplyData.openingBank;
-        res.accountOpening = supplyData.accountOpening;
-        let countTotal = 0;
-        let productMoney = 0;
-        for (let i = 0; i < res.purchaseDetailList.length; i++) {
-          const e = res.purchaseDetailList[i];
-          e.productUnitName = proxy.dictValueLabel(
-            e.productUnit,
-            productUnit.value
-          );
-          countTotal += Number(e.count);
-          productMoney += Number(e.amount);
-        }
-        res.countTotal = countTotal;
-        res.productMoney = productMoney;
-        res.otherMoney = res.amount - res.productMoney;
-        res.moneyChinese = NumberToChinese(res.amount);
-        res.supplyAddress = {
-          countryName: supplyData.countryName,
-          provinceName: supplyData.provinceName,
-          cityName: supplyData.cityName,
-          areaDetail: supplyData.areaDetail,
-        };
-        if (res.approvedDate) {
-          res.approvedDate = res.approvedDate.slice(0, 10);
-        }
-        pdfData.value = res;
-        openPdf.value = true;
-      });
-  });
+  rowData.value = {
+    id: row.id,
+    code: row.code,
+    type: "20", //type 20 采购合同
+  };
+  openPdf.value = true;
+  // proxy.post("/purchase/detail", { id: row.id }).then((res) => {
+  //   proxy
+  //     .post("/supplierInfo/detail", { id: res.supplyId })
+  //     .then((supplyData) => {
+  //       res.contactPerson = supplyData.contactPerson;
+  //       res.contactNumber = supplyData.contactNumber;
+  //       res.openingBank = supplyData.openingBank;
+  //       res.accountOpening = supplyData.accountOpening;
+  //       let countTotal = 0;
+  //       let productMoney = 0;
+  //       for (let i = 0; i < res.purchaseDetailList.length; i++) {
+  //         const e = res.purchaseDetailList[i];
+  //         e.productUnitName = proxy.dictValueLabel(
+  //           e.productUnit,
+  //           productUnit.value
+  //         );
+  //         countTotal += Number(e.count);
+  //         productMoney += Number(e.amount);
+  //       }
+  //       res.countTotal = countTotal;
+  //       res.productMoney = productMoney;
+  //       res.otherMoney = res.amount - res.productMoney;
+  //       res.moneyChinese = NumberToChinese(res.amount);
+  //       res.supplyAddress = {
+  //         countryName: supplyData.countryName,
+  //         provinceName: supplyData.provinceName,
+  //         cityName: supplyData.cityName,
+  //         areaDetail: supplyData.areaDetail,
+  //       };
+  //       if (res.approvedDate) {
+  //         res.approvedDate = res.approvedDate.slice(0, 10);
+  //       }
+  //       pdfData.value = res;
+  //       openPdf.value = true;
+  //     });
+  // });
 };
 const clickDownload = () => {
-  proxy.getPdf("请款PDF文件");
+  proxy.getPdf("购销合同" + rowData.value.code);
 };
 const pdfDom = ref(null);
 const printObj = ref({

+ 39 - 351
src/views/salesMange/saleContract/contract/index.vue

@@ -16,7 +16,7 @@
         ]"
         @get-list="getList"
       >
-        <template #code="{ item }">
+        <!-- <template #code="{ item }">
           <div style="width: 100%">
             <a
               style="color: #409eff; cursor: pointer; word-break: break-all"
@@ -24,6 +24,15 @@
               >{{ item.code }}</a
             >
           </div>
+        </template> -->
+        <template #code="{ item }">
+          <div style="width: 100%">
+            <a
+              style="color: #409eff; cursor: pointer; word-break: break-all"
+              @click="openDetails(item)"
+              >{{ item.code }}</a
+            >
+          </div>
         </template>
         <template #amount="{ item }">
           <div>
@@ -69,351 +78,7 @@
     </div>
 
     <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="860">
-      <div id="printMe">
-        <div
-          id="pdfDom"
-          style="width: 800px; padding: 16px; font-size: 12px !important"
-        >
-          <div style="font-size: 18px; text-align: center">
-            {{ printDetails.sellCorporationNameEn }}
-          </div>
-          <div style="text-align: center">
-            {{ printDetails.sellCountryName }},{{
-              printDetails.sellProvinceName
-            }},{{ printDetails.sellCityName }},{{
-              printDetails.sellDetailedAddress
-            }}
-          </div>
-          <div
-            style="
-              font-size: 14px;
-              color: #409eff;
-              text-align: center;
-              padding-top: 16px;
-            "
-          >
-            PROFORMA INVOICE
-          </div>
-          <div style="padding-top: 8px">
-            <div>PI NO. : {{ printDetails.contractCode }}</div>
-            <div>PI DATE: {{ printDetails.createTimeEn }}</div>
-          </div>
-          <div style="border: 1px solid black; display: flex">
-            <div style="width: 50%; border-right: 1px solid black">
-              <div style="color: #409eff">VENDOR:</div>
-              <div>{{ printDetails.sellCorporationNameEn }}</div>
-              <div style="padding: 16px 0">
-                {{ printDetails.sellCountryName }},{{
-                  printDetails.sellProvinceName
-                }},{{ printDetails.sellCityName }},{{
-                  printDetails.sellDetailedAddress
-                }}
-              </div>
-              <div>CONTACT: {{ printDetails.sellContactName }}</div>
-              <div>TEL.: {{ printDetails.sellContactNumber }}</div>
-            </div>
-            <div style="width: 50%">
-              <div style="color: #409eff">BUYER:</div>
-              <div>{{ printDetails.buyCorporationName }}</div>
-              <div style="padding: 16px 0">
-                {{ printDetails.buyDetailedAddress }},{{
-                  printDetails.buyCityName
-                }},{{ printDetails.buyProvinceName }},{{
-                  printDetails.buyCountryName
-                }}
-              </div>
-              <div>CONTACT: {{ printDetails.buyContactName }}</div>
-              <div>TEL.: {{ printDetails.buyContactNumber }}</div>
-            </div>
-          </div>
-          <div style="height: 16px"></div>
-          <div style="border: 1px solid black">
-            <div style="display: flex; width: 100%">
-              <div
-                style="
-                  width: 33%;
-                  border-bottom: 1px solid black;
-                  border-right: 1px solid black;
-                "
-              >
-                <div style="color: #409eff">COUNTRY OF ORIGIN:</div>
-                <div>{{ printDetails.sellCountryName }}</div>
-              </div>
-              <div
-                style="
-                  width: 34%;
-                  border-bottom: 1px solid black;
-                  border-right: 1px solid black;
-                "
-              >
-                <div style="color: #409eff">COUNTRY OF DESTINATION:</div>
-                <div>{{ printDetails.buyCountryName }}</div>
-              </div>
-              <div style="width: 33%; border-bottom: 1px solid black">
-                <div style="color: #409eff">PLACE OF DISCHARGE:</div>
-                <div>{{ printDetails.transportRemark }}</div>
-              </div>
-            </div>
-            <div style="display: flex; width: 100%">
-              <div
-                style="
-                  width: 33%;
-                  border-bottom: 1px solid black;
-                  border-right: 1px solid black;
-                "
-              >
-                <div style="color: #409eff">TERMS OF DELIVERY:</div>
-                <div>
-                  {{ dictValueLabel(printDetails.tradeMethods, tradeMethods) }}
-                </div>
-              </div>
-              <div
-                style="
-                  width: 34%;
-                  border-bottom: 1px solid black;
-                  border-right: 1px solid black;
-                "
-              >
-                <div style="color: #409eff">CURRENCY:</div>
-                <div>
-                  {{ printDetails.currency }}
-                </div>
-              </div>
-              <div style="width: 33%; border-bottom: 1px solid black">
-                <div style="color: #409eff">EXPORT BY/VIA:</div>
-                <div>
-                  {{
-                    dictValueLabel(printDetails.transportMethod, shippingMethod)
-                  }}
-                </div>
-              </div>
-            </div>
-            <div style="display: flex; width: 100%">
-              <div style="width: 33%; border-right: 1px solid black">
-                <div style="color: #409eff">DELIVERY TIME:</div>
-                <div>{{ printDetails.deliveryTime }}</div>
-              </div>
-              <div style="width: 67%">
-                <div style="color: #409eff">TERMS OF PAYMENT:</div>
-                <div>{{ printDetails.remark }}</div>
-              </div>
-            </div>
-          </div>
-          <div style="height: 16px"></div>
-          <div class="baseRow" style="display: flex; color: #409eff">
-            <div class="contentRow" style="width: 50px; text-align: center">
-              NO.
-            </div>
-            <div
-              class="contentRow"
-              style="width: calc(100% - 450px); text-align: center"
-            >
-              COMMODITY, SPECIFICATION
-            </div>
-            <div class="contentRow" style="width: 100px; text-align: center">
-              UNIT
-            </div>
-            <div class="contentRow" style="width: 100px; text-align: center">
-              QUANTITY
-            </div>
-            <div class="contentRow" style="width: 100px; text-align: center">
-              UNIT PRICE
-            </div>
-            <div class="contentRow" style="width: 100px; text-align: center">
-              TOTAL PRICE
-            </div>
-          </div>
-          <div
-            v-if="
-              printDetails.productInfoList &&
-              printDetails.productInfoList.length > 0
-            "
-          >
-            <div
-              class="baseRow"
-              style="display: flex"
-              v-for="(item, index) in printDetails.productInfoList"
-              :key="item.productId"
-            >
-              <div class="contentRow" style="width: 50px; text-align: center">
-                {{ index + 1 }}
-              </div>
-              <div
-                class="contentRow"
-                style="width: calc(100% - 450px); text-align: center"
-              >
-                {{ item.productName }}
-              </div>
-              <div class="contentRow" style="width: 100px; text-align: center">
-                {{ dictValueLabel(item.productUnit, productUnit) }}
-              </div>
-              <div class="contentRow" style="width: 100px; text-align: center">
-                {{ item.productQuantity }}
-              </div>
-              <div class="contentRow" style="width: 100px; text-align: center">
-                {{ item.productPrice }}
-              </div>
-              <div class="contentRow" style="width: 100px; text-align: center">
-                {{ item.amount }}
-              </div>
-            </div>
-          </div>
-          <div class="baseRow" style="display: flex; color: #409eff">
-            <div
-              class="contentRow"
-              style="width: calc(100% - 400px); text-align: center"
-            >
-              SUBTOTAL:
-            </div>
-            <div
-              class="contentRow"
-              style="width: 100px; text-align: center"
-            ></div>
-            <div class="contentRow" style="width: 100px; text-align: center">
-              {{ statistics("productQuantity", 0) }}
-            </div>
-            <div
-              class="contentRow"
-              style="width: 100px; text-align: center"
-            ></div>
-            <div class="contentRow" style="width: 100px; text-align: center">
-              {{ statistics("amount", 2) }}
-            </div>
-          </div>
-          <!-- <div v-if="printDetails.quotationPayList && printDetails.quotationPayList.length > 0">
-            <div class="baseRow" style="display: flex" v-for="(item, index) in printDetails.quotationPayList" :key="index">
-              <div class="contentRow" style="width: calc(100% - 100px); text-align: right; color: #409eff">{{ item.payName }}:</div>
-              <div class="contentRow" style="width: 100px; text-align: center">{{ item.amount }}</div>
-            </div>
-          </div> -->
-          <div class="baseRow" style="display: flex">
-            <div
-              class="contentRow"
-              style="
-                width: calc(100% - 100px);
-                text-align: right;
-                color: #409eff;
-              "
-            >
-              FREIGHT COST:
-            </div>
-            <div class="contentRow" style="width: 100px; text-align: center">
-              {{ statisticsTwo("amount", 2) }}
-            </div>
-          </div>
-          <div class="baseRow" style="display: flex">
-            <div
-              class="contentRow"
-              style="
-                width: calc(100% - 100px);
-                text-align: right;
-                color: #409eff;
-              "
-            >
-              TOTAL PRICE:
-            </div>
-            <div class="contentRow" style="width: 100px; text-align: center">
-              {{ printDetails.totalAmount }}
-            </div>
-          </div>
-          <div
-            class="baseRow"
-            style="display: flex; border-bottom: 1px solid black"
-          >
-            <div class="contentRow" style="width: 100%">
-              {{
-                translateIntoEnglish(
-                  printDetails.totalAmount,
-                  printDetails.currency
-                )
-              }}
-            </div>
-          </div>
-          <div style="height: 16px"></div>
-          <div class="baseRow" style="color: #409eff">
-            <div class="contentRow" style="width: 100%">
-              ACCOUNT INFORMATION:
-            </div>
-          </div>
-          <div class="baseRow" style="border-bottom: 1px solid black">
-            <div class="contentRow" style="width: 100%">
-              <div
-                style="
-                  line-height: 24px;
-                  padding-left: 4px;
-                  word-break: break-all;
-                  word-wrap: break-word;
-                "
-              >
-                Beneficiary Name: {{ printDetails.beneficiaryName }}
-              </div>
-              <div
-                style="
-                  line-height: 24px;
-                  padding-left: 4px;
-                  word-break: break-all;
-                  word-wrap: break-word;
-                "
-              >
-                Beneficiary Bank: {{ printDetails.beneficiaryBank }}
-              </div>
-              <div
-                style="
-                  line-height: 24px;
-                  padding-left: 4px;
-                  word-break: break-all;
-                  word-wrap: break-word;
-                "
-              >
-                Beneficiary Bank Address:
-                {{ printDetails.beneficiaryBankAddress }}
-              </div>
-              <div
-                style="
-                  line-height: 24px;
-                  padding-left: 4px;
-                  word-break: break-all;
-                  word-wrap: break-word;
-                "
-              >
-                Beneficiary Account Number:
-                {{ printDetails.beneficiaryAccountNumber }}
-              </div>
-              <div
-                style="
-                  line-height: 24px;
-                  padding-left: 4px;
-                  word-break: break-all;
-                  word-wrap: break-word;
-                "
-              >
-                Swift Code: {{ printDetails.swiftCode }}
-              </div>
-              <div
-                style="
-                  line-height: 24px;
-                  padding-left: 4px;
-                  word-break: break-all;
-                  word-wrap: break-word;
-                "
-              >
-                Beneficiary Address: {{ printDetails.beneficiaryAddress }}
-              </div>
-            </div>
-          </div>
-          <div style="height: 32px"></div>
-          <div style="display: flex">
-            <div style="width: 50%">
-              <div style="color: #409eff">CONFIRMED BY VENDOR:</div>
-              <div>{{ printDetails.sellCorporationNameEn }}</div>
-            </div>
-            <div style="width: 50%">
-              <div style="color: #409eff">CONFIRMED BY BUYER:</div>
-              <div>{{ printDetails.buyCorporationName }}</div>
-            </div>
-          </div>
-        </div>
-      </div>
+      <ContractPDF :rowData="rowData"></ContractPDF>
       <template #footer>
         <el-button @click="openPrint = false" size="large">取消</el-button>
         <el-button v-print="printObj" size="large">打印</el-button>
@@ -422,6 +87,15 @@
         >
       </template>
     </el-dialog>
+
+    <el-dialog
+      title="合同详情"
+      v-if="openDetailsDialog"
+      v-model="openDetailsDialog"
+      width="1000"
+    >
+      <ContractDetails :contractId="currentContractId"></ContractDetails>
+    </el-dialog>
   </div>
 </template>
 
@@ -430,8 +104,9 @@ import { computed, ref } from "vue";
 import byTable from "@/components/byTable/index";
 import useUserStore from "@/store/modules/user";
 import { ElMessage, ElMessageBox } from "element-plus";
+import ContractDetails from "@/components/contractCom/contractDetails.vue";
+import ContractPDF from "@/components/PDF/contractPDF.vue";
 const route = useRoute();
-
 const { proxy } = getCurrentInstance();
 const contractType = ref([]);
 const accountCurrency = ref([]);
@@ -441,6 +116,7 @@ const customerList = ref([]);
 const shippingMethod = ref([]);
 const productUnit = ref([]);
 const userList = ref([]);
+const openDetailsDialog = ref(false);
 const status = ref([
   {
     label: "草稿",
@@ -806,12 +482,19 @@ const newContract = () => {
 };
 const openPrint = ref(false);
 const printDetails = ref({});
+const rowData = ref({});
 const clickPrint = (row) => {
-  printDetails.value = {};
+  // printDetails.value = {};
+  // openPrint.value = true;
+  // proxy.post("/contract/getContractPdfInfo", { id: row.id }).then((res) => {
+  //   printDetails.value = res;
+  // });
+
+  rowData.value = {
+    id: row.id,
+    type: "10", //type 10 销售合同
+  };
   openPrint.value = true;
-  proxy.post("/contract/getContractPdfInfo", { id: row.id }).then((res) => {
-    printDetails.value = res;
-  });
 };
 const clickDownload = () => {
   proxy.getPdf("外销合同PDF文件");
@@ -876,6 +559,11 @@ const pushProcessApproval = (row) => {
   });
   return;
 };
+const currentContractId = ref("");
+const openDetails = (row) => {
+  currentContractId.value = row.id;
+  openDetailsDialog.value = true;
+};
 const printObj = ref({
   id: "printMe",
   popTitle: "",

+ 130 - 42
src/views/salesMange/salesMange/profitSettlement/index.vue

@@ -15,12 +15,16 @@
           action: () => openModal(),
         },
       ]"
-      @get-list="getList">
+      @get-list="getList"
+    >
       <template #amount="{ item }">
         <div></div>
       </template>
     </byTable>
-    <div style="padding: 0 20px 20px 20px; background-color: white" v-if="rateStatus">
+    <div
+      style="padding: 0 20px 20px 20px; background-color: white"
+      v-if="rateStatus"
+    >
       <el-table v-loading="loading" :data="sourceList.data">
         <el-table-column label="合同编号">
           <el-table-column label="" prop="contractCode" width="160" />
@@ -34,55 +38,64 @@
         <el-table-column label="销售合同金额">
           <el-table-column label="" width="120">
             <template #default="{ row }">
-              <div>{{ row.currency }}{{ row.contractAmount }}</div>
+              <div>
+                {{ row.currency }} {{ moneyFormat(row.contractAmount, 2) }}
+              </div>
             </template>
           </el-table-column>
         </el-table-column>
-        <el-table-column label="收入">
+        <el-table-column label="收入(CNY)">
           <el-table-column label="合同到账" width="120">
             <template #default="{ row }">
-              <div>¥{{ row.contractArrival }}</div>
+              <div>{{ moneyFormat(row.contractArrival, 2) }}</div>
+            </template>
+          </el-table-column>
+          <el-table-column label="退税" width="120">
+            <template #default="{ row }">
+              <div>{{ moneyFormat(row.taxReturnMoney, 2) }}</div>
             </template>
           </el-table-column>
           <el-table-column label="其他收入" width="120">
             <template #default="{ row }">
-              <div>¥{{ row.otherIncome }}</div>
+              <div>{{ moneyFormat(row.otherIncome, 2) }}</div>
             </template>
           </el-table-column>
         </el-table-column>
         <el-table-column label="采购合同金额">
           <el-table-column label="" width="120">
             <template #default="{ row }">
-              <div>{{ row.currency }}{{ row.purchaseAmount }}</div>
+              <div>
+                {{ row.currency }} {{ moneyFormat(row.purchaseAmount, 2) }}
+              </div>
             </template>
           </el-table-column>
         </el-table-column>
-        <el-table-column label="支出">
+        <el-table-column label="支出(CNY)">
           <el-table-column label="支付货款" width="120">
             <template #default="{ row }">
-              <div>¥{{ row.payForGoods }}</div>
+              <div>{{ moneyFormat(row.payForGoods, 2) }}</div>
             </template>
           </el-table-column>
           <el-table-column label="其他支出" width="120">
             <template #default="{ row }">
-              <div>¥{{ row.otherExpenses }}</div>
+              <div>{{ moneyFormat(row.otherExpenses, 2) }}</div>
             </template>
           </el-table-column>
         </el-table-column>
         <el-table-column label="统计">
           <el-table-column label="收入合计" width="120">
             <template #default="{ row }">
-              <div>¥{{ row.totalIncome }}</div>
+              <div>{{ moneyFormat(row.totalIncome, 2) }}</div>
             </template>
           </el-table-column>
           <el-table-column label="支出合计" width="120">
             <template #default="{ row }">
-              <div>¥{{ row.totalExpenses }}</div>
+              <div>{{ moneyFormat(row.totalExpenses, 2) }}</div>
             </template>
           </el-table-column>
           <el-table-column label="毛利" width="120">
             <template #default="{ row }">
-              <div>¥{{ row.grossProfit }}</div>
+              <div>{{ moneyFormat(row.grossProfit, 2) }}</div>
             </template>
           </el-table-column>
           <el-table-column label="毛利率" prop="grossProfitMargin" width="120">
@@ -94,9 +107,23 @@
         <el-table-column label="操作" align="center" width="170" fixed="right">
           <template #default="{ row }">
             <div>
-              <el-button type="primary" @click="changeExchangeRate(row)" link>调整汇率</el-button>
-              <el-button type="primary" @click="clickSettlement(row)" v-if="row.settlementStatus === 0" link>结算</el-button>
-              <el-button type="primary" @click="clickCancelSettlement(row)" v-else link>取消结算</el-button>
+              <el-button type="primary" @click="changeExchangeRate(row)" link
+                >调整汇率</el-button
+              >
+              <el-button
+                type="primary"
+                @click="clickSettlement(row)"
+                v-if="row.settlementStatus === 0"
+                link
+                >结算</el-button
+              >
+              <el-button
+                type="primary"
+                @click="clickCancelSettlement(row)"
+                v-else
+                link
+                >取消结算</el-button
+              >
             </div>
           </template>
         </el-table-column>
@@ -109,14 +136,30 @@
           :page-size="sourceList.pagination.pageSize"
           :total="sourceList.pagination.total"
           @size-change="handleSizeChange"
-          @current-change="handlePageChange" />
+          @current-change="handlePageChange"
+        />
       </el-row>
     </div>
 
-    <el-dialog title="默认汇率" v-if="dialogVisible" v-model="dialogVisible" width="600">
-      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
+    <el-dialog
+      title="默认汇率"
+      v-if="dialogVisible"
+      v-model="dialogVisible"
+      width="600"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="submit"
+      >
         <template #currencyList>
-          <el-table :data="formData.data.list" style="width: 100%" v-loading="loadingDialog">
+          <el-table
+            :data="formData.data.list"
+            style="width: 100%"
+            v-loading="loadingDialog"
+          >
             <el-table-column label="币种">
               <template #default="{ row }">
                 <div>{{ dictValueLabel(row.type, accountCurrency) }}</div>
@@ -124,8 +167,19 @@
             </el-table-column>
             <el-table-column label="兑 CHY 汇率">
               <template #default="{ row, $index }">
-                <el-form-item :prop="'list.' + $index + '.rate'" :rules="rules.rate" :inline-message="true">
-                  <el-input-number v-model="row.rate" placeholder="请输入兑 CHY 汇率" style="width: 100%" :precision="6" :controls="false" :min="0" />
+                <el-form-item
+                  :prop="'list.' + $index + '.rate'"
+                  :rules="rules.rate"
+                  :inline-message="true"
+                >
+                  <el-input-number
+                    v-model="row.rate"
+                    placeholder="请输入兑 CHY 汇率"
+                    style="width: 100%"
+                    :precision="6"
+                    :controls="false"
+                    :min="0"
+                  />
                 </el-form-item>
               </template>
             </el-table-column>
@@ -134,14 +188,31 @@
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="large"
+          >确 定</el-button
+        >
       </template>
     </el-dialog>
 
-    <el-dialog title="调整汇率" v-if="openChange" v-model="openChange" width="600">
-      <byForm :formConfig="formChangeConfig" :formOption="formOption" v-model="formChangeData.data" :rules="rules" ref="change">
+    <el-dialog
+      title="调整汇率"
+      v-if="openChange"
+      v-model="openChange"
+      width="600"
+    >
+      <byForm
+        :formConfig="formChangeConfig"
+        :formOption="formOption"
+        v-model="formChangeData.data"
+        :rules="rules"
+        ref="change"
+      >
         <template #currencyList>
-          <el-table :data="formChangeData.data.list" style="width: 100%" v-loading="loadingDialog">
+          <el-table
+            :data="formChangeData.data.list"
+            style="width: 100%"
+            v-loading="loadingDialog"
+          >
             <el-table-column label="币种">
               <template #default="{ row }">
                 <div>{{ dictValueLabel(row.type, accountCurrency) }}</div>
@@ -149,8 +220,19 @@
             </el-table-column>
             <el-table-column label="兑 CHY 汇率">
               <template #default="{ row, $index }">
-                <el-form-item :prop="'list.' + $index + '.rate'" :rules="rules.rate" :inline-message="true">
-                  <el-input-number v-model="row.rate" placeholder="请输入兑 CHY 汇率" style="width: 100%" :precision="6" :controls="false" :min="0" />
+                <el-form-item
+                  :prop="'list.' + $index + '.rate'"
+                  :rules="rules.rate"
+                  :inline-message="true"
+                >
+                  <el-input-number
+                    v-model="row.rate"
+                    placeholder="请输入兑 CHY 汇率"
+                    style="width: 100%"
+                    :precision="6"
+                    :controls="false"
+                    :min="0"
+                  />
                 </el-form-item>
               </template>
             </el-table-column>
@@ -159,7 +241,9 @@
       </byForm>
       <template #footer>
         <el-button @click="openChange = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitChangeForm()" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitChangeForm()" size="large"
+          >确 定</el-button
+        >
       </template>
     </el-dialog>
   </div>
@@ -253,13 +337,15 @@ const getDict = () => {
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/saleStatement/getProfitSettlement", sourceList.value.pagination).then((res) => {
-    sourceList.value.data = res.rows;
-    sourceList.value.pagination.total = res.total;
-    setTimeout(() => {
-      loading.value = false;
-    }, 200);
-  });
+  proxy
+    .post("/saleStatement/getProfitSettlement", sourceList.value.pagination)
+    .then((res) => {
+      sourceList.value.data = res.rows;
+      sourceList.value.pagination.total = res.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
 };
 const rateStatus = ref(false);
 const judgeRate = () => {
@@ -499,13 +585,15 @@ const clickSettlement = (row) => {
   });
 };
 const clickCancelSettlement = (row) => {
-  proxy.post("/commission/add", { id: row.contractId, settlementStatus: 0 }).then(() => {
-    ElMessage({
-      message: "保存成功",
-      type: "success",
+  proxy
+    .post("/commission/add", { id: row.contractId, settlementStatus: 0 })
+    .then(() => {
+      ElMessage({
+        message: "保存成功",
+        type: "success",
+      });
+      getList();
     });
-    getList();
-  });
 };
 </script>
 

+ 98 - 32
src/views/salesMange/shipmentMange/packing/index.vue

@@ -47,6 +47,41 @@
             </div>
           </div>
         </template>
+        <template #netWeight="{ item }">
+          <div>
+            <div v-for="(i, index) in item.dataJsonListCopy" :key="index">
+              {{ i.netWeight + "kg" }}
+            </div>
+          </div>
+        </template>
+        <template #roughWeight="{ item }">
+          <div>
+            <div v-for="(i, index) in item.dataJsonListCopy" :key="index">
+              {{ i.roughWeight + "kg" }}
+            </div>
+          </div>
+        </template>
+        <template #boxLong="{ item }">
+          <div>
+            <div v-for="(i, index) in item.dataJsonListCopy" :key="index">
+              {{ i.boxLong + "cm" }}
+            </div>
+          </div>
+        </template>
+        <template #boxWide="{ item }">
+          <div>
+            <div v-for="(i, index) in item.dataJsonListCopy" :key="index">
+              {{ i.boxWide + "cm" }}
+            </div>
+          </div>
+        </template>
+        <template #boxHigh="{ item }">
+          <div>
+            <div v-for="(i, index) in item.dataJsonListCopy" :key="index">
+              {{ i.boxHigh + "cm" }}
+            </div>
+          </div>
+        </template>
       </byTable>
     </div>
     <el-dialog
@@ -103,6 +138,7 @@
             :data="formData.data.contractProductData"
             @select="handleSelectProduct"
             @select-all="handleSelectProduct"
+            ref="tableDom"
           >
             <el-table-column type="selection" label="" width="50" />
             <el-table-column prop="contractCode" label="合同编码" />
@@ -499,53 +535,57 @@ const config = computed(() => {
     {
       attrs: {
         label: "净重",
-        prop: "netWeight",
+        slot: "netWeight",
         width: 90,
       },
-      render(netWeight) {
-        return netWeight + "kg";
-      },
     },
     {
       attrs: {
         label: "毛重",
-        prop: "roughWeight",
+        slot: "roughWeight",
         width: 90,
       },
-
-      render(roughWeight) {
-        return roughWeight + "kg";
-      },
     },
     {
       attrs: {
         label: "长",
-        prop: "boxLong",
+        slot: "boxLong",
         width: 90,
       },
-      render(boxLong) {
-        return boxLong + "cm";
-      },
     },
 
     {
       attrs: {
         label: "宽",
-        prop: "boxWide",
+        slot: "boxWide",
         width: 90,
       },
-      render(boxWide) {
-        return boxWide + "cm";
-      },
     },
     {
       attrs: {
         label: "高",
-        prop: "boxHigh",
+        slot: "boxHigh",
         width: 90,
       },
-      render(boxHigh) {
-        return boxHigh + "cm";
+    },
+    {
+      attrs: {
+        label: "总净重",
+        prop: "bomVolume",
+        width: 120,
+      },
+      render(bomVolume) {
+        return bomVolume + "m³";
+      },
+    },
+    {
+      attrs: {
+        label: "总毛重",
+        prop: "bomVolume",
+        width: 120,
+      },
+      render(bomVolume) {
+        return bomVolume + "m³";
       },
     },
     {
@@ -574,6 +614,13 @@ const config = computed(() => {
         prop: "shipmentTime",
         width: 155,
       },
+      render(shipmentTime) {
+        if (shipmentTime) {
+          return shipmentTime.slice(5, 10);
+        } else {
+          return "";
+        }
+      },
     },
     {
       attrs: {
@@ -661,18 +708,34 @@ const getList = async (req) => {
   selectData.value = [];
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy
-    .post("/packDetail/page", sourceList.value.pagination)
-    .then((message) => {
-      sourceList.value.data = message.rows.map((x) => ({
-        ...x,
-        isCheck: x.shipmentStatus == 1 ? false : true,
-      }));
-      sourceList.value.pagination.total = message.total;
-      setTimeout(() => {
-        loading.value = false;
-      }, 200);
-    });
+  proxy.post("/packDetail/page", sourceList.value.pagination).then((res) => {
+    for (let i = 0; i < res.rows.length; i++) {
+      const e = res.rows[i];
+      e.isCheck = e.shipmentStatus == 1 ? false : true;
+      let arr = [];
+      let newArr = [];
+      arr = e.dataJsonList.split("_");
+      for (let j = 0; j < arr.length; j++) {
+        const jele = arr[j];
+        const jarr = jele.split(",");
+        const obj = {
+          bomVolume: jarr[0],
+          boxLong: jarr[1],
+          boxWide: jarr[2],
+          boxHigh: jarr[3],
+          roughWeight: jarr[4],
+          netWeight: jarr[5],
+        };
+        newArr = [...newArr, new Array(Number(jarr[6]) - 1).fill(obj)];
+      }
+      e.dataJsonListCopy = newArr;
+    }
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
 };
 
 const openModal = () => {
@@ -776,6 +839,7 @@ const selectProductData = ref([]);
 const handleSelectProduct = (data) => {
   selectProductData.value = data;
 };
+const tableDom = ref(null);
 const handleClickPacking = () => {
   if (selectProductData.value.length > 0) {
     const list = selectProductData.value;
@@ -832,6 +896,7 @@ const handleClickPacking = () => {
       item.packQuantity,
       formData.data.packDetailList.length - 1
     );
+    tableDom.value.clearSelection();
     selectProductData.value = [];
   } else {
     return ElMessage({
@@ -984,6 +1049,7 @@ getList();
     flex-wrap: wrap;
     .item {
       width: 50%;
+      margin-bottom: 10px;
       div {
         line-height: 22px;
       }