Commit 1711ae9f by Lin

feat(CustomerApi):添加客户资料分组API并集成到HomeFrame

- 实现了按月分组的客户资料查询分页接口 getCustomerProfileGroupInfoAPI。
- 更新 HomeFrame 以调用新的 API 方法来获取客户资料数据。
- 重构客户表单字段,使用更具描述性的键名以提高清晰度。
- 在 addFiles.vue 中增强了数据处理逻辑,以适配更新后的客户信息结构。
1 parent ce7a67bb
...@@ -211,4 +211,15 @@ module.exports = { ...@@ -211,4 +211,15 @@ module.exports = {
...data ...data
}) })
}, },
/**
* 轻改业务改版
* 5、客户建档分页查询-月按天分组
*/
getCustomerProfileGroupInfoAPI(data) {
return http.post({
method: 'dj.api.smartcarlife.order.pageCustomerProfileGroupInfo',
projectName: 'pad',
...data
})
},
} }
...@@ -492,6 +492,8 @@ export default { ...@@ -492,6 +492,8 @@ export default {
this.getStrategyStatus() this.getStrategyStatus()
this.getPrelearnHome() this.getPrelearnHome()
this.getCustomerProfileGroupInfo()
}, },
methods: { methods: {
handleHomeContentTabClick(index) { handleHomeContentTabClick(index) {
...@@ -709,12 +711,12 @@ export default { ...@@ -709,12 +711,12 @@ export default {
* 查询策略首页数据状态(营销活动和客户列表是否有数据) * 查询策略首页数据状态(营销活动和客户列表是否有数据)
*/ */
async getStrategyStatus() { async getStrategyStatus() {
// const res = await uni.$api.activityApi.getActivityStatusAPI() const res = await uni.$api.activityApi.getActivityStatusAPI()
// console.log('查询策略首页数据状态(营销活动和客户列表是否有数据):', res) // console.log('查询策略首页数据状态(营销活动和客户列表是否有数据):', res)
const res = { // const res = {
marketingActivityHasData: true, // marketingActivityHasData: true,
customerListHasData: true // customerListHasData: true
} // }
if (!res) return if (!res) return
this.marketingActivityHasData = !!res.marketingActivityHasData this.marketingActivityHasData = !!res.marketingActivityHasData
...@@ -726,6 +728,10 @@ export default { ...@@ -726,6 +728,10 @@ export default {
this.getActivityProductList() this.getActivityProductList()
} }
}, },
async getCustomerProfileGroupInfo() {
const res = await uni.$api.customerApi.getCustomerProfileGroupInfoAPI()
console.log('查询客户建档分页查询-月按天分组:', res)
},
/** /**
* 查询当前进行中的营销活动商品列表 * 查询当前进行中的营销活动商品列表
*/ */
......
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
@select="handleSelect($event, 'carBrandVisible')" @select="handleSelect($event, 'carBrandVisible')"
:echoData="customerInfo" :echoData="customerInfo"
carBrandKey="carBrand" carBrandKey="carBrand"
carModelKey="brandModel" carModelKey="carTypeName"
customBoolean customBoolean
/> />
<reception-sence <reception-sence
...@@ -156,8 +156,8 @@ import { validateVin, formatVinInput } from '@/utils/vinVaildate' ...@@ -156,8 +156,8 @@ import { validateVin, formatVinInput } from '@/utils/vinVaildate'
const phoneRex = /^[1]([3-9])[0-9]{9}$/, const phoneRex = /^[1]([3-9])[0-9]{9}$/,
default_customerForm = [{ default_customerForm = [{
label: '车主姓名', label: '车主姓名',
valueKey: 'ownerName', valueKey: 'customerName',
key: 'ownerName', key: 'customerName',
type: 'input', type: 'input',
inputType: 'text', inputType: 'text',
required: true, required: true,
...@@ -165,8 +165,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -165,8 +165,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
}, },
{ {
label: '手机号', label: '手机号',
valueKey: 'ownerPhone', valueKey: 'customerPhone',
key: 'ownerPhone', key: 'customerPhone',
type: 'input', type: 'input',
inputType: 'tel', inputType: 'tel',
required: true, required: true,
...@@ -175,8 +175,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -175,8 +175,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
}, },
{ {
label: '车型', label: '车型',
valueKey: 'brandModel', valueKey: 'carTypeName',
key: 'brandModel', key: 'carTypeName',
type: 'select', type: 'select',
required: true, required: true,
popKey: 'carBrandVisible' popKey: 'carBrandVisible'
...@@ -277,9 +277,9 @@ export default { ...@@ -277,9 +277,9 @@ export default {
this.customerForm = JSON.parse(JSON.stringify(default_customerForm)) this.customerForm = JSON.parse(JSON.stringify(default_customerForm))
this.optionalForm = JSON.parse(JSON.stringify(default_optionalForm)) this.optionalForm = JSON.parse(JSON.stringify(default_optionalForm))
this.customerInfo = { this.customerInfo = {
ownerName: '', customerName: '',
ownerPhone: '', customerPhone: '',
brandModel: '', carTypeName: '',
receptionScene: '', receptionScene: '',
arrivalDate: '', arrivalDate: '',
receptionSceneName: '', receptionSceneName: '',
...@@ -313,8 +313,8 @@ export default { ...@@ -313,8 +313,8 @@ export default {
if (popkey == 'carBrandVisible') { if (popkey == 'carBrandVisible') {
this.$refs.carBrandVisible.close() this.$refs.carBrandVisible.close()
Object.assign(this.customerInfo, { Object.assign(this.customerInfo, {
brandModel: item.name, carTypeName: item.name,
carModelId: item.id, carTypeId: item.id,
carBrand: item.carChildsBrandName, carBrand: item.carChildsBrandName,
carBrandId: item.carChildsBrandId, carBrandId: item.carChildsBrandId,
oneCarBrand: item.carBrand, oneCarBrand: item.carBrand,
...@@ -378,7 +378,7 @@ export default { ...@@ -378,7 +378,7 @@ export default {
merchantId: shopMerchantId, merchantId: shopMerchantId,
bussinessScene: sceneType == 0 ? 1 : 2 bussinessScene: sceneType == 0 ? 1 : 2
} }
if (!phoneRex.test(customerInfo.ownerPhone)) throw 'ownerPhone' if (!phoneRex.test(customerInfo.customerPhone)) throw 'customerPhone'
customerForm.map(e => { customerForm.map(e => {
params[e.key] = customerInfo[e.key] params[e.key] = customerInfo[e.key]
}) })
...@@ -387,16 +387,21 @@ export default { ...@@ -387,16 +387,21 @@ export default {
}) })
if (customerInfo.id) params.id = customerInfo.id if (customerInfo.id) params.id = customerInfo.id
Object.assign(params, { Object.assign(params, {
carModelId: customerInfo.carModelId, carTypeId: customerInfo.carTypeId,
carBrand: customerInfo.carBrand, carBrand: customerInfo.carBrand,
carBrandId: customerInfo.carBrandId, carBrandId: customerInfo.carBrandId,
oneCarBrand: customerInfo.oneCarBrand, oneCarBrand: customerInfo.oneCarBrand,
oneCarBrandId: customerInfo.oneCarBrandId oneCarBrandId: customerInfo.oneCarBrandId,
employeeName: uni.$storage.get('userInfo').name,
userId: uni.$storage.get('userInfo').uuid,
sellerMerchantId: uni.$storage.get('userInfo').merchantId
}) })
uni.showLoading({ uni.showLoading({
mask: true mask: true
}) })
const res = await uni.$api.customerApi[targetApi](params), console.log('params**', params)
// const res = await uni.$api.customerApi[targetApi](params),
const res = await uni.$api.customerApi.submitCustomerProfileAPI([params]),
_this = this _this = this
if (res) { if (res) {
if (res == '1') { if (res == '1') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!