Commit 1711ae9f by Lin

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

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