| | |
| | | <el-step title="申请部门负责人意见" @click="setStep(1)"></el-step> |
| | | <el-step title="维修记录" @click="setStep(2)"></el-step> |
| | | </el-steps> |
| | | <el-form ref="modelForm" :model="form" :rules="rules" label-width="160px"> |
| | | <el-form ref="modelForm" :model="form" :rules="rules" label-width="160px" :disabled="!canOperate"> |
| | | <el-col v-if="showStep === 0" :span="12"> |
| | | <el-form-item label="安装地点:" prop="location"> |
| | | <el-input v-model="form.location" :disabled="currentStep !== 0" clearable size="small"></el-input> |
| | |
| | | </el-form> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-button @click="resetForm">取 消</el-button> |
| | | <el-button v-if="currentStep !== 3" :loading="submitFormLoading" type="primary" @click="submitForm">确 |
| | | <el-button v-if="currentStep !== 3 && canOperate" :loading="submitFormLoading" type="primary" @click="submitForm">确 |
| | | 认</el-button> |
| | | </span></template> |
| | | </el-dialog> |
| | |
| | | addDeviceBreakdownMaintenance, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | export default { |
| | | name: "failure-form", |
| | | // import 引入的组件需要注入到对象中才能使用 |
| | |
| | | return { |
| | | dialogVisible: false, |
| | | submitFormLoading: false, |
| | | canOperate: true, |
| | | form: { |
| | | location: '', |
| | | damageOrMalfunction: '', |
| | |
| | | // 打开弹框 |
| | | openDialog(id, deviceId) { |
| | | this.dialogVisible = true |
| | | this.canOperate = true |
| | | this.form.maintenanceId = id |
| | | this.form.deviceId = deviceId |
| | | this.getUserList() |
| | |
| | | this.currentStep = 3 |
| | | this.showStep = 2 |
| | | } |
| | | this.applyPermission() |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | | }) |
| | | }, |
| | | // 非当前环节责任人只允许查看 |
| | | applyPermission() { |
| | | if (this.form.isFinish === 1) { |
| | | this.canOperate = false |
| | | return |
| | | } |
| | | const responsible = this.currentStep === 1 ? this.form.departmentHeadUser : this.form.applicantUser |
| | | this.canOperate = !responsible || responsible === this.nickName |
| | | if (!this.canOperate) { |
| | | this.$message.warning('当前环节责任人为:' + responsible + ',您只能查看') |
| | | } |
| | | }, |
| | | setStep(step) { |
| | | this.showStep = step |
| | |
| | | this.form.flowType = this.currentStep |
| | | this.$refs.modelForm.validate((valid) => { |
| | | if (valid) { |
| | | this.submitFormLoading = true |
| | | addDeviceBreakdownMaintenance(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('新增成功') |
| | |
| | | }) |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["nickName"]), |
| | | }, |
| | | } |
| | | </script> |
| | | |