From b9989d6d13e894b6be78fc7fcfa283f77eb55821 Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期二, 18 二月 2025 17:41:36 +0800
Subject: [PATCH] 1、调整设备维修时长与故障停机时长页面的时长精度为2且单位调整由分钟调整为小时 2、调整设备维修时长与故障停机时长页面的计算接口传参方式 3、解决设备维修时长与故障停机时长页面的计算弹窗中输入框非空校验无效的问题

---
 src/views/mdc/base/modules/EquipmentRepairTime/ComputeEquipmentRepairTimeModal.vue |   45 +++++++++++++++++++++++++--------------------
 1 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/src/views/mdc/base/modules/EquipmentRepairTime/ComputeEquipmentRepairTimeModal.vue b/src/views/mdc/base/modules/EquipmentRepairTime/ComputeEquipmentRepairTimeModal.vue
index 53f0f11..7adc63d 100644
--- a/src/views/mdc/base/modules/EquipmentRepairTime/ComputeEquipmentRepairTimeModal.vue
+++ b/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() {

--
Gitblit v1.9.3