From d73f643144694aa5176c0bfa0466296c3dad69e4 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 15 二月 2025 10:54:02 +0800
Subject: [PATCH] 客户管理联调

---
 src/views/system/customer/index.vue |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/src/views/system/customer/index.vue b/src/views/system/customer/index.vue
index 169b755..b6d0e30 100644
--- a/src/views/system/customer/index.vue
+++ b/src/views/system/customer/index.vue
@@ -59,7 +59,7 @@
 
 <script>
 import limsTable from '@/components/Table/lims-table.vue'
-import {addCustom, selectCustomPageList, upCustom} from "@/api/system/customer";
+import {addCustom, delCustomById, selectCustomPageList, upCustom} from "@/api/system/customer";
 export default {
   components: {
     limsTable
@@ -89,6 +89,12 @@
               type: 'text',
               clickFun: (row) => {
                 this.openFormDia('edit', row);
+              },
+            },{
+              name: '鍒犻櫎',
+              type: 'text',
+              clickFun: (row) => {
+                this.delete(row);
               },
             },
           ]
@@ -128,8 +134,8 @@
       selectCustomPageList({...this.queryParams, ...this.page}).then(res => {
         this.tableLoading = false
         if (res.code === 200) {
-          this.tableData = res.data
-          this.page.total = res.total
+          this.tableData = res.data.records
+          this.page.total = res.data.total
         }
       }).catch(err => {
         this.tableLoading = false
@@ -144,6 +150,9 @@
       this.addDia = true
       this.formTitle = type === 'add' ? '鏂板瀹㈡埛' : '缂栬緫瀹㈡埛'
       this.operationType = type
+      if (type === 'edit') {
+        this.user = row
+      }
     },
     customAdd() {
       this.$refs['userForm'].validate((valid) => {
@@ -176,6 +185,23 @@
     reset () {
       this.addDia = false
       this.resetForm("userForm");
+    },
+    delete (row) {
+      this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', "璀﹀憡", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      }).then(() => {
+        delCustomById({id: row.id}).then(res => {
+          if (res.code === 500) {
+            return
+          }
+          this.$message.success('鍒犻櫎鎴愬姛')
+          this.getList()
+        }).catch(e => {
+          this.$message.error('鍒犻櫎澶辫触')
+        })
+      }).catch(() => {})
     }
   }
 }

--
Gitblit v1.9.3