Commit e2d2430d by Lin

feat: 优化

1 parent 8b39a87a
...@@ -778,7 +778,7 @@ export default { ...@@ -778,7 +778,7 @@ export default {
async getPrelearnHome() { async getPrelearnHome() {
try { try {
const res = await uni.$api.commonApi.getPrelernHomePopupAPI() const res = await uni.$api.commonApi.getPrelernHomePopupAPI()
console.log('getPrelernHomePopupAPI res***', res); console.log('预学习:查询预学习首页弹框信息***', res);
if (!res) return if (!res) return
this.prelearnData = res this.prelearnData = res
this.showPreStudyPopup = res.shouldPopup this.showPreStudyPopup = res.shouldPopup
......
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
}, },
computed: { computed: {
displayMainImage() { displayMainImage() {
return this.goodsInfo.mainImageUrl || this.goodsInfo.thumbImageUrl || GOODS_COVER return this.goodsInfo.detailImageUrl || ''
}, },
backButtonStyle() { backButtonStyle() {
const { top, left } = this.overlayLayoutPx const { top, left } = this.overlayLayoutPx
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<template v-else> <template v-else>
<view <view
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]" :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
@click="showPopup(i.popKey)" @click="showPopup(i)"
> >
<view class="value text-hide">{{ customerInfo[i.valueKey] || `请选择${i.label}` }}</view> <view class="value text-hide">{{ customerInfo[i.valueKey] || `请选择${i.label}` }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons> <uni-icons class="arrow" type="right" :size="16"></uni-icons>
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
<template v-else> <template v-else>
<view <view
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]" :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
@click="showPopup(i.popKey)" @click="showPopup(i)"
> >
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view> <view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons> <uni-icons class="arrow" type="right" :size="16"></uni-icons>
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
<employee <employee
ref="residentSaleVisible" ref="residentSaleVisible"
title="驻店零售" title="驻店零售"
:salesPropsUuid="customerInfo.residentSaleId" :salesPropsUuid="employeeSelectKey ? customerInfo[employeeSelectKey] : ''"
@select="handleSelect($event, 'residentSaleVisible')" @select="handleSelect($event, 'residentSaleVisible')"
/> />
</view> </view>
...@@ -190,8 +190,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -190,8 +190,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
}, },
{ {
label: '流量来源', label: '流量来源',
valueKey: 'residentSaleName', valueKey: 'employeeName',
key: 'residentSaleId', key: 'userId',
type: 'select', type: 'select',
required: true, required: true,
popKey: 'residentSaleVisible' popKey: 'residentSaleVisible'
...@@ -226,8 +226,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -226,8 +226,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
type: 'date' type: 'date'
},{ },{
label: '驻店零售', label: '驻店零售',
valueKey: 'residentSaleName', valueKey: 'sellerName',
key: 'residentSaleId', key: 'sellerUserId',
type: 'select', type: 'select',
popKey: 'residentSaleVisible' popKey: 'residentSaleVisible'
}] }]
...@@ -257,7 +257,8 @@ export default { ...@@ -257,7 +257,8 @@ export default {
customerInfo: {}, customerInfo: {},
startDate: '', startDate: '',
endDate: '', endDate: '',
validateState: true validateState: true,
employeeSelectKey: ''
} }
}, },
onLoad (options) { onLoad (options) {
...@@ -290,8 +291,10 @@ export default { ...@@ -290,8 +291,10 @@ export default {
arrivalDate: '', arrivalDate: '',
receptionSceneName: '', receptionSceneName: '',
standNo: '', standNo: '',
residentSaleName: '', employeeName: '',
residentSaleId: '', userId: '',
sellerName: '',
sellerUserId: '',
filingDate: '' filingDate: ''
} }
if (this.customerId) this.findVisitsInfo() if (this.customerId) this.findVisitsInfo()
...@@ -311,8 +314,9 @@ export default { ...@@ -311,8 +314,9 @@ export default {
animationDuration: 100 animationDuration: 100
}) })
}, },
showPopup (e) { showPopup (item) {
this.$refs[e].open() this.employeeSelectKey = item.key
this.$refs[item.popKey].open()
}, },
handleSelect (item, popkey) { handleSelect (item, popkey) {
this.$refs[popkey].close() this.$refs[popkey].close()
...@@ -329,8 +333,11 @@ export default { ...@@ -329,8 +333,11 @@ export default {
oneCarBrandId: item.carBrandId oneCarBrandId: item.carBrandId
}) })
} else if (popkey == 'residentSaleVisible') { } else if (popkey == 'residentSaleVisible') {
this.customerInfo.residentSaleName = item.staffName const field = this.customerForm.concat(this.optionalForm).find(e => e.key === this.employeeSelectKey)
this.customerInfo.residentSaleId = item.uuid if (field) {
this.customerInfo[field.valueKey] = item.staffName
this.customerInfo[field.key] = item.uuid
}
} else { } else {
this.customerInfo.receptionSceneName = item.receptionSceneName this.customerInfo.receptionSceneName = item.receptionSceneName
this.customerInfo.receptionScene = item.id this.customerInfo.receptionScene = item.id
...@@ -402,8 +409,8 @@ export default { ...@@ -402,8 +409,8 @@ export default {
carChildsBrandName: customerInfo.carChildsBrandName, carChildsBrandName: customerInfo.carChildsBrandName,
oneCarBrand: customerInfo.oneCarBrand, oneCarBrand: customerInfo.oneCarBrand,
oneCarBrandId: customerInfo.oneCarBrandId, oneCarBrandId: customerInfo.oneCarBrandId,
employeeName: uni.$storage.get('userInfo').name, employeeName: customerInfo.employeeName,
userId: uni.$storage.get('userInfo').uuid, userId: customerInfo.userId,
sellerMerchantId: uni.$storage.get('userInfo').merchantId sellerMerchantId: uni.$storage.get('userInfo').merchantId
}) })
uni.showLoading({ uni.showLoading({
...@@ -428,9 +435,13 @@ export default { ...@@ -428,9 +435,13 @@ export default {
standNo:params.standNo, standNo:params.standNo,
carSeriesId:params.carTypeId, carSeriesId:params.carTypeId,
carSeriesName:params.carTypeName, carSeriesName:params.carTypeName,
employeeName:params.employeeName,
userId:params.userId,
deliveryDate: params.arrivalDate ? params.arrivalDate + ' 00:00:00' : params.arrivalDate, //交付日期 deliveryDate: params.arrivalDate ? params.arrivalDate + ' 00:00:00' : params.arrivalDate, //交付日期
inviteDate: params.filingDate ? params.filingDate + ' 00:00:00' : params.filingDate, //到店日期 inviteDate: params.filingDate ? params.filingDate + ' 00:00:00' : params.filingDate, //到店日期
createdDate: params.filingDate, //建档日期 createdDate: params.filingDate, //建档日期
sellerUserld: params.sellerUserId,
sellerName: customerInfo.sellerName,
} }
] ]
} }
......
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
<employee <employee
ref="residentSaleVisible" ref="residentSaleVisible"
title="驻店零售" title="驻店零售"
:salesPropsUuid="customerInfo.userId" :salesPropsUuid="customerInfo.advanceUserId"
@select="handleSelect($event, 'residentSaleVisible')" @select="handleSelect($event, 'residentSaleVisible')"
/> />
<employee <employee
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
:list="groupMemberList" :list="groupMemberList"
label-key="contact_name" label-key="contact_name"
value-key="contact_id" value-key="contact_id"
:salesPropsUuid="customerInfo.groupMemberId" :salesPropsUuid="customerInfo.contact_id"
@select="handleSelect($event, 'groupMemberVisible')" @select="handleSelect($event, 'groupMemberVisible')"
/> />
</view> </view>
...@@ -284,8 +284,8 @@ ...@@ -284,8 +284,8 @@
}, },
{ {
label: '驻店零售', label: '驻店零售',
valueKey: 'employeeName', valueKey: 'advanceUserName',
key: 'userId', key: 'advanceUserId',
type: 'select', type: 'select',
popKey: 'residentSaleVisible' popKey: 'residentSaleVisible'
}, },
...@@ -304,8 +304,8 @@ ...@@ -304,8 +304,8 @@
}, },
{ {
label: '群成员关联', label: '群成员关联',
valueKey: 'groupMemberName', valueKey: 'contact_name',
key: 'groupMemberId', key: 'contact_id',
type: 'select', type: 'select',
popKey: 'groupMemberVisible' popKey: 'groupMemberVisible'
}, },
...@@ -454,8 +454,9 @@ ...@@ -454,8 +454,9 @@
advanceUserName: this.customerInfo.advanceUserName, advanceUserName: this.customerInfo.advanceUserName,
qwGroupId: this.customerInfo.qwGroupId, qwGroupId: this.customerInfo.qwGroupId,
qwGroupName: this.customerInfo.qwGroupName, qwGroupName: this.customerInfo.qwGroupName,
wxId:this.customerInfo.wxId, wxId: this.customerInfo.contact_id,
wxName:this.customerInfo.wxName, wxName: this.customerInfo.contact_name,
standNo:this.customerInfo.standNo,
} }
console.log('submitCustomerProfileAPI***',requestParams) console.log('submitCustomerProfileAPI***',requestParams)
uni.showLoading({ uni.showLoading({
...@@ -600,12 +601,12 @@ ...@@ -600,12 +601,12 @@
createdDate: '', createdDate: '',
employeeName: '', employeeName: '',
userId: '', userId: '',
advanceUserName: '',
advanceUserId: '',
qwGroupName: '', qwGroupName: '',
groupMemberName: '', contact_id: '',
groupMemberId: '', contact_name: '',
groupRemark: '', groupRemark: ''
wxId: '',
wxName: ''
} }
if (this.customerId) this.findVisitsInfo() if (this.customerId) this.findVisitsInfo()
}, },
...@@ -616,8 +617,14 @@ ...@@ -616,8 +617,14 @@
if (res.deliveryDate) res.deliveryDate = dayjs(res.deliveryDate).format("YYYY-MM-DD") if (res.deliveryDate) res.deliveryDate = dayjs(res.deliveryDate).format("YYYY-MM-DD")
if (res.createdDate) res.createdDate = dayjs(res.createdDate).format("YYYY-MM-DD") if (res.createdDate) res.createdDate = dayjs(res.createdDate).format("YYYY-MM-DD")
if (res.inviteDate) res.inviteDate = dayjs(res.inviteDate).format("YYYY-MM-DD") if (res.inviteDate) res.inviteDate = dayjs(res.inviteDate).format("YYYY-MM-DD")
// 合并而非整对象替换,保留 initForm 中已声明的响应式字段(如 groupMemberName) // 合并而非整对象替换,保留 initForm 中已声明的响应式字段(如 contact_name)
Object.assign(this.customerInfo, res) Object.assign(this.customerInfo, res)
if (!this.customerInfo.contact_id && res.wxId) {
this.customerInfo.contact_id = res.wxId
}
if (!this.customerInfo.contact_name && res.wxName) {
this.customerInfo.contact_name = res.wxName
}
this.syncDisplayInfo(this.customerInfo) this.syncDisplayInfo(this.customerInfo)
console.log('findVisitsInfo**customerInfo*', this.customerInfo) console.log('findVisitsInfo**customerInfo*', this.customerInfo)
await this.getCustomerGroupInfo() await this.getCustomerGroupInfo()
...@@ -663,12 +670,8 @@ ...@@ -663,12 +670,8 @@
this.customerInfo.employeeName = item.staffName this.customerInfo.employeeName = item.staffName
this.customerInfo.userId = item.uuid this.customerInfo.userId = item.uuid
} else if (popkey == 'groupMemberVisible') { } else if (popkey == 'groupMemberVisible') {
const groupMemberName = item.contact_name || item.name || '' this.$set(this.customerInfo, 'contact_id', item.contact_id || item.id || '')
const groupMemberId = item.contact_id || item.id || '' this.$set(this.customerInfo, 'contact_name', item.contact_name || item.name || '')
this.$set(this.customerInfo, 'groupMemberName', groupMemberName)
this.$set(this.customerInfo, 'groupMemberId', groupMemberId)
this.$set(this.customerInfo, 'wxId', item.wxId || item.wx_id || '')
this.$set(this.customerInfo, 'wxName', item.wxName || item.wx_name || '')
} else { } else {
this.customerInfo.receptionSceneName = item.receptionSceneName this.customerInfo.receptionSceneName = item.receptionSceneName
this.customerInfo.receptionScene = item.id this.customerInfo.receptionScene = item.id
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!