From 9aae2af6f3937a7d99ec619b51f457002cef969f Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 03 十一月 2025 14:29:37 +0800
Subject: [PATCH] 档案管理-添加导出功能

---
 src/views/personnelManagement/payrollManagement/index.vue |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/src/views/personnelManagement/payrollManagement/index.vue b/src/views/personnelManagement/payrollManagement/index.vue
index 5e9bf71..24e3dd8 100644
--- a/src/views/personnelManagement/payrollManagement/index.vue
+++ b/src/views/personnelManagement/payrollManagement/index.vue
@@ -13,7 +13,7 @@
 				/>
 				<span class="search_title ml10">鏈堜唤锛�</span>
 				<el-date-picker
-					v-model="searchForm.payDate"
+					v-model="searchForm.payDateStr"
 					type="month"
 					@change="handleQuery"
 					value-format="YYYY-MM"
@@ -27,8 +27,8 @@
 				>
 			</div>
 			<div>
+				<el-button @click="handleExport" style="margin-right: 10px">瀵煎嚭</el-button>
 				<el-button type="primary" @click="openForm('add')">鏂板钖祫</el-button>
-<!--				<el-button @click="handleOut">瀵煎嚭</el-button>-->
 				<el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
 			</div>
 		</div>
@@ -51,7 +51,7 @@
 
 <script setup>
 import { Search } from "@element-plus/icons-vue";
-import {onMounted, ref} from "vue";
+import {onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue";
 import FormDia from "@/views/personnelManagement/payrollManagement/components/formDia.vue";
 import {staffJoinDel} from "@/api/personnelManagement/onboarding.js";
 import {ElMessageBox} from "element-plus";
@@ -61,7 +61,7 @@
 const data = reactive({
 	searchForm: {
 		name: "",
-		payDate: "",
+		payDateStr: "",
 	},
 });
 const { searchForm } = toRefs(data);
@@ -283,6 +283,22 @@
 			proxy.$modal.msg("宸插彇娑�");
 		});
 };
+
+// 瀵煎嚭钖祫绠$悊
+const handleExport = () => {
+	ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+		confirmButtonText: "纭",
+		cancelButtonText: "鍙栨秷",
+		type: "warning",
+	})
+		.then(() => {
+			proxy.download("/compensationPerformance/export", { ...searchForm.value, ...page }, "钖祫绠$悊.xlsx");
+		})
+		.catch(() => {
+			proxy.$modal.msg("宸插彇娑�");
+		});
+};
+
 onMounted(() => {
 	getList();
 });

--
Gitblit v1.9.3