From c22206f91424f5dc81df9c2275b6e0a45a5b47a1 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期一, 15 六月 2026 16:30:13 +0800
Subject: [PATCH] 人员薪资只能审核人可以进行审核
---
src/views/personnelManagement/monthlyStatistics/components/auditDia.vue | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/views/personnelManagement/monthlyStatistics/components/auditDia.vue b/src/views/personnelManagement/monthlyStatistics/components/auditDia.vue
index 48a41f0..e615402 100644
--- a/src/views/personnelManagement/monthlyStatistics/components/auditDia.vue
+++ b/src/views/personnelManagement/monthlyStatistics/components/auditDia.vue
@@ -86,7 +86,7 @@
<script setup>
import { ref, computed, reactive, toRefs, getCurrentInstance, watch } from "vue";
import { ElMessage } from "element-plus";
-import Cookies from "js-cookie";
+import useUserStore from "@/store/modules/user";
import FormDialog from "@/components/Dialog/FormDialog.vue";
import { staffSalaryMainUpdate } from "@/api/personnelManagement/staffSalaryMain.js";
@@ -98,6 +98,7 @@
});
const { proxy } = getCurrentInstance();
+const userStore = useUserStore();
const dialogVisible = computed({
get: () => props.modelValue,
@@ -176,15 +177,21 @@
return;
}
- const username = Cookies.get("username") || "";
- const userIdRaw = Cookies.get("userId");
- const auditUserId = userIdRaw ? Number(userIdRaw) : undefined;
+ const username = userStore.name || "";
+ const currentUserId = Number(userStore.id);
+ const assignedAuditUserId = Number(row?.auditUserId);
+
+ // 鏉冮檺楠岃瘉锛氬彧鏈夋寚瀹氱殑瀹℃牳浜烘墠鑳借繘琛屽鏍�
+ if (!currentUserId || currentUserId !== assignedAuditUserId) {
+ ElMessage.warning("鎮ㄤ笉鏄寚瀹氱殑瀹℃牳浜猴紝鏃犳硶杩涜瀹℃牳鎿嶄綔");
+ return;
+ }
// 鏋勫缓瀹℃牳鏁版嵁
const submitData = {
id: row.id,
status: Number(auditResult.value) === 2 ? 2 : 4, // 2=涓嶉�氳繃 4=閫氳繃(寰呭彂鏀�)
- auditUserId,
+ auditUserId: currentUserId,
auditUserName: username,
};
loading.value = true;
--
Gitblit v1.9.3