From 64a65ca91d1b21755088616af63db669515aff6d Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 14 八月 2025 15:16:31 +0800
Subject: [PATCH] 出厂检验修改

---
 src/views/qualityManagement/finalInspection/components/formDia.vue |   79 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 74 insertions(+), 5 deletions(-)

diff --git a/src/views/qualityManagement/finalInspection/components/formDia.vue b/src/views/qualityManagement/finalInspection/components/formDia.vue
index 34f5990..6547e3f 100644
--- a/src/views/qualityManagement/finalInspection/components/formDia.vue
+++ b/src/views/qualityManagement/finalInspection/components/formDia.vue
@@ -58,8 +58,10 @@
         <el-row :gutter="30">
           <el-col :span="12">
             <el-form-item label="妫�楠屽憳锛�" prop="checkName">
-              <el-input v-model="form.checkName" placeholder="璇疯緭鍏�" clearable/>
-            
+							<el-select v-model="form.checkName" 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-col :span="12">
@@ -77,6 +79,17 @@
           </el-col>
         </el-row>
       </el-form>
+			<PIMTable
+				rowKey="id"
+				:column="tableColumn"
+				:tableData="tableData"
+				:tableLoading="tableLoading"
+				height="400"
+			>
+				<template #slot="{ row }">
+					<el-input v-model="row.testValue" clearable/>
+				</template>
+			</PIMTable>
       <template #footer>
         <div class="dialog-footer">
           <el-button type="primary" @click="submitForm">纭</el-button>
@@ -92,6 +105,9 @@
 import {getOptions} from "@/api/procurementManagement/procurementLedger.js";
 import {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";
+import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
 const { proxy } = getCurrentInstance()
 const emit = defineEmits(['close'])
 
@@ -125,17 +141,50 @@
 const { form, rules } = toRefs(data);
 const supplierList = ref([]);
 const productOptions = ref([]);
+const tableColumn = ref([
+	{
+		label: "鎸囨爣",
+		prop: "parameterItem",
+	},
+	{
+		label: "鍗曚綅",
+		prop: "unit",
+	},
+	{
+		label: "鏍囧噯鍊�",
+		prop: "standardValue",
+	},
+	{
+		label: "鍐呮帶鍊�",
+		prop: "controlValue",
+	},
+	{
+		label: "妫�楠屽��",
+		prop: "testValue",
+		dataType: 'slot',
+		slot: 'slot',
+	},
+]);
+const tableData = ref([]);
+const tableLoading = ref(false);
+const userList = ref([]);
+const currentProductId = ref(0);
 
 // 鎵撳紑寮规
-const openDialog = (type, row) => {
+const openDialog = async (type, row) => {
   operationType.value = type;
   dialogFormVisible.value = true;
   getOptions().then((res) => {
     supplierList.value = res.data;
   });
+	let userLists = await userListNoPage();
+	userList.value = userLists.data;
+	form.value = {}
   getProductOptions();
   if (operationType.value === 'edit') {
     form.value = {...row}
+		currentProductId.value = row.productId || 0
+		getQualityInspectParamList(row.id)
   }
 }
 const getProductOptions = () => {
@@ -144,7 +193,11 @@
   });
 };
 const getModels = (value) => {
+	currentProductId.value = value
   form.value.productName = findNodeById(productOptions.value, value);
+	if (currentProductId) {
+		getList();
+	}
 };
 const findNodeById = (nodes, productId) => {
   for (let i = 0; i < nodes.length; i++) {
@@ -179,13 +232,19 @@
   proxy.$refs.formRef.validate(valid => {
     if (valid) {
       form.value.inspectType = 2
+			if (operationType.value === "add") {
+				tableData.value.forEach((item) => {
+					delete item.id
+				})
+			}
+			const data = {...form.value, qualityInspectParams: tableData.value}
       if (operationType.value === "add") {
-        qualityInspectAdd(form.value).then(res => {
+        qualityInspectAdd(data).then(res => {
           proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
           closeDia();
         })
       } else {
-        qualityInspectUpdate(form.value).then(res => {
+        qualityInspectUpdate(data).then(res => {
           proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
           closeDia();
         })
@@ -193,6 +252,16 @@
     }
   })
 }
+const getList = () => {
+	qualityInspectDetailByProductId(currentProductId.value).then(res => {
+		tableData.value = res.data;
+	})
+}
+const getQualityInspectParamList = (id) => {
+	qualityInspectParamInfo(id).then(res => {
+		tableData.value = res.data;
+	})
+}
 // 鍏抽棴寮规
 const closeDia = () => {
   proxy.resetForm("formRef");

--
Gitblit v1.9.3