From af4f913751c08fd6ef70cb183de2fb3c604bab38 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 31 十月 2025 16:33:15 +0800
Subject: [PATCH] 人力资源-添加导出功能
---
 src/views/personnelManagement/payrollManagement/index.vue |   20 ++++++++++++++++++--
 src/views/personnelManagement/scheduling/index.vue        |   19 ++++++++++++++++++-
 2 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/src/views/personnelManagement/payrollManagement/index.vue b/src/views/personnelManagement/payrollManagement/index.vue
index 1de23e4..24e3dd8 100644
--- a/src/views/personnelManagement/payrollManagement/index.vue
+++ b/src/views/personnelManagement/payrollManagement/index.vue
@@ -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";
@@ -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();
 });
diff --git a/src/views/personnelManagement/scheduling/index.vue b/src/views/personnelManagement/scheduling/index.vue
index 2818055..251dbe9 100644
--- a/src/views/personnelManagement/scheduling/index.vue
+++ b/src/views/personnelManagement/scheduling/index.vue
@@ -37,6 +37,10 @@
             <el-icon><Refresh/></el-icon>
             閲嶇疆
           </el-button>
+          <el-button @click="handleExport">
+            <el-icon><Download/></el-icon>
+            瀵煎嚭
+          </el-button>
           <el-button type="primary" @click="openScheduleDialog('add')">
           <el-icon><Plus/></el-icon>
           鏂板鎺掔彮
@@ -244,7 +248,7 @@
 </template>
 
 <script setup>
-import {ref, reactive, computed, onMounted} from 'vue'
+import {ref, reactive, computed, onMounted, getCurrentInstance} from 'vue'
 import {ElMessage, ElMessageBox} from 'element-plus'
 import {useDict} from "@/utils/dict.js"
 import {Plus, Download, Search, Refresh} from '@element-plus/icons-vue'
@@ -252,6 +256,8 @@
 import {getStaffOnJob} from "@/api/personnelManagement/onboarding.js";
 import dayjs from "dayjs";
 import pagination from "@/components/PIMTable/Pagination.vue";
+
+const { proxy } = getCurrentInstance();
 
 const tableCount = ref(0)
 // 鍝嶅簲寮忔暟鎹�
@@ -482,6 +488,17 @@
   selectedRows.value = selection
 }
 
+// 瀵煎嚭
+const handleExport = () => {
+  let searchForm = {
+    ...filterForm,
+    ...(filterForm.dateRange.length > 0 && {
+      startDate: filterForm.dateRange[0],
+      endDate: filterForm.dateRange[1],
+    })
+  }
+  proxy.download('/staff/staffScheduling/export', {}, '浜哄憳鎺掔彮.xlsx')
+}
 
 // 鐢熷懡鍛ㄦ湡
 onMounted(() => {
--
Gitblit v1.9.3