| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getDeviceInspectionRecord, |
| | | addDeviceInspectionRecord, |
| | | updateDeviceInspectionRecord, |
| | | reviewDeviceInspectionRecord, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | export default { |
| | | name: "inspection-form", |
| | | // import 引入的组件需要注入到对象中才能使用 |
| | |
| | | } |
| | | }, |
| | | searchInfo() { |
| | | this.$axios.get(this.$api.deviceInspectionRecord.getDeviceInspectionRecord + '?inspectionRecordId=' + this.form.inspectionRecordId).then(res => { |
| | | getDeviceInspectionRecord({ |
| | | inspectionRecordId: this.form.inspectionRecordId |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.form = { ...res.data } |
| | | this.details = this.form.details || [] |
| | |
| | | this.form.details = this.HaveJson(this.details) |
| | | this.submitFormLoading = true |
| | | if (this.operationType === 'add') { |
| | | this.$axios.post(this.$api.deviceInspectionRecord.addDeviceInspectionRecord, |
| | | this.form, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | }, |
| | | noQs: true |
| | | }).then(res => { |
| | | addDeviceInspectionRecord(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('新增成功') |
| | | this.resetForm() |
| | |
| | | this.submitFormLoading = false |
| | | }) |
| | | } else { |
| | | this.$axios.post(this.$api.deviceInspectionRecord.updateDeviceInspectionRecord, |
| | | this.form, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | }, |
| | | noQs: true |
| | | }).then(res => { |
| | | updateDeviceInspectionRecord(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('新增成功') |
| | | this.resetForm() |
| | |
| | | inspectionRecordId: this.form.inspectionRecordId, |
| | | status: status, |
| | | } |
| | | this.$axios.post(this.$api.deviceInspectionRecord.reviewDeviceInspectionRecord, |
| | | params, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | }, |
| | | noQs: true |
| | | }).then(res => { |
| | | reviewDeviceInspectionRecord(params).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('审核成功') |
| | | this.resetForm() |
| | |
| | | this.$emit('closeDialog') |
| | | }, |
| | | getUserList() { |
| | | this.$axios.post(this.$api.user.selectUserList, { |
| | | page: { current: -1, size: -1, }, |
| | | entity: { name: null } |
| | | }, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).then(res => { |
| | | selectUserCondition().then(res => { |
| | | if (res.code === 201) { |
| | | return |
| | | } |
| | | this.userList = res.data.records |
| | | this.userList = res.data |
| | | }) |
| | | }, |
| | | }, |