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/processInspection/components/formDia.vue                 |   80 ++++--
 src/views/qualityManagement/processInspection/components/detailDia.vue               |   84 +++++++
 src/views/qualityManagement/finalInspection/components/formDia.vue                   |   61 +++-
 src/views/qualityManagement/rawMaterialInspection/components/formDia.vue             |  100 ++++++--
 src/views/qualityManagement/rawMaterialInspection/components/detailDia.vue           |   83 +++++++
 src/components/PIMTable/PIMTable.vue                                                 |    2 
 src/views/qualityManagement/rawMaterialInspection/index.vue                          |   37 +--
 src/views/salesManagement/salesLedger/index.vue                                      |    1 
 src/views/qualityManagement/finalInspection/index.vue                                |   45 +--
 src/views/qualityManagement/finalInspection/components/detailDia.vue                 |   83 +++++++
 src/views/qualityManagement/nonconformingManagement/components/inspectionFormDia.vue |    2 
 src/views/qualityManagement/processInspection/index.vue                              |   45 +--
 12 files changed, 457 insertions(+), 166 deletions(-)

diff --git a/src/components/PIMTable/PIMTable.vue b/src/components/PIMTable/PIMTable.vue
index 1fa1695..9dcd440 100644
--- a/src/components/PIMTable/PIMTable.vue
+++ b/src/components/PIMTable/PIMTable.vue
@@ -40,7 +40,7 @@
       :fixed="item.fixed"
       :label="item.label"
       :prop="item.prop"
-      show-overflow-tooltip
+      :show-overflow-tooltip="item.dataType !== 'action'"
       :align="item.align"
       :sortable="!!item.sortable"
       :type="item.type"
diff --git a/src/views/qualityManagement/finalInspection/components/detailDia.vue b/src/views/qualityManagement/finalInspection/components/detailDia.vue
new file mode 100644
index 0000000..9fcb8d1
--- /dev/null
+++ b/src/views/qualityManagement/finalInspection/components/detailDia.vue
@@ -0,0 +1,83 @@
+<template>
+  <div>
+    <el-dialog
+        v-model="dialogVisible"
+        title="鍑哄巶妫�楠岃鎯�"
+        width="70%"
+        @close="closeDialog"
+    >
+      <el-descriptions :column="2" border>
+        <el-descriptions-item label="妫�娴嬫棩鏈�">{{ detailData.checkTime || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="浜у搧鍚嶇О">{{ detailData.productName || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="瑙勬牸鍨嬪彿">{{ detailData.model || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="鍗曚綅">{{ detailData.unit || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="鏁伴噺">{{ detailData.quantity ?? '-' }}</el-descriptions-item>
+        <el-descriptions-item label="妫�娴嬬粨鏋�">{{ detailData.checkResult || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="妫�楠屽憳">{{ detailData.checkName || '-' }}</el-descriptions-item>
+      </el-descriptions>
+
+      <div style="margin-top: 20px">
+        <el-table :data="tableData" v-loading="tableLoading" border style="width: 100%" height="400">
+          <el-table-column label="鎸囨爣" prop="parameterItem" />
+          <el-table-column label="鍗曚綅" prop="unit" />
+          <el-table-column label="鏍囧噯鍊�" prop="standardValue" />
+          <el-table-column label="鍐呮帶鍊�" prop="controlValue" />
+          <el-table-column label="妫�楠屽��" prop="testValue" />
+        </el-table>
+      </div>
+
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="closeDialog">鍏抽棴</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import {ref} from "vue";
+import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
+
+const emit = defineEmits(["close"]);
+const dialogVisible = ref(false);
+const detailData = ref({});
+const tableData = ref([]);
+const tableLoading = ref(false);
+
+const openDialog = (row) => {
+  detailData.value = row || {};
+  dialogVisible.value = true;
+  loadParams(row?.id);
+};
+
+const loadParams = (id) => {
+  if (!id) {
+    tableData.value = [];
+    return;
+  }
+  tableLoading.value = true;
+  qualityInspectParamInfo(id)
+      .then((res) => {
+        tableData.value = res.data || [];
+      })
+      .finally(() => {
+        tableLoading.value = false;
+      });
+};
+
+const closeDialog = () => {
+  dialogVisible.value = false;
+  tableData.value = [];
+  emit("close");
+};
+
+defineExpose({
+  openDialog,
+});
+</script>
+
+<style scoped>
+
+</style>
+
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) {
diff --git a/src/views/qualityManagement/finalInspection/index.vue b/src/views/qualityManagement/finalInspection/index.vue
index 12aadac..038d565 100644
--- a/src/views/qualityManagement/finalInspection/index.vue
+++ b/src/views/qualityManagement/finalInspection/index.vue
@@ -39,6 +39,7 @@
     </div>
     <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia>
     <FormDia ref="formDia" @close="handleQuery"></FormDia>
+    <DetailDia ref="detailDia"></DetailDia>
     <files-dia ref="filesDia" @close="handleQuery"></files-dia>
 		<el-dialog v-model="dialogFormVisible" title="缂栬緫妫�楠屽憳" width="30%"
 							 @close="closeDia">
@@ -65,6 +66,7 @@
 import {onMounted, ref} from "vue";
 import InspectionFormDia from "@/views/qualityManagement/finalInspection/components/inspectionFormDia.vue";
 import FormDia from "@/views/qualityManagement/finalInspection/components/formDia.vue";
+import DetailDia from "@/views/qualityManagement/finalInspection/components/detailDia.vue";
 import {ElMessageBox} from "element-plus";
 import {
 	downloadQualityInspect,
@@ -116,11 +118,6 @@
     width: 100
   },
   {
-    label: "妫�娴嬪崟浣�",
-    prop: "checkCompany",
-    width: 120
-  },
-  {
     label: "妫�娴嬬粨鏋�",
     prop: "checkResult",
     dataType: "tag",
@@ -150,11 +147,10 @@
     label: "鎿嶄綔",
     align: "center",
     fixed: "right",
-    width: 300,
+    width: 260,
     operation: [
       {
         name: "缂栬緫",
-        type: "text",
         clickFun: (row) => {
           openForm("edit", row);
         },
@@ -162,16 +158,8 @@
 					return row.inspectState == 1;
 				}
       },
-      {
-        name: "闄勪欢",
-        type: "text",
-        clickFun: (row) => {
-          openFilesFormDia(row);
-        },
-      },
 			{
 				name: "鎻愪氦",
-				type: "text",
 				clickFun: (row) => {
 					submit(row.id);
 				},
@@ -179,23 +167,14 @@
 					return row.inspectState == 1;
 				}
 			},
-			{
-				name: "鍒嗛厤妫�楠屽憳",
-				type: "text",
-				clickFun: (row) => {
-					if (!row.checkName) {
-						open(row)
-					} else {
-						proxy.$modal.msgError("妫�楠屽憳宸插瓨鍦�");
-					}
-				},
-				disabled: (row) => {
-					return row.inspectState == 1 || row.checkName;
-				}
-			},
+      {
+        name: "鏌ョ湅",
+        clickFun: (row) => {
+          openDetail(row);
+        },
+      },
 			{
 				name: "涓嬭浇",
-				type: "text",
 				clickFun: (row) => {
 					downLoadFile(row);
 				},
@@ -215,6 +194,7 @@
 const formDia = ref()
 const filesDia = ref()
 const inspectionFormDia = ref()
+const detailDia = ref()
 const { proxy } = getCurrentInstance()
 const userList = ref([]);
 const form = ref({
@@ -265,6 +245,11 @@
     formDia.value?.openDialog(type, row)
   })
 };
+const openDetail = (row) => {
+  nextTick(() => {
+    detailDia.value?.openDialog(row)
+  })
+};
 // 鎵撳紑鏂板妫�楠屽脊妗�
 const openInspectionForm = (type, row) => {
   nextTick(() => {
diff --git a/src/views/qualityManagement/nonconformingManagement/components/inspectionFormDia.vue b/src/views/qualityManagement/nonconformingManagement/components/inspectionFormDia.vue
index 196eda0..68621fe 100644
--- a/src/views/qualityManagement/nonconformingManagement/components/inspectionFormDia.vue
+++ b/src/views/qualityManagement/nonconformingManagement/components/inspectionFormDia.vue
@@ -149,7 +149,7 @@
     quantity: "",
     checkCompany: "",
     checkResult: "",
-    inspectState: '',
+    inspectState: 1,
     inspectType: '',
     defectivePhenomena: '',
     dealResult: '',
diff --git a/src/views/qualityManagement/processInspection/components/detailDia.vue b/src/views/qualityManagement/processInspection/components/detailDia.vue
new file mode 100644
index 0000000..d03c88c
--- /dev/null
+++ b/src/views/qualityManagement/processInspection/components/detailDia.vue
@@ -0,0 +1,84 @@
+<template>
+  <div>
+    <el-dialog
+        v-model="dialogVisible"
+        title="杩囩▼妫�楠岃鎯�"
+        width="70%"
+        @close="closeDialog"
+    >
+      <el-descriptions :column="2" border>
+        <el-descriptions-item label="妫�娴嬫棩鏈�">{{ detailData.checkTime || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="宸ュ簭">{{ detailData.process || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="浜у搧鍚嶇О">{{ detailData.productName || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="瑙勬牸鍨嬪彿">{{ detailData.model || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="鍗曚綅">{{ detailData.unit || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="鏁伴噺">{{ detailData.quantity ?? '-' }}</el-descriptions-item>
+        <el-descriptions-item label="妫�娴嬬粨鏋�">{{ detailData.checkResult || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="妫�楠屽憳">{{ detailData.checkName || '-' }}</el-descriptions-item>
+      </el-descriptions>
+
+      <div style="margin-top: 20px">
+        <el-table :data="tableData" v-loading="tableLoading" border style="width: 100%" height="400">
+          <el-table-column label="鎸囨爣" prop="parameterItem" />
+          <el-table-column label="鍗曚綅" prop="unit" />
+          <el-table-column label="鏍囧噯鍊�" prop="standardValue" />
+          <el-table-column label="鍐呮帶鍊�" prop="controlValue" />
+          <el-table-column label="妫�楠屽��" prop="testValue" />
+        </el-table>
+      </div>
+
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="closeDialog">鍏抽棴</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import {ref} from "vue";
+import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
+
+const emit = defineEmits(["close"]);
+const dialogVisible = ref(false);
+const detailData = ref({});
+const tableData = ref([]);
+const tableLoading = ref(false);
+
+const openDialog = (row) => {
+  detailData.value = row || {};
+  dialogVisible.value = true;
+  loadParams(row?.id);
+};
+
+const loadParams = (id) => {
+  if (!id) {
+    tableData.value = [];
+    return;
+  }
+  tableLoading.value = true;
+  qualityInspectParamInfo(id)
+      .then((res) => {
+        tableData.value = res.data || [];
+      })
+      .finally(() => {
+        tableLoading.value = false;
+      });
+};
+
+const closeDialog = () => {
+  dialogVisible.value = false;
+  tableData.value = [];
+  emit("close");
+};
+
+defineExpose({
+  openDialog,
+});
+</script>
+
+<style scoped>
+
+</style>
+
diff --git a/src/views/qualityManagement/processInspection/components/formDia.vue b/src/views/qualityManagement/processInspection/components/formDia.vue
index b371e67..df5d7cd 100644
--- a/src/views/qualityManagement/processInspection/components/formDia.vue
+++ b/src/views/qualityManagement/processInspection/components/formDia.vue
@@ -31,41 +31,37 @@
         <el-row :gutter="30">
           <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-col :span="12">
+						<el-form-item label="鍗曚綅锛�" prop="unit">
+							<el-input v-model="form.unit" placeholder="璇疯緭鍏�" clearable/>
+						</el-form-item>
+					</el-col>
         </el-row>
         <el-row :gutter="30">
-          <el-col :span="12">
-            <el-form-item label="鍗曚綅锛�" prop="unit">
-              <el-input v-model="form.unit" placeholder="璇疯緭鍏�" clearable/>
-            </el-form-item>
-          </el-col>
           <el-col :span="12">
             <el-form-item label="鏁伴噺锛�" prop="quantity">
               <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="璇疯緭鍏�" clearable :precision="2"/>
             </el-form-item>
           </el-col>
-        </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="鍚堟牸" />
-                <el-option label="涓嶅悎鏍�" value="涓嶅悎鏍�" />
-              </el-select>
-            </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="鍚堟牸" />
+								<el-option label="涓嶅悎鏍�" value="涓嶅悎鏍�" />
+							</el-select>
+						</el-form-item>
+					</el-col>
         </el-row>
         <el-row :gutter="30">
           <el-col :span="12">
             <el-form-item label="妫�楠屽憳锛�" prop="checkName">
-							<el-select v-model="form.checkName"               filterable
+							<el-select v-model="form.checkName"
+												 filterable
                          default-first-option
                          :reserve-keyword="false" placeholder="璇烽�夋嫨" clearable>
 								<el-option v-for="item in userList" :key="item.nickName" :label="item.nickName"
@@ -112,7 +108,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 {qualityInspectDetailByProductId} from "@/api/qualityManagement/metricMaintenance.js";
 import {userListNoPage} from "@/api/system/user.js";
@@ -138,7 +134,7 @@
   rules: {
     checkTime: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" },],
     process: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
-    checkName: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
+    checkName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
     productId: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
     model: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
     unit: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
@@ -147,7 +143,12 @@
     checkResult: [{ required: true, message: "璇疯緭鍏�", trigger: "change" }],
   },
 });
-const userList = ref([]);
+const userList = ref([
+	{nickName: '鍊欑洓鏉�'},
+	{nickName: '鐒﹁緣'},
+	{nickName: '寮犲煿'},
+	{nickName: '鍐伒涔�'},
+]);
 const { form, rules } = toRefs(data);
 const supplierList = ref([]);
 const productOptions = ref([]);
@@ -178,6 +179,7 @@
 const tableData = ref([]);
 const tableLoading = ref(false);
 const currentProductId = ref(0);
+const modelOptions = ref([]);
 
 // 鎵撳紑寮规
 const openDialog = async (type, row) => {
@@ -186,28 +188,50 @@
 	getOptions().then((res) => {
 		supplierList.value = res.data;
 	});
-	let userLists = await userListNoPage();
-	userList.value = userLists.data;
+	// let userLists = await userListNoPage();
+	// 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) {
diff --git a/src/views/qualityManagement/processInspection/index.vue b/src/views/qualityManagement/processInspection/index.vue
index b6429de..a4669e0 100644
--- a/src/views/qualityManagement/processInspection/index.vue
+++ b/src/views/qualityManagement/processInspection/index.vue
@@ -39,6 +39,7 @@
     </div>
     <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia>
     <FormDia ref="formDia" @close="handleQuery"></FormDia>
+    <DetailDia ref="detailDia"></DetailDia>
     <files-dia ref="filesDia" @close="handleQuery"></files-dia>
 		<el-dialog v-model="dialogFormVisible" title="缂栬緫妫�楠屽憳" width="30%"
 							 @close="closeDia">
@@ -65,6 +66,7 @@
 import {onMounted, ref} from "vue";
 import InspectionFormDia from "@/views/qualityManagement/processInspection/components/inspectionFormDia.vue";
 import FormDia from "@/views/qualityManagement/processInspection/components/formDia.vue";
+import DetailDia from "@/views/qualityManagement/processInspection/components/detailDia.vue";
 import {ElMessageBox} from "element-plus";
 import {
 	downloadQualityInspect,
@@ -121,11 +123,6 @@
     width: 100
   },
   {
-    label: "妫�娴嬪崟浣�",
-    prop: "checkCompany",
-    width: 120
-  },
-  {
     label: "妫�娴嬬粨鏋�",
     prop: "checkResult",
     dataType: "tag",
@@ -155,11 +152,10 @@
     label: "鎿嶄綔",
     align: "center",
     fixed: "right",
-    width: 300,
+    width: 260,
     operation: [
       {
         name: "缂栬緫",
-        type: "text",
         clickFun: (row) => {
           openForm("edit", row);
         },
@@ -167,16 +163,8 @@
 					return row.inspectState == 1;
 				}
       },
-      {
-        name: "闄勪欢",
-        type: "text",
-        clickFun: (row) => {
-          openFilesFormDia(row);
-        },
-      },
 			{
 				name: "鎻愪氦",
-				type: "text",
 				clickFun: (row) => {
 					submit(row.id);
 				},
@@ -184,23 +172,14 @@
 					return row.inspectState == 1;
 				}
 			},
-			{
-				name: "鍒嗛厤妫�楠屽憳",
-				type: "text",
-				clickFun: (row) => {
-					if (!row.checkName) {
-						open(row)
-					} else {
-						proxy.$modal.msgError("妫�楠屽憳宸插瓨鍦�");
-					}
-				},
-				disabled: (row) => {
-					return row.inspectState == 1 || row.checkName;
-				}
-			},
+      {
+        name: "鏌ョ湅",
+        clickFun: (row) => {
+          openDetail(row);
+        },
+      },
 			{
 				name: "涓嬭浇",
-				type: "text",
 				clickFun: (row) => {
 					downLoadFile(row);
 				},
@@ -225,6 +204,7 @@
 const formDia = ref()
 const filesDia = ref()
 const inspectionFormDia = ref()
+const detailDia = ref()
 const { proxy } = getCurrentInstance()
 const changeDaterange = (value) => {
   searchForm.value.entryDateStart = undefined;
@@ -269,6 +249,11 @@
     formDia.value?.openDialog(type, row)
   })
 };
+const openDetail = (row) => {
+  nextTick(() => {
+    detailDia.value?.openDialog(row)
+  })
+};
 // 鎵撳紑鏂板妫�楠屽脊妗�
 const openInspectionForm = (type, row) => {
   nextTick(() => {
diff --git a/src/views/qualityManagement/rawMaterialInspection/components/detailDia.vue b/src/views/qualityManagement/rawMaterialInspection/components/detailDia.vue
new file mode 100644
index 0000000..f7134a6
--- /dev/null
+++ b/src/views/qualityManagement/rawMaterialInspection/components/detailDia.vue
@@ -0,0 +1,83 @@
+<template>
+  <div>
+    <el-dialog
+        v-model="dialogVisible"
+        title="鍘熸潗鏂欐楠岃鎯�"
+        width="70%"
+        @close="closeDialog"
+    >
+      <el-descriptions :column="2" border>
+        <el-descriptions-item label="妫�娴嬫棩鏈�">{{ detailData.checkTime || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="渚涘簲鍟�">{{ detailData.supplier || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="浜у搧鍚嶇О">{{ detailData.productName || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="瑙勬牸鍨嬪彿">{{ detailData.model || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="鍗曚綅">{{ detailData.unit || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="鏁伴噺">{{ detailData.quantity ?? '-' }}</el-descriptions-item>
+        <el-descriptions-item label="妫�娴嬬粨鏋�">{{ detailData.checkResult || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="妫�楠屽憳">{{ detailData.checkName || '-' }}</el-descriptions-item>
+      </el-descriptions>
+
+      <div style="margin-top: 20px">
+        <el-table :data="tableData" v-loading="tableLoading" border style="width: 100%" height="400">
+          <el-table-column label="鎸囨爣" prop="parameterItem" />
+          <el-table-column label="鍗曚綅" prop="unit" />
+          <el-table-column label="鏍囧噯鍊�" prop="standardValue" />
+          <el-table-column label="鍐呮帶鍊�" prop="controlValue" />
+          <el-table-column label="妫�楠屽��" prop="testValue" />
+        </el-table>
+      </div>
+
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="closeDialog">鍏抽棴</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import {ref} from "vue";
+import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
+
+const emit = defineEmits(["close"]);
+const dialogVisible = ref(false);
+const detailData = ref({});
+const tableData = ref([]);
+const tableLoading = ref(false);
+const openDialog = (row) => {
+  detailData.value = row || {};
+  dialogVisible.value = true;
+  loadParams(row?.id);
+};
+
+const loadParams = (id) => {
+  if (!id) {
+    tableData.value = [];
+    return;
+  }
+  tableLoading.value = true;
+  qualityInspectParamInfo(id)
+      .then((res) => {
+        tableData.value = res.data || [];
+      })
+      .finally(() => {
+        tableLoading.value = false;
+      });
+};
+
+const closeDialog = () => {
+  dialogVisible.value = false;
+  tableData.value = [];
+  emit("close");
+};
+
+defineExpose({
+  openDialog,
+});
+</script>
+
+<style scoped>
+
+</style>
+
diff --git a/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue b/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
index 5ea1e47..6852629 100644
--- a/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
+++ b/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
@@ -14,6 +14,7 @@
                   v-model="form.supplier"
                   placeholder="璇烽�夋嫨"
                   clearable
+									filterable
               >
                 <el-option
                     v-for="item in supplierList"
@@ -42,43 +43,50 @@
         <el-row :gutter="30">
           <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-col :span="12">
+						<el-form-item label="鍗曚綅锛�" prop="unit">
+							<el-input v-model="form.unit" placeholder="璇疯緭鍏�" clearable/>
+						</el-form-item>
+					</el-col>
         </el-row>
         <el-row :gutter="30">
-          <el-col :span="12">
-            <el-form-item label="鍗曚綅锛�" prop="unit">
-              <el-input v-model="form.unit" placeholder="璇疯緭鍏�" clearable/>
-            </el-form-item>
-          </el-col>
           <el-col :span="12">
             <el-form-item label="鏁伴噺锛�" prop="quantity">
               <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="璇疯緭鍏�"
                                clearable :precision="2"/>
             </el-form-item>
           </el-col>
-        </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="鍚堟牸"/>
-                <el-option label="涓嶅悎鏍�" value="涓嶅悎鏍�"/>
-              </el-select>
-            </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="鍚堟牸"/>
+								<el-option label="涓嶅悎鏍�" value="涓嶅悎鏍�"/>
+							</el-select>
+						</el-form-item>
+					</el-col>
         </el-row>
         <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="閫夋嫨浜哄憳"
+								style="width: 100%;"
+								filterable
+								clearable
+							>
+								<el-option
+									v-for="user in userList"
+									:key="user.nickName"
+									:label="user.nickName"
+									:value="user.nickName"
+								/>
+							</el-select>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -96,9 +104,6 @@
           </el-col>
         </el-row>
       </el-form>
-<!--      <div style="margin-bottom: 10px;text-align: right">-->
-<!--        <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>-->
-<!--      </div>-->
       <PIMTable
           rowKey="id"
           :column="tableColumn"
@@ -123,15 +128,21 @@
 <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 {ElMessageBox} from "element-plus";
 import {qualityInspectParamDel, qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
 import {qualityInspectDetailByProductId} from "@/api/qualityManagement/metricMaintenance.js";
+import {userListNoPageByTenantId} from "@/api/system/user.js";
 
 const {proxy} = getCurrentInstance()
 const emit = defineEmits(['close'])
-
+const userList = ref([
+	{nickName: '鍊欑洓鏉�'},
+	{nickName: '鐒﹁緣'},
+	{nickName: '寮犲煿'},
+	{nickName: '鍐伒涔�'},
+])
 const dialogFormVisible = ref(false);
 const operationType = ref('')
 const data = reactive({
@@ -142,6 +153,7 @@
     productName: "",
     productId: "",
     model: "",
+		modelId: "",
     unit: "",
     quantity: "",
     checkCompany: "",
@@ -150,7 +162,7 @@
   rules: {
     checkTime: [{required: true, message: "璇疯緭鍏�", trigger: "blur"},],
     supplier: [{required: true, message: "璇疯緭鍏�", trigger: "blur"}],
-    checkName: [{required: false, message: "璇疯緭鍏�", trigger: "blur"}],
+    checkName: [{required: true, message: "璇疯緭鍏�", trigger: "blur"}],
     productId: [{required: true, message: "璇疯緭鍏�", trigger: "blur"}],
     model: [{required: false, message: "璇疯緭鍏�", trigger: "blur"}],
     unit: [{required: false, message: "璇疯緭鍏�", trigger: "blur"}],
@@ -185,6 +197,7 @@
 ]);
 const tableData = ref([]);
 const tableLoading = ref(false);
+const modelOptions = ref([]);
 
 const {form, rules} = toRefs(data);
 const supplierList = ref([]);
@@ -198,26 +211,51 @@
   getOptions().then((res) => {
     supplierList.value = res.data;
   });
+	// userListNoPageByTenantId().then((res) => {
+	// 	userList.value = res.data;
+	// });
 	form.value = {}
   getProductOptions();
-  if (operationType.value === 'edit') {
+  if (operationType.value === 'edit' && row) {
     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) {
diff --git a/src/views/qualityManagement/rawMaterialInspection/index.vue b/src/views/qualityManagement/rawMaterialInspection/index.vue
index 477b55e..ae4c2f5 100644
--- a/src/views/qualityManagement/rawMaterialInspection/index.vue
+++ b/src/views/qualityManagement/rawMaterialInspection/index.vue
@@ -40,6 +40,7 @@
     </div>
     <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia>
     <FormDia ref="formDia" @close="handleQuery"></FormDia>
+    <DetailDia ref="detailDia"></DetailDia>
     <files-dia ref="filesDia" @close="handleQuery"></files-dia>
     <el-dialog v-model="dialogFormVisible" title="缂栬緫妫�楠屽憳" width="30%"
                @close="closeDia">
@@ -67,6 +68,7 @@
 import {onMounted, ref} from "vue";
 import InspectionFormDia from "@/views/qualityManagement/rawMaterialInspection/components/inspectionFormDia.vue";
 import FormDia from "@/views/qualityManagement/rawMaterialInspection/components/formDia.vue";
+import DetailDia from "@/views/qualityManagement/rawMaterialInspection/components/detailDia.vue";
 import {ElMessageBox} from "element-plus";
 import {
   downloadQualityInspect,
@@ -123,11 +125,6 @@
     width: 120
   },
   {
-    label: "妫�娴嬪崟浣�",
-    prop: "checkCompany",
-    width: 120
-  },
-  {
     label: "妫�娴嬬粨鏋�",
     prop: "checkResult",
     dataType: "tag",
@@ -157,11 +154,10 @@
     label: "鎿嶄綔",
     align: "center",
     fixed: "right",
-    width: 300,
+    width: 250,
     operation: [
       {
         name: "缂栬緫",
-        type: "text",
         clickFun: (row) => {
           openForm("edit", row);
         },
@@ -170,15 +166,7 @@
 				}
       },
       {
-        name: "闄勪欢",
-        type: "text",
-        clickFun: (row) => {
-          openFilesFormDia(row);
-        },
-      },
-      {
         name: "鎻愪氦",
-        type: "text",
         clickFun: (row) => {
           submit(row.id);
         },
@@ -187,22 +175,13 @@
 				}
       },
       {
-        name: "鍒嗛厤妫�楠屽憳",
-        type: "text",
+        name: "鏌ョ湅",
         clickFun: (row) => {
-          if (!row.checkName) {
-            open(row)
-          } else {
-            proxy.$modal.msgError("妫�楠屽憳宸插瓨鍦�");
-          }
+          openDetail(row);
         },
-				disabled: (row) => {
-					return row.inspectState == 1 || row.checkName;
-				}
       },
       {
         name: "涓嬭浇",
-        type: "text",
         clickFun: (row) => {
           downLoadFile(row);
         },
@@ -227,6 +206,7 @@
 const formDia = ref()
 const filesDia = ref()
 const inspectionFormDia = ref()
+const detailDia = ref()
 const {proxy} = getCurrentInstance()
 const changeDaterange = (value) => {
   searchForm.value.entryDateStart = undefined;
@@ -271,6 +251,11 @@
     formDia.value?.openDialog(type, row)
   })
 };
+const openDetail = (row) => {
+  nextTick(() => {
+    detailDia.value?.openDialog(row)
+  })
+};
 // 鎵撳紑闄勪欢寮规
 const openFilesFormDia = (type, row) => {
   nextTick(() => {
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index bccf621..59f6bba 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -673,7 +673,6 @@
   });
 };
 const getProductModel = (value) => {
-  console.log("value", value);
   const index = modelOptions.value.findIndex((item) => item.id === value);
   if (index !== -1) {
     productForm.value.specificationModel = modelOptions.value[index].model;

--
Gitblit v1.9.3