Commit 7e6409eb by 李伟康

feat(customer): 增强客户车型品牌信息处理与日志记录

- 在多个组件中完善车辆品牌、车型相关字段的赋值逻辑,使用 Object.assign 统一更新
- 增加对空值的容错处理(如 `|| ''`),提升数据稳定性
- 添加关键操作日志,便于追踪用户选择的车辆品牌及模型信息
- 优化代码结构,提高可读性和维护性
- 调整部分样式缩进问题,保持代码格式整洁
1 parent 5dca6f2d
...@@ -206,6 +206,13 @@ export default { ...@@ -206,6 +206,13 @@ export default {
oneCarBrand: selectItem.carBrand, oneCarBrand: selectItem.carBrand,
oneCarBrandId: selectItem.carBrandId oneCarBrandId: selectItem.carBrandId
}) })
uni.$logger.local.info(`选择车:
carModel:${item.name},
carModelId: ${item.id},
carBrand:${customerInfo.carBrand},
carBrandId:${customerInfo.carBrandId},
oneCarBrand:${customerInfo.oneCarBrand},
oneCarBrandId:${customerInfo.oneCarBrandId}`)
if (linkage) { if (linkage) {
this.$store.dispatch('setCustomerInfo', customerInfo) this.$store.dispatch('setCustomerInfo', customerInfo)
this.$store.dispatch('updateViewKey') this.$store.dispatch('updateViewKey')
......
...@@ -270,8 +270,16 @@ export default { ...@@ -270,8 +270,16 @@ export default {
this.$refs[popkey].close() this.$refs[popkey].close()
if (popkey == 'carBrandVisible') { if (popkey == 'carBrandVisible') {
this.$refs.carBrandVisible.close() this.$refs.carBrandVisible.close()
this.customerInfo.brandModel = item.name // this.customerInfo.brandModel = item.name
this.customerInfo.carBrand = item.carChildsBrandName // this.customerInfo.carBrand = item.carChildsBrandName
Object.assign(this.customerInfo, {
brandModel: item.name,
carModelId: item.id,
carBrand: item.carChildsBrandName,
carBrandId: item.carChildsBrandId,
oneCarBrand: item.carBrand,
oneCarBrandId: item.carBrandId
})
} else if (popkey == 'customerTagstVisible') { } else if (popkey == 'customerTagstVisible') {
let names = [], let names = [],
ids = [] ids = []
...@@ -308,6 +316,13 @@ export default { ...@@ -308,6 +316,13 @@ export default {
params[e.key] = customerInfo[e.key] params[e.key] = customerInfo[e.key]
}) })
if (customerInfo.id) params.id = customerInfo.id if (customerInfo.id) params.id = customerInfo.id
Object.assign(params, {
carModelId: customerInfo.carModelId,
carBrand: customerInfo.carBrand,
carBrandId: customerInfo.carBrandId,
oneCarBrand: customerInfo.oneCarBrand,
oneCarBrandId: customerInfo.oneCarBrandId
})
params.customerTagName = params.customerTagName.replace(/|/g, ',') params.customerTagName = params.customerTagName.replace(/|/g, ',')
uni.showLoading({ uni.showLoading({
mask: true mask: true
......
...@@ -266,8 +266,14 @@ export default { ...@@ -266,8 +266,14 @@ export default {
this.$store.dispatch("setReceptionTrack", { key, value }) this.$store.dispatch("setReceptionTrack", { key, value })
}, },
handleSelect (item) { handleSelect (item) {
this.customerInfo.carModel = item.name this.customerInfo.carModel = item.name || ''
this.customerInfo.carModelId = item.id this.customerInfo.carModelId = item.id || ''
Object.assign(this.customerInfo, {
carBrand: item.carChildsBrandName || '',
carBrandId: item.carChildsBrandId || '',
oneCarBrand: item.carBrand || '',
oneCarBrandId: item.carBrandId || ''
})
this.$store.dispatch('setCustomerInfo', this.customerInfo) this.$store.dispatch('setCustomerInfo', this.customerInfo)
this.carInfo = item this.carInfo = item
uni.hideLoading() uni.hideLoading()
......
...@@ -6,9 +6,7 @@ ...@@ -6,9 +6,7 @@
* @LastEditTime: 2024-05-31 16:07:23 * @LastEditTime: 2024-05-31 16:07:23
--> -->
<template> <template>
<view <view class="detail-box">
class="detail-box"
>
<view class="nav-bar"> <view class="nav-bar">
<view <view
class="back" class="back"
...@@ -204,13 +202,17 @@ export default { ...@@ -204,13 +202,17 @@ export default {
// } // }
let customer = { let customer = {
customerName: item.customerName, customerName: item.customerName,
carModel: item.carSeriesName, carModel: item.carSeriesName || '',
phoneNumber: item.customerPhone, phoneNumber: item.customerPhone,
salesUuid: item.userId, salesUuid: item.userId,
staffName: item.employeeName, staffName: item.employeeName,
receiveCouponDate: item.receiveCouponDate, receiveCouponDate: item.receiveCouponDate,
customerCouponId: item.customerCouponId, customerCouponId: item.customerCouponId,
carSeriesId: item.carSeriesId carSeriesId: item.carSeriesId || '',
carBrand: item.carChildsBrandName || '',
carBrandId: item.carChildsBrandId || '',
oneCarBrand: item.carBrand || '',
oneCarBrandId: item.carBrandId || ''
} }
let [reception] = this.$refs.media1 let [reception] = this.$refs.media1
reception?.clearCustomerReceivedTimer() reception?.clearCustomerReceivedTimer()
......
...@@ -80,6 +80,7 @@ export default { ...@@ -80,6 +80,7 @@ export default {
return state.customerInfo; return state.customerInfo;
}, },
setCustomerInfo ({ commit }, value) { setCustomerInfo ({ commit }, value) {
uni.$logger.local.info(`当前接待客户信息: ${JSON.stringify(value)}`)
commit("setCustomerInfo", value); commit("setCustomerInfo", value);
}, },
clearCustomerInfo ({ commit }) { clearCustomerInfo ({ commit }) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!