修正,仅剩一个选择星级bug
This commit is contained in:
parent
937a51626f
commit
954ef47dd7
|
|
@ -153,13 +153,14 @@ const loadCustomerDetail = async () => {
|
||||||
wechat: res.wechat ||'',
|
wechat: res.wechat ||'',
|
||||||
source: res.source || '',
|
source: res.source || '',
|
||||||
intents: Array.isArray(res.intents) ? res.intents : (res.intents ? res.intents.split(',') : []),
|
intents: Array.isArray(res.intents) ? res.intents : (res.intents ? res.intents.split(',') : []),
|
||||||
intentLevel: res.intentLevel || res.customerIntentLevel || '',
|
intentLevel: res.intentLevel || '',
|
||||||
customerStatus: res.customerStatus || res.status || '',
|
customerStatus: res.customerStatus || res.status || '',
|
||||||
region: res.region || res.regionName || '',
|
region: res.region || res.regionName || '',
|
||||||
regionIds: (res.regionIds && Array.isArray(res.regionIds) && res.regionIds.length > 0) ? res.regionIds : (res.regionId ? [res.regionId] : []),
|
// 从后端返回的 provinceId, cityId, countyId 构建 regionIds 数组(用于前端显示和选择器)
|
||||||
|
regionIds: [res.provinceId, res.cityId, res.countyId],
|
||||||
workWechat: res.wechatId || '',
|
workWechat: res.wechatId || '',
|
||||||
workWechatId: res.workWechatId || null,
|
workWechatId: res.workWechatId || null,
|
||||||
rating: res.intentLevel ||'',
|
rating: res.rating ||'',
|
||||||
remark: res.remark || '',
|
remark: res.remark || '',
|
||||||
concern: res.concern || '',
|
concern: res.concern || '',
|
||||||
pain: res.pain || '',
|
pain: res.pain || '',
|
||||||
|
|
@ -322,8 +323,11 @@ const handleSave = async () => {
|
||||||
remark: formData.value.remark.trim() || null,
|
remark: formData.value.remark.trim() || null,
|
||||||
type: formData.value.customerType || '2',
|
type: formData.value.customerType || '2',
|
||||||
workWechatId: formData.value.workWechatId || null,
|
workWechatId: formData.value.workWechatId || null,
|
||||||
regionIds: regionIdsArray,
|
// 将 regionIds 数组转换为三个独立的字段传给后端
|
||||||
|
provinceId: (regionIdsArray[0] !== undefined && regionIdsArray[0] !== null) ? regionIdsArray[0] : null,
|
||||||
|
cityId: (regionIdsArray[1] !== undefined && regionIdsArray[1] !== null) ? regionIdsArray[1] : null,
|
||||||
|
countyId: (regionIdsArray[2] !== undefined && regionIdsArray[2] !== null) ? regionIdsArray[2] : null,
|
||||||
|
rating: formData.value.rating || 0,
|
||||||
attention: formData.value.attention.trim() || null,
|
attention: formData.value.attention.trim() || null,
|
||||||
concern: formData.value.concern.trim() || null,
|
concern: formData.value.concern.trim() || null,
|
||||||
demand: formData.value.demand.trim() || null,
|
demand: formData.value.demand.trim() || null,
|
||||||
|
|
@ -339,6 +343,14 @@ const handleSave = async () => {
|
||||||
customerStatus: formData.value.customerStatus || null
|
customerStatus: formData.value.customerStatus || null
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log('提交的数据:', submitData);
|
||||||
|
console.log('地区数据:', {
|
||||||
|
regionIds: regionIdsArray,
|
||||||
|
provinceId: submitData.provinceId,
|
||||||
|
cityId: submitData.cityId,
|
||||||
|
countyId: submitData.countyId
|
||||||
|
});
|
||||||
|
|
||||||
await updateCustomer(submitData);
|
await updateCustomer(submitData);
|
||||||
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user