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 +++++++++++++
 src/views/qualityManagement/finalInspection/components/formDia.vue       |  158 ++++++++++++++++---
 src/views/qualityManagement/rawMaterialInspection/components/formDia.vue |  117 +++++++++++++
 src/api/qualityManagement/rawMaterialInspection.js                       |    9 +
 src/views/qualityManagement/rawMaterialInspection/index.vue              |    4 
 src/views/qualityManagement/finalInspection/index.vue                    |   34 +++
 src/views/qualityManagement/processInspection/index.vue                  |    4 
 7 files changed, 390 insertions(+), 52 deletions(-)

diff --git a/src/api/qualityManagement/rawMaterialInspection.js b/src/api/qualityManagement/rawMaterialInspection.js
index dcb3869..1df76ef 100644
--- a/src/api/qualityManagement/rawMaterialInspection.js
+++ b/src/api/qualityManagement/rawMaterialInspection.js
@@ -55,3 +55,12 @@
     })
 }
 
+// 涓嬭浇鍑哄簱妫�楠屾姤鍛�
+export function downloadOutReport(data) {
+    return request({
+        url: '/quality/qualityInspect/downOutReport',
+        method: 'post',
+        data: data,
+        responseType: "blob",
+    })
+}
\ No newline at end of file
diff --git a/src/views/qualityManagement/finalInspection/components/formDia.vue b/src/views/qualityManagement/finalInspection/components/formDia.vue
index 46c5cb8..6c91846 100644
--- a/src/views/qualityManagement/finalInspection/components/formDia.vue
+++ b/src/views/qualityManagement/finalInspection/components/formDia.vue
@@ -89,6 +89,50 @@
         </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="quantityDisabled"/>
+            </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>
+        <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>
@@ -154,10 +198,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 />
@@ -218,6 +271,10 @@
     batchNo: "",
     inspectedQuantity: "",
     quantity: "",
+    inspectedQuantity: "",
+    inspectMaterialCondition: "",
+    productionDate: "",
+    validityDate: "",
     checkCompany: "",
     checkResult: "",
   },
@@ -231,6 +288,25 @@
     unit: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
     inspectedQuantity: [{ required: true, 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" }],
@@ -255,32 +331,32 @@
 		prop: "standardValue",
 		width: 180
 	},
-	{
-		label: "鍗曚綅",
-		prop: "unit",
-		width: 80
-	},
-	{
-		label: "妫�娴嬪櫒鍏�",
-		prop: "instrument",
-		dataType: 'slot',
-		slot: 'instrument',
-		width: 220
-	},
-	{
-		label: "璁惧鐘舵��",
-		prop: "deviceStatus",
-		dataType: 'slot',
-		slot: 'deviceStatus',
-		width: 120
-	},
-	{
-		label: "妫�娴嬬粨鏋�",
-		prop: "result",
-		dataType: 'slot',
-		slot: 'result',
-		minWidth: 150
-	},
+  {
+    label: "鍗曚綅",
+    prop: "unit",
+    width: 70
+  },
+  {
+    label: "妫�娴嬪櫒鍏�",
+    prop: "instrument",
+    dataType: 'slot',
+    slot: 'instrument',
+    width: 220
+  },
+  {
+    label: "璁惧鐘舵��",
+    prop: "deviceStatus",
+    dataType: 'slot',
+    slot: 'deviceStatus',
+    width: 120
+  },
+  {
+    label: "妫�娴嬬粨鏋�",
+    prop: "result",
+    dataType: 'slot',
+    slot: 'result',
+    width: 150
+  },
 	{
 		label: "缁撴灉鍒ゆ柇",
 		prop: "resultJudgment",
@@ -412,6 +488,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) => {
@@ -509,6 +589,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 loadDeviceList = () => {
 	qualityInspectParamDeviceList().then(res => {
diff --git a/src/views/qualityManagement/finalInspection/index.vue b/src/views/qualityManagement/finalInspection/index.vue
index c7df4e9..a9ecdfb 100644
--- a/src/views/qualityManagement/finalInspection/index.vue
+++ b/src/views/qualityManagement/finalInspection/index.vue
@@ -68,6 +68,7 @@
 import {ElMessageBox} from "element-plus";
 import {
 	downloadQualityInspect,
+	downloadOutReport,
 	qualityInspectDel,
 	qualityInspectListPage, qualityInspectUpdate,
 	submitQualityInspect
@@ -190,7 +191,7 @@
 					return false;
 				}
       },
-      {
+      /*{
         name: "濉啓妫�楠岃褰�",
         type: "text",
         clickFun: (row) => {
@@ -203,7 +204,7 @@
 					}
 					return false;
 				}
-      },
+      },*/
       {
         name: "闄勪欢",
         type: "text",
@@ -246,6 +247,13 @@
 				type: "text",
 				clickFun: (row) => {
 					downLoadFile(row);
+				},
+			},
+			{
+				name: "鎶ュ憡",
+				type: "text",
+				clickFun: (row) => {
+					downloadReport(row);
 				},
 			},
     ],
@@ -408,13 +416,31 @@
 			type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
 		})
 		const downloadUrl = window.URL.createObjectURL(blob)
-		
+
 		const link = document.createElement('a')
 		link.href = downloadUrl
 		link.download = '鍘熸潗鏂欐楠屾姤鍛�.docx'
 		document.body.appendChild(link)
 		link.click()
-		
+
+		document.body.removeChild(link)
+		window.URL.revokeObjectURL(downloadUrl)
+	})
+};
+
+const downloadReport = (row) => {
+	downloadOutReport({ id: row.id }).then((blobData) => {
+		const blob = new Blob([blobData], {
+			type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+		})
+		const downloadUrl = window.URL.createObjectURL(blob)
+
+		const link = document.createElement('a')
+		link.href = downloadUrl
+		link.download = '鍑哄簱妫�楠屾姤鍛�.docx'
+		document.body.appendChild(link)
+		link.click()
+
 		document.body.removeChild(link)
 		window.URL.revokeObjectURL(downloadUrl)
 	})
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");
diff --git a/src/views/qualityManagement/processInspection/index.vue b/src/views/qualityManagement/processInspection/index.vue
index 955320a..0a86ccf 100644
--- a/src/views/qualityManagement/processInspection/index.vue
+++ b/src/views/qualityManagement/processInspection/index.vue
@@ -188,7 +188,7 @@
 					return false;
 				}
       },
-      {
+      /*{
         name: "濉啓妫�楠岃褰�",
         type: "text",
         clickFun: (row) => {
@@ -201,7 +201,7 @@
 					}
 					return false;
 				}
-      },
+      },*/
       {
         name: "闄勪欢",
         type: "text",
diff --git a/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue b/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
index 824194e..fc527f3 100644
--- a/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
+++ b/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
@@ -76,9 +76,54 @@
             </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="supplierQuantityDisabled"/>
+            </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="supplierQuantityDisabled"/>
+            </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>
@@ -168,10 +213,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 />
@@ -232,6 +286,10 @@
     testStandardId: "",
     unit: "",
     quantity: "",
+    inspectedQuantity: "",
+    inspectMaterialCondition: "",
+    productionDate: "",
+    validityDate: "",
     checkCompany: "",
     checkResult: "",
   },
@@ -244,6 +302,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"}],
@@ -263,7 +340,7 @@
   {
     label: "鍗曚綅",
     prop: "unit",
-    width: 80
+    width: 70
   },
   {
     label: "妫�娴嬪櫒鍏�",
@@ -284,7 +361,7 @@
     prop: "result",
     dataType: 'slot',
     slot: 'result',
-    minWidth: 150
+    width: 150
   },
   {
     label: "缁撴灉鍒ゆ柇",
@@ -343,6 +420,10 @@
     testStandardId: "",
     unit: "",
     quantity: "",
+    inspectedQuantity: "",
+    inspectMaterialCondition: "",
+    productionDate: "",
+    validityDate: "",
     checkCompany: "",
     checkResult: "",
   }
@@ -441,6 +522,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) => {
@@ -580,6 +665,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");
diff --git a/src/views/qualityManagement/rawMaterialInspection/index.vue b/src/views/qualityManagement/rawMaterialInspection/index.vue
index bb90efa..98b51a5 100644
--- a/src/views/qualityManagement/rawMaterialInspection/index.vue
+++ b/src/views/qualityManagement/rawMaterialInspection/index.vue
@@ -190,7 +190,7 @@
 					return false;
 				}
       },
-      {
+      /*{
         name: "濉啓妫�楠岃褰�",
         type: "text",
         clickFun: (row) => {
@@ -203,7 +203,7 @@
 					}
 					return false;
 				}
-      },
+      },*/
       {
         name: "闄勪欢",
         type: "text",

--
Gitblit v1.9.3