Commit db94a6fa by 李伟康

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

2 parents 7cf02fa6 da70e4ca
...@@ -171,7 +171,18 @@ module.exports = { ...@@ -171,7 +171,18 @@ module.exports = {
* 轻改业务改版 * 轻改业务改版
* 2、客户建档提交 * 2、客户建档提交
*/ */
csubmitCustomerProfileAPI(data) { submitPreliminaryOrderAPI(data) {
return http.post({
method: 'dj.api.smartcarlife.order.preliminaryOrder.batch',
projectName: 'pad',
...data
})
},
/**
* 轻改业务改版
* 3、客户建档提交
*/
submitCustomerProfileAPI(data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.order.submitCustomerProfile', method: 'dj.api.smartcarlife.order.submitCustomerProfile',
projectName: 'pad', projectName: 'pad',
......
...@@ -28,6 +28,11 @@ ...@@ -28,6 +28,11 @@
</view> </view>
<scroll-view class="customer-list" scroll-y show-scrollbar="false"> <scroll-view class="customer-list" scroll-y show-scrollbar="false">
<view class="customer-list-inner"> <view class="customer-list-inner">
<view
v-for="group in customerProfile"
:key="group.date"
class="customer-day-group"
>
<view class="customer-count"> <view class="customer-count">
<view class="customer-count-left"> <view class="customer-count-left">
<image <image
...@@ -35,107 +40,116 @@ ...@@ -35,107 +40,116 @@
:src="require('@/assets/images/common/icon-customer-count.png')" :src="require('@/assets/images/common/icon-customer-count.png')"
mode="aspectFit" mode="aspectFit"
/> />
<text class="customer-count-label">今日({{ todayDate }})已建档</text> <text class="customer-count-label">{{ formatDateLabel(group.date) }}已建档</text>
</view> </view>
<view class="customer-count-right"> <view class="customer-count-right">
<text class="customer-count-num">{{ todayCustomerCount }}</text> <text class="customer-count-num">{{ group.number || 0 }}</text>
<text class="customer-count-unit">位客户</text> <text class="customer-count-unit">位客户</text>
</view> </view>
</view> </view>
<view <view
v-for="item in customerList" v-for="item in group.customerProfileInfoDTOS || []"
:key="item.id" :key="item.id"
class="customer-item" class="customer-item"
> >
<view class="customer-item-avatar"> <view class="customer-item-avatar">
<text class="customer-item-avatar-text">{{ item.surname }}</text> <text class="customer-item-avatar-text">{{ getCustomerSurname(item.customerName) }}</text>
</view> </view>
<view class="customer-item-body" @click="handleGoCustomerDetail(item)"> <view class="customer-item-body" @click="handleGoCustomerDetail(item)">
<view class="customer-item-row customer-item-row--name"> <view class="customer-item-row customer-item-row--name">
<text class="customer-item-name">{{ item.name }}</text> <view class="customer-item-name-left">
<view v-if="item.carModel" class="customer-item-car-tag"> <text class="customer-item-name">{{ item.customerName || '-' }}</text>
<text class="customer-item-car-text">{{ item.carModel }}</text> <view v-if="item.carSeriesName" class="customer-item-car-tag">
<text class="customer-item-car-text">{{ item.carSeriesName }}</text>
</view>
</view>
<view
v-if="getCustomerStatusLabel(item.customerStatus)"
:class="['customer-item-status', getCustomerStatusClass(item.customerStatus)]"
>
<text class="customer-item-status-text">{{ getCustomerStatusLabel(item.customerStatus) }}</text>
</view> </view>
</view> </view>
<view class="customer-item-row customer-item-row--meta"> <view class="customer-item-row customer-item-row--meta">
<text class="customer-item-meta">{{ item.phone }}</text> <text class="customer-item-meta">{{ item.customerPhone || '-' }}</text>
<view class="customer-item-divider"></view> <view class="customer-item-divider"></view>
<text class="customer-item-meta">交付{{ item.deliveryDate }}</text> <text class="customer-item-meta">交付{{ formatDisplayDate(item.deliveryDate) }}</text>
<view class="customer-item-divider"></view> <view class="customer-item-divider"></view>
<text class="customer-item-meta">到店{{ item.visitDate }}</text> <text class="customer-item-meta">到店{{ formatDisplayDate(item.inviteDate) }}</text>
</view> </view>
<view class="customer-item-row customer-item-row--group"> <view class="customer-item-row customer-item-row--group">
<text class="customer-item-group">客户群:{{ item.groupName }}</text> <text class="customer-item-group">客户群:{{ item.qwGroupName || '-' }}</text>
</view>
</view>
<view class="customer-item-side">
<view
v-if="item.status"
:class="['customer-item-status', `customer-item-status--${item.statusType || 'warning'}`]"
>
<text class="customer-item-status-text">{{ item.status }}</text>
</view>
<view class="customer-item-arrow"> <view class="customer-item-arrow">
<view class="sprite-icon icon-arrow-right"></view> <view class="sprite-icon icon-arrow-right"></view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view>
</view>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>
<script> <script>
const MOCK_CUSTOMER_LIST = [
{
id: 1,
surname: '张',
name: '张**',
carModel: '奥迪 A6L',
phone: '136****6789',
deliveryDate: '06-20',
visitDate: '05-12',
groupName: '张先生2827-客户大定精品服务群吉利古拉',
status: '待跟进',
statusType: 'warning'
},
{
id: 2,
surname: '李',
name: '李**',
carModel: '宝马 5系',
phone: '138****1234',
deliveryDate: '06-18',
visitDate: '05-10',
groupName: '李先生1028-客户精品服务群',
status: '待跟进',
statusType: 'warning'
}
]
export default { export default {
name: 'CustomerSide', name: 'CustomerSide',
props: { props: {
type: { type: {
type: String, type: String,
default: 'out' default: 'out'
},
customerProfile: {
type: Array,
default: () => []
} }
}, },
data() { methods: {
return { getCustomerSurname(name) {
customerList: MOCK_CUSTOMER_LIST, if (!name) return ''
todayCustomerCount: 8 return String(name).charAt(0)
},
getCustomerStatusLabel(status) {
const map = {
1: '待跟进',
2: '已升级',
3: '战败',
4: '已退款'
}
return map[status] || ''
},
getCustomerStatusClass(status) {
const map = {
1: 'customer-item-status--warning',
2: 'customer-item-status--success',
3: 'customer-item-status--failed',
4: 'customer-item-status--refund'
}
return map[status] || ''
},
formatDisplayDate(val) {
if (!val) return '-'
if (typeof val === 'number') {
const date = new Date(val)
if (Number.isNaN(date.getTime())) return '-'
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${month}-${day}`
} }
const match = String(val).match(/(\d{4})-(\d{2})-(\d{2})/)
if (match) return `${match[2]}-${match[3]}`
return val
}, },
computed: { formatDateLabel(dateStr) {
todayDate() { const display = this.formatDisplayDate(dateStr)
if (!dateStr) return display
const now = new Date() const now = new Date()
const month = String(now.getMonth() + 1).padStart(2, '0') const todayStr = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`
const day = String(now.getDate()).padStart(2, '0') if (dateStr === todayStr) {
return `${month}-${day}` return `今日(${display})`
} }
return display
}, },
methods: {
handleGoCustomerFiles() { handleGoCustomerFiles() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/common/customerPages/addFiles', url: '/pages/common/customerPages/addFiles',
...@@ -241,6 +255,14 @@ export default { ...@@ -241,6 +255,14 @@ export default {
box-sizing: border-box; box-sizing: border-box;
} }
.customer-day-group {
margin-bottom: 8px;
&:last-child {
margin-bottom: 0;
}
}
.customer-count { .customer-count {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -337,7 +359,8 @@ export default { ...@@ -337,7 +359,8 @@ export default {
min-width: 0; min-width: 0;
&--name { &--name {
gap: 6px; justify-content: space-between;
gap: 8px;
} }
&--meta { &--meta {
...@@ -346,8 +369,18 @@ export default { ...@@ -346,8 +369,18 @@ export default {
} }
&--group { &--group {
align-items: flex-start; align-items: center;
justify-content: space-between;
gap: 8px;
}
} }
.customer-item-name-left {
display: flex;
align-items: center;
gap: 6px;
min-width: 0;
flex: 1;
} }
.customer-item-name { .customer-item-name {
...@@ -397,19 +430,10 @@ export default { ...@@ -397,19 +430,10 @@ export default {
white-space: nowrap; white-space: nowrap;
} }
.customer-item-side {
align-self: stretch;
display: flex;
flex-direction: column;
align-items: flex-end;
justify-content: space-between;
flex-shrink: 0;
}
.customer-item-status { .customer-item-status {
padding: 0 8px; padding: 0 8px;
border-radius: 4px; border-radius: 4px;
background: #FDECE9; flex-shrink: 0;
&--warning { &--warning {
background: #FDECE9; background: #FDECE9;
...@@ -418,6 +442,30 @@ export default { ...@@ -418,6 +442,30 @@ export default {
color: #F24724; color: #F24724;
} }
} }
&--success {
background: #EAF9F1;
.customer-item-status-text {
color: #35C376;
}
}
&--failed {
background: #F5F7FA;
.customer-item-status-text {
color: #999EA8;
}
}
&--refund {
background: #FFF5E6;
.customer-item-status-text {
color: #F7A431;
}
}
} }
.customer-item-status-text { .customer-item-status-text {
...@@ -427,10 +475,11 @@ export default { ...@@ -427,10 +475,11 @@ export default {
.customer-item-arrow { .customer-item-arrow {
width: 16px; width: 16px;
height: 16px; height: 18px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-shrink: 0;
.icon-arrow-right { .icon-arrow-right {
width: 16px !important; width: 16px !important;
......
...@@ -12,7 +12,11 @@ ...@@ -12,7 +12,11 @@
<view class="cancel-button" @click="handleCancel"> <view class="cancel-button" @click="handleCancel">
取消 取消
</view> </view>
<view class="confirm-button" @click="deductSkipCount"> <view
class="confirm-button"
:class="{ 'confirm-button--disabled': confirmDisabled }"
@click="deductSkipCount"
>
{{ confirmText }} {{ confirmText }}
</view> </view>
</view> </view>
...@@ -32,14 +36,21 @@ export default { ...@@ -32,14 +36,21 @@ export default {
default: () => ({skipCount: 2}) default: () => ({skipCount: 2})
} }
}, },
computed: {
confirmDisabled() {
return this.prelearnContext?.skipCount === 0
}
},
methods: { methods: {
handleCancel() { handleCancel() {
this.$emit('cancel') this.$emit('cancel')
}, },
async deductSkipCount() { async deductSkipCount() {
if (this.confirmDisabled) return
let requestParams = { let requestParams = {
activityId:this.prelearnContext.getActivityMessagePopUpWindow activityId:this.prelearnContext.activityId
} }
console.log('deductSkipCountAPI requestParams***', requestParams);
const res = await uni.$api.commonApi.deductSkipCountAPI(requestParams) const res = await uni.$api.commonApi.deductSkipCountAPI(requestParams)
console.log('deductSkipCountAPI***', res); console.log('deductSkipCountAPI***', res);
if (res) { if (res) {
...@@ -128,6 +139,17 @@ export default { ...@@ -128,6 +139,17 @@ export default {
&:active { &:active {
opacity: 0.8; opacity: 0.8;
} }
&--disabled {
border-color: #d9d9d9;
background-image: linear-gradient(0deg, #2c66f799 0%, #48a6ff99 100%);
color: #ffffff;
pointer-events: none;
&:active {
opacity: 1;
}
}
} }
.text-red { .text-red {
color: #F24724; color: #F24724;
......
...@@ -25,7 +25,11 @@ ...@@ -25,7 +25,11 @@
</view> </view>
<!-- 按钮组(始终显示) --> <!-- 按钮组(始终显示) -->
<view class="button-group"> <view class="button-group">
<view class="confirm-button" @click="handleConfirm"> <view
class="confirm-button"
:class="{ 'confirm-button--disabled': confirmDisabled }"
@click="handleConfirm"
>
{{ confirmText }} {{ confirmText }}
</view> </view>
</view> </view>
...@@ -40,6 +44,10 @@ export default { ...@@ -40,6 +44,10 @@ export default {
type: String, type: String,
default: '跳过' default: '跳过'
}, },
confirmDisabled: {
type: Boolean,
default: false
},
prelearnData: { prelearnData: {
type: Object, type: Object,
default: () => ({}) default: () => ({})
...@@ -55,21 +63,57 @@ export default { ...@@ -55,21 +63,57 @@ export default {
if (!includes?.length) return '' if (!includes?.length) return ''
return `包含:${includes.join(' + ')}` return `包含:${includes.join(' + ')}`
}, },
handleStartStudy(item, index) { async handleStartStudy(item, index) {
if (item.learnStatus !== 'NOT_STUDY') return if (item.learnStatus !== 'NOT_STUDY') return
this.$emit('start-study', item, index)
const prelearnDataStr = encodeURIComponent(JSON.stringify(this.prelearnData)) try {
// const res = await uni.$api.commonApi.getPrelernHomePopupAPI()
const res = {
"activityId": 31,
"activityName": "618年中促活动A",
"packages": [
{
"activityProductId": "16",
"packageName": "tttttttt",
"includes": ['原厂定制车衣','玻璃贴膜'],
"learnStatus": "NOT_STUDY",
"scriptReady": true
}
],
"remainingSkipCount": 0,
"shouldPopup": true,
"muteReason": null,
"remainingActivityCount": null
}
console.log('getPrelernHomePopupAPI res***', res)
if (!res) return
const freshItem = res.packages?.find(
(pkg) => pkg.activityProductId === item.activityProductId
)
console.log('freshItem***', freshItem)
if (!freshItem?.scriptReady) {
uni.showToast({ title: '话术未就绪,请稍后重试', icon: 'none' })
return
}
this.$emit('start-study', freshItem, index)
const prelearnDataStr = encodeURIComponent(JSON.stringify(res))
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/prelearnBridge?prelearnData=${prelearnDataStr}&entrySource=home_popup`, url: `/pages/common/prelearnBridge?prelearnData=${prelearnDataStr}&entrySource=home_popup`,
fail: (err) => { fail: (err) => {
console.error('预学习桥接页跳转失败:', err) console.error('预学习桥接页跳转失败:', err)
} }
}) })
} catch (err) {
console.error('预学习首页弹框查询失败:', err)
}
}, },
handleCancel() { handleCancel() {
this.$emit('cancel') this.$emit('cancel')
}, },
handleConfirm() { handleConfirm() {
if (this.confirmDisabled) return
this.$emit('confirm') this.$emit('confirm')
} }
} }
...@@ -187,9 +231,11 @@ export default { ...@@ -187,9 +231,11 @@ export default {
} }
.confirm-button { .confirm-button {
width: toRpx(338); width: 100%;
height: toRpx(80); height: toRpx(80);
margin: 0 auto; margin: 0 auto;
padding: 0 toRpx(24);
box-sizing: border-box;
border-radius: toRpx(48); border-radius: toRpx(48);
border: toRpx(2) solid #979797; border: toRpx(2) solid #979797;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%); background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
...@@ -203,5 +249,16 @@ export default { ...@@ -203,5 +249,16 @@ export default {
&:active { &:active {
opacity: 0.8; opacity: 0.8;
} }
&--disabled {
border-color: #d9d9d9;
background-image: linear-gradient(0deg, #2c66f799 0%, #48a6ff99 100%);
color: #ffffff;
pointer-events: none;
&:active {
opacity: 1;
}
}
} }
</style> </style>
...@@ -182,19 +182,19 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -182,19 +182,19 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
popKey: 'carBrandVisible' popKey: 'carBrandVisible'
}, },
{ {
label: '交付日期',
valueKey: 'arrivalDate',
key: 'arrivalDate',
required: true,
type: 'date'
},
{
label: '流量来源', label: '流量来源',
valueKey: 'residentSaleName', valueKey: 'residentSaleName',
key: 'residentSaleId', key: 'residentSaleId',
type: 'select', type: 'select',
required: true, required: true,
popKey: 'residentSaleVisible' popKey: 'residentSaleVisible'
},
{
label: '交付日期',
valueKey: 'arrivalDate',
key: 'arrivalDate',
required: true,
type: 'date'
} }
// { // {
// label: '接待场景', // label: '接待场景',
...@@ -269,6 +269,10 @@ export default { ...@@ -269,6 +269,10 @@ export default {
this.endDate = dayjs(dayjs().add(30, 'day')).format("YYYY-MM-DD") this.endDate = dayjs(dayjs().add(30, 'day')).format("YYYY-MM-DD")
}, },
methods: { methods: {
async getCustomerGroupInfo() {
const res = await uni.$api.customerApi.getCustomerGroupInfoAPI({merchantId: 44211227})
console.log('getCustomerGroupInfoAPI***', res)
},
initForm () { initForm () {
const { sceneType } = uni.$storage.get("userInfo") const { sceneType } = uni.$storage.get("userInfo")
default_customerForm[0].maxlength = sceneType == 1 ? 20 : 50 default_customerForm[0].maxlength = sceneType == 1 ? 20 : 50
...@@ -373,7 +377,7 @@ export default { ...@@ -373,7 +377,7 @@ export default {
}) })
let { customerInfo, customerForm, optionalForm } = this, let { customerInfo, customerForm, optionalForm } = this,
{ shopMerchantId, sceneType } = uni.$storage.get("userInfo"), { shopMerchantId, sceneType } = uni.$storage.get("userInfo"),
targetApi = customerInfo.id ? 'updateVisitsInfo' : 'saveVisitsInfo', targetApi = customerInfo.id ? 'submitCustomerProfileAPI' : 'submitCustomerProfileAPI',
params = { params = {
merchantId: shopMerchantId, merchantId: shopMerchantId,
bussinessScene: sceneType == 0 ? 1 : 2 bussinessScene: sceneType == 0 ? 1 : 2
...@@ -400,9 +404,50 @@ export default { ...@@ -400,9 +404,50 @@ export default {
mask: true mask: true
}) })
console.log('params**', params) console.log('params**', params)
// const res = await uni.$api.customerApi[targetApi](params), // {
const res = await uni.$api.customerApi.submitCustomerProfileAPI([params]), // "merchantId": 44211227,
// "bussinessScene": 2,
// "customerName": "linl",
// "customerPhone": "13588008885",
// "carTypeName": "问界M7",
// "arrivalDate": "2026-06-25",
// "residentSaleId": "997c9fbb64b046ac900d751d99d0273d",
// "standNo": "",
// "filingDate": "",
// "carTypeId": 1149147,
// "carBrand": "AITO 问界",
// "carBrandId": 3454,
// "oneCarBrand": "鸿蒙智行",
// "oneCarBrandId": 2978,
// "employeeName": "成威2号",
// "userId": "e77729f1a544442a8f43e587e1f6d20a",
// "sellerMerchantId": 44209880
// }
let requestParams = {
userId:params.userId,
merchantId:params.merchantId,
employeeName:params.employeeName,
sellerMerchantId:params.sellerMerchantId,
preliminaryOrders: [
{
customerName:params.customerName,
customerPhone:params.customerPhone,
carBrand:params.carBrand,
carBrandId:params.carBrandId,
carChildsBrandId:'',
carChildsBrandName:'',
carSeriesId:params.carTypeId,
carSeriesName:params.carTypeName,
deliveryDate:params.arrivalDate, //交付日期
inviteDate:'', //到店日期
createdDate:'', //建档日期
}
]
}
console.log('requestParams**', requestParams)
const res = await uni.$api.customerApi[targetApi](requestParams),
_this = this _this = this
console.log('submitCustomerProfileAPI res**', res)
if (res) { if (res) {
if (res == '1') { if (res == '1') {
this.$refs.successRef.open() this.$refs.successRef.open()
...@@ -428,8 +473,10 @@ export default { ...@@ -428,8 +473,10 @@ export default {
uni.hideLoading() uni.hideLoading()
} }
} catch (error) { } catch (error) {
let index = this.customerForm.findIndex(e => e.key == error) const index = this.customerForm.findIndex(e => e.key == error)
if (index !== -1) {
this.customerForm[index].error = true this.customerForm[index].error = true
}
uni.hideLoading() uni.hideLoading()
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!