Commit 565096a8 by Lin

feat(Employee, AddFiles, DetailFiles):增强员工管理与数据处理功能

- 更新 Employee 组件,新增 employeeType 和 sellerEmployeeList,以实现更完善的员工分类。
- 优化 AddFiles 组件,动态设置员工选择标题,并改进邀请日期的逻辑管理。
- 重构 DetailFiles,提升客户信息的显示效果,并确保数据处理的准确性。
1 parent 450b9d2d
...@@ -32,15 +32,15 @@ export default { ...@@ -32,15 +32,15 @@ export default {
type: String, type: String,
default: 'uuid' default: 'uuid'
}, },
/** 转化人员(驻店零售)模式,与 OrderPopup 转化人员选择项一致 */ // default: 销售顾问;seller: 转化人员/驻店零售
sellerUser: { employeeType: {
type: Boolean, type: String,
default: false default: 'default'
} }
}, },
data () { data () {
return { return {
localEmployeeList: null sellerEmployeeList: []
} }
}, },
watch: { watch: {
...@@ -56,21 +56,17 @@ export default { ...@@ -56,21 +56,17 @@ export default {
return this.$store.state.user.historyStatus return this.$store.state.user.historyStatus
}, },
selectedId () { selectedId () {
if (Array.isArray(this.list)) { if (Array.isArray(this.list) || this.employeeType === 'seller') {
return this.salesPropsUuid return this.salesPropsUuid
} }
// 优先使用父组件传入的选中值,避免多表单项共用弹框时与 vuex salesUuid 冲突 return this.$store.state.user.customerInfo.salesUuid || this.salesPropsUuid
if (this.salesPropsUuid) {
return this.salesPropsUuid
}
return this.$store.state.user.customerInfo.salesUuid
}, },
displayList () { displayList () {
if (Array.isArray(this.list)) { if (Array.isArray(this.list)) {
return this.list return this.list
} }
if (Array.isArray(this.localEmployeeList)) { if (this.employeeType === 'seller') {
return this.localEmployeeList return this.sellerEmployeeList
} }
return this.$store.state.user.employeeList return this.$store.state.user.employeeList
} }
...@@ -81,25 +77,29 @@ export default { ...@@ -81,25 +77,29 @@ export default {
open () { open () {
this.$refs.employeeBoxVisible.open() this.$refs.employeeBoxVisible.open()
if (Array.isArray(this.list)) return if (Array.isArray(this.list)) return
const userInfo = uni.$storage.get("userInfo"), const userInfo = uni.$storage.get("userInfo")
{ shopMerchantId, merchantId } = userInfo if (this.employeeType === 'seller') {
const fetchType = this.employeeType const { merchantId } = userInfo
this.localEmployeeList = [] uni.$api.popupApi
const fetchList = fetchType === 'seller' .getEmployeeList({
? uni.$api.popupApi.getEmployeeList({ merchantId,
merchantId, sceneList: ''
sceneList: '' })
.then((res) => {
this.sellerEmployeeList = res || []
})
return
}
const { shopMerchantId } = userInfo
/**获取销售人员 */
uni.$api.commonApi
.getEmployeeList({
merchantId: shopMerchantId,
}) })
: uni.$api.commonApi.getEmployeeList({ .then((res) => {
merchantId: shopMerchantId this.$store.dispatch("setEmployeeList", res);
uni.$storage.set("employeeList", res || []);
}) })
fetchList.then((res) => {
if (fetchType !== this.employeeType) return
const list = res || []
this.localEmployeeList = list
this.$store.dispatch("setEmployeeList", list)
uni.$storage.set("employeeList", list)
})
}, },
handleSelect (item) { handleSelect (item) {
this.close(); this.close();
......
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
></reception-sence> ></reception-sence>
<employee <employee
ref="residentSaleVisible" ref="residentSaleVisible"
:title="employeePopupTitle" :title="employeeSelectKey === 'sellerUserId' ? '驻店零售' : '流量来源'"
:employeeType="employeeSelectKey === 'sellerUserId' ? 'seller' : 'default'" :employeeType="employeeSelectKey === 'sellerUserId' ? 'seller' : 'default'"
:salesPropsUuid="employeeSelectKey ? customerInfo[employeeSelectKey] : ''" :salesPropsUuid="employeeSelectKey ? customerInfo[employeeSelectKey] : ''"
@select="handleSelect($event, 'residentSaleVisible')" @select="handleSelect($event, 'residentSaleVisible')"
...@@ -214,8 +214,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -214,8 +214,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
}, },
{ {
label: '到店日期', label: '到店日期',
valueKey: 'arrivalDate', valueKey: 'inviteDate',
key: 'arrivalDate', key: 'inviteDate',
type: 'date' type: 'date'
}, },
{ {
...@@ -257,7 +257,6 @@ export default { ...@@ -257,7 +257,6 @@ export default {
endDate: '', endDate: '',
validateState: true, validateState: true,
employeeSelectKey: '', employeeSelectKey: '',
employeePopupTitle: '驻店零售',
inviteDateTouched: false inviteDateTouched: false
} }
}, },
...@@ -296,8 +295,10 @@ export default { ...@@ -296,8 +295,10 @@ export default {
merchantName: '', merchantName: '',
sellerName: '', sellerName: '',
sellerUserId: '', sellerUserId: '',
inviteDate: '',
filingDate: '' filingDate: ''
} }
this.inviteDateTouched = false
if (this.customerId) this.findVisitsInfo() if (this.customerId) this.findVisitsInfo()
}, },
async findVisitsInfo () { async findVisitsInfo () {
...@@ -305,8 +306,10 @@ export default { ...@@ -305,8 +306,10 @@ export default {
id: this.customerId id: this.customerId
}) })
if (res.arrivalDate) res.arrivalDate = dayjs(res.arrivalDate).format("YYYY-MM-DD") if (res.arrivalDate) res.arrivalDate = dayjs(res.arrivalDate).format("YYYY-MM-DD")
if (res.inviteDate) res.inviteDate = dayjs(res.inviteDate).format("YYYY-MM-DD")
if (res.filingDate) res.filingDate = dayjs(res.filingDate).format("YYYY-MM-DD") if (res.filingDate) res.filingDate = dayjs(res.filingDate).format("YYYY-MM-DD")
this.customerInfo = res this.customerInfo = res
this.inviteDateTouched = !!res.inviteDate
}, },
backPage () { backPage () {
uni.navigateBack({ uni.navigateBack({
...@@ -317,7 +320,6 @@ export default { ...@@ -317,7 +320,6 @@ export default {
}, },
showPopup (item) { showPopup (item) {
this.employeeSelectKey = item.key this.employeeSelectKey = item.key
this.employeePopupTitle = item.label
this.$refs[item.popKey].open() this.$refs[item.popKey].open()
}, },
getFieldDisplayValue (field) { getFieldDisplayValue (field) {
...@@ -356,7 +358,14 @@ export default { ...@@ -356,7 +358,14 @@ export default {
} }
}, },
bindDateChange (e, valueKey) { bindDateChange (e, valueKey) {
this.customerInfo[valueKey] = e.detail.value const value = e.detail.value
this.customerInfo[valueKey] = value
if (valueKey === 'arrivalDate' && !this.inviteDateTouched) {
this.customerInfo.inviteDate = value
}
if (valueKey === 'inviteDate') {
this.inviteDateTouched = true
}
}, },
inputBlur (e, val) { inputBlur (e, val) {
const standNoVal = this.customerInfo.standNo const standNoVal = this.customerInfo.standNo
...@@ -434,6 +443,8 @@ export default { ...@@ -434,6 +443,8 @@ export default {
merchantId:params.merchantId, merchantId:params.merchantId,
employeeName:params.employeeName, employeeName:params.employeeName,
sellerMerchantId:params.sellerMerchantId, sellerMerchantId:params.sellerMerchantId,
sellerUserId: params.sellerUserId,
sellerName: customerInfo.sellerName,
preliminaryOrders: [ preliminaryOrders: [
{ {
sceneType:1, sceneType:1,
...@@ -450,7 +461,7 @@ export default { ...@@ -450,7 +461,7 @@ export default {
employeeName:params.employeeName, employeeName:params.employeeName,
userId:params.userId, userId:params.userId,
deliveryDate: params.arrivalDate ? params.arrivalDate + ' 00:00:00' : params.arrivalDate, //交付日期 deliveryDate: params.arrivalDate ? params.arrivalDate + ' 00:00:00' : params.arrivalDate, //交付日期
inviteDate: params.filingDate ? params.filingDate + ' 00:00:00' : params.filingDate, //到店日期 inviteDate: params.inviteDate ? params.inviteDate + ' 00:00:00' : params.inviteDate, //到店日期
createdDate: params.filingDate, //建档日期 createdDate: params.filingDate, //建档日期
sellerUserld: params.sellerUserId, sellerUserld: params.sellerUserId,
sellerName: customerInfo.sellerName, sellerName: customerInfo.sellerName,
......
<template> <template>
<view class="detail-box"> <view class="detail-box">
<view class="nav-bar"> <view class="nav-bar">
<view class="back" @click="backPage"> <view class="back" @click="backPage">
<uni-icons type="left" :size="20" color="#000"></uni-icons> <uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title">客户建档详情</view>
</view> </view>
<view class="detail-content"> <view class="title">客户建档详情</view>
<view class="detail-panel"> </view>
<view class="detail-info"> <view class="detail-content">
<view class="detail-info-bg"></view> <view class="detail-panel">
<view class="detail-info-body flex"> <view class="detail-info">
<view class="detail-info-left flex"> <view class="detail-info-bg"></view>
<view class="user-tag"> <view class="detail-info-body flex">
<text class="user-tag-text">{{ customerSurname }}</text> <view class="detail-info-left flex">
</view> <view class="user-tag">
<view class="user-name">{{ customerInfo.customerName || '-' }}</view> <text class="user-tag-text">{{ customerSurname }}</text>
<view class="active-list flex">
<view
v-for="(tag, index) in goodsSubOrderList"
:key="index"
class="active-item"
>
{{ tag.upgradeGoodsAlias || tag.upgradeGoodsName || tag.packageName }}
</view>
</view>
</view> </view>
<view <view class="user-name">{{ displayInfo.customerName || '-' }}</view>
v-if="getCustomerStatusLabel(customerInfo.customerStatus)" <view class="active-list flex">
:class="['customer-item-status', getCustomerStatusClass(customerInfo.customerStatus)]" <view
> v-for="(tag, index) in goodsSubOrderList"
<text class="customer-item-status-text">{{ getCustomerStatusLabel(customerInfo.customerStatus) }}</text> :key="index"
class="active-item"
>
{{ tag.upgradeGoodsAlias || tag.upgradeGoodsName || tag.packageName }}
</view>
</view> </view>
</view> </view>
</view> <view
<view class="form-header">基本信息</view> v-if="getCustomerStatusLabel(displayInfo.customerStatus)"
<view class="form-box flex"> :class="['customer-item-status', getCustomerStatusClass(displayInfo.customerStatus)]"
<template v-for="(i, index) in customerForm"> >
<view class="form-item flex" :key="index"> <text class="customer-item-status-text">{{ getCustomerStatusLabel(displayInfo.customerStatus) }}</text>
<view class="label flex"> </view>
<view class="required" v-if="i.required">*</view>{{ i.label }} </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 == 'readonly'">
<view class="input input--readonly text-hide">{{ customerInfo[i.valueKey] || '-' }}</view>
</template>
<template v-else-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"
@blur="inputBlur($event, i)"
/>
</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> </view>
<template v-if="i.type == 'input'"> </template>
<input </view>
:type="i.inputType" </template>
:maxlength="i.maxlength" </view>
v-model="customerInfo[i.valueKey]" <view class="form-box form-box--no-top flex">
:class="['input', { error: i.error }]" <template v-for="(i, index) in optionalForm">
placeholder="请选择" <view class="form-item flex" :key="index">
placeholder-style="color:rgba(51, 51, 51, 0.2);" <view class="label flex">
confirm-type="done" <view class="required" v-if="i.required">*</view>{{ i.label }}
/> </view>
</template> <template v-if="i.type == 'input'">
<template v-else-if="i.type == 'date'"> <input
<picker :type="i.inputType"
mode="date" :maxlength="i.maxlength"
fields="day" v-model="customerInfo[i.valueKey]"
:start="startDate" :class="['input', { error: i.error }]"
:end="endDate" placeholder="请选择"
@change="bindDateChange($event, i.valueKey)" placeholder-style="color:rgba(51, 51, 51, 0.2);"
:value="customerInfo[i.valueKey]" confirm-type="done"
> @blur="inputBlur($event, i)"
<view :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"> />
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view> </template>
<uni-icons class="arrow" type="right" :size="16"></uni-icons> <template v-else-if="i.type == 'date'">
</view> <picker
</picker> mode="date"
</template> fields="day"
<template v-else> :start="startDate"
<view :end="endDate"
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]" @change="bindDateChange($event, i.valueKey)"
@click="showPopup(i.popKey)" :value="customerInfo[i.valueKey]"
> >
<view :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]">
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view> <view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons> <uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view> </view>
</template> </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> </view>
</template> <template v-if="i.type == 'readonly'">
</view> <view v-if="i.showSync" class="readonly-box flex">
<view class="form-box form-box--no-top flex"> <view class="input input--readonly text-hide">{{ customerInfo[i.valueKey] || '-' }}</view>
<template v-for="(i, index) in optionalForm"> <view class="sync-btn" @click.stop="syncCustomerGroupInfo">同步</view>
<view class="form-item flex" :key="index">
<view class="label flex">
<view class="required" v-if="i.required">*</view>{{ i.label }}
</view> </view>
<template v-if="i.type == 'input'"> <view v-else class="input input--readonly text-hide">{{ customerInfo[i.valueKey] || '-' }}</view>
</template>
<template v-else-if="i.type == 'input'">
<view class="input-box flex">
<input <input
:type="i.inputType" :type="i.inputType || 'text'"
:maxlength="i.maxlength" :maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]" v-model="customerInfo[i.valueKey]"
:class="['input', { error: i.error }]" class="input input--count"
placeholder="请选择" placeholder="请输入"
placeholder-style="color:rgba(51, 51, 51, 0.2);" placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done" confirm-type="done"
/> />
</template> <view v-if="i.showCount" class="input-count">{{ (customerInfo[i.valueKey] || '').length }}/{{ i.maxlength }}</view>
<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> </view>
<template v-if="i.type == 'readonly'"> </template>
<view class="input input--readonly text-hide">{{ customerInfo[i.valueKey] || '-' }}</view> <template v-else-if="i.type == 'select'">
</template> <view
<template v-else-if="i.type == 'input'"> :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
<view class="input-box flex"> @click="showPopup(i.popKey)"
<input >
:type="i.inputType || 'text'" <view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view>
:maxlength="i.maxlength" <uni-icons class="arrow" type="right" :size="16"></uni-icons>
v-model="customerInfo[i.valueKey]" </view>
class="input input--count" </template>
placeholder="请输入" </view>
placeholder-style="color:rgba(51, 51, 51, 0.2);" </template>
confirm-type="done" </view>
/> <view class="btns flex">
<view v-if="i.showCount" class="input-count">{{ (customerInfo[i.valueKey] || '').length }}/{{ i.maxlength }}</view> <view class="btn cancel" @click="submitCustomerProfileAPI">提交</view>
</view> <template v-if="sceneType != 7">
</template> <view :class="['btn', { disabled: customerInfo.customerStatus==2?true:false }]" @click="startReception">开始接待</view>
<template v-else-if="i.type == 'select'"> </template>
<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="submitCustomerProfileAPI">提交</view>
<template v-if="sceneType != 7">
<view :class="['btn', { disabled: customerInfo.customerStatus==2?true:false }]" @click="startReception">开始接待</view>
</template>
</view>
</view> </view>
</view> </view>
<view class="popup">
<car-brands
ref="carBrandVisible"
@select="handleSelect($event, 'carBrandVisible')"
:echoData="customerInfo"
carBrandKey="carBrand"
carModelKey="carChildsBrandName"
customBoolean
/>
<reception-sence
ref="receptionSceneVisible"
@select="handleSelect($event, 'receptionSceneVisible')"
:customerInfo="customerInfo"
></reception-sence>
<employee
ref="residentSaleVisible"
title="驻店零售"
:salesPropsUuid="customerInfo.userId"
@select="handleSelect($event, 'residentSaleVisible')"
/>
<employee
ref="groupMemberVisible"
title="群成员关联"
:list="groupMemberList"
label-key="contact_name"
value-key="contact_id"
: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> </view>
</template> <view class="popup">
<car-brands
<script type='text/ecmascript-6'> ref="carBrandVisible"
import CarBrands from '@/components/CarBrands.vue' @select="handleSelect($event, 'carBrandVisible')"
import dayjs from 'dayjs' :echoData="customerInfo"
import ReceptionSence from '@/components/HomeFrame/components/ReceptionCenter/ReceptionSence.vue' carBrandKey="carBrand"
import Employee from '@/components/Employee.vue' carModelKey="carChildsBrandName"
customBoolean
const phoneRex = /^[1]([3-9])[0-9]{9}$/, />
default_customerForm = [{ <reception-sence
label: '车主姓名', ref="receptionSceneVisible"
valueKey: 'customerName', @select="handleSelect($event, 'receptionSceneVisible')"
key: 'customerName', :customerInfo="customerInfo"
type: 'input', ></reception-sence>
inputType: 'text', <employee
required: true, ref="residentSaleVisible"
maxlength: 50 title="驻店零售"
employee-type="seller"
:salesPropsUuid="customerInfo.advanceUserId"
@select="handleSelect($event, 'residentSaleVisible')"
/>
<employee
ref="groupMemberVisible"
title="群成员关联"
:list="groupMemberList"
label-key="contact_name"
value-key="contact_id"
:salesPropsUuid="customerInfo.contact_id"
@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 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 = [{
label: '车主姓名',
valueKey: 'customerName',
key: 'customerName',
type: 'input',
inputType: 'text',
required: true,
maxlength: 50
},
{
label: '手机号',
valueKey: 'customerPhone',
key: 'customerPhone',
type: 'readonly',
required: true
},
{
label: '车型',
valueKey: 'carChildsBrandName',
key: 'carChildsBrandId',
type: 'select',
required: true,
popKey: 'carBrandVisible'
},
{
label: '交付日期',
valueKey: 'deliveryDate',
key: 'deliveryDate',
required: true,
type: 'date'
},
// {
// label: '接待场景',
// valueKey: 'receptionSceneName',
// key: 'receptionScene',
// type: 'select',
// required: true,
// popKey: 'receptionSceneVisible'
// },
{
label: '流量来源',
valueKey: 'employeeName',
key: 'userId',
type: 'readonly',
required: true
}],
default_optionalForm = [{
label: '车架号',
valueKey: 'standNo',
key: 'standNo',
type: 'input',
inputType: 'text',
maxlength: 17
},
{
label: '到店日期',
valueKey: 'inviteDate',
key: 'inviteDate',
type: 'date'
},
{
label: '驻店零售',
valueKey: 'advanceUserName',
key: 'advanceUserId',
type: 'select',
popKey: 'residentSaleVisible'
},
{
label: '建档日期',
valueKey: 'createdDate',
key: 'createdDate',
type: 'date'
}],
default_groupForm = [ {
label: '客户群',
valueKey: 'qwGroupName',
key: 'qwGroupName',
type: 'readonly',
showSync: true
},
{
label: '群成员关联',
valueKey: 'contact_name',
key: 'contact_id',
type: 'select',
popKey: 'groupMemberVisible'
},
{
label: '备注',
valueKey: 'remark',
key: 'remark',
type: 'input',
inputType: 'text',
maxlength: 200,
fullWidth: true,
showCount: true
}]
export default {
name: 'DetailFiles',
components: { CarBrands, ReceptionSence, Employee },
computed: {
customerSurname () {
const name = this.displayInfo.customerName || ''
return name ? name.charAt(0) : ''
},
activityTagList () {
const { customerInfo } = this
return [customerInfo.packageName, customerInfo.activityName].filter(Boolean)
}, },
{ goodsSubOrderList () {
label: '手机号', const list = this.displayInfo.goodsSubOrderDTOS
valueKey: 'customerPhone', if (!Array.isArray(list)) return []
key: 'customerPhone', return list.filter(item => item)
type: 'input', },
inputType: 'tel', upgradeStatusInfo () {
required: true, const { customerInfo } = this
maxlength: 11, if (customerInfo.upgradeStatusName) {
error: false 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
}, },
{ sceneType () {
label: '车型', const { sceneType } = uni.$storage.get('userInfo') || {}
valueKey: 'carChildsBrandName', return sceneType
key: 'carChildsBrandId', }
type: 'select', },
required: true, data () {
popKey: 'carBrandVisible' return {
customerId: '',
customerForm: [],
optionalForm: [],
groupForm: [],
customerInfo: {},
displayInfo: {
customerName: '',
customerStatus: '',
goodsSubOrderDTOS: []
},
groupMemberList: [],
startDate: '',
endDate: '',
validateState: true
}
},
onLoad (options) {
this.customerId = options.customerId || ''
console.log('customerId**options*', this.customerId)
// this.getCustormDetail()
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: {
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] || ''
},
getCustomerStatusLabel(status) {
const map = {
1: '待跟进',
2: '已升级',
3: '战败',
4: '已退款'
}
return map[status] || ''
},
async getCustormDetail() {
console.log('getCustormDetailAPI***', this.customerId)
const res = await uni.$api.customerApi.customerProfileInfoAPI({
id: this.customerId
})
console.log('getCustormDetailAPI***', res)
if(res) {
this.customerForm = res
}
console.log('getCustomerGroupInfoAPI**customerForm*', this.customerForm)
}, },
{ async submitCustomerProfileAPI(options = {}) {
label: '交付日期', const { fromReception = false } = options
valueKey: 'deliveryDate', try {
key: 'deliveryDate', this.customerForm.forEach(e => {
required: true, e.error = false
type: 'date' })
const { customerInfo, customerForm } = this
customerForm.forEach(e => {
if (e.required && !customerInfo[e.key]) throw e.key
})
if (!phoneRex.test(customerInfo.customerPhone)) throw 'customerPhone'
} catch (error) {
const index = this.customerForm.findIndex(e => e.key == error)
if (index !== -1) {
this.customerForm[index].error = true
}
return false
}
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 false
}
if (!this.validateState) {
uni.showToast({
title: '车架号校验不匹配,请核对后重新输入',
icon: 'none'
})
return false
}
}
const requestParams = {
id: this.customerInfo.id,
customerName: this.customerInfo.customerName,
carBrand: this.customerInfo.carBrand,
carBrandId: this.customerInfo.carBrandId,
carChildsBrandName: this.customerInfo.carChildsBrandName,
carChildsBrandId: this.customerInfo.carChildsBrandId,
carSeriesName: this.customerInfo.carSeriesName,
carSeriesId: this.customerInfo.carSeriesId,
deliveryDate: this.formatDateTime(this.customerInfo.deliveryDate),
createdDate: this.formatDateTime(this.customerInfo.createdDate),
inviteDate: this.formatDateTime(this.customerInfo.inviteDate),
merchantId: this.customerInfo.merchantId,
merchantName: this.customerInfo.merchantName,
userId: this.customerInfo.userId,
employeeName: this.customerInfo.employeeName,
remark: this.customerInfo.remark,
advanceUserId: this.customerInfo.advanceUserId,
advanceUserName: this.customerInfo.advanceUserName,
qwGroupId: this.customerInfo.qwGroupId,
qwGroupName: this.customerInfo.qwGroupName,
wxId: this.customerInfo.contact_id,
wxName: this.customerInfo.contact_name,
standNo:this.customerInfo.standNo,
}
console.log('submitCustomerProfileAPI***',requestParams)
uni.showLoading({
mask: true
})
const res = await uni.$api.customerApi.submitCustomerProfileAPI(requestParams),
_this = this
console.log('submitCustomerProfileAPI***', res)
if (res) {
this.syncDisplayInfo()
uni.$emit('refreshCustomerProfileGroupInfo')
if (fromReception) {
uni.hideLoading()
return true
}
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()
}
return true
} else {
uni.hideLoading()
return false
}
}, },
// { async getCustomerGroupInfo(showToast = false) {
// label: '接待场景', if (!this.customerInfo.customerName || !this.customerInfo.customerPhone) {
// valueKey: 'receptionSceneName', if (showToast) {
// key: 'receptionScene', uni.showToast({
// type: 'select', title: '请先填写客户姓名和手机号',
// required: true, icon: 'none'
// popKey: 'receptionSceneVisible' })
// }, }
{ return false
label: '流量来源', }
valueKey: 'employeeName', let customerGroupParam = this.customerInfo.customerName + this.customerInfo.customerPhone.slice(7,11)
key: 'userId', console.log('getCustomerGroupInfo*', customerGroupParam)
type: 'select', const data = await uni.$api.customerApi.getCustomerGroupInfoAPI({
required: true, customerGroupParam: customerGroupParam
popKey: 'residentSaleVisible' })
}], console.log('getCustomerGroupInfoAPI**getCustomerGroupInfo*', data)
default_optionalForm = [{ // http 层已在 code=0 时 resolve(data.data),此处 data 即为业务数据,无需再取 data.data
label: '车架号', const contactId = data && data.contact_id
valueKey: 'standNo', if (contactId) {
key: 'standNo', this.customerInfo.qwGroupId = contactId
type: 'input', this.customerInfo.qwGroupName = data.contact_name || data.name || data.qwGroupName || ''
inputType: 'text', await this.getCustomerGroupMemberInfoAPI(contactId)
maxlength: 17 return true
}
if (showToast) {
uni.showToast({
title: '未找到客户群',
icon: 'none'
})
}
return false
}, },
{ async syncCustomerGroupInfo() {
label: '到店日期', uni.showLoading({
valueKey: 'createdDate', mask: true,
key: 'createdDate', title: '同步中...'
type: 'date' })
try {
const success = await this.getCustomerGroupInfo(true)
if (success) {
uni.showToast({
title: '同步成功',
icon: 'success'
})
}
} catch (error) {
uni.showToast({
title: '同步失败',
icon: 'none'
})
} finally {
uni.hideLoading()
}
}, },
{ async getCustomerGroupMemberInfoAPI(contactId) {
label: '驻店零售', const data = await uni.$api.customerApi.getCustomerGroupMemberInfoAPI({
valueKey: 'employeeName', qwGroupId: contactId
key: 'userId', })
type: 'select', console.log('群成员getCustomerGroupMemberInfoAPI***', data)
popKey: 'residentSaleVisible' this.groupMemberList = Array.isArray(data) ? data : []
}, },
{ syncDisplayInfo (info = this.customerInfo) {
label: '建档日期', this.displayInfo = {
valueKey: 'createdDate', customerName: info.customerName || '',
key: 'createdDate', customerStatus: info.customerStatus,
type: 'date' goodsSubOrderDTOS: Array.isArray(info.goodsSubOrderDTOS) ? info.goodsSubOrderDTOS : []
}], }
default_groupForm = [{
label: '客户群',
valueKey: 'qwGroupName',
key: 'qwGroupName',
type: 'readonly'
}, },
{ getUpgradeStatusType (label) {
label: '群成员关联', if (label === '已升级') return 'success'
valueKey: 'groupMemberName', if (label === '待跟进') return 'warning'
key: 'groupMemberId', if (label === '战败') return 'failed'
type: 'select', return 'default'
popKey: 'groupMemberVisible'
}, },
{ initForm () {
label: '备注', const { sceneType } = uni.$storage.get("userInfo")
valueKey: 'groupRemark', default_customerForm[0].maxlength = sceneType == 1 ? 20 : 50
key: 'groupRemark', this.$store.dispatch("clearCustomerInfo")
type: 'input', this.$store.dispatch("clearHistory")
inputType: 'text', this.customerForm = JSON.parse(JSON.stringify(default_customerForm))
maxlength: 200, this.optionalForm = JSON.parse(JSON.stringify(default_optionalForm))
fullWidth: true, this.groupForm = JSON.parse(JSON.stringify(default_groupForm))
showCount: true this.displayInfo = {
}] customerName: '',
customerStatus: '',
export default { goodsSubOrderDTOS: []
name: 'DetailFiles', }
components: { CarBrands, ReceptionSence, Employee }, this.customerInfo = {
computed: { customerName: '',
customerSurname () { customerPhone: '',
const name = this.customerInfo.customerName || '' carBrand: '',
return name ? name.charAt(0) : '' carBrandId: '',
}, carSeriesName: '',
activityTagList () { carSeriesId: '',
const { customerInfo } = this carChildsBrandName: '',
return [customerInfo.packageName, customerInfo.activityName].filter(Boolean) carChildsBrandId: '',
}, receptionScene: '',
goodsSubOrderList () { deliveryDate: '',
const list = this.customerInfo.goodsSubOrderDTOS receptionSceneName: '',
if (!Array.isArray(list)) return [] standNo: '',
return list.filter(item => item) inviteDate: '',
}, createdDate: '',
upgradeStatusInfo () { employeeName: '',
const { customerInfo } = this userId: '',
if (customerInfo.upgradeStatusName) { advanceUserName: '',
return { advanceUserId: '',
label: customerInfo.upgradeStatusName, qwGroupName: '',
type: this.getUpgradeStatusType(customerInfo.upgradeStatusName) contact_id: '',
} contact_name: '',
} groupRemark: ''
const statusMap = {
1: { label: '待跟进', type: 'warning' },
2: { label: '不升级', type: 'default' },
4: { label: '已升级', type: 'success' }
}
const status = customerInfo.upgradeStatus ?? customerInfo.orderStatus
return statusMap[status] || null
},
sceneType () {
const { sceneType } = uni.$storage.get('userInfo') || {}
return sceneType
} }
if (this.customerId) this.findVisitsInfo()
}, },
data () { async findVisitsInfo () {
return { const res = await uni.$api.customerApi.customerProfileInfoAPI({
customerId: '', id: this.customerId
customerForm: [], })
optionalForm: [], if (res.deliveryDate) res.deliveryDate = dayjs(res.deliveryDate).format("YYYY-MM-DD")
groupForm: [], if (res.createdDate) res.createdDate = dayjs(res.createdDate).format("YYYY-MM-DD")
customerInfo: {}, if (res.inviteDate) res.inviteDate = dayjs(res.inviteDate).format("YYYY-MM-DD")
groupMemberList: [], // 合并而非整对象替换,保留 initForm 中已声明的响应式字段(如 contact_name)
startDate: '', Object.assign(this.customerInfo, res)
endDate: '' if (!this.customerInfo.contact_id && res.wxId) {
this.customerInfo.contact_id = res.wxId
} }
if (!this.customerInfo.contact_name && res.wxName) {
this.customerInfo.contact_name = res.wxName
}
this.syncDisplayInfo(this.customerInfo)
console.log('findVisitsInfo**customerInfo*', this.customerInfo)
await this.getCustomerGroupInfo()
},
backPage () {
uni.navigateBack({
delta: 1,
animationType: 'pop-out',
animationDuration: 100
})
}, },
onLoad (options) { async startReception () {
this.customerId = options.customerId || '' const { sceneType, customerInfo } = this
console.log('customerId**options*', this.customerId) if (sceneType == 7) return // 二手车无接待功能
// this.getCustormDetail() if (customerInfo.customerStatus == 2) return
this.initForm() const submitted = await this.submitCustomerProfileAPI({ fromReception: true })
if (!submitted) return
uni.navigateBack({
delta: 1,
animationType: 'pop-out',
animationDuration: 100,
success: () => {
uni.$emit('startReceptionFromCustomerDetail')
}
})
}, },
mounted () { showPopup (e) {
this.startDate = dayjs(dayjs().subtract(7, 'day')).format("YYYY-MM-DD") this.$refs[e].open()
this.endDate = dayjs(dayjs().add(30, 'day')).format("YYYY-MM-DD")
}, },
methods: { handleSelect (item, popkey) {
getCustomerStatusClass(status) { this.$refs[popkey].close()
const map = { if (popkey == 'carBrandVisible') {
1: 'customer-item-status--warning', this.$refs.carBrandVisible.close()
2: 'customer-item-status--success', Object.assign(this.customerInfo, {
3: 'customer-item-status--failed', carChildsBrandName: item.name,
4: 'customer-item-status--refund' carChildsBrandId: item.id,
carBrand: item.carChildsBrandName,
carBrandId: item.carChildsBrandId,
carSeriesName: item.carBrand,
carSeriesId: item.carBrandId
})
} else if (popkey == 'residentSaleVisible') {
this.customerInfo.advanceUserName = item.staffName
this.customerInfo.advanceUserId = item.uuid
} else if (popkey == 'groupMemberVisible') {
this.$set(this.customerInfo, 'contact_id', item.contact_id || item.id || '')
this.$set(this.customerInfo, 'contact_name', item.contact_name || item.name || '')
} else {
this.customerInfo.receptionSceneName = item.receptionSceneName
this.customerInfo.receptionScene = item.id
} }
return map[status] || ''
}, },
getCustomerStatusLabel(status) { bindDateChange (e, valueKey) {
const map = { this.customerInfo[valueKey] = e.detail.value
1: '待跟进', },
2: '已升级', inputBlur (e, val) {
3: '战败', const standNoVal = this.customerInfo.standNo
4: '已退款' 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
} }
return map[status] || ''
}, },
async getCustormDetail() { formatDateTime (value) {
console.log('getCustormDetailAPI***', this.customerId) if (!value) return value
const res = await uni.$api.customerApi.customerProfileInfoAPI({ return dayjs(value).format('YYYY-MM-DD HH:mm:ss')
id: this.customerId },
async submit () {
this.submitCustomerProfileAPI()
try {
this.customerForm.map(e => {
e.error = false
}) })
console.log('getCustormDetailAPI***', res) let { customerInfo, customerForm, optionalForm, groupForm } = this,
if(res) { { shopMerchantId, sceneType } = uni.$storage.get("userInfo"),
this.customerForm = res targetApi = customerInfo.id ? 'submitCustomerProfileAPI' : 'submitCustomerProfileAPI',
} params = {
console.log('getCustomerGroupInfoAPI**customerForm*', this.customerForm) merchantId: shopMerchantId,
}, bussinessScene: sceneType == 0 ? 1 : 2
async submitCustomerProfileAPI() { }
// carModel:问界M7, if (!phoneRex.test(customerInfo.customerPhone)) throw 'customerPhone'
// carModelId: 1149147, customerForm.map(e => {
// carBrand:AITO 问界, params[e.key] = customerInfo[e.key]
// carBrandId:3454,
// oneCarBrand:鸿蒙智行,
// oneCarBrandId:2978
let requestParams = this.customerInfo
console.log('submitCustomerProfileAPI***', requestParams)
const res = await uni.$api.customerApi.submitCustomerProfileAPI(requestParams)
console.log('submitCustomerProfileAPI***', res)
},
async getCustomerGroupInfo() {
if (!this.customerInfo.customerName || !this.customerInfo.customerPhone) {
return
}
let customerGroupParam = this.customerInfo.customerName + this.customerInfo.customerPhone.slice(7,11)
console.log('g张三525235*', customerGroupParam)
const data = await uni.$api.customerApi.getCustomerGroupInfoAPI({
customerGroupParam: customerGroupParam
}) })
console.log('getCustomerGroupInfoAPI**getCustomerGroupInfo*', data) optionalForm.map(e => {
// http 层已在 code=0 时 resolve(data.data),此处 data 即为业务数据,无需再取 data.data params[e.key] = customerInfo[e.key]
const contactId = data.contact_id
if (contactId) {
await this.getCustomerGroupMemberInfoAPI(contactId)
}
},
async getCustomerGroupMemberInfoAPI(contactId) {
const data = await uni.$api.customerApi.getCustomerGroupMemberInfoAPI({
qwGroupId: contactId
}) })
console.log('群成员getCustomerGroupMemberInfoAPI***', data) groupForm.map(e => {
this.groupMemberList = Array.isArray(data) ? data : [] params[e.key] = customerInfo[e.key]
},
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 = {
customerName: '',
customerPhone: '',
carBrand: '',
carBrandId: '',
carSeriesName: '',
carSeriesId: '',
carChildsBrandName: '',
carChildsBrandId: '',
receptionScene: '',
deliveryDate: '',
receptionSceneName: '',
standNo: '',
createdDate: '',
employeeName: '',
userId: '',
qwGroupName: '',
groupMemberName: '',
groupMemberId: '',
groupRemark: ''
}
if (this.customerId) this.findVisitsInfo()
},
async findVisitsInfo () {
const res = await uni.$api.customerApi.customerProfileInfoAPI({
id: this.customerId
}) })
if (res.deliveryDate) res.deliveryDate = dayjs(res.deliveryDate).format("YYYY-MM-DD") if (customerInfo.id) params.id = customerInfo.id
if (res.createdDate) res.createdDate = dayjs(res.createdDate).format("YYYY-MM-DD") Object.assign(params, {
this.customerInfo = res carBrand: customerInfo.carBrand,
console.log('findVisitsInfo**customerInfo*', this.customerInfo) carBrandId: customerInfo.carBrandId,
await this.getCustomerGroupInfo() carSeriesName: customerInfo.carSeriesName,
}, carSeriesId: customerInfo.carSeriesId,
backPage () { carChildsBrandName: customerInfo.carChildsBrandName,
uni.navigateBack({ carChildsBrandId: customerInfo.carChildsBrandId
delta: 1,
animationType: 'pop-out',
animationDuration: 100
}) })
}, uni.showLoading({
startReception () { mask: true
const { sceneType, customerInfo } = this
if (sceneType == 7) return // 二手车无接待功能
if (customerInfo.customerStatus == 2) return
uni.navigateBack({
delta: 1,
animationType: 'pop-out',
animationDuration: 100,
success: () => {
uni.$emit('startReceptionFromCustomerDetail')
}
}) })
}, const res = await uni.$api.customerApi[targetApi](params),
showPopup (e) { _this = this
this.$refs[e].open() if (res) {
}, this.syncDisplayInfo()
handleSelect (item, popkey) { uni.$emit('refreshCustomerProfileGroupInfo')
this.$refs[popkey].close() if (res == '1') {
if (popkey == 'carBrandVisible') { this.$refs.successRef.open()
this.$refs.carBrandVisible.close() setTimeout(() => {
Object.assign(this.customerInfo, {
carChildsBrandName: item.name,
carChildsBrandId: item.id,
carBrand: item.carChildsBrandName,
carBrandId: item.carChildsBrandId,
carSeriesName: item.carBrand,
carSeriesId: item.carBrandId
})
} else if (popkey == 'residentSaleVisible') {
this.customerInfo.employeeName = item.staffName
this.customerInfo.userId = item.uuid
} else if (popkey == 'groupMemberVisible') {
this.customerInfo.groupMemberName = item.contact_name
this.customerInfo.groupMemberId = item.contact_id
} else {
this.customerInfo.receptionSceneName = item.receptionSceneName
this.customerInfo.receptionScene = item.id
}
},
bindDateChange (e, valueKey) {
this.customerInfo[valueKey] = e.detail.value
},
async submit () {
this.submitCustomerProfileAPI()
try {
this.customerForm.map(e => {
e.error = false
})
let { customerInfo, customerForm, optionalForm, groupForm } = this,
{ shopMerchantId, sceneType } = uni.$storage.get("userInfo"),
targetApi = customerInfo.id ? 'submitCustomerProfileAPI' : 'submitCustomerProfileAPI',
params = {
merchantId: shopMerchantId,
bussinessScene: sceneType == 0 ? 1 : 2
}
if (!phoneRex.test(customerInfo.customerPhone)) throw 'customerPhone'
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, {
carBrand: customerInfo.carBrand,
carBrandId: customerInfo.carBrandId,
carSeriesName: customerInfo.carSeriesName,
carSeriesId: customerInfo.carSeriesId,
carChildsBrandName: customerInfo.carChildsBrandName,
carChildsBrandId: customerInfo.carChildsBrandId
})
uni.showLoading({
mask: true
})
const res = await uni.$api.customerApi[targetApi](params),
_this = this
if (res) {
uni.$emit('refreshCustomerProfileGroupInfo')
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() uni.hideLoading()
} this.backPage()
}, 1e3)
} else { } else {
uni.showModal({
content: '存在与该手机号相同的接待记录,系统将自动归类到已接待',
showCancel: false,
confirmText: '确认',
confirmColor: '#347BFF',
success (res) {
if (res.confirm) {
_this.backPage()
}
}
})
uni.hideLoading() uni.hideLoading()
} }
} catch (error) { } else {
let index = this.customerForm.findIndex(e => e.key == error)
this.customerForm[index].error = true
uni.hideLoading() uni.hideLoading()
} }
} catch (error) {
let index = this.customerForm.findIndex(e => e.key == error)
this.customerForm[index].error = true
uni.hideLoading()
} }
} }
} }
</script> }
</script>
<style scoped lang="scss"> <style scoped lang="scss">
.detail-box { .detail-box {
position: relative; position: relative;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
background-image: url('@/assets/images/common/page-bg.webp'); background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%; background-size: 100%;
box-sizing: border-box; box-sizing: border-box;
padding: toRpx(160) toRpx(64) 0; 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 {
.nav-bar { position: absolute;
position: fixed; top: 50%;
width: 100%; left: 50%;
height: toRpx(96); transform: translate(-50%, -50%);
left: 0; font-weight: 700;
top: toRpx(48); font-size: toRpx(32);
z-index: 999; color: #1a1a1a;
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 { .detail-content {
height: calc(100vh - #{toRpx(212)}); height: calc(100vh - #{toRpx(212)});
overflow-y: auto; overflow-y: auto;
.detail-panel {
.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%; width: 100%;
min-height: 100%; height: 64px;
height: auto; border: 2px solid #ffffff;
border-radius: toRpx(48); border-radius: 16px;
background: #ffffff59; overflow: hidden;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff; margin-bottom: 24px;
padding: toRpx(32) toRpx(48); flex-shrink: 0;
box-sizing: border-box; box-sizing: border-box;
display: flex; .detail-info-bg {
flex-direction: column; position: absolute;
inset: 0;
.detail-info { 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; position: relative;
width: 100%; z-index: 1;
height: 64px; height: 100%;
border: 2px solid #ffffff; align-items: center;
border-radius: 16px; justify-content: space-between;
overflow: hidden; padding: 0 18px;
margin-bottom: 24px;
flex-shrink: 0;
box-sizing: border-box; box-sizing: border-box;
}
.detail-info-bg { .detail-info-left {
position: absolute; flex: 1;
inset: 0; min-width: 0;
background: linear-gradient(90deg, rgba(44, 102, 247, 0.08) 0%, rgba(72, 166, 255, 0.12) 100%); align-items: center;
background-color: rgba(255, 255, 255, 0.2); gap: 8px;
backdrop-filter: blur(2px); }
-webkit-backdrop-filter: blur(2px); .customer-item-status {
} padding: 0 8px;
border-radius: 4px;
.detail-info-body { flex-shrink: 0;
position: relative; &--warning {
z-index: 1; background: #FDECE9;
height: 100%; .customer-item-status-text {
align-items: center; color: #F24724;
justify-content: space-between;
padding: 0 18px;
box-sizing: border-box;
}
.detail-info-left {
flex: 1;
min-width: 0;
align-items: center;
gap: 8px;
}
.customer-item-status {
padding: 0 8px;
border-radius: 4px;
flex-shrink: 0;
&--warning {
background: #FDECE9;
.customer-item-status-text {
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;
}
} }
} }
&--success {
.customer-item-status-text { background: #EAF9F1;
font-size: 12px; .customer-item-status-text {
line-height: 22px; color: #35C376;
}
.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;
} }
} }
&--failed {
.user-name { background: #F5F7FA;
font-size: 16px; .customer-item-status-text {
font-weight: 500; color: #999EA8;
color: #1a1a2e; }
flex-shrink: 0;
white-space: nowrap;
}
.active-list {
flex: 1;
min-width: 0;
align-items: center;
gap: 8px;
overflow: hidden;
} }
&--refund {
.active-item { background: #FFF5E6;
padding: 6px 12px; .customer-item-status-text {
border: 1px solid #dce1e6; color: #F7A431;
border-radius: 4px; }
font-size: 13px;
line-height: normal;
color: #6c6f75;
white-space: nowrap;
flex-shrink: 0;
box-sizing: border-box;
} }
} }
.customer-item-status-text {
.form-header { font-size: 12px;
width: 100%; line-height: 22px;
height: 28px; }
font-size: 13px; .user-tag {
color: #2c66f7; width: 32px;
border-radius: 4px; height: 32px;
background: rgba(44, 102, 247, 0.05); border-radius: 50%;
background: rgba(44, 102, 247, 0.1);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: 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%;
.form-box { height: 28px;
flex-shrink: 0; font-size: 13px;
flex-wrap: wrap; color: #2c66f7;
align-items: flex-start; border-radius: 4px;
align-content: flex-start; background: rgba(44, 102, 247, 0.05);
row-gap: 16px; display: flex;
padding: toRpx(32) toRpx(40); align-items: center;
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; justify-content: center;
.required {
color: #f24724;
font-size: toRpx(28);
}
} }
}
.input, }
.select { .form-box {
width: toRpx(738); flex-shrink: 0;
height: toRpx(76); flex-wrap: wrap;
background: #ffffff; align-items: flex-start;
border-radius: toRpx(16); align-content: flex-start;
border: toRpx(2) solid transparent !important; row-gap: 16px;
outline: none; padding: toRpx(32) toRpx(40);
color: #333333; justify-content: space-between;
box-sizing: border-box; &--no-top {
line-height: toRpx(76); padding-top: 0;
padding: 0 toRpx(32) !important; }
.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); font-size: toRpx(28);
&::placeholder {
color: #33333333;
}
.value {
max-width: toRpx(598);
}
} }
}
.placeholderStyle { .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; color: #33333333;
} }
.value {
.arrow { max-width: toRpx(598);
color: #999 !important;
margin-left: auto;
flex-shrink: 0;
}
.error {
border: toRpx(2) solid #f24724 !important;
} }
}
.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;
}
.readonly-box {
width: toRpx(738);
align-items: center;
gap: toRpx(16);
.input--readonly { .input--readonly {
color: #666666; flex: 1;
background: #f5f7fa; width: 0;
}
.form-item--full {
width: 100%;
.input-box,
.input,
.select,
.input--readonly {
flex: 1;
width: 0;
}
} }
.sync-btn {
.input-box { flex-shrink: 0;
width: toRpx(738); min-width: toRpx(112);
height: toRpx(76); height: toRpx(76);
background: #ffffff; padding: 0 toRpx(24);
background: #dae9ff;
border-radius: toRpx(16); border-radius: toRpx(16);
color: #2c66f7;
font-size: toRpx(28);
font-weight: 500;
line-height: toRpx(76);
text-align: center;
box-sizing: border-box; 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;
}
} }
} }
.form-item--full {
.btns { width: 100%;
justify-content: center; .input-box,
gap: 0 toRpx(34); .input,
padding-bottom: toRpx(32); .select,
flex-shrink: 0; .input--readonly {
flex: 1;
.btn { width: 0;
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 { .input-box {
background: #dae9ff; width: toRpx(738);
color: #2c66f7; 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 {
.disabled { flex-shrink: 0;
background-image: linear-gradient(0deg, #2c66f799 0%, #48a6ff99 100%); font-size: toRpx(24);
color: #999999;
line-height: toRpx(76);
white-space: nowrap;
} }
} }
</style> }
.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 \ 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!