Browse Source

refactor(market): 重构线索跟进页面

- 添加了页面标题注释
- 优化了表单数据结构,明确了各个字段的用途
- 重新组织了下拉选择器和时间选择器的逻辑
- 移除了未使用的代码和冗余的数据
-调整了页面布局和样式
master
liutong 1 year ago
parent
commit
7768348531
  1. 343
      pages/market/clue/writing_followUp.vue

343
pages/market/clue/writing_followUp.vue

@ -1,3 +1,4 @@
<!--添加跟进-->
<template>
<view class="assemble">
<view class="form-style">
@ -132,13 +133,13 @@
<fui-button background="#434544" color="#24BA9F" borderColor="#24BA9F" @click="submit">保存</fui-button>
</view>
<!-- 年月日-选择时间 -->
<fui-date-picker :show="show_date" type="3" @change="change_date" @cancel="cancel_date"></fui-date-picker>
<!-- 选择器 -->
<fui-picker :linkage='linkage' :options="options" :layer="1" :show="show" @change="change"
<!-- 下拉选择器 -->
<fui-picker :linkage='linkage' :options="options" :layer="1" :show="show" @change="changeOptions"
@cancel="cancel"></fui-picker>
</view>
</template>
@ -154,105 +155,78 @@ const rules = [{
export default {
data() {
return {
switchChange_type: 1,
rules,
show_date: false,
result_date: '',
result_leixing: '',
result_student: '',
result_status: '',
result_intention: '',
result_dates: '',
result_renwu: '',
result_fangshi: '',
show: false,
options: [],
linkage: true,
options_type: undefined,
options_leixing: [],//跟进类型
options_student: [{
'value': 1,
'text': '张三'
}, {
'value': 2,
'text': '李四'
}, {
'value': 3,
'text': '王五'
}],
options_status: [{
'value': 1,
'text': '状态1'
}, {
'value': 2,
'text': '状态2'
}, {
'value': 3,
'text': '状态3'
}],
options_intention: [{
'value': 1,
'text': '张三1'
}, {
'value': 2,
'text': '李四2'
}, {
'value': 3,
'text': '王五3'
}],
options_kehu: [{
'value': 1,
'text': '张三'
}, {
'value': 2,
'text': '李四'
}, {
'value': 3,
'text': '王五'
}],
options_renwu: [{
'value': 1,
'text': '是'
}, {
'value': 2,
'text': '否'
}],
options_fangshi: [{
'value': 1,
'text': '短信'
}, {
'value': 2,
'text': '微信'
}],
follow_up_type: [],//跟进类型
signing_intention_contact: [],//跟进类型
follow_up_personnel: [],//跟进人员
reminder_method: [],//提醒方式
//表单数据
formData:{
//##### 基础表单 #####
sales_id:'',//选择线索(线索id)
entry_type:'',//跟进类型(1=市场人员录入的,2=销售人员录入)
staff_id:'',//跟进人员
follow_up_time:'',//跟进时间(2025-03-20 16:04:50)
requirement:'',//需求
purchasing_power:'',//购买力(1=低,2=中,3=高)
cognitive_concept:'',//认知理念|1=低,2=中,3=高
schooltime:'',//可选上课时间(2025-03-20 16:04:50)
distance:'',//距离
decision_maker:'',//决策人
emotional_intensity:'',//情感粘度|1=低,2=中,3=高
//##### 初步意向 #####
initial_customer_intent:'',//意向分类(客户初步意向度|A+,A,A-,B+B,B-,C)
initial_relationship_intent:'',//意向度(客情初步意向度|A,B,C)
follow_up_content:'',//备注
//##### 跟进任务 #####
is_warn:'1',//是否转角跟进任务(是否提醒 1提醒 2不提醒)
//跟进类型
//跟进时间
audio_upload:''//上传录音(单文件)
follow_staff_id:'',//跟进人员
reminder_time:'',//跟进时间
follow_content:'',//备注
},
//下拉选择器组件
options_type: undefined,//选择器标识
show: false,//是否显示下拉选择器
linkage: true,//是否联动选择
options: [],//下拉选择器可选值列表
//时间选择器相关
show_date: false,//是否显示时间选择器|true=是,false=否
//选择线索-相关
//字典-
//文本展示-
//-相关
//字典-
//文本展示-
//-相关
//字典-
//文本展示-
//-相关
//字典-
//文本展示-
//-相关
//字典-
//文本展示-
//-相关
//字典-
//文本展示-
//-相关
//字典-
//文本展示-
//-相关
//字典-
//文本展示-
//跟进内容
//学员名称
//客户状态(字典单选)
//签单意向联系人(员工id)
//####跟进任务####
//创建下次跟进任务
//跟进时间
//跟进内容
//跟进人员
//任务提醒方式
},
}
},
onLoad(options) {
@ -265,12 +239,8 @@ export default {
//初始化
async init() {
this.getDicFollow_up_type()//获取字典-跟进类型
this.getDicReminder_method()//获取字典-提醒方式
this.getSigning_intention_contact()//获取签单意向联系人
this.getFollow_up_personnel()//获取跟进人员
},
//获取字段-跟进类型
//获取字典-跟进类型
async getDicFollow_up_type() {
let key = 'follow_up_type'
let res = await commonApi.getDictionary(key)
@ -291,130 +261,103 @@ export default {
})
})
},
//获取字典-提醒方式
async getDicReminder_method() {
let key = 'reminder_method'
let res = await commonApi.getDictionary(key)
if (res.code != 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.reminder_method = res.data.dictionary
},
//获取签单意向联系人
async getSigning_intention_contact() {
//验证表单
async validatorForm(data) {
},
//获取跟进人员
async getFollow_up_personnel() {
//提交表单
async submit() {
},
submit() {
console.log(this.formData)
this.$refs.form.validator(null, null, true).then(res => {
console.log(res)
if (res.isPassed) {
console.log('校验通过!')
} else {
console.log('向上滑动页面查看错误提示!')
}
}).catch(err => {
console.log(err)
})
},
//选择弹窗
selectCon(type) {
if (type == 1) {
//选择跟进时间
this.options_date_type = 1
this.show_date = true
} else if (type == 2) {
//跟进类型
this.options_type = 2
this.options = this.options_leixing
this.show = true
this.linkage = true
} else if (type == 3) {
this.options_type = 3
this.options = this.options_student
this.options_type = type
switch (type) {
//来源渠道
case 'source_channel':
this.options = this.options_source_channel
this.show = true
this.linkage = true
} else if (type == 4) {
this.options_type = 4
this.options = this.options_status
break;
//客户来源
case 'customer_source':
this.options = this.options_customer_source
this.show = true
this.linkage = true
} else if (type == 5) {
this.options_type = 5
this.options = this.options_intention
break;
//顾问
case 'add_staff_id':
this.options = this.options_add_staff_id
this.show = true
this.linkage = true
} else if (type == 6) {
//选择跟进时间
this.options_date_type = 6
this.show_date = true
} else if (type == 7) {
//选择任务提醒
this.options_type = 7
this.options = this.options_renwu
break;
// 跟进类型
case 'entry_type':
this.options = this.options_entry_type
this.show = true
this.linkage = true
} else if (type == 8) {
//选择提醒方式
this.options_type = 8
this.options = this.options_fangshi
break;
// 跟进人员
case 'staff_id':
this.options = this.options_staff_id
this.show = true
this.linkage = true
break;
//跟进时间
case 'follow_up_time':
this.show_date = true
break;
}
},
//选择跟进时间
//监听-下拉选择框
changeOptions(e) {
console.log('选择器选中',e)
this.show = false
let type = this.options_type
switch (type) {
//来源渠道
case 'source_channel':
this.str_source_channel = e.text//选中的text值
this.formData.source_channel = e.value//选中value值
break;
//客户来源
case 'customer_source':
this.str_customer_source = e.text//选中的text值
this.formData.customer_source = e.value//选中value值
break;
//顾问
case 'add_staff_id':
this.str_add_staff_id = e.text//选中的text值
this.formData.add_staff_id = e.value//选中value值
break;
// 跟进类型
case 'entry_type':
this.str_entry_type = e.text//选中的text值
this.formData.entry_type = e.value//选中value值
break;
// 跟进人员
case 'staff_id':
this.str_staff_id = e.text//选中的text值
this.formData.staff_id = e.value//选中value值
break;
//跟进时间
case 'follow_up_time':
break;
}
},
//监听-时间选择器
change_date(e) {
if (this.options_date_type == 1) {
this.show_date = false
this.result_date = e.result ?? ''
} else if (this.options_date_type == 6) {
//跟进时间
this.show_date = false
this.result_dates = e.result ?? ''
}
this.formData.follow_up_time = e.result ?? ''
},
//关闭选择跟进时间
//关闭时间选择器
cancel_date() {
this.show_date = false
},
//选择框
change(e) {
this.show = false
console.log(e)
if (this.options_type == 2) {
this.result_leixing = e.result
} else if (this.options_type == 3) {
this.result_student = e.result
} else if (this.options_type == 4) {
this.result_status = e.result
} else if (this.options_type == 5) {
this.result_intention = e.result
} else if (this.options_type == 7) {
this.result_renwu = e.result
} else if (this.options_type == 8) {
this.result_fangshi = e.result
}
},
//关闭选择框
cancel() {
this.show = false
},
//开关选择
switchChange(e) {
if (e.detail.value) {
this.switchChange_type = 1
} else {
this.switchChange_type = 2
}
}
}
}
</script>

Loading…
Cancel
Save