From 140fe3938619e859955eb9b446591179ffe5e47a Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期二, 21 四月 2026 15:09:38 +0800
Subject: [PATCH] 更新审批人选择逻辑
---
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue b/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
index 5fe236c..a61c4d8 100644
--- a/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
+++ b/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
@@ -156,9 +156,9 @@
filterable
style="width: 100%">
<el-option
- v-for="item in userList"
+ v-for="item in approverList"
:key="item.userId"
- :label="item.nickName"
+ :label="item.userName"
:value="item.userId"
/>
</el-select>
@@ -200,6 +200,7 @@
import {qualityInspectParamDel, qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
import {qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId} from "@/api/qualityManagement/metricMaintenance.js";
import {userListNoPage} from "@/api/system/user.js";
+import { approveUserList } from "@/api/collaborativeApproval/approvalProcess.js";
const {proxy} = getCurrentInstance()
const emit = defineEmits(['close'])
@@ -271,6 +272,7 @@
const testStandardOptions = ref([]); // 鎸囨爣閫夋嫨涓嬫媺妗嗘暟鎹�
const modelOptions = ref([]);
const userList = ref([]); // 妫�楠屽憳涓嬫媺鍒楄〃
+const approverList = ref([]); // 瀹℃壒浜轰笅鎷夊垪琛�
const approverNodes = ref([{ id: 1, userId: null }]);
let nextApproverId = 2;
const addApproverNode = () => {
@@ -296,9 +298,12 @@
try {
const userRes = await userListNoPage();
userList.value = userRes.data || [];
+ const approverRes = await approveUserList({ approveType: 9 });
+ approverList.value = approverRes.data || [];
} catch (e) {
- console.error("鍔犺浇妫�楠屽憳鍒楄〃澶辫触", e);
+ console.error("鍔犺浇浜哄憳鍒楄〃澶辫触", e);
userList.value = [];
+ approverList.value = [];
}
// 鍏堥噸缃〃鍗曟暟鎹紙淇濇寔瀛楁瀹屾暣锛岄伩鍏嶅脊绐楅娆℃覆鏌撴椂瑙﹀彂蹇呭~绾㈡鈥滈棯涓�涓嬧�濓級
form.value = {
@@ -340,7 +345,7 @@
nextApproverId = ids.length + 1;
}
} else if (form.value.reviewName) {
- const matchedReviewer = userList.value.find(item => item.nickName === form.value.reviewName);
+ const matchedReviewer = approverList.value.find(item => item.userName === form.value.reviewName);
if (matchedReviewer?.userId) {
approverNodes.value = [{ id: 1, userId: matchedReviewer.userId }];
nextApproverId = 2;
@@ -476,8 +481,8 @@
}
const approveUserIds = approverNodes.value.map(node => node.userId).join(",");
const firstApproverName =
- userList.value.find(item => String(item.userId) === String(approverNodes.value[0]?.userId))
- ?.nickName || "";
+ approverList.value.find(item => String(item.userId) === String(approverNodes.value[0]?.userId))
+ ?.userName || "";
form.value.inspectType = 0
if (operationType.value === "add") {
tableData.value.forEach((item) => {
--
Gitblit v1.9.3