Commit 9f3d77ab by Lin

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

- 在 pages.json 中新增客户建档详情页面的条目,并设置自定义导航样式。
- 更新 CustomerSide 组件,修改点击事件以导航至客户建档详情页面。
- 在 addFiles.vue 中添加必填和选填信息的表单结构,优化用户输入体验。
- 新增 detailFiles.vue 组件,展示客户详细信息及相关操作按钮。
1 parent f2fd8631
...@@ -41,12 +41,11 @@ ...@@ -41,12 +41,11 @@
v-for="item in customerList" v-for="item in customerList"
:key="item.id" :key="item.id"
class="customer-item" class="customer-item"
@click="handleCustomerItemClick(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">{{ item.surname }}</text>
</view> </view>
<view class="customer-item-body"> <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> <text class="customer-item-name">{{ item.name }}</text>
<view v-if="item.carModel" class="customer-item-car-tag"> <view v-if="item.carModel" class="customer-item-car-tag">
...@@ -138,8 +137,12 @@ export default { ...@@ -138,8 +137,12 @@ export default {
animationDuration: 100 animationDuration: 100
}) })
}, },
handleCustomerItemClick(item) { handleGoCustomerDetail(item) {
console.log('点击客户卡片:', item) uni.navigateTo({
url: `/pages/common/customFiles/detailFiles?customerId=${item.id}`,
animationType: 'pop-in',
animationDuration: 100
})
} }
} }
} }
...@@ -308,6 +311,7 @@ export default { ...@@ -308,6 +311,7 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 6px; gap: 6px;
cursor: pointer;
} }
.customer-item-row { .customer-item-row {
......
...@@ -167,6 +167,12 @@ ...@@ -167,6 +167,12 @@
} }
}, },
{ {
"path": "pages/common/customFiles/detailFiles",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/caseDetail", "path": "pages/common/caseDetail",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
</view> </view>
<view class="detail-content"> <view class="detail-content">
<view class="detail-panel"> <view class="detail-panel">
<view class="form-header">必填信息</view>
<view class="form-box flex"> <view class="form-box flex">
<template v-for="(i, index) in customerForm"> <template v-for="(i, index) in customerForm">
<view class="form-item flex" :key="index"> <view class="form-item flex" :key="index">
...@@ -31,7 +32,52 @@ ...@@ -31,7 +32,52 @@
fields="day" fields="day"
:start="startDate" :start="startDate"
:end="endDate" :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]" :value="customerInfo[i.valueKey]"
> >
<view :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"> <view :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]">
...@@ -78,6 +124,12 @@ ...@@ -78,6 +124,12 @@
@select="handleSelect($event, 'receptionSceneVisible')" @select="handleSelect($event, 'receptionSceneVisible')"
:customerInfo="customerInfo" :customerInfo="customerInfo"
></reception-sence> ></reception-sence>
<employee
ref="residentSaleVisible"
title="驻店零售"
:salesPropsUuid="customerInfo.residentSaleId"
@select="handleSelect($event, 'residentSaleVisible')"
/>
</view> </view>
<uni-popup ref="successRef" type="message"> <uni-popup ref="successRef" type="message">
<uni-popup-message <uni-popup-message
...@@ -94,6 +146,7 @@ import CarBrands from '@/components/CarBrands.vue' ...@@ -94,6 +146,7 @@ import CarBrands from '@/components/CarBrands.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import CustomerTags from '@/components/HomeFrame/components/ReceptionCenter/CustomerTags.vue' import CustomerTags from '@/components/HomeFrame/components/ReceptionCenter/CustomerTags.vue'
import ReceptionSence from '@/components/HomeFrame/components/ReceptionCenter/ReceptionSence.vue' import ReceptionSence from '@/components/HomeFrame/components/ReceptionCenter/ReceptionSence.vue'
import Employee from '@/components/Employee.vue'
const phoneRex = /^[1]([3-9])[0-9]{9}$/, const phoneRex = /^[1]([3-9])[0-9]{9}$/,
default_customerForm = [{ default_customerForm = [{
...@@ -106,7 +159,7 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -106,7 +159,7 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
maxlength: 50 maxlength: 50
}, },
{ {
label: '车主电话', label: '手机号',
valueKey: 'ownerPhone', valueKey: 'ownerPhone',
key: 'ownerPhone', key: 'ownerPhone',
type: 'input', type: 'input',
...@@ -116,7 +169,7 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -116,7 +169,7 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
error: false error: false
}, },
{ {
label: '品牌车型', label: '车型',
valueKey: 'brandModel', valueKey: 'brandModel',
key: 'brandModel', key: 'brandModel',
type: 'select', type: 'select',
...@@ -124,32 +177,58 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -124,32 +177,58 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
popKey: 'carBrandVisible' popKey: 'carBrandVisible'
}, },
{ {
label: '接待场景', label: '交付日期',
valueKey: 'receptionSceneName', valueKey: 'arrivalDate',
key: 'receptionScene', key: 'arrivalDate',
type: 'date'
},
// {
// label: '接待场景',
// valueKey: 'receptionSceneName',
// key: 'receptionScene',
// type: 'select',
// required: true,
// popKey: 'receptionSceneVisible'
// },
{
label: '流量来源',
valueKey: 'customerTagName',
key: 'customerTagName',
type: 'select', type: 'select',
required: true, required: true,
popKey: 'receptionSceneVisible' popKey: 'customerTagstVisible'
}],
default_optionalForm = [{
label: '车架号',
valueKey: 'standNo',
key: 'standNo',
type: 'input',
inputType: 'text',
maxlength: 17
}, },
{ {
label: '到店日期', label: '到店日期',
valueKey: 'arrivalDate', valueKey: 'arrivalDate',
key: 'arrivalDate', key: 'arrivalDate',
type: 'date', type: 'date'
required: true,
}, },
{ {
label: '客户标签', label: '驻店零售',
valueKey: 'customerTagName', valueKey: 'residentSaleName',
key: 'customerTagName', key: 'residentSaleId',
type: 'select', type: 'select',
required: true, popKey: 'residentSaleVisible'
popKey: 'customerTagstVisible' },
{
label: '建档日期',
valueKey: 'filingDate',
key: 'filingDate',
type: 'date'
}] }]
export default { export default {
name: 'AddFiles', name: 'AddFiles',
components: { CarBrands, CustomerTags, ReceptionSence }, components: { CarBrands, CustomerTags, ReceptionSence, Employee },
computed: { computed: {
check () { check () {
let { customerForm, customerInfo } = this, let { customerForm, customerInfo } = this,
...@@ -181,6 +260,7 @@ export default { ...@@ -181,6 +260,7 @@ export default {
return { return {
customerId: '', customerId: '',
customerForm: [], customerForm: [],
optionalForm: [],
customerInfo: {}, customerInfo: {},
startDate: '', startDate: '',
endDate: '', endDate: '',
...@@ -202,6 +282,7 @@ export default { ...@@ -202,6 +282,7 @@ export default {
this.$store.dispatch("clearCustomerInfo") this.$store.dispatch("clearCustomerInfo")
this.$store.dispatch("clearHistory") this.$store.dispatch("clearHistory")
this.customerForm = JSON.parse(JSON.stringify(default_customerForm)) this.customerForm = JSON.parse(JSON.stringify(default_customerForm))
this.optionalForm = JSON.parse(JSON.stringify(default_optionalForm))
this.customerInfo = { this.customerInfo = {
ownerName: '', ownerName: '',
ownerPhone: '', ownerPhone: '',
...@@ -209,7 +290,11 @@ export default { ...@@ -209,7 +290,11 @@ export default {
receptionScene: '', receptionScene: '',
arrivalDate: '', arrivalDate: '',
customerTagName: '', customerTagName: '',
receptionSceneName: '' receptionSceneName: '',
standNo: '',
residentSaleName: '',
residentSaleId: '',
filingDate: ''
} }
if (this.customerId) this.findVisitsInfo() if (this.customerId) this.findVisitsInfo()
}, },
...@@ -219,7 +304,8 @@ export default { ...@@ -219,7 +304,8 @@ export default {
}) })
if (res.customerTag) this.customerTag = res.customerTag if (res.customerTag) this.customerTag = res.customerTag
res.customerTagName = res.customerTagName.replace(/,/g, '|') 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 this.customerInfo = res
}, },
backPage () { backPage () {
...@@ -253,13 +339,16 @@ export default { ...@@ -253,13 +339,16 @@ export default {
}) })
this.customerInfo.customerTagName = names.join('|') this.customerInfo.customerTagName = names.join('|')
this.customerTag = ids.join(',') this.customerTag = ids.join(',')
} else if (popkey == 'residentSaleVisible') {
this.customerInfo.residentSaleName = item.staffName
this.customerInfo.residentSaleId = item.uuid
} else { } else {
this.customerInfo.receptionSceneName = item.receptionSceneName this.customerInfo.receptionSceneName = item.receptionSceneName
this.customerInfo.receptionScene = item.id this.customerInfo.receptionScene = item.id
} }
}, },
bindDateChange (e) { bindDateChange (e, valueKey) {
this.customerInfo.arrivalDate = e.detail.value this.customerInfo[valueKey] = e.detail.value
}, },
async submit () { async submit () {
if (this.check) return if (this.check) return
...@@ -267,7 +356,7 @@ export default { ...@@ -267,7 +356,7 @@ export default {
this.customerForm.map(e => { this.customerForm.map(e => {
e.error = false e.error = false
}) })
let { customerInfo, customerForm, customerTag } = this, let { customerInfo, customerForm, optionalForm, customerTag } = this,
{ shopMerchantId, sceneType } = uni.$storage.get("userInfo"), { shopMerchantId, sceneType } = uni.$storage.get("userInfo"),
targetApi = customerInfo.id ? 'updateVisitsInfo' : 'saveVisitsInfo', targetApi = customerInfo.id ? 'updateVisitsInfo' : 'saveVisitsInfo',
params = { params = {
...@@ -279,6 +368,9 @@ export default { ...@@ -279,6 +368,9 @@ export default {
customerForm.map(e => { customerForm.map(e => {
params[e.key] = customerInfo[e.key] params[e.key] = customerInfo[e.key]
}) })
optionalForm.map(e => {
params[e.key] = customerInfo[e.key]
})
if (customerInfo.id) params.id = customerInfo.id if (customerInfo.id) params.id = customerInfo.id
Object.assign(params, { Object.assign(params, {
carModelId: customerInfo.carModelId, carModelId: customerInfo.carModelId,
...@@ -369,32 +461,45 @@ export default { ...@@ -369,32 +461,45 @@ export default {
.detail-content { .detail-content {
height: calc(100vh - #{toRpx(212)}); height: calc(100vh - #{toRpx(212)});
overflow-y: auto;
.detail-panel { .detail-panel {
width: 100%; width: 100%;
height: 100%; min-height: 100%;
height: auto;
border-radius: toRpx(48); border-radius: toRpx(48);
background: #ffffff59; background: #ffffff59;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff; box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
padding: toRpx(32) toRpx(48); padding: toRpx(32) toRpx(48);
box-sizing: border-box; box-sizing: border-box;
overflow: hidden;
display: flex; display: flex;
flex-direction: column; 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 { .form-box {
flex: 1; flex-shrink: 0;
flex-wrap: wrap; 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; justify-content: space-between;
overflow-y: auto;
.form-item { .form-item {
width: toRpx(934); width: toRpx(934);
height: toRpx(80); height: toRpx(80);
margin-bottom: toRpx(48);
font-size: toRpx(28); font-size: toRpx(28);
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!