Commit bb5040ce by 李伟康

Merge branch 'saas+v5.8.3' of http://192.168.3.233:8090/glsx/gl_tape into saas+v5.8.3

2 parents fb3cb51c d6ae98bf
......@@ -40,7 +40,8 @@ export default {
},
data () {
return {
sellerEmployeeList: []
sellerEmployeeList: [],
defaultEmployeeList: []
}
},
watch: {
......@@ -56,7 +57,7 @@ export default {
return this.$store.state.user.historyStatus
},
selectedId () {
if (Array.isArray(this.list) || this.employeeType === 'seller') {
if (Array.isArray(this.list) || this.employeeType === 'seller' || this.employeeType === 'default') {
return this.salesPropsUuid
}
return this.$store.state.user.customerInfo.salesUuid || this.salesPropsUuid
......@@ -68,6 +69,9 @@ export default {
if (this.employeeType === 'seller') {
return this.sellerEmployeeList
}
if (this.employeeType === 'default') {
return this.defaultEmployeeList
}
return this.$store.state.user.employeeList
}
},
......@@ -94,6 +98,17 @@ export default {
this.sellerEmployeeList = res || []
return
}
if (this.employeeType === 'default') {
if (this.defaultEmployeeList.length) return
const { shopMerchantId, sceneType } = userInfo
const apiTargetName = sceneType == 1 ? 'getEmployeeList' : 'getOrderScreenEmployeeList'
const res = await uni.$api.popupApi[apiTargetName]({
merchantId: shopMerchantId,
sceneList: [sceneType]
})
this.defaultEmployeeList = res || []
return
}
const employeeList = this.$store.state.user.employeeList
if (employeeList && employeeList.length) return
const { shopMerchantId } = userInfo
......
......@@ -427,7 +427,7 @@ export default {
top: 0;
z-index: 2;
padding: 2px 10px;
border-radius: 0 0 8px 0;
border-radius: 8px 0 8px 0;
background: linear-gradient(270deg, #FF6748 0%, #F24724 100%);
font-size: 12px;
line-height: normal;
......
......@@ -293,41 +293,50 @@ export default {
border-radius: 10px;
background: rgba(44, 102, 247, 0.05);
box-sizing: border-box;
min-height: 32px;
.customer-count-left {
.customer-count-left,
.customer-count-right {
display: flex;
align-items: center;
}
.customer-count-left {
gap: 2px;
min-width: 0;
flex: 1;
}
.customer-count-right {
gap: 2px;
flex-shrink: 0;
margin-left: 8px;
}
.customer-count-icon {
width: 16px;
height: 16px;
flex-shrink: 0;
display: block;
}
.customer-count-label {
font-size: 13px;
line-height: normal;
color: #6C6F75;
.customer-count-label,
.customer-count-num,
.customer-count-unit {
line-height: 16px;
white-space: nowrap;
}
.customer-count-right {
display: flex;
align-items: flex-start;
gap: 2px;
flex-shrink: 0;
.customer-count-label {
font-size: 13px;
color: #6C6F75;
}
.customer-count-num,
.customer-count-unit {
font-size: 14px;
line-height: normal;
font-weight: 500;
color: #2C66F7;
white-space: nowrap;
}
}
......
......@@ -520,6 +520,7 @@ export default {
methods: {
handleHomeContentTabClick(index) {
this.homeContentTabIndex = index
this.getCustomerProfileGroupInfo()
},
_syncShowFloatLog() {
this.showFloatLog = FloatLogConfig.isLogBallVisible()
......@@ -708,7 +709,11 @@ export default {
}
},
async changeTab({ item, index }) {
if (index == 0) this.$refs.messageRef.getMessageSummary()
if (index == 0) {
this.$refs.messageRef.getMessageSummary()
this.getCustomerProfileGroupInfo()
this.getStrategyStatus()
}
this.previewOff = index != 0
this.$emit('changeTab', index)
console.log(this.$refs.leftBox.hasPopupOpen)
......@@ -734,6 +739,7 @@ export default {
try {
const res = await uni.$api.activityApi.getActivityStatusAPI({ merchantId })
console.log('getStrategyStatus***', res)
if (!res) {
this.marketingActivityHasData = false
this.customerListHasData = false
......@@ -792,6 +798,7 @@ export default {
try {
const res = await uni.$api.customerApi.getCustomerProfileGroupInfoAPI({ merchantId })
console.log('getCustomerProfileListInfo***')
this.customerProfileList = Array.isArray(res) ? res : []
} catch (error) {
console.error('查询客户建档分组信息失败:', error)
......@@ -833,6 +840,7 @@ export default {
if (res.remainingSkipCount != null) {
this.prelearnData = { ...this.prelearnData, remainingSkipCount: res.remainingSkipCount }
}
await this.getPrelearnHome()
} catch (e) {
// uni.$logger?.local?.info('预学习扣减跳过次数失败', e)
}
......
......@@ -27,9 +27,9 @@
></view>
</view>
<view
v-if="item.type === 'single' && hasMinSellPrice(item.minSellPrice)"
v-if="item.type === 'single' && hasActivityPrice(item.activityPrice)"
class="min-price"
>活动价 ¥ {{ item.minSellPrice }}</view>
>活动价 ¥ {{ item.activityPrice }}</view>
</view>
</view>
</view>
......@@ -50,9 +50,9 @@
<view class="child-name">{{ child.name }}</view>
</view>
<view
v-if="hasMinSellPrice(child.minSellPrice)"
v-if="hasActivityPrice(child.activityPrice)"
class="min-price"
>活动价 ¥ {{ child.minSellPrice }}</view>
>活动价 ¥ {{ child.activityPrice }}</view>
</view>
<view class="card-right">
<view class="current-price">¥ {{ child.sellPrice }}</view>
......@@ -84,7 +84,7 @@ export default {
}
},
methods: {
hasMinSellPrice(value) {
hasActivityPrice(value) {
return value != null && value !== ''
},
shouldShowMarketingIcon(item) {
......
......@@ -8,11 +8,13 @@
/>
</view>
<image
class="goods-img"
:src="displayMainImage"
mode="aspectFill"
/>
<scroll-view class="detail-scroll" scroll-y>
<image
class="goods-img"
:src="displayMainImage"
mode="widthFix"
/>
</scroll-view>
<image
class="prelearn-entrance"
......@@ -146,9 +148,13 @@ export default {
background-color: #000;
}
.detail-scroll {
width: 100%;
height: 100vh;
}
.goods-img {
width: 100%;
height: 100%;
display: block;
}
......
......@@ -42,7 +42,9 @@
<view class="required" v-if="i.required">*</view>{{ i.label }}
</view>
<template v-if="i.type == 'readonly'">
<view class="input input--readonly text-hide">{{ getFieldDisplayValue(i) || '-' }}</view>
<view :class="['input input--readonly text-hide', { placeholderStyle: !getFieldDisplayValue(i) && i.placeholder }]">
{{ getFieldDisplayValue(i) || (i.placeholder || '-') }}
</view>
</template>
<template v-else-if="i.type == 'input'">
<input
......@@ -50,7 +52,7 @@
:maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]"
:class="['input', { error: i.error }]"
placeholder="请选择"
:placeholder="`请输入${i.label}`"
placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done"
@blur="inputBlur($event, i)"
......@@ -60,8 +62,8 @@
<picker
mode="date"
fields="day"
:start="startDate"
:end="endDate"
:start="getDatePickerStart(i)"
:end="getDatePickerEnd(i)"
@change="bindDateChange($event, i.valueKey)"
:value="customerInfo[i.valueKey]"
>
......@@ -99,7 +101,7 @@
:maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]"
:class="['input', { error: i.error }]"
placeholder="请选择"
:placeholder="`请输入${i.label}`"
placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done"
@blur="inputBlur($event, i)"
......@@ -109,8 +111,8 @@
<picker
mode="date"
fields="day"
:start="startDate"
:end="endDate"
:start="getDatePickerStart(i)"
:end="getDatePickerEnd(i)"
@change="bindDateChange($event, i.valueKey)"
:value="customerInfo[i.valueKey]"
>
......@@ -157,7 +159,7 @@
:maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]"
class="input input--count"
placeholder="请输入"
:placeholder="`请输入${i.label}`"
placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done"
/>
......@@ -169,7 +171,7 @@
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
@click="showPopup(i.popKey)"
>
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view>
<view class="value text-hide">{{ customerInfo[i.valueKey] || i.placeholder || '请选择' }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view>
</template>
......@@ -245,7 +247,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
valueKey: 'customerPhone',
key: 'customerPhone',
type: 'readonly',
required: true
required: true,
placeholder: '请输入车主手机号'
},
{
label: '车型',
......@@ -260,7 +263,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
valueKey: 'deliveryDate',
key: 'deliveryDate',
required: true,
type: 'date'
type: 'date',
dateUnlimited: true
},
// {
// label: '接待场景',
......@@ -290,7 +294,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
label: '到店日期',
valueKey: 'inviteDate',
key: 'inviteDate',
type: 'date'
type: 'date',
dateFromToday: true
},
{
label: '驻店零售',
......@@ -303,7 +308,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
label: '建档日期',
valueKey: 'createdDate',
key: 'createdDate',
type: 'date'
type: 'date',
dateUnlimited: true
}],
default_groupForm = [ {
label: '客户群',
......@@ -317,7 +323,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
valueKey: 'contact_name',
key: 'contact_id',
type: 'select',
popKey: 'groupMemberVisible'
popKey: 'groupMemberVisible',
placeholder: '请选择群成员'
},
{
label: '备注',
......@@ -421,15 +428,39 @@ export default {
return map[status] || ''
},
async getCustormDetail() {
console.log('getCustormDetailAPI***', this.customerId)
const res = await uni.$api.customerApi.customerProfileInfoAPI({
id: this.customerId
})
console.log('getCustormDetailAPI***', res)
if(res) {
this.customerForm = res
if (!this.customerId) {
return false
}
try {
const res = await uni.$api.customerApi.customerProfileInfoAPI({
id: this.customerId
})
if (!res || typeof res !== 'object') {
return false
}
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')
}
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)
await this.getCustomerGroupInfo()
return true
} catch (error) {
console.error('getCustormDetail 失败', error)
return false
}
console.log('getCustomerGroupInfoAPI**customerForm*', this.customerForm)
},
async submitCustomerProfileAPI(options = {}) {
const { fromReception = false } = options
......@@ -587,11 +618,22 @@ export default {
}
},
async getCustomerGroupMemberInfoAPI(contactId) {
const data = await uni.$api.customerApi.getCustomerGroupMemberInfoAPI({
qwGroupId: contactId
})
console.log('群成员getCustomerGroupMemberInfoAPI***', data)
this.groupMemberList = Array.isArray(data) ? data : []
const qwGroupId = contactId || this.customerInfo.qwGroupId
if (!qwGroupId) {
this.groupMemberList = []
return false
}
try {
const data = await uni.$api.customerApi.getCustomerGroupMemberInfoAPI({
qwGroupId
})
this.groupMemberList = Array.isArray(data) ? data : []
return this.groupMemberList.length > 0
} catch (error) {
console.error('getCustomerGroupMemberInfoAPI 失败', error)
this.groupMemberList = []
return false
}
},
syncDisplayInfo (info = this.customerInfo) {
this.headerSnapshot = {
......@@ -633,7 +675,7 @@ export default {
receptionSceneName: '',
standNo: '',
inviteDate: '',
createdDate: '',
createdDate: dayjs().format('YYYY-MM-DD'),
employeeName: '',
userId: '',
merchantName: '',
......@@ -655,6 +697,9 @@ export default {
if (res.inviteDate) res.inviteDate = dayjs(res.inviteDate).format("YYYY-MM-DD")
// 合并而非整对象替换,保留 initForm 中已声明的响应式字段(如 contact_name)
Object.assign(this.customerInfo, res)
if (!this.customerInfo.createdDate) {
this.customerInfo.createdDate = dayjs().format('YYYY-MM-DD')
}
if (!this.customerInfo.contact_id && res.wxId) {
this.customerInfo.contact_id = res.wxId
}
......@@ -719,6 +764,14 @@ export default {
this.customerInfo.receptionScene = item.id
}
},
getDatePickerStart (field) {
if (field.dateUnlimited) return '1970-01-01'
if (field.dateFromToday) return dayjs().format('YYYY-MM-DD')
return this.startDate
},
getDatePickerEnd (field) {
return field.dateUnlimited ? '2099-12-31' : this.endDate
},
bindDateChange (e, valueKey) {
this.customerInfo[valueKey] = e.detail.value
},
......
......@@ -10,6 +10,14 @@ export function getGoodsDisplayName(goods) {
return goods.goodsAlias || goods.upgradeGoodsName || goods.goodsInfo?.goodsName || goods.baseGoodsName || ''
}
// 活动价:商品列表返回的原始售价,加入订单时快照,不随用户改价变化
export function getGoodsActivityPrice(goods) {
if (!goods) return undefined
const price = goods.oldPrice ?? goods.upgradePrice ?? goods.price
if (price == null || price === '') return undefined
return price
}
function buildSingleApprovalItem(item, goods, number) {
const sellPrice = normalizeGoodsPrice(goods.sellPrice)
if (!isBelowMinSellPrice(goods, sellPrice)) return null
......@@ -17,7 +25,7 @@ function buildSingleApprovalItem(item, goods, number) {
type: 'single',
name: getGoodsDisplayName(goods),
sellPrice,
minSellPrice: goods.minSellPrice,
activityPrice: getGoodsActivityPrice(goods),
number: number || '1',
sourceItem: item
}
......@@ -47,7 +55,7 @@ function buildPackageApprovalItem(item, orderTypeCode) {
return {
name: getGoodsDisplayName(goods),
sellPrice,
minSellPrice: goods.minSellPrice,
activityPrice: getGoodsActivityPrice(goods),
number: item.packageGoods.number || '1',
sourceGoods: goods
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!