| | |
| | | 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 { |
| | |
| | | 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) { |
| | |
| | | this.currentStep = 4 |
| | | this.showStep = 3 |
| | | } |
| | | this.$nextTick(() => { |
| | | this.draftRestore('applicationForm', 'form', externalApplyId, 'dialogVisible') |
| | | }) |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | |
| | | addDeviceExternalApply(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('新增成功') |
| | | this.draftClear('applicationForm') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | |
| | | }, |
| | | // 关闭弹框 |
| | | resetForm() { |
| | | this.draftStop('applicationForm') |
| | | this.dialogVisible = false |
| | | this.$emit('closeDialog') |
| | | }, |