From 70551b35cac6dd0262f644cb248ba1d03ff2fa08 Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期五, 22 五月 2026 14:53:10 +0800
Subject: [PATCH] feat: 质量管理检验员筛选和传递优化 1. 检验员下拉框筛选:过程检验、出厂检验、原材料检验的检验员下拉框只显示 roleIds 包含 106 的用户,包括列表页的"检验"弹窗、"分配检验员"弹窗,以及新增/编辑弹窗 2. 检验员默认值优化:点击"检验"按钮时检验员默认为当前登录用户;选择"不合格"打开详情页时检验员从上个页面带入,修复 closeQuickCheck() 重置表单导致检验员值丢失的问题 3. 材料信息新增行修复:生产工单绑定工艺路线弹窗中,新增材料行时根据 productById 是否有值判断显示选择器还是文本
---
src/views/qualityManagement/processInspection/components/formDia.vue | 9 +++-
src/views/qualityManagement/finalInspection/components/formDia.vue | 5 ++
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue | 7 ++-
src/views/qualityManagement/rawMaterialInspection/index.vue | 21 +++++++---
src/views/qualityManagement/finalInspection/index.vue | 21 +++++++---
src/views/qualityManagement/processInspection/index.vue | 21 +++++++---
6 files changed, 60 insertions(+), 24 deletions(-)
diff --git a/src/views/qualityManagement/finalInspection/components/formDia.vue b/src/views/qualityManagement/finalInspection/components/formDia.vue
index 07f0921..2866cca 100644
--- a/src/views/qualityManagement/finalInspection/components/formDia.vue
+++ b/src/views/qualityManagement/finalInspection/components/formDia.vue
@@ -203,7 +203,7 @@
const modelOptions = ref([]);
// 鎵撳紑寮规
-const openDialog = async (type, row, defaultCheckResult = "") => {
+const openDialog = async (type, row, defaultCheckResult = "", defaultCheckName = "") => {
operationType.value = type;
dialogFormVisible.value = true;
// 鍏堟竻绌鸿〃鍗曢獙璇佺姸鎬侊紝閬垮厤闂儊
@@ -237,6 +237,9 @@
if (defaultCheckResult) {
form.value.checkResult = defaultCheckResult;
}
+ // 濡傛灉浼犲叆浜嗛粯璁ゆ楠屽憳锛岃鐩杛ow涓殑鍊硷紙浼樺厛浣跨敤浼犲叆鐨勬楠屽憳锛�
+ console.log('formDia checkName debug:', { defaultCheckName, rowCheckName: row.checkName });
+ form.value.checkName = defaultCheckName || row.checkName || "";
currentProductId.value = row.productId || 0
// 娓呯┖楠岃瘉鐘舵�侊紝閬垮厤鏁版嵁鍔犺浇杩囩▼涓殑鏍¢獙闂儊
nextTick(() => {
diff --git a/src/views/qualityManagement/finalInspection/index.vue b/src/views/qualityManagement/finalInspection/index.vue
index 28619cd..456ae7f 100644
--- a/src/views/qualityManagement/finalInspection/index.vue
+++ b/src/views/qualityManagement/finalInspection/index.vue
@@ -407,7 +407,11 @@
const open = async (row) => {
let userLists = await userListNoPage();
- userList.value = userLists.data;
+ // 绛涢�� roleIds 鍖呭惈 106 鐨勭敤鎴�
+ userList.value = (userLists.data || []).filter(user => {
+ const roleIds = user.roleIds || [];
+ return roleIds.includes(106) || roleIds.includes('106');
+ });
currentRow.value = row
dialogFormVisible.value = true
}
@@ -433,15 +437,18 @@
// 鎵撳紑妫�楠岀粨鏋滈�夋嫨瀵硅瘽妗�
const openQuickCheck = async (row) => {
currentRow.value = row;
- // 鍔犺浇鐢ㄦ埛鍒楄〃
+ // 鍔犺浇鐢ㄦ埛鍒楄〃锛岀瓫閫� roleIds 鍖呭惈 106 鐨勭敤鎴�
try {
const userLists = await userListNoPage();
- userList.value = userLists.data || [];
+ userList.value = (userLists.data || []).filter(user => {
+ const roleIds = user.roleIds || [];
+ return roleIds.includes(106) || roleIds.includes('106');
+ });
} catch (e) {
console.error("鍔犺浇妫�楠屽憳鍒楄〃澶辫触", e);
userList.value = [];
}
- // 璁剧疆榛樿鍊�
+ // 璁剧疆榛樿鍊硷紙妫�楠屽憳榛樿涓哄綋鍓嶇櫥褰曠敤鎴凤級
quickCheckForm.value = {
checkResult: "鍚堟牸",
checkName: userStore.nickName || "",
@@ -490,10 +497,12 @@
getList();
});
} else {
- // 涓嶅悎鏍硷細鎵撳紑璇︾粏濉啓椤甸潰
+ // 涓嶅悎鏍硷細鎵撳紑璇︾粏濉啓椤甸潰锛屼紶閫掓楠屽憳淇℃伅
+ // 鍏堜繚瀛樻楠屽憳鍊硷紝閬垮厤 closeQuickCheck 閲嶇疆鍚庝涪澶�
+ const checkNameToPass = quickCheckForm.value.checkName;
closeQuickCheck();
nextTick(() => {
- formDia.value?.openDialog("edit", currentRow.value, "涓嶅悎鏍�");
+ formDia.value?.openDialog("edit", currentRow.value, "涓嶅悎鏍�", checkNameToPass);
});
}
};
diff --git a/src/views/qualityManagement/processInspection/components/formDia.vue b/src/views/qualityManagement/processInspection/components/formDia.vue
index 444c7b4..fb2f830 100644
--- a/src/views/qualityManagement/processInspection/components/formDia.vue
+++ b/src/views/qualityManagement/processInspection/components/formDia.vue
@@ -216,7 +216,7 @@
const modelOptions = ref([]);
// 鎵撳紑寮规
-const openDialog = async (type, row, defaultCheckResult = "") => {
+const openDialog = async (type, row, defaultCheckResult = "", defaultCheckName = "") => {
operationType.value = type;
getOptions().then((res) => {
supplierList.value = res.data;
@@ -239,7 +239,7 @@
form.value = {
checkTime: "",
process: "",
- checkName: "",
+ checkName: defaultCheckName || "",
productName: "",
productId: "",
productModelId: "",
@@ -261,8 +261,11 @@
form.value = {...row, testStandardId: ''}
// 濡傛灉浼犲叆浜嗛粯璁ゆ娴嬬粨鏋滐紝瑕嗙洊row涓殑鍊�
if (defaultCheckResult) {
- form.value.checkResult = defaultCheckResult;
+ form.value.checkResult = defaultCheckResult;
}
+ // 濡傛灉浼犲叆浜嗛粯璁ゆ楠屽憳锛岃鐩杛ow涓殑鍊硷紙浼樺厛浣跨敤浼犲叆鐨勬楠屽憳锛�
+ console.log('formDia checkName debug:', { defaultCheckName, rowCheckName: row.checkName });
+ form.value.checkName = defaultCheckName || row.checkName || "";
currentProductId.value = row.productId || 0
// 鍏抽敭锛氱紪杈戞椂鍔犺浇瑙勬牸鍨嬪彿涓嬫媺閫夐」锛屾墠鑳藉弽鏄� productModelId
if (currentProductId.value) {
diff --git a/src/views/qualityManagement/processInspection/index.vue b/src/views/qualityManagement/processInspection/index.vue
index 6bfa7fb..cf1e77c 100644
--- a/src/views/qualityManagement/processInspection/index.vue
+++ b/src/views/qualityManagement/processInspection/index.vue
@@ -350,7 +350,11 @@
}
const open = async (row) => {
let userLists = await userListNoPage();
- userList.value = userLists.data;
+ // 绛涢�� roleIds 鍖呭惈 106 鐨勭敤鎴�
+ userList.value = (userLists.data || []).filter(user => {
+ const roleIds = user.roleIds || [];
+ return roleIds.includes(106) || roleIds.includes('106');
+ });
currentRow.value = row
dialogFormVisible.value = true
}
@@ -432,15 +436,18 @@
// 鎵撳紑妫�楠岀粨鏋滈�夋嫨瀵硅瘽妗�
const openQuickCheck = async (row) => {
currentRow.value = row;
- // 鍔犺浇鐢ㄦ埛鍒楄〃
+ // 鍔犺浇鐢ㄦ埛鍒楄〃锛岀瓫閫� roleIds 鍖呭惈 106 鐨勭敤鎴�
try {
const userLists = await userListNoPage();
- userList.value = userLists.data || [];
+ userList.value = (userLists.data || []).filter(user => {
+ const roleIds = user.roleIds || [];
+ return roleIds.includes(106) || roleIds.includes('106');
+ });
} catch (e) {
console.error("鍔犺浇妫�楠屽憳鍒楄〃澶辫触", e);
userList.value = [];
}
- // 璁剧疆榛樿鍊�
+ // 璁剧疆榛樿鍊硷紙妫�楠屽憳榛樿涓哄綋鍓嶇櫥褰曠敤鎴凤級
quickCheckForm.value = {
checkResult: "鍚堟牸",
checkName: userStore.nickName || "",
@@ -489,10 +496,12 @@
getList();
});
} else {
- // 涓嶅悎鏍硷細鎵撳紑璇︾粏濉啓椤甸潰
+ // 涓嶅悎鏍硷細鎵撳紑璇︾粏濉啓椤甸潰锛屼紶閫掓楠屽憳淇℃伅
+ // 鍏堜繚瀛樻楠屽憳鍊硷紝閬垮厤 closeQuickCheck 閲嶇疆鍚庝涪澶�
+ const checkNameToPass = quickCheckForm.value.checkName;
closeQuickCheck();
nextTick(() => {
- formDia.value?.openDialog("edit", currentRow.value, "涓嶅悎鏍�");
+ formDia.value?.openDialog("edit", currentRow.value, "涓嶅悎鏍�", checkNameToPass);
});
}
};
diff --git a/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue b/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
index 412ec98..bec44df 100644
--- a/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
+++ b/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
@@ -228,7 +228,7 @@
});
// 鎵撳紑寮规
-const openDialog = async (type, row, defaultCheckResult = "") => {
+const openDialog = async (type, row, defaultCheckResult = "", defaultCheckName = "") => {
operationType.value = type;
getOptions().then((res) => {
supplierList.value = res.data;
@@ -249,7 +249,7 @@
form.value = {
checkTime: "",
supplier: "",
- checkName: "",
+ checkName: defaultCheckName || "",
productName: "",
productId: "",
productModelId: "",
@@ -272,6 +272,9 @@
if (defaultCheckResult) {
form.value.checkResult = defaultCheckResult;
}
+ // 濡傛灉浼犲叆浜嗛粯璁ゆ楠屽憳锛岃鐩杛ow涓殑鍊硷紙浼樺厛浣跨敤浼犲叆鐨勬楠屽憳锛�
+ console.log('formDia checkName debug:', { defaultCheckName, rowCheckName: row.checkName });
+ form.value.checkName = defaultCheckName || row.checkName || "";
currentProductId.value = row.productId || 0
// 鍏抽敭锛氱紪杈戞椂鍔犺浇瑙勬牸鍨嬪彿涓嬫媺閫夐」锛屾墠鑳藉弽鏄� productModelId
if (currentProductId.value) {
diff --git a/src/views/qualityManagement/rawMaterialInspection/index.vue b/src/views/qualityManagement/rawMaterialInspection/index.vue
index f97f991..67bf6ef 100644
--- a/src/views/qualityManagement/rawMaterialInspection/index.vue
+++ b/src/views/qualityManagement/rawMaterialInspection/index.vue
@@ -407,7 +407,11 @@
const open = async (row) => {
let userLists = await userListNoPage();
- userList.value = userLists.data;
+ // 绛涢�� roleIds 鍖呭惈 106 鐨勭敤鎴�
+ userList.value = (userLists.data || []).filter(user => {
+ const roleIds = user.roleIds || [];
+ return roleIds.includes(106) || roleIds.includes('106');
+ });
currentRow.value = row
dialogFormVisible.value = true
}
@@ -433,15 +437,18 @@
// 鎵撳紑妫�楠岀粨鏋滈�夋嫨瀵硅瘽妗�
const openQuickCheck = async (row) => {
currentRow.value = row;
- // 鍔犺浇鐢ㄦ埛鍒楄〃
+ // 鍔犺浇鐢ㄦ埛鍒楄〃锛岀瓫閫� roleIds 鍖呭惈 106 鐨勭敤鎴�
try {
const userLists = await userListNoPage();
- userList.value = userLists.data || [];
+ userList.value = (userLists.data || []).filter(user => {
+ const roleIds = user.roleIds || [];
+ return roleIds.includes(106) || roleIds.includes('106');
+ });
} catch (e) {
console.error("鍔犺浇妫�楠屽憳鍒楄〃澶辫触", e);
userList.value = [];
}
- // 璁剧疆榛樿鍊�
+ // 璁剧疆榛樿鍊硷紙妫�楠屽憳榛樿涓哄綋鍓嶇櫥褰曠敤鎴凤級
quickCheckForm.value = {
checkResult: "鍚堟牸",
checkName: userStore.nickName || "",
@@ -490,10 +497,12 @@
getList();
});
} else {
- // 涓嶅悎鏍硷細鎵撳紑璇︾粏濉啓椤甸潰
+ // 涓嶅悎鏍硷細鎵撳紑璇︾粏濉啓椤甸潰锛屼紶閫掓楠屽憳淇℃伅
+ // 鍏堜繚瀛樻楠屽憳鍊硷紝閬垮厤 closeQuickCheck 閲嶇疆鍚庝涪澶�
+ const checkNameToPass = quickCheckForm.value.checkName;
closeQuickCheck();
nextTick(() => {
- formDia.value?.openDialog("edit", currentRow.value, "涓嶅悎鏍�");
+ formDia.value?.openDialog("edit", currentRow.value, "涓嶅悎鏍�", checkNameToPass);
});
}
};
--
Gitblit v1.9.3