修正,仅剩一个选择星级bug

This commit is contained in:
WindowBird 2025-11-08 15:18:48 +08:00
parent 937a51626f
commit 954ef47dd7

View File

@ -153,13 +153,14 @@ const loadCustomerDetail = async () => {
wechat: res.wechat ||'',
source: res.source || '',
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 || '',
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 || '',
workWechatId: res.workWechatId || null,
rating: res.intentLevel ||'',
rating: res.rating ||'',
remark: res.remark || '',
concern: res.concern || '',
pain: res.pain || '',
@ -322,8 +323,11 @@ const handleSave = async () => {
remark: formData.value.remark.trim() || null,
type: formData.value.customerType || '2',
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,
concern: formData.value.concern.trim() || null,
demand: formData.value.demand.trim() || null,
@ -339,6 +343,14 @@ const handleSave = async () => {
customerStatus: formData.value.customerStatus || null
};
console.log('提交的数据:', submitData);
console.log('地区数据:', {
regionIds: regionIdsArray,
provinceId: submitData.provinceId,
cityId: submitData.cityId,
countyId: submitData.countyId
});
await updateCustomer(submitData);
uni.showToast({