From 329d1dff5c6bd31990c7194c0da33eddb1d751c6 Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Tue, 15 Apr 2025 16:44:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(market):=20=E6=A0=B9=E6=8D=AE=E8=B7=9F?= =?UTF-8?q?=E8=BF=9B=E7=B1=BB=E5=9E=8B=E5=8C=BA=E5=88=86=E5=B8=82=E5=9C=BA?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=92=8C=E9=94=80=E5=94=AE=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增市场人员和销售人员的字典列表 - 根据跟进类型动态显示不同人员列表 - 优化跟进人员选择逻辑,增加空值重置 -调整数据结构和方法以支持新的功能 --- pages/market/clue/add_clues.vue | 70 +++++++++++++++++++++++++++++---- 1 file changed, 63 insertions(+), 7 deletions(-) diff --git a/pages/market/clue/add_clues.vue b/pages/market/clue/add_clues.vue index b30192a..241b285 100644 --- a/pages/market/clue/add_clues.vue +++ b/pages/market/clue/add_clues.vue @@ -423,12 +423,18 @@ export default { //跟进人员-相关 //字典-跟进人员 - options_staff_id: [ + options_staff_id_5: [ // { // 'value': 1, // 'text': '类型1' // } - ], + ],//市场人员列表 + options_staff_id_6: [ + // { + // 'value': 1, + // 'text': '类型1' + // } + ],//销售人员列表 str_staff_id:'',//文本显示-跟进人员 @@ -555,9 +561,15 @@ export default { this.getDict_source_channel()//获取字典-来源渠道 this.getDict_customer_source()//获取字典-客户来源 this.getDict_customer_tags()//获取字典-客户标签 + this.getStaffList()//获取人员列表 + this.getRoleStaffList(5)//获取市场人员列表 + this.getRoleStaffList(6)//获取销售人员列表 + this.getAreaTree()//获取地区树形结构 + + }, async getUserInfo(){ @@ -575,9 +587,6 @@ export default { this.formData.add_staff_id = res.data.staff_id//顾问id this.str_add_staff_id = res.data.name//顾问名字 - - this.formData.staff_id = res.data.staff_id//跟进人员id - this.str_staff_id = res.data.name//跟进人员名字 }, @@ -600,7 +609,37 @@ export default { }) }) this.options_add_staff_id = arr - this.options_staff_id = arr + }, + + //获取人员列表 role_id|5=市场,6=销售 + async getRoleStaffList(role_id) { + let res = await memberApi.staffList({ + type: 2, + role_id:role_id + }) + 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, + }) + }) + + if(role_id == 5){ + this.options_staff_id_5 = arr + console.log('市场',arr) + }else{ + this.options_staff_id_6 = arr + console.log('销售',arr) + } }, //获取地区树形结构 @@ -891,7 +930,20 @@ export default { break; // 跟进人员 case 'staff_id': - this.options = this.options_staff_id + if(!this.formData.entry_type){ + uni.showToast({ + title: '请先选择跟进类型', + icon: 'none' + }) + return + } + if(this.formData.entry_type == 1){ + //市场人员列表 + this.options = this.options_staff_id_5 + }else{ + //销售人员列表 + this.options = this.options_staff_id_6 + } this.show = true this.linkage = true break; @@ -926,6 +978,10 @@ export default { case 'entry_type': this.str_entry_type = e.text//选中的text值 this.formData.entry_type = e.value//选中value值 + + //清空跟进人员选择 + this.formData.staff_id = '' + this.str_staff_id = '' break; // 跟进人员 case 'staff_id':