From ebddc02611b0373c1d5bfa342bd781fb5eb82009 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期二, 01 八月 2023 14:23:31 +0800
Subject: [PATCH] 侧边栏样式机销售明细单增加销售机会选择弹窗

---
 src/views/client/client/index.vue |  101 +++++++++++++++++++-------------------------------
 1 files changed, 38 insertions(+), 63 deletions(-)

diff --git a/src/views/client/client/index.vue b/src/views/client/client/index.vue
index dc643b4..6b3fe15 100644
--- a/src/views/client/client/index.vue
+++ b/src/views/client/client/index.vue
@@ -27,15 +27,16 @@
         :statistics="true"
         :operates-list="operatesList"
       />
-      <PagerView class="page" />
+      <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
     </div>
     <TableCommonView ref="tableListRef" v-loading="loading" :table-list="tableList">
       <template slot="tableButton">
-        <el-table-column label="鎿嶄綔" width="150" fixed="right">
+        <el-table-column label="鎿嶄綔" width="180">
           <template slot-scope="scope">
             <el-button type="text" size="small">鍙樻洿鍏捣</el-button>
             <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button>
             <el-button type="text" size="small">璺熻繘</el-button>
+            <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button>
           </template>
         </el-table-column>
       </template>
@@ -47,11 +48,13 @@
 
 <script>
 import AddClientManageDialog from "@/views/client/client/AddClientManageDialog.vue"
-import { getClientList } from "@/api/client/client"
+import { getClientList, getDeleteClient } from "@/api/client/client"
+import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
 
 export default {
   name: "CustomManage",
   props: {},
+  mixins: [pageMixin],
   components: {
     AddClientManageDialog
   },
@@ -121,7 +124,11 @@
     // 璇锋眰鏁版嵁
     async getData() {
       this.loading = true
-      await getClientList()
+      await getClientList({
+        keyword: "",
+        page: this.pagerOptions.currPage,
+        pageSize: this.pagerOptions.pageSize
+      })
         .then((res) => {
           console.log(res)
           if (res.code === 200) {
@@ -137,7 +144,6 @@
                     }
                   }
                 }
-
                 return {
                   ...item,
                   contact_name: contact_name,
@@ -145,6 +151,7 @@
                 }
               })
               this.tableList.tableInfomation = list || []
+              this.pagerOptions.totalCount = res.data.count
             } else {
               this.tableList.tableInfomation = []
             }
@@ -166,36 +173,7 @@
     addBtnClick() {
       this.editConfig.visible = true
       this.editConfig.title = "鏂板缓"
-      this.editConfig.infomation = {
-        name: "",
-        number: "",
-        client_status_id: "",
-        member_id: "",
-        client_type_id: "",
-        clientSource: "",
-        client_level_id: "",
-        service_member_id: "",
-        next_visit_time: "",
-        latest_service_time: "",
-        contact_name: "",
-        contact_phone: "",
-        contact_duties: "",
-        contact_wechat: "",
-        contact_email: "",
-        industry_id: "",
-        representative: "",
-        registration_time: "",
-        registered_capital_id: "",
-        enterprise_nature_id: "",
-        enterprise_scale_id: "",
-        business_scope: "",
-        country: "",
-        province: "",
-        city: "",
-        region: "",
-        detail_address: "",
-        remark: ""
-      }
+      this.editConfig.infomation = {}
     },
     // 缂栬緫
     handleClick(row) {
@@ -212,36 +190,33 @@
       }
       console.log(contactObj)
       this.editConfig.infomation = {
-        id: row.id,
-        name: row.name,
-        number: row.number,
-        client_status_id: row.client_status_id,
-        member_id: row.member_id,
-        client_type_id: row.client_type_id,
-        clientSource: row.clientSource,
-        client_level_id: row.client_level_id,
-        service_member_id: row.service_member_id,
-        next_visit_time: row.next_visit_time,
-        latest_service_time: row.latest_service_time,
-        contact_name: row.contact_name,
-        contact_phone: row.contact_phone,
-        contact_duties: "",
+        ...row,
         contact_wechat: contactObj.length > 0 ? contactObj.wechat : "",
-        contact_email: contactObj.length > 0 ? contactObj.email : "",
-        industry_id: row.industry_id,
-        representative: row.representative,
-        registration_time: row.registration_time,
-        registered_capital_id: row.registered_capital_id,
-        enterprise_nature_id: row.enterprise_nature_id,
-        enterprise_scale_id: row.enterprise_scale_id,
-        business_scope: row.business_scope,
-        country: row.country,
-        province: row.province,
-        city: row.city,
-        region: row.region,
-        detail_address: row.detail_address,
-        remark: row.remark
+        contact_email: contactObj.length > 0 ? contactObj.email : ""
       }
+    },
+    // 鍒犻櫎
+    delClick(id) {
+      this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+        .then(function () {
+          return getDeleteClient({ id: id })
+        })
+        .then((response) => {
+          if (response.code === 200) {
+            this.$message.success("鍒犻櫎鎴愬姛")
+            this.getData()
+          } else {
+            this.$message.warning("鍒犻櫎澶辫触")
+          }
+        })
+        .catch(function () {})
+    },
+    getSelectArray(val) {
+      console.log(val)
     }
   }
 }

--
Gitblit v1.8.0