Răsfoiți Sursa

账户流水页面增加“销售合同号”展示

lxf 1 an în urmă
părinte
comite
d8405c01dc

+ 48 - 204
src/components/PDF/contractPDF.vue

@@ -1,30 +1,14 @@
 <template>
   <div>
     <div id="printMe">
-      <div
-        id="pdfDom"
-        style="width: 800px; padding: 16px; font-size: 12px !important"
-      >
+      <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
+          {{ 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>
@@ -34,11 +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.sellCountryName }},{{ printDetails.sellProvinceName }},{{ printDetails.sellCityName }},{{ printDetails.sellDetailedAddress }}
             </div>
             <div>CONTACT: {{ printDetails.sellContactName }}</div>
             <div>TEL.: {{ printDetails.sellContactNumber }}</div>
@@ -47,11 +27,7 @@
             <div style="color: #409eff">BUYER:</div>
             <div>{{ printDetails.buyCorporationName }}</div>
             <div style="padding: 16px 0">
-              {{ printDetails.buyDetailedAddress }},{{
-                printDetails.buyCityName
-              }},{{ printDetails.buyProvinceName }},{{
-                printDetails.buyCountryName
-              }}
+              {{ printDetails.buyDetailedAddress }},{{ printDetails.buyCityName }},{{ printDetails.buyProvinceName }},{{ printDetails.buyCountryName }}
             </div>
             <div>CONTACT: {{ printDetails.buyContactName }}</div>
             <div>TEL.: {{ printDetails.buyContactNumber }}</div>
@@ -60,23 +36,11 @@
         <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="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="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>
@@ -86,25 +50,13 @@
             </div>
           </div>
           <div style="display: flex; width: 100%">
-            <div
-              style="
-                width: 33%;
-                border-bottom: 1px solid black;
-                border-right: 1px solid black;
-              "
-            >
+            <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="width: 34%; border-bottom: 1px solid black; border-right: 1px solid black">
               <div style="color: #409eff">CURRENCY:</div>
               <div>
                 {{ printDetails.currency }}
@@ -113,9 +65,7 @@
             <div style="width: 33%; border-bottom: 1px solid black">
               <div style="color: #409eff">EXPORT BY/VIA:</div>
               <div>
-                {{
-                  dictValueLabel(printDetails.transportMethod, shippingMethod)
-                }}
+                {{ dictValueLabel(printDetails.transportMethod, shippingMethod) }}
               </div>
             </div>
           </div>
@@ -132,47 +82,19 @@
         </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 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 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"
-            >
+            <div class="contentRow" style="width: calc(100% - 450px); text-align: center">
               {{ item.productName }}
             </div>
             <div class="contentRow" style="width: 100px; text-align: center">
@@ -190,23 +112,12 @@
           </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: 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"></div>
           <div class="contentRow" style="width: 100px; text-align: center">
             {{ statistics("amount", 2) }}
           </div>
@@ -218,38 +129,20 @@
             </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: 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: 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="baseRow" style="display: flex; border-bottom: 1px solid black">
           <div class="contentRow" style="width: 100%">
-            {{
-              translateIntoEnglish(
-                printDetails.totalAmount,
-                printDetails.currency
-              )
-            }}
+            {{ translateIntoEnglish(printDetails.totalAmount, printDetails.currency) }}
           </div>
         </div>
         <div style="height: 16px"></div>
@@ -258,66 +151,22 @@
         </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;
-              "
-            >
+            <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;
-              "
-            >
+            <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;
-              "
-            >
+            <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;
-              "
-            >
+            <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;
-              "
-            >
+            <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>
@@ -339,24 +188,21 @@
 </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) => {
+const getPdfData = (query) => {
+  proxy.post("/contract/getContractPdfInfo", query).then((res) => {
     printDetails.value = res;
   });
 };
 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);
@@ -367,10 +213,7 @@ 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);
@@ -379,17 +222,18 @@ const statisticsTwo = (label, index) => {
   }
   return num;
 };
-
-if (props.rowData && props.rowData.id) {
-  getPdfData(props.rowData);
-}
-
 watch(
-  () => props.rowData.id,
-  (val) => {
-    if (props.rowData && props.rowData.id) {
-      getPdfData(props.rowData);
+  props.rowData,
+  () => {
+    if (props.rowData.id) {
+      getPdfData({ id: props.rowData.id });
+    } else if (props.rowData.code) {
+      getPdfData({ code: props.rowData.code });
     }
+  },
+  {
+    immediate: true,
+    deep: true,
   }
 );
 </script>
@@ -405,4 +249,4 @@ watch(
   line-height: 24px;
   padding-left: 4px;
 }
-</style>
+</style>

+ 98 - 173
src/views/finance/fundManage/accountStatement/index.vue

@@ -22,8 +22,7 @@
             action: () => openModal('add'),
           },
         ]"
-        @get-list="getList"
-      >
+        @get-list="getList">
         <!-- <template #amount="{ item }">
           <div :style="'color: ' + (item.status === '10' ? '#04cb04;' : 'red;')">
             <span style="padding-right: 4px">{{ item.currency }}</span>
@@ -41,31 +40,23 @@
             <span v-if="item.status == 20">{{ item.amount }}</span>
           </div>
         </template>
+        <template #contractCodes="{ item }">
+          <div style="width: 100%">
+            <div v-if="item.contractCodes">
+              <div v-for="(contract, index) in item.contractCodes.split(',')" :key="index">
+                <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="openDetails(contract)">{{ contract }}</a>
+              </div>
+            </div>
+          </div>
+        </template>
       </byTable>
     </div>
 
-    <el-dialog
-      :title="modalType == 'add' ? '添加流水' : '编辑流水'"
-      v-if="dialogVisible"
-      v-model="dialogVisible"
-      width="600"
-    >
-      <byForm
-        :formConfig="formConfig"
-        :formOption="formOption"
-        v-model="formData.data"
-        :rules="rules"
-        ref="submit"
-        v-loading="loadingDialog"
-      >
+    <el-dialog :title="modalType == 'add' ? '添加流水' : '编辑流水'" v-if="dialogVisible" v-model="dialogVisible" width="600">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit" v-loading="loadingDialog">
         <template #transactionTime>
           <div>
-            <el-date-picker
-              v-model="formData.data.transactionTime"
-              type="datetime"
-              placeholder="请选择交易时间"
-              value-format="YYYY-MM-DD HH:mm:ss"
-            />
+            <el-date-picker v-model="formData.data.transactionTime" type="datetime" placeholder="请选择交易时间" value-format="YYYY-MM-DD HH:mm:ss" />
           </div>
         </template>
         <template #money>
@@ -73,34 +64,15 @@
             <el-row :gutter="10">
               <el-col :span="6">
                 <el-form-item prop="status">
-                  <el-select
-                    v-model="formData.data.status"
-                    placeholder="请选择"
-                    style="width: 100%"
-                    @change="changeStatus()"
-                  >
-                    <el-option
-                      v-for="item in status"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value"
-                    />
+                  <el-select v-model="formData.data.status" placeholder="请选择" style="width: 100%" @change="changeStatus()">
+                    <el-option v-for="item in status" :key="item.value" :label="item.label" :value="item.value" />
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="6">
                 <el-form-item prop="currency">
-                  <el-select
-                    v-model="formData.data.currency"
-                    placeholder="请选择"
-                    style="width: 100%"
-                  >
-                    <el-option
-                      v-for="item in accountCurrency"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value"
-                    />
+                  <el-select v-model="formData.data.currency" placeholder="请选择" style="width: 100%">
+                    <el-option v-for="item in accountCurrency" :key="item.value" :label="item.label" :value="item.value" />
                   </el-select>
                 </el-form-item>
               </el-col>
@@ -113,8 +85,7 @@
                     style="width: 100%"
                     :precision="2"
                     :controls="false"
-                    :min="0"
-                  />
+                    :min="0" />
                 </el-form-item>
               </el-col>
             </el-row>
@@ -124,13 +95,7 @@
           <div>
             <el-form-item prop="received">
               <el-radio-group v-model="formData.data.received">
-                <el-radio
-                  v-for="item in received"
-                  :key="item.value"
-                  :label="item.value"
-                  border
-                  >{{ item.label }}</el-radio
-                >
+                <el-radio v-for="item in received" :key="item.value" :label="item.value" border>{{ item.label }}</el-radio>
               </el-radio-group>
             </el-form-item>
           </div>
@@ -138,82 +103,35 @@
       </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="dialogVisibleOne"
-      v-model="dialogVisibleOne"
-      width="600"
-    >
-      <byForm
-        :formConfig="formConfigOne"
-        :formOption="formOption"
-        v-model="formData.dataOne"
-        :rules="rulesOne"
-        ref="submitOne"
-        v-loading="loadingDialog"
-      >
+    <el-dialog :title="'退税登记'" v-if="dialogVisibleOne" v-model="dialogVisibleOne" width="600">
+      <byForm :formConfig="formConfigOne" :formOption="formOption" v-model="formData.dataOne" :rules="rulesOne" ref="submitOne" v-loading="loadingDialog">
         <template #details>
           <div style="width: 100%">
-            <el-button
-              type="primary"
-              @click="handleAddRow"
-              style="margin: 10px 0"
-            >
-              添加
-            </el-button>
+            <el-button type="primary" @click="handleAddRow" style="margin: 10px 0"> 添加 </el-button>
             <el-table :data="formData.dataOne.taxRefundDetailsList">
               <el-table-column prop="count" label="合同编号" min-width="150">
                 <template #default="{ row, $index }">
-                  <el-form-item
-                    :prop="'taxRefundDetailsList.' + $index + '.contractId'"
-                    :rules="rulesOne.contractId"
-                    :inline-message="true"
-                  >
-                    <el-select
-                      v-model="row.contractId"
-                      placeholder="请选择"
-                      filterable
-                      style="width: 100%"
-                    >
-                      <el-option
-                        v-for="item in contractList"
-                        :label="item.code"
-                        :value="item.id"
-                      >
-                      </el-option>
+                  <el-form-item :prop="'taxRefundDetailsList.' + $index + '.contractId'" :rules="rulesOne.contractId" :inline-message="true">
+                    <el-select v-model="row.contractId" placeholder="请选择" filterable style="width: 100%">
+                      <el-option v-for="item in contractList" :label="item.code" :value="item.id"> </el-option>
                     </el-select>
                   </el-form-item>
                 </template>
               </el-table-column>
               <el-table-column prop="amount" label="关联金额" min-width="150">
                 <template #default="{ row, $index }">
-                  <el-form-item
-                    :prop="'taxRefundDetailsList.' + $index + '.amount'"
-                    :rules="rulesOne.amount"
-                    :inline-message="true"
-                  >
-                    <el-input-number
-                      onmousewheel="return false;"
-                      v-model="row.amount"
-                      :precision="2"
-                      :controls="false"
-                      :min="0"
-                      style="width: 100%"
-                    />
+                  <el-form-item :prop="'taxRefundDetailsList.' + $index + '.amount'" :rules="rulesOne.amount" :inline-message="true">
+                    <el-input-number onmousewheel="return false;" v-model="row.amount" :precision="2" :controls="false" :min="0" style="width: 100%" />
                   </el-form-item>
                 </template>
               </el-table-column>
               <el-table-column prop="zip" label="操作" width="80">
                 <template #default="{ $index }">
-                  <el-button type="primary" link @click="handleRemove($index)"
-                    >删除</el-button
-                  >
+                  <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -221,12 +139,17 @@
         </template>
       </byForm>
       <template #footer>
-        <el-button @click="dialogVisibleOne = false" size="large"
-          >取 消</el-button
-        >
-        <el-button type="primary" @click="submitFormOne()" size="large"
-          >确 定</el-button
-        >
+        <el-button @click="dialogVisibleOne = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitFormOne()" size="large">确 定</el-button>
+      </template>
+    </el-dialog>
+
+    <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="860">
+      <ContractPDF :rowData="rowData"></ContractPDF>
+      <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>
       </template>
     </el-dialog>
   </div>
@@ -239,6 +162,7 @@ import byForm from "@/components/byForm/index";
 import useUserStore from "@/store/modules/user";
 import { ElMessage, ElMessageBox } from "element-plus";
 import moment from "moment";
+import ContractPDF from "@/components/PDF/contractPDF.vue";
 
 const { proxy } = getCurrentInstance();
 const accountCurrency = ref([]);
@@ -303,6 +227,13 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "关联销售合同",
+        slot: "contractCodes",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
         label: "资金账户",
         prop: "accountManagementName",
         width: 200,
@@ -399,15 +330,11 @@ const config = computed(() => {
             },
             el: "button",
             click() {
-              ElMessageBox.confirm(
-                "此操作将永久删除该数据, 是否继续?",
-                "提示",
-                {
-                  confirmButtonText: "确定",
-                  cancelButtonText: "取消",
-                  type: "warning",
-                }
-              ).then(() => {
+              ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+              }).then(() => {
                 proxy
                   .post("/accountRunningWater/delete", {
                     id: row.id,
@@ -448,28 +375,23 @@ const getCurrency = () => {
     });
 };
 const getAccountList = () => {
-  return proxy
-    .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
-    .then((res) => {
-      if (res.rows && res.rows.length > 0) {
-        accountList.value = res.rows.map((item) => {
-          return {
-            label: item.alias,
-            value: item.id,
-          };
-        });
-        sourceList.value.pagination.accountManagementId =
-          accountList.value[0].value;
-      }
-    });
+  return proxy.post("/accountManagement/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      accountList.value = res.rows.map((item) => {
+        return {
+          label: item.alias,
+          value: item.id,
+        };
+      });
+      sourceList.value.pagination.accountManagementId = accountList.value[0].value;
+    }
+  });
 };
 const getDict = () => {
   // 关联合同
-  proxy
-    .post("/contract/page", { pageNum: 1, pageSize: 9999, status: 30 })
-    .then((res) => {
-      contractList.value = res.rows;
-    });
+  proxy.post("/contract/page", { pageNum: 1, pageSize: 9999, status: 30 }).then((res) => {
+    contractList.value = res.rows;
+  });
 
   Promise.all([getCurrency(), getAccountList()]).then(() => {
     getList();
@@ -478,15 +400,13 @@ const getDict = () => {
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy
-    .post("/accountRunningWater/page1", sourceList.value.pagination)
-    .then((res) => {
-      sourceList.value.data = res.rows;
-      sourceList.value.pagination.total = res.total;
-      setTimeout(() => {
-        loading.value = false;
-      }, 200);
-    });
+  proxy.post("/accountRunningWater/page1", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
 };
 getDict();
 const modalType = ref("add");
@@ -647,29 +567,19 @@ const formConfigOne = computed(() => {
 });
 
 const rules = ref({
-  accountManagementId: [
-    { required: true, message: "请选择账户", trigger: "change" },
-  ],
-  transactionTime: [
-    { required: true, message: "请选择交易时间", trigger: "change" },
-  ],
+  accountManagementId: [{ required: true, message: "请选择账户", trigger: "change" }],
+  transactionTime: [{ required: true, message: "请选择交易时间", trigger: "change" }],
   status: [{ required: true, message: "请选择收支类型", trigger: "change" }],
   currency: [{ required: true, message: "请选择币种", trigger: "change" }],
-  received: [
-    { required: true, message: "请选择合同是否到账", trigger: "change" },
-  ],
+  received: [{ required: true, message: "请选择合同是否到账", trigger: "change" }],
   amount: [{ required: true, message: "请输入金额", trigger: "blur" }],
   // name: [{ required: true, message: "请输入账户名称", trigger: "blur" }],
   // openingBank: [{ required: true, message: "请输入开户银行", trigger: "blur" }],
   // accountOpening: [{ required: true, message: "请输入银行账号", trigger: "blur" }],
 });
 const rulesOne = ref({
-  accountManagementId: [
-    { required: true, message: "请选择账户", trigger: "change" },
-  ],
-  transactionTime: [
-    { required: true, message: "请选择退税时间", trigger: "change" },
-  ],
+  accountManagementId: [{ required: true, message: "请选择账户", trigger: "change" }],
+  transactionTime: [{ required: true, message: "请选择退税时间", trigger: "change" }],
   currency: [{ required: true, message: "请选择币种", trigger: "change" }],
   // amount: [{ required: true, message: "请输入退税金额", trigger: "blur" }],
   contractId: [{ required: true, message: "请选择合同", trigger: "change" }],
@@ -748,10 +658,7 @@ const submitFormOne = () => {
         });
       }
     }
-    const total = submitData.taxRefundDetailsList.reduce(
-      (sum, crr) => (sum += crr.amount),
-      0
-    );
+    const total = submitData.taxRefundDetailsList.reduce((sum, crr) => (sum += crr.amount), 0);
     if (total !== Number(submitData.amount)) {
       return ElMessage({
         message: "关联合同明细的关联金额总合必须等于退税金额",
@@ -810,6 +717,24 @@ const exportData = (res, name) => {
     navigator.msSaveBlob(blob, fileName);
   }
 };
+const openPrint = ref(false);
+const rowData = ref({});
+const openDetails = (val) => {
+  rowData.value = {
+    code: val,
+  };
+  openPrint.value = true;
+};
+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",
+  extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
+});
+const clickDownload = () => {
+  proxy.getPdf("外销合同PDF文件");
+};
 </script>
 
 <style lang="scss" scoped>