|
|
@ -45,13 +45,13 @@ |
|
|
</view> |
|
|
</view> |
|
|
</fui-form-item> |
|
|
</fui-form-item> |
|
|
<!-- 来源渠道 --> |
|
|
<!-- 来源渠道 --> |
|
|
<fui-form-item |
|
|
<fui-form-item |
|
|
v-if="formData.source == 1" |
|
|
v-if="formData.source == 1" |
|
|
label="来源渠道" |
|
|
label="来源渠道" |
|
|
labelSize='26' |
|
|
labelSize='26' |
|
|
prop="source_channel" |
|
|
prop="source_channel" |
|
|
background='#434544' |
|
|
background='#434544' |
|
|
labelColor='#fff' |
|
|
labelColor='#fff' |
|
|
:bottomBorder='false'> |
|
|
:bottomBorder='false'> |
|
|
<view class="input-title" style="margin-right:14rpx;"> |
|
|
<view class="input-title" style="margin-right:14rpx;"> |
|
|
<view class="input-title" style="margin-right:14rpx;" @click="openCicker('source_channel')"> |
|
|
<view class="input-title" style="margin-right:14rpx;" @click="openCicker('source_channel')"> |
|
|
@ -172,7 +172,7 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</fui-form-item> --> |
|
|
</fui-form-item> --> |
|
|
|
|
|
|
|
|
<fui-form-item labelWidth="240" label="2、承诺到访时间" labelSize='26' prop="promised_visit_time" background='#434544' labelColor='#fff' :bottomBorder='false'> |
|
|
<fui-form-item labelWidth="240" label="2、承诺到访时间" labelSize='26' prop="promised_visit_time" background='#434544' labelColor='#fff' :bottomBorder='false'> |
|
|
<view class="input-title" style="margin-right:14rpx;"> |
|
|
<view class="input-title" style="margin-right:14rpx;"> |
|
|
<fui-input :borderBottom="false" :padding="[0]" placeholder="填写承诺到访时间" v-model="formData.promised_visit_time" backgroundColor="#434544" size="26" color="#fff" ></fui-input> |
|
|
<fui-input :borderBottom="false" :padding="[0]" placeholder="填写承诺到访时间" v-model="formData.promised_visit_time" backgroundColor="#434544" size="26" color="#fff" ></fui-input> |
|
|
@ -223,7 +223,7 @@ |
|
|
</fui-radio-group> |
|
|
</fui-radio-group> |
|
|
</view> |
|
|
</view> |
|
|
</fui-form-item> |
|
|
</fui-form-item> |
|
|
|
|
|
|
|
|
<!-- 沟通备注 --> |
|
|
<!-- 沟通备注 --> |
|
|
<fui-form-item label="沟通备注" labelSize='26' prop="communication" background='#434544' labelColor='#fff' :bottomBorder='false'> |
|
|
<fui-form-item label="沟通备注" labelSize='26' prop="communication" background='#434544' labelColor='#fff' :bottomBorder='false'> |
|
|
<view class="input-title" style="margin-right:14rpx;"> |
|
|
<view class="input-title" style="margin-right:14rpx;"> |
|
|
@ -255,7 +255,7 @@ |
|
|
<fui-textarea v-model="formData.first_visit_status" placeholder="点击填写" backgroundColor="#434544" size="26" color="#fff" :textareaBorder="false" :isCounter="true" :maxlength="500" :minHeight="120" :isAutoHeight="true" :borderTop="false"></fui-textarea> |
|
|
<fui-textarea v-model="formData.first_visit_status" placeholder="点击填写" backgroundColor="#434544" size="26" color="#fff" :textareaBorder="false" :isCounter="true" :maxlength="500" :minHeight="120" :isAutoHeight="true" :borderTop="false"></fui-textarea> |
|
|
</view> |
|
|
</view> |
|
|
</fui-form-item> |
|
|
</fui-form-item> |
|
|
|
|
|
|
|
|
<!-- 二访时间 --> |
|
|
<!-- 二访时间 --> |
|
|
<fui-form-item label="二访时间" labelSize='26' prop="second_visit_time" background='#434544' labelColor='#fff' :bottomBorder='false'> |
|
|
<fui-form-item label="二访时间" labelSize='26' prop="second_visit_time" background='#434544' labelColor='#fff' :bottomBorder='false'> |
|
|
<view class="input-title" style="margin-right:14rpx;" @click="openDate('second_visit_time')"> |
|
|
<view class="input-title" style="margin-right:14rpx;" @click="openDate('second_visit_time')"> |
|
|
@ -268,13 +268,13 @@ |
|
|
<fui-textarea v-model="formData.second_visit_status" placeholder="点击填写" backgroundColor="#434544" size="26" color="#fff" :textareaBorder="false" :isCounter="true" :maxlength="500" :minHeight="120" :isAutoHeight="true" :borderTop="false"></fui-textarea> |
|
|
<fui-textarea v-model="formData.second_visit_status" placeholder="点击填写" backgroundColor="#434544" size="26" color="#fff" :textareaBorder="false" :isCounter="true" :maxlength="500" :minHeight="120" :isAutoHeight="true" :borderTop="false"></fui-textarea> |
|
|
</view> |
|
|
</view> |
|
|
</fui-form-item> |
|
|
</fui-form-item> |
|
|
|
|
|
|
|
|
<fui-form-item label="追单标注" labelSize='26' prop="chasing_orders" background='#434544' labelColor='#fff' :bottomBorder='false'> |
|
|
<fui-form-item label="追单标注" labelSize='26' prop="chasing_orders" background='#434544' labelColor='#fff' :bottomBorder='false'> |
|
|
<view class="textarea-container"> |
|
|
<view class="textarea-container"> |
|
|
<fui-textarea v-model="formData.chasing_orders" placeholder="点击填写" backgroundColor="#434544" size="26" color="#fff" :textareaBorder="false" :isCounter="true" :maxlength="500" :minHeight="120" :isAutoHeight="true" :borderTop="false"></fui-textarea> |
|
|
<fui-textarea v-model="formData.chasing_orders" placeholder="点击填写" backgroundColor="#434544" size="26" color="#fff" :textareaBorder="false" :isCounter="true" :maxlength="500" :minHeight="120" :isAutoHeight="true" :borderTop="false"></fui-textarea> |
|
|
</view> |
|
|
</view> |
|
|
</fui-form-item> |
|
|
</fui-form-item> |
|
|
|
|
|
|
|
|
<fui-form-item label="是否报名" labelSize='26' prop="is_bm" background='#434544' labelColor='#fff' :bottomBorder='false'> |
|
|
<fui-form-item label="是否报名" labelSize='26' prop="is_bm" background='#434544' labelColor='#fff' :bottomBorder='false'> |
|
|
<view class="input-title" style="margin-right:14rpx;"> |
|
|
<view class="input-title" style="margin-right:14rpx;"> |
|
|
<fui-radio-group name="radio" v-model="formData.is_bm" :disabled="true"> |
|
|
<fui-radio-group name="radio" v-model="formData.is_bm" :disabled="true"> |
|
|
@ -295,7 +295,7 @@ |
|
|
</fui-radio-group> |
|
|
</fui-radio-group> |
|
|
</view> |
|
|
</view> |
|
|
</fui-form-item> |
|
|
</fui-form-item> |
|
|
|
|
|
|
|
|
<!-- 面咨备注 --> |
|
|
<!-- 面咨备注 --> |
|
|
<fui-form-item label="面咨备注" labelSize='26' prop="consultation_remark" background='#434544' labelColor='#fff' :bottomBorder='false'> |
|
|
<fui-form-item label="面咨备注" labelSize='26' prop="consultation_remark" background='#434544' labelColor='#fff' :bottomBorder='false'> |
|
|
<view class="textarea-container"> |
|
|
<view class="textarea-container"> |
|
|
@ -313,10 +313,10 @@ |
|
|
|
|
|
|
|
|
<!-- 选择器、日期选择等控件保留原有 --> |
|
|
<!-- 选择器、日期选择等控件保留原有 --> |
|
|
<fui-date-picker :show="date_picker_show" type="5" @change="change_date" @cancel="cancel_date" :value="default_date_value"></fui-date-picker> |
|
|
<fui-date-picker :show="date_picker_show" type="5" @change="change_date" @cancel="cancel_date" :value="default_date_value"></fui-date-picker> |
|
|
|
|
|
|
|
|
<!-- 日期时间选择器 --> |
|
|
<!-- 日期时间选择器 --> |
|
|
<fui-date-picker :show="datetime_picker_show" type="5" @change="change_datetime" @cancel="cancel_datetime" :value="default_datetime_value"></fui-date-picker> |
|
|
<fui-date-picker :show="datetime_picker_show" type="5" @change="change_datetime" @cancel="cancel_datetime" :value="default_datetime_value"></fui-date-picker> |
|
|
|
|
|
|
|
|
<fui-picker :linkage='picker_linkage' :options="picker_options" :layer="1" :show="picker_show" @change="changeCicker" @cancel="cancelCicker"></fui-picker> |
|
|
<fui-picker :linkage='picker_linkage' :options="picker_options" :layer="1" :show="picker_show" @change="changeCicker" @cancel="cancelCicker"></fui-picker> |
|
|
|
|
|
|
|
|
<!-- 快速填写弹窗 --> |
|
|
<!-- 快速填写弹窗 --> |
|
|
@ -333,8 +333,8 @@ |
|
|
<text>请粘贴包含客户信息的文本,支持格式:</text> |
|
|
<text>请粘贴包含客户信息的文本,支持格式:</text> |
|
|
<text>姓名:张三,电话:13800138000,校区:测试校区</text> |
|
|
<text>姓名:张三,电话:13800138000,校区:测试校区</text> |
|
|
</view> |
|
|
</view> |
|
|
<textarea |
|
|
<textarea |
|
|
class="quick-fill-textarea" |
|
|
class="quick-fill-textarea" |
|
|
placeholder="请粘贴客户信息文本..." |
|
|
placeholder="请粘贴客户信息文本..." |
|
|
v-model="quickFillText" |
|
|
v-model="quickFillText" |
|
|
:maxlength="1000" |
|
|
:maxlength="1000" |
|
|
@ -362,11 +362,11 @@ |
|
|
is_submit: true, //是否提交(防止重复提交)|true=可提交,false=不可提交 |
|
|
is_submit: true, //是否提交(防止重复提交)|true=可提交,false=不可提交 |
|
|
|
|
|
|
|
|
resource_sharing_id: '', //resource_sharing_id(资源共享表id) |
|
|
resource_sharing_id: '', //resource_sharing_id(资源共享表id) |
|
|
|
|
|
|
|
|
// 快速填写相关 |
|
|
// 快速填写相关 |
|
|
showQuickFill: false, // 是否显示快速填写弹窗 |
|
|
showQuickFill: false, // 是否显示快速填写弹窗 |
|
|
quickFillText: '', // 快速填写文本内容 |
|
|
quickFillText: '', // 快速填写文本内容 |
|
|
|
|
|
|
|
|
//表单 |
|
|
//表单 |
|
|
formData: { |
|
|
formData: { |
|
|
// 客户基础信息 |
|
|
// 客户基础信息 |
|
|
@ -489,7 +489,7 @@ |
|
|
data_picker_input_name: '', //时间组件的input_name |
|
|
data_picker_input_name: '', //时间组件的input_name |
|
|
date_picker_show: false, //时间选择器是否展示 |
|
|
date_picker_show: false, //时间选择器是否展示 |
|
|
default_date_value: '', // 添加默认日期值 |
|
|
default_date_value: '', // 添加默认日期值 |
|
|
|
|
|
|
|
|
// 日期时间选择组件 |
|
|
// 日期时间选择组件 |
|
|
datetime_picker_input_name: '', //日期时间组件的input_name |
|
|
datetime_picker_input_name: '', //日期时间组件的input_name |
|
|
datetime_picker_show: false, //日期时间选择器是否展示 |
|
|
datetime_picker_show: false, //日期时间选择器是否展示 |
|
|
@ -497,7 +497,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查重相关 |
|
|
// 查重相关 |
|
|
clientUserList: [], //查重用户列表 |
|
|
clientUserList: [], //查重用户列表 |
|
|
showDuplicateCheck: false, //是否显示查重弹出层 |
|
|
showDuplicateCheck: false, //是否显示查重弹出层 |
|
|
|
|
|
|
|
|
@ -520,14 +520,14 @@ |
|
|
}, |
|
|
}, |
|
|
onLoad(options) { |
|
|
onLoad(options) { |
|
|
console.log('onLoad - 接收到参数:', options); |
|
|
console.log('onLoad - 接收到参数:', options); |
|
|
|
|
|
|
|
|
// 检查参数是否存在 |
|
|
// 检查参数是否存在 |
|
|
if (!options) { |
|
|
if (!options) { |
|
|
console.error('onLoad - 未接收到任何参数'); |
|
|
console.error('onLoad - 未接收到任何参数'); |
|
|
this.showParameterError(); |
|
|
this.showParameterError(); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 检查 resource_sharing_id 参数,支持多种参数名称 |
|
|
// 检查 resource_sharing_id 参数,支持多种参数名称 |
|
|
const resourceSharingId = options.resource_sharing_id || options.id || options.resourceSharingId; |
|
|
const resourceSharingId = options.resource_sharing_id || options.id || options.resourceSharingId; |
|
|
if (!resourceSharingId) { |
|
|
if (!resourceSharingId) { |
|
|
@ -536,7 +536,7 @@ |
|
|
this.showParameterError(); |
|
|
this.showParameterError(); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.resource_sharing_id = String(resourceSharingId); |
|
|
this.resource_sharing_id = String(resourceSharingId); |
|
|
console.log('onLoad - 成功设置 resource_sharing_id:', this.resource_sharing_id); |
|
|
console.log('onLoad - 成功设置 resource_sharing_id:', this.resource_sharing_id); |
|
|
}, |
|
|
}, |
|
|
@ -556,39 +556,39 @@ |
|
|
uni.navigateBack(); |
|
|
uni.navigateBack(); |
|
|
}, 2000); |
|
|
}, 2000); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//初始化 |
|
|
//初始化 |
|
|
async init() { |
|
|
async init() { |
|
|
try { |
|
|
try { |
|
|
console.log('init - 开始初始化流程'); |
|
|
console.log('init - 开始初始化流程'); |
|
|
|
|
|
|
|
|
if (!this.resource_sharing_id) { |
|
|
if (!this.resource_sharing_id) { |
|
|
console.error('init - resource_sharing_id 为空,无法初始化'); |
|
|
console.error('init - resource_sharing_id 为空,无法初始化'); |
|
|
this.showParameterError(); |
|
|
this.showParameterError(); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: '加载中...', |
|
|
title: '加载中...', |
|
|
mask: true |
|
|
mask: true |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
console.log('init - 开始加载字典数据'); |
|
|
console.log('init - 开始加载字典数据'); |
|
|
|
|
|
|
|
|
// 批量加载所有字典数据 |
|
|
// 批量加载所有字典数据 |
|
|
await this.getBatchDictData(); |
|
|
await this.getBatchDictData(); |
|
|
console.log('init - 字典数据加载完成'); |
|
|
console.log('init - 字典数据加载完成'); |
|
|
|
|
|
|
|
|
// 加载校区列表 |
|
|
// 加载校区列表 |
|
|
console.log('init - 开始加载校区列表'); |
|
|
console.log('init - 开始加载校区列表'); |
|
|
await this.get_campus_list(); |
|
|
await this.get_campus_list(); |
|
|
console.log('init - 校区列表加载完成'); |
|
|
console.log('init - 校区列表加载完成'); |
|
|
|
|
|
|
|
|
// 获取资源共享详情并回显数据 |
|
|
// 获取资源共享详情并回显数据 |
|
|
console.log('init - 开始获取客户详情'); |
|
|
console.log('init - 开始获取客户详情'); |
|
|
await this.getInfo(); |
|
|
await this.getInfo(); |
|
|
console.log('init - 客户详情获取完成'); |
|
|
console.log('init - 客户详情获取完成'); |
|
|
|
|
|
|
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error('初始化失败:', error); |
|
|
console.error('初始化失败:', error); |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
@ -599,7 +599,7 @@ |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 批量获取字典数据 |
|
|
// 批量获取字典数据 |
|
|
async getBatchDictData() { |
|
|
async getBatchDictData() { |
|
|
const dictMapping = { |
|
|
const dictMapping = { |
|
|
@ -613,7 +613,7 @@ |
|
|
'distance': 'distance', |
|
|
'distance': 'distance', |
|
|
'emotional_stickiness_score': 'emotional_stickiness_score' |
|
|
'emotional_stickiness_score': 'emotional_stickiness_score' |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
const batchResult = await apiRoute.common_getBatchDict(Object.keys(dictMapping)); |
|
|
const batchResult = await apiRoute.common_getBatchDict(Object.keys(dictMapping)); |
|
|
if (batchResult?.code === 1 && batchResult.data) { |
|
|
if (batchResult?.code === 1 && batchResult.data) { |
|
|
@ -627,11 +627,11 @@ |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error('批量字典接口失败:', error); |
|
|
console.error('批量字典接口失败:', error); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 回退到单个获取 |
|
|
// 回退到单个获取 |
|
|
const priorityKeys = ['source_channel', 'source']; |
|
|
const priorityKeys = ['source_channel', 'source']; |
|
|
const otherKeys = ['purchasing_power', 'initial_intent', 'cognitive_idea', 'status', 'decision_maker', 'distance', 'emotional_stickiness_score']; |
|
|
const otherKeys = ['purchasing_power', 'initial_intent', 'cognitive_idea', 'status', 'decision_maker', 'distance', 'emotional_stickiness_score']; |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
await Promise.all(priorityKeys.map(key => this.getDict(key))); |
|
|
await Promise.all(priorityKeys.map(key => this.getDict(key))); |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
@ -645,18 +645,18 @@ |
|
|
// 处理字典数据 |
|
|
// 处理字典数据 |
|
|
processDictData(localKey, dictData) { |
|
|
processDictData(localKey, dictData) { |
|
|
if (!Array.isArray(dictData) || !dictData.length) return; |
|
|
if (!Array.isArray(dictData) || !dictData.length) return; |
|
|
|
|
|
|
|
|
let options = dictData.map(item => ({ text: item.name || '', value: item.value || '' })); |
|
|
let options = dictData.map(item => ({ text: item.name || '', value: item.value || '' })); |
|
|
if (localKey === 'source_channel') { |
|
|
if (localKey === 'source_channel') { |
|
|
options.unshift({ text: '线下', value: '0' }); |
|
|
options.unshift({ text: '线下', value: '0' }); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.picker_config[localKey] = this.picker_config[localKey] || { text: '点击选择' }; |
|
|
this.picker_config[localKey] = this.picker_config[localKey] || { text: '点击选择' }; |
|
|
this.picker_config[localKey].options = options; |
|
|
this.picker_config[localKey].options = options; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async get_campus_list(){ |
|
|
async get_campus_list(){ |
|
|
|
|
|
|
|
|
let res = await apiRoute.common_getCampusesList({}) |
|
|
let res = await apiRoute.common_getCampusesList({}) |
|
|
if (res.code != 1) { |
|
|
if (res.code != 1) { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
@ -665,10 +665,10 @@ |
|
|
}) |
|
|
}) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.campus_list = res.data |
|
|
this.campus_list = res.data |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let arr = [] |
|
|
let arr = [] |
|
|
this.campus_list.forEach((v,k)=>{ |
|
|
this.campus_list.forEach((v,k)=>{ |
|
|
arr.push({ |
|
|
arr.push({ |
|
|
@ -676,29 +676,25 @@ |
|
|
value: v.id, |
|
|
value: v.id, |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
this.picker_config['campus'].options = arr |
|
|
this.picker_config['campus'].options = arr |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//获取资源共享-详情(客户资源详情) |
|
|
//获取资源共享-详情(客户资源详情) |
|
|
async getInfo() { |
|
|
async getInfo() { |
|
|
try { |
|
|
try { |
|
|
console.log('getInfo - 开始获取客户详情, resource_sharing_id:', this.resource_sharing_id); |
|
|
|
|
|
|
|
|
|
|
|
if (!this.resource_sharing_id) { |
|
|
if (!this.resource_sharing_id) { |
|
|
console.error('getInfo - resource_sharing_id 为空,无法获取客户详情'); |
|
|
console.error('getInfo - resource_sharing_id 为空,无法获取客户详情'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
let params = { |
|
|
let params = { |
|
|
resource_sharing_id: this.resource_sharing_id |
|
|
resource_sharing_id: this.resource_sharing_id |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
console.log('getInfo - 发起请求:', params); |
|
|
|
|
|
let res = await apiRoute.xs_resourceSharingInfo(params); //资源共享-详情(客户资源详情) |
|
|
let res = await apiRoute.xs_resourceSharingInfo(params); //资源共享-详情(客户资源详情) |
|
|
console.log('getInfo - 请求响应:', res); |
|
|
|
|
|
|
|
|
|
|
|
if (res.code != 1) { |
|
|
if (res.code != 1) { |
|
|
console.error('getInfo - 请求失败:', res.msg); |
|
|
console.error('getInfo - 请求失败:', res.msg); |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
@ -710,8 +706,6 @@ |
|
|
|
|
|
|
|
|
let customerResource = res.data.customerResource || {}; //客户资源详情 |
|
|
let customerResource = res.data.customerResource || {}; //客户资源详情 |
|
|
let sixSpeed = res.data.customerResource.sixSpeed || {}; //六要素详情 |
|
|
let sixSpeed = res.data.customerResource.sixSpeed || {}; //六要素详情 |
|
|
console.log('getInfo - 客户资源详情:', customerResource); |
|
|
|
|
|
console.log('getInfo - 六要素详情:', sixSpeed); |
|
|
|
|
|
|
|
|
|
|
|
// 存储原始数据,用于后续回显 |
|
|
// 存储原始数据,用于后续回显 |
|
|
this._resourceDetail = res.data; |
|
|
this._resourceDetail = res.data; |
|
|
@ -754,39 +748,40 @@ |
|
|
call_intent: sixSpeed.call_intent || '2', // 是否加微信 |
|
|
call_intent: sixSpeed.call_intent || '2', // 是否加微信 |
|
|
emotional_stickiness_score: sixSpeed.emotional_stickiness_score || '', // 情感粘度 |
|
|
emotional_stickiness_score: sixSpeed.emotional_stickiness_score || '', // 情感粘度 |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
console.log('getInfo - 表单数据设置完成:', this.formData); |
|
|
console.log('getInfo - 表单数据设置完成:',sixSpeed.promised_visit_time); |
|
|
|
|
|
|
|
|
// 格式化日期时间 |
|
|
// 格式化日期时间 |
|
|
if (sixSpeed.promised_visit_time) { |
|
|
// if (sixSpeed.promised_visit_time) { |
|
|
|
|
|
// console.log('getInfo - 开始格式化日期时间',sixSpeed.promised_visit_time.includes(' ')); |
|
|
// 如果包含时间部分,保持原格式;否则只格式化日期部分 |
|
|
// 如果包含时间部分,保持原格式;否则只格式化日期部分 |
|
|
if (sixSpeed.promised_visit_time.includes(' ')) { |
|
|
// if (sixSpeed.promised_visit_time.includes(' ')) { |
|
|
this.formData.promised_visit_time = sixSpeed.promised_visit_time; |
|
|
// this.formData.promised_visit_time = sixSpeed.promised_visit_time; |
|
|
} else { |
|
|
// } else { |
|
|
this.formData.promised_visit_time = this.$util.formatToDateTime(sixSpeed.promised_visit_time, 'Y-m-d'); |
|
|
// this.formData.promised_visit_time = this.$util.formatToDateTime(sixSpeed.promised_visit_time, 'Y-m-d'); |
|
|
} |
|
|
// } |
|
|
} |
|
|
// } |
|
|
|
|
|
|
|
|
// 可选上课时间保持原始文本格式,不做日期格式化 |
|
|
// 可选上课时间保持原始文本格式,不做日期格式化 |
|
|
if (sixSpeed.preferred_class_time) { |
|
|
if (sixSpeed.preferred_class_time) { |
|
|
this.formData.optional_class_time = sixSpeed.preferred_class_time; |
|
|
this.formData.optional_class_time = sixSpeed.preferred_class_time; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (sixSpeed.first_visit_time) { |
|
|
if (sixSpeed.first_visit_time) { |
|
|
this.formData.first_visit_time = this.$util.formatToDateTime(sixSpeed.first_visit_time, 'Y-m-d'); |
|
|
this.formData.first_visit_time = this.$util.formatToDateTime(sixSpeed.first_visit_time, 'Y-m-d'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (sixSpeed.second_visit_time) { |
|
|
if (sixSpeed.second_visit_time) { |
|
|
this.formData.second_visit_time = this.$util.formatToDateTime(sixSpeed.second_visit_time, 'Y-m-d'); |
|
|
this.formData.second_visit_time = this.$util.formatToDateTime(sixSpeed.second_visit_time, 'Y-m-d'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
console.log('getInfo - 日期格式化完成'); |
|
|
console.log('getInfo - 日期格式化完成'); |
|
|
|
|
|
|
|
|
// 设置选择器文本回显 |
|
|
// 设置选择器文本回显 |
|
|
console.log('getInfo - 开始设置选择器文本回显'); |
|
|
console.log('getInfo - 开始设置选择器文本回显'); |
|
|
await this.setPickerText(); |
|
|
await this.setPickerText(); |
|
|
console.log('getInfo - 选择器文本回显完成'); |
|
|
console.log('getInfo - 选择器文本回显完成'); |
|
|
|
|
|
|
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error('获取客户详情失败:', error); |
|
|
console.error('获取客户详情失败:', error); |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
@ -800,7 +795,7 @@ |
|
|
async setPickerText() { |
|
|
async setPickerText() { |
|
|
try { |
|
|
try { |
|
|
const { customerResource = {}, sixSpeed = {} } = await this.getResourceDetail() || {}; |
|
|
const { customerResource = {}, sixSpeed = {} } = await this.getResourceDetail() || {}; |
|
|
|
|
|
|
|
|
// 设置选择器文本回显 |
|
|
// 设置选择器文本回显 |
|
|
this.setPickerTextByValue('source_channel', this.formData.source_channel, customerResource.source_channel_name); |
|
|
this.setPickerTextByValue('source_channel', this.formData.source_channel, customerResource.source_channel_name); |
|
|
this.setPickerTextByValue('source', this.formData.source, customerResource.source_name); |
|
|
this.setPickerTextByValue('source', this.formData.source, customerResource.source_name); |
|
|
@ -810,14 +805,14 @@ |
|
|
this.setPickerTextByValue('decision_maker', this.formData.decision_maker, customerResource.decision_maker_name); |
|
|
this.setPickerTextByValue('decision_maker', this.formData.decision_maker, customerResource.decision_maker_name); |
|
|
this.setPickerTextByValue('campus', this.formData.campus, customerResource.campus_name); |
|
|
this.setPickerTextByValue('campus', this.formData.campus, customerResource.campus_name); |
|
|
this.setPickerTextByValue('customer_type', this.formData.customer_type, customerResource.customer_type_name); |
|
|
this.setPickerTextByValue('customer_type', this.formData.customer_type, customerResource.customer_type_name); |
|
|
|
|
|
|
|
|
// 六要素相关 |
|
|
// 六要素相关 |
|
|
this.setPickerTextByValue('purchasing_power', this.formData.purchasing_power, sixSpeed.purchase_power_name); |
|
|
this.setPickerTextByValue('purchasing_power', this.formData.purchasing_power, sixSpeed.purchase_power_name); |
|
|
this.setPickerTextByValue('cognitive_idea', this.formData.cognitive_idea, sixSpeed.concept_awareness_name); |
|
|
this.setPickerTextByValue('cognitive_idea', this.formData.cognitive_idea, sixSpeed.concept_awareness_name); |
|
|
this.setPickerTextByValue('distance', this.formData.distance, sixSpeed.distance_name); |
|
|
this.setPickerTextByValue('distance', this.formData.distance, sixSpeed.distance_name); |
|
|
this.setPickerTextByValue('emotional_stickiness_score', this.formData.emotional_stickiness_score, sixSpeed.emotional_stickiness_score_name); |
|
|
this.setPickerTextByValue('emotional_stickiness_score', this.formData.emotional_stickiness_score, sixSpeed.emotional_stickiness_score_name); |
|
|
// 不再需要设置call_intent的选择器文本,因为已改为单选组件 |
|
|
// 不再需要设置call_intent的选择器文本,因为已改为单选组件 |
|
|
|
|
|
|
|
|
console.log('选择器文本回显完成'); |
|
|
console.log('选择器文本回显完成'); |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error('设置选择器文本回显失败:', error); |
|
|
console.error('设置选择器文本回显失败:', error); |
|
|
@ -832,12 +827,12 @@ |
|
|
this.picker_config[pickerName].text = '点击选择'; |
|
|
this.picker_config[pickerName].text = '点击选择'; |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 创建映射缓存,避免重复查找 |
|
|
// 创建映射缓存,避免重复查找 |
|
|
if (!this._valueTextMapping) { |
|
|
if (!this._valueTextMapping) { |
|
|
this._valueTextMapping = {}; |
|
|
this._valueTextMapping = {}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 检查缓存 |
|
|
// 检查缓存 |
|
|
const cacheKey = `${pickerName}_${value}`; |
|
|
const cacheKey = `${pickerName}_${value}`; |
|
|
if (this._valueTextMapping[cacheKey]) { |
|
|
if (this._valueTextMapping[cacheKey]) { |
|
|
@ -845,16 +840,16 @@ |
|
|
this.picker_config[pickerName].text = this._valueTextMapping[cacheKey]; |
|
|
this.picker_config[pickerName].text = this._valueTextMapping[cacheKey]; |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 确保 picker_config[pickerName] 存在 |
|
|
// 确保 picker_config[pickerName] 存在 |
|
|
if (!this.picker_config[pickerName]) { |
|
|
if (!this.picker_config[pickerName]) { |
|
|
this.picker_config[pickerName] = { options: [] }; |
|
|
this.picker_config[pickerName] = { options: [] }; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 先尝试从选项中找到匹配的文本 |
|
|
// 先尝试从选项中找到匹配的文本 |
|
|
const options = this.picker_config[pickerName].options || []; |
|
|
const options = this.picker_config[pickerName].options || []; |
|
|
const option = options.find(opt => String(opt.value) === String(value)); |
|
|
const option = options.find(opt => String(opt.value) === String(value)); |
|
|
|
|
|
|
|
|
let textValue; |
|
|
let textValue; |
|
|
if (option) { |
|
|
if (option) { |
|
|
textValue = option.text; |
|
|
textValue = option.text; |
|
|
@ -864,7 +859,7 @@ |
|
|
} else { |
|
|
} else { |
|
|
textValue = '点击选择'; |
|
|
textValue = '点击选择'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 保存到缓存 |
|
|
// 保存到缓存 |
|
|
this._valueTextMapping[cacheKey] = textValue; |
|
|
this._valueTextMapping[cacheKey] = textValue; |
|
|
this.picker_config[pickerName].text = textValue; |
|
|
this.picker_config[pickerName].text = textValue; |
|
|
@ -875,11 +870,11 @@ |
|
|
if (this._resourceDetail) { |
|
|
if (this._resourceDetail) { |
|
|
return this._resourceDetail |
|
|
return this._resourceDetail |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
let params = { |
|
|
let params = { |
|
|
resource_sharing_id: this.resource_sharing_id |
|
|
resource_sharing_id: this.resource_sharing_id |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
let res = await apiRoute.xs_resourceSharingInfo(params) |
|
|
let res = await apiRoute.xs_resourceSharingInfo(params) |
|
|
if (res.code == 1) { |
|
|
if (res.code == 1) { |
|
|
this._resourceDetail = res.data |
|
|
this._resourceDetail = res.data |
|
|
@ -902,14 +897,14 @@ |
|
|
customer_type: 'customer_type', |
|
|
customer_type: 'customer_type', |
|
|
emotional_stickiness_score: 'emotional_stickiness_score' |
|
|
emotional_stickiness_score: 'emotional_stickiness_score' |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const key = keyMap[inputName]; |
|
|
const key = keyMap[inputName]; |
|
|
if (!key) return; |
|
|
if (!key) return; |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
const dictionary = await this.$util.getDict(key); |
|
|
const dictionary = await this.$util.getDict(key); |
|
|
if (!dictionary?.length) return; |
|
|
if (!dictionary?.length) return; |
|
|
|
|
|
|
|
|
this.processDictData(inputName, dictionary); |
|
|
this.processDictData(inputName, dictionary); |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error(`获取字典 ${inputName} 失败:`, error); |
|
|
console.error(`获取字典 ${inputName} 失败:`, error); |
|
|
@ -1000,7 +995,7 @@ |
|
|
this.showQuickFill = true |
|
|
this.showQuickFill = true |
|
|
this.quickFillText = '' |
|
|
this.quickFillText = '' |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 解析快速填写文本 |
|
|
// 解析快速填写文本 |
|
|
parseQuickFillText() { |
|
|
parseQuickFillText() { |
|
|
if (!this.quickFillText.trim()) { |
|
|
if (!this.quickFillText.trim()) { |
|
|
@ -1010,7 +1005,7 @@ |
|
|
}) |
|
|
}) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
// 定义字段映射规则 |
|
|
// 定义字段映射规则 |
|
|
const fieldRules = [ |
|
|
const fieldRules = [ |
|
|
@ -1020,11 +1015,11 @@ |
|
|
{ key: 'age', patterns: ['年龄'] }, |
|
|
{ key: 'age', patterns: ['年龄'] }, |
|
|
{ key: 'birthday', patterns: ['生日', '出生日期', '生日日期'] } |
|
|
{ key: 'birthday', patterns: ['生日', '出生日期', '生日日期'] } |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
// 用于存储解析结果 |
|
|
// 用于存储解析结果 |
|
|
const parsedData = {} |
|
|
const parsedData = {} |
|
|
const text = this.quickFillText.trim() |
|
|
const text = this.quickFillText.trim() |
|
|
|
|
|
|
|
|
// 对每个字段规则进行匹配 |
|
|
// 对每个字段规则进行匹配 |
|
|
fieldRules.forEach(rule => { |
|
|
fieldRules.forEach(rule => { |
|
|
rule.patterns.forEach(pattern => { |
|
|
rule.patterns.forEach(pattern => { |
|
|
@ -1036,9 +1031,9 @@ |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
console.log('解析结果:', parsedData) |
|
|
console.log('解析结果:', parsedData) |
|
|
|
|
|
|
|
|
// 填写到表单中 |
|
|
// 填写到表单中 |
|
|
let fillCount = 0 |
|
|
let fillCount = 0 |
|
|
if (parsedData.name) { |
|
|
if (parsedData.name) { |
|
|
@ -1065,7 +1060,7 @@ |
|
|
this.formData.birthday = parsedData.birthday |
|
|
this.formData.birthday = parsedData.birthday |
|
|
fillCount++ |
|
|
fillCount++ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (fillCount > 0) { |
|
|
if (fillCount > 0) { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: `成功填写${fillCount}个字段`, |
|
|
title: `成功填写${fillCount}个字段`, |
|
|
@ -1078,7 +1073,7 @@ |
|
|
icon: 'none' |
|
|
icon: 'none' |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error('解析失败:', error) |
|
|
console.error('解析失败:', error) |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
@ -1087,14 +1082,14 @@ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 查找并设置校区 |
|
|
// 查找并设置校区 |
|
|
findAndSetCampus(campusText) { |
|
|
findAndSetCampus(campusText) { |
|
|
const campusOptions = this.picker_config.campus?.options || [] |
|
|
const campusOptions = this.picker_config.campus?.options || [] |
|
|
const matchedCampus = campusOptions.find(option => |
|
|
const matchedCampus = campusOptions.find(option => |
|
|
option.text.includes(campusText) || campusText.includes(option.text) |
|
|
option.text.includes(campusText) || campusText.includes(option.text) |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
if (matchedCampus) { |
|
|
if (matchedCampus) { |
|
|
this.formData.campus = matchedCampus.value |
|
|
this.formData.campus = matchedCampus.value |
|
|
this.picker_config.campus.text = matchedCampus.text |
|
|
this.picker_config.campus.text = matchedCampus.text |
|
|
@ -1106,7 +1101,7 @@ |
|
|
// 打开选择器 |
|
|
// 打开选择器 |
|
|
openCicker(inputName, linkage = true) { |
|
|
openCicker(inputName, linkage = true) { |
|
|
const options = this.picker_config[inputName]?.options || []; |
|
|
const options = this.picker_config[inputName]?.options || []; |
|
|
|
|
|
|
|
|
if (!options.length) { |
|
|
if (!options.length) { |
|
|
uni.showToast({ title: '暂无选项', icon: 'none' }); |
|
|
uni.showToast({ title: '暂无选项', icon: 'none' }); |
|
|
return; |
|
|
return; |
|
|
@ -1115,7 +1110,7 @@ |
|
|
this.picker_input_name = inputName; |
|
|
this.picker_input_name = inputName; |
|
|
this.picker_options = options; |
|
|
this.picker_options = options; |
|
|
this.picker_linkage = linkage; |
|
|
this.picker_linkage = linkage; |
|
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
this.picker_show = true; |
|
|
this.picker_show = true; |
|
|
}); |
|
|
}); |
|
|
@ -1124,7 +1119,7 @@ |
|
|
// 处理选择器选择 |
|
|
// 处理选择器选择 |
|
|
changeCicker(e) { |
|
|
changeCicker(e) { |
|
|
const inputName = this.picker_input_name; |
|
|
const inputName = this.picker_input_name; |
|
|
|
|
|
|
|
|
this.updateFormField(inputName, e.value, e.text); |
|
|
this.updateFormField(inputName, e.value, e.text); |
|
|
this.handleSpecialSelectionLogic(inputName, e.value, e.text); |
|
|
this.handleSpecialSelectionLogic(inputName, e.value, e.text); |
|
|
this.cancelCicker(); |
|
|
this.cancelCicker(); |
|
|
@ -1221,7 +1216,7 @@ |
|
|
change_date(e) { |
|
|
change_date(e) { |
|
|
const val = e.result || ''; |
|
|
const val = e.result || ''; |
|
|
const inputName = this.data_picker_input_name; |
|
|
const inputName = this.data_picker_input_name; |
|
|
|
|
|
|
|
|
this.formData[inputName] = val; |
|
|
this.formData[inputName] = val; |
|
|
this.cancel_date(); |
|
|
this.cancel_date(); |
|
|
}, |
|
|
}, |
|
|
@ -1234,9 +1229,9 @@ |
|
|
// 处理日期时间选择 |
|
|
// 处理日期时间选择 |
|
|
change_datetime(e) { |
|
|
change_datetime(e) { |
|
|
console.log('日期时间选择器返回数据:', e); |
|
|
console.log('日期时间选择器返回数据:', e); |
|
|
|
|
|
|
|
|
let val = e.result || e.value || ''; |
|
|
let val = e.result || e.value || ''; |
|
|
|
|
|
|
|
|
// 确保日期时间格式正确 |
|
|
// 确保日期时间格式正确 |
|
|
if (val && typeof val === 'string') { |
|
|
if (val && typeof val === 'string') { |
|
|
// 如果包含时间部分但格式不对,进行格式化 |
|
|
// 如果包含时间部分但格式不对,进行格式化 |
|
|
@ -1251,7 +1246,7 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const inputName = this.datetime_picker_input_name; |
|
|
const inputName = this.datetime_picker_input_name; |
|
|
this.formData[inputName] = val; |
|
|
this.formData[inputName] = val; |
|
|
this.cancel_datetime(); |
|
|
this.cancel_datetime(); |
|
|
@ -1313,13 +1308,13 @@ |
|
|
//提交 |
|
|
//提交 |
|
|
async submit() { |
|
|
async submit() { |
|
|
const data = { ...this.formData }; |
|
|
const data = { ...this.formData }; |
|
|
|
|
|
|
|
|
// 表单验证 |
|
|
// 表单验证 |
|
|
if (!await this.validatorForm(data)) return; |
|
|
if (!await this.validatorForm(data)) return; |
|
|
|
|
|
|
|
|
// 防止重复提交 |
|
|
// 防止重复提交 |
|
|
if (!this.canSubmit()) return; |
|
|
if (!this.canSubmit()) return; |
|
|
|
|
|
|
|
|
this.is_submit = false; |
|
|
this.is_submit = false; |
|
|
try { |
|
|
try { |
|
|
const res = await apiRoute.xs_editCustomerResources(data); |
|
|
const res = await apiRoute.xs_editCustomerResources(data); |
|
|
@ -1340,4 +1335,4 @@ |
|
|
|
|
|
|
|
|
<style lang="less" scoped> |
|
|
<style lang="less" scoped> |
|
|
@import './edit_clues.less'; |
|
|
@import './edit_clues.less'; |
|
|
</style> |
|
|
</style> |
|
|
|