1、调整设备维修时长与故障停机时长页面的时长精度为2且单位调整由分钟调整为小时
2、调整设备维修时长与故障停机时长页面的计算接口传参方式
3、解决设备维修时长与故障停机时长页面的计算弹窗中输入框非空校验无效的问题
已修改7个文件
107 ■■■■■ 文件已修改
src/api/mdc.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/EquipmentFailureCloseTime/ComputeEquipmentFailureCloseTimeModal.vue 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/EquipmentFailureCloseTime/EquipmentFailureCloseTimeForm.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/EquipmentFailureCloseTime/EquipmentFailureCloseTimeList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/EquipmentRepairTime/ComputeEquipmentRepairTimeModal.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/EquipmentRepairTime/EquipmentRepairTimeForm.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/EquipmentRepairTime/EquipmentRepairTimeList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mdc.js
@@ -45,7 +45,7 @@
  // 计算OEE
  computeOeeApi: params => postAction('/mdc/mdcOeeInfo/computeOee', params),
  // 计算MTBF
  computeMTBFApi: params => postAction('/mdc/mdcDownTime/computeMtbf', params),
  computeMTBFApi: ({ month }) => postAction(`/mdc/mdcDownTime/computeMtbf?month=${month}`),
  // 计算MTTR
  computeMTTRApi: params => postAction('/mdc/mdcRepairInfo/computeMttr', params)
  computeMTTRApi: ({ month }) => postAction(`/mdc/mdcRepairInfo/computeMttr?month=${month}`)
}
src/views/mdc/base/modules/EquipmentFailureCloseTime/ComputeEquipmentFailureCloseTimeModal.vue
@@ -1,7 +1,7 @@
<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">
@@ -41,27 +41,33 @@
    },
    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() {
src/views/mdc/base/modules/EquipmentFailureCloseTime/EquipmentFailureCloseTimeForm.vue
@@ -18,8 +18,8 @@
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="故障停机时长(min)" prop="downLong">
              <a-input-number :min="0" v-model="model.downLong" placeholder="请输入故障停机时长(min)"></a-input-number>
            <a-form-model-item label="故障停机时长(h)" prop="downLong">
              <a-input-number :min="0" :step="0.1" :precision="2" v-model="model.downLong" placeholder="请输入故障停机时长(h)"></a-input-number>
            </a-form-model-item>
          </a-col>
        </a-row>
src/views/mdc/base/modules/EquipmentFailureCloseTime/EquipmentFailureCloseTimeList.vue
@@ -135,7 +135,7 @@
            width: 440
          },
          {
            title: '故障停机时长(min)',
            title: '故障停机时长(h)',
            align: 'center',
            dataIndex: 'downLong',
            width: 300
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() {
src/views/mdc/base/modules/EquipmentRepairTime/EquipmentRepairTimeForm.vue
@@ -18,8 +18,8 @@
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="维修时长(min)" prop="repairLong">
              <a-input-number :min="0" v-model="model.repairLong" placeholder="请输入维修时长(min)"></a-input-number>
            <a-form-model-item label="维修时长(h)" prop="repairLong">
              <a-input-number :min="0":step="0.1" :precision="2" v-model="model.repairLong" placeholder="请输入维修时长(h)"></a-input-number>
            </a-form-model-item>
          </a-col>
        </a-row>
src/views/mdc/base/modules/EquipmentRepairTime/EquipmentRepairTimeList.vue
@@ -135,7 +135,7 @@
            width: 440
          },
          {
            title: '维修时长(min)',
            title: '维修时长(h)',
            align: 'center',
            dataIndex: 'repairLong',
            width: 300