src/views/mdc/base/modules/EquipmentRepairTime/ComputeEquipmentRepairTimeModal.vue
@@ -1,7 +1,7 @@
<template>
  <a-modal title="计算MTTR" :visible="visible" :width="400" @cancel="handleModalClose" @ok="handleComputeMTTR"
           :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">
@@ -41,27 +41,32 @@
    },
    methods: {
      handleComputeMTTR() {
        mdcApi.computeMTTRApi(this.model)
          .then(res => {
            if (res.success) {
              this.$notification.success({
                message: '消息',
                description: res.message
        // 触发表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            mdcApi.computeMTTRApi(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() {