| | |
| | | allow-clear |
| | | placeholder='请输入故障现象' |
| | | v-decorator="['repairOrderFaultAnalysisUda1', validatorRules.repairOrderFaultAnalysisUda1]" |
| | | :disabled="isEdit" |
| | | :disabled="disabledEdit" |
| | | ></a-textarea> |
| | | </a-form-item> |
| | | </a-col> |
| | |
| | | <a-textarea |
| | | placeholder='请输入故障检查' |
| | | v-decorator="['faultCause', validatorRules.faultCause]" |
| | | :disabled="isEdit" |
| | | :disabled="disabledEdit" |
| | | ></a-textarea> |
| | | </a-form-item> |
| | | </a-col> |
| | |
| | | <a-textarea |
| | | placeholder='请输入故障维修' |
| | | v-decorator="['maintenanceMeasures', validatorRules.maintenanceMeasures]" |
| | | :disabled="isEdit" |
| | | :disabled="disabledEdit" |
| | | ></a-textarea> |
| | | </a-form-item> |
| | | </a-col> |
| | |
| | | <a-textarea |
| | | v-decorator="['suggestion', validatorRules.suggestion]" |
| | | placeholder='请输入故障预防' |
| | | :disabled="isEdit" |
| | | :disabled="disabledEdit" |
| | | ></a-textarea> |
| | | </a-form-item> |
| | | </a-col> |
| | |
| | | <a-button |
| | | :style="{marginRight: '8px'}" |
| | | @click='handleEdit2()' |
| | | :disabled="buttonStatus" |
| | | :disabled="disabledButton||!disabledEdit" |
| | | :loading='confirmLoading' |
| | | > |
| | | 编辑 |
| | |
| | | @click='handleOk()' |
| | | type='primary' |
| | | :loading='confirmLoading' |
| | | :disabled="buttonStatus" |
| | | :disabled="disabledButton||disabledEdit" |
| | | >保存 |
| | | </a-button> |
| | | </a-form> |
| | |
| | | 'repairOrder.id':{ |
| | | immediate: true, |
| | | handler(val) { |
| | | this.form.resetFields(); |
| | | if(this.repairOrder.id!==undefined&&this.repairOrder.status==='3'){ |
| | | this.isEdit = false; |
| | | this.loadData(val); |
| | | if(this.repairOrder.id!==undefined&&this.repairOrder.id!==null&&this.repairOrder.id!==''){ |
| | | if(this.repairOrder.status!=='3'){ |
| | | this.disabledButton = true; |
| | | }else{ |
| | | this.disabledButton = false; |
| | | } |
| | | }else{ |
| | | this.loadData(val); |
| | | this.disabledButton = true; |
| | | } |
| | | if(this.repairOrder.status!=='3'){ |
| | | this.buttonStatus = true; |
| | | } |
| | | } |
| | | }, |
| | | 'repairOrder.status':{ |
| | | immediate: true, |
| | | handler(val) { |
| | | if(val!=='3'){ |
| | | this.disabledButton = true; |
| | | }else{ |
| | | this.disabledButton = false; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | |
| | | getInfo:'/eam/repairOrderFaultAnalysis/list', |
| | | }, |
| | | dictOptions: {}, |
| | | isEdit:false, |
| | | disabledEdit:false, |
| | | validatorRules: { |
| | | faultCause: { |
| | | rules: [ |
| | |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | }, |
| | | buttonStatus:false |
| | | disabledButton:false |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | obj.then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message); |
| | | that.isEdit = true; |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | |
| | | }) |
| | | }, |
| | | loadData(repairOrderId){ |
| | | let that = this; |
| | | let that = this; |
| | | getAction(that.url.getInfo,{repairOrderId:repairOrderId}).then(res=>{ |
| | | if(res.success){ |
| | | if(res.result.records.length!==0){ |
| | | that.isEdit=true; |
| | | if(res.success&&res.result.records.length!==0){ |
| | | that.disabledEdit=true; |
| | | that.form.setFieldsValue(pick(res.result.records[0], 'faultCause','repairOrderFaultAnalysisUda1', 'faultTypeId', 'suggestion', 'maintenanceMeasures','id')) |
| | | that.model = Object.assign({}, res.result.records[0]); |
| | | }else if(this.repairOrder.status==='3'){ |
| | | that.isEdit=false; |
| | | }else{ |
| | | that.isEdit=true; |
| | | } |
| | | }else{ |
| | | if(that.repairOrder.status==='3'){ |
| | | that.disabledEdit=false; |
| | | }else{ |
| | | that.disabledEdit=true; |
| | | } |
| | | that.form.resetFields(); |
| | | } |
| | | }) |
| | | }, |
| | | handleEdit2(){ |
| | | this.isEdit=false; |
| | | this.disabledEdit=false; |
| | | } |
| | | }, |
| | | |