From a2586ce70485035d77746ff9c18364f408f4c6aa Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期一, 07 八月 2023 16:57:06 +0800 Subject: [PATCH] 服务管理模块详情页 --- src/views/client/contacts/index.vue | 85 +++++++++++++++++++++++++++++++++++++----- 1 files changed, 74 insertions(+), 11 deletions(-) diff --git a/src/views/client/contacts/index.vue b/src/views/client/contacts/index.vue index 340c482..ec669d5 100644 --- a/src/views/client/contacts/index.vue +++ b/src/views/client/contacts/index.vue @@ -1,11 +1,27 @@ <template> <div class="contacts-view"> - <SearchCommonView ref="searchCommonView" :query-class-options="queryClassOptions" :search-options="searchOptions" /> - <div class="btn-pager"> - <PublicFunctionBtnView :operates-list="operatesList" /> - <PagerView class="page" /> + <div v-if="isDetail" class="detail-top"> + <DetailListCommonBtn :query-class-options="queryClassOptions" /> + <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> - <TableCommonView ref="tableListRef" v-loading="loading" :table-list="tableList"> + <div v-else class="top"> + <SearchCommonView + ref="searchCommonView" + :query-class-options="queryClassOptions" + :search-options="searchOptions" + /> + <div class="btn-pager"> + <PublicFunctionBtnView :operates-list="operatesList" :allocation="false" /> + <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> + </div> + </div> + <TableCommonView + ref="tableListRef" + v-loading="loading" + :table-list="tableList" + @selContactsClick="selContactsClick" + @selClientClick="selClientClick" + > <template slot="tableButton"> <el-table-column label="鎿嶄綔" width="120" fixed="right"> <template slot-scope="scope"> @@ -18,17 +34,30 @@ </TableCommonView> <!-- 鏂板缓/缂栬緫鑱旂郴浜� --> <AddContactsDialog v-if="editConfig.visible" :edit-contacts-config="editConfig" /> + <!-- 鑱旂郴浜鸿鎯� --> + <DetailContacts v-if="contactsDeail.visible" :contacts-detail="contactsDeail" /> + <!-- 瀹㈡埛璇︽儏 --> + <DetailClientManage v-if="clientDeail.visible" :client-manage-detail="clientDeail" /> </div> </template> <script> import AddContactsDialog from "@/views/client/contacts/AddContactsDialog" import { getContactList, getDeleteContact } from "@/api/client/contacts" +import pageMixin from "@/components/makepager/pager/mixin/pageMixin" export default { name: "ContactsView", - props: {}, + props: { + isDetail: { + type: Boolean, + default: false + } + }, + mixins: [pageMixin], components: { - AddContactsDialog + AddContactsDialog, + DetailContacts: () => import("@/views/client/contacts/DetailContacts"), + DetailClientManage: () => import("@/views/client/client/DetailClientManage") }, computed: {}, data() { @@ -57,6 +86,14 @@ visible: false, title: "鏂板缓", infomation: {} + }, + contactsDeail: { + visible: false, + infomation: {} + }, + clientDeail: { + visible: false, + infomation: {} } } }, @@ -69,8 +106,8 @@ this.tableList = { tableInfomation: [], tableColumn: [ - { label: "鑱旂郴浜哄鍚�", prop: "name", min: 100 }, // 鑱旂郴浜哄鍚� - { label: "瀹㈡埛鍚嶇О", prop: "client_name", min: 190 }, // 瀹㈡埛鍚嶇О + { label: "鑱旂郴浜哄鍚�", prop: "name", min: 100, isContactClick: true }, // 鑱旂郴浜哄鍚� + { label: "瀹㈡埛鍚嶇О", prop: "client_name", min: 190, isClientClick: true }, // 瀹㈡埛鍚嶇О { label: "鑱旂郴浜虹紪鍙�", prop: "number", min: 100 }, // 鑱旂郴浜虹紪鍙� { label: "鑱屽姟", prop: "position", min: 120 }, // 鑱屽姟 { label: "鎵嬫満", prop: "phone", min: 100 }, // 鎵嬫満鍙风爜 @@ -87,7 +124,11 @@ // 璇锋眰鏁版嵁 async getData() { this.loading = true - await getContactList() + await getContactList({ + keyword: "", + page: this.pagerOptions.currPage, + pageSize: this.pagerOptions.pageSize + }) .then((res) => { console.log(res) if (res.code === 200) { @@ -100,6 +141,7 @@ } }) this.tableList.tableInfomation = list || [] + this.pagerOptions.totalCount = res.data.count } else { this.tableList.tableInfomation = [] } @@ -149,6 +191,18 @@ }, getSelectArray(val) { console.log(val) + }, + // 鑱旂郴浜鸿鎯� + selContactsClick(row) { + console.log(row) + this.contactsDeail.visible = true + this.contactsDeail.infomation = { ...row, contact_name: row.name } + }, + // 瀹㈡埛鍚嶇О璇︽儏 + selClientClick(row) { + console.log(row) + this.clientDeail.visible = true + this.clientDeail.infomation = { ...row, client_name: row.Client.name } } } } @@ -157,7 +211,16 @@ <!-- Add "scoped" attribute to limit CSS to this component only --> <style lang="scss" scoped> .contacts-view { - .btn-pager { + .top { + margin-bottom: 20px; + .btn-pager { + display: flex; + .page { + margin-left: auto; + } + } + } + .detail-top { display: flex; .page { margin-left: auto; -- Gitblit v1.8.0