From 30b15089e5000ab82af8dca4c335bda8940f0a7a Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 01 四月 2026 13:14:45 +0800
Subject: [PATCH] Merge branch 'dev_长治_健齿齿科器材' of http://114.132.189.42:9002/r/product-inventory-management into dev_长治_健齿齿科器材

---
 src/views/qualityManagement/processInspection/components/formDia.vue |  116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 109 insertions(+), 7 deletions(-)

diff --git a/src/views/qualityManagement/processInspection/components/formDia.vue b/src/views/qualityManagement/processInspection/components/formDia.vue
index 4dd1518..216ff14 100644
--- a/src/views/qualityManagement/processInspection/components/formDia.vue
+++ b/src/views/qualityManagement/processInspection/components/formDia.vue
@@ -66,8 +66,52 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="鏁伴噺锛�" prop="quantity">
+            <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" :disabled="processQuantityDisabled"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="30">
+          <el-col :span="12">
+            <el-form-item label="妫�鍝佹暟閲忥細" prop="inspectedQuantity">
+              <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.inspectedQuantity" placeholder="璇疯緭鍏ワ紝涓嶅ぇ浜庢�绘暟閲�" clearable :precision="2" :disabled="processQuantityDisabled"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="妫�楠岀敤绮夊墏/娑叉儏鍐碉細" prop="inspectMaterialCondition">
+              <el-radio-group v-model="form.inspectMaterialCondition">
+                <el-radio label="绮夊墏">绮夊墏</el-radio>
+                <el-radio label="娑蹭綋">娑蹭綋</el-radio>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="30">
+          <el-col :span="12">
+            <el-form-item label="鐢熶骇鏃ユ湡锛�" prop="productionDate">
+              <el-date-picker
+                  v-model="form.productionDate"
+                  type="date"
+                  placeholder="璇烽�夋嫨鏃ユ湡"
+                  value-format="YYYY-MM-DD"
+                  format="YYYY-MM-DD"
+                  clearable
+                  style="width: 100%"
+                  @change="calculateValidityDate"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鏈夋晥鏈燂細" prop="validityDate">
+              <el-date-picker
+                  v-model="form.validityDate"
+                  type="date"
+                  placeholder="鑷姩璁$畻鎴栨墜鍔ㄩ�夋嫨"
+                  value-format="YYYY-MM-DD"
+                  format="YYYY-MM-DD"
+                  clearable
+                  style="width: 100%"
+              />
             </el-form-item>
           </el-col>
         </el-row>
@@ -155,10 +199,19 @@
           </el-select>
         </template>
         <template #deviceStatus="{ row }">
-          <el-tag v-if="row.deviceStatus" :type="getDeviceStatusType(row.deviceStatus)">
-            {{ row.deviceStatus }}
-          </el-tag>
-          <span v-else style="color: #999">-</span>
+          <el-select
+              v-model="row.deviceStatus"
+              placeholder="璇烽�夋嫨"
+              default-first-option
+              clearable
+              style="width: 100%"
+          >
+            <el-option label="姝e父" value="姝e父" />
+            <el-option label="鍋滄満" value="鍋滄満" />
+            <el-option label="杩愯" value="杩愯" />
+            <el-option label="缁翠慨" value="缁翠慨" />
+            <el-option label="/" value="/" />
+          </el-select>
         </template>
         <template #result="{ row }">
           <el-input v-model="row.result" placeholder="璇疯緭鍏�" clearable />
@@ -221,6 +274,10 @@
     testStandardId: "",
     unit: "",
     quantity: "",
+    inspectedQuantity: "",
+    inspectMaterialCondition: "",
+    productionDate: "",
+    validityDate: "",
     checkCompany: "",
     checkResult: "",
   },
@@ -233,6 +290,25 @@
     testStandardId: [{required: false, message: "璇烽�夋嫨鎸囨爣", trigger: "change"}],
     unit: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
     quantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+    inspectedQuantity: [
+      { required: true, message: "璇疯緭鍏ユ鍝佹暟閲�", trigger: "blur" },
+      {
+        validator: (rule, value, callback) => {
+          if (value !== '' && value !== null && value !== undefined) {
+            const qty = Number(form.value.quantity);
+            const inspectedQty = Number(value);
+            if (!isNaN(qty) && !isNaN(inspectedQty) && inspectedQty > qty) {
+              callback(new Error("妫�鍝佹暟閲忎笉鑳藉ぇ浜庢�绘暟閲�"));
+            } else {
+              callback();
+            }
+          } else {
+            callback();
+          }
+        },
+        trigger: "blur"
+      }
+    ],
     checkCompany: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
     batchNo: [{ required: true, validator: validateBatchNo, trigger: "blur" }],
     checkResult: [{ required: true, message: "璇疯緭鍏�", trigger: "change" }],
@@ -262,7 +338,7 @@
 	{
 		label: "鍗曚綅",
 		prop: "unit",
-		width: 80
+		width: 70
 	},
 	{
 		label: "妫�娴嬪櫒鍏�",
@@ -283,7 +359,7 @@
 		prop: "result",
 		dataType: 'slot',
 		slot: 'result',
-		minWidth: 150
+    width: 150
 	},
 	{
 		label: "缁撴灉鍒ゆ柇",
@@ -332,6 +408,10 @@
 		uidNo: "",
 		batchNo: "",
 		quantity: "",
+		inspectedQuantity: "",
+		inspectMaterialCondition: "",
+		productionDate: "",
+		validityDate: "",
 		checkCompany: "",
 		checkResult: "",
 	}
@@ -432,6 +512,10 @@
   form.value.model = modelOptions.value.find(item => item.id == value)?.model || '';
   form.value.unit = modelOptions.value.find(item => item.id == value)?.unit || '';
   form.value.uidNo = modelOptions.value.find(item => item.id == value)?.uidNo || '';
+  // 閫夋嫨瑙勬牸鍨嬪彿鍚庯紝濡傛灉宸叉湁鐢熶骇鏃ユ湡鍒欓噸鏂拌绠楁湁鏁堟湡
+  if (form.value.productionDate) {
+    calculateValidityDate();
+  }
 }
 
 const findNodeById = (nodes, productId) => {
@@ -575,6 +659,24 @@
 	}
 };
 
+// 璁$畻鏈夋晥鏈燂紙鐢熶骇鏃ユ湡 + 瑙勬牸鍨嬪彿涓殑鏈夋晥鏈燂級
+const calculateValidityDate = async () => {
+  if (!form.value.productionDate) {
+    form.value.validityDate = '';
+    return;
+  }
+  // 鑾峰彇瑙勬牸鍨嬪彿鐨勬湁鏁堟湡
+  const selectedModel = modelOptions.value.find(item => item.id == form.value.productModelId);
+  if (selectedModel && selectedModel.validityPeriod) {
+    const productionDate = new Date(form.value.productionDate);
+    const validityPeriod = parseFloat(selectedModel.validityPeriod);
+    const validityDate = new Date(productionDate);
+    validityDate.setFullYear(validityDate.getFullYear() + Math.floor(validityPeriod));
+    validityDate.setMonth(validityDate.getMonth() + Math.round((validityPeriod % 1) * 12));
+    form.value.validityDate = validityDate.toISOString().split('T')[0];
+  }
+};
+
 // 鍏抽棴寮规
 const closeDia = () => {
   proxy.resetForm("formRef");

--
Gitblit v1.9.3