Commit 29559c09 by Lin

feat(reception): 添加接待信息编辑页面及相关功能

- 新增接待信息编辑页面 FormReceptionListEdit,支持用户输入接待信息
- 更新接待中心列表,支持跳转到接待信息编辑页面
- 引入 buildPageUrlWithRecord 函数,优化页面跳转逻辑
- 修改接待记录数据结构,添加 orderFinishFlag 字段以支持接待结果的处理
1 parent 8321e0f5
......@@ -66,6 +66,13 @@
}
},
{
"path": "pages/receptionCenter/FormReceptionListEdit",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "接待信息"
}
},
{
"path": "pages/receptionCenter/receptionDetail",
"style": {
"navigationStyle": "custom",
......
......@@ -175,7 +175,7 @@ import ReceptionDetail from "./receptionDetail.uvue";
import pageVars from "./styles/index.vars";
import ReceptionCustomerListTab from "./tabs/ReceptionCustomerListTab.uvue";
import ReceptionDashboardTab from "./tabs/ReceptionDashboardTab.uvue";
import { getCurrentMonthRange, getMockPerformanceData, getNum, getStr, getTodayDayRangeStrings, mergeByKey, resolveHasMore } from "./types/reception-center-helpers.uts";
import { buildPageUrlWithRecord, getCurrentMonthRange, getMockPerformanceData, getNum, getStr, getTodayDayRangeStrings, mergeByKey, resolveHasMore } from "./types/reception-center-helpers.uts";
import type { CompareRow, OutputSummary } from "./types/reception-output-types.uts";
const shellRef = ref(null);
......@@ -419,7 +419,7 @@ onResize((_res: any) => {
function toReceptionListRowFromLocalRecord(rec: RecordData): UTSJSONObject {
// ListReception.uvue 使用 batchId 作为 key;本地记录只有 id,这里做一层兼容映射。
// 未提交列表不展示“战败/成交”,因此 orderFinishFlag 置空让角标隐藏。
const of = rec.orderFinishFlag
return {
batchId: rec.id,
customerName: rec.customerName ?? "",
......@@ -430,7 +430,7 @@ function toReceptionListRowFromLocalRecord(rec: RecordData): UTSJSONObject {
receptionStartTime: rec.receptionStartTime ?? "",
receptionEndTime: rec.receptionEndTime ?? "",
reviewFlag: 1,
orderFinishFlag: null,
orderFinishFlag: of != null ? of : null,
submitted: 0,
} as UTSJSONObject;
}
......@@ -542,7 +542,12 @@ function onReceptionCardClick(item: UTSJSONObject): void {
if (filterTabIndex.value == 0) {
// 与 FormAdd 打开方式一致:navigateTo + query record(JSON)
uni.navigateTo({
url: `/pages/receptionCenter/receptionDetail?record=${encodeURIComponent(JSON.stringify(item))}`
url: buildPageUrlWithRecord("/pages/receptionCenter/receptionDetail", item)
});
} else if (filterTabIndex.value == 1 && unsubmittedPendingTabIndex.value == 1) {
// 未提交 · 待提交:本地临时记录,跳转补充/编辑表单
uni.navigateTo({
url: buildPageUrlWithRecord("/pages/receptionCenter/FormReceptionListEdit", item)
});
} else {
uni.showToast({ title: "该接待尚不支持复盘", icon: "none" });
......@@ -643,7 +648,7 @@ function onCustomerEntryClick(): void {
function onListCustomerEntryEdit(item: UTSJSONObject): void {
uni.navigateTo({
url: `/pages/receptionCenter/FormAdd?record=${encodeURIComponent(JSON.stringify(item))}`
url: buildPageUrlWithRecord("/pages/receptionCenter/FormAdd", item)
});
}
......@@ -660,7 +665,7 @@ function onReceptionRecordDetailClose(): void {
function onListCustomerEntryClick(item: UTSJSONObject): void {
// 与 FormAdd 打开方式一致:navigateTo + query record(JSON)
uni.navigateTo({
url: `/pages/receptionCenter/forms/FormDetail?record=${encodeURIComponent(JSON.stringify(item))}`
url: buildPageUrlWithRecord("/pages/receptionCenter/forms/FormDetail", item)
});
}
......
......@@ -25,7 +25,9 @@
<view class="card-header-row">
<view class="card-title-box">
<text class="card-name">{{ getStr(item, 'customerName') }}</text>
<text class="card-car">{{ getStr(item, 'carBrand') }}</text>
<text class="card-car">{{
getStr(item, 'carModel') != '' ? getStr(item, 'carModel') : getStr(item, 'carBrand')
}}</text>
</view>
<view class="card-status-box">
<view class="status-badge bg-slate-100">
......
......@@ -148,3 +148,12 @@ export function isPerformanceDataEmpty(data: UTSJSONObject | null): boolean {
const hasRate = rate != null && `${rate}` != ''
return !(hasCount || hasRate)
}
/**
* 拼接带 record(JSON) 查询参数的页面 URL,供 uni.navigateTo 使用。
* 放在独立 .uts 中可避免 center.uvue 内对 url 表达式的路由校验误报。
*/
export function buildPageUrlWithRecord(path: string, item: UTSJSONObject): string {
const jsonStr = JSON.stringify(item)
return path + "?record=" + encodeURIComponent(jsonStr)
}
......@@ -89,6 +89,7 @@ export class DefaultRecorderStrategy implements IRecorderStrategy {
`carBrandId TEXT`,
`oneCarBrand TEXT`,
`oneCarBrandId TEXT`,
`orderFinishFlag INTEGER`,
];
}
......
......@@ -19,6 +19,8 @@ export type RecordData = {
channelType?: null | number
customerName?: null | string
endReasonType?: null | number
/** 接待结果:0 战败,1 成交(本地补充) */
orderFinishFlag?: null | number
id: string
loginPhone?: null | string
merchantId?: null | number
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!