| | |
| | | <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"; |
| | | |
| | |
| | | }); |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const userStore = useUserStore(); |
| | | |
| | | const dialogVisible = computed({ |
| | | get: () => props.modelValue, |
| | |
| | | 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; |