| | |
| | | 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 { |
| | |
| | | calibrationPlanDetailList: [], |
| | | } |
| | | this.calibrationPlanDetailList = [] |
| | | this.$nextTick(() => { |
| | | this.draftRestore('addYearPlanDiaForm', 'form', '', 'applicationForm') |
| | | this.draftRestore('addYearPlanDiaRows', 'calibrationPlanDetailList', '', 'applicationForm') |
| | | }) |
| | | } else { |
| | | this.getRowInfo(row) |
| | | } |
| | |
| | | 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 |
| | |
| | | addDeviceCalibrationPlan(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('新增成功') |
| | | this.draftClear('addYearPlanDiaForm') |
| | | this.draftClear('addYearPlanDiaRows') |
| | | this.closeDialog() |
| | | this.$emit('closeDia') |
| | | } |
| | |
| | | updateDeviceCalibrationPlan(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('新增成功') |
| | | this.draftClear('addYearPlanDiaForm') |
| | | this.draftClear('addYearPlanDiaRows') |
| | | this.closeDialog() |
| | | this.$emit('closeDia') |
| | | } |
| | |
| | | } |
| | | }, |
| | | closeDialog() { |
| | | this.draftStop('addYearPlanDiaForm') |
| | | this.draftStop('addYearPlanDiaRows') |
| | | this.applicationForm = false |
| | | }, |
| | | // 获取所有设备 |