From 785b8cb5b5c4a338fb748b0aff18c187102fb9f2 Mon Sep 17 00:00:00 2001
From: wwl <xchao828@163.com>
Date: 星期二, 25 三月 2025 15:11:29 +0800
Subject: [PATCH] 1

---
 src/views/doctor/checkAll/index.vue |   71 +++++++++++++++++++----------------
 1 files changed, 38 insertions(+), 33 deletions(-)

diff --git a/src/views/doctor/checkAll/index.vue b/src/views/doctor/checkAll/index.vue
index a67e45e..a329d02 100644
--- a/src/views/doctor/checkAll/index.vue
+++ b/src/views/doctor/checkAll/index.vue
@@ -96,17 +96,14 @@
     </template>
 
     <!-- 鐐瑰嚮寮瑰嚭妗� -->
-    <el-drawer custom-class="tanchu"
-  :visible.sync="drawer"
-  :before-close="handleClose"
-  :with-header="false"
-  size="100%"
-  :show-close="true">
-  <div class="top">
-    <table style="width: 100%; margin: 10px 10px; border: 1px solid #dfe6ec; border-collapse: collapse;" cellspacing="4">
-      <caption style="background-color: #f8f8f9; font-size: 18px">
-        {{ tableAll.cusName }}鐨勪綋妫�璧勬枡
-      </caption>
+    <el-drawer custom-class="tanchu" :visible.sync="drawer" :before-close="handleClose" :with-header="false" size="100%"
+      :show-close="true">
+      <div class="top">
+        <table style="width: 100%; margin: 10px 10px; border: 1px solid #dfe6ec; border-collapse: collapse;"
+          cellspacing="4">
+          <caption style="background-color: #f8f8f9; font-size: 18px">
+            {{ tableAll.cusName }}鐨勪綋妫�璧勬枡
+          </caption>
           <tr style="
               border: 1px solid #dfe6ec;
               border-collapse: collapse;
@@ -1076,34 +1073,42 @@
       shanchu({
         id: row.orderDetailId,
       }).then((res) => {
-        console.log(res);
-        // 鎵惧埌瑕佸垹闄ら」鎵�鍦ㄧ殑鐖剁骇鏁扮粍
-        const parentItem = this.yichangList.find(item =>
-          item.sone.some(soneItem => soneItem.proId === row.proId)
-        );
+        if (res.code === 200) {  // 娣诲姞鎴愬姛鍝嶅簲妫�鏌�
+          // 鎵惧埌瑕佸垹闄ら」鎵�鍦ㄧ殑鐖剁骇鏁扮粍
+          const parentItem = this.yichangList.find(item =>
+            item.sone.some(soneItem => soneItem.proId === row.proId)
+          );
 
-        if (parentItem) {
-          // 浠庣埗绾х殑 sone 鏁扮粍涓垹闄よ椤�
-          const index = parentItem.sone.findIndex(item => item.proId === row.proId);
-          if (index > -1) {
-            parentItem.sone.splice(index, 1);
+          if (parentItem) {
+            // 浠庣埗绾х殑 sone 鏁扮粍涓垹闄よ椤�
+            const index = parentItem.sone.findIndex(item => item.proId === row.proId);
+            if (index > -1) {
+              parentItem.sone.splice(index, 1);
 
-            // 濡傛灉鍒犻櫎鍚� sone 鏁扮粍涓虹┖,鍒欏垹闄ゆ暣涓埗绾ч」
-            if (parentItem.sone.length === 0) {
-              const parentIndex = this.yichangList.indexOf(parentItem);
-              if (parentIndex > -1) {
-                this.yichangList.splice(parentIndex, 1);
+              // 濡傛灉鍒犻櫎鍚� sone 鏁扮粍涓虹┖锛屽垯鍒犻櫎鏁翠釜鐖剁骇椤�
+              if (parentItem.sone.length === 0) {
+                const parentIndex = this.yichangList.indexOf(parentItem);
+                if (parentIndex > -1) {
+                  this.yichangList.splice(parentIndex, 1);
+                }
               }
+
+              // 鏇存柊 expends 鏁扮粍
+              this.getExpends();
+
+              this.$message.success('鍒犻櫎鎴愬姛');
+
+              // 鑷姩鏇存柊寮傚父缁撴灉鏁版嵁
+              this.yichangjieguo();
             }
-
-            // 鏇存柊 expends 鏁扮粍
-            this.getExpends();
-
-            this.$message.success('鍒犻櫎鎴愬姛');
           }
+        } else {
+          this.$message.error('鍒犻櫎澶辫触');
         }
-      })
-
+      }).catch((error) => {
+        console.error('鍒犻櫎澶辫触:', error);
+        this.$message.error('鍒犻櫎鎿嶄綔澶辫触');
+      });
     },
     getConfigKey() {
       getconfigKey("sfkqtwbg").then((res) => {

--
Gitblit v1.8.0