| | |
| | | <template> |
| | | <a-modal title="计算MTBF" :visible="visible" :width="400" @cancel="handleModalClose" @ok="handleComputeMTBF" |
| | | :maskClosable="false"> |
| | | <a-form-model :model="model" :labelCol="labelColLong" :wrapperCol="wrapperColLong" :rules="validateRules"> |
| | | <a-form-model ref="form" :model="model" :labelCol="labelColLong" :wrapperCol="wrapperColLong" :rules="validateRules"> |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="月份" prop="month"> |
| | |
| | | }, |
| | | methods: { |
| | | handleComputeMTBF() { |
| | | mdcApi.computeMTBFApi(this.model) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.$notification.success({ |
| | | message: '消息', |
| | | description: res.message |
| | | // 触发表单验证 |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | mdcApi.computeMTBFApi(this.model) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.$notification.success({ |
| | | message: '消息', |
| | | description: res.message |
| | | }) |
| | | this.handleModalClose() |
| | | } else { |
| | | this.$notification.error({ |
| | | message: '消息', |
| | | description: '计算失败' |
| | | }) |
| | | } |
| | | }) |
| | | this.handleModalClose() |
| | | } else { |
| | | this.$notification.error({ |
| | | message: '消息', |
| | | description: '计算失败' |
| | | .catch(err => { |
| | | this.$notification.error({ |
| | | message: '消息', |
| | | description: '计算失败' |
| | | }) |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | this.$notification.error({ |
| | | message: '消息', |
| | | description: '计算失败' |
| | | }) |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | |
| | | handleModalClose() { |