From 113ca01ea4abdeee4e01695df973219ee4671ef0 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 30 六月 2026 17:05:41 +0800
Subject: [PATCH] 新疆海川开心 1.质量管理、回款登记修改默认数据

---
 src/views/qualityManagement/processInspection/components/formDia.vue |   72 +++++++++++++++++++++++++++++------
 1 files changed, 59 insertions(+), 13 deletions(-)

diff --git a/src/views/qualityManagement/processInspection/components/formDia.vue b/src/views/qualityManagement/processInspection/components/formDia.vue
index df5d7cd..9bf4e1d 100644
--- a/src/views/qualityManagement/processInspection/components/formDia.vue
+++ b/src/views/qualityManagement/processInspection/components/formDia.vue
@@ -4,13 +4,17 @@
         v-model="dialogFormVisible"
         :title="operationType === 'add' ? '鏂板杩囩▼妫�楠�' : '缂栬緫杩囩▼妫�楠�'"
         width="70%"
+				draggable
         @close="closeDia"
     >
       <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="process">
-              <el-input v-model="form.process" placeholder="璇疯緭鍏�" clearable/>
+              <el-select v-model="form.process" placeholder="璇烽�夋嫨" clearable>
+                <el-option label="璇曞帇" value="璇曞帇" />
+                <el-option label="鎶芥" value="鎶芥" />
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -31,9 +35,7 @@
         <el-row :gutter="30">
           <el-col :span="12">
             <el-form-item label="瑙勬牸鍨嬪彿锛�" prop="model">
-							<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-input v-model="form.model" placeholder="璇疯緭鍏�" clearable/>
             </el-form-item>
           </el-col>
 					<el-col :span="12">
@@ -106,15 +108,20 @@
 </template>
 
 <script setup>
-import {ref} from "vue";
+import {ref, computed, reactive, toRefs, getCurrentInstance} from "vue";
 import {getOptions} from "@/api/procurementManagement/procurementLedger.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";
 import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
+import dayjs from "dayjs";
+import useUserStore from "@/store/modules/user.js";
 const { proxy } = getCurrentInstance()
 const emit = defineEmits(['close'])
+const userStore = useUserStore()
+const currentUserName = computed(() => userStore.nickName || userStore.name || "")
+const getToday = () => dayjs().format("YYYY-MM-DD")
 
 const dialogFormVisible = ref(false);
 const operationType = ref('')
@@ -143,12 +150,7 @@
     checkResult: [{ required: true, message: "璇疯緭鍏�", trigger: "change" }],
   },
 });
-const userList = ref([
-	{nickName: '鍊欑洓鏉�'},
-	{nickName: '鐒﹁緣'},
-	{nickName: '寮犲煿'},
-	{nickName: '鍐伒涔�'},
-]);
+const userList = ref([]);
 const { form, rules } = toRefs(data);
 const supplierList = ref([]);
 const productOptions = ref([]);
@@ -188,8 +190,8 @@
 	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') {
@@ -206,6 +208,50 @@
 			});
 		}
 		getQualityInspectParamList(row.id)
+	} else {
+		// 鏂板鏃惰缃粯璁ゅ��
+		form.value.process = "璇曞帇"; // 宸ュ簭榛樿涓鸿瘯鍘�
+		form.value.unit = "鍖�"; // 鍗曚綅榛樿涓哄寘
+		form.value.quantity = 3; // 鏁伴噺榛樿涓�3
+		form.value.checkResult = "鍚堟牸"; // 妫�楠岀粨鏋滈粯璁や负鍚堟牸
+			// 浜у搧鍚嶇О榛樿鍌昏�佸ぇ鍘熷懗鐡滃瓙锛堣川妫�璇曞帇锛�
+			productTreeList({productName: '璐ㄩ噺'}).then((res) => {
+				productOptions.value = convertIdToValue(res);
+				// 閫掑綊鏌ユ壘鐩爣鑺傜偣
+					const findTarget = (nodes) => {
+						for (const node of nodes) {
+							if (node.label === "鍌昏�佸ぇ鍘熷懗鐡滃瓙锛堣川妫�璇曞帇锛�") {
+								return node;
+							}
+							if (node.children && node.children.length > 0) {
+								const found = findTarget(node.children);
+								if (found) return found;
+							}
+						}
+						return null;
+					};
+					const target = findTarget(res);
+				if (target) {
+					form.value.productId = target.id;
+					form.value.productName = target.label;
+					currentProductId.value = target.id;
+					// 鍔犺浇瑙勬牸鍒楄〃
+					modelList({ id: target.id }).then((modelRes) => {
+						modelOptions.value = modelRes;
+					});
+					// 鍔犺浇妫�楠屽弬鏁�
+					qualityInspectDetailByProductId(target.id).then((paramRes) => {
+						tableData.value = paramRes.data;
+					});
+				}
+			});
+	}
+	// 榛樿妫�楠屽憳涓哄綋鍓嶇櫥褰曚汉锛屾娴嬫棩鏈熼粯璁や负褰撳ぉ锛堢┖鏃跺~鍏咃級
+	if (!form.value.checkName) {
+		form.value.checkName = "渚洓鏉�";
+	}
+	if (!form.value.checkTime) {
+		form.value.checkTime = getToday();
 	}
 }
 const getProductOptions = () => {

--
Gitblit v1.9.3