From 9bce6d06fc72b109ebfe1fa779c57e1d62a43b57 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期五, 13 九月 2024 16:58:56 +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