lxf il y a 1 semaine
Parent
commit
3aa203e924
1 fichiers modifiés avec 180 ajouts et 63 suppressions
  1. 180 63
      src/views/finance/fundManage/accountStatement/index.vue

+ 180 - 63
src/views/finance/fundManage/accountStatement/index.vue

@@ -1,67 +1,75 @@
 <template>
   <div class="tenant">
     <div class="content">
-      <byTable
-        :source="sourceList.data"
-        :pagination="sourceList.pagination"
-        :config="config"
-        :loading="loading"
-        :selectConfig="selectConfig"
-        highlight-current-row
-        :action-list="[
-          {
-            text: '导出Excel',
-            action: () => deriveExcel(),
-          },
-          {
-            text: '添加借款',
-            action: () => addloan(),
-          },
-          {
-            text: '内部转账',
-            action: () => openTransferMoney('add'),
-          },
-          {
-            text: '退税登记',
-            action: () => openModalOne('add'),
-          },
-          {
-            text: '结汇',
-            action: () => openSettlementModal('add'),
-          },
-          {
-            text: '添加流水',
-            action: () => openModal('add'),
-          },
-        ]"
-        @get-list="getList">
-        <!-- <template #amount="{ item }">
-          <div :style="'color: ' + (item.status === '10' ? '#04cb04;' : 'red;')">
-            <span style="padding-right: 4px">{{ item.currency }}</span>
-            <span v-if="item.status === '20'">-</span>
-            <span>{{ moneyFormat(item.amount, 2) }}</span>
-          </div>
-        </template> -->
-        <template #status10="{ item }">
-          <div>
-            <span v-if="item.status == 10">{{ item.amount }}</span>
-          </div>
-        </template>
-        <template #status20="{ item }">
-          <div>
-            <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>
+      <el-checkbox-group v-model="checkList">
+        <byTable
+          :source="sourceList.data"
+          :pagination="sourceList.pagination"
+          :config="config"
+          :loading="loading"
+          :selectConfig="selectConfig"
+          highlight-current-row
+          :action-list="[
+            {
+              text: '预览PDF',
+              action: () => previewPDF(),
+              disabled: !(checkList && checkList.length > 0),
+            },
+            {
+              text: '导出Excel',
+              action: () => deriveExcel(),
+            },
+            {
+              text: '添加借款',
+              action: () => addloan(),
+            },
+            {
+              text: '内部转账',
+              action: () => openTransferMoney('add'),
+            },
+            {
+              text: '退税登记',
+              action: () => openModalOne('add'),
+            },
+            {
+              text: '结汇',
+              action: () => openSettlementModal('add'),
+            },
+            {
+              text: '添加流水',
+              action: () => openModal('add'),
+            },
+          ]"
+          @get-list="getList">
+          <!-- <template #amount="{ item }">
+            <div :style="'color: ' + (item.status === '10' ? '#04cb04;' : 'red;')">
+              <span style="padding-right: 4px">{{ item.currency }}</span>
+              <span v-if="item.status === '20'">-</span>
+              <span>{{ moneyFormat(item.amount, 2) }}</span>
+            </div>
+          </template> -->
+          <template #status10="{ item }">
+            <div>
+              <span v-if="item.status == 10">{{ item.amount }}</span>
+            </div>
+          </template>
+          <template #status20="{ item }">
+            <div>
+              <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">
+                  <el-checkbox :label="contract"><br /></el-checkbox>
+                  <a style="color: #409eff; cursor: pointer; word-break: break-all; margin-left: 4px" @click="openDetails(contract)">{{ contract }}</a>
+                </div>
               </div>
             </div>
-          </div>
-        </template>
-      </byTable>
+          </template>
+        </byTable>
+      </el-checkbox-group>
     </div>
     <el-dialog title="内部转账" v-if="transferMoneyModal" v-model="transferMoneyModal" width="600" v-loading="loadingDialog">
       <byForm :formConfig="transferMoneyConfig" :formOption="formOption" v-model="formData2.data" :rules="rules2" ref="transferMoneySubmit"> </byForm>
@@ -259,6 +267,21 @@
       </template>
     </el-dialog>
 
+    <el-dialog title="打印" v-if="openMorePrint" v-model="openMorePrint" width="860">
+      <div id="printMe">
+        <div id="pdfDom" style="padding: 16px; font-size: 12px !important; font-family: 'msyh'">
+          <div v-for="(item, index) in checkList" :key="index" style="margin-bottom: 20px; border-bottom: 1px solid #e4e7ed; padding-bottom: 20px">
+            <ContractPDF :rowData="{ code: item }"></ContractPDF>
+          </div>
+        </div>
+      </div>
+      <template #footer>
+        <el-button @click="openMorePrint = 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>
+
     <el-dialog :title="submitType == 'add' ? '添加借款' : '还款'" v-if="openLoanDialog" v-model="openLoanDialog" width="500" destroy-on-close>
       <byForm :formConfig="loanFormConfig" :formOption="formOption" :rules="loanRules" v-model="formData.loanData" ref="byform">
         <template #loanUserName>
@@ -298,6 +321,7 @@ const contractList = ref([]);
 const contractList2 = ref([]);
 const corporationList = ref([]);
 const deptTreeData = ref([]);
+const checkList = ref([]);
 const status = ref([
   {
     label: "收入",
@@ -318,6 +342,69 @@ const received = ref([
     value: "20",
   },
 ]);
+const year = ref([]);
+const getYear = () => {
+  // 获取当前年份
+  const currentYear = new Date().getFullYear();
+  // 初始化年份数组,从2023年开始
+  for (let yyyy = currentYear; yyyy >= 2023; yyyy--) {
+    year.value.push({
+      label: yyyy,
+      value: yyyy,
+    });
+  }
+};
+getYear();
+const month = ref([
+  {
+    label: "1月",
+    value: "01",
+  },
+  {
+    label: "2月",
+    value: "02",
+  },
+  {
+    label: "3月",
+    value: "03",
+  },
+  {
+    label: "4月",
+    value: "04",
+  },
+  {
+    label: "5月",
+    value: "05",
+  },
+  {
+    label: "6月",
+    value: "06",
+  },
+  {
+    label: "7月",
+    value: "07",
+  },
+  {
+    label: "8月",
+    value: "08",
+  },
+  {
+    label: "9月",
+    value: "09",
+  },
+  {
+    label: "10月",
+    value: "10",
+  },
+  {
+    label: "11月",
+    value: "11",
+  },
+  {
+    label: "12月",
+    value: "12",
+  },
+]);
 const sourceList = ref({
   data: [],
   pagination: {
@@ -327,6 +414,10 @@ const sourceList = ref({
     keyword: "",
     accountManagementId: "",
     currency: "",
+    startTime: "",
+    stopTime: "",
+    year: "",
+    month: "",
   },
 });
 const loading = ref(false);
@@ -344,6 +435,16 @@ const selectConfig = computed(() => {
       data: accountCurrency.value,
       isShowAll: false,
     },
+    {
+      label: "年份",
+      prop: "year",
+      data: year.value,
+    },
+    {
+      label: "月份",
+      prop: "month",
+      data: month.value,
+    },
   ];
 });
 const config = computed(() => {
@@ -373,7 +474,7 @@ const config = computed(() => {
       attrs: {
         label: "关联销售合同",
         slot: "contractCodes",
-        width: 160,
+        width: 180,
       },
     },
     {
@@ -694,6 +795,18 @@ const getDict = () => {
 
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  if (sourceList.value.pagination.year) {
+    if (sourceList.value.pagination.month) {
+      sourceList.value.pagination.startTime = sourceList.value.pagination.year + "-" + sourceList.value.pagination.month + "-01 00:00:00";
+      sourceList.value.pagination.stopTime = sourceList.value.pagination.year + "-" + sourceList.value.pagination.month + "-31 23:59:59";
+    } else {
+      sourceList.value.pagination.startTime = sourceList.value.pagination.year + "-01-01 00:00:00";
+      sourceList.value.pagination.stopTime = sourceList.value.pagination.year + "-12-31 23:59:59";
+    }
+  } else {
+    sourceList.value.pagination.startTime = "";
+    sourceList.value.pagination.stopTime = "";
+  }
   loading.value = true;
   proxy.post("/accountRunningWater/page1", sourceList.value.pagination).then((res) => {
     sourceList.value.data = res.rows;
@@ -1316,13 +1429,13 @@ const submitForm = () => {
       if (money > Number(formData.data.amount)) {
         return ElMessage("部门费用不能大于交易金额");
       }
-      proxy.post("accountDeptRunningWater/bathAdd", formData.data.deptMoneyList).then(() => {
-        ElMessage({ message: "部门费用添加成功", type: "success" });
-      });
     }
     loadingDialog.value = true;
     proxy.post("/accountRunningWater/" + modalType.value, formData.data).then(
       () => {
+        proxy.post("accountDeptRunningWater/bathAdd", formData.data.deptMoneyList).then(() => {
+          ElMessage({ message: "部门费用添加成功", type: "success" });
+        });
         ElMessage({
           message: modalType.value == "add" ? "添加成功" : "编辑成功",
           type: "success",
@@ -1658,6 +1771,10 @@ const handleSubmitLoan = () => {
     );
   });
 };
+const openMorePrint = ref(false);
+const previewPDF = () => {
+  openMorePrint.value = true;
+};
 </script>
 
 <style lang="scss" scoped>