From 785c27f9ad8c9d33791e3eacc3c1c6f11ac7e614 Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Mon, 19 May 2025 17:44:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(market):=20=E5=AE=9E=E7=8E=B0=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=88=86=E9=85=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增公共端获取全部员工列表接口 - 新增销售端资源共享分配员工接口 - 修改客户列表展示逻辑 - 添加员工选择器组件 - 实现资源分配操作流程 --- api/apiRoute.js | 16 +++++ pages/market/clue/index.vue | 115 +++++++++++++++++++++++++++--------- 2 files changed, 104 insertions(+), 27 deletions(-) diff --git a/api/apiRoute.js b/api/apiRoute.js index 40d201f..3459dda 100644 --- a/api/apiRoute.js +++ b/api/apiRoute.js @@ -45,6 +45,13 @@ export default { return res; }) }, + //公共端-获取全部员工列表 + common_getPersonnelAll(data = {}) { + let url = '/personnel/getPersonnelAll' + return http.get(url, data).then(res => { + return res; + }) + }, @@ -146,6 +153,15 @@ export default { return res; }) }, + //销售端-资源共享-分配员工 + xs_resourceSharingAssign(data = {}) { + let url = '/resourceSharing/assign' + return http.post(url, data).then(res => { + return res; + }) + }, + + diff --git a/pages/market/clue/index.vue b/pages/market/clue/index.vue index 8567a46..99b243c 100644 --- a/pages/market/clue/index.vue +++ b/pages/market/clue/index.vue @@ -74,14 +74,14 @@ - {{v.student_name}} - {{v.is_status == 1 ? '试听' : '成交'}} + {{v.customerResource.name}} + - 首联系人:{{v.contact_name}} {{v.decision_maker}} + 决策人:{{v.customerResource.name}} {{v.customerResource.decision_maker}} - {{ $util.formatToDateTime((v.follow && v.follow.follow_up_time || ''),'m-d H:i') }} 跟进 + {{ $util.formatToDateTime((v.shared_at || ''),'m-d H:i') }} 跟进 @@ -101,7 +101,7 @@ class="drop-image-x" > - 意向:{{ v.follow && v.follow.initial_customer_intent || '' }} + 意向:{{ v.customerResource && v.customerResource.initial_intent_name || '' }} @@ -109,12 +109,14 @@ - + + + @@ -158,7 +160,6 @@ export default { // name: '资源分配' // } ], - select_type: 1,//筛选标签列表|1,2,3,4 segmented_type: 1,//当前选中的Tab栏目|1=我的客户,2=资源分配 userInfo:{},//用户信息 @@ -178,10 +179,23 @@ export default { page:1,//当前页码 limit:10,//每页返回数据条数 total:10,//数据总条数 + shared_by:'0',//共享人ID|0=未分配 + shared_at:[],//共享时间|[开始时间(Y-m-d),结束时间(Y-m-d)] }, //数据列表 tableList_2:[],//表格数据 + //员工select选择器 + select_show:false,//是否展示选择器 + select_item:{},//当前选中的选项 + select_options:[ + // { + // text: '张三', + // value: '1', + // } + ],//选择器可选项 + + } }, onLoad(options) {}, @@ -205,9 +219,13 @@ export default { }, methods: { //初始化 - async init(){ + async init() { await this.getUserInfo(); - // await this.getList(); + if (this.segmented_type == 1) { + await this.getList_1(); + } else { + await this.getList_2(); + } }, //获取用户信息 @@ -235,6 +253,8 @@ export default { name: '资源分配' } ] + //是经理的情况下,获取这个校区的全部用户(身份是销售的) + await this.getPersonnelAll(); }else{ this.values = [ { @@ -243,7 +263,32 @@ export default { }, ] } - console.log('用户',this.userInfo) + }, + + + //获取全部员工 + async getPersonnelAll(){ + let res = await apiRoute.common_getPersonnelAll({ + personnel_id:this.userInfo.id,//客户id + account_type:'market',//账号类型|teacher=老师,market=销售 + }) + if (res.code != 1) { + uni.showToast({ + title: res.msg, + icon: 'none' + }) + return + } + + let arr = [] + res.data.forEach((v, k) => { + arr.push({ + text: v.name, + value: v.id, + }) + }) + this.select_options = arr + console.log('员工',this.select_options) }, //获取列表-我的客户相关 @@ -294,10 +339,10 @@ export default { return } - this.tableList_1 = this.tableList_1.concat(res.data.list.data); // 使用 concat 方法 将新数据追加到数组中 + this.tableList_1 = this.tableList_1.concat(res.data.data); // 使用 concat 方法 将新数据追加到数组中 console.log('列表',this.tableList_1) - this.filteredData_1.total = res.data.list.total + this.filteredData_1.total = res.data.total this.filteredData_1.page++ @@ -340,7 +385,7 @@ export default { this.tableList_2 = [] } - let res = await marketApi.myClient(data) + let res = await apiRoute.xs_resourceSharingIndex(data) this.loading = false this.isReachedBottom = false; if (res.code != 1){ @@ -351,19 +396,19 @@ export default { return } - this.tableList_2 = this.tableList_2.concat(res.data.list.data); // 使用 concat 方法 将新数据追加到数组中 + console.log(123123,res) + + this.tableList_2 = this.tableList_2.concat(res.data.data); // 使用 concat 方法 将新数据追加到数组中 console.log('列表',this.tableList_2) - this.filteredData_2.total = res.data.list.total + this.filteredData_2.total = res.data.total this.filteredData_2.page++ }, //切换tag列表 - async segmented(index) { - this.select_type = 1 - this.segmented_type = index.id//1=我的客户,2=资源分配 - + async segmented(param) { + this.segmented_type = param.id//1=我的客户,2=资源分配 if(this.segmented_type == 1){ //我的客户 //重置为第一页 @@ -425,12 +470,28 @@ export default { }) }, - //公海-领取客户 - async getSales(item){ + //公海-分配客户给员工相关 + //打开分配列表 + openAssign(item) { + this.select_item = item + this.select_show = true + }, + //关闭分配列表 + closeAssign(item) { + this.select_item = {} + this.select_show = false + this.select_options = this.select_options.map(v => ({ ...v, checked: false })); + }, + //公海-分配客户给员工 + async getSales(e){ + let select_item = {...this.select_item} + console.log('选中',e,select_item) + this.closeAssign()//关闭选择窗 let param = { - sales_id:item.id + resource_sharing_id: select_item.id,//共享资源表id + shared_by: e.options.value,//分给员工的id } - let res = await marketApi.getSales(param) + let res = await apiRoute.xs_resourceSharingAssign(param) if(res.code != 1){ uni.showToast({ title: res.msg, @@ -445,9 +506,9 @@ export default { //延迟1s执行 setTimeout(() => { let param = { - index:{ - id:2//2=公海客户列表 - } + id: 2, + index: 1, + name: "资源分配", } this.segmented(param) }, 1000) @@ -498,7 +559,7 @@ export default { height: 60rpx; } .card-text{ - font-size: 46rpx; + font-size: 32rpx; padding-left: 16rpx; color: #fff; }