From 36c0f6593e6825fe035f63147fa1257638f57676 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期一, 26 十月 2026 13:52:55 +0800
Subject: [PATCH] feat(device): 设备模块统一“设备名称/设备EN名称”命名;核查计划新增设备型号列;核查计划弹窗取消确认与废草稿清理

---
 src/views/CNAS/resourceDemand/device/component/equipmentVerificationPlan.vue |   31 ++++++++++++++++++++++++++++---
 1 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/src/views/CNAS/resourceDemand/device/component/equipmentVerificationPlan.vue b/src/views/CNAS/resourceDemand/device/component/equipmentVerificationPlan.vue
index b79641d..fa984f8 100644
--- a/src/views/CNAS/resourceDemand/device/component/equipmentVerificationPlan.vue
+++ b/src/views/CNAS/resourceDemand/device/component/equipmentVerificationPlan.vue
@@ -51,6 +51,7 @@
           width="70"></el-table-column>
         <el-table-column label="璁惧缂栧彿" min-width="170" prop="deviceNumber"></el-table-column>
         <el-table-column label="璁惧鍚嶇О" min-width="180" prop="deviceName" show-overflow-tooltip></el-table-column>
+        <el-table-column label="璁惧鍨嬪彿" min-width="120" prop="deviceModel" show-overflow-tooltip></el-table-column>
         <el-table-column label="鏍告煡鏃堕棿" min-width="120" prop="checkTime"
           :formatter="formatCheckMonth"></el-table-column>
         <el-table-column label="鏍告煡鎸囨爣" min-width="140" prop="checkIndex"> </el-table-column>
@@ -107,7 +108,7 @@
           <div class="form-section-title">鍩烘湰淇℃伅</div>
           <el-row :gutter="12">
             <el-col :span="12">
-              <el-form-item label="浠櫒鍚嶇О锛�" prop="deviceName">
+              <el-form-item label="璁惧鍚嶇О锛�" prop="deviceName">
                 <el-input v-model="form.deviceName" disabled size="small"></el-input>
               </el-form-item>
             </el-col>
@@ -212,7 +213,7 @@
         </div>
       </el-form>
       <template #footer><span class="dialog-footer">
-        <el-button @click="resetForm">鍙� 娑�</el-button>
+        <el-button @click="handleCancel">鍙� 娑�</el-button>
         <el-button :loading="submitFormLoading" type="primary" @click="submitForm"
           v-if="operationType !== 'view'">纭� 璁�</el-button>
       </span></template>
@@ -471,7 +472,10 @@
       this.$nextTick(() => {
         this.form = this.HaveJson(row)
         if (this.operationType !== 'view') {
-          this.draftRestore('equipmentVerificationPlan', 'form', this.form.planDetailsId, 'dialogVisible')
+          const rowDeviceName = this.form.deviceName
+          this.draftRestore('equipmentVerificationPlan', 'form', this.form.planDetailsId, 'dialogVisible',
+            // 璁惧鍚嶇О鏄鐢ㄥ瓧娈碉紝鑽夌閲屼负绌鸿鏄庢槸琚〃鍗曢噸缃竻绌虹殑搴熻崏绋匡紝鐩存帴涓㈠純
+            draft => !!draft.deviceName || !rowDeviceName)
         }
       })
     },
@@ -518,7 +522,28 @@
         this.saveDocx(res, '浠櫒璁惧鏈熼棿鏍告煡璁″垝琛�.docx')
       }).catch(() => { })
     },
+    // 鏈鏄惁鏈夋敼鍔紙鍚墦寮�鏃舵仮澶嶇殑鑽夌锛�
+    hasUnsavedEdit() {
+      const state = this.draftStates && this.draftStates['equipmentVerificationPlan']
+      return !!state && this.draftSnapshot(state) !== state.baseline
+    },
+    // 鍙栨秷锛氭棤缂栬緫鐩存帴閫�鍑猴紱鏈夌紪杈戝厛纭锛岀‘璁ゅ悗涓㈠純鑽夌閫�鍑�
+    handleCancel() {
+      if (this.operationType === 'view' || !this.hasUnsavedEdit()) {
+        this.dialogVisible = false
+        return
+      }
+      this.$confirm('鏄惁纭鍙栨秷缂栬緫锛熸湰娆$紪杈戣褰曚笉淇濆瓨锛�', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '缁х画缂栬緫',
+        type: 'warning'
+      }).then(() => {
+        this.draftClear('equipmentVerificationPlan')
+        this.dialogVisible = false
+      }).catch(() => { })
+    },
     resetForm() {
+      // 鍙充笂瑙掑叧闂椂 close 浜嬩欢鍏堜簬鏄鹃殣鐩戝惉瑙﹀彂锛屽厛鎶婅崏绋垮瓨涓嬪啀閲嶇疆琛ㄥ崟锛岄伩鍏嶉噸缃悗鐨勭┖鍐呭琚瓨鎴愯崏绋�
       this.draftStop('equipmentVerificationPlan')
       this.$refs.modelForm.resetFields();
       this.dialogVisible = false

--
Gitblit v1.9.3