From f31492fa8ceb58c773b67403314557df93060c5b Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Tue, 15 Apr 2025 18:57:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(market):=20=E6=96=B0=E5=A2=9E=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E8=B7=9F=E8=BF=9B=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 | 114 +++++++++++++++---------- 1 file changed, 67 insertions(+), 47 deletions(-) diff --git a/pages/market/clue/writing_followUp.vue b/pages/market/clue/writing_followUp.vue index faf9975..f839e43 100644 --- a/pages/market/clue/writing_followUp.vue +++ b/pages/market/clue/writing_followUp.vue @@ -75,7 +75,6 @@ - @@ -244,7 +236,7 @@ 跟进任务 - @@ -469,6 +461,7 @@ export default { methods: { //初始化 async init() { + this.getUserInfo() //获取字典-选择线索 this.getSalesList() //获取字典-跟进类型 @@ -492,6 +485,22 @@ export default { this.getDic_staff_id('6') }, + //获取当前登陆用户信息 + async getUserInfo(){ + let res = await marketApi.member({}) + if (res.code != 1) { + uni.showToast({ + title: res.msg, + icon: 'none' + }) + return + } + console.log(111,res.data) + this.formData.staff_id = res.data.staff_id//基础表单->跟进人员 + this.str_staff_id = res.data.name//基础表单->跟进人员名字 + }, + + //获取字典-选择线索 async getSalesList() { let res = await marketApi.salesList({}) @@ -657,48 +666,41 @@ export default { //表单验证 async validatorForm(data) { - //线索标题 - if(!data.title){ - uni.showToast({ - title: '线索标题必填', - icon: 'none' - }) - return false - } - //学生姓名 - if(!data.student_name){ + //线索 + if(!data.sales_id){ uni.showToast({ - title: '学生姓名必填', + title: '线索必填', icon: 'none' }) return false } - //年龄 - if(!data.age){ + //跟进人员 + if(!data.staff_id){ uni.showToast({ - title: '年龄必填', + title: '跟进人员必填', icon: 'none' }) return false } - //性别 - if(!data.sex){ + //跟进时间标题 + if(!data.follow_up_time){ uni.showToast({ - title: '性别必填', + title: '跟进时间必填', icon: 'none' }) return false } - //电话 - if(!data.student_phone){ + //需求标题 + if(!data.requirement){ uni.showToast({ - title: '电话必填', + title: '需求必填', icon: 'none' }) return false } + //##### 跟进 ##### - if(data.is_follow == 1){ + if(data.is_warn == 1){ //跟进类型 if(!data.entry_type){ uni.showToast({ @@ -708,7 +710,7 @@ export default { return false } //跟进人员 - if(!data.staff_id){ + if(!data.follow_staff_id){ uni.showToast({ title: '跟进人员必填', icon: 'none' @@ -716,7 +718,7 @@ export default { return false } //跟进时间 - if(!data.follow_up_time){ + if(!data.reminder_time){ uni.showToast({ title: '跟进时间必填', icon: 'none' @@ -743,7 +745,7 @@ export default { } this.is_submit = false - let res = await marketApi.setSales(data) + let res = await marketApi.createFollow(data) this.is_submit = true @@ -875,37 +877,38 @@ export default { break; //购买力 case 'purchasing_power': - this.str_source_channel = e.text//选中的text值 - this.formData.source_channel = e.value//选中value值 + this.str_purchasing_power = e.text//选中的text值 + this.formData.purchasing_power = e.value//选中value值 break; //认知理念 case 'cognitive_concept': - this.str_source_channel = e.text//选中的text值 - this.formData.source_channel = e.value//选中value值 + this.str_cognitive_concept = e.text//选中的text值 + this.formData.cognitive_concept = e.value//选中value值 break; //情感粘度 case 'emotional_intensity': - this.str_source_channel = e.text//选中的text值 - this.formData.source_channel = e.value//选中value值 + this.str_emotional_intensity = e.text//选中的text值 + this.formData.emotional_intensity = e.value//选中value值 break; //意向分类 case 'initial_customer_intent': - this.show_date = true + this.str_initial_customer_intent = e.text//选中的text值 + this.formData.initial_customer_intent = e.value//选中value值 break; //意向度 case 'initial_relationship_intent': - this.str_source_channel = e.text//选中的text值 - this.formData.source_channel = e.value//选中value值 + this.str_initial_relationship_intent = e.text//选中的text值 + this.formData.initial_relationship_intent = e.value//选中value值 break; //跟进类型 case 'entry_type': - this.str_source_channel = e.text//选中的text值 - this.formData.source_channel = e.value//选中value值 + this.str_entry_type = e.text//选中的text值 + this.formData.entry_type = e.value//选中value值 break; //跟进人员 case 'follow_staff_id': - this.str_source_channel = e.text//选中的text值 - this.formData.source_channel = e.value//选中value值 + this.str_follow_staff_id = e.text//选中的text值 + this.formData.follow_staff_id = e.value//选中value值 break; } }, @@ -947,6 +950,23 @@ export default { this.show_date = false }, + + //监听-转交跟进任务 + switchChange(e){ + console.log('监听-转交跟进任务',e) + let val = e.detail.value + if(val){ + this.formData.is_warn = 1//是否提醒 1提醒 2不提醒 + }else{ + this.formData.is_warn = 2//是否提醒 1提醒 2不提醒 + + this.formData.entry_type = ''//-跟进类型 + this.formData.follow_staff_id = ''//-跟进人员 + this.formData.reminder_time = ''//-跟进时间 + this.formData.follow_content = ''//-备注 + } + } + } }