From b461c6527e3a85e9af59e7680e792bcb5ffb6b7e Mon Sep 17 00:00:00 2001
From: ZN <zhang_12370@163.com>
Date: 星期二, 10 三月 2026 15:53:37 +0800
Subject: [PATCH] Merge branch 'dev_New' of http://114.132.189.42:9002/r/product-inventory-management into dev_New
---
src/views/personnelManagement/socialSecuritySet/components/formDia.vue | 1
src/layout/components/Sidebar/Logo.vue | 4
src/views/personnelManagement/monthlyStatistics/components/formDia.vue | 259 ++++++++++++++++++++-----
src/components/Dialog/FormDialog.vue | 20 +
src/views/personnelManagement/monthlyStatistics/index.vue | 93 ++++-----
src/views/personnelManagement/monthlyStatistics/components/auditDia.vue | 216 +++++++++++++++++++++
6 files changed, 480 insertions(+), 113 deletions(-)
diff --git a/src/components/Dialog/FormDialog.vue b/src/components/Dialog/FormDialog.vue
index 1425b6d..8b657de 100644
--- a/src/components/Dialog/FormDialog.vue
+++ b/src/components/Dialog/FormDialog.vue
@@ -8,14 +8,18 @@
<slot></slot>
<template #footer>
<div class="dialog-footer">
- <el-button
- v-if="showConfirm"
- type="primary"
- @click="handleConfirm"
- >
- 纭
- </el-button>
- <el-button @click="handleCancel">鍙栨秷</el-button>
+ <!-- 鑷畾涔夋寜閽彃妲� -->
+ <slot name="footer">
+ <!-- 榛樿鎸夐挳 -->
+ <el-button
+ v-if="showConfirm"
+ type="primary"
+ @click="handleConfirm"
+ >
+ 纭
+ </el-button>
+ <el-button @click="handleCancel">鍙栨秷</el-button>
+ </slot>
</div>
</template>
</el-dialog>
diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue
index 32919a9..f8f1da3 100644
--- a/src/layout/components/Sidebar/Logo.vue
+++ b/src/layout/components/Sidebar/Logo.vue
@@ -2,11 +2,11 @@
<div class="sidebar-logo-container" :class="{ 'collapse': collapse }">
<transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
-<!-- <img v-if="logoUrl" :src="logoUrl" class="sidebar-logo" @error="handleImageError" alt="鍏徃Logo" />-->
+ <img v-if="logoUrl" :src="logoUrl" class="sidebar-logo" @error="handleImageError" alt="鍏徃Logo" />
<h1 class="sidebar-title">{{ title }}</h1>
</router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
-<!-- <img v-if="logoUrl" :src="logoUrl" class="sidebar-logo" @error="handleImageError" alt="鍏徃Logo" />-->
+ <img v-if="logoUrl" :src="logoUrl" class="sidebar-logo" @error="handleImageError" alt="鍏徃Logo" />
<h1 class="sidebar-title">{{ title }}</h1>
</router-link>
</transition>
diff --git a/src/views/personnelManagement/monthlyStatistics/components/auditDia.vue b/src/views/personnelManagement/monthlyStatistics/components/auditDia.vue
new file mode 100644
index 0000000..48a41f0
--- /dev/null
+++ b/src/views/personnelManagement/monthlyStatistics/components/auditDia.vue
@@ -0,0 +1,216 @@
+<template>
+ <FormDialog
+ v-model="dialogVisible"
+ title="宸ヨ祫瀹℃牳"
+ width="900px"
+ @close="handleClose"
+ >
+ <!-- 宸ヨ祫琛ㄥ熀纭�淇℃伅 -->
+ <el-card shadow="never" style="margin-bottom: 16px;">
+ <template #header>
+ <span>宸ヨ祫琛ㄤ俊鎭�</span>
+ </template>
+ <el-descriptions :column="3" border>
+ <el-descriptions-item label="宸ヨ祫涓婚">{{ auditData?.salaryTitle || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="宸ヨ祫鏈堜唤">{{ auditData?.salaryMonth || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="宸ヨ祫鎬婚">楼 {{ formatMoney(auditData?.totalSalary) }}</el-descriptions-item>
+ <el-descriptions-item label="鏀粯閾惰">{{ auditData?.payBank || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="瀹℃牳浜�">{{ auditData?.auditUserName || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="澶囨敞">{{ auditData?.remark || '-' }}</el-descriptions-item>
+ </el-descriptions>
+ </el-card>
+
+ <!-- 鍛樺伐宸ヨ祫鏄庣粏 -->
+ <el-card shadow="never" style="margin-bottom: 16px;">
+ <template #header>
+ <span>鍛樺伐宸ヨ祫鏄庣粏</span>
+ </template>
+ <div v-if="!employeeList || employeeList.length === 0" style="text-align: center; padding: 20px; color: #909399;">
+ <div>鏆傛棤鍛樺伐宸ヨ祫鏄庣粏鏁版嵁</div>
+ <div style="font-size: 12px; margin-top: 5px;">鍛樺伐鏄庣粏鏁版嵁闇�瑕佸湪宸ヨ祫琛ㄧ敓鎴愭垨缂栬緫鏃舵墠浼氫繚瀛�</div>
+ </div>
+ <div v-else>
+ <el-table :data="employeeList" border max-height="300" style="width: 100%">
+ <el-table-column prop="staffName" label="鍛樺伐濮撳悕" width="100" />
+ <el-table-column prop="deptName" label="閮ㄩ棬" width="120" />
+ <el-table-column prop="basicSalary" label="鍩烘湰宸ヨ祫" width="100" align="right">
+ <template #default="{ row }">楼 {{ formatMoney(row.basicSalary) }}</template>
+ </el-table-column>
+ <el-table-column prop="pieceSalary" label="璁′欢宸ヨ祫" width="100" align="right">
+ <template #default="{ row }">楼 {{ formatMoney(row.pieceSalary) }}</template>
+ </el-table-column>
+ <el-table-column prop="hourlySalary" label="璁℃椂宸ヨ祫" width="100" align="right">
+ <template #default="{ row }">楼 {{ formatMoney(row.hourlySalary) }}</template>
+ </el-table-column>
+ <el-table-column prop="otherIncome" label="鍏朵粬鏀跺叆" width="100" align="right">
+ <template #default="{ row }">楼 {{ formatMoney(row.otherIncome) }}</template>
+ </el-table-column>
+ <el-table-column prop="socialPersonal" label="绀句繚涓汉" width="100" align="right">
+ <template #default="{ row }">楼 {{ formatMoney(row.socialPersonal) }}</template>
+ </el-table-column>
+ <el-table-column prop="fundPersonal" label="鍏Н閲戜釜浜�" width="120" align="right">
+ <template #default="{ row }">楼 {{ formatMoney(row.fundPersonal) }}</template>
+ </el-table-column>
+ <el-table-column prop="salaryTax" label="宸ヨ祫涓◣" width="100" align="right">
+ <template #default="{ row }">楼 {{ formatMoney(row.salaryTax) }}</template>
+ </el-table-column>
+ <el-table-column prop="netSalary" label="瀹炲彂宸ヨ祫" width="100" align="right" fixed="right">
+ <template #default="{ row }">楼 {{ formatMoney(row.netSalary) }}</template>
+ </el-table-column>
+ </el-table>
+ <div style="margin-top: 10px; text-align: right; font-weight: bold;">
+ 宸ヨ祫鎬婚锛毬� {{ formatMoney(totalSalary) }}
+ </div>
+ </div>
+ </el-card>
+
+ <!-- 瀹℃牳鎿嶄綔 -->
+ <el-form label-position="top">
+ <el-form-item label="瀹℃牳缁撴灉" required>
+ <el-radio-group v-model="auditResult">
+ <el-radio :value="4">閫氳繃</el-radio>
+ <el-radio :value="2">涓嶉�氳繃</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-form>
+
+ <template #footer>
+ <el-button type="primary" :loading="loading" @click="handleConfirm">
+ 纭畾
+ </el-button>
+ <el-button @click="handleClose">鍙栨秷</el-button>
+ </template>
+ </FormDialog>
+</template>
+
+<script setup>
+import { ref, computed, reactive, toRefs, getCurrentInstance, watch } from "vue";
+import { ElMessage } from "element-plus";
+import Cookies from "js-cookie";
+import FormDialog from "@/components/Dialog/FormDialog.vue";
+import { staffSalaryMainUpdate } from "@/api/personnelManagement/staffSalaryMain.js";
+
+const emit = defineEmits(["update:modelValue", "close", "success"]);
+
+const props = defineProps({
+ modelValue: { type: Boolean, default: false },
+ row: { type: Object, default: () => ({}) },
+});
+
+const { proxy } = getCurrentInstance();
+
+const dialogVisible = computed({
+ get: () => props.modelValue,
+ set: (val) => emit("update:modelValue", val),
+});
+
+const loading = ref(false);
+const auditResult = ref(4); // 榛樿閫氳繃
+const auditData = ref({});
+const employeeList = ref([]);
+
+// 鐩戝惉row鏁版嵁鍙樺寲
+watch(() => props.row, (newRow) => {
+ if (newRow && Object.keys(newRow).length > 0) {
+ loadAuditData(newRow);
+ }
+}, { immediate: true });
+
+// 鏍煎紡鍖栭噾棰�
+const formatMoney = (value) => {
+ const num = Number(value) || 0;
+ return num.toFixed(2);
+};
+
+// 璁$畻宸ヨ祫鎬婚
+const totalSalary = computed(() => {
+ return employeeList.value.reduce((sum, e) => {
+ const salary = Number(e.netSalary) || 0;
+ return sum + salary;
+ }, 0);
+});
+
+// 鍔犺浇瀹℃牳鏁版嵁
+const loadAuditData = (row) => {
+ auditData.value = row || {};
+ auditResult.value = 4; // 榛樿閫夋嫨閫氳繃
+
+ // 鍔犺浇鍛樺伐宸ヨ祫鏄庣粏鏁版嵁
+ if (row?.staffSalaryDetailList && Array.isArray(row.staffSalaryDetailList)) {
+ employeeList.value = row.staffSalaryDetailList.map((e) => ({
+ staffName: e.staffName ?? "",
+ deptName: e.deptName ?? "",
+ basicSalary: Number(e.basicSalary) || 0,
+ pieceSalary: Number(e.pieceSalary) || 0,
+ hourlySalary: Number(e.hourlySalary) || 0,
+ otherIncome: Number(e.otherIncome) || 0,
+ socialPersonal: Number(e.socialPersonal) || 0,
+ fundPersonal: Number(e.fundPersonal) || 0,
+ salaryTax: Number(e.salaryTax) || 0,
+ netSalary: Number(e.netSalary) || 0,
+ }));
+ } else {
+ console.log('娌℃湁鎵惧埌鍛樺伐鏄庣粏鏁版嵁');
+ employeeList.value = [];
+ }
+};
+
+// 鎵撳紑寮圭獥
+const openDialog = (row) => {
+ loadAuditData(row);
+ dialogVisible.value = true;
+};
+
+// 鍏抽棴寮圭獥
+const handleClose = () => {
+ dialogVisible.value = false;
+ emit("close");
+};
+
+// 纭瀹℃牳
+const handleConfirm = () => {
+ try {
+ const row = auditData.value;
+ if (!row?.id) {
+ ElMessage.warning("鏁版嵁寮傚父锛岃閲嶈瘯");
+ return;
+ }
+
+ const username = Cookies.get("username") || "";
+ const userIdRaw = Cookies.get("userId");
+ const auditUserId = userIdRaw ? Number(userIdRaw) : undefined;
+
+ // 鏋勫缓瀹℃牳鏁版嵁
+ const submitData = {
+ id: row.id,
+ status: Number(auditResult.value) === 2 ? 2 : 4, // 2=涓嶉�氳繃 4=閫氳繃(寰呭彂鏀�)
+ auditUserId,
+ auditUserName: username,
+ };
+ loading.value = true;
+ staffSalaryMainUpdate(submitData)
+ .then(() => {
+ ElMessage.success("瀹℃牳鎴愬姛");
+ dialogVisible.value = false;
+ emit("success");
+ })
+ .catch((error) => {
+ console.error('瀹℃牳澶辫触:', error)
+ })
+ .finally(() => {
+ loading.value = false;
+ });
+ } catch (error) {
+ console.error('瀹℃牳澶勭悊寮傚父:', error);
+ loading.value = false;
+ }
+};
+
+defineExpose({ openDialog });
+</script>
+
+<style scoped>
+:deep(.el-descriptions__label) {
+ width: 100px;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/personnelManagement/monthlyStatistics/components/formDia.vue b/src/views/personnelManagement/monthlyStatistics/components/formDia.vue
index e3105d2..36c2ec3 100644
--- a/src/views/personnelManagement/monthlyStatistics/components/formDia.vue
+++ b/src/views/personnelManagement/monthlyStatistics/components/formDia.vue
@@ -4,9 +4,12 @@
:title="operationType === 'add' ? '鏂板缓宸ヨ祫琛�' : '缂栬緫宸ヨ祫琛�'"
width="90%"
@close="closeDia"
- @confirm="submitForm"
- @cancel="closeDia"
>
+ <template #footer>
+ <el-button type="info" @click="saveDraft">淇濆瓨鑽夌</el-button>
+ <el-button type="primary" @click="submitForm">纭鎻愪氦</el-button>
+ <el-button @click="closeDia">鍙栨秷</el-button>
+ </template>
<div class="form-dia-body">
<!-- 鍩虹璧勬枡 -->
<el-card class="form-card" shadow="never">
@@ -34,7 +37,6 @@
placeholder="璇烽�夋嫨"
clearable
multiple
- collapse-tags
collapse-tags-tooltip
style="width: 100%"
>
@@ -89,6 +91,24 @@
</el-select>
</el-form-item>
</el-col>
+ <el-col :span="6">
+ <el-form-item label="瀹℃牳浜�" prop="auditUserId">
+ <el-select
+ v-model="form.auditUserId"
+ placeholder="璇烽�夋嫨瀹℃牳浜�"
+ clearable
+ filterable
+ style="width: 100%"
+ >
+ <el-option
+ v-for="item in userList"
+ :key="item.userId"
+ :label="item.nickName"
+ :value="item.userId"
+ />
+ </el-select>
+ </el-form-item>
+ </el-col>
</el-row>
</el-form>
</el-card>
@@ -96,10 +116,7 @@
<!-- 鎿嶄綔鎸夐挳 -->
<div class="toolbar">
<el-button type="primary" @click="handleGenerate">鐢熸垚宸ヨ祫琛�</el-button>
- <el-button @click="handleExport">瀵煎嚭</el-button>
- <el-button @click="handleImport">瀵煎叆</el-button>
<el-button @click="handleClear">娓呯┖</el-button>
- <el-button @click="openAddPerson">鏂板浜哄憳</el-button>
<el-button @click="handleBatchDelete">鍒犻櫎</el-button>
<el-button @click="handleTaxForm">涓◣琛�</el-button>
</div>
@@ -182,6 +199,70 @@
/>
</template>
</el-table-column>
+ <el-table-column label="鍏朵粬鏀嚭" minWidth="110">
+ <template #default="{ row }">
+ <el-input
+ v-model.number="row.otherDeduct"
+ type="number"
+ placeholder="0"
+ size="small"
+ @input="row.otherDeduct = parseNum(row.otherDeduct)"
+ />
+ </template>
+ </el-table-column>
+ <el-table-column label="宸ヨ祫涓◣" minWidth="110">
+ <template #default="{ row }">
+ <el-input
+ v-model.number="row.salaryTax"
+ type="number"
+ placeholder="0"
+ size="small"
+ @input="row.salaryTax = parseNum(row.salaryTax)"
+ />
+ </template>
+ </el-table-column>
+ <el-table-column label="搴斿彂宸ヨ祫" minWidth="110">
+ <template #default="{ row }">
+ <el-input
+ v-model.number="row.grossSalary"
+ type="number"
+ placeholder="0"
+ size="small"
+ @input="row.grossSalary = parseNum(row.grossSalary)"
+ />
+ </template>
+ </el-table-column>
+ <el-table-column label="搴旀墸宸ヨ祫" minWidth="110">
+ <template #default="{ row }">
+ <el-input
+ v-model.number="row.deductSalary"
+ type="number"
+ placeholder="0"
+ size="small"
+ @input="row.deductSalary = parseNum(row.deductSalary)"
+ />
+ </template>
+ </el-table-column>
+ <el-table-column label="瀹炲彂宸ヨ祫" minWidth="110">
+ <template #default="{ row }">
+ <el-input
+ v-model.number="row.netSalary"
+ type="number"
+ placeholder="0"
+ size="small"
+ @input="row.netSalary = parseNum(row.netSalary)"
+ />
+ </template>
+ </el-table-column>
+ <el-table-column label="澶囨敞" minWidth="120">
+ <template #default="{ row }">
+ <el-input
+ v-model="row.remark"
+ placeholder="璇疯緭鍏�"
+ size="small"
+ />
+ </template>
+ </el-table-column>
<el-table-column label="鎿嶄綔" width="80" align="center" fixed="right">
<template #default="{ row }">
<el-button type="primary" link @click="removeEmployee(row)">鍒犻櫎</el-button>
@@ -189,6 +270,10 @@
</el-table-column>
</el-table>
<div v-if="!employeeList.length" class="table-empty">鏆傛棤鏁版嵁</div>
+ <div v-else class="salary-total">
+ <span class="total-label">宸ヨ祫鎬婚锛�</span>
+ <span class="total-value">楼 {{ totalSalary.toFixed(2) }}</span>
+ </div>
</div>
</div>
@@ -262,6 +347,8 @@
staffSalaryMainUpdate,
staffSalaryMainCalculateSalary,
} from "@/api/personnelManagement/staffSalaryMain.js";
+import { userListNoPageByTenantId } from "@/api/system/user.js";
+
const emit = defineEmits(["update:modelValue", "close"]);
const props = defineProps({
@@ -287,6 +374,7 @@
const employeeList = ref([]);
const selectedEmployees = ref([]);
const bankOptions = ref([]);
+const userList = ref([]);
const taxTableData = ref([
{ level: 1, range: "涓嶈秴杩�36000鍏�", rate: 3, quickDeduction: 0 },
{ level: 2, range: "瓒呰繃36000-144000鍏�", rate: 10, quickDeduction: 2520 },
@@ -312,14 +400,28 @@
salaryMonth: "",
remark: "",
payBank: "",
+ auditUserId: undefined,
},
rules: {
salaryTitle: [{ required: true, message: "璇疯緭鍏ュ伐璧勪富棰�", trigger: "blur" }],
deptIds: [{ required: true, message: "璇烽�夋嫨閮ㄩ棬", trigger: "change" }],
salaryMonth: [{ required: true, message: "璇烽�夋嫨宸ヨ祫鏈堜唤", trigger: "change" }],
+ auditUserId: [{ required: true, message: "璇烽�夋嫨瀹℃牳浜�", trigger: "change" }],
},
});
const { form, rules } = toRefs(data);
+
+// 璁$畻宸ヨ祫鎬婚锛堟墍鏈夊憳宸ュ疄鍙戝伐璧勪箣鍜岋級
+const totalSalary = computed(() => {
+ return employeeList.value.reduce((sum, e) => sum + parseNum(e.netSalary), 0);
+});
+
+// 鏍规嵁瀹℃牳浜篒D鑾峰彇瀹℃牳浜哄悕绉�
+const auditUserName = computed(() => {
+ if (!form.value.auditUserId) return "";
+ const user = userList.value.find(u => u.userId === form.value.auditUserId);
+ return user ? user.nickName : "";
+});
const loadBankOptions = () => {
return bankList().then((res) => {
@@ -327,6 +429,12 @@
bankOptions.value = list
.map((b) => (b?.bankName == null ? "" : String(b.bankName).trim()))
.filter((v) => v !== "");
+ });
+};
+
+const loadUserList = () => {
+ return userListNoPageByTenantId().then((res) => {
+ userList.value = res.data || [];
});
};
@@ -389,6 +497,7 @@
nextTick(() => {
loadDeptOptions();
loadBankOptions();
+ loadUserList();
employeeList.value = [];
Object.assign(form.value, {
id: undefined,
@@ -397,6 +506,7 @@
salaryMonth: "",
remark: "",
payBank: "",
+ auditUserId: undefined,
});
// 缂栬緫锛氬垪琛ㄩ〉宸茶繑鍥炰富琛ㄥ瓧娈碉紱杩欓噷鍙仛鍥炴樉锛堟槑缁嗙敱鈥滅敓鎴愬伐璧勮〃/璁$畻宸ヨ祫鈥濆緱鍒帮級
if (type === "edit" && row?.id) {
@@ -409,6 +519,30 @@
form.value.salaryMonth = row.salaryMonth ?? "";
form.value.remark = row.remark ?? "";
form.value.payBank = row.payBank ?? "";
+ form.value.auditUserId = row.auditUserId ?? undefined;
+
+ // 濡傛灉鏈夊憳宸ユ槑缁嗘暟鎹紝鐩存帴鍙嶆樉
+ if (row.staffSalaryDetailList && row.staffSalaryDetailList.length > 0) {
+ employeeList.value = row.staffSalaryDetailList.map((e) => ({
+ staffOnJobId: e.staffOnJobId ?? e.staffId ?? e.id,
+ id: e.staffOnJobId ?? e.staffId ?? e.id,
+ staffName: e.staffName ?? "",
+ postName: e.postName ?? "",
+ deptName: e.deptName ?? "",
+ basicSalary: parseNum(e.basicSalary),
+ pieceSalary: parseNum(e.pieceSalary),
+ hourlySalary: parseNum(e.hourlySalary),
+ otherIncome: parseNum(e.otherIncome),
+ socialPersonal: parseNum(e.socialPersonal),
+ fundPersonal: parseNum(e.fundPersonal),
+ otherDeduct: parseNum(e.otherDeduct),
+ salaryTax: parseNum(e.salaryTax),
+ grossSalary: parseNum(e.grossSalary),
+ deductSalary: parseNum(e.deductSalary),
+ netSalary: parseNum(e.netSalary),
+ remark: e.remark ?? "",
+ }));
+ }
}
});
};
@@ -522,14 +656,6 @@
});
};
-const handleExport = () => {
- proxy.$modal.msgInfo("瀵煎嚭鍔熻兘闇�瀵规帴鍚庣");
-};
-
-const handleImport = () => {
- proxy.$modal.msgInfo("瀵煎叆鍔熻兘闇�瀵规帴鍚庣");
-};
-
const handleClear = () => {
proxy.$modal.confirm("纭畾娓呯┖褰撳墠鍛樺伐鍒楄〃鍚楋紵").then(() => {
employeeList.value = [];
@@ -543,44 +669,58 @@
const submitForm = () => {
formRef.value?.validate((valid) => {
if (!valid) return;
- const payload = {
- id: form.value.id,
- salaryTitle: form.value.salaryTitle,
- deptIds: form.value.deptIds?.length ? form.value.deptIds.join(",") : "",
- salaryMonth: form.value.salaryMonth,
- remark: form.value.remark,
- payBank: form.value.payBank,
- staffSalaryDetailList: employeeList.value.map((e) => ({
- staffOnJobId: e.staffOnJobId ?? e.staffId ?? e.id,
- staffName: e.staffName,
- postName: e.postName ?? "",
- deptName: e.deptName ?? "",
- basicSalary: parseNum(e.basicSalary),
- pieceSalary: parseNum(e.pieceSalary),
- hourlySalary: parseNum(e.hourlySalary),
- otherIncome: parseNum(e.otherIncome),
- socialPersonal: parseNum(e.socialPersonal),
- fundPersonal: parseNum(e.fundPersonal),
- otherDeduct: parseNum(e.otherDeduct),
- salaryTax: parseNum(e.salaryTax),
- grossSalary: parseNum(e.grossSalary),
- deductSalary: parseNum(e.deductSalary),
- netSalary: parseNum(e.netSalary),
- remark: e.remark ?? "",
- })),
- };
- if (props.operationType === "add") {
- staffSalaryMainAdd({ ...payload, status: 1 }).then(() => {
- proxy.$modal.msgSuccess("鏂板鎴愬姛");
- closeDia();
- });
- } else {
- staffSalaryMainUpdate(payload).then(() => {
- proxy.$modal.msgSuccess("淇敼鎴愬姛");
- closeDia();
- });
- }
+ saveData(3); // 纭鎻愪氦锛岀姸鎬佷负3锛堝緟瀹℃牳锛�
});
+};
+
+const saveDraft = () => {
+ formRef.value?.validate((valid) => {
+ if (!valid) return;
+ saveData(1); // 淇濆瓨鑽夌锛岀姸鎬佷负1锛堣崏绋匡級
+ });
+};
+
+const saveData = (status) => {
+ const payload = {
+ id: form.value.id,
+ salaryTitle: form.value.salaryTitle,
+ deptIds: form.value.deptIds?.length ? form.value.deptIds.join(",") : "",
+ salaryMonth: form.value.salaryMonth,
+ remark: form.value.remark,
+ payBank: form.value.payBank,
+ auditUserId: form.value.auditUserId,
+ auditUserName: auditUserName.value,
+ totalSalary: totalSalary.value,
+ staffSalaryDetailList: employeeList.value.map((e) => ({
+ staffOnJobId: e.staffOnJobId ?? e.staffId ?? e.id,
+ staffName: e.staffName,
+ postName: e.postName ?? "",
+ deptName: e.deptName ?? "",
+ basicSalary: parseNum(e.basicSalary),
+ pieceSalary: parseNum(e.pieceSalary),
+ hourlySalary: parseNum(e.hourlySalary),
+ otherIncome: parseNum(e.otherIncome),
+ socialPersonal: parseNum(e.socialPersonal),
+ fundPersonal: parseNum(e.fundPersonal),
+ otherDeduct: parseNum(e.otherDeduct),
+ salaryTax: parseNum(e.salaryTax),
+ grossSalary: parseNum(e.grossSalary),
+ deductSalary: parseNum(e.deductSalary),
+ netSalary: parseNum(e.netSalary),
+ remark: e.remark ?? "",
+ })),
+ };
+ if (props.operationType === "add") {
+ staffSalaryMainAdd({ ...payload, status }).then(() => {
+ proxy.$modal.msgSuccess(status === 1 ? "鑽夌淇濆瓨鎴愬姛" : "鎻愪氦鎴愬姛");
+ closeDia();
+ });
+ } else {
+ staffSalaryMainUpdate({ ...payload, status }).then(() => {
+ proxy.$modal.msgSuccess(status === 1 ? "鑽夌淇濆瓨鎴愬姛" : "鎻愪氦鎴愬姛");
+ closeDia();
+ });
+ }
};
const closeDia = () => {
@@ -644,4 +784,21 @@
.dialog-footer {
text-align: right;
}
+.salary-total {
+ margin-top: 16px;
+ padding: 12px 16px;
+ background-color: #f5f7fa;
+ border-radius: 4px;
+ text-align: right;
+ font-size: 16px;
+}
+.salary-total .total-label {
+ color: #606266;
+ margin-right: 8px;
+}
+.salary-total .total-value {
+ color: #f56c6c;
+ font-weight: bold;
+ font-size: 18px;
+}
</style>
diff --git a/src/views/personnelManagement/monthlyStatistics/index.vue b/src/views/personnelManagement/monthlyStatistics/index.vue
index 40d450b..f389f57 100644
--- a/src/views/personnelManagement/monthlyStatistics/index.vue
+++ b/src/views/personnelManagement/monthlyStatistics/index.vue
@@ -4,7 +4,7 @@
<div>
<span class="search_title">涓婚锛�</span>
<el-input
- v-model="searchForm.title"
+ v-model="searchForm.salaryTitle"
style="width: 240px"
placeholder="璇疯緭鍏ヤ富棰�"
clearable
@@ -81,28 +81,18 @@
</el-form-item>
</el-form>
<template #footer>
- <el-button @click="issueDialogVisible = false">鍙栨秷</el-button>
<el-button type="primary" :loading="issueLoading" @click="confirmIssue">
纭畾
</el-button>
+ <el-button @click="issueDialogVisible = false">鍙栨秷</el-button>
</template>
</el-dialog>
- <el-dialog v-model="auditDialogVisible" title="宸ヨ祫瀹℃牳" width="720px">
- <el-form label-position="top">
- <el-form-item label="瀹℃牳缁撴灉" required>
- <el-radio-group v-model="auditForm.result">
- <el-radio :value="4">閫氳繃</el-radio>
- <el-radio :value="2">涓嶉�氳繃</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-form>
- <template #footer>
- <el-button @click="auditDialogVisible = false">鍙栨秷</el-button>
- <el-button type="primary" :loading="auditLoading" @click="confirmAudit">
- 纭畾
- </el-button>
- </template>
- </el-dialog>
+ <audit-dia
+ v-model="auditDialogVisible"
+ :row="auditRow"
+ @close="auditDialogVisible = false"
+ @success="handleAuditSuccess"
+ />
</div>
</template>
@@ -120,6 +110,7 @@
import Cookies from "js-cookie";
import FormDia from "./components/formDia.vue";
import BankSettingDia from "./components/bankSettingDia.vue";
+import AuditDia from "./components/auditDia.vue";
import PIMTable from "@/components/PIMTable/PIMTable.vue";
import { bankList } from "@/api/personnelManagement/bank.js";
import {
@@ -130,7 +121,7 @@
const data = reactive({
searchForm: {
- title: "",
+ salaryTitle: "",
status: "",
salaryMonth: "",
},
@@ -140,7 +131,22 @@
const tableColumn = ref([
{ label: "宸ヨ祫涓婚", prop: "salaryTitle", minWidth: 140 },
{ label: "宸ヨ祫鏈堜唤", prop: "salaryMonth", width: 120 },
- { label: "鐘舵��", prop: "statusName", width: 110 },
+ {
+ label: "鐘舵��",
+ prop: "statusName",
+ width: 110,
+ dataType: "tag",
+ formatType: (status) => {
+ const statusMap = {
+ "鑽夌": "info",
+ "瀹℃牳鏈�氳繃": "danger",
+ "寰呭鏍�": "warning",
+ "寰呭彂鏀�": "primary",
+ "宸插彂鏀�": "success"
+ };
+ return statusMap[status] || "info";
+ }
+ },
{ label: "宸ヨ祫鎬婚", prop: "totalSalary", width: 120 },
{ label: "鏀粯閾惰", prop: "payBank", width: 120 },
{ label: "瀹℃牳浜�", prop: "auditUserName", width: 110 },
@@ -155,19 +161,19 @@
{
name: "缂栬緫",
type: "text",
- showHide: (row) => Number(row?.status) === 1 || Number(row?.status) === 2,
+ disabled: (row) => Number(row?.status) !== 1 && Number(row?.status) !== 2,
clickFun: (row) => openForm("edit", row),
},
{
name: "瀹℃牳",
type: "text",
- showHide: (row) => Number(row?.status) === 3,
+ disabled: (row) => Number(row?.status) !== 3,
clickFun: (row) => openAudit(row),
},
{
name: "鍙戞斁",
type: "text",
- showHide: (row) => Number(row?.status) === 4,
+ disabled: (row) => Number(row?.status) !== 4,
clickFun: (row) => openIssue(row),
},
],
@@ -195,9 +201,8 @@
const issueRow = ref(null);
const issueForm = reactive({ bank: "" });
const auditDialogVisible = ref(false);
-const auditLoading = ref(false);
const auditRow = ref(null);
-const auditForm = reactive({ result: 4 }); // 4=閫氳繃(寰呭彂鏀�) 2=涓嶉�氳繃
+const auditDiaRef = ref(null);
const issueBankOptions = computed(() => {
const options = Array.isArray(bankSetting.value?.options) ? bankSetting.value.options : [];
@@ -235,7 +240,7 @@
};
const handleReset = () => {
- searchForm.value.title = "";
+ searchForm.value.salaryTitle = "";
searchForm.value.status = "";
searchForm.value.salaryMonth = "";
page.current = 1;
@@ -258,6 +263,7 @@
.then((res) => {
tableLoading.value = false;
const records = res.data?.records ?? res.data?.list ?? [];
+ console.log('鍒楄〃鎺ュ彛杩斿洖鏁版嵁:', records);
// 鍏煎鍚庣瀛楁锛氳嫢鎺ュ彛浠嶈繑鍥炲彴璐︾粨鏋勶紝鍙湪姝ゅ仛鏄犲皠
tableData.value = records.map((item) => ({
...item,
@@ -293,9 +299,16 @@
};
const openAudit = (row) => {
+ console.log('鎵撳紑瀹℃牳锛屼紶鍏ョ殑鏁版嵁:', row);
auditRow.value = row || null;
- auditForm.result = 4;
auditDialogVisible.value = true;
+ nextTick(() => {
+ auditDiaRef.value?.openDialog(row);
+ });
+};
+
+const handleAuditSuccess = () => {
+ getList();
};
const openIssue = (row) => {
@@ -309,31 +322,7 @@
issueDialogVisible.value = true;
};
-const confirmAudit = () => {
- const row = auditRow.value;
- if (!row?.id) {
- auditDialogVisible.value = false;
- return;
- }
- const username = Cookies.get("username") || "";
- const userIdRaw = Cookies.get("userId");
- const auditUserId = userIdRaw ? Number(userIdRaw) : undefined;
- auditLoading.value = true;
- staffSalaryMainUpdate({
- id: row.id,
- status: Number(auditForm.result) === 2 ? 2 : 4,
- auditUserId,
- auditUserName: username,
- })
- .then(() => {
- proxy?.$modal?.msgSuccess?.("瀹℃牳鎴愬姛");
- auditDialogVisible.value = false;
- getList();
- })
- .finally(() => {
- auditLoading.value = false;
- });
-};
+
const confirmIssue = () => {
const bank = issueForm.bank ? String(issueForm.bank).trim() : "";
diff --git a/src/views/personnelManagement/socialSecuritySet/components/formDia.vue b/src/views/personnelManagement/socialSecuritySet/components/formDia.vue
index c473f17..71f5e61 100644
--- a/src/views/personnelManagement/socialSecuritySet/components/formDia.vue
+++ b/src/views/personnelManagement/socialSecuritySet/components/formDia.vue
@@ -200,6 +200,7 @@
{ label: "澶变笟淇濋櫓", value: "澶变笟淇濋櫓" },
{ label: "宸ヤ激淇濋櫓", value: "宸ヤ激淇濋櫓" },
{ label: "鐢熻偛淇濋櫓", value: "鐢熻偛淇濋櫓" },
+ { label: "鍏Н閲�", value: "鍏Н閲�" },
];
const defaultBenefit = () => ({
--
Gitblit v1.9.3