From 2366cd3edcbeddc7b02f79515c902387778efe3b Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期四, 09 十一月 2023 15:56:04 +0800
Subject: [PATCH] 增加修改销售明细状态接口及联通

---
 src/views/sales/salesDetails/index.vue |   31 +++++++++++++++++++++++--------
 1 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/src/views/sales/salesDetails/index.vue b/src/views/sales/salesDetails/index.vue
index bed23b9..28931bd 100644
--- a/src/views/sales/salesDetails/index.vue
+++ b/src/views/sales/salesDetails/index.vue
@@ -40,12 +40,12 @@
             <template slot="tableButton">
               <el-table-column label="鎿嶄綔" width="180">
                 <template slot-scope="scope">
-                  <el-button @click="handleClick(scope.row, '鏌ョ湅')" type="text" size="small">鏌ョ湅</el-button>
+                  <el-button @click.stop="handleClick(scope.row, '鏌ョ湅')" type="text" size="small">鏌ョ湅</el-button>
                   <template v-if="scope.row.status === 1">
-                    <el-button @click="handleClick(scope.row, '缂栬緫')" type="text" size="small">缂栬緫</el-button>
-                    <el-button @click="submitClick(scope.row)" type="text" size="small">纭鎻愪氦</el-button>
+                    <el-button @click.stop="handleClick(scope.row, '缂栬緫')" type="text" size="small">缂栬緫</el-button>
+                    <el-button @click.stop="submitClick(scope.row)" type="text" size="small">纭鎻愪氦</el-button>
                     <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> -->
-                    <el-button @click="closeClick(scope.row.id)" type="text" size="small">鍏抽棴</el-button>
+                    <el-button @click.stop="closeClick(scope.row)" type="text" size="small">鍏抽棴</el-button>
                   </template>
                 </template>
               </el-table-column>
@@ -123,7 +123,8 @@
   getSalesDetailsList,
   getDelSalesDetails,
   getProductInventoryInfo,
-  getProductOrderInfo
+  getProductOrderInfo,
+  updateStatus
 } from "@/api/sales/salesDetails"
 import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
 import DetailSpecification from "@/views/sales/salesDetails/DetailSpecification"
@@ -365,8 +366,7 @@
                   ...item,
                   client_name: item.client.name,
                   member_name: item.Member.username,
-                  source: "CRM鍚屾",
-                  status: 2
+                  source: "CRM鍚屾"
                 }
               })
               this.tableList.tableInfomation = list || []
@@ -439,12 +439,27 @@
       }
     },
     // 纭鎻愪氦
-    submitClick(row) {
+    async submitClick(row) {
       console.log(row, "纭鎻愪氦")
+      this.updateStatus(row.id, 2)
     },
     // 鍏抽棴
     closeClick(row) {
       console.log(row, "鍏抽棴")
+      this.updateStatus(row.id, 4)
+    },
+    // 淇敼鐘舵��
+    async updateStatus(id, status) {
+      await updateStatus({
+        id: id,
+        status: status
+      }).then((res) => {
+        console.log(res)
+        if (res.code == 200) {
+          this.$message.success("淇敼鎴愬姛")
+          this.getData()
+        }
+      })
     },
     // 鍒犻櫎
     delClick(rowID) {

--
Gitblit v1.8.0