Commit 7e6409eb by 李伟康

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

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