From 549d9a1b7e53554af4add6663478149dc42516ae Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期一, 22 四月 2024 13:54:21 +0800 Subject: [PATCH] 员工信息的列表接口联调+删除员工的接口联调 --- src/views/employeeManage/employeeInfo/index.vue | 51 +++++++++++++++++++-------------------------------- 1 files changed, 19 insertions(+), 32 deletions(-) diff --git a/src/views/employeeManage/employeeInfo/index.vue b/src/views/employeeManage/employeeInfo/index.vue index 5579c07..706a4ef 100644 --- a/src/views/employeeManage/employeeInfo/index.vue +++ b/src/views/employeeManage/employeeInfo/index.vue @@ -30,7 +30,7 @@ <el-table-column label="鎿嶄綔" width="90" fixed="right"> <template slot-scope="scope"> <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button> - <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> + <el-button @click="delClick(scope.row)" type="text" size="small">鍒犻櫎</el-button> </template> </el-table-column> </template> @@ -46,7 +46,7 @@ </template> <script> -import { getFollowRecordList, getDeleteFollowRecord } from "@/api/employeeManage/employeeInfo.js" +import { getWorkerList, getDeleteWorkerInfo } from "@/api/employeeManage/employeeInfo.js" import pageMixin from "@/components/makepager/pager/mixin/pageMixin" import AddEmployee from "@/views/employeeManage/employeeInfo/components/AddEmployee" export default { @@ -65,16 +65,16 @@ editRow: { title: "鏂板缓", }, - search_map: {}, + search_map: '', tableColumn: [ - { label: "鍛樺伐缂栫爜", prop: "topic", min: 120, default: true }, // 涓婚 - { label: "濮撳悕", prop: "client_name", min: 190, }, // 瀹㈡埛鍚嶇О - { label: "鎵嬫満鍙�", prop: "contact_name", min: 130, }, // 鑱旂郴浜哄鍚� - { label: "杞﹂棿", prop: "client_status", min: 100 }, // 瀹㈡埛鐘舵�� - { label: "缁勫埆", prop: "contact_information_name", min: 100 }, // 鑱旂郴鏂瑰紡 - { label: "宸ョ", prop: "follow_time", min: 130 }, // 鑱旂郴浜烘棩鏈� - { label: "娣诲姞鏃堕棿", prop: "next_follow_time", min: 130 }, // 涓嬫鍥炶鏃ユ湡 - { label: "娣诲姞浜�", prop: "member_name", min: 110 }, // 璐熻矗浜� + { label: "鍛樺伐缂栫爜", prop: "id", min: 120, default: true }, // 涓婚 + { label: "濮撳悕", prop: "name", min: 190, }, // 瀹㈡埛鍚嶇О + { label: "鎵嬫満鍙�", prop: "phoneNum", min: 130, }, // 鑱旂郴浜哄鍚� + { label: "杞﹂棿", prop: "shopName", min: 100 }, // 瀹㈡埛鐘舵�� + { label: "缁勫埆", prop: "groupNumber", min: 100 }, // 鑱旂郴鏂瑰紡 + { label: "宸ョ", prop: "workType", min: 130 }, // 鑱旂郴浜烘棩鏈� + { label: "娣诲姞鏃堕棿", prop: "createdAt", min: 150 }, // 涓嬫鍥炶鏃ユ湡 + { label: "娣诲姞浜�", prop: "addPeople", min: 110 }, // 璐熻矗浜� ], showCol: [ "鍛樺伐缂栫爜", @@ -126,28 +126,17 @@ // 璇锋眰鏁版嵁 async getData() { this.loading = true - await getFollowRecordList({ - search_map: this.search_map, + await getWorkerList({ + keyWord: this.search_map, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }) .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 { - ...item, - client_name: item.client.name, - contact_name: item.contact.name, - client_status: item.client_status.name, - phone: item.contact.phone, - member_name: item.member.username, - contact_information_name: item.contact_information.name - } - }) + if (res.data) { + const list = res.data this.tableList.tableInfomation = list || [] - this.pagerOptions.totalCount = res.data.count + this.pagerOptions.totalCount = res.count } else { this.tableList.tableInfomation = [] } @@ -164,7 +153,7 @@ }, // 鎼滅储 onFilterSearch(searchText) { - this.search_map.client_name = searchText ?? "" + this.search_map = searchText ?? "" this.pagerOptions.currPage = 1 this.getData() }, @@ -183,19 +172,17 @@ this.$refs.addEmployee.islook = true; }, // 鍒犻櫎 - delClick(id) { + delClick(row) { this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { confirmButtonText: "纭畾", cancelButtonText: "鍙栨秷", type: "warning" }) .then(() => { - getDeleteFollowRecord({ ids: [id] }).then((response) => { + getDeleteWorkerInfo({ id: row.id }).then((response) => { if (response.code === 200) { this.$message.success("鍒犻櫎鎴愬姛") this.getData() - } else { - this.$message.warning("鍒犻櫎澶辫触") } }) }) -- Gitblit v1.8.0