From 92c8ebd688d55cdd803992061ff09ad9e92d18bc Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期一, 28 四月 2025 09:59:38 +0800
Subject: [PATCH] OEE计算新增loading等待提示以及计算OEE后刷新OEE表格功能

---
 src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue |    2 +-
 src/views/mdc/base/modules/OEEAnalysis/ComputeOeeModal.vue |   36 ++++++++++++++++++++++--------------
 2 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/src/views/mdc/base/modules/OEEAnalysis/ComputeOeeModal.vue b/src/views/mdc/base/modules/OEEAnalysis/ComputeOeeModal.vue
index 1445eee..030dba9 100644
--- a/src/views/mdc/base/modules/OEEAnalysis/ComputeOeeModal.vue
+++ b/src/views/mdc/base/modules/OEEAnalysis/ComputeOeeModal.vue
@@ -1,17 +1,19 @@
 <template>
-  <a-modal title="璁$畻OEE" :visible="visible" :width="550" @cancel="handleModalClose" @ok="handleComputeOee"
-           :maskClosable="false">
-    <a-form-model :model="model" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
-      <a-row>
-        <a-col :span="24">
-          <a-form-model-item label="鏃ユ湡">
-            <a-range-picker v-model="dates" style="width: 100%" value-format="YYYY-MM-DD"
-                            @change="dateParamChange"></a-range-picker>
-          </a-form-model-item>
-        </a-col>
-      </a-row>
-    </a-form-model>
-  </a-modal>
+  <j-modal title="璁$畻OEE" :visible="visible" :width="550" @cancel="handleModalClose" @ok="handleComputeOee"
+           :maskClosable="false" :confirmLoading="confirmLoading">
+    <a-spin :spinning="confirmLoading">
+      <a-form-model :model="model" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="鏃ユ湡">
+              <a-range-picker v-model="dates" style="width: 100%" value-format="YYYY-MM-DD"
+                              @change="dateParamChange"></a-range-picker>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </a-spin>
+  </j-modal>
 </template>
 
 <script>
@@ -23,6 +25,7 @@
     data() {
       return {
         visible: false,
+        confirmLoading: false,
         model: {},
         dates: [],
         labelColLong: {
@@ -46,6 +49,7 @@
           return
         }
 
+        this.confirmLoading = true
         mdcApi.computeOeeApi(this.model)
           .then(res => {
             if (res.success) {
@@ -53,7 +57,8 @@
                 message: '娑堟伅',
                 description: res.message
               })
-              this.visible = false
+              this.$emit('ok')
+              this.handleModalClose()
             } else {
               this.$notification.error({
                 message: '娑堟伅',
@@ -67,6 +72,9 @@
               description: '璁$畻澶辫触'
             })
           })
+          .finally(() => {
+            this.confirmLoading = false
+          })
       },
 
       dateParamChange(value1, value2) {
diff --git a/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
index b09a6a0..df9092d 100644
--- a/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
+++ b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
@@ -49,7 +49,7 @@
       </a-table>
     </div>
 
-    <ComputeOeeModal ref="computeOeeModalRef"/>
+    <ComputeOeeModal ref="computeOeeModalRef" @ok="modalFormOk"/>
   </div>
 </template>
 

--
Gitblit v1.9.3