From 9382cf0ba396fa434daba76303a956905dff837d Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 23 十二月 2025 16:32:00 +0800
Subject: [PATCH] 1.海川开心-质量管理三个页面,去掉分配检验员功能,新增时规格型号和单位可以直接赋值

---
 src/views/qualityManagement/finalInspection/components/formDia.vue |   61 +++++++++++++++++++++---------
 1 files changed, 43 insertions(+), 18 deletions(-)

diff --git a/src/views/qualityManagement/finalInspection/components/formDia.vue b/src/views/qualityManagement/finalInspection/components/formDia.vue
index 26e5b3a..7bcd81b 100644
--- a/src/views/qualityManagement/finalInspection/components/formDia.vue
+++ b/src/views/qualityManagement/finalInspection/components/formDia.vue
@@ -24,7 +24,9 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="瑙勬牸鍨嬪彿锛�" prop="model">
-              <el-input v-model="form.model" placeholder="璇疯緭鍏�" clearable/>
+							<el-select v-model="form.modelId" placeholder="璇烽�夋嫨" clearable @change="getProductModel">
+								<el-option v-for="item in modelOptions" :key="item.id" :label="item.model" :value="item.id" />
+							</el-select>
             </el-form-item>
           </el-col>
         </el-row>
@@ -42,11 +44,6 @@
         </el-row>
         <el-row :gutter="30">
           <el-col :span="12">
-            <el-form-item label="妫�娴嬪崟浣嶏細" prop="checkCompany">
-              <el-input v-model="form.checkCompany" placeholder="璇疯緭鍏�" clearable/>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
             <el-form-item label="妫�娴嬬粨鏋滐細" prop="checkResult">
               <el-select v-model="form.checkResult">
                 <el-option label="鍚堟牸" value="鍚堟牸" />
@@ -54,18 +51,18 @@
               </el-select>
             </el-form-item>
           </el-col>
-        </el-row>
-        <el-row :gutter="30">
-          <el-col :span="12">
-            <el-form-item label="妫�楠屽憳锛�" prop="checkName">
+					<el-col :span="12">
+						<el-form-item label="妫�楠屽憳锛�" prop="checkName">
 							<el-select v-model="form.checkName"               filterable
-                         default-first-option
-                         :reserve-keyword="false" placeholder="璇烽�夋嫨" clearable>
+												 default-first-option
+												 :reserve-keyword="false" placeholder="璇烽�夋嫨" clearable>
 								<el-option v-for="item in userList" :key="item.nickName" :label="item.nickName"
 													 :value="item.nickName"/>
 							</el-select>
-            </el-form-item>
-          </el-col>
+						</el-form-item>
+					</el-col>
+        </el-row>
+        <el-row :gutter="30">
           <el-col :span="12">
             <el-form-item label="妫�娴嬫棩鏈燂細" prop="checkTime">
               <el-date-picker
@@ -105,7 +102,7 @@
 <script setup>
 import {ref} from "vue";
 import {getOptions} from "@/api/procurementManagement/procurementLedger.js";
-import {productTreeList} from "@/api/basicData/product.js";
+import {modelList, productTreeList} from "@/api/basicData/product.js";
 import {qualityInspectAdd, qualityInspectUpdate} from "@/api/qualityManagement/rawMaterialInspection.js";
 import {userListNoPage} from "@/api/system/user.js";
 import {qualityInspectDetailByProductId} from "@/api/qualityManagement/metricMaintenance.js";
@@ -169,8 +166,14 @@
 ]);
 const tableData = ref([]);
 const tableLoading = ref(false);
-const userList = ref([]);
+const userList = ref([
+	{nickName: '鍊欑洓鏉�'},
+	{nickName: '鐒﹁緣'},
+	{nickName: '寮犲煿'},
+	{nickName: '鍐伒涔�'},
+]);
 const currentProductId = ref(0);
+const modelOptions = ref([]);
 
 // 鎵撳紑寮规
 const openDialog = async (type, row) => {
@@ -180,27 +183,49 @@
     supplierList.value = res.data;
   });
 	let userLists = await userListNoPage();
-	userList.value = userLists.data;
+	// userList.value = userLists.data;
 	form.value = {}
   getProductOptions();
   if (operationType.value === 'edit') {
     form.value = {...row}
 		currentProductId.value = row.productId || 0
+		// 鍔犺浇褰撳墠浜у搧涓嬬殑瑙勬牸鍒楄〃锛屽苟鏍规嵁鍚庣杩斿洖鐨� model 鍙嶆煡骞惰缃� modelId锛屽疄鐜拌鏍间笅鎷夋鍙嶆樉
+		if (currentProductId.value) {
+			modelList({ id: currentProductId.value }).then((res) => {
+				modelOptions.value = res;
+				const target = res.find((item) => item.model === row.model);
+				if (target) {
+					form.value.modelId = target.id;
+				}
+			});
+		}
 		getQualityInspectParamList(row.id)
   }
 }
 const getProductOptions = () => {
-  productTreeList().then((res) => {
+  productTreeList({productName: '璐ㄩ噺'}).then((res) => {
     productOptions.value = convertIdToValue(res);
   });
 };
 const getModels = (value) => {
 	currentProductId.value = value
   form.value.productName = findNodeById(productOptions.value, value);
+	modelList({ id: value }).then((res) => {
+		modelOptions.value = res;
+	});
 	if (currentProductId) {
 		getList();
 	}
 };
+const getProductModel = (value) => {
+	const index = modelOptions.value.findIndex((item) => item.id === value);
+	if (index !== -1) {
+		form.value.unit = modelOptions.value[index].unit;
+		form.value.model = modelOptions.value[index].model;
+	} else {
+		form.value.unit = null;
+	}
+};
 const findNodeById = (nodes, productId) => {
   for (let i = 0; i < nodes.length; i++) {
     if (nodes[i].value === productId) {

--
Gitblit v1.9.3