From 84e3953ec23a393fdfdadb21463ed502a494e27f Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 31 十月 2025 16:22:28 +0800
Subject: [PATCH] 采购管理-添加导出功能

---
 src/views/procurementManagement/paymentHistory/index.vue |   33 ++++++++++++++++++++++-----------
 1 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/src/views/procurementManagement/paymentHistory/index.vue b/src/views/procurementManagement/paymentHistory/index.vue
index aa64726..62ac579 100644
--- a/src/views/procurementManagement/paymentHistory/index.vue
+++ b/src/views/procurementManagement/paymentHistory/index.vue
@@ -32,27 +32,29 @@
         >
           鎼滅储
         </el-button>
+        <el-button @click="handleExport">瀵煎嚭</el-button>
       </el-form-item>
     </el-form>
     <div class="table_list">
       <PIMTable
+        rowKey="id"
         :column="tableColumn"
         :tableData="tableData"
         :page="page"
         :isSelection="true"
         :isShowSummary="isShowSummarySon"
         :summaryMethod="summarizeMainTable1"
-        :handleSelectionChange="handleSelectionChange"
+        @selection-change="handleSelectionChange"
         :tableLoading="tableLoading"
         @pagination="pagination"
-        :total="total"
+        :total="page.total"
       ></PIMTable>
     </div>
   </div>
 </template>
 
 <script setup>
-import { ref } from "vue";
+import { ref, reactive, getCurrentInstance, onMounted } from "vue";
 import { Search } from "@element-plus/icons-vue";
 import { paymentHistoryListPage } from "@/api/procurementManagement/paymentEntry.js";
 import useFormData from "@/hooks/useFormData";
@@ -62,18 +64,23 @@
 const isShowSummarySon = ref(true);
 const tableColumn = ref([
   {
+    label: "閲囪喘鍚堝悓鍙�",
+    prop: "purchaseContractNumber",
+  },
+  {
     label: "浠樻鏃ユ湡",
     prop: "paymentDate",
   },
   {
     label: "渚涘簲鍟嗗悕绉�",
     prop: "supplierName",
+    width:240
   },
   {
     label: "浠樻閲戦",
     prop: "currentPaymentAmount",
     formatData: (params) => {
-      return parseFloat(params).toFixed(2);
+      return params ? parseFloat(params).toFixed(2) : 0;
     },
   },
   {
@@ -95,16 +102,14 @@
 const page = reactive({
   current: 1,
   size: 100,
+  total: 0,
 });
 const total = ref(0);
 const { form: searchForm } = useFormData({
   searchText: undefined,
-  paymentDate: [
-    dayjs().startOf("month").format("YYYY-MM-DD"),
-    dayjs().endOf("month").format("YYYY-MM-DD"),
-  ],
-  paymentDateStart: dayjs().startOf("month").format("YYYY-MM-DD"),
-  paymentDateEnd: dayjs().endOf("month").format("YYYY-MM-DD"),
+  paymentDate: [],
+  paymentDateStart: undefined,
+  paymentDateEnd: undefined,
 });
 
 // 鏌ヨ鍒楄〃
@@ -124,7 +129,7 @@
   paymentHistoryListPage({ ...rest, ...page }).then((res) => {
     tableLoading.value = false;
     tableData.value = res.records;
-    total.value = res.total;
+		page.total = res.total;
   });
 };
 // 瀛愯〃鍚堣鏂规硶
@@ -154,6 +159,12 @@
   getList();
 };
 
+// 瀵煎嚭
+const handleExport = () => {
+  const { paymentDate, ...rest } = searchForm;
+  proxy.download("/purchase/paymentRegistration/export", { ...rest, ...page }, "浠樻娴佹按.xlsx");
+};
+
 onMounted(() => {
   getList();
 });

--
Gitblit v1.9.3