From cb57bc6b4abf45dbb0605c94359c63e3b31b4b87 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 10 九月 2024 15:55:57 +0800
Subject: [PATCH] 优化报告生成、修改电路下单传参

---
 src/components/do/b1-report-preparation/order.vue |   47 ++++++++++++++++++++++++++++++-----------------
 1 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/src/components/do/b1-report-preparation/order.vue b/src/components/do/b1-report-preparation/order.vue
index 5d001d0..f3c1d0f 100644
--- a/src/components/do/b1-report-preparation/order.vue
+++ b/src/components/do/b1-report-preparation/order.vue
@@ -159,36 +159,49 @@
             cancelButtonText: "涓嶇敓鎴�",
             type: "success",
             distinguishCancelAndClose: true,
-          }).then(() => {
-            this.$axios.post(this.$api.insReport.isReport, {
-              id:row.id,
-              state:1
-            }).then(res => {
-              if (res.code === 201) {
-                return
-              }
-              this.$message.success("宸茬敓鎴�")
-              this.refreshTable()
-            }).catch(err => {
-
-              console.log(err)
-            })
-          }).catch((e) => {
-            console.log(e)
-            if(e=='cancel'){
+            beforeClose: (action, instance, done) => {
+            if (action === 'confirm') {
+              instance.confirmButtonLoading = true;
+              this.$axios.post(this.$api.insReport.isReport, {
+                id:row.id,
+                state:1
+              }).then(res => {
+                instance.confirmButtonLoading = false;
+                if (res.code === 201) {
+                  return
+                }
+                this.$message.success("宸茬敓鎴�")
+                this.refreshTable()
+                done();
+              }).catch(err => {
+                console.log(err)
+                instance.confirmButtonLoading = false;
+              })
+            } else if(action === 'cancel'){
+              instance.cancelButtonLoading = true;
               this.$axios.post(this.$api.insReport.isReport, {
                 id:row.id,
                 state:0
               }).then(res => {
+                instance.cancelButtonLoading = false;
                 if (res.code === 201) {
                   return
                 }
                 this.refreshTable()
+                done();
                 this.$message.success("宸插彇娑堢敓鎴�")
               }).catch(err => {
+                instance.cancelButtonLoading = false;
                 console.log(err)
               })
+            }else{
+              done();
             }
+          }
+          }).then(() => {
+
+          }).catch((e) => {
+            console.log(e)
           })
     }
   }

--
Gitblit v1.9.3