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 |   18 +++++---
 src/views/procurementManagement/invoiceEntry/index.vue   |   20 +++++++++-
 src/views/procurementManagement/paymentEntry/index.vue   |   23 ++++++++++-
 3 files changed, 50 insertions(+), 11 deletions(-)

diff --git a/src/views/procurementManagement/invoiceEntry/index.vue b/src/views/procurementManagement/invoiceEntry/index.vue
index 4b25c38..87e08e9 100644
--- a/src/views/procurementManagement/invoiceEntry/index.vue
+++ b/src/views/procurementManagement/invoiceEntry/index.vue
@@ -45,10 +45,10 @@
       <div class="actions">
         <div></div>
         <div>
+          <el-button @click="handleExport" style="margin-right: 10px">瀵煎嚭</el-button>
           <el-button type="primary" @click="handleAdd('add')">
             鏂板鐧昏
           </el-button>
-<!--          <el-button @click="handleOut">瀵煎嚭</el-button>-->
 <!--          <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>-->
         </div>
       </div>
@@ -92,7 +92,7 @@
 <script setup>
 import { usePaginationApi } from "@/hooks/usePaginationApi";
 import {delRegistration, gePurchaseListPage} from "@/api/procurementManagement/invoiceEntry.js";
-import { nextTick, onMounted, getCurrentInstance } from "vue";
+import { nextTick, onMounted, getCurrentInstance, ref } from "vue";
 import ExpandTable from "./components/ExpandTable.vue";
 import Modal from "./components/Modal.vue";
 import {ElMessageBox} from "element-plus";
@@ -223,6 +223,22 @@
 			proxy.$modal.msg("宸插彇娑�");
 		});
 };
+
+// 瀵煎嚭閲囪喘鍙拌处
+const handleExport = () => {
+	ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+		confirmButtonText: "纭",
+		cancelButtonText: "鍙栨秷",
+		type: "warning",
+	})
+		.then(() => {
+			proxy.download("/purchase/ledger/exportOne", {}, "鏉ョエ鐧昏.xlsx");
+		})
+		.catch(() => {
+			proxy.$modal.msg("宸插彇娑�");
+		});
+};
+
 // 鍒犻櫎
 const handleDelete = () => {
 	let ids = [];
diff --git a/src/views/procurementManagement/paymentEntry/index.vue b/src/views/procurementManagement/paymentEntry/index.vue
index 0749292..bd9ce30 100644
--- a/src/views/procurementManagement/paymentEntry/index.vue
+++ b/src/views/procurementManagement/paymentEntry/index.vue
@@ -27,6 +27,7 @@
           </el-col>
           <el-col :span="4">
             <el-form-item style="float: right; margin-right: unset">
+              <el-button @click="handleExport" style="margin-right: 10px">瀵煎嚭</el-button>
               <el-button type="primary" @click="openForm('add')">
                 鏂板浠樻
               </el-button>
@@ -269,7 +270,7 @@
 </template>
 
 <script setup>
-import { ref } from "vue";
+import { ref, reactive, toRefs, getCurrentInstance, nextTick, onMounted } from "vue";
 import { Search } from "@element-plus/icons-vue";
 import { ElMessageBox } from "element-plus";
 import useUserStore from "@/store/modules/user.js";
@@ -567,7 +568,25 @@
   const day = String(today.getDate()).padStart(2, "0");
   return `${year}-${month}-${day}`;
 }
-getList();
+
+// 瀵煎嚭
+const handleExport = () => {
+  ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+    confirmButtonText: "纭",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  })
+    .then(() => {
+      proxy.download("/purchase/registration/exportOne", { ...searchForm, ...page }, "浠樻鐧昏.xlsx");
+    })
+    .catch(() => {
+      proxy.$modal.msg("宸插彇娑�");
+    });
+};
+
+onMounted(() => {
+  getList();
+});
 </script>
 
 <style scoped lang="scss">
diff --git a/src/views/procurementManagement/paymentHistory/index.vue b/src/views/procurementManagement/paymentHistory/index.vue
index 7c71979..62ac579 100644
--- a/src/views/procurementManagement/paymentHistory/index.vue
+++ b/src/views/procurementManagement/paymentHistory/index.vue
@@ -32,6 +32,7 @@
         >
           鎼滅储
         </el-button>
+        <el-button @click="handleExport">瀵煎嚭</el-button>
       </el-form-item>
     </el-form>
     <div class="table_list">
@@ -53,7 +54,7 @@
 </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";
@@ -106,12 +107,9 @@
 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,
 });
 
 // 鏌ヨ鍒楄〃
@@ -161,6 +159,12 @@
   getList();
 };
 
+// 瀵煎嚭
+const handleExport = () => {
+  const { paymentDate, ...rest } = searchForm;
+  proxy.download("/purchase/paymentRegistration/export", { ...rest, ...page }, "浠樻娴佹按.xlsx");
+};
+
 onMounted(() => {
   getList();
 });

--
Gitblit v1.9.3