From bd6032cf49ff7be0a48544e9bcdc6818a0d5d450 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 20 一月 2026 17:45:14 +0800
Subject: [PATCH] fix: 质量关联指标

---
 src/views/qualityManagement/processInspection/components/formDia.vue |   71 +++++------------------------------
 1 files changed, 11 insertions(+), 60 deletions(-)

diff --git a/src/views/qualityManagement/processInspection/components/formDia.vue b/src/views/qualityManagement/processInspection/components/formDia.vue
index 4821db2..37b3914 100644
--- a/src/views/qualityManagement/processInspection/components/formDia.vue
+++ b/src/views/qualityManagement/processInspection/components/formDia.vue
@@ -9,21 +9,8 @@
       <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
         <el-row :gutter="30">
           <el-col :span="12">
-            <el-form-item label="宸ュ簭锛�" prop="processId">
-              <el-select 
-                v-model="form.processId" 
-                placeholder="璇烽�夋嫨宸ュ簭" 
-                clearable 
-                @change="handleProcessChange"
-                style="width: 100%"
-              >
-                <el-option
-                  v-for="item in processOptions"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                />
-              </el-select>
+            <el-form-item label="宸ュ簭锛�" prop="process">
+              <el-input v-model="form.process" placeholder="璇疯緭鍏ュ伐搴�" clearable />
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -142,7 +129,6 @@
 import {ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue";
 import {getOptions} from "@/api/procurementManagement/procurementLedger.js";
 import {productTreeList} from "@/api/basicData/product.js";
-import {productProcessListPage} from "@/api/basicData/productProcess.js";
 import {qualityInspectAdd, qualityInspectUpdate} from "@/api/qualityManagement/rawMaterialInspection.js";
 import {qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId} from "@/api/qualityManagement/metricMaintenance.js";
 import {userListNoPage} from "@/api/system/user.js";
@@ -155,7 +141,7 @@
 const data = reactive({
   form: {
     checkTime: "",
-    processId: "",
+    process: "",
     checkName: "",
     productName: "",
     productId: "",
@@ -168,11 +154,11 @@
   },
   rules: {
     checkTime: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" },],
-    processId: [{ required: true, message: "璇烽�夋嫨宸ュ簭", trigger: "change" }],
+    process: [{ required: true, message: "璇疯緭鍏ュ伐搴�", trigger: "blur" }],
     checkName: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
     productId: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
     model: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
-    testStandardId: [{required: true, message: "璇烽�夋嫨鎸囨爣", trigger: "change"}],
+    testStandardId: [{required: false, message: "璇烽�夋嫨鎸囨爣", trigger: "change"}],
     unit: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
     quantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
     checkCompany: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
@@ -210,24 +196,7 @@
 const tableData = ref([]);
 const tableLoading = ref(false);
 const currentProductId = ref(0);
-const processOptions = ref([]); // 宸ュ簭涓嬫媺妗嗘暟鎹�
 const testStandardOptions = ref([]); // 鎸囨爣閫夋嫨涓嬫媺妗嗘暟鎹�
-
-// 鑾峰彇宸ュ簭鍒楄〃
-const getProcessList = async () => {
-	try {
-		const res = await productProcessListPage({ current: 1, size: 1000 })
-		if (res?.code === 200) {
-			const records = res?.data?.records || []
-			processOptions.value = records.map(item => ({
-				label: item.processName || item.name || item.label,
-				value: item.id || item.processId || item.value
-			}))
-		}
-	} catch (error) {
-		console.error('鑾峰彇宸ュ簭鍒楄〃澶辫触:', error)
-	}
-}
 
 // 鎵撳紑寮规
 const openDialog = async (type, row) => {
@@ -242,21 +211,11 @@
 	testStandardOptions.value = [];
 	tableData.value = [];
 	getProductOptions();
-	// 鍏堝姞杞藉伐搴忓垪琛�
-	await getProcessList();
 	if (operationType.value === 'edit') {
 		// 鍏堜繚瀛� testStandardId锛岄伩鍏嶈娓呯┖
 		const savedTestStandardId = row.testStandardId;
 		// 鍏堣缃〃鍗曟暟鎹紝浣嗘殏鏃舵竻绌� testStandardId锛岀瓑閫夐」鍔犺浇瀹屾垚鍚庡啀璁剧疆
 		form.value = {...row, testStandardId: ''}
-		// 鍏煎鏃ф暟鎹細濡傛灉 row 涓湁 process 瀛楁锛岃浆鎹负 processId
-		if (row.process && !row.processId) {
-			// 灏濊瘯浠� processOptions 涓煡鎵惧尮閰嶇殑宸ュ簭
-			const processOption = processOptions.value.find(p => p.label === row.process);
-			if (processOption) {
-				form.value.processId = processOption.value;
-			}
-		}
 		currentProductId.value = row.productId || 0
 		// 缂栬緫妯″紡涓嬶紝鍏堝姞杞芥寚鏍囬�夐」锛岀劧鍚庡姞杞藉弬鏁板垪琛�
 		if (currentProductId.value) {
@@ -264,7 +223,7 @@
 			let params = {
 				productId: currentProductId.value,
 				inspectType: 1,
-				process: form.value.processId ? processOptions.value.find(p => p.value === form.value.processId)?.label : ''
+				process: form.value.process || ''
 			}
 			qualityInspectDetailByProductId(params).then(res => {
 				testStandardOptions.value = res.data || [];
@@ -280,12 +239,13 @@
 							if (matchedOption) {
 								// 纭繚浣跨敤鍖归厤椤圭殑 id锛堜繚鎸佺被鍨嬩竴鑷达級
 								form.value.testStandardId = matchedOption.id;
-								handleTestStandardChange(matchedOption.id);
+								// 缂栬緫淇濈暀鍘熸楠屽�硷紝鐩存帴鎷夊彇鍘熷弬鏁版暟鎹�
+								getQualityInspectParamList(row.id);
 							} else {
 								// 濡傛灉鎵句笉鍒板尮閰嶉」锛屽皾璇曠洿鎺ヤ娇鐢ㄥ師鍊�
 								console.warn('鏈壘鍒板尮閰嶇殑鎸囨爣閫夐」锛宼estStandardId:', savedTestStandardId, '鍙敤閫夐」:', testStandardOptions.value);
 								form.value.testStandardId = savedTestStandardId;
-								handleTestStandardChange(savedTestStandardId);
+								getQualityInspectParamList(row.id);
 							}
 						} else {
 							// 鍚﹀垯浣跨敤鏃х殑閫昏緫
@@ -340,20 +300,12 @@
   });
 }
 // 宸ュ簭鍙樺寲澶勭悊
-const handleProcessChange = () => {
-	// 宸ュ簭鍙樺寲鏃讹紝濡傛灉宸查�夋嫨浜у搧锛岄噸鏂板姞杞芥寚鏍囧垪琛�
-	if (currentProductId.value) {
-		getList();
-	}
-}
-
 // 鎻愪氦浜у搧琛ㄥ崟
 const submitForm = () => {
   proxy.$refs.formRef.validate(valid => {
     if (valid) {
       form.value.inspectType = 1
-			// 灏� processId 杞崲涓� process 鍚嶇О锛堝鏋滃悗绔渶瑕� process 瀛楁锛�
-			const processName = form.value.processId ? processOptions.value.find(p => p.value === form.value.processId)?.label : '';
+			const processName = form.value.process || '';
 			if (operationType.value === "add") {
 				tableData.value.forEach((item) => {
 					delete item.id
@@ -384,8 +336,7 @@
 		tableData.value = [];
 		return;
 	}
-	// 鑾峰彇宸ュ簭鍚嶇О
-	const processName = form.value.processId ? processOptions.value.find(p => p.value === form.value.processId)?.label : '';
+	const processName = form.value.process || '';
 	let params = {
 		productId: currentProductId.value,
 		inspectType: 1,

--
Gitblit v1.9.3