Commit 0d4cfafe by 李伟康

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

2 parents 4595a973 0a6ac5a9
......@@ -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);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!