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
......@@ -167,11 +167,22 @@ module.exports = {
...data
})
},
/**
/**
* 轻改业务改版
* 2、客户建档提交
*/
csubmitCustomerProfileAPI(data) {
submitPreliminaryOrderAPI(data) {
return http.post({
method: 'dj.api.smartcarlife.order.preliminaryOrder.batch',
projectName: 'pad',
...data
})
},
/**
* 轻改业务改版
* 3、客户建档提交
*/
submitCustomerProfileAPI(data) {
return http.post({
method: 'dj.api.smartcarlife.order.submitCustomerProfile',
projectName: 'pad',
......
......@@ -28,114 +28,128 @@
</view>
<scroll-view class="customer-list" scroll-y show-scrollbar="false">
<view class="customer-list-inner">
<view class="customer-count">
<view class="customer-count-left">
<image
class="customer-count-icon"
:src="require('@/assets/images/common/icon-customer-count.png')"
mode="aspectFit"
/>
<text class="customer-count-label">今日({{ todayDate }})已建档</text>
</view>
<view class="customer-count-right">
<text class="customer-count-num">{{ todayCustomerCount }}</text>
<text class="customer-count-unit">位客户</text>
</view>
</view>
<view
v-for="item in customerList"
:key="item.id"
class="customer-item"
v-for="group in customerProfile"
:key="group.date"
class="customer-day-group"
>
<view class="customer-item-avatar">
<text class="customer-item-avatar-text">{{ item.surname }}</text>
</view>
<view class="customer-item-body" @click="handleGoCustomerDetail(item)">
<view class="customer-item-row customer-item-row--name">
<text class="customer-item-name">{{ item.name }}</text>
<view v-if="item.carModel" class="customer-item-car-tag">
<text class="customer-item-car-text">{{ item.carModel }}</text>
<view class="customer-count">
<view class="customer-count-left">
<image
class="customer-count-icon"
:src="require('@/assets/images/common/icon-customer-count.png')"
mode="aspectFit"
/>
<text class="customer-count-label">{{ formatDateLabel(group.date) }}已建档</text>
</view>
<view class="customer-count-right">
<text class="customer-count-num">{{ group.number || 0 }}</text>
<text class="customer-count-unit">位客户</text>
</view>
</view>
<view class="customer-item-row customer-item-row--meta">
<text class="customer-item-meta">{{ item.phone }}</text>
<view class="customer-item-divider"></view>
<text class="customer-item-meta">交付{{ item.deliveryDate }}</text>
<view class="customer-item-divider"></view>
<text class="customer-item-meta">到店{{ item.visitDate }}</text>
</view>
<view class="customer-item-row customer-item-row--group">
<text class="customer-item-group">客户群:{{ item.groupName }}</text>
</view>
</view>
<view class="customer-item-side">
<view
v-if="item.status"
:class="['customer-item-status', `customer-item-status--${item.statusType || 'warning'}`]"
v-for="item in group.customerProfileInfoDTOS || []"
:key="item.id"
class="customer-item"
>
<text class="customer-item-status-text">{{ item.status }}</text>
</view>
<view class="customer-item-arrow">
<view class="sprite-icon icon-arrow-right"></view>
<view class="customer-item-avatar">
<text class="customer-item-avatar-text">{{ getCustomerSurname(item.customerName) }}</text>
</view>
<view class="customer-item-body" @click="handleGoCustomerDetail(item)">
<view class="customer-item-row customer-item-row--name">
<view class="customer-item-name-left">
<text class="customer-item-name">{{ item.customerName || '-' }}</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 class="customer-item-row customer-item-row--meta">
<text class="customer-item-meta">{{ item.customerPhone || '-' }}</text>
<view class="customer-item-divider"></view>
<text class="customer-item-meta">交付{{ formatDisplayDate(item.deliveryDate) }}</text>
<view class="customer-item-divider"></view>
<text class="customer-item-meta">到店{{ formatDisplayDate(item.inviteDate) }}</text>
</view>
<view class="customer-item-row customer-item-row--group">
<text class="customer-item-group">客户群:{{ item.qwGroupName || '-' }}</text>
<view class="customer-item-arrow">
<view class="sprite-icon icon-arrow-right"></view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
<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 {
name: 'CustomerSide',
props: {
type: {
type: String,
default: 'out'
}
},
data() {
return {
customerList: MOCK_CUSTOMER_LIST,
todayCustomerCount: 8
}
},
computed: {
todayDate() {
const now = new Date()
const month = String(now.getMonth() + 1).padStart(2, '0')
const day = String(now.getDate()).padStart(2, '0')
return `${month}-${day}`
},
customerProfile: {
type: Array,
default: () => []
}
},
methods: {
getCustomerSurname(name) {
if (!name) return ''
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
},
formatDateLabel(dateStr) {
const display = this.formatDisplayDate(dateStr)
if (!dateStr) return display
const now = new Date()
const todayStr = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`
if (dateStr === todayStr) {
return `今日(${display})`
}
return display
},
handleGoCustomerFiles() {
uni.navigateTo({
url: '/pages/common/customerPages/addFiles',
......@@ -241,6 +255,14 @@ export default {
box-sizing: border-box;
}
.customer-day-group {
margin-bottom: 8px;
&:last-child {
margin-bottom: 0;
}
}
.customer-count {
display: flex;
align-items: center;
......@@ -337,7 +359,8 @@ export default {
min-width: 0;
&--name {
gap: 6px;
justify-content: space-between;
gap: 8px;
}
&--meta {
......@@ -346,10 +369,20 @@ export default {
}
&--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 {
font-size: 16px;
line-height: 22px;
......@@ -397,19 +430,10 @@ export default {
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 {
padding: 0 8px;
border-radius: 4px;
background: #FDECE9;
flex-shrink: 0;
&--warning {
background: #FDECE9;
......@@ -418,6 +442,30 @@ export default {
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 {
......@@ -427,10 +475,11 @@ export default {
.customer-item-arrow {
width: 16px;
height: 16px;
height: 18px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
.icon-arrow-right {
width: 16px !important;
......
......@@ -12,7 +12,11 @@
<view class="cancel-button" @click="handleCancel">
取消
</view>
<view class="confirm-button" @click="deductSkipCount">
<view
class="confirm-button"
:class="{ 'confirm-button--disabled': confirmDisabled }"
@click="deductSkipCount"
>
{{ confirmText }}
</view>
</view>
......@@ -32,14 +36,21 @@ export default {
default: () => ({skipCount: 2})
}
},
computed: {
confirmDisabled() {
return this.prelearnContext?.skipCount === 0
}
},
methods: {
handleCancel() {
this.$emit('cancel')
},
async deductSkipCount() {
if (this.confirmDisabled) return
let requestParams = {
activityId:this.prelearnContext.getActivityMessagePopUpWindow
activityId:this.prelearnContext.activityId
}
console.log('deductSkipCountAPI requestParams***', requestParams);
const res = await uni.$api.commonApi.deductSkipCountAPI(requestParams)
console.log('deductSkipCountAPI***', res);
if (res) {
......@@ -128,6 +139,17 @@ export default {
&:active {
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 {
color: #F24724;
......
......@@ -25,7 +25,11 @@
</view>
<!-- 按钮组(始终显示) -->
<view class="button-group">
<view class="confirm-button" @click="handleConfirm">
<view
class="confirm-button"
:class="{ 'confirm-button--disabled': confirmDisabled }"
@click="handleConfirm"
>
{{ confirmText }}
</view>
</view>
......@@ -40,6 +44,10 @@ export default {
type: String,
default: '跳过'
},
confirmDisabled: {
type: Boolean,
default: false
},
prelearnData: {
type: Object,
default: () => ({})
......@@ -55,21 +63,57 @@ export default {
if (!includes?.length) return ''
return `包含:${includes.join(' + ')}`
},
handleStartStudy(item, index) {
async handleStartStudy(item, index) {
if (item.learnStatus !== 'NOT_STUDY') return
this.$emit('start-study', item, index)
const prelearnDataStr = encodeURIComponent(JSON.stringify(this.prelearnData))
uni.navigateTo({
url: `/pages/common/prelearnBridge?prelearnData=${prelearnDataStr}&entrySource=home_popup`,
fail: (err) => {
console.error('预学习桥接页跳转失败:', err)
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({
url: `/pages/common/prelearnBridge?prelearnData=${prelearnDataStr}&entrySource=home_popup`,
fail: (err) => {
console.error('预学习桥接页跳转失败:', err)
}
})
} catch (err) {
console.error('预学习首页弹框查询失败:', err)
}
},
handleCancel() {
this.$emit('cancel')
},
handleConfirm() {
if (this.confirmDisabled) return
this.$emit('confirm')
}
}
......@@ -187,9 +231,11 @@ export default {
}
.confirm-button {
width: toRpx(338);
width: 100%;
height: toRpx(80);
margin: 0 auto;
padding: 0 toRpx(24);
box-sizing: border-box;
border-radius: toRpx(48);
border: toRpx(2) solid #979797;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
......@@ -203,5 +249,16 @@ export default {
&:active {
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>
......@@ -182,19 +182,19 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
popKey: 'carBrandVisible'
},
{
label: '交付日期',
valueKey: 'arrivalDate',
key: 'arrivalDate',
required: true,
type: 'date'
},
{
label: '流量来源',
valueKey: 'residentSaleName',
key: 'residentSaleId',
type: 'select',
required: true,
popKey: 'residentSaleVisible'
},
{
label: '交付日期',
valueKey: 'arrivalDate',
key: 'arrivalDate',
required: true,
type: 'date'
}
// {
// label: '接待场景',
......@@ -269,6 +269,10 @@ export default {
this.endDate = dayjs(dayjs().add(30, 'day')).format("YYYY-MM-DD")
},
methods: {
async getCustomerGroupInfo() {
const res = await uni.$api.customerApi.getCustomerGroupInfoAPI({merchantId: 44211227})
console.log('getCustomerGroupInfoAPI***', res)
},
initForm () {
const { sceneType } = uni.$storage.get("userInfo")
default_customerForm[0].maxlength = sceneType == 1 ? 20 : 50
......@@ -373,7 +377,7 @@ export default {
})
let { customerInfo, customerForm, optionalForm } = this,
{ shopMerchantId, sceneType } = uni.$storage.get("userInfo"),
targetApi = customerInfo.id ? 'updateVisitsInfo' : 'saveVisitsInfo',
targetApi = customerInfo.id ? 'submitCustomerProfileAPI' : 'submitCustomerProfileAPI',
params = {
merchantId: shopMerchantId,
bussinessScene: sceneType == 0 ? 1 : 2
......@@ -400,9 +404,50 @@ export default {
mask: true
})
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
console.log('submitCustomerProfileAPI res**', res)
if (res) {
if (res == '1') {
this.$refs.successRef.open()
......@@ -428,8 +473,10 @@ export default {
uni.hideLoading()
}
} catch (error) {
let index = this.customerForm.findIndex(e => e.key == error)
this.customerForm[index].error = true
const index = this.customerForm.findIndex(e => e.key == error)
if (index !== -1) {
this.customerForm[index].error = true
}
uni.hideLoading()
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!