Browse Source

feat(market): 根据跟进类型区分市场人员和销售人员

- 新增市场人员和销售人员的字典列表
- 根据跟进类型动态显示不同人员列表
- 优化跟进人员选择逻辑,增加空值重置
-调整数据结构和方法以支持新的功能
master
liutong 1 year ago
parent
commit
329d1dff5c
  1. 70
      pages/market/clue/add_clues.vue

70
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':

Loading…
Cancel
Save