| | |
| | | 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 { |
| | |
| | | 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) |
| | |
| | | addDeviceAcceptance(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('新增成功') |
| | | this.draftClear('acceptanceForm') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | |
| | | updateDeviceAcceptance(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('修改成功') |
| | | this.draftClear('acceptanceForm') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | |
| | | }, |
| | | // 关闭弹框 |
| | | resetForm() { |
| | | this.draftStop('acceptanceForm') |
| | | this.dialogVisible = false |
| | | this.$emit('closeDialog') |
| | | }, |