Browse Source

feat(market): 新增客户信息页面字典数据加载功能

- 添加了多个字典数据加载方法,包括跟进人员、购买力、认知理念、情感粘度、意向分类等
- 优化了字典数据的存储和展示逻辑,提高了页面的可维护性和用户体验- 新增了跟进人员(全部、市场、销售)的字典数据加载功能,为不同角色的用户提供了更精准的数据支持
master
liutong 1 year ago
parent
commit
2490bf74ce
  1. 160
      pages/market/clue/writing_followUp.vue

160
pages/market/clue/writing_followUp.vue

@ -412,7 +412,7 @@ export default {
str_entry_type:'', str_entry_type:'',
//跟进人员-相关 //跟进人员-相关
//字典-跟进人员 //字典-跟进人员(全部)
options_staff_id:[], options_staff_id:[],
//文本展示-跟进人员 //文本展示-跟进人员
str_staff_id:'', str_staff_id:'',
@ -442,7 +442,7 @@ export default {
str_initial_customer_intent:'', str_initial_customer_intent:'',
//意向度-相关 //意向度-相关
//字典-意向度 //字典-意向度(客情)
options_initial_relationship_intent:[], options_initial_relationship_intent:[],
//文本展示-意向度 //文本展示-意向度
str_initial_relationship_intent:'', str_initial_relationship_intent:'',
@ -465,8 +465,27 @@ export default {
methods: { methods: {
//初始化 //初始化
async init() { async init() {
this.getSalesList()//获取字典-选择线索 //获取字典-选择线索
this.getDicFollow_up_type()//获取字典-跟进类型 this.getSalesList()
//获取字典-跟进类型
this.getDic_entry_type()
//获取字典-购买力
this.getDic_purchasing_power()
//获取字典-认知理念
this.getDic_cognitive_concept()
//获取字典-情感粘度
this.getDic_emotional_intensity()
//获取字典-意向分类
this.getDic_initial_customer_intent()
//获取字典-意向度
this.getDic_initial_relationship_intent()
//获取字典-跟进人员(全部)
this.getDic_staff_id('')
//获取字典-跟进人员(市场)
this.getDic_staff_id('5')
//获取字典-跟进人员(销售)
this.getDic_staff_id('6')
}, },
//获取字典-选择线索 //获取字典-选择线索
@ -489,19 +508,75 @@ export default {
}) })
}, },
//获取字典-跟进类型 //获取字典-跟进类型
//获取字典-跟进人员(全部) async getDic_entry_type() {
//获取字典-跟进任务-跟进人员(市场) //填写人员类型(字典:1=市场人员录入的,2=销售人员录入的)
//获取字典-跟进任务-跟进人员(销售) this.options_entry_type = [
{
value: 1,
text: '市场人员',
},
{
value: 2,
text: '销售人员',
},
]
},
//获取字典-购买力 //获取字典-购买力
async getDic_purchasing_power() {
this.options_purchasing_power = [
{
value: 1,
text: '低',
},
{
value: 2,
text: '中',
},
{
value: 3,
text: '高',
},
]
},
//获取字典-认知理念 //获取字典-认知理念
async getDic_cognitive_concept() {
// 认知理念|1=低,2=中,3=高
this.options_cognitive_concept = [
{
value: 1,
text: '低',
},
{
value: 2,
text: '中',
},
{
value: 3,
text: '高',
},
]
},
//获取字典-情感粘度 //获取字典-情感粘度
async getDic_emotional_intensity() {
// 情感粘度|1=低,2=中,3=高
this.options_emotional_intensity = [
{
value: 1,
text: '低',
},
{
value: 2,
text: '中',
},
{
value: 3,
text: '高',
},
]
},
//获取字典-意向分类 //获取字典-意向分类
//获取字典-意向度 async getDic_initial_customer_intent() {
let key = 'initial_customer_intent'
//获取字典-跟进类型
async getDicFollow_up_type() {
let key = 'follow_up_type'
let res = await commonApi.getDictionary(key) let res = await commonApi.getDictionary(key)
if (res.code != 1) { if (res.code != 1) {
uni.showToast({ uni.showToast({
@ -512,14 +587,69 @@ export default {
} }
this.follow_up_type = res.data.dictionary this.follow_up_type = res.data.dictionary
this.options_leixing = [] this.options_initial_customer_intent = []
res.data.dictionary.forEach((v, k) => {
this.options_initial_customer_intent.push({
value: v.value,
text: v.name,
})
})
},
//获取字典-意向度
async getDic_initial_relationship_intent() {
let key = 'initial_relationship_intent'
let res = await commonApi.getDictionary(key)
if (res.code != 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.options_initial_relationship_intent = []
res.data.dictionary.forEach((v, k) => { res.data.dictionary.forEach((v, k) => {
this.options_leixing.push({ this.options_initial_relationship_intent.push({
value: v.value, value: v.value,
text: v.name, text: v.name,
}) })
}) })
}, },
//获取字典-跟进人员(全部)
//获取人员列表 role_id|5=市场,6=销售
async getDic_staff_id(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_follow_staff_id_sc = arr
console.log('市场',arr)
}else if(role_id == 6){
this.options_follow_staff_id_xs = arr
console.log('销售',arr)
}else{
//全部
this.options_staff_id = arr
console.log('全部',arr)
}
},
//验证表单 //验证表单
async validatorForm(data) { async validatorForm(data) {

Loading…
Cancel
Save