From 960d295793f1d164e3e8e22f8d7744b7923ae24b Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期一, 17 七月 2023 18:29:17 +0800
Subject: [PATCH] 销售线索列表、新建、编辑接口联调

---
 src/views/custom/client/index.vue |   78 ++++++++++++++++++++++++++------------
 1 files changed, 53 insertions(+), 25 deletions(-)

diff --git a/src/views/custom/customManage/index.vue b/src/views/custom/client/index.vue
similarity index 73%
rename from src/views/custom/customManage/index.vue
rename to src/views/custom/client/index.vue
index 4b93a52..0f5da51 100644
--- a/src/views/custom/customManage/index.vue
+++ b/src/views/custom/client/index.vue
@@ -29,7 +29,7 @@
       />
       <PagerView class="page" />
     </div>
-    <TableCommonView ref="tableListRef" :table-list="tableList">
+    <TableCommonView ref="tableListRef" v-loading="loading" :table-list="tableList">
       <template slot="tableButton">
         <el-table-column label="鎿嶄綔" width="150" fixed="right">
           <template slot-scope="scope">
@@ -41,17 +41,19 @@
       </template>
     </TableCommonView>
     <!-- 鏂板缓/缂栬緫瀹㈡埛绠$悊 -->
-    <AddCustomManageDialog v-if="editConfig.visible" :edit-cuntom-manage-config="editConfig" />
+    <AddClientManageDialog v-if="editConfig.visible" :edit-client-manage-config="editConfig" />
   </div>
 </template>
 
 <script>
-import AddCustomManageDialog from "@/views/custom/customManage/AddCustomManageDialog"
+import AddClientManageDialog from "@/views/custom/client/AddClientManageDialog"
+import { getClientList } from "@/api/custom/client"
+import { dateFormat } from "@/common/config/index"
 export default {
   name: "CustomManage",
   props: {},
   components: {
-    AddCustomManageDialog
+    AddClientManageDialog
   },
   computed: {
     searchCommonHeight() {
@@ -61,6 +63,7 @@
   data() {
     return {
       tableList: {},
+      loading: false,
       activeName: "first",
       gonghaiValue: "",
       gonghaiOptions: [],
@@ -92,33 +95,22 @@
   },
   created() {
     this.setTable()
+    this.getData()
   },
   methods: {
     setTable() {
       this.tableList = {
-        tableInfomation: [
-          {
-            customName: "涓婃捣閫氱敤鏈烘鏈夐檺鍏徃",
-            saleLeadOwner: "BOSS",
-            importantLevel: "C绫诲鎴�",
-            notContactDay: "20",
-            contactName: "钁e浼�",
-            phoneNumber: "15988887777",
-            nextFollowDate: "2023-07-26",
-            detailAddress: "涓婃捣甯傞潤瀹夊尯濞佹捣璺�115鍙�",
-            customStatus: "娼滃湪瀹㈡埛"
-          }
-        ],
+        tableInfomation: [],
         tableColumn: [
-          { label: "瀹㈡埛鍚嶇О", prop: "customName", min: 100 }, // 瀹㈡埛鍚嶇О
-          { label: "閿�鍞礋璐d汉", prop: "saleLeadOwner" }, // 閿�鍞礋璐d汉
+          { label: "瀹㈡埛鍚嶇О", prop: "name", min: 100 }, // 瀹㈡埛鍚嶇О
+          { label: "閿�鍞礋璐d汉", prop: "service_member_id" }, // 閿�鍞礋璐d汉
           { label: "閲嶈绾у埆", prop: "importantLevel" }, // 閲嶈绾у埆
-          { label: "涓嬫鍥炶鏃ユ湡", prop: "notContactDay", min: 90 }, // 鏈仈绯讳汉澶╂暟
-          { label: "鎵嬫満鍙风爜", prop: "nextFollowDate" }, // 涓嬫鍥炶鏃ユ湡
-          { label: "璇︾粏鍦板潃", prop: "detailAddress", min: 200 }, // 璇︾粏鍦板潃
-          { label: "瀹㈡埛鐘舵��", prop: "customStatus" }, // 瀹㈡埛鐘舵��
-          { label: "鑱旂郴浜哄鍚�", prop: "contactName" }, // 鑱旂郴浜哄鍚�
-          { label: "鎵嬫満", prop: "phoneNumber" } // 鎵嬫満鍙风爜
+          { label: "涓嬫鍥炶鏃ユ湡", prop: "next_visit_time", min: 90 }, // 涓嬫鍥炶鏃ユ湡
+          { label: "鎵嬫満鍙风爜", prop: "phoneNumber" }, // 鎵嬫満鍙风爜
+          { label: "璇︾粏鍦板潃", prop: "detail_address", min: 200 }, // 璇︾粏鍦板潃
+          { label: "瀹㈡埛鐘舵��", prop: "client_status_id" }, // 瀹㈡埛鐘舵��
+          { label: "鑱旂郴浜哄鍚�", prop: "contact_name" }, // 鑱旂郴浜哄鍚�
+          { label: "鎵嬫満", prop: "phone" } // 鎵嬫満鍙风爜
         ]
       }
       this.searchOptions = []
@@ -127,6 +119,42 @@
         this.searchOptions.push({ value: (i + 1).toString(), label: label })
       }
     },
+    // 璇锋眰鏁版嵁
+    async getData() {
+      this.loading = true
+      await getClientList()
+        .then((res) => {
+          console.log(res)
+          if (res.code === 200) {
+            if (res.data.list && res.data.list.length > 0) {
+              const list = res.data.list.map((item) => {
+                return {
+                  name: item.name,
+                  service_member_id: item.service_member_id,
+                  importantLevel: "",
+                  next_visit_time: dateFormat("YYYY-mm-dd HH:MM", item.next_visit_time),
+                  phoneNumber: "",
+                  detail_address: item.detail_address,
+                  client_status_id: item.client_status_id,
+                  contact_name: "",
+                  phone: ""
+                }
+              })
+              this.tableList.tableInfomation = list || []
+            } else {
+              this.tableList.tableInfomation = []
+            }
+          } else {
+            this.tableList.tableInfomation = []
+          }
+          this.loading = false
+        })
+        .catch((err) => {
+          console.log(err)
+          this.tableList.tableInfomation = []
+          this.loading = false
+        })
+    },
     tabsClick(tab, event) {
       console.log(tab, event)
     },

--
Gitblit v1.8.0