| | |
| | | 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> |
| | |
| | | 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']) |
| | |
| | | const testStandardOptions = ref([]); // 指标选择下拉框数据 |
| | | const modelOptions = ref([]); |
| | | const userList = ref([]); // 检验员下拉列表 |
| | | const approverList = ref([]); // 审批人下拉列表 |
| | | const approverNodes = ref([{ id: 1, userId: null }]); |
| | | let nextApproverId = 2; |
| | | const addApproverNode = () => { |
| | |
| | | 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 = { |
| | |
| | | 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; |
| | |
| | | } |
| | | 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) => { |