From a63d71177a2899b01da37e5bfc2d498bec5f80be Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期二, 17 十月 2023 15:10:13 +0800 Subject: [PATCH] Merge branch 'dev' of http://192.168.5.5:10010/r/web/crm-web into zhengwenfeng/modify-style --- src/views/other/commonDialog/SelectChanceDialog.vue | 65 +++++++++++++++++++++++++------- 1 files changed, 51 insertions(+), 14 deletions(-) diff --git a/src/views/other/commonDialog/SelectChanceDialog.vue b/src/views/other/commonDialog/SelectChanceDialog.vue index 34c450d..0c1ed41 100644 --- a/src/views/other/commonDialog/SelectChanceDialog.vue +++ b/src/views/other/commonDialog/SelectChanceDialog.vue @@ -27,10 +27,14 @@ :table-list="tableList" :select-box="false" @selCommonClick="selNameClick" + @selTableCol="selTableCol" > </TableCommonView> <div slot="footer" class="dialog-footer"> - <div class="remark">璇存槑锛氭敮鎸佸瀛楁妯$硦鏌ヨ锛屼粎鏄剧ず绗﹀悎鏉′欢鐨勫墠5鏉℃暟鎹�</div> + <!-- <div class="remark">璇存槑锛氭敮鎸佸瀛楁妯$硦鏌ヨ锛屼粎鏄剧ず绗﹀悎鏉′欢鐨勫墠5鏉℃暟鎹�</div> --> + <div class="btn-pager"> + <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> + </div> </div> </div> </el-dialog> @@ -39,8 +43,10 @@ <script> import { getSaleChanceList } from "@/api/sales/salesOpportunity" +import pageMixin from "@/components/makepager/pager/mixin/pageMixin" export default { name: "EditSelChanceDialog", + mixins: [pageMixin], props: { editCommonConfig: { type: Object, @@ -48,6 +54,7 @@ return { editVisible: false, title: "", + clientId: 0, infomation: {} } } @@ -64,31 +71,52 @@ tableList: [], searchSelOptions: [], loading: false, - search_map: {} + search_map: {}, + tableColumn: [ + { label: "閿�鍞満浼氱紪鍙�", prop: "number" }, // 閿�鍞満浼氱紪鍙� + { label: "鏈轰細鍚嶇О", prop: "name", isCommonClick: true, default: true }, // 鏈轰細鍚嶇О + { label: "閿�鍞樁娈�", prop: "sale_stage_name" }, // 閿�鍞樁娈� + { label: "閿�鍞礋璐d汉", prop: "member_name" }, // 閿�鍞礋璐d汉 + { label: "棰勮鎴愪氦鏃ユ湡", prop: "expected_time" } // 棰勮鎴愪氦鏃ユ湡 + ], + showCol: ["閿�鍞満浼氱紪鍙�", "鏈轰細鍚嶇О", "閿�鍞樁娈�", "閿�鍞礋璐d汉", "棰勮鎴愪氦鏃ユ湡"] } }, created() { + this.search_map = { + client_id: this.editConfig.clientId + } this.setTable() this.getData() }, methods: { setTable() { this.tableList = { + selectIndex: true, tableInfomation: [], - tableColumn: [ - { label: "閿�鍞満浼氱紪鍙�", prop: "number" }, // 閿�鍞満浼氱紪鍙� - { label: "鏈轰細鍚嶇О", prop: "name", isCommonClick: true }, // 鏈轰細鍚嶇О - { label: "閿�鍞樁娈�", prop: "sale_stage_name" }, // 閿�鍞樁娈� - { label: "閿�鍞礋璐d汉", prop: "member_name" }, // 閿�鍞礋璐d汉 - { label: "棰勮鎴愪氦鏃ユ湡", prop: "expected_time" } // 棰勮鎴愪氦鏃ユ湡 - ] + allcol: [], + showcol: this.showCol, + tableColumn: this.setColumnVisible(this.showCol) } + this.tableList.allcol = this.tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label) this.searchOptions = [] for (let i = 0; i < this.tableList.tableColumn.length; i++) { const label = this.tableList.tableColumn[i].label const value = this.tableList.tableColumn[i].prop this.searchOptions.push({ value: value, label: label }) } + }, + setColumnVisible(showCol) { + return this.tableColumn.map((ele) => { + return { + ...ele, + isShowColumn: showCol.includes(ele.label) + } + }) + }, + selTableCol(val) { + this.showcol = val + this.tableList.tableColumn = this.setColumnVisible(val) }, handleClose() { this.editConfig.editVisible = false @@ -98,8 +126,8 @@ this.loading = true await getSaleChanceList({ search_map: this.search_map, - page: 0, - pageSize: 0 + page: this.pagerOptions.currPage, + pageSize: this.pagerOptions.pageSize }) .then((res) => { console.log(res) @@ -112,7 +140,8 @@ sale_stage_name: item.sale_stage.name } }) - this.tableList.tableInfomation = list.slice(0, 5) || [] + this.tableList.tableInfomation = list || [] + this.pagerOptions.totalCount = res.data.count } else { this.tableList.tableInfomation = [] } @@ -153,6 +182,7 @@ .bg-view { margin: 10px; .query-bg { + margin-left: -20px; margin-bottom: 10px; display: flex; justify-content: space-between; @@ -172,9 +202,16 @@ cursor: pointer; } .dialog-footer { - height: 40px; - line-height: 40px; + height: 50px; + line-height: 50px; color: red; + .btn-pager { + display: flex; + margin-top: 0px; + .page { + margin-left: auto; + } + } } ::v-deep { .input-with-select .el-input-group__prepend { -- Gitblit v1.8.0