From fd0e3fd03817d6610c52b09fe27cccf0d3f96438 Mon Sep 17 00:00:00 2001
From: yaowanxin <3588231647@qq.com>
Date: 星期二, 12 八月 2025 16:26:11 +0800
Subject: [PATCH] Merge branch 'dev_ai' of http://114.132.189.42:9002/r/product-inventory-management into ywx

---
 src/views/personnelManagement/payrollManagement/index.vue |  291 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 291 insertions(+), 0 deletions(-)

diff --git a/src/views/personnelManagement/payrollManagement/index.vue b/src/views/personnelManagement/payrollManagement/index.vue
new file mode 100644
index 0000000..1de23e4
--- /dev/null
+++ b/src/views/personnelManagement/payrollManagement/index.vue
@@ -0,0 +1,291 @@
+<template>
+	<div class="app-container">
+		<div class="search_form">
+			<div>
+				<span class="search_title">濮撳悕锛�</span>
+				<el-input
+					v-model="searchForm.name"
+					style="width: 240px"
+					placeholder="璇疯緭鍏ュ鍚嶆悳绱�"
+					@change="handleQuery"
+					clearable
+					:prefix-icon="Search"
+				/>
+				<span class="search_title ml10">鏈堜唤锛�</span>
+				<el-date-picker
+					v-model="searchForm.payDateStr"
+					type="month"
+					@change="handleQuery"
+					value-format="YYYY-MM"
+					format="YYYY-MM"
+					placeholder="璇烽�夋嫨鏈堜唤"
+					style="width: 240px"
+					clearable
+				/>
+				<el-button type="primary" @click="handleQuery" style="margin-left: 10px"
+				>鎼滅储</el-button
+				>
+			</div>
+			<div>
+				<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>
+		<div class="table_list">
+			<PIMTable
+				rowKey="id"
+				:column="tableColumn"
+				:tableData="tableData"
+				:page="page"
+				:isSelection="true"
+				@selection-change="handleSelectionChange"
+				:tableLoading="tableLoading"
+				@pagination="pagination"
+				:total="page.total"
+			></PIMTable>
+		</div>
+		<form-dia ref="formDia" @close="handleQuery"></form-dia>
+	</div>
+</template>
+
+<script setup>
+import { Search } from "@element-plus/icons-vue";
+import {onMounted, ref} from "vue";
+import FormDia from "@/views/personnelManagement/payrollManagement/components/formDia.vue";
+import {staffJoinDel} from "@/api/personnelManagement/onboarding.js";
+import {ElMessageBox} from "element-plus";
+import dayjs from "dayjs";
+import {compensationDelete, compensationListPage} from "@/api/personnelManagement/payrollManagement.js";
+
+const data = reactive({
+	searchForm: {
+		name: "",
+		payDateStr: "",
+	},
+});
+const { searchForm } = toRefs(data);
+const tableColumn = ref([
+	{
+		label: "钖祫鏈堜唤",
+		prop: "payDate",
+	},
+	{
+		label: "濮撳悕",
+		prop: "name",
+	},
+	{
+		label: "搴斿嚭鍕ゅぉ鏁�",
+		prop: "shouldAttendedNum",
+		width:100
+	},
+	{
+		label: "瀹為檯鍑哄嫟澶╂暟",
+		prop: "actualAttendedNum",
+		width:110
+	},
+	{
+		label: "鍩烘湰宸ヨ祫",
+		prop: "basicSalary",
+	},
+	{
+		label: "宀椾綅宸ヨ祫",
+		prop: "postSalary",
+		width:100
+	},
+	{
+		label: "鍏ョ鑱岀己鍕ゆ墸娆�",
+		prop: "deductionAbsenteeism",
+		width:130
+	},
+	{
+		label: "鐥呭亣鎵f",
+		prop: "sickLeaveDeductions",
+		width:100
+	},
+	{
+		label: "浜嬪亣鎵f",
+		prop: "deductionPersonalLeave",
+		width:100
+	},
+	{
+		label: "蹇樿鎵撳崱鎵f",
+		prop: "forgetClockDeduct",
+		width:110
+	},
+	{
+		label: "缁╂晥寰楀垎",
+		prop: "performanceScore",
+		width:150
+	},
+	{
+		label: "缁╂晥宸ヨ祫",
+		prop: "performancePay",
+		width: 120
+	},
+	{
+		label: "搴斿彂鍚堣",
+		prop: "payableWages",
+		width:150
+	},
+	{
+		label: "绀句繚涓汉",
+		prop: "socialSecurityIndividuals",
+	},
+	{
+		label: "绀句繚鍏徃",
+		prop: "socialSecurityCompanies",
+		width: 120
+	},
+	{
+		label: "绀句繚鍚堣",
+		prop: "socialSecurityTotal",
+		width: 120
+	},
+	{
+		label: "鍏Н閲戜釜浜�",
+		prop: "providentFundIndividuals",
+		width: 120
+	},
+	{
+		label: "鍏Н閲戝叕鍙�",
+		prop: "providentFundCompany",
+		width: 120
+	},
+	{
+		label: "鍏Н閲戝悎璁�",
+		prop: "providentFundTotal",
+		width: 120
+	},
+	{
+		label: "搴旂◣宸ヨ祫",
+		prop: "taxableWaget",
+	},
+	{
+		label: "涓汉鎵�寰楃◣",
+		prop: "personalIncomeTax",
+		width: 120
+	},
+	{
+		label: "瀹炲彂宸ヨ祫",
+		prop: "actualWages",
+		width: 120
+	},
+	{
+		dataType: "action",
+		label: "鎿嶄綔",
+		align: "center",
+		fixed: 'right',
+		operation: [
+			{
+				name: "缂栬緫",
+				type: "text",
+				clickFun: (row) => {
+					openForm("edit", row);
+				},
+			},
+		],
+	},
+]);
+const tableData = ref([]);
+const selectedRows = ref([]);
+const tableLoading = ref(false);
+const page = reactive({
+	current: 1,
+	size: 100,
+	total: 0,
+});
+const formDia = ref()
+const { proxy } = getCurrentInstance()
+
+const handleDateChange = (value,type) => {
+	searchForm.value.entryDateEnd = null
+	searchForm.value.entryDateStart = null
+	if(type === 1){
+		if (value) {
+			searchForm.value.entryDateStart = dayjs(value).format("YYYY-MM-DD");
+		}
+	}else{
+		if (value) {
+			searchForm.value.entryDateEnd = dayjs(value).format("YYYY-MM-DD");
+		}
+	}
+	getList();
+};
+// 鏌ヨ鍒楄〃
+/** 鎼滅储鎸夐挳鎿嶄綔 */
+const handleQuery = () => {
+	page.current = 1;
+	getList();
+};
+const pagination = (obj) => {
+	page.current = obj.page;
+	page.size = obj.limit;
+	getList();
+};
+const getList = () => {
+	tableLoading.value = true;
+	compensationListPage({...page, ...searchForm.value, staffState: 1}).then(res => {
+		tableLoading.value = false;
+		tableData.value = res.data.records
+		page.total = res.data.total;
+	}).catch(err => {
+		tableLoading.value = false;
+	})
+};
+// 琛ㄦ牸閫夋嫨鏁版嵁
+const handleSelectionChange = (selection) => {
+	selectedRows.value = selection;
+};
+
+// 鎵撳紑寮规
+const openForm = (type, row) => {
+	nextTick(() => {
+		formDia.value?.openDialog(type, row)
+	})
+};
+
+// 鍒犻櫎
+const handleDelete = () => {
+	let ids = [];
+	if (selectedRows.value.length > 0) {
+		ids = selectedRows.value.map((item) => item.id);
+	} else {
+		proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+		return;
+	}
+	ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+		confirmButtonText: "纭",
+		cancelButtonText: "鍙栨秷",
+		type: "warning",
+	})
+		.then(() => {
+			compensationDelete(ids).then((res) => {
+				proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+				getList();
+			});
+		})
+		.catch(() => {
+			proxy.$modal.msg("宸插彇娑�");
+		});
+};
+// 瀵煎嚭
+const handleOut = () => {
+	ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+		confirmButtonText: "纭",
+		cancelButtonText: "鍙栨秷",
+		type: "warning",
+	})
+		.then(() => {
+			proxy.download("/staff/staffJoinLeaveRecord/export", {staffState: 1}, "浜哄憳鍏ヨ亴.xlsx");
+		})
+		.catch(() => {
+			proxy.$modal.msg("宸插彇娑�");
+		});
+};
+onMounted(() => {
+	getList();
+});
+</script>
+
+<style scoped></style>

--
Gitblit v1.9.3