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/contacts/index.vue |   59 +++++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 43 insertions(+), 16 deletions(-)

diff --git a/src/views/custom/contacts/index.vue b/src/views/custom/contacts/index.vue
index 001f105..871f24b 100644
--- a/src/views/custom/contacts/index.vue
+++ b/src/views/custom/contacts/index.vue
@@ -5,7 +5,7 @@
       <PublicFunctionBtnView :operates-list="operatesList" />
       <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="120" fixed="right">
           <template slot-scope="scope">
@@ -22,6 +22,7 @@
 
 <script>
 import AddContactsDialog from "@/views/custom/contacts/AddContactsDialog"
+import { getContactList } from "@/api/custom/contacts"
 export default {
   name: "ContactsView",
   props: {},
@@ -32,6 +33,7 @@
   data() {
     return {
       tableList: {},
+      loading: false,
       queryClassOptions: [
         { value: "1", label: "鍏ㄩ儴" },
         { value: "2", label: "鏈湀鐢熸棩" }
@@ -59,29 +61,20 @@
   },
   created() {
     this.setTable()
+    this.getData()
   },
   methods: {
     setTable() {
       this.tableList = {
-        tableInfomation: [
-          {
-            contactName: "涓婃捣閫氱敤鏈烘鏈夐檺鍏徃",
-            customName: "BOSS",
-            contactNumber: "C绫诲鎴�",
-            duties: "20",
-            phoneNumber: "钁e浼�",
-            salesHead: "15988887777",
-            primaryContact: "2023-07-26"
-          }
-        ],
+        tableInfomation: [],
         tableColumn: [
           { label: "鑱旂郴浜哄鍚�", prop: "contactName", min: 100 }, // 鑱旂郴浜哄鍚�
-          { label: "瀹㈡埛鍚嶇О", prop: "customName", min: 190 }, // 瀹㈡埛鍚嶇О
-          { label: "鑱旂郴浜虹紪鍙�", prop: "contactNumber", min: 100 }, // 鑱旂郴浜虹紪鍙�
+          { label: "瀹㈡埛鍚嶇О", prop: "client_name", min: 190 }, // 瀹㈡埛鍚嶇О
+          { label: "鑱旂郴浜虹紪鍙�", prop: "number", min: 100 }, // 鑱旂郴浜虹紪鍙�
           { label: "鑱屽姟", prop: "duties", min: 120 }, // 鑱屽姟
-          { label: "鎵嬫満", prop: "phoneNumber", min: 100 }, // 鎵嬫満鍙风爜
+          { label: "鎵嬫満", prop: "phone", min: 100 }, // 鎵嬫満鍙风爜
           { label: "閿�鍞礋璐d汉", prop: "salesHead", min: 120 }, // 閿�鍞礋璐d汉
-          { label: "棣栬鑱旂郴浜�", prop: "primaryContact", min: 90 } // 棣栬鑱旂郴浜�
+          { label: "棣栬鑱旂郴浜�", prop: "name", min: 90 } // 棣栬鑱旂郴浜�
         ]
       }
       this.searchOptions = []
@@ -90,6 +83,40 @@
         this.searchOptions.push({ value: (i + 1).toString(), label: label })
       }
     },
+    // 璇锋眰鏁版嵁
+    async getData() {
+      this.loading = true
+      await getContactList()
+        .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 {
+                  contactName: "",
+                  client_name: item.Client.name,
+                  number: item.number,
+                  duties: "",
+                  phone: item.phone,
+                  salesHead: "",
+                  name: item.name
+                }
+              })
+              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
+        })
+    },
     // 鏂板缓
     addBtnClick() {
       this.editConfig.visible = true

--
Gitblit v1.8.0