From 8f06fbf30772f2dd23a0ca7957d0f6d3db92c0e9 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期四, 17 九月 2026 17:36:19 +0800
Subject: [PATCH] feat: 移除“标准维护”中的“标准描述EN”

---
 src/views/business/inspectionTask/components/InspectionWord.vue |  153 ++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 127 insertions(+), 26 deletions(-)

diff --git a/src/views/business/inspectionTask/components/InspectionWord.vue b/src/views/business/inspectionTask/components/InspectionWord.vue
index 0b59485..54ddbd0 100644
--- a/src/views/business/inspectionTask/components/InspectionWord.vue
+++ b/src/views/business/inspectionTask/components/InspectionWord.vue
@@ -26,18 +26,45 @@
             </el-select>
           </div>
         </div>
-        <div style="text-align: left; margin-top: 8px;">
-          <el-form :inline="true" :model="currentOtherForm" class="form-inline" label-width="50px"
-            style="text-align: left; display: inline">
-            <el-form-item label="娓╁害:" style="margin-bottom: 0">
+        <div class="template-panel">
+          <el-form :inline="true" :model="currentOtherForm" class="form-inline" size="small" label-width="84px">
+            <el-form-item label="娓╁害:">
               <el-input v-model="currentOtherForm.temperature" :disabled="state > 1" placeholder="" size="small"
                 style="width: 90px" @change="m => subOtherForm(m, 'temperature')"></el-input>
-              <span style="margin-left: 4px">鈩�</span>
+              <span class="template-panel__unit">鈩�</span>
             </el-form-item>
-            <el-form-item label="婀垮害:" style="margin-bottom: 0">
+            <el-form-item label="婀垮害:">
               <el-input v-model="currentOtherForm.humidity" :disabled="state > 1" placeholder="" size="small"
                 style="width: 90px" @change="m => subOtherForm(m, 'humidity')"></el-input>
-              <span style="margin-left: 4px">%RH</span>
+              <span class="template-panel__unit">%RH</span>
+            </el-form-item>
+            <el-form-item label="妫�娴嬫椂闂�:">
+              <el-date-picker v-model="currentOtherForm.detectionTime" :disabled="state > 1" type="date"
+                value-format="yyyy-MM-dd" placeholder="璇烽�夋嫨鏃ユ湡" size="small" style="width: 160px"
+                @change="m => subOtherForm(m, 'detectionTime')"></el-date-picker>
+            </el-form-item>
+            <el-form-item label="妫�娴嬪湴鐐�:">
+              <el-input v-model="currentOtherForm.detectionPlace" :disabled="state > 1" clearable
+                placeholder="璇疯緭鍏ユ娴嬪湴鐐�" size="small" style="width: 200px"
+                @change="m => subOtherForm(m, 'detectionPlace')"></el-input>
+            </el-form-item>
+            <el-form-item label="璁惧:">
+              <el-select v-model="currentOtherForm.deviceIds" :disabled="state != 1" multiple filterable clearable
+                size="small" placeholder="璇烽�夋嫨璁惧" style="width: 360px"
+                @change="m => subOtherForm(m, 'deviceIds')">
+                <el-option v-for="device in deviceOptions" :key="device.id" :label="device.label"
+                  :value="device.id" />
+              </el-select>
+            </el-form-item>
+          </el-form>
+          <el-form :inline="true" :model="currentOtherForm" class="form-inline template-panel__conclusion--divided"
+            size="small" label-width="84px">
+            <el-form-item label="妫�楠岀粨璁�:">
+              <el-radio-group v-model="currentOtherForm.insResult" :disabled="state != 2"
+                @change="m => subOtherForm(m, 'insResult')">
+                <el-radio :label="1">鍚堟牸</el-radio>
+                <el-radio :label="0">涓嶅悎鏍�</el-radio>
+              </el-radio-group>
             </el-form-item>
           </el-form>
         </div>
@@ -356,8 +383,9 @@
       numOptions: [],
       temperatureOptions: [],
       wareTableData: [],
-      // 娓╁害銆佹箍搴︽寜妯℃澘 id 鍒嗙粍锛歿 [templateId]: { temperature, humidity } }
+      // 妫�娴嬫潯浠舵寜妯℃澘 id 鍒嗙粍锛歿 [templateId]: { temperature, humidity, detectionTime, detectionPlace, deviceIds } }
       otherForm: {},
+      deviceOptions: [],
       equipForm: {
         value0: null,
         code0: null,
@@ -433,11 +461,15 @@
     action() {
       return this.javaApi + "/insOrderPlan/uploadFile";
     },
-    // 褰撳墠妯℃澘瀵瑰簲鐨勬俯搴︺�佹箍搴�
+    // 褰撳墠妯℃澘瀵瑰簲鐨勬娴嬫潯浠�
     currentOtherForm() {
       return this.otherForm[this.currentTable] || {
         temperature: null,
-        humidity: null
+        humidity: null,
+        detectionTime: null,
+        detectionPlace: null,
+        deviceIds: [],
+        insResult: null
       }
     }
   },
@@ -474,19 +506,24 @@
         this.sampleProduct = res.data.sampleProduct
         this.currentSample = this.HaveJson(this.sampleProduct[0])
         let insProduct = this.HaveJson(this.currentSample.insProduct)
-        // 娓╁害銆佹箍搴﹁祴鍊硷細鎸夋ā鏉� id 鍒嗙粍鍥炴樉
+        // 妫�娴嬫潯浠惰祴鍊硷細鎸夋ā鏉� id 鍒嗙粍鍥炴樉
         this.otherForm = {}
         const conditionList = this.insOrder.templateConditions || []
         conditionList.forEach(item => {
           this.$set(this.otherForm, item.templateId, {
             temperature: item.temperature != null ? item.temperature : null,
-            humidity: item.humidity != null ? item.humidity : null
+            humidity: item.humidity != null ? item.humidity : null,
+            detectionTime: item.detectionTime != null ? item.detectionTime : null,
+            detectionPlace: item.detectionPlace != null ? item.detectionPlace : null,
+            deviceIds: Array.isArray(item.deviceIds) ? [...item.deviceIds] : [],
+            insResult: item.insResult != null ? item.insResult : null
           })
         })
         if (this.typeSource == '1') {
           this.retestTag = '1'
         }
         this.getEquipOptions(1)
+        this.loadDeviceOptions()
         // 鑾峰彇褰撳墠鏍峰搧鐨勬楠岄」
         let list = await this.getCurrentProduct(this.currentSample.id, 0)
         if (list === undefined) {
@@ -1318,6 +1355,16 @@
         })
       }
     },
+    loadDeviceOptions() {
+      search({ status: 0 }).then(res => {
+        this.deviceOptions = (res.data || []).map(device => ({
+          id: device.id,
+          label: `${device.deviceName}--${device.managementNumber}`
+        }))
+      }).catch(error => {
+        console.error(error)
+      })
+    },
     getUserInfo() {
       getUserNow().then(res => {
         this.userId = res.data.id
@@ -1327,13 +1374,23 @@
     upInsReview(e) {
       if (e == 1) {
         // 閫氳繃
+        // 姣忎釜妯℃澘閮借鏈夌粨璁猴紱鍏ㄩ儴鍚堟牸鎵嶇畻鏁村崟鍚堟牸
+        const insResults = this.tableLists.map(
+          item => (this.otherForm[item.templateId] || {}).insResult
+        )
+        const missingIndex = insResults.findIndex(result => result !== 0 && result !== 1)
+        if (missingIndex > -1) {
+          this.$message.error(`璇烽�夋嫨銆�${this.tableLists[missingIndex].templateName}銆嶇殑妫�楠岀粨璁篳)
+          return
+        }
         this.reviewLoading = true;
         verifyPlan({
           orderId: this.orderId,
           type: 1,
           laboratory: this.sonLaboratory,
           tell: null,
-          userId: this.checkUser
+          userId: this.checkUser,
+          insResult: insResults.every(result => result === 1) ? 1 : 0
         }).then(res => {
           if (res.code === 200) {
             this.$message.success("鎿嶄綔鎴愬姛")
@@ -1372,23 +1429,34 @@
         this.$message.error('鏈緭鍏ヤ笉閫氳繃鍘熷洜')
       }
     },
-    // 淇濊瘉妯℃澘鐨勬俯搴︺�佹箍搴︽Ы浣嶅瓨鍦�
+    // 淇濊瘉妯℃澘鐨勬娴嬫潯浠舵Ы浣嶅瓨鍦�
     ensureOtherForm(templateId) {
       if (templateId == null) return
       if (!this.otherForm[templateId]) {
         this.$set(this.otherForm, templateId, {
           temperature: null,
-          humidity: null
+          humidity: null,
+          detectionTime: null,
+          detectionPlace: null,
+          deviceIds: [],
+          insResult: null
         })
       }
     },
-    // 淇濆瓨褰撳墠妯℃澘鐨勬俯搴︺�佹箍搴�
+    // 淇濆瓨褰撳墠妯℃澘鐨勬娴嬫潯浠�
     subOtherForm(m, type) {
-      write({
+      const payload = {
         id: this.insOrder.id,
-        templateId: this.currentTable,
-        [type]: Number(m)
-      }).then(res => {
+        templateId: this.currentTable
+      }
+      if (type === 'deviceIds') {
+        payload.deviceIds = Array.isArray(m) ? [...m] : []
+      } else if (type === 'detectionTime' || type === 'detectionPlace') {
+        payload[type] = m === '' || m == null ? null : m
+      } else {
+        payload[type] = Number(m)
+      }
+      write(payload).then(res => {
         this.$message.success("淇濆瓨鎴愬姛")
       })
     },
@@ -1397,17 +1465,19 @@
         this.$message.error("璇锋寚瀹氬鏍镐汉鍛�")
         return
       }
-      const labels = { temperature: "娓╁害", humidity: "婀垮害" }
-      const keys = ["temperature", "humidity"]
       const missing = []
       this.tableLists.forEach(m => {
         const form = this.otherForm[m.templateId] || {}
-        keys.forEach(key => {
-          if (!form[key]) missing.push(`銆�${m.templateName}銆嶇殑${labels[key]}`)
-        })
+        if (!form.temperature) missing.push(`璇峰~鍐欍��${m.templateName}銆嶇殑娓╁害`)
+        if (!form.humidity) missing.push(`璇峰~鍐欍��${m.templateName}銆嶇殑婀垮害`)
+        if (!form.detectionTime) missing.push(`璇烽�夋嫨銆�${m.templateName}銆嶇殑妫�娴嬫椂闂碻)
+        if (!form.detectionPlace) missing.push(`璇峰~鍐欍��${m.templateName}銆嶇殑妫�娴嬪湴鐐筦)
+        if (!form.deviceIds || form.deviceIds.length === 0) {
+          missing.push(`璇烽�夋嫨銆�${m.templateName}銆嶇殑璁惧`)
+        }
       })
       if (missing.length > 0) {
-        this.$message.error(`璇峰~鍐�${missing[0]}`)
+        this.$message.error(missing[0])
         return
       }
       this.submitLoading = true;
@@ -1737,6 +1807,37 @@
   text-align: left;
 }
 
+/* 褰撳墠妫�楠屾ā鏉跨殑妫�娴嬫潯浠� */
+.template-panel {
+  background-color: #f8f9fb;
+  border: 1px solid #ebeef5;
+  border-radius: 3px;
+  padding: 16px 16px 4px;
+  margin-top: 12px;
+  text-align: left;
+}
+
+/* form-item 鐢� inline-flex 淇濊瘉 label 涓庢帶浠跺悓琛岋紝涓嶄緷璧栬鐩掑搴︽帹绠� */
+.template-panel>>>.el-form-item {
+  display: inline-flex;
+  align-items: center;
+  margin-bottom: 12px;
+}
+
+.template-panel>>>.el-form-item__label {
+  flex: none;
+}
+
+.template-panel__unit {
+  margin-left: 4px;
+  color: #606266;
+}
+
+.template-panel__conclusion--divided {
+  border-top: 1px dashed #e4e7ed;
+  padding-top: 12px;
+}
+
 .center {
   width: calc(100% - 40px);
   /* max-height: 580px; */

--
Gitblit v1.9.3