Commit e2d2430d by Lin

feat: 优化

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