Commit 186cabf2 by Lin

feat(客户页面):重构文件路径并添加新的客户页面

- 更新了 JSON 和 Vue 和 Vue 组件中的文件路径,以反映 'customerPages' 下的新结构。
- 新增了用于添加和查看客户文件的组件。
- 更新了 prelearnBridge.vue 中的默认 URL,以提升功能表现。
- 添加了日历图标资源,供新客户表单使用。
1 parent 7e43fa71
......@@ -138,14 +138,14 @@ export default {
methods: {
handleGoCustomerFiles() {
uni.navigateTo({
url: '/pages/common/customFiles/addFiles',
url: '/pages/common/customerPages/addFiles',
animationType: 'pop-in',
animationDuration: 100
})
},
handleGoCustomerDetail(item) {
uni.navigateTo({
url: `/pages/common/customFiles/detailFiles?customerId=${item.id}`,
url: `/pages/common/customerPages/detailFiles?customerId=${item.id}`,
animationType: 'pop-in',
animationDuration: 100
})
......
......@@ -161,13 +161,13 @@
}
},
{
"path": "pages/common/customFiles/addFiles",
"path": "pages/common/customerPages/addFiles",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/customFiles/detailFiles",
"path": "pages/common/customerPages/detailFiles",
"style": {
"navigationStyle": "custom"
}
......
......@@ -21,9 +21,10 @@
:maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]"
:class="['input', { error: i.error }]"
placeholder="请选择"
:placeholder="`请输入${i.label}`"
placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done"
@blur="inputBlur($event, i)"
/>
</template>
<template v-else-if="i.type == 'date'">
......@@ -36,8 +37,12 @@
: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 class="value text-hide">{{ customerInfo[i.valueKey] || `请选择${i.label}` }}</view>
<image
class="calendar-icon"
:src="require('@/assets/images/common/icon-calendar.png')"
mode="aspectFit"
/>
</view>
</picker>
</template>
......@@ -46,7 +51,7 @@
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
@click="showPopup(i.popKey)"
>
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view>
<view class="value text-hide">{{ customerInfo[i.valueKey] || `请选择${i.label}` }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view>
</template>
......@@ -66,9 +71,10 @@
:maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]"
:class="['input', { error: i.error }]"
placeholder="请选择"
:placeholder="`请输入${i.label}`"
placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done"
@blur="inputBlur($event, i)"
/>
</template>
<template v-else-if="i.type == 'date'">
......@@ -81,8 +87,12 @@
: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 class="value text-hide">{{ customerInfo[i.valueKey] || `请选择${i.label}` }}</view>
<image
class="calendar-icon"
:src="require('@/assets/images/common/icon-calendar.png')"
mode="aspectFit"
/>
</view>
</picker>
</template>
......@@ -114,11 +124,6 @@
carModelKey="brandModel"
customBoolean
/>
<customer-tags
ref="customerTagstVisible"
@select="handleSelect($event, 'customerTagstVisible')"
:chooseList="tagsList"
></customer-tags>
<reception-sence
ref="receptionSceneVisible"
@select="handleSelect($event, 'receptionSceneVisible')"
......@@ -144,9 +149,9 @@
<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'
import { validateVin, formatVinInput } from '@/utils/vinVaildate'
const phoneRex = /^[1]([3-9])[0-9]{9}$/,
default_customerForm = [{
......@@ -177,11 +182,20 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
popKey: 'carBrandVisible'
},
{
label: '流量来源',
valueKey: 'residentSaleName',
key: 'residentSaleId',
type: 'select',
required: true,
popKey: 'residentSaleVisible'
},
{
label: '交付日期',
valueKey: 'arrivalDate',
key: 'arrivalDate',
required: true,
type: 'date'
},
}
// {
// label: '接待场景',
// valueKey: 'receptionSceneName',
......@@ -189,15 +203,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
// type: 'select',
// required: true,
// popKey: 'receptionSceneVisible'
// },
{
label: '流量来源',
valueKey: 'customerTagName',
key: 'customerTagName',
type: 'select',
required: true,
popKey: 'customerTagstVisible'
}],
// }
],
default_optionalForm = [{
label: '车架号',
valueKey: 'standNo',
......@@ -213,22 +220,21 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
type: 'date'
},
{
label: '建档日期',
valueKey: 'filingDate',
key: 'filingDate',
type: 'date'
},{
label: '驻店零售',
valueKey: 'residentSaleName',
key: 'residentSaleId',
type: 'select',
popKey: 'residentSaleVisible'
},
{
label: '建档日期',
valueKey: 'filingDate',
key: 'filingDate',
type: 'date'
}]
export default {
name: 'AddFiles',
components: { CarBrands, CustomerTags, ReceptionSence, Employee },
components: { CarBrands, ReceptionSence, Employee },
computed: {
check () {
let { customerForm, customerInfo } = this,
......@@ -241,19 +247,6 @@ export default {
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
}
},
data () {
......@@ -264,7 +257,7 @@ export default {
customerInfo: {},
startDate: '',
endDate: '',
customerTag: ''
validateState: true
}
},
onLoad (options) {
......@@ -289,7 +282,6 @@ export default {
brandModel: '',
receptionScene: '',
arrivalDate: '',
customerTagName: '',
receptionSceneName: '',
standNo: '',
residentSaleName: '',
......@@ -302,8 +294,6 @@ export default {
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
......@@ -330,15 +320,6 @@ export default {
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
......@@ -350,17 +331,50 @@ export default {
bindDateChange (e, valueKey) {
this.customerInfo[valueKey] = e.detail.value
},
inputBlur (e, val) {
const standNoVal = this.customerInfo.standNo
if (val.key === 'standNo' && standNoVal) {
this.customerInfo.standNo = formatVinInput(standNoVal)
validateVin(this.customerInfo.standNo)
.then(result => {
const { valid } = result.data
this.validateState = valid
})
.catch(() => {
this.validateState = false
})
} else if (val.key === 'standNo') {
this.validateState = true
}
},
async submit () {
if (this.check) return
const carVin = this.customerInfo.standNo
if (carVin) {
this.customerInfo.standNo = formatVinInput(carVin)
if (this.customerInfo.standNo.length !== 17) {
uni.showToast({
title: '请输入 17 位有效字符(支持大写 A-H/J-N/P-Z、0-9)',
icon: 'none'
})
return
}
if (!this.validateState) {
uni.showToast({
title: '车架号校验不匹配,请核对后重新输入',
icon: 'none'
})
return
}
}
try {
this.customerForm.map(e => {
e.error = false
})
let { customerInfo, customerForm, optionalForm, customerTag } = this,
let { customerInfo, customerForm, optionalForm } = this,
{ shopMerchantId, sceneType } = uni.$storage.get("userInfo"),
targetApi = customerInfo.id ? 'updateVisitsInfo' : 'saveVisitsInfo',
params = {
customerTag,
merchantId: shopMerchantId,
bussinessScene: sceneType == 0 ? 1 : 2
}
......@@ -379,7 +393,6 @@ export default {
oneCarBrand: customerInfo.oneCarBrand,
oneCarBrandId: customerInfo.oneCarBrandId
})
params.customerTagName = params.customerTagName.replace(/|/g, ',')
uni.showLoading({
mask: true
})
......@@ -547,6 +560,13 @@ export default {
flex-shrink: 0;
}
.calendar-icon {
width: 16px;
height: 16px;
margin-left: auto;
flex-shrink: 0;
}
.error {
border: toRpx(2) solid #f24724 !important;
}
......
......@@ -125,7 +125,7 @@ export default {
},
},
onLoad(options) {
const defaultUrl = 'http://192.168.1.68:3001/gl-agent-position/?demo=prelearn-bridge'
const defaultUrl = 'http://192.168.1.68:4173/prelearning.html'
this.webviewUrl = options.url ? decodeURIComponent(options.url) : defaultUrl
console.log('[prelearn bridge demo] open url:', this.webviewUrl)
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!