Commit 9f3d77ab by Lin

feat(customFiles): 添加客户建档详情页面及相关功能

- 在 pages.json 中新增客户建档详情页面的条目,并设置自定义导航样式。
- 更新 CustomerSide 组件,修改点击事件以导航至客户建档详情页面。
- 在 addFiles.vue 中添加必填和选填信息的表单结构,优化用户输入体验。
- 新增 detailFiles.vue 组件,展示客户详细信息及相关操作按钮。
1 parent f2fd8631
......@@ -41,12 +41,11 @@
v-for="item in customerList"
:key="item.id"
class="customer-item"
@click="handleCustomerItemClick(item)"
>
<view class="customer-item-avatar">
<text class="customer-item-avatar-text">{{ item.surname }}</text>
</view>
<view class="customer-item-body">
<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">
......@@ -138,8 +137,12 @@ export default {
animationDuration: 100
})
},
handleCustomerItemClick(item) {
console.log('点击客户卡片:', item)
handleGoCustomerDetail(item) {
uni.navigateTo({
url: `/pages/common/customFiles/detailFiles?customerId=${item.id}`,
animationType: 'pop-in',
animationDuration: 100
})
}
}
}
......@@ -308,6 +311,7 @@ export default {
display: flex;
flex-direction: column;
gap: 6px;
cursor: pointer;
}
.customer-item-row {
......
......@@ -167,6 +167,12 @@
}
},
{
"path": "pages/common/customFiles/detailFiles",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/caseDetail",
"style": {
"navigationStyle": "custom"
......
......@@ -8,6 +8,7 @@
</view>
<view class="detail-content">
<view class="detail-panel">
<view class="form-header">必填信息</view>
<view class="form-box flex">
<template v-for="(i, index) in customerForm">
<view class="form-item flex" :key="index">
......@@ -31,7 +32,52 @@
fields="day"
:start="startDate"
:end="endDate"
@change="bindDateChange"
@change="bindDateChange($event, i.valueKey)"
:value="customerInfo[i.valueKey]"
>
<view :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]">
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view>
</picker>
</template>
<template v-else>
<view
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
@click="showPopup(i.popKey)"
>
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view>
</template>
</view>
</template>
</view>
<view class="form-header">选填信息</view>
<view class="form-box flex">
<template v-for="(i, index) in optionalForm">
<view class="form-item flex" :key="index">
<view class="label flex">
<view class="required" v-if="i.required">*</view>{{ i.label }}
</view>
<template v-if="i.type == 'input'">
<input
:type="i.inputType"
:maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]"
:class="['input', { error: i.error }]"
placeholder="请选择"
placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done"
/>
</template>
<template v-else-if="i.type == 'date'">
<picker
mode="date"
fields="day"
:start="startDate"
:end="endDate"
@change="bindDateChange($event, i.valueKey)"
:value="customerInfo[i.valueKey]"
>
<view :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]">
......@@ -78,6 +124,12 @@
@select="handleSelect($event, 'receptionSceneVisible')"
:customerInfo="customerInfo"
></reception-sence>
<employee
ref="residentSaleVisible"
title="驻店零售"
:salesPropsUuid="customerInfo.residentSaleId"
@select="handleSelect($event, 'residentSaleVisible')"
/>
</view>
<uni-popup ref="successRef" type="message">
<uni-popup-message
......@@ -94,6 +146,7 @@ import CarBrands from '@/components/CarBrands.vue'
import dayjs from 'dayjs'
import CustomerTags from '@/components/HomeFrame/components/ReceptionCenter/CustomerTags.vue'
import ReceptionSence from '@/components/HomeFrame/components/ReceptionCenter/ReceptionSence.vue'
import Employee from '@/components/Employee.vue'
const phoneRex = /^[1]([3-9])[0-9]{9}$/,
default_customerForm = [{
......@@ -106,7 +159,7 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
maxlength: 50
},
{
label: '车主电话',
label: '手机号',
valueKey: 'ownerPhone',
key: 'ownerPhone',
type: 'input',
......@@ -116,7 +169,7 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
error: false
},
{
label: '品牌车型',
label: '车型',
valueKey: 'brandModel',
key: 'brandModel',
type: 'select',
......@@ -124,32 +177,58 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
popKey: 'carBrandVisible'
},
{
label: '接待场景',
valueKey: 'receptionSceneName',
key: 'receptionScene',
label: '交付日期',
valueKey: 'arrivalDate',
key: 'arrivalDate',
type: 'date'
},
// {
// label: '接待场景',
// valueKey: 'receptionSceneName',
// key: 'receptionScene',
// type: 'select',
// required: true,
// popKey: 'receptionSceneVisible'
// },
{
label: '流量来源',
valueKey: 'customerTagName',
key: 'customerTagName',
type: 'select',
required: true,
popKey: 'receptionSceneVisible'
popKey: 'customerTagstVisible'
}],
default_optionalForm = [{
label: '车架号',
valueKey: 'standNo',
key: 'standNo',
type: 'input',
inputType: 'text',
maxlength: 17
},
{
label: '到店日期',
valueKey: 'arrivalDate',
key: 'arrivalDate',
type: 'date',
required: true,
type: 'date'
},
{
label: '客户标签',
valueKey: 'customerTagName',
key: 'customerTagName',
label: '驻店零售',
valueKey: 'residentSaleName',
key: 'residentSaleId',
type: 'select',
required: true,
popKey: 'customerTagstVisible'
popKey: 'residentSaleVisible'
},
{
label: '建档日期',
valueKey: 'filingDate',
key: 'filingDate',
type: 'date'
}]
export default {
name: 'AddFiles',
components: { CarBrands, CustomerTags, ReceptionSence },
components: { CarBrands, CustomerTags, ReceptionSence, Employee },
computed: {
check () {
let { customerForm, customerInfo } = this,
......@@ -181,6 +260,7 @@ export default {
return {
customerId: '',
customerForm: [],
optionalForm: [],
customerInfo: {},
startDate: '',
endDate: '',
......@@ -202,6 +282,7 @@ export default {
this.$store.dispatch("clearCustomerInfo")
this.$store.dispatch("clearHistory")
this.customerForm = JSON.parse(JSON.stringify(default_customerForm))
this.optionalForm = JSON.parse(JSON.stringify(default_optionalForm))
this.customerInfo = {
ownerName: '',
ownerPhone: '',
......@@ -209,7 +290,11 @@ export default {
receptionScene: '',
arrivalDate: '',
customerTagName: '',
receptionSceneName: ''
receptionSceneName: '',
standNo: '',
residentSaleName: '',
residentSaleId: '',
filingDate: ''
}
if (this.customerId) this.findVisitsInfo()
},
......@@ -219,7 +304,8 @@ export default {
})
if (res.customerTag) this.customerTag = res.customerTag
res.customerTagName = res.customerTagName.replace(/,/g, '|')
res.arrivalDate = dayjs(res.arrivalDate).format("YYYY-MM-DD")
if (res.arrivalDate) res.arrivalDate = dayjs(res.arrivalDate).format("YYYY-MM-DD")
if (res.filingDate) res.filingDate = dayjs(res.filingDate).format("YYYY-MM-DD")
this.customerInfo = res
},
backPage () {
......@@ -253,13 +339,16 @@ export default {
})
this.customerInfo.customerTagName = names.join('|')
this.customerTag = ids.join(',')
} else if (popkey == 'residentSaleVisible') {
this.customerInfo.residentSaleName = item.staffName
this.customerInfo.residentSaleId = item.uuid
} else {
this.customerInfo.receptionSceneName = item.receptionSceneName
this.customerInfo.receptionScene = item.id
}
},
bindDateChange (e) {
this.customerInfo.arrivalDate = e.detail.value
bindDateChange (e, valueKey) {
this.customerInfo[valueKey] = e.detail.value
},
async submit () {
if (this.check) return
......@@ -267,7 +356,7 @@ export default {
this.customerForm.map(e => {
e.error = false
})
let { customerInfo, customerForm, customerTag } = this,
let { customerInfo, customerForm, optionalForm, customerTag } = this,
{ shopMerchantId, sceneType } = uni.$storage.get("userInfo"),
targetApi = customerInfo.id ? 'updateVisitsInfo' : 'saveVisitsInfo',
params = {
......@@ -279,6 +368,9 @@ export default {
customerForm.map(e => {
params[e.key] = customerInfo[e.key]
})
optionalForm.map(e => {
params[e.key] = customerInfo[e.key]
})
if (customerInfo.id) params.id = customerInfo.id
Object.assign(params, {
carModelId: customerInfo.carModelId,
......@@ -369,32 +461,45 @@ export default {
.detail-content {
height: calc(100vh - #{toRpx(212)});
overflow-y: auto;
.detail-panel {
width: 100%;
height: 100%;
min-height: 100%;
height: auto;
border-radius: toRpx(48);
background: #ffffff59;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
padding: toRpx(32) toRpx(48);
box-sizing: border-box;
overflow: hidden;
display: flex;
flex-direction: column;
.form-header {
width: 100%;
height: 28px;
font-size: 13px;
color: #2c66f7;
border-radius: 4px;
background: rgba(44, 102, 247, 0.05);
display: flex;
align-items: center;
justify-content: center;
}
}
}
.form-box {
flex: 1;
flex-shrink: 0;
flex-wrap: wrap;
padding: toRpx(32) toRpx(40);
align-items: flex-start;
align-content: flex-start;
row-gap: 20px;
padding: toRpx(40) toRpx(40);
justify-content: space-between;
overflow-y: auto;
.form-item {
width: toRpx(934);
height: toRpx(80);
margin-bottom: toRpx(48);
font-size: toRpx(28);
}
......
<template>
<view class="detail-box">
<view class="nav-bar">
<view class="back" @click="backPage">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title">客户建档详情</view>
</view>
<view class="detail-content">
<view class="detail-panel">
<view class="detail-info">
<view class="detail-info-bg"></view>
<view class="detail-info-body flex">
<view class="detail-info-left flex">
<view class="user-tag">
<text class="user-tag-text">{{ customerSurname }}</text>
</view>
<view class="user-name">{{ customerInfo.ownerName || '-' }}</view>
<view class="active-list flex">
<view
v-for="(tag, index) in activityTagList"
:key="index"
class="active-item"
>
{{ tag }}
</view>
</view>
</view>
<view
v-if="upgradeStatusInfo"
:class="['detail-info-right', `detail-info-right--${upgradeStatusInfo.type}`]"
>
{{ upgradeStatusInfo.label }}
</view>
</view>
</view>
<view class="form-header">基本信息</view>
<view class="form-box flex">
<template v-for="(i, index) in customerForm">
<view class="form-item flex" :key="index">
<view class="label flex">
<view class="required" v-if="i.required">*</view>{{ i.label }}
</view>
<template v-if="i.type == 'input'">
<input
:type="i.inputType"
:maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]"
:class="['input', { error: i.error }]"
placeholder="请选择"
placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done"
/>
</template>
<template v-else-if="i.type == 'date'">
<picker
mode="date"
fields="day"
:start="startDate"
:end="endDate"
@change="bindDateChange($event, i.valueKey)"
:value="customerInfo[i.valueKey]"
>
<view :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]">
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view>
</picker>
</template>
<template v-else>
<view
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
@click="showPopup(i.popKey)"
>
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view>
</template>
</view>
</template>
</view>
<view class="form-box form-box--no-top flex">
<template v-for="(i, index) in optionalForm">
<view class="form-item flex" :key="index">
<view class="label flex">
<view class="required" v-if="i.required">*</view>{{ i.label }}
</view>
<template v-if="i.type == 'input'">
<input
:type="i.inputType"
:maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]"
:class="['input', { error: i.error }]"
placeholder="请选择"
placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done"
/>
</template>
<template v-else-if="i.type == 'date'">
<picker
mode="date"
fields="day"
:start="startDate"
:end="endDate"
@change="bindDateChange($event, i.valueKey)"
:value="customerInfo[i.valueKey]"
>
<view :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]">
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view>
</picker>
</template>
<template v-else>
<view
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
@click="showPopup(i.popKey)"
>
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view>
</template>
</view>
</template>
</view>
<view class="form-header">客户群消息</view>
<view class="form-box flex">
<template v-for="(i, index) in groupForm">
<view :class="['form-item flex', { 'form-item--full': i.fullWidth }]" :key="index">
<view class="label flex">
<view class="required" v-if="i.required">*</view>{{ i.label }}
</view>
<template v-if="i.type == 'readonly'">
<view class="input input--readonly text-hide">{{ customerInfo[i.valueKey] || '-' }}</view>
</template>
<template v-else-if="i.type == 'input'">
<view class="input-box flex">
<input
:type="i.inputType || 'text'"
:maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]"
class="input input--count"
placeholder="请输入"
placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done"
/>
<view v-if="i.showCount" class="input-count">{{ (customerInfo[i.valueKey] || '').length }}/{{ i.maxlength }}</view>
</view>
</template>
<template v-else-if="i.type == 'select'">
<view
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
@click="showPopup(i.popKey)"
>
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view>
</template>
</view>
</template>
</view>
<view class="btns flex">
<view class="btn cancel" @click="backPage">取消</view>
<view :class="['btn', { disabled: check }]" @click="submit">提交</view>
</view>
</view>
</view>
<view class="popup">
<car-brands
ref="carBrandVisible"
@select="handleSelect($event, 'carBrandVisible')"
:echoData="customerInfo"
carBrandKey="carBrand"
carModelKey="brandModel"
customBoolean
/>
<customer-tags
ref="customerTagstVisible"
@select="handleSelect($event, 'customerTagstVisible')"
:chooseList="tagsList"
></customer-tags>
<reception-sence
ref="receptionSceneVisible"
@select="handleSelect($event, 'receptionSceneVisible')"
:customerInfo="customerInfo"
></reception-sence>
<employee
ref="residentSaleVisible"
title="驻店零售"
:salesPropsUuid="customerInfo.residentSaleId"
@select="handleSelect($event, 'residentSaleVisible')"
/>
<employee
ref="groupMemberVisible"
title="群成员关联"
:salesPropsUuid="customerInfo.groupMemberId"
@select="handleSelect($event, 'groupMemberVisible')"
/>
</view>
<uni-popup ref="successRef" type="message">
<uni-popup-message
type="success"
message="数据保存成功"
:duration="1500"
></uni-popup-message>
</uni-popup>
</view>
</template>
<script type='text/ecmascript-6'>
import CarBrands from '@/components/CarBrands.vue'
import dayjs from 'dayjs'
import CustomerTags from '@/components/HomeFrame/components/ReceptionCenter/CustomerTags.vue'
import ReceptionSence from '@/components/HomeFrame/components/ReceptionCenter/ReceptionSence.vue'
import Employee from '@/components/Employee.vue'
const phoneRex = /^[1]([3-9])[0-9]{9}$/,
default_customerForm = [{
label: '车主姓名',
valueKey: 'ownerName',
key: 'ownerName',
type: 'input',
inputType: 'text',
required: true,
maxlength: 50
},
{
label: '手机号',
valueKey: 'ownerPhone',
key: 'ownerPhone',
type: 'input',
inputType: 'tel',
required: true,
maxlength: 11,
error: false
},
{
label: '车型',
valueKey: 'brandModel',
key: 'brandModel',
type: 'select',
required: true,
popKey: 'carBrandVisible'
},
{
label: '交付日期',
valueKey: 'arrivalDate',
key: 'arrivalDate',
type: 'date'
},
// {
// label: '接待场景',
// valueKey: 'receptionSceneName',
// key: 'receptionScene',
// type: 'select',
// required: true,
// popKey: 'receptionSceneVisible'
// },
{
label: '流量来源',
valueKey: 'customerTagName',
key: 'customerTagName',
type: 'select',
required: true,
popKey: 'customerTagstVisible'
}],
default_optionalForm = [{
label: '车架号',
valueKey: 'standNo',
key: 'standNo',
type: 'input',
inputType: 'text',
maxlength: 17
},
{
label: '到店日期',
valueKey: 'arrivalDate',
key: 'arrivalDate',
type: 'date'
},
{
label: '驻店零售',
valueKey: 'residentSaleName',
key: 'residentSaleId',
type: 'select',
popKey: 'residentSaleVisible'
},
{
label: '建档日期',
valueKey: 'filingDate',
key: 'filingDate',
type: 'date'
}],
default_groupForm = [{
label: '客户群',
valueKey: 'groupName',
key: 'groupName',
type: 'readonly'
},
{
label: '群成员关联',
valueKey: 'groupMemberName',
key: 'groupMemberId',
type: 'select',
popKey: 'groupMemberVisible'
},
{
label: '备注',
valueKey: 'groupRemark',
key: 'groupRemark',
type: 'input',
inputType: 'text',
maxlength: 200,
fullWidth: true,
showCount: true
}]
export default {
name: 'DetailFiles',
components: { CarBrands, CustomerTags, ReceptionSence, Employee },
computed: {
check () {
let { customerForm, customerInfo } = this,
result = false
try {
customerForm.map(e => {
if (e.required && !customerInfo[e.key]) throw true
})
} catch (error) {
result = error
}
return result
},
tagsList () {
let list = [],
{ customerInfo, customerTag } = this,
names = customerInfo.customerTagName ? customerInfo.customerTagName.split('|') : [],
isd = customerTag ? customerTag.split(',') : []
names.map((e, index) => {
list.push({
labelName: e,
labelId: isd[index]
})
})
return list
},
customerSurname () {
const name = this.customerInfo.ownerName || ''
return name ? name.charAt(0) : ''
},
activityTagList () {
const { customerInfo } = this
return [customerInfo.packageName, customerInfo.activityName].filter(Boolean)
},
upgradeStatusInfo () {
const { customerInfo } = this
if (customerInfo.upgradeStatusName) {
return {
label: customerInfo.upgradeStatusName,
type: this.getUpgradeStatusType(customerInfo.upgradeStatusName)
}
}
const statusMap = {
1: { label: '待跟进', type: 'warning' },
2: { label: '不升级', type: 'default' },
4: { label: '已升级', type: 'success' }
}
const status = customerInfo.upgradeStatus ?? customerInfo.orderStatus
return statusMap[status] || null
}
},
data () {
return {
customerId: '',
customerForm: [],
optionalForm: [],
groupForm: [],
customerInfo: {},
startDate: '',
endDate: '',
customerTag: ''
}
},
onLoad (options) {
this.customerId = options.customerId || ''
this.initForm()
},
mounted () {
this.startDate = dayjs(dayjs().subtract(7, 'day')).format("YYYY-MM-DD")
this.endDate = dayjs(dayjs().add(30, 'day')).format("YYYY-MM-DD")
},
methods: {
getUpgradeStatusType (label) {
if (label === '已升级') return 'success'
if (label === '待跟进') return 'warning'
if (label === '战败') return 'failed'
return 'default'
},
initForm () {
const { sceneType } = uni.$storage.get("userInfo")
default_customerForm[0].maxlength = sceneType == 1 ? 20 : 50
this.$store.dispatch("clearCustomerInfo")
this.$store.dispatch("clearHistory")
this.customerForm = JSON.parse(JSON.stringify(default_customerForm))
this.optionalForm = JSON.parse(JSON.stringify(default_optionalForm))
this.groupForm = JSON.parse(JSON.stringify(default_groupForm))
this.customerInfo = {
ownerName: '',
ownerPhone: '',
brandModel: '',
receptionScene: '',
arrivalDate: '',
customerTagName: '',
receptionSceneName: '',
standNo: '',
residentSaleName: '',
residentSaleId: '',
filingDate: '',
groupName: '',
groupMemberName: '',
groupMemberId: '',
groupRemark: ''
}
if (this.customerId) this.findVisitsInfo()
},
async findVisitsInfo () {
const res = await uni.$api.customerApi.findVisitsInfo({
id: this.customerId
})
if (res.customerTag) this.customerTag = res.customerTag
res.customerTagName = res.customerTagName.replace(/,/g, '|')
if (res.arrivalDate) res.arrivalDate = dayjs(res.arrivalDate).format("YYYY-MM-DD")
if (res.filingDate) res.filingDate = dayjs(res.filingDate).format("YYYY-MM-DD")
this.customerInfo = res
},
backPage () {
uni.navigateBack({
delta: 1,
animationType: 'pop-out',
animationDuration: 100
})
},
showPopup (e) {
this.$refs[e].open()
},
handleSelect (item, popkey) {
this.$refs[popkey].close()
if (popkey == 'carBrandVisible') {
this.$refs.carBrandVisible.close()
Object.assign(this.customerInfo, {
brandModel: item.name,
carModelId: item.id,
carBrand: item.carChildsBrandName,
carBrandId: item.carChildsBrandId,
oneCarBrand: item.carBrand,
oneCarBrandId: item.carBrandId
})
} else if (popkey == 'customerTagstVisible') {
let names = [],
ids = []
item.map(i => {
names.push(i.labelName)
ids.push(i.labelId)
})
this.customerInfo.customerTagName = names.join('|')
this.customerTag = ids.join(',')
} else if (popkey == 'residentSaleVisible') {
this.customerInfo.residentSaleName = item.staffName
this.customerInfo.residentSaleId = item.uuid
} else if (popkey == 'groupMemberVisible') {
this.customerInfo.groupMemberName = item.staffName
this.customerInfo.groupMemberId = item.uuid
} else {
this.customerInfo.receptionSceneName = item.receptionSceneName
this.customerInfo.receptionScene = item.id
}
},
bindDateChange (e, valueKey) {
this.customerInfo[valueKey] = e.detail.value
},
async submit () {
if (this.check) return
try {
this.customerForm.map(e => {
e.error = false
})
let { customerInfo, customerForm, optionalForm, groupForm, customerTag } = this,
{ shopMerchantId, sceneType } = uni.$storage.get("userInfo"),
targetApi = customerInfo.id ? 'updateVisitsInfo' : 'saveVisitsInfo',
params = {
customerTag,
merchantId: shopMerchantId,
bussinessScene: sceneType == 0 ? 1 : 2
}
if (!phoneRex.test(customerInfo.ownerPhone)) throw 'ownerPhone'
customerForm.map(e => {
params[e.key] = customerInfo[e.key]
})
optionalForm.map(e => {
params[e.key] = customerInfo[e.key]
})
groupForm.map(e => {
params[e.key] = customerInfo[e.key]
})
if (customerInfo.id) params.id = customerInfo.id
Object.assign(params, {
carModelId: customerInfo.carModelId,
carBrand: customerInfo.carBrand,
carBrandId: customerInfo.carBrandId,
oneCarBrand: customerInfo.oneCarBrand,
oneCarBrandId: customerInfo.oneCarBrandId
})
params.customerTagName = params.customerTagName.replace(/|/g, ',')
uni.showLoading({
mask: true
})
const res = await uni.$api.customerApi[targetApi](params),
_this = this
if (res) {
if (res == '1') {
this.$refs.successRef.open()
setTimeout(() => {
uni.hideLoading()
this.backPage()
}, 1e3)
} else {
uni.showModal({
content: '存在与该手机号相同的接待记录,系统将自动归类到已接待',
showCancel: false,
confirmText: '确认',
confirmColor: '#347BFF',
success (res) {
if (res.confirm) {
_this.backPage()
}
}
})
uni.hideLoading()
}
} else {
uni.hideLoading()
}
} catch (error) {
let index = this.customerForm.findIndex(e => e.key == error)
this.customerForm[index].error = true
uni.hideLoading()
}
}
}
}
</script>
<style scoped lang="scss">
.detail-box {
position: relative;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%;
box-sizing: border-box;
padding: toRpx(160) toRpx(64) 0;
}
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 999;
pointer-events: none;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
pointer-events: auto;
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
}
}
.detail-content {
height: calc(100vh - #{toRpx(212)});
overflow-y: auto;
.detail-panel {
width: 100%;
min-height: 100%;
height: auto;
border-radius: toRpx(48);
background: #ffffff59;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
padding: toRpx(32) toRpx(48);
box-sizing: border-box;
display: flex;
flex-direction: column;
.detail-info {
position: relative;
width: 100%;
height: 64px;
border: 2px solid #ffffff;
border-radius: 16px;
overflow: hidden;
margin-bottom: 24px;
flex-shrink: 0;
box-sizing: border-box;
.detail-info-bg {
position: absolute;
inset: 0;
background: linear-gradient(90deg, rgba(44, 102, 247, 0.08) 0%, rgba(72, 166, 255, 0.12) 100%);
background-color: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(2px);
-webkit-backdrop-filter: blur(2px);
}
.detail-info-body {
position: relative;
z-index: 1;
height: 100%;
align-items: center;
justify-content: space-between;
padding: 0 18px;
box-sizing: border-box;
}
.detail-info-left {
flex: 1;
min-width: 0;
align-items: center;
gap: 8px;
}
.detail-info-right {
flex-shrink: 0;
padding: 0 8px;
border-radius: 4px;
font-size: 12px;
line-height: 22px;
white-space: nowrap;
&--success {
background: #eaf9f1;
color: #35c376;
}
&--warning {
background: #fdece9;
color: #f24724;
}
&--failed,
&--default {
background: #f5f7fa;
color: #6c6f75;
}
}
.user-tag {
width: 32px;
height: 32px;
border-radius: 50%;
background: rgba(44, 102, 247, 0.1);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
.user-tag-text {
font-size: 14px;
line-height: 20px;
font-weight: 600;
color: #2c66f7;
}
}
.user-name {
font-size: 16px;
font-weight: 500;
color: #1a1a2e;
flex-shrink: 0;
white-space: nowrap;
}
.active-list {
flex: 1;
min-width: 0;
align-items: center;
gap: 8px;
overflow: hidden;
}
.active-item {
padding: 6px 12px;
border: 1px solid #dce1e6;
border-radius: 4px;
font-size: 13px;
line-height: normal;
color: #6c6f75;
white-space: nowrap;
flex-shrink: 0;
box-sizing: border-box;
}
}
.form-header {
width: 100%;
height: 28px;
font-size: 13px;
color: #2c66f7;
border-radius: 4px;
background: rgba(44, 102, 247, 0.05);
display: flex;
align-items: center;
justify-content: center;
}
}
}
.form-box {
flex-shrink: 0;
flex-wrap: wrap;
align-items: flex-start;
align-content: flex-start;
row-gap: 16px;
padding: toRpx(32) toRpx(40);
justify-content: space-between;
&--no-top {
padding-top: 0;
}
.form-item {
width: toRpx(934);
height: toRpx(80);
font-size: toRpx(28);
}
.label {
width: toRpx(192);
color: #292d33;
justify-content: center;
.required {
color: #f24724;
font-size: toRpx(28);
}
}
.input,
.select {
width: toRpx(738);
height: toRpx(76);
background: #ffffff;
border-radius: toRpx(16);
border: toRpx(2) solid transparent !important;
outline: none;
color: #333333;
box-sizing: border-box;
line-height: toRpx(76);
padding: 0 toRpx(32) !important;
font-size: toRpx(28);
&::placeholder {
color: #33333333;
}
.value {
max-width: toRpx(598);
}
}
.placeholderStyle {
color: #33333333;
}
.arrow {
color: #999 !important;
margin-left: auto;
flex-shrink: 0;
}
.error {
border: toRpx(2) solid #f24724 !important;
}
.input--readonly {
color: #666666;
background: #f5f7fa;
}
.form-item--full {
width: 100%;
.input-box,
.input,
.select,
.input--readonly {
flex: 1;
width: 0;
}
}
.input-box {
width: toRpx(738);
height: toRpx(76);
background: #ffffff;
border-radius: toRpx(16);
box-sizing: border-box;
align-items: center;
padding-right: toRpx(24);
.input--count {
flex: 1;
width: 0;
height: 100%;
background: transparent;
border: none !important;
padding: 0 0 0 toRpx(32) !important;
line-height: toRpx(76);
}
.input-count {
flex-shrink: 0;
font-size: toRpx(24);
color: #999999;
line-height: toRpx(76);
white-space: nowrap;
}
}
}
.btns {
justify-content: center;
gap: 0 toRpx(34);
padding-bottom: toRpx(32);
flex-shrink: 0;
.btn {
width: toRpx(718);
height: toRpx(80);
background-image: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
border-radius: toRpx(48);
display: flex;
justify-content: center;
align-items: center;
font-weight: 500;
font-size: toRpx(32);
color: #ffffff;
}
.cancel {
background: #dae9ff;
color: #2c66f7;
}
.disabled {
background-image: linear-gradient(0deg, #2c66f799 0%, #48a6ff99 100%);
}
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!