From 39154a82354b08c2449918c0665457fdb2701b9b Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期五, 16 十月 2026 16:02:23 +0800
Subject: [PATCH] 设备模块各标签页弹窗新增草稿自动保存与恢复:编辑或录入数据中途关闭/刷新页面,再次打开同一弹窗时自动恢复未保存的编辑内容(弹窗显示"已恢复上次未保存的编辑内容"提示),保存成功后草稿自动清除;新增 src/mixins/draftSave.js 同时清理设备死代码:management.vue 数采配置旧弹窗及其提交方法、calibration.vue 被注释的导出按钮、device.js 中 numberCollect/deviceMetricRecordExport 两个死接口定义

---
 src/views/CNAS/resourceDemand/device/component/acceptanceForm.vue |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/views/CNAS/resourceDemand/device/component/acceptanceForm.vue b/src/views/CNAS/resourceDemand/device/component/acceptanceForm.vue
index 331d207..a0d204e 100644
--- a/src/views/CNAS/resourceDemand/device/component/acceptanceForm.vue
+++ b/src/views/CNAS/resourceDemand/device/component/acceptanceForm.vue
@@ -79,10 +79,12 @@
   updateDeviceAcceptance,
 } from '@/api/cnas/resourceDemand/device.js'
 import { selectUserCondition } from "@/api/business/inspectionTask";
+import draftSave from '@/mixins/draftSave'
 export default {
   name: "acceptance-form",
   // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
   components: {},
+  mixins: [draftSave],
   data() {
     // 杩欓噷瀛樻斁鏁版嵁
     return {
@@ -122,13 +124,19 @@
       this.getUserList()
       if (this.form.acceptanceId) {
         this.searchInfo()
+      } else if (this.operationType !== 'view') {
+        this.draftRestore('acceptanceForm', 'form', this.form.deviceId, 'dialogVisible')
       }
     },
     // 鏌ヨ璇︽儏
     searchInfo() {
       getDeviceAcceptance({ acceptanceId: this.form.acceptanceId }).then(res => {
         if (res.code === 200) {
+          const id = this.form.acceptanceId
           this.form = { ...res.data }
+          if (this.operationType !== 'view') {
+            this.draftRestore('acceptanceForm', 'form', id, 'dialogVisible')
+          }
         }
       }).catch(error => {
         console.error(error)
@@ -142,6 +150,7 @@
             addDeviceAcceptance(this.form).then(res => {
               if (res.code == 200) {
                 this.$message.success('鏂板鎴愬姛')
+                this.draftClear('acceptanceForm')
                 this.resetForm()
               }
               this.submitFormLoading = false
@@ -152,6 +161,7 @@
             updateDeviceAcceptance(this.form).then(res => {
               if (res.code == 200) {
                 this.$message.success('淇敼鎴愬姛')
+                this.draftClear('acceptanceForm')
                 this.resetForm()
               }
               this.submitFormLoading = false
@@ -164,6 +174,7 @@
     },
     // 鍏抽棴寮规
     resetForm() {
+      this.draftStop('acceptanceForm')
       this.dialogVisible = false
       this.$emit('closeDialog')
     },

--
Gitblit v1.9.3