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
    },
    // 获取所有设备