From 2490bf74ce433eebcac3486f6f500703f74bfb1c Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Tue, 15 Apr 2025 18:01:40 +0800 Subject: [PATCH] =?UTF-8?q?feat(market):=20=E6=96=B0=E5=A2=9E=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E4=BF=A1=E6=81=AF=E9=A1=B5=E9=9D=A2=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8A=A0=E8=BD=BD=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加了多个字典数据加载方法,包括跟进人员、购买力、认知理念、情感粘度、意向分类等 - 优化了字典数据的存储和展示逻辑,提高了页面的可维护性和用户体验- 新增了跟进人员(全部、市场、销售)的字典数据加载功能,为不同角色的用户提供了更精准的数据支持 --- pages/market/clue/writing_followUp.vue | 160 ++++++++++++++++++++++--- 1 file changed, 145 insertions(+), 15 deletions(-) diff --git a/pages/market/clue/writing_followUp.vue b/pages/market/clue/writing_followUp.vue index 4336cae..26324a6 100644 --- a/pages/market/clue/writing_followUp.vue +++ b/pages/market/clue/writing_followUp.vue @@ -412,7 +412,7 @@ export default { str_entry_type:'', //跟进人员-相关 - //字典-跟进人员 + //字典-跟进人员(全部) options_staff_id:[], //文本展示-跟进人员 str_staff_id:'', @@ -442,7 +442,7 @@ export default { str_initial_customer_intent:'', //意向度-相关 - //字典-意向度 + //字典-意向度(客情) options_initial_relationship_intent:[], //文本展示-意向度 str_initial_relationship_intent:'', @@ -465,8 +465,27 @@ export default { methods: { //初始化 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 getDicFollow_up_type() { - let key = 'follow_up_type' + async getDic_initial_customer_intent() { + let key = 'initial_customer_intent' let res = await commonApi.getDictionary(key) if (res.code != 1) { uni.showToast({ @@ -512,14 +587,69 @@ export default { } 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) => { - this.options_leixing.push({ + this.options_initial_relationship_intent.push({ value: v.value, 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) {