设备模块各标签页弹窗新增草稿自动保存与恢复:编辑或录入数据中途关闭/刷新页面,再次打开同一弹窗时自动恢复未保存的编辑内容(弹窗显示"已恢复上次未保存的编辑内容"提示),保存成功后草稿自动清除;新增 src/mixins/draftSave.js
同时清理设备死代码:management.vue 数采配置旧弹窗及其提交方法、calibration.vue 被注释的导出按钮、device.js 中 numberCollect/deviceMetricRecordExport 两个死接口定义
已添加1个文件
已修改28个文件
584 ■■■■■ 文件已修改
src/api/cnas/resourceDemand/device.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mixins/draftSave.js 157 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/acceptanceForm.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/accidentForm.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/addVerificationYearPlanDia.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/addYearPlanDia.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/applicationForm.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/borrow.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/calibration.vue 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/check.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/checkRecord.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/equipmentCalibrationPlan.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/equipmentCheck.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/equipmentMaintenance.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/equipmentMaintenancePlan.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/equipmentVerificationPlan.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/failureForm.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/fault.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/files.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/inspectionForm.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/management.vue 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/operationInstruction.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/quantityValueTraceabilityPlan.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/record.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/resourceReservation.vue 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/scrapApplicationForm.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/state.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/usageAuthorization.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/resourceDemand/device.js
@@ -74,15 +74,6 @@
  });
}
// ç»´æŠ¤æ•°é‡‡é…ç½®
export function numberCollect(data) {
  return request({
    url: "/deviceScope/numberCollect",
    method: "post",
    data: data,
  });
}
//设备预约接口-列表
export function getDeviceParameter(query) {
  return request({
@@ -823,16 +814,6 @@
  return request({
    url: "/deviceMetricRecord/deleteDeviceMetricRecord",
    method: "delete",
    params: query,
  });
}
//设备校准 å¯¼å‡º
export function deviceMetricRecordExport(query) {
  return request({
    url: "/deviceMetricRecord/deviceMetricRecordExport",
    method: "get",
    responseType: "blob",
    params: query,
  });
}
src/mixins/draftSave.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,157 @@
import cache from '@/plugins/cache'
import useUserStore from '@/store/modules/user'
// å¼¹çª—编辑草稿自动保存/恢复:
// æ‰“开弹窗时注册唯一业务 key,表单有改动时防抖写入 localStorage,
// å…³é—­/切页/刷新后再次打开同一弹窗时自动恢复未保存的内容;保存成功后草稿清除。
export default {
  data() {
    return {
      draftStates: {}
    }
  },
  created() {
    this.draftBeforeUnload = () => {
      this.draftFlushAll()
    }
    window.addEventListener('beforeunload', this.draftBeforeUnload)
  },
  beforeUnmount() {
    this.draftFlushAll()
    window.removeEventListener('beforeunload', this.draftBeforeUnload)
  },
  methods: {
    // æ‰“开弹窗、表单填好后调用;有未保存草稿则自动恢复
    // bizKey:全局唯一业务名;formField:表单字段名(如 'form');recordId:编辑传记录id、新增传上下文;visibleField:弹窗显隐字段(如 'dialogVisible')
    draftRestore(bizKey, formField, recordId, visibleField) {
      const old = this.draftStates[bizKey]
      if (old) {
        this.draftTeardown(old)
      }
      let uid = ''
      try {
        uid = useUserStore().id || ''
      } catch (e) {
      }
      const rid = (recordId === null || recordId === undefined || recordId === '') ? 'new' : recordId
      const state = {
        key: `limsDraft_${uid}_${bizKey}_${rid}`,
        formField,
        visibleField,
        active: true,
        timer: null,
        baseline: ''
      }
      state.unwatchForm = this.$watch(formField, () => this.draftSchedule(state), { deep: true })
      if (visibleField) {
        state.unwatchVisible = this.$watch(visibleField, (val) => {
          if (!val) {
            this.draftStop(bizKey)
          }
        })
      }
      state.baseline = this.draftSnapshot(state)
      this.draftStates[bizKey] = state
      const raw = cache.local.get(state.key)
      if (raw) {
        try {
          const draft = JSON.parse(raw)
          const target = this[formField]
          if (Array.isArray(target) && Array.isArray(draft)) {
            target.splice(0, target.length, ...draft)
          } else if (target && typeof target === 'object') {
            Object.assign(target, draft)
          } else {
            this[formField] = draft
          }
          this.$message({ type: 'info', message: '已恢复上次未保存的编辑内容' })
        } catch (e) {
          cache.local.remove(state.key)
        }
      }
    },
    draftSnapshot(state) {
      try {
        return JSON.stringify(this[state.formField])
      } catch (e) {
        return ''
      }
    },
    draftSchedule(state) {
      if (!state.active) {
        return
      }
      if (state.timer) {
        clearTimeout(state.timer)
      }
      state.timer = setTimeout(() => {
        state.timer = null
        this.draftWrite(state, true)
      }, 300)
    },
    draftWrite(state, checkVisible) {
      if (!state.active) {
        return
      }
      if (checkVisible && state.visibleField && !this[state.visibleField]) {
        return
      }
      const json = this.draftSnapshot(state)
      if (json === '' || json === state.baseline) {
        cache.local.remove(state.key)
      } else {
        cache.local.set(state.key, json)
      }
    },
    // ç”¨æˆ·å–消/关闭弹窗时调用(必须在清空表单之前)
    draftStop(bizKey) {
      const state = this.draftStates[bizKey]
      if (!state || !state.active) {
        return
      }
      if (state.timer) {
        clearTimeout(state.timer)
        state.timer = null
      }
      this.draftWrite(state, false)
      this.draftTeardown(state)
    },
    // ä¿å­˜æˆåŠŸåŽè°ƒç”¨
    draftClear(bizKey) {
      const state = this.draftStates[bizKey]
      if (!state) {
        return
      }
      if (state.timer) {
        clearTimeout(state.timer)
        state.timer = null
      }
      cache.local.remove(state.key)
      this.draftTeardown(state)
    },
    draftTeardown(state) {
      state.active = false
      if (state.unwatchForm) {
        state.unwatchForm()
        state.unwatchForm = null
      }
      if (state.unwatchVisible) {
        state.unwatchVisible()
        state.unwatchVisible = null
      }
    },
    draftFlushAll() {
      Object.keys(this.draftStates).forEach((k) => {
        const state = this.draftStates[k]
        if (state && state.active) {
          if (state.timer) {
            clearTimeout(state.timer)
            state.timer = null
          }
          this.draftWrite(state, true)
          this.draftTeardown(state)
        }
      })
    }
  }
}
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')
    },
src/views/CNAS/resourceDemand/device/component/accidentForm.vue
@@ -100,10 +100,12 @@
  getDeviceAccidentReport,
  addDeviceAccidentReport,
} from '@/api/cnas/resourceDemand/device.js'
import draftSave from '@/mixins/draftSave'
export default {
  name: "accident-form",
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  mixins: [draftSave],
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
@@ -150,13 +152,17 @@
      this.getUserList()
      if (this.form.accidentReportId) {
        this.searchInfo()
      } else {
        this.draftRestore('accidentForm', 'form', this.form.deviceId, 'dialogVisible')
      }
    },
    // æŸ¥è¯¢è¯¦æƒ…
    searchInfo() {
      getDeviceAccidentReport({ accidentReportId: this.form.accidentReportId }).then(res => {
        if (res.code === 200) {
          const id = this.form.accidentReportId
          this.form = { ...res.data }
          this.draftRestore('accidentForm', 'form', id, 'dialogVisible')
          if (res.data.isFinish === 0) {
            if (this.form.assessorUserId) {
              this.currentStep = 1
@@ -194,6 +200,7 @@
          addDeviceAccidentReport(this.form).then(res => {
            if (res.code == 200) {
              this.$message.success('新增成功')
              this.draftClear('accidentForm')
              this.resetForm()
            }
            this.submitFormLoading = false
@@ -205,6 +212,7 @@
    },
    // å…³é—­å¼¹æ¡†
    resetForm() {
      this.draftStop('accidentForm')
      this.dialogVisible = false
      this.$emit('closeDialog')
    },
src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue
@@ -181,10 +181,12 @@
  getNoConfigProduct,
} from '@/api/cnas/resourceDemand/device.js'
import limsTable from "@/components/Table/lims-table.vue";
import draftSave from '@/mixins/draftSave'
export default {
  name: "dataAcquisitionConfig",
  // import å¼•入的组件需要注入到对象中才能使用
  components: {limsTable},
  mixins: [draftSave],
  props: {
    deviceId: {
      type: Number,
@@ -405,6 +407,9 @@
        this.configForm["sampleCode"] = res.data.sampleCode;
        this.configForm["dbFileName"] = res.data.dbFileName;
        this.configForm["fiberOpticRibbon"] = res.data.fiberOpticRibbon
        this.$nextTick(() => {
          this.draftRestore('acquisitionConfig4', 'configForm', this.deviceId, 'dialogVisible4')
        })
      })
    },
    // æäº¤æ–‡ä»¶é…ç½®
@@ -423,6 +428,7 @@
      this.upLoad4 = true;
      saveDeviceFileConfiguration({ deviceId: this.deviceId, ...obj }).then(res => {
        if (res.code == 200) {
          this.draftClear('acquisitionConfig4')
          this.dialogVisible4 = false;
          this.init();
          this.$message.success("操作成功");
@@ -481,6 +487,10 @@
            });
          });
        }
        this.$nextTick(() => {
          this.draftRestore('acquisitionConfig3', 'configForm', row.structureItemParameterId, 'dialogVisible3')
          this.draftRestore('acquisitionConfig3Domains', 'domains', row.structureItemParameterId, 'dialogVisible3')
        })
      });
    },
    // æäº¤æ•°é‡‡é…ç½®
@@ -520,6 +530,8 @@
            dataConfigList: this.domains,
            isDevice: false
          }).then(res => {
            this.draftClear('acquisitionConfig3')
            this.draftClear('acquisitionConfig3Domains')
            this.dialogVisible3 = false;
            this.domains = [
              {
@@ -580,6 +592,8 @@
      this.page.current = val;
    },
    closeForm() {
      this.draftStop('acquisitionConfig3')
      this.draftStop('acquisitionConfig3Domains')
      this.deleteList = [];
      this.domains = [
        {
src/views/CNAS/resourceDemand/device/component/addVerificationYearPlanDia.vue
@@ -99,10 +99,12 @@
  deviceScopeSearch,
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/performance/class";
import draftSave from '@/mixins/draftSave'
export default {
  name: "addVerificationYearPlanDia",
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  mixins: [draftSave],
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
@@ -137,6 +139,10 @@
          examinePlanDetailsList: [],
        }
        this.examinePlanDetailsList = []
        this.$nextTick(() => {
          this.draftRestore('addVerificationYearPlanDiaForm', 'form', '', 'applicationForm')
          this.draftRestore('addVerificationYearPlanDiaRows', 'examinePlanDetailsList', '', 'applicationForm')
        })
      } else {
        this.getRowInfo(row)
      }
@@ -152,6 +158,10 @@
          this.form.planName = res.data.planName
          this.form.planYear = res.data.planYear
          this.form.planId = res.data.planId
          this.$nextTick(() => {
            this.draftRestore('addVerificationYearPlanDiaForm', 'form', this.form.planId, 'applicationForm')
            this.draftRestore('addVerificationYearPlanDiaRows', 'examinePlanDetailsList', this.form.planId, 'applicationForm')
          })
        }
      }).catch(error => {
        this.yearTableLoading = false
@@ -212,6 +222,8 @@
        addDeviceExaminePlan(this.form).then(res => {
          if (res.code == 200) {
            this.$message.success('新增成功')
            this.draftClear('addVerificationYearPlanDiaForm')
            this.draftClear('addVerificationYearPlanDiaRows')
            this.closeDialog()
            this.$emit('closeDia')
          }
@@ -223,6 +235,8 @@
        updateDeviceExaminePlan(this.form).then(res => {
          if (res.code == 200) {
            this.$message.success('新增成功')
            this.draftClear('addVerificationYearPlanDiaForm')
            this.draftClear('addVerificationYearPlanDiaRows')
            this.closeDialog()
            this.$emit('closeDia')
          }
@@ -233,6 +247,8 @@
      }
    },
    closeDialog() {
      this.draftStop('addVerificationYearPlanDiaForm')
      this.draftStop('addVerificationYearPlanDiaRows')
      this.applicationForm = false
    },
    // èŽ·å–æ‰€æœ‰è®¾å¤‡
src/views/CNAS/resourceDemand/device/component/addYearPlanDia.vue
@@ -96,11 +96,13 @@
  deviceScopeSearch
} from '@/api/cnas/resourceDemand/device.js'
import Sortable from "sortablejs";
import draftSave from '@/mixins/draftSave'
export default {
  name: "addYearPlanDia",
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  mixins: [draftSave],
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
@@ -134,6 +136,10 @@
          calibrationPlanDetailList: [],
        }
        this.calibrationPlanDetailList = []
        this.$nextTick(() => {
          this.draftRestore('addYearPlanDiaForm', 'form', '', 'applicationForm')
          this.draftRestore('addYearPlanDiaRows', 'calibrationPlanDetailList', '', 'applicationForm')
        })
      } else {
        this.getRowInfo(row)
      }
@@ -148,6 +154,10 @@
          this.form.planName = res.data.planName
          this.form.planYear = res.data.planYear
          this.form.planId = res.data.planId
          this.$nextTick(() => {
            this.draftRestore('addYearPlanDiaForm', 'form', this.form.planId, 'applicationForm')
            this.draftRestore('addYearPlanDiaRows', 'calibrationPlanDetailList', this.form.planId, 'applicationForm')
          })
        }
      }).catch(err => {
        this.yearTableLoading = false
@@ -215,6 +225,8 @@
        addDeviceCalibrationPlan(this.form).then(res => {
          if (res.code == 200) {
            this.$message.success('新增成功')
            this.draftClear('addYearPlanDiaForm')
            this.draftClear('addYearPlanDiaRows')
            this.closeDialog()
            this.$emit('closeDia')
          }
@@ -226,6 +238,8 @@
        updateDeviceCalibrationPlan(this.form).then(res => {
          if (res.code == 200) {
            this.$message.success('新增成功')
            this.draftClear('addYearPlanDiaForm')
            this.draftClear('addYearPlanDiaRows')
            this.closeDialog()
            this.$emit('closeDia')
          }
@@ -236,6 +250,8 @@
      }
    },
    closeDialog() {
      this.draftStop('addYearPlanDiaForm')
      this.draftStop('addYearPlanDiaRows')
      this.applicationForm = false
    },
    // èŽ·å–æ‰€æœ‰è®¾å¤‡
src/views/CNAS/resourceDemand/device/component/applicationForm.vue
@@ -115,10 +115,12 @@
  addDeviceExternalApply,
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/business/inspectionTask";
import draftSave from '@/mixins/draftSave'
export default {
  name: "applicationForm",
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  mixins: [draftSave],
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
@@ -165,12 +167,17 @@
      this.getUserList()
      if (this.form.externalApplyId) {
        this.searchInfo()
      } else {
        this.$nextTick(() => {
          this.draftRestore('applicationForm', 'form', '', 'dialogVisible')
        })
      }
    },
    // æŸ¥è¯¢è¯¦æƒ…
    searchInfo() {
      getDeviceExternalApply({ externalApplyId: this.form.externalApplyId }).then(res => {
        if (res.code === 200) {
          const externalApplyId = this.form.externalApplyId
          this.form = { ...res.data }
          if (res.data.isFinish === 0) {
            if (this.form.departmentHeadUserId) {
@@ -189,6 +196,9 @@
            this.currentStep = 4
            this.showStep = 3
          }
          this.$nextTick(() => {
            this.draftRestore('applicationForm', 'form', externalApplyId, 'dialogVisible')
          })
        }
      }).catch(error => {
        console.error(error)
@@ -205,6 +215,7 @@
          addDeviceExternalApply(this.form).then(res => {
            if (res.code == 200) {
              this.$message.success('新增成功')
              this.draftClear('applicationForm')
              this.resetForm()
            }
            this.submitFormLoading = false
@@ -216,6 +227,7 @@
    },
    // å…³é—­å¼¹æ¡†
    resetForm() {
      this.draftStop('applicationForm')
      this.dialogVisible = false
      this.$emit('closeDialog')
    },
src/views/CNAS/resourceDemand/device/component/borrow.vue
@@ -207,7 +207,9 @@
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/business/inspectionTask";
import { mapGetters } from "@/utils/store-compat";
import draftSave from '@/mixins/draftSave'
export default {
  mixins: [draftSave],
  props: {
    clickNodeVal: {
      type: Object,
@@ -343,6 +345,7 @@
    },
    dialogVisible(newVal) {
      if (!newVal) {
        this.draftStop('borrow')
        this.form = {}
        this.currentStep = 0 // æ­¥éª¤æ¡æ˜¾ç¤ºç¬¬å‡ æ­¥
        this.currentStepClick = 0 // ç‚¹å‡»æ­¥éª¤æ¡å˜åŒ–
@@ -448,6 +451,7 @@
          saveDeviceBorrow(this.form).then(res => {
            if (res.code == 200) {
              this.$message.success('提交成功')
              this.draftClear('borrow')
              this.dialogVisible = false
              this.refreshTable()
            }
@@ -510,6 +514,9 @@
            this.currentStepClick = i
          }
          console.log(this.currentStepClick)
          if (this.currentStep < 2) {
            this.draftRestore('borrow', 'form', this.form.id, 'dialogVisible')
          }
          this.dialogVisible = true
        }
      })
@@ -532,6 +539,7 @@
      }
      this.form.deviceName = this.clickNodeVal.label
      this.form.deviceId = this.clickNodeVal.value
      this.draftRestore('borrow', 'form', this.clickNodeVal.value, 'dialogVisible')
    },
    //导出
    handleDown() {
src/views/CNAS/resourceDemand/device/component/calibration.vue
@@ -4,7 +4,6 @@
    <div class="btnS">
      <el-button size="small" type="primary" @click="calibrationMaintenance()">校准项目维护</el-button>
      <el-button size="small" type="primary" @click="add('add')">添加校准记录</el-button>
      <!-- <el-button size="small" type="primary" @click="handleDown">导出Excel</el-button> -->
    </div>
    <div class="tables" style="margin-top: 10px;">
      <el-table :data="tableData" height="calc(100vh - 20em)" border>
@@ -258,7 +257,6 @@
  deviceMetricRecordPage,
  showDeviceMetricsCopy,
  deleteDeviceMetricRecord,
  deviceMetricRecordExport,
  deleteCNASFile,
  selectDeviceMetric,
  deleteDeviceMetrics,
@@ -267,6 +265,7 @@
} from '@/api/cnas/resourceDemand/device.js'
import { selectQualifiedSupplierManagementPage } from '@/api/cnas/externalService/supplierManage/supplierManage'
import { mapGetters } from "@/utils/store-compat";
import draftSave from '@/mixins/draftSave'
export default {
  props: {
    clickNodeVal: {
@@ -276,6 +275,7 @@
      }
    }
  },
  mixins: [draftSave],
  data() {
    return {
      value: "",
@@ -408,7 +408,10 @@
    add(type) {
      this.operationType = type
      this.dialogVisible1 = true
      this.getXmsg()
      this.draftRestore('calibrationRecord', 'calibrationRecord', '', 'dialogVisible1')
      this.getXmsg().then(() => {
        this.draftRestore('calibrationRecordParams', 'calibrateParams', '', 'dialogVisible1')
      })
    },
    // æŸ¥çœ‹è¯¦æƒ…
    handleViewClick(type, row) {
@@ -440,18 +443,6 @@
    handleAttachmentClick(row) {
      this.$download.saveAs(row.systemFileName, row.systemFileName)
    },
    //导出
    handleDown() {
      this.outLoading = true
      deviceMetricRecordExport({
        deviceId: this.clickNodeVal.value,
        type: 'calibrate'
      }).then(res => {
        this.outLoading = false
        const blob = new Blob([res], { type: 'application/octet-stream' });
        this.$download.saveAs(blob, '设备校准.xlsx')
      })
    },
    deleteFile() {
      this.$confirm('此操作将永久删除文件, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
@@ -477,6 +468,9 @@
    calibrationMaintenance() {
      this.dialogVisible0 = true
      this.getXmsg();
      this.$nextTick(() => {
        this.draftRestore('calibrationMaintain', 'form0', this.clickNodeVal.value, 'dialogVisible0')
      })
    },
    // èŽ·å–è®¾å¤‡æ ¡å‡†å‚æ•°table信息
    async getXmsg() {
@@ -523,6 +517,8 @@
            if (res.code == 200) {
              this.$message.success('保存成功')
              this.$refs['form0'].resetFields()
              this.draftClear('calibrationMaintain')
              this.draftRestore('calibrationMaintain', 'form0', this.clickNodeVal.value, 'dialogVisible0')
              this.getXmsg() // åˆ·æ–°è®¾å¤‡æ ¡å‡†å‚数表格
            }
            this.calibrateParamsLoading = false
@@ -554,6 +550,8 @@
            addOrUpdateDeviceMetricRecord(this.calibrationRecord).then(res => {
              if (res.code == 200) {
                this.$message.success('添加成功')
                this.draftClear('calibrationRecord')
                this.draftClear('calibrationRecordParams')
                this.dialogVisible1 = false
                this.getTableList(this.clickNodeVal.value)
              }
@@ -608,6 +606,8 @@
    },
    dialogVisible1(newVal) {
      if (newVal === false) {
        this.draftStop('calibrationRecord')
        this.draftStop('calibrationRecordParams')
        this.calibrateParams = []
        this.calibrationRecord = {
          unitOfMeasure: '', // è®¡é‡å•位
src/views/CNAS/resourceDemand/device/component/check.vue
@@ -250,8 +250,10 @@
<script>
import file from '@/utils/file';
import { mapGetters } from "@/utils/store-compat";
import draftSave from '@/mixins/draftSave'
export default {
  components: {},
  mixins: [draftSave],
  props: {
    clickNodeVal: {
      type: Object,
@@ -385,6 +387,7 @@
    // æ ¡å‡†é¡¹ç›®ç»´æŠ¤
    calibrationMaintenance() {
      this.dialogVisible0 = true
      this.draftRestore('checkMaintenanceDia', 'form0', this.clickNodeVal.value, 'dialogVisible0')
      this.getXmsg();
    },
    addCalibrate() {
@@ -403,6 +406,7 @@
          }).then(res => {
            if (res.code == 200) {
              this.$message.success('保存成功')
              this.draftClear('checkMaintenanceDia')
              this.$refs['form0'].resetFields()
              this.getXmsg() // åˆ·æ–°è®¾å¤‡æ ¡å‡†å‚数表格
            }
@@ -447,6 +451,7 @@
            }).then(res => {
              if (res.code == 200) {
                this.$message.success('添加成功')
                this.draftClear('checkAddRecordDia')
                this.dialogVisible1 = false
                this.getTableList(this.clickNodeVal.value)
              }
@@ -462,6 +467,7 @@
      })
    },
    resetcalibrationRecord() {
      this.draftStop('checkAddRecordDia')
      this.$refs.calibrationRecord.resetFields()
    },
    // é™„件上传
@@ -518,6 +524,7 @@
    add(type) {
      this.operationType = type
      this.dialogVisible1 = true
      this.draftRestore('checkAddRecordDia', 'calibrationRecord', this.clickNodeVal.value, 'dialogVisible1')
      this.getXmsg()
    },
    // æŸ¥çœ‹è¯¦æƒ…
src/views/CNAS/resourceDemand/device/component/checkRecord.vue
@@ -229,10 +229,12 @@
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/performance/class";
import {mapGetters} from "@/utils/store-compat";
import draftSave from '@/mixins/draftSave'
export default {
  name: "check-record",
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  mixins: [draftSave],
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
@@ -319,6 +321,10 @@
            this.currentStep = 2
          }
          this.reviewUserId = this.form.reviewUserId
          this.$nextTick(() => {
            this.draftRestore('checkRecordForm', 'form', this.form.planDetailsId, 'dialogVisible')
            this.draftRestore('checkRecordRows', 'recordDetailList', this.form.planDetailsId, 'dialogVisible')
          })
        }
      }).catch(error => {
        console.error(error)
@@ -340,6 +346,8 @@
      addExamineRecord(this.form).then(res => {
        if (res.code == 200) {
          this.$message.success('新增成功')
          this.draftClear('checkRecordForm')
          this.draftClear('checkRecordRows')
          this.resetForm()
        }
        this.submitFormLoading = false
@@ -356,6 +364,8 @@
      reviewExamineRecord(params).then(res => {
        if (res.code == 200) {
          this.$message.success('审核成功')
          this.draftClear('checkRecordForm')
          this.draftClear('checkRecordRows')
          this.resetForm()
        }
        this.submitFormLoading = false
@@ -364,6 +374,8 @@
      })
    },
    resetForm() {
      this.draftStop('checkRecordForm')
      this.draftStop('checkRecordRows')
      this.dialogVisible = false
      this.$emit('closeDialog1')
    },
src/views/CNAS/resourceDemand/device/component/equipmentCalibrationPlan.vue
@@ -229,10 +229,12 @@
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/performance/class";
import { mapGetters } from "@/utils/store-compat";
import draftSave from '@/mixins/draftSave'
export default {
  name: "equipment-calibration-plan",
  // import å¼•入的组件需要注入到对象中才能使用
  components: { AddVerificationYearPlanDia, AddYearPlanDia },
  mixins: [draftSave],
  props: {
    clickNodeVal: {
      type: Object,
@@ -459,6 +461,9 @@
      if (this.operationType !== 'add') {
        this.$nextTick(() => {
          this.form = this.HaveJson(row)
          if (this.operationType !== 'view') {
            this.draftRestore('equipmentCalibrationPlan', 'form', this.form.planDetailId, 'dialogVisible')
          }
        })
      } else {
        this.form = {
@@ -473,6 +478,7 @@
          planId: this.currentRow.planId,
          planDetailId: '',
        }
        this.draftRestore('equipmentCalibrationPlan', 'form', this.form.planId, 'dialogVisible')
      }
    },
    // æäº¤è¡¨å•
@@ -484,6 +490,7 @@
            addDeviceCalibrationPlanDetail(this.form).then(res => {
              if (res.code == 200) {
                this.$message.success('新增成功')
                this.draftClear('equipmentCalibrationPlan')
                this.dialogVisible = false
                this.getYearTableData()
              }
@@ -496,6 +503,7 @@
            updateDeviceCalibrationPlanDetail(this.form).then(res => {
              if (res.code == 200) {
                this.$message.success('新增成功')
                this.draftClear('equipmentCalibrationPlan')
                this.dialogVisible = false
                this.getYearTableData()
              }
@@ -550,6 +558,7 @@
      })
    },
    resetForm() {
      this.draftStop('equipmentCalibrationPlan')
      this.$refs.modelForm.resetFields();
      this.dialogVisible = false
    },
src/views/CNAS/resourceDemand/device/component/equipmentCheck.vue
@@ -147,10 +147,12 @@
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/business/inspectionTask";
import {mapGetters} from "@/utils/store-compat";
import draftSave from '@/mixins/draftSave'
export default {
  name: "equipment-check",
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  mixins: [draftSave],
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
@@ -213,6 +215,10 @@
            this.currentStep = 2
          }
          this.reviewUserId = this.form.reviewUserId
          if (this.currentStep === 0) {
            this.draftRestore('equipmentCheck', 'form', this.form.planDetailsId, 'dialogVisible')
            this.recordContrastDetailsList = this.form.recordContrastDetailsList || []
          }
        }
      }).catch(error => {
        console.error(error)
@@ -243,6 +249,7 @@
      addExamineRecordContrast(this.form).then(res => {
        if (res.code == 200) {
          this.$message.success('新增成功')
          this.draftClear('equipmentCheck')
          this.resetForm()
        }
        this.submitFormLoading = false
@@ -258,6 +265,7 @@
      reviewExamineRecordContrast(params).then(res => {
        if (res.code == 200) {
          this.$message.success('审核成功')
          this.draftClear('equipmentCheck')
          this.resetForm()
        }
        this.submitFormLoading = false
@@ -266,6 +274,7 @@
      })
    },
    resetForm() {
      this.draftStop('equipmentCheck')
      this.dialogVisible = false
      this.$emit('closeDialog')
    },
src/views/CNAS/resourceDemand/device/component/equipmentMaintenance.vue
@@ -67,11 +67,13 @@
} from "@/api/cnas/resourceDemand/device";
import limsTable from "@/components/Table/lims-table.vue";
import {selectUserCondition} from "@/api/system/user";
import draftSave from '@/mixins/draftSave'
export default {
  name: '',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {limsTable},
  mixins: [draftSave],
  props: {
    clickNodeVal: {
      type: Object,
@@ -180,6 +182,9 @@
          this.form = {...row}
          this.form['maintenanceContentArr'] = this.form.maintenanceContent.split(',')
        }
        if (this.operationType !== 'view') {
          this.draftRestore('equipmentMaintenance', 'form', this.operationType === 'edit' ? this.form.id : this.clickNodeVal.value, 'dialogVisible')
        }
      })
      this.getDictS()
      this.getUserList()
@@ -259,6 +264,7 @@
          addDeviceMaintenance(this.form).then(res => {
            this.buttonLoading = false;
            this.$message.success('新增成功')
            this.draftClear('equipmentMaintenance')
            this.closeDia()
            this.getTableList()
          }).catch(err => {
@@ -268,6 +274,7 @@
      })
    },
    closeDia () {
      this.draftStop('equipmentMaintenance')
      this.$refs['form'].resetFields();
      this.dialogVisible = false
      this.refreshTableList()
src/views/CNAS/resourceDemand/device/component/equipmentMaintenancePlan.vue
@@ -166,10 +166,12 @@
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/business/inspectionTask";
import { mapGetters } from "@/utils/store-compat";
import draftSave from '@/mixins/draftSave'
export default {
  name: "equipment-maintenance-plan",
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  mixins: [draftSave],
  props: {
    clickNodeVal: {
      type: Object,
@@ -273,12 +275,22 @@
          if (res.code === 200) {
            this.form = res.data
            this.deviceMaintenancePlanDetails = this.form.deviceMaintenancePlanDetails
            this.restoreMaintenancePlanDraft()
          }
        }).catch(error => {
          console.error(error)
        })
      } else {
        this.restoreMaintenancePlanDraft()
      }
      this.getEquipOptions()
    },
    restoreMaintenancePlanDraft() {
      if (this.operationType === 'add' || this.operationType === 'edit') {
        const rid = this.operationType === 'edit' ? this.maintenancePlanId : ''
        this.draftRestore('maintenancePlanForm', 'form', rid, 'applicationForm')
        this.draftRestore('maintenancePlanRows', 'deviceMaintenancePlanDetails', rid, 'applicationForm')
      }
    },
    // æ·»åŠ è®¾å¤‡
    addTableRow() {
@@ -331,6 +343,8 @@
        addMaintenancePlan(this.form).then(res => {
          if (res.code == 200) {
            this.$message.success('新增成功')
            this.draftClear('maintenancePlanForm')
            this.draftClear('maintenancePlanRows')
            this.applicationForm = false
            this.getYearTableDetailData()
          }
@@ -342,6 +356,8 @@
        updateMaintenancePlan(this.form).then(res => {
          if (res.code == 200) {
            this.$message.success('修改成功')
            this.draftClear('maintenancePlanForm')
            this.draftClear('maintenancePlanRows')
            this.applicationForm = false
            this.getYearTableDetailData()
          }
src/views/CNAS/resourceDemand/device/component/equipmentVerificationPlan.vue
@@ -249,10 +249,12 @@
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/performance/class";
import { mapGetters } from "@/utils/store-compat";
import draftSave from '@/mixins/draftSave'
export default {
  name: "equipment-verification-plan",
  // import å¼•入的组件需要注入到对象中才能使用
  components: { AddVerificationYearPlanDia, CheckRecord, EquipmentCheck },
  mixins: [draftSave],
  props: {
    clickNodeVal: {
      type: Object,
@@ -495,6 +497,9 @@
      if (this.operationType !== 'add') {
        this.$nextTick(() => {
          this.form = this.HaveJson(row)
          if (this.operationType !== 'view') {
            this.draftRestore('equipmentVerificationPlan', 'form', this.form.planDetailsId, 'dialogVisible')
          }
        })
      } else {
        this.form = {
@@ -510,6 +515,7 @@
          planId: this.currentRow.planId,
          planDetailsId: '',
        }
        this.draftRestore('equipmentVerificationPlan', 'form', this.form.planId, 'dialogVisible')
      }
    },
    // æäº¤è¡¨å•
@@ -521,6 +527,7 @@
            addDeviceExaminePlanDetail(this.form).then(res => {
              if (res.code == 200) {
                this.$message.success('新增成功')
                this.draftClear('equipmentVerificationPlan')
                this.dialogVisible = false
                this.getYearTableData()
              }
@@ -533,6 +540,7 @@
            updateDeviceExaminePlanDetail(this.form).then(res => {
              if (res.code == 200) {
                this.$message.success('新增成功')
                this.draftClear('equipmentVerificationPlan')
                this.dialogVisible = false
                this.getYearTableData()
              }
@@ -564,6 +572,7 @@
      })
    },
    resetForm() {
      this.draftStop('equipmentVerificationPlan')
      this.$refs.modelForm.resetFields();
      this.dialogVisible = false
    },
src/views/CNAS/resourceDemand/device/component/failureForm.vue
@@ -72,10 +72,12 @@
  addDeviceBreakdownMaintenance,
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/business/inspectionTask";
import draftSave from '@/mixins/draftSave'
export default {
  name: "failure-form",
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  mixins: [draftSave],
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
@@ -116,6 +118,8 @@
      this.getUserList()
      if (this.form.maintenanceId) {
        this.searchInfo()
      } else {
        this.draftRestore('failureForm', 'form', this.form.deviceId, 'dialogVisible')
      }
    },
    // æŸ¥è¯¢è¯¦æƒ…
@@ -124,7 +128,9 @@
        maintenanceId: this.form.maintenanceId
      }).then(res => {
        if (res.code === 200) {
          const id = this.form.maintenanceId
          this.form = { ...res.data }
          this.draftRestore('failureForm', 'form', id, 'dialogVisible')
          if (this.form.isFinish === 0) {
            if (this.form.departmentHeadUserId) {
              this.currentStep = 1
@@ -154,6 +160,7 @@
          addDeviceBreakdownMaintenance(this.form).then(res => {
            if (res.code == 200) {
              this.$message.success('新增成功')
              this.draftClear('failureForm')
              this.resetForm()
            }
            this.submitFormLoading = false
@@ -165,6 +172,7 @@
    },
    // å…³é—­å¼¹æ¡†
    resetForm() {
      this.draftStop('failureForm')
      this.dialogVisible = false
      this.$emit('closeDialog')
    },
src/views/CNAS/resourceDemand/device/component/fault.vue
@@ -279,7 +279,9 @@
<script>
import { dateFormat } from '@/utils/date'
import { mapGetters } from "@/utils/store-compat";
import draftSave from '@/mixins/draftSave'
export default {
  mixins: [draftSave],
  props: {
    clickNodeVal: {
      type: Object,
@@ -407,6 +409,7 @@
          }).then(res => {
            if (res.code == 200) {
              this.$message.success('提交成功')
              this.draftClear('fault')
              this.getTableList(this.clickNodeVal.value)
              this.dialogVisible = false
            }
@@ -431,6 +434,11 @@
        this.form.manufacturer = res.data.manufacturer
        this.form.specificationModel = res.data.specificationModel
        this.form.managementNumber = res.data.managementNumber
        if (!this.form.id) {
          this.draftRestore('fault', 'form', this.clickNodeVal.value, 'dialogVisible')
        } else if (this.currentStep === 0) {
          this.draftRestore('fault', 'form', this.form.id, 'dialogVisible')
        }
      });
      // èŽ·å–è´Ÿè´£äººä¿¡æ¯
      this.getUserList()
@@ -580,6 +588,7 @@
    },
    dialogVisible(newVal) {
      if (!newVal) {
        this.draftStop('fault')
        this.form = {}
        this.closeLoading()
        this.currentStep = 0 // æ­¥éª¤æ¡æ˜¾ç¤ºç¬¬å‡ æ­¥
src/views/CNAS/resourceDemand/device/component/files.vue
@@ -5,7 +5,7 @@
      <h4><span class="line"></span><span>设备档案</span></h4>
      <div class="btns">
        <el-button type="primary" size="small" @click="openEditForm" style="">修订档案</el-button>
        <el-button type="primary" size="small" @click="dialogVisible1 = true" style="">添加附件</el-button>
        <el-button type="primary" size="small" @click="openAddFileDia" style="">添加附件</el-button>
        <el-button type="primary" size="small" @click="deviceDialog = true" style="">查看设备二维码</el-button>
        <el-button type="primary" size="small" @click="handleDownOne" style="">导出</el-button>
      </div>
@@ -504,7 +504,9 @@
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/business/inspectionTask";
import { selectQualifiedSupplierManagementPage } from '@/api/cnas/externalService/supplierManage/supplierManage'
import draftSave from '@/mixins/draftSave'
export default {
  mixins: [draftSave],
  props: {
    clickNodeVal: {
      type: Object,
@@ -682,6 +684,14 @@
        })
        this.fileList.push(obj)
      }
      this.draftRestore('fileAdd', 'addFile', row.id, 'dialogVisible1')
    },
    // æ‰“开添加附件弹窗
    openAddFileDia() {
      this.dialogVisible1 = true
      this.$nextTick(() => {
        this.draftRestore('fileAdd', 'addFile', this.clickNodeVal.value, 'dialogVisible1')
      })
    },
    handleDeleteClick(row) {
      // åˆ é™¤é€»è¾‘
@@ -712,6 +722,7 @@
        updateDocument(this.addFile).then(res => {
          if (res.code == 200) {
            this.$message.success('更新成功')
            this.draftClear('fileAdd')
            this.dialogVisible1 = false;
            this.getPage()
          }
@@ -721,6 +732,7 @@
        addDocument(this.addFile).then(res => {
          if (res.code == 200) {
            this.$message.success('保存成功')
            this.draftClear('fileAdd')
            this.dialogVisible1 = false;
            this.getPage()
          }
@@ -804,6 +816,7 @@
      this.editData = JSON.parse(JSON.stringify(this.Mdata))
      this.$nextTick(() => {
        this.dialogVisible = true
        this.draftRestore('fileRevision', 'editData', this.clickNodeVal.value, 'dialogVisible')
      })
    },
    // ä¸‹æ¬¡æ—¥æœŸ = æœ€è¿‘日期 + å‘¨æœŸï¼ˆæœˆï¼‰ï¼Œè‡ªåŠ¨è®¡ç®—
@@ -875,6 +888,7 @@
      upDeviceParameter(formData).then(res => {
        this.$message.success('修改成功')
        this.upLoad = false
        this.draftClear('fileRevision')
        this.getList(this.clickNodeVal.value)
        this.dialogVisible = false
      }).catch(e => {
@@ -977,6 +991,7 @@
    },
    dialogVisible1(newVal) {
      if (newVal == false) {
        this.draftStop('fileAdd')
        this.isAddFileUpdate = false
        this.addFile = {}
        this.fileList = []
src/views/CNAS/resourceDemand/device/component/inspectionForm.vue
@@ -144,10 +144,12 @@
  reviewDeviceInspectionRecord,
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/business/inspectionTask";
import draftSave from '@/mixins/draftSave'
export default {
  name: "inspection-form",
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  mixins: [draftSave],
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
@@ -186,6 +188,8 @@
      this.getUserList()
      if (this.form.inspectionRecordId) {
        this.searchInfo()
      } else if (this.operationType !== 'check') {
        this.draftRestore('inspectionForm', 'form', this.form.deviceId, 'dialogVisible')
      }
    },
    searchInfo() {
@@ -193,8 +197,12 @@
        inspectionRecordId: this.form.inspectionRecordId
      }).then(res => {
        if (res.code === 200) {
          const id = this.form.inspectionRecordId
          this.form = { ...res.data }
          this.details = this.form.details || []
          if (this.operationType !== 'check') {
            this.draftRestore('inspectionForm', 'form', id, 'dialogVisible')
          }
        }
      }).catch(error => {
        console.error(error)
@@ -211,6 +219,7 @@
        addDeviceInspectionRecord(this.form).then(res => {
          if (res.code == 200) {
            this.$message.success('新增成功')
            this.draftClear('inspectionForm')
            this.resetForm()
          }
          this.submitFormLoading = false
@@ -221,6 +230,7 @@
        updateDeviceInspectionRecord(this.form).then(res => {
          if (res.code == 200) {
            this.$message.success('新增成功')
            this.draftClear('inspectionForm')
            this.resetForm()
          }
          this.submitFormLoading = false
@@ -245,6 +255,7 @@
      })
    },
    resetForm() {
      this.draftStop('inspectionForm')
      this.dialogVisible = false
      this.$emit('closeDialog')
    },
src/views/CNAS/resourceDemand/device/component/management.vue
@@ -27,7 +27,7 @@
        </el-form>
      </div>
      <div>
        <el-button size="small" type="primary" @click="dialogVisible2 = true">新增</el-button>
        <el-button size="small" type="primary" @click="openAdd2">新增</el-button>
        <el-button size="small" type="primary" @click="handleDownOne">导出</el-button>
      </div>
    </div>
@@ -408,42 +408,6 @@
                </el-row>
            </span></template>
        </el-dialog>
        <el-dialog title="数采配置" v-model="dialogVisible3" width="400px">
            <div class="search_thing" style="margin-bottom: 14px;">
                <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>IP:</div>
                <el-input size="small" placeholder="请输入" clearable v-model="configForm.ip"></el-input>
            </div>
            <div class="search_thing" style="margin-bottom: 14px;">
                <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>采集地址:</div>
                <el-input size="small" placeholder="请输入" clearable v-model="configForm.collectUrl"></el-input>
            </div>
            <div class="search_thing" style="margin-bottom: 14px;">
                <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>储存地址:</div>
                <el-input size="small" placeholder="请输入" clearable v-model="configForm.storageUrl"></el-input>
            </div>
            <div class="search_thing" style="margin-bottom: 14px;">
                <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>参照:</div>
                <el-input size="small" placeholder="请输入" clearable v-model="configForm.refer"></el-input>
            </div>
            <div class="search_thing" style="margin-bottom: 14px;">
                <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>X:</div>
                <el-input size="small" placeholder="请输入" clearable v-model="configForm.x"></el-input>
            </div>
            <div class="search_thing" style="margin-bottom: 14px;">
                <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>Y:</div>
                <el-input size="small" placeholder="请输入" clearable v-model="configForm.y"></el-input>
            </div>
            <div class="search_thing">
                <div class="search_label">公式:</div>
                <el-input size="small" placeholder="请输入" clearable v-model="configForm.formula"></el-input>
            </div>
            <template #footer><span  class="dialog-footer">
                <el-row justify="end">
                    <el-button @click="dialogVisible3 = false">取 æ¶ˆ</el-button>
                    <el-button type="primary" @click="submitForm3" :loading="upLoad3">ç¡® å®š</el-button>
                </el-row>
            </span></template>
        </el-dialog>
        <dataAcquisitionConfig v-if="showData" :deviceId="deviceId" />
    </div>
</template>
@@ -456,13 +420,13 @@
    getInsProduction,
    upDeviceParameter,
    addDeviceParameter,
    numberCollect,
    getDeviceParameter,
    delDeviceParameter,
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/business/inspectionTask";
import dayjs from 'dayjs'
import { selectQualifiedSupplierManagementPage } from '@/api/cnas/externalService/supplierManage/supplierManage'
import draftSave from '@/mixins/draftSave'
export default {
    props: {
        clickNodeVal: {
@@ -476,6 +440,7 @@
        limsTable,
        dataAcquisitionConfig,
    },
    mixins: [draftSave],
    data() {
        return {
            dateFormat: 'yyyy-MM-dd',
@@ -522,9 +487,6 @@
            deviceStatusList: [],
            upLoad: false,
            upLoad2: false,
            dialogVisible3: false,
            upLoad3: false,
            configForm: {},
            queryParams: {},
            tableData: [],
            column: [
@@ -808,7 +770,14 @@
                })
            })
        },
        openAdd2() {
            this.dialogVisible2 = true
            this.$nextTick(() => {
                this.draftRestore('managementAdd', 'formData2', '', 'dialogVisible2')
            })
        },
        handleClose() {
            this.draftStop('management')
            this.formData = {
                authorizedPerson: []
            }
@@ -821,6 +790,7 @@
            this.upLoad = false;
        },
        handleClose2() {
            this.draftStop('managementAdd')
            this.formData = {
                authorizedPerson: []
            }
@@ -864,6 +834,7 @@
                    this.formData[key] = `${this.formData[key]} 00:00:00`
                }
            })
            this.draftRestore('management', 'formData', this.formData.id, 'dialogVisible')
        },
        beforeUpload(file) {
            if (file.size > 1024 * 1024 * 10) {
@@ -958,6 +929,7 @@
                this.$message.success('修改成功')
                this.upLoad = false
                this.refreshTable('page')
                this.draftClear('management')
                this.dialogVisible = false
            }).catch(e => {
                this.$message.error('修改失败')
@@ -1001,6 +973,7 @@
                this.$message.success('提交成功')
                this.upLoad2 = false
                this.refreshTable('page')
                this.draftClear('managementAdd')
                this.dialogVisible2 = false
                this.formData2 = {
                    imageUpload: '',
@@ -1035,44 +1008,6 @@
        closeDataVue() {
            this.clickSidebar(this.clickNodeVal)
            this.showData = false
        },
        submitForm3() {
            if (!this.configForm.ip) {
                this.$message.error('请填写IP');
                return
            }
            if (!this.configForm.collectUrl) {
                this.$message.error('请填写采集地址');
                return
            }
            if (!this.configForm.storageUrl) {
                this.$message.error('请填写储存地址');
                return
            }
            if (!this.configForm.refer) {
                this.$message.error('请填写参照');
                return
            }
            if (!this.configForm.x) {
                this.$message.error('请填写X');
                return
            }
            if (!this.configForm.y) {
                this.$message.error('请填写Y');
                return
            }
            this.upLoad3 = true
            numberCollect(this.configForm).then(res => {
                this.upLoad3 = false
                this.$message.success('操作成功')
                this.refreshTable('page')
                this.dialogVisible3 = false
            }).catch(e => {
                this.$message.error('操作失败')
                this.dialogVisible3 = false
                this.upLoad3 = false
            })
        },
        // ç‚¹å‡»ä¾§è¾¹æ åˆ·æ–°
        clickSidebar(clickNodeVal) {
src/views/CNAS/resourceDemand/device/component/operationInstruction.vue
@@ -3,7 +3,7 @@
  <div>
    <div style="margin: 10px 0;text-align: right">
      <el-button size="small" type="primary" @click="getList">刷新</el-button>
      <el-button size="small" type="primary" @click="dialogVisible = true">受控申请</el-button>
      <el-button size="small" type="primary" @click="openInstructionDia">受控申请</el-button>
    </div>
    <el-table :data="tableData" border height="calc(100vh - 18em)"
>
@@ -188,7 +188,9 @@
  pageByPageQueryOfHomeworkInstructions,
  selectDeviceParameter,
} from '@/api/cnas/resourceDemand/device.js'
import draftSave from '@/mixins/draftSave'
export default {
  mixins: [draftSave],
  props: {
    clickNodeVal: {
      type: Object,
@@ -259,6 +261,8 @@
    },
    dialogVisible(newVal) {
      if (newVal === false) {
        this.draftStop('instructionForm')
        this.draftStop('instructionRows')
        this.instructionForm = {}
        this.documentTableData = []
        this.fileList1 = []
@@ -337,7 +341,17 @@
          this.documentTableData.forEach((v, k) => {
            v.index = k
          })
          this.draftRestore('instructionForm', 'instructionForm', row.instructionId, 'dialogVisible')
          this.draftRestore('instructionRows', 'documentTableData', row.instructionId, 'dialogVisible')
        }
      })
    },
    // æ‰“开受控申请弹窗(新增)
    openInstructionDia() {
      this.dialogVisible = true
      this.$nextTick(() => {
        this.draftRestore('instructionForm', 'instructionForm', '', 'dialogVisible')
        this.draftRestore('instructionRows', 'documentTableData', '', 'dialogVisible')
      })
    },
    handleSizeChange(val) {
@@ -355,6 +369,8 @@
          newHomeworkGuidebookAdded(this.instructionForm).then(res => {
            if (res.code == 200) {
              this.$message.success('操作成功!')
              this.draftClear('instructionForm')
              this.draftClear('instructionRows')
              this.dialogVisible = false
              this.getList()
            }
@@ -396,6 +412,7 @@
    addFile() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.draftClear('instructionRowForm')
          if (this.tableDataIndex !== undefined) {
            this.documentTableData[this.tableDataIndex] = this.form
            this.dialogVisible1 = false;
@@ -418,7 +435,7 @@
      this.form.deviceName = this.clickNodeVal.label
      this.onDeviceNameChange()
      this.fileList = []
      this.draftRestore('instructionRowForm', 'form', '', 'dialogVisible1')
    },
    editFun(row, index) {
      this.form = { ...row }
@@ -429,8 +446,10 @@
        this.fileList.push({ name: this.form.fileName })
      }
      this.dialogVisible1 = true
      this.draftRestore('instructionRowForm', 'form', row.id !== undefined ? row.id : ('row' + index), 'dialogVisible1')
    },
    closeDia() {
      this.draftStop('instructionRowForm')
      this.dialogVisible1 = false
      this.$refs['form'].resetFields()
      this.fileList = []
src/views/CNAS/resourceDemand/device/component/quantityValueTraceabilityPlan.vue
@@ -174,10 +174,12 @@
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/business/inspectionTask";
import { mapGetters } from "@/utils/store-compat";
import draftSave from '@/mixins/draftSave'
export default {
  name: "quantity-value-traceability-plan",
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  mixins: [draftSave],
  props: {
    clickNodeVal: {
      type: Object,
@@ -284,11 +286,21 @@
          if (res.code === 200) {
            this.form = res.data
            this.deviceTraceabilityManagementDetails = this.form.deviceTraceabilityManagementDetails
            this.restoreTraceabilityDraft()
          }
        }).catch(error => {
          console.error(error)
          this.yearTableLoading = false
        })
      } else {
        this.restoreTraceabilityDraft()
      }
    },
    restoreTraceabilityDraft() {
      if (this.operationType === 'add' || this.operationType === 'edit') {
        const rid = this.operationType === 'edit' ? this.traceabilityManagementId : ''
        this.draftRestore('traceabilityForm', 'form', rid, 'applicationForm')
        this.draftRestore('traceabilityRows', 'deviceTraceabilityManagementDetails', rid, 'applicationForm')
      }
    },
    // æ·»åŠ è®¾å¤‡
@@ -349,6 +361,8 @@
        addTraceabilityManagement(this.form).then(res => {
          if (res.code == 200) {
            this.$message.success('新增成功')
            this.draftClear('traceabilityForm')
            this.draftClear('traceabilityRows')
            this.applicationForm = false
            this.getYearTableDetailData()
          }
@@ -360,6 +374,8 @@
        updateTraceabilityManagement(this.form).then(res => {
          if (res.code == 200) {
            this.$message.success('修改成功')
            this.draftClear('traceabilityForm')
            this.draftClear('traceabilityRows')
            this.applicationForm = false
            this.getYearTableDetailData()
          }
src/views/CNAS/resourceDemand/device/component/record.vue
@@ -157,7 +157,9 @@
  deleteDeviceRecord,
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/business/inspectionTask";
import draftSave from '@/mixins/draftSave'
export default {
  mixins: [draftSave],
  props: {
    clickNodeVal: {
      type: Object,
@@ -288,6 +290,7 @@
        this.form.managementNumber = res.data.managementNumber
        this.$nextTick(() => {
          this.$refs['form'].clearValidate()
          this.draftRestore('record', 'form', '', 'dialogVisible')
        })
      });
    },
@@ -309,6 +312,7 @@
              if (res.code == 200) {
                this.$message.success('新增成功')
                this.getTableList(this.clickNodeVal.value)
                this.draftClear('record')
                this.dialogVisible = false
              }
            })
@@ -318,6 +322,7 @@
              if (res.code == 200) {
                this.$message.success('修改成功')
                this.getTableList(this.clickNodeVal.value)
                this.draftClear('record')
                this.dialogVisible = false
              }
            })
@@ -343,6 +348,9 @@
      list.push(row.useStartDate)
      list.push(row.useEndDate)
      this.form['useDateList'] = list
      if (type === 'edit') {
        this.draftRestore('record', 'form', this.form.id, 'dialogVisible')
      }
    },
    handleDeleteClick(index, row) {
      this.$confirm('此操作将永久删除该文件, æ˜¯å¦ç»§ç»­?', '提示', {
@@ -379,6 +387,7 @@
    },
    dialogVisible(newVal) {
      if (newVal === false) {
        this.draftStop('record')
        this.form = {
          // deviceId:'',
          sampleCode: '',
src/views/CNAS/resourceDemand/device/component/resourceReservation.vue
@@ -120,7 +120,9 @@
</template>
<script>
import draftSave from '@/mixins/draftSave'
export default {
  mixins: [draftSave],
  props: {
    clickNodeVal: {
      type: Object,
@@ -381,6 +383,7 @@
      this.addReservation.reservationTime = this.yuyuetime + " " + this.yuyue.time;
      this.addReservation.specificTime = this.yuyue.time;
      this.addReservation.deviceNumber = 'TX-ABC-01'+Math.floor(Math.random() * 10 + 1);
      this.draftRestore('reservation', 'addReservation', this.yuyue.id + '_' + this.yuyuetime, 'addVisiable')
    },
    handleSelectionChange(selected) {
      this.selectedRow = selected.length > 0 ? selected : null;
@@ -421,6 +424,7 @@
          this.$axios.post(this.$api.deviceReservate.save, this.addReservation).then(res => {
            if (res.code == 200) {
              this.$message.success('保存成功')
              this.draftClear('reservation')
              this.addVisiable = false
              this.getList();
              this.query();
src/views/CNAS/resourceDemand/device/component/scrapApplicationForm.vue
@@ -78,10 +78,12 @@
  addDeviceScrapped,
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/business/inspectionTask";
import draftSave from '@/mixins/draftSave'
export default {
  name: "scrapApplicationForm",
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  mixins: [draftSave],
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
@@ -123,6 +125,8 @@
      this.getUserList()
      if (this.form.scrappedId) {
        this.searchInfo()
      } else {
        this.draftRestore('scrapApplicationForm', 'form', this.form.deviceId, 'dialogVisible')
      }
    },
    // æŸ¥è¯¢è¯¦æƒ…
@@ -131,7 +135,9 @@
        scrappedId: this.form.scrappedId
      }).then(res => {
        if (res.code === 200) {
          const id = this.form.scrappedId
          this.form = { ...res.data }
          this.draftRestore('scrapApplicationForm', 'form', id, 'dialogVisible')
          if (this.form.isFinish === 0) {
            if (this.form.departmentHeadUserId) {
              this.currentStep = 1
@@ -165,6 +171,7 @@
          addDeviceScrapped(this.form).then(res => {
            if (res.code == 200) {
              this.$message.success('新增成功')
              this.draftClear('scrapApplicationForm')
              this.resetForm()
            }
            this.submitFormLoading = false
@@ -176,6 +183,7 @@
    },
    // å…³é—­å¼¹æ¡†
    resetForm() {
      this.draftStop('scrapApplicationForm')
      this.dialogVisible = false
      this.$emit('closeDialog')
    },
src/views/CNAS/resourceDemand/device/component/state.vue
@@ -242,7 +242,9 @@
import { selectUserCondition } from "@/api/business/inspectionTask";
import { dateFormat } from '@/utils/date'
import { mapGetters } from "@/utils/store-compat";
import draftSave from '@/mixins/draftSave'
export default {
  mixins: [draftSave],
  props: {
    clickNodeVal: {
      type: Object,
@@ -365,6 +367,7 @@
            if (res.code == 200) {
              this.$message.success('提交成功')
              this.getDeviceStatePage(this.clickNodeVal.value)
              this.draftClear('deviceState')
              this.dialogVisible = false
              this.closeLoading()
            }
@@ -393,6 +396,9 @@
        this.form.managementNumber = res.data.managementNumber
        this.$nextTick(() => {
          this.$refs['form'].clearValidate()
          if (!this.form.stateId) {
            this.draftRestore('deviceState', 'form', '', 'dialogVisible')
          }
        })
      });
      // èŽ·å–è´Ÿè´£äººä¿¡æ¯
@@ -414,6 +420,9 @@
      this.currentStepClick = this.currentStep === 4 ? 0 : this.currentStep
      this.$nextTick(() => {
        this.$refs['form'].clearValidate()
        if (this.currentStep === 0) {
          this.draftRestore('deviceState', 'form', this.form.stateId, 'dialogVisible')
        }
      })
      this.dialogVisible = true
    },
@@ -489,6 +498,7 @@
    },
    dialogVisible(newVal) {
      if (!newVal) {
        this.draftStop('deviceState')
        this.form = {
        }
        this.closeLoading()
src/views/CNAS/resourceDemand/device/component/usageAuthorization.vue
@@ -122,11 +122,13 @@
} from "@/api/cnas/resourceDemand/device";
import {selectUserCondition} from "@/api/system/user";
import {mapGetters} from "@/utils/store-compat";
import draftSave from '@/mixins/draftSave'
export default {
  name: '',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {limsTable},
  mixins: [draftSave],
  props: {
    clickNodeVal: {
      type: Object,
@@ -323,13 +325,23 @@
            this.deviceImpowerDetails.forEach(item => {
              item['delegatedUserArr'] = item.delegatedUser.split(',')
            })
            this.restoreImpowerDraft()
          }
        }).catch(error => {
          console.error(error)
        })
      } else {
        this.restoreImpowerDraft()
      }
      this.getEquipOptions()
      this.getUserList()
    },
    restoreImpowerDraft() {
      if (this.operationType === 'add' || this.operationType === 'edit') {
        const rid = this.operationType === 'edit' ? this.impowerId : ''
        this.draftRestore('usageAuthorizationForm', 'form', rid, 'usageTableDia')
        this.draftRestore('usageAuthorizationRows', 'deviceImpowerDetails', rid, 'usageTableDia')
      }
    },
    closeDialog () {
      this.usageTableDia = false
@@ -356,6 +368,8 @@
        addImpower(this.form).then(res => {
          if (res.code == 200) {
            this.$message.success('新增成功')
            this.draftClear('usageAuthorizationForm')
            this.draftClear('usageAuthorizationRows')
            this.usageTableDia = false
            this.refreshTableList()
          }
@@ -367,6 +381,8 @@
        updateImpower(this.form).then(res => {
          if (res.code == 200) {
            this.$message.success('修改成功')
            this.draftClear('usageAuthorizationForm')
            this.draftClear('usageAuthorizationRows')
            this.usageTableDia = false
            this.refreshTableList()
          }