Commit 21bf162f by Lin

refactor(接待中心): 移除冗余组件并优化表单样式

- 删除 ReceptionCenter 组件,整合其功能至接待中心页面
- 优化 FormAdd 组件的表单项样式,统一对齐方式和交互体验
- 调整 CustomerTags 组件的样式,避免布局冲突
- 清理不必要的代码和注释,提升代码可读性
1 parent fe62a028
...@@ -6,11 +6,12 @@ ...@@ -6,11 +6,12 @@
<view class="reception-navbar-spacer"></view> <view class="reception-navbar-spacer"></view>
<view class="form-add-wrap"> <view class="form-add-wrap">
<view class="form-add-body"> <view class="form-add-body">
<un-form :model="formData" labelWidth="80" borderBottom> <un-form :model="formData" labelWidth="80" labelAlign="left" borderBottom>
<un-form-item label="车主姓名" prop="ownerName"> <un-form-item label="车主姓名" prop="ownerName">
<un-input <un-input
v-model="formData['ownerName']" v-model="formData['ownerName']"
border="none" border="none"
inputAlign="right"
placeholder="请输入车主姓名" placeholder="请输入车主姓名"
:maxlength="50" :maxlength="50"
></un-input> ></un-input>
...@@ -21,53 +22,61 @@ ...@@ -21,53 +22,61 @@
v-model="formData['ownerPhone']" v-model="formData['ownerPhone']"
border="none" border="none"
type="tel" type="tel"
inputAlign="right"
placeholder="请输入车主电话" placeholder="请输入车主电话"
:maxlength="11" :maxlength="11"
></un-input> ></un-input>
</un-form-item> </un-form-item>
<un-form-item label="品牌车型" prop="brandModel"> <un-form-item label="品牌车型" prop="brandModel">
<un-cell <view class="form-add-link-cell" @click="brandCascaderShow = true">
:value="formData.brandModel !== '' ? formData.brandModel : '请选择品牌车型'" <text
isLink class="form-add-link-cell__value"
:border="false" :style="getCellValueStyle(formData.brandModel !== '')"
size="large" >
@click="brandCascaderShow = true" {{ formData.brandModel !== '' ? formData.brandModel : '请选择品牌车型' }}
:valueStyle="formData.brandModel !== '' ? 'color: #1e293b; font-size: 15px;' : 'color: #94a3b8; font-size: 15px;'" </text>
></un-cell> <un-icon name="arrow-right" color="#a1a1a1"></un-icon>
</view>
</un-form-item> </un-form-item>
<un-form-item label="接待场景" prop="receptionSceneName"> <un-form-item label="接待场景" prop="receptionSceneName">
<un-cell <view class="form-add-link-cell" @click="sceneSelectShow = true">
:value="formData.receptionSceneName !== '' ? formData.receptionSceneName : '请选择接待场景'" <text
isLink class="form-add-link-cell__value"
size="large" :style="getCellValueStyle(formData.receptionSceneName !== '')"
:border="false" >
@click="sceneSelectShow = true" {{ formData.receptionSceneName !== '' ? formData.receptionSceneName : '请选择接待场景' }}
:valueStyle="formData.receptionSceneName !== '' ? 'color: #1e293b; font-size: 15px;' : 'color: #94a3b8; font-size: 15px;'" </text>
></un-cell> <un-icon name="arrow-right" color="#a1a1a1"></un-icon>
</view>
</un-form-item> </un-form-item>
<un-form-item label="到店日期" prop="arrivalDate"> <un-form-item label="到店日期" prop="arrivalDate">
<un-cell <view class="form-add-link-cell" @click="onOpenDatePicker">
:value="formData.arrivalDate !== '' ? formData.arrivalDate : '请选择到店日期'" <text
isLink class="form-add-link-cell__value"
size="large" :style="getCellValueStyle(formData.arrivalDate !== '')"
:border="false" >
@click="onOpenDatePicker" {{ formData.arrivalDate !== '' ? formData.arrivalDate : '请选择到店日期' }}
:valueStyle="formData.arrivalDate !== '' ? 'color: #1e293b; font-size: 15px;' : 'color: #94a3b8; font-size: 15px;'" </text>
></un-cell> <un-icon name="arrow-right" color="#a1a1a1"></un-icon>
</view>
</un-form-item> </un-form-item>
<un-form-item label="客户标签" prop="customerTagName"> <un-form-item label="客户标签" prop="customerTagName">
<un-cell <view
:value="formData.customerTagName !== '' ? formData.customerTagName : '请选择客户标签'" class="form-add-link-cell"
isLink
size="large"
:border="false"
@click="customerTagsSelectShow = true" @click="customerTagsSelectShow = true"
:valueStyle="formData.customerTagName !== '' ? 'color: #1e293b; font-size: 15px;' : 'color: #94a3b8; font-size: 15px;'"
:style="{ position: 'relative', zIndex: 10 }" :style="{ position: 'relative', zIndex: 10 }"
></un-cell> >
<text
class="form-add-link-cell__value"
:style="getCellValueStyle(formData.customerTagName !== '')"
>
{{ formData.customerTagName !== '' ? formData.customerTagName : '请选择客户标签' }}
</text>
<un-icon name="arrow-right" color="#a1a1a1"></un-icon>
</view>
</un-form-item> </un-form-item>
</un-form> </un-form>
</view> </view>
...@@ -124,6 +133,13 @@ import { storage } from '@/utils/storage.uts' ...@@ -124,6 +133,13 @@ import { storage } from '@/utils/storage.uts'
const phoneRex = /^1[3-9]\d{9}$/ const phoneRex = /^1[3-9]\d{9}$/
function getCellValueStyle(hasValue: boolean): string {
// 统一控制:label 左、value 右(这里只管 value 的对齐与颜色)
return hasValue
? 'color: #1e293b; font-size: 14px; text-align: right;margin-right: 6px;'
: 'color:rgb(151, 150, 150); font-size: 14px; text-align: right;margin-right: 6px;'
}
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
show?: boolean show?: boolean
...@@ -564,17 +580,18 @@ async function handleSubmit(): Promise<void> { ...@@ -564,17 +580,18 @@ async function handleSubmit(): Promise<void> {
const body = res as UTSJSONObject const body = res as UTSJSONObject
const code = fieldStr(body, 'code') const code = fieldStr(body, 'code')
console.log('saveVisitsInfo 保存更新成功code', code)
if (code !== '0') { // 失败直接提示后结束
if (code != '0') {
const msg = fieldStr(body, 'message') const msg = fieldStr(body, 'message')
uni.showToast({ title: msg !== '' ? msg : '保存失败', icon: 'none' }) uni.showToast({ title: msg !== '' ? msg : '保存失败', icon: 'none' })
return return
} }
// 成功:处理重复记录提示(后端可能用 data 标记归类结果)
const flag = fieldStr(body, 'data') const flag = fieldStr(body, 'data')
if (flag === '2') { if (flag === '2') {
// 重复记录处理
await new Promise<void>((resolve) => { await new Promise<void>((resolve) => {
uni.showModal({ uni.showModal({
content: '存在与该手机号相同的接待记录,系统将自动归类到已接待', content: '存在与该手机号相同的接待记录,系统将自动归类到已接待',
...@@ -588,11 +605,8 @@ async function handleSubmit(): Promise<void> { ...@@ -588,11 +605,8 @@ async function handleSubmit(): Promise<void> {
// 提父级刷新并关闭 // 提父级刷新并关闭
uni.showToast({ title: '提交成功', icon: 'success' }) uni.showToast({ title: '提交成功', icon: 'success' })
resetForm() handleClose();
emit('saved')
emit('close')
uni.$emit('refresh-reception-list') uni.$emit('refresh-reception-list')
uni.navigateBack()
} catch (_e) { } catch (_e) {
uni.showToast({ title: '网络异常,请重试', icon: 'none' }) uni.showToast({ title: '网络异常,请重试', icon: 'none' })
...@@ -708,4 +722,24 @@ onLoad((options: UTSJSONObject) => { ...@@ -708,4 +722,24 @@ onLoad((options: UTSJSONObject) => {
.submit-btn .btn-text { .submit-btn .btn-text {
color: #ffffff; color: #ffffff;
} }
.form-add-link-cell {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
box-sizing: border-box;
}
.form-add-link-cell__value {
flex: 1;
}
.form-add-link-cell__arrow {
margin-left: 6px;
color: #cbd5e1;
font-size: 14px;
text-align: right;
}
</style> </style>
...@@ -89,9 +89,6 @@ ...@@ -89,9 +89,6 @@
@confirm="onReviewPickerConfirm" @confirm="onReviewPickerConfirm"
/> />
<!-- 客户档案详情全屏层 -->
<view v-if="showReceptionDetail" class="form-detail-inner">
<!-- 客户录入列表 → 客户档案(FormDetail) --> <!-- 客户录入列表 → 客户档案(FormDetail) -->
<view v-if="showCustomerFormDetail" class="form-detail-inner"> <view v-if="showCustomerFormDetail" class="form-detail-inner">
<FormDetail <FormDetail
......
...@@ -561,10 +561,12 @@ ...@@ -561,10 +561,12 @@
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
/* 仅作弹层容器:勿 flex:1,否则会与表单区(如 FormAdd 的 form-add-wrap)瓜分纵向空间并引发点击穿透/叠层问题 */
.customer-tags-root { .customer-tags-root {
width: 100%; width: 100%;
flex: 1; height: 0;
min-height: 0; flex-grow: 0;
flex-shrink: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
/* Android:滚动父级勿用 overflow:hidden,易导致子 list-view 手势异常(FormDetail 同注) */ /* Android:滚动父级勿用 overflow:hidden,易导致子 list-view 手势异常(FormDetail 同注) */
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!