From 9689c0418e2a71a36ae2ebef79a0db329ca428bf Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期一, 20 四月 2026 11:33:16 +0800
Subject: [PATCH] feat: 添加厚度字段

---
 src/views/qualityManagement/finalInspection/components/formDia.vue |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/views/qualityManagement/finalInspection/components/formDia.vue b/src/views/qualityManagement/finalInspection/components/formDia.vue
index 6a3e774..a6013f9 100644
--- a/src/views/qualityManagement/finalInspection/components/formDia.vue
+++ b/src/views/qualityManagement/finalInspection/components/formDia.vue
@@ -49,6 +49,11 @@
               </el-select>
             </el-form-item>
           </el-col>
+          <el-col :span="12">
+            <el-form-item label="鍘氬害(mm)锛�" prop="thickness">
+              <el-input v-model="form.thickness" placeholder="璇疯緭鍏�" disabled/>
+            </el-form-item>
+          </el-col>
         </el-row>
         <el-row :gutter="30">
           <el-col :span="12">
@@ -58,7 +63,7 @@
           </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-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="璇疯緭鍏�" clearable :precision="2" :disabled="quantityDisabled"/>
             </el-form-item>
           </el-col>
         </el-row>
@@ -123,7 +128,7 @@
 </template>
 
 <script setup>
-import {ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue";
+import {ref, reactive, toRefs, computed, getCurrentInstance, nextTick} 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";
@@ -149,6 +154,7 @@
     quantity: "",
     checkCompany: "",
     checkResult: "",
+    thickness:""
   },
   rules: {
     checkTime: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" },],
@@ -164,6 +170,11 @@
   },
 });
 const { form, rules } = toRefs(data);
+// 缂栬緫鏃讹細productMainId 鎴� purchaseLedgerId 浠讳竴鏈夊�煎垯鏁伴噺缃伆
+const quantityDisabled = computed(() => {
+  const v = form.value || {};
+  return !!(v.productMainId != null || v.purchaseLedgerId != null);
+});
 const supplierList = ref([]);
 const productOptions = ref([]);
 const tableColumn = ref([
@@ -253,6 +264,7 @@
           if (selectedModel) {
             form.value.model = selectedModel.model || '';
             form.value.unit = selectedModel.unit || '';
+            form.value.thickness = selectedModel.thickness || ''
           }
         }
         
@@ -306,6 +318,7 @@
 const handleChangeModel = (value) => {
   form.value.model = modelOptions.value.find(item => item.id == value)?.model || '';
   form.value.unit = modelOptions.value.find(item => item.id == value)?.unit || '';
+  form.value.thickness = modelOptions.value.find(item => item.id == value)?.thickness || '';
 }
 
 const findNodeById = (nodes, productId) => {

--
Gitblit v1.9.3