Browse Source

feat(market): 新增线索跟进功能

- 添加线索跟进相关的表单字段和验证逻辑
- 实现线索跟进的提交功能,包括防止重复提交
- 优化选择框和日期选择器的使用- 修复了一些小问题
master
liutong 12 months ago
parent
commit
6d28f20fa5
  1. 230
      pages/market/clue/writing_followUp.vue

230
pages/market/clue/writing_followUp.vue

@ -359,6 +359,9 @@ export default {
data() {
return {
rules,
is_submit: true,//()|true=,false=
//
formData:{
//##### #####
@ -651,11 +654,116 @@ export default {
}
},
//
//
async validatorForm(data) {
//线
if(!data.title){
uni.showToast({
title: '线索标题必填',
icon: 'none'
})
return false
}
//
if(!data.student_name){
uni.showToast({
title: '学生姓名必填',
icon: 'none'
})
return false
}
//
if(!data.age){
uni.showToast({
title: '年龄必填',
icon: 'none'
})
return false
}
//
if(!data.sex){
uni.showToast({
title: '性别必填',
icon: 'none'
})
return false
}
//
if(!data.student_phone){
uni.showToast({
title: '电话必填',
icon: 'none'
})
return false
}
//##### #####
if(data.is_follow == 1){
//
if(!data.entry_type){
uni.showToast({
title: '跟进类型必填',
icon: 'none'
})
return false
}
//
if(!data.staff_id){
uni.showToast({
title: '跟进人员必填',
icon: 'none'
})
return false
}
//
if(!data.follow_up_time){
uni.showToast({
title: '跟进时间必填',
icon: 'none'
})
return false
}
}
return true
},
//
//
async submit() {
console.log('提交',this.formData)
let data = {...this.formData}
//
let validatorForm = await this.validatorForm(data)
console.log('验证结果',validatorForm)
if(!validatorForm){
return
}
//
if (!this.is_submit) {
return
}
this.is_submit = false
let res = await marketApi.setSales(data)
this.is_submit = true
if(res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
uni.showToast({
title: res.msg,
icon: 'success'
})
//1s
setTimeout(() => {
//-线
uni.navigateTo({
url: `/pages/market/clue/index`
})
}, 1000)
},
@ -663,38 +771,62 @@ export default {
selectCon(type) {
this.options_type = type
switch (type) {
//
case 'source_channel':
//线
case 'sales_id':
this.options = this.options_source_channel
this.show = true
this.linkage = true
break;
//
case 'customer_source':
//
case 'staff_id':
this.options = this.options_customer_source
this.show = true
this.linkage = true
break;
//
case 'add_staff_id':
//
case 'follow_up_time':
this.options = this.options_add_staff_id
this.show = true
this.linkage = true
break;
//
case 'entry_type':
//
case 'purchasing_power':
this.options = this.options_entry_type
this.show = true
this.linkage = true
break;
//
case 'staff_id':
//
case 'cognitive_concept':
this.options = this.options_staff_id
this.show = true
this.linkage = true
break;
//
case 'follow_up_time':
//
case 'schooltime':
this.show_date = true
break;
//
case 'emotional_intensity':
this.show_date = true
break;
//
case 'initial_customer_intent':
this.show_date = true
break;
//
case 'initial_relationship_intent':
this.show_date = true
break;
//
case 'entry_type':
this.show_date = true
break;
//
case 'follow_staff_id':
this.show_date = true
break;
//-()
case 'reminder_time':
this.show_date = true
break;
}
@ -710,28 +842,64 @@ export default {
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
//线
case 'sales_id':
this.str_source_channel = e.text//text
this.formData.source_channel = e.value//value
break;
//
//
case 'staff_id':
this.str_staff_id = e.text//text
this.formData.staff_id = e.value//value
this.str_source_channel = e.text//text
this.formData.source_channel = e.value//value
break;
//
case 'follow_up_time':
this.str_source_channel = e.text//text
this.formData.source_channel = e.value//value
break;
//
case 'purchasing_power':
this.str_source_channel = e.text//text
this.formData.source_channel = e.value//value
break;
//
case 'cognitive_concept':
this.str_source_channel = e.text//text
this.formData.source_channel = e.value//value
break;
//
case 'schooltime':
this.str_source_channel = e.text//text
this.formData.source_channel = e.value//value
break;
//
case 'emotional_intensity':
this.str_source_channel = e.text//text
this.formData.source_channel = e.value//value
break;
//
case 'initial_customer_intent':
this.show_date = true
break;
//
case 'initial_relationship_intent':
this.str_source_channel = e.text//text
this.formData.source_channel = e.value//value
break;
//
case 'entry_type':
this.str_source_channel = e.text//text
this.formData.source_channel = e.value//value
break;
//
case 'follow_staff_id':
this.str_source_channel = e.text//text
this.formData.source_channel = e.value//value
break;
//-()
case 'reminder_time':
this.str_source_channel = e.text//text
this.formData.source_channel = e.value//value
break;
}
},

Loading…
Cancel
Save