Commit 9483f61f by Lin

feat(reception): 新增接待复盘列表接口和组件重构

- 添加 getReceptionList 接口以查询当前门店接待复盘列表
- 引入 CardContainer 组件以统一接待看板的样式
- 替换多个组件中的玻璃卡片样式为 CardContainer,提升一致性
- 移除不再使用的 CarBrandSelect 组件及相关模拟数据
- 更新相关组件以适应新的品牌选择逻辑
1 parent 7cfe7941
...@@ -43,6 +43,14 @@ export async function getCustomerFileList(params: UTSJSONObject): Promise<any> { ...@@ -43,6 +43,14 @@ export async function getCustomerFileList(params: UTSJSONObject): Promise<any> {
} }
return await http.fetch("dj.api.smartcarlife.customervisits.customerInfoPage", data, true, "dj") return await http.fetch("dj.api.smartcarlife.customervisits.customerInfoPage", data, true, "dj")
} }
/** 查询当前门店接待复盘列表(接待复盘列表) */
export async function getReceptionList(params: UTSJSONObject): Promise<any> {
const data: UTSJSONObject = {
projectName: 'boutique',
...params
}
return await http.fetch("dj.api.smartcarlife.reception.customer.page", data, true, "dj")
}
export async function findAllSence(params: UTSJSONObject): Promise<any> { export async function findAllSence(params: UTSJSONObject): Promise<any> {
const data: UTSJSONObject = { const data: UTSJSONObject = {
projectName: 'boutique', projectName: 'boutique',
......
...@@ -131,7 +131,7 @@ const carModel = computed<null|string>(() => { ...@@ -131,7 +131,7 @@ const carModel = computed<null|string>(() => {
const carBrand = computed<null|string>(() => { const carBrand = computed<null|string>(() => {
const car_key = props.carModelKey; const car_key = props.carBrandKey;
if (props.customBoolean) { if (props.customBoolean) {
const echoObj = props.echoData as UTSJSONObject; const echoObj = props.echoData as UTSJSONObject;
const value = echoObj[car_key]; const value = echoObj[car_key];
......
<template>
<view :class="rootClass">
<slot />
</view>
</template>
<script setup lang="uts">
import { computed } from 'vue'
/**
* 接待看板统一毛玻璃卡片容器:背景、描边、圆角、阴影与 flex 纵向布局。
* - plain:仅外壳,无默认内边距与底部间距(自行控制留白)
* - output:24px 内边距(产值、对比条等卡片)
* - funnel:同 output,并保留底部 10px 外边距(与列表间距一致)
*/
const props = withDefaults(
defineProps<{
variant?: 'plain' | 'output' | 'funnel'
/** 追加在根节点上的 class,空格分隔,便于业务侧扩展布局或覆盖 */
extraClass?: string
}>(),
{
variant: 'output',
extraClass: ''
}
)
const rootClass = computed((): string => {
let s = 'card-container'
if (props.variant == 'output' || props.variant == 'funnel') {
s += ' card-container--padded'
}
if (props.variant == 'funnel') {
s += ' card-container--funnel-gap'
}
if (props.extraClass != null && props.extraClass != '') {
s += ' ' + props.extraClass
}
return s
})
</script>
<style scoped lang="scss">
.card-container {
background-color: rgba(255, 255, 255, 0.7);
border: 1px solid rgba(255, 255, 255, 0.4);
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
border-radius: 32px;
flex-direction: column;
}
.card-container--padded {
padding: 24px;
}
.card-container--funnel-gap {
margin-bottom: 10px;
}
</style>
<template> <template>
<view class="glass-card funnel-card"> <card-container variant="funnel">
<view class="title-box"> <view class="title-box">
<text class="title-text">门店客流情况</text> <text class="title-text">门店客流情况</text>
</view> </view>
<view class="funnel-container"> <view class="funnel-container">
<text class="funnel-title">门店客流情况</text>
<view class="funnel-chart-box"> <view class="funnel-chart-box">
<view class="funnel-box"> <view class="funnel-box">
<view class="funnel-bg-layer"></view> <view class="funnel-bg-layer"></view>
...@@ -23,11 +22,12 @@ ...@@ -23,11 +22,12 @@
</view> </view>
</view> </view>
</view> </view>
</view> </card-container>
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import { computed } from 'vue' import { computed } from 'vue'
import CardContainer from './CardContainer.uvue'
/** 业绩看板聚合数据,与 center 中 performanceData 同源 */ /** 业绩看板聚合数据,与 center 中 performanceData 同源 */
const props = withDefaults( const props = withDefaults(
...@@ -94,19 +94,6 @@ const contactRateMasked = computed((): string => { ...@@ -94,19 +94,6 @@ const contactRateMasked = computed((): string => {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.glass-card {
background-color: rgba(255, 255, 255, 0.7);
border: 1px solid rgba(255, 255, 255, 0.4);
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
border-radius: 32px;
flex-direction: column;
}
.funnel-card {
padding: 24px;
margin-bottom: 10px;
}
.title-box { .title-box {
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
...@@ -124,7 +111,6 @@ const contactRateMasked = computed((): string => { ...@@ -124,7 +111,6 @@ const contactRateMasked = computed((): string => {
border-radius: 16px; border-radius: 16px;
padding: 16px; padding: 16px;
padding-right: 90px; padding-right: 90px;
margin-top: 32px;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
border: 1px solid rgba(255, 255, 255, 0.6); border: 1px solid rgba(255, 255, 255, 0.6);
......
<template> <template>
<view class="glass-card output-value-card"> <card-container>
<view class="title-box"> <view class="title-box">
<text class="title-text">本月产值</text> <text class="title-text">本月产值</text>
</view> </view>
...@@ -44,11 +44,12 @@ ...@@ -44,11 +44,12 @@
<text class="right-count-value">{{ achievementValueDisplay }}</text> <text class="right-count-value">{{ achievementValueDisplay }}</text>
</view> </view>
</view> </view>
</view> </card-container>
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import { computed } from 'vue' import { computed } from 'vue'
import CardContainer from './CardContainer.uvue'
import type { OutputSummary } from './reception-output-types.uts' import type { OutputSummary } from './reception-output-types.uts'
const props = withDefaults( const props = withDefaults(
...@@ -134,18 +135,6 @@ const ringRightStyle = computed(() => { ...@@ -134,18 +135,6 @@ const ringRightStyle = computed(() => {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.glass-card {
background-color: rgba(255, 255, 255, 0.7);
border: 1px solid rgba(255, 255, 255, 0.4);
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
border-radius: 32px;
flex-direction: column;
}
.output-value-card {
padding: 24px;
}
.title-box { .title-box {
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
......
<template> <template>
<view class="glass-card output-value-card"> <card-container>
<view class="tabs-box"> <view class="tabs-box">
<un-segmented <un-segmented
shape="circle" shape="circle"
...@@ -30,10 +30,11 @@ ...@@ -30,10 +30,11 @@
<text class="compare-value">{{ metricsVisible ? row.value : '****' }}</text> <text class="compare-value">{{ metricsVisible ? row.value : '****' }}</text>
</view> </view>
</view> </view>
</view> </card-container>
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import CardContainer from './CardContainer.uvue'
import type { CompareRow } from './reception-output-types.uts' import type { CompareRow } from './reception-output-types.uts'
const props = withDefaults( const props = withDefaults(
...@@ -62,18 +63,6 @@ const onSegmentedTabIndex = (v: number): void => { ...@@ -62,18 +63,6 @@ const onSegmentedTabIndex = (v: number): void => {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.glass-card {
background-color: rgba(255, 255, 255, 0.7);
border: 1px solid rgba(255, 255, 255, 0.4);
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
border-radius: 32px;
flex-direction: column;
}
.output-value-card {
padding: 24px;
}
.tabs-box { .tabs-box {
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
......
...@@ -77,12 +77,10 @@ ...@@ -77,12 +77,10 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 品牌车型:CarBrandSelect 显隐由 brandCascaderShow 与 watch 同步 open/close --> <!-- 品牌车型:CarBrands 显隐由 brandCascaderShow 与 watch 同步 open/close -->
<CarBrandSelect <CarBrands
ref="carBrandSelectRef" ref="carBrandSelectRef"
:echo-data="carBrandEchoData" @select="onCarBrandsSelect"
echo-child-brand-key="carBrand"
@confirm="onCarBrandConfirm"
@close="onCarBrandClose" @close="onCarBrandClose"
/> />
<SenceSelect <SenceSelect
...@@ -116,7 +114,7 @@ ...@@ -116,7 +114,7 @@
<script setup lang="uts"> <script setup lang="uts">
import { ref, onMounted, watch, nextTick, computed } from 'vue' import { ref, onMounted, watch, nextTick, computed } from 'vue'
import { ComponentPublicInstance } from 'vue' import { ComponentPublicInstance } from 'vue'
import CarBrandSelect from './CarBrandSelect.uvue' import CarBrands from '@/components/CarBrands.uvue'
import SenceSelect from './SenceSelect.uvue' import SenceSelect from './SenceSelect.uvue'
import CustomerTags from './CustomerTags.uvue' import CustomerTags from './CustomerTags.uvue'
...@@ -188,23 +186,12 @@ function onDatePickerConfirm(): void { ...@@ -188,23 +186,12 @@ function onDatePickerConfirm(): void {
datePickerShow.value = false datePickerShow.value = false
} }
// 品牌车型选择器:true 时打开 CarBrandSelect,false 时关闭(占位文案仍由 formData.brandModel 是否为空决定) // 品牌车型选择器:true 时打开 CarBrands,false 时关闭(占位文案仍由 formData.brandModel 是否为空决定)
const brandCascaderShow = ref(false) const brandCascaderShow = ref(false)
const carBrandSelectRef = ref<ComponentPublicInstance | null>(null) const carBrandSelectRef = ref<ComponentPublicInstance | null>(null)
/** 与 CarBrandSelect 的 emit 字段一致(UTSJSONObject),供再次打开时高亮已选子品牌/车型;不可 as 强转为自定义 type(Android 会 ClassCastException) */
const carBrandSelectionEcho = ref<UTSJSONObject | null>(null)
const carBrandEchoData = computed((): UTSJSONObject => {
const p = carBrandSelectionEcho.value
if (p == null) {
return {} as UTSJSONObject
}
return p
})
watch(brandCascaderShow, (show: boolean) => { watch(brandCascaderShow, (show: boolean) => {
// 双 nextTick:CarBrandSelect 在 un-popup 内,确保弹层渲染后再取 ref 调用 open // 双 nextTick:CarBrands 在 un-popup 内,确保弹层渲染后再取 ref 调用 open
nextTick(() => { nextTick(() => {
nextTick(() => { nextTick(() => {
const r = carBrandSelectRef.value const r = carBrandSelectRef.value
...@@ -221,7 +208,7 @@ watch(brandCascaderShow, (show: boolean) => { ...@@ -221,7 +208,7 @@ watch(brandCascaderShow, (show: boolean) => {
}) })
}) })
// 接待场景:与 CarBrandSelect 相同,通过 ref + watch 打开底部标签弹框 // 接待场景:与 CarBrands 相同,通过 ref + watch 打开底部标签弹框
const sceneSelectShow = ref(false) const sceneSelectShow = ref(false)
const sceneSelectRef = ref<ComponentPublicInstance | null>(null) const sceneSelectRef = ref<ComponentPublicInstance | null>(null)
...@@ -294,23 +281,25 @@ function onCustomerTagsClose(): void { ...@@ -294,23 +281,25 @@ function onCustomerTagsClose(): void {
customerTagsSelectShow.value = false customerTagsSelectShow.value = false
} }
function onCarBrandConfirm(payload: UTSJSONObject): void { function onCarBrandsSelect(payload: UTSJSONObject): void {
brandCascaderShow.value = false brandCascaderShow.value = false
const parts: string[] = [] const parts: string[] = []
const one = payload['oneCarBrand'] // CarBrands emit payload 字段(old CarBrands):
const child = payload['carBrand'] // - 车型:name / id(来自 item)
const model = payload['carModel'] // - 一级品牌:carBrand(来自 selectItemVal)
if (one != null && `${one}` != '') { // - 子品牌:carChildsBrandName(来自 selectItemVal)
parts.push(`${one}`) const oneV = payload['carBrand']
} const childV = payload['carChildsBrandName']
if (child != null && `${child}` != '') { const modelV = payload['name']
parts.push(`${child}`)
} const oneStr = oneV != null ? `${oneV}` : ''
if (model != null && `${model}` != '') { const childStr = childV != null ? `${childV}` : ''
parts.push(`${model}`) const modelStr = modelV != null ? `${modelV}` : ''
}
if (oneStr != '') parts.push(oneStr)
if (childStr != '') parts.push(childStr)
if (modelStr != '') parts.push(modelStr)
formData.value.brandModel = parts.join(' ') formData.value.brandModel = parts.join(' ')
carBrandSelectionEcho.value = payload
} }
function onCarBrandClose(): void { function onCarBrandClose(): void {
...@@ -323,7 +312,6 @@ function resetForm(): void { ...@@ -323,7 +312,6 @@ function resetForm(): void {
sceneSelectShow.value = false sceneSelectShow.value = false
customerTagsSelectShow.value = false customerTagsSelectShow.value = false
visitDateValue.value = '' visitDateValue.value = ''
carBrandSelectionEcho.value = null
} }
function handleClose(): void { function handleClose(): void {
......
/**
* 接待中心品牌/车型选择:纯 UTS 构造的模拟数据(避免 JSON.parse 在部分端上异常导致「获取品牌失败」)。
* CarBrandSelect 中 USE_MOCK_CAR_BRAND_LIST 为 true 时使用;改回 false 则走真实接口与登录校验。
*/
/** 与 flattenMerchantBrands 摊平后每行结构一致:子品牌行 + brandId、brandName */
export function getMockFlatCarBrandRows(): Array<any> {
const out: Array<any> = []
function pushRow(
brandId: number,
brandName: string,
childId: number,
childName: string
): void {
const row = {} as UTSJSONObject
row['id'] = childId
row['name'] = childName
row['brandId'] = brandId
row['brandName'] = brandName
out.push(row)
}
pushRow(2149, 'ARCFOX极狐', 2150, '北汽新能源')
pushRow(2978, '鸿蒙智行', 3454, 'AITO 问界')
pushRow(2978, '鸿蒙智行', 3458, 'LUXEED 智界')
pushRow(2978, '鸿蒙智行', 3502, 'MAEXTRO 尊界')
pushRow(2978, '鸿蒙智行', 3503, 'STELATO 享界')
pushRow(2978, '鸿蒙智行', 3574, 'SAIC 尚界')
return out
}
/** 第二步车型列表(替代 getCarBrandsListApi) */
export function getMockCarModelsList(): Array<any> {
const out: Array<any> = []
const m1 = {} as UTSJSONObject
m1['id'] = 90001
m1['name'] = '模拟车型 · 尊享版'
out.push(m1)
const m2 = {} as UTSJSONObject
m2['id'] = 90002
m2['name'] = '模拟车型 · 智驾版'
out.push(m2)
return out
}
...@@ -19,25 +19,5 @@ export type OutputSummary = { ...@@ -19,25 +19,5 @@ export type OutputSummary = {
ringComparePercent: number ringComparePercent: number
} }
/** 品牌车型选择结果(与 CarBrands / 客户信息字段对齐) */ // NOTE: 该文件原先包含 CarBrandSelect(品牌-车型两步选择组件)相关类型。
export type CarBrandSelectPayload = { // 本次移除该组件后,这些类型不再被其它代码引用,因此删除以避免维护负担。
carBrand: string
carBrandId: number | string
oneCarBrand: string
oneCarBrandId: number | string
carModel: string
carModelId: number | string
}
/**
* getMerchantCarBrandList 返回的 res.data 为门店对象数组,每项含 carBrandList。
* 一级品牌:id、name、letter、logoUrl、childs(子品牌数组,元素 childs 可为 null)。
* 摊平到可选行后:在子项上挂载 brandId=一级 id、brandName=一级 name;
* 请求车型列表:getCarSeriesList 使用 brandId + childBrandId=子项 id。
*/
export type FlatCarBrandChildRow = {
id: number | string
name: string
brandId: number | string
brandName: string
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!