| | |
| | | } 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, |
| | |
| | | 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') |
| | | } |
| | | }, |
| | | // 添加设备 |
| | |
| | | addTraceabilityManagement(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('新增成功') |
| | | this.draftClear('traceabilityForm') |
| | | this.draftClear('traceabilityRows') |
| | | this.applicationForm = false |
| | | this.getYearTableDetailData() |
| | | } |
| | |
| | | updateTraceabilityManagement(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('修改成功') |
| | | this.draftClear('traceabilityForm') |
| | | this.draftClear('traceabilityRows') |
| | | this.applicationForm = false |
| | | this.getYearTableDetailData() |
| | | } |