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/followupRecords/index.vue | 65 ++++++++++++++++++++------------ 1 files changed, 41 insertions(+), 24 deletions(-) diff --git a/src/views/custom/followupRecords/index.vue b/src/views/custom/followupRecords/index.vue index 04dd78c..a73057c 100644 --- a/src/views/custom/followupRecords/index.vue +++ b/src/views/custom/followupRecords/index.vue @@ -5,7 +5,7 @@ <PublicFunctionBtnView :statistics="true" :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 AddFollowupRecordsDialog from "@/views/custom/followupRecords/AddFollowupRecordsDialog" import { getFollowRecordList } from "@/api/custom/followupRecords.js" +import { dateFormat } from "@/common/config/index" export default { name: "FollowupRecords", @@ -37,6 +38,7 @@ data() { return { tableList: {}, + loading: false, activeName: "second", queryClassOptions: [ { value: "1", label: "鍏ㄩ儴" }, @@ -69,29 +71,17 @@ methods: { setTable() { this.tableList = { - tableInfomation: [ - { - theme: "涓婇棬鎷滆", - customName: "涓婃捣閫氱敤鏈烘鏈夐檺鍏徃", - contactName: "BOSS", - customStatus: "C绫诲鎴�", - phoneNumber: "15988887777", - contactDate: "钁e浼�", - nextFollowupDate: "2023-07-28", - owner: "2023-07-26", - followupRecords: "涓婃捣甯傞潤瀹夊尯濞佹捣璺�115鍙�" - } - ], + tableInfomation: [], tableColumn: [ - { label: "涓婚", prop: "theme", min: 190 }, // 涓婚 - { label: "瀹㈡埛鍚嶇О", prop: "customName", min: 190 }, // 瀹㈡埛鍚嶇О - { label: "鑱旂郴浜哄鍚�", prop: "contactName", min: 100 }, // 鑱旂郴浜哄鍚� - { label: "瀹㈡埛鐘舵��", prop: "customStatus", min: 100 }, // 瀹㈡埛鐘舵�� - { label: "鑱旂郴鏂瑰紡", prop: "phoneNumber", min: 100 }, // 鑱旂郴鏂瑰紡 - { label: "鑱旂郴浜烘棩鏈�", prop: "contactDate", min: 100 }, // 鑱旂郴浜烘棩鏈� - { label: "涓嬫鍥炶鏃ユ湡", prop: "nextFollowupDate", min: 130 }, // 涓嬫鍥炶鏃ユ湡 - { label: "璐熻矗浜�", prop: "owner", min: 120 }, // 璐熻矗浜� - { label: "璺熻繘璁板綍", prop: "followupRecords", min: 120 } // 璺熻繘璁板綍 + { label: "涓婚", prop: "topic", min: 190 }, // 涓婚 + { label: "瀹㈡埛鍚嶇О", prop: "client_name", min: 190 }, // 瀹㈡埛鍚嶇О + { label: "鑱旂郴浜哄鍚�", prop: "contact_name", min: 100 }, // 鑱旂郴浜哄鍚� + { label: "瀹㈡埛鐘舵��", prop: "client_status_id", min: 100 }, // 瀹㈡埛鐘舵�� + { label: "鑱旂郴鏂瑰紡", prop: "phone", min: 100 }, // 鑱旂郴鏂瑰紡 + { label: "鑱旂郴浜烘棩鏈�", prop: "follow_time", min: 100 }, // 鑱旂郴浜烘棩鏈� + { label: "涓嬫鍥炶鏃ユ湡", prop: "next_follow_time", min: 130 }, // 涓嬫鍥炶鏃ユ湡 + { label: "璐熻矗浜�", prop: "member_id", min: 120 }, // 璐熻矗浜� + { label: "璺熻繘璁板綍", prop: "record", min: 120 } // 璺熻繘璁板綍 ] } this.searchOptions = [] @@ -101,13 +91,40 @@ } }, // 璇锋眰鏁版嵁 + // 璇锋眰鏁版嵁 async getData() { + this.loading = true await getFollowRecordList() .then((res) => { - console.log("鎴愬姛" + 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 { + topic: item.topic, + client_name: item.client.name, + contact_name: item.contact.name, + client_status_id: item.client.client_status_id, + phone: item.contact.phone, + follow_time: dateFormat("YYYY-mm-dd HH:MM", item.follow_time), + next_follow_time: dateFormat("YYYY-mm-dd HH:MM", item.next_follow_time), + member_id: item.member_id, + record: item.record + } + }) + 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 }) }, // 鏂板缓 -- Gitblit v1.8.0