Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ujia
/
uj-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cc04d92f
authored
Nov 13, 2026
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化评估单详情页面,重构数据展示逻辑,新增动态事件配置
1 parent
5710314b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
39 deletions
apps/web/subapps/usedcar/src/pages/Assessment/AssessmentDetail.tsx
apps/web/subapps/usedcar/src/pages/Assessment/detailConfig.ts
apps/web/subapps/usedcar/src/pages/Assessment/AssessmentDetail.tsx
View file @
cc04d92
...
@@ -6,18 +6,11 @@ import { assessmentApi, type AssessmentDetail as Detail } from '@/api';
...
@@ -6,18 +6,11 @@ import { assessmentApi, type AssessmentDetail as Detail } from '@/api';
import { UC } from '@/permissions/codes';
import { UC } from '@/permissions/codes';
import type { PageParams } from '@/routes';
import type { PageParams } from '@/routes';
import { goTo } from '../Leads/navigate';
import { goTo } from '../Leads/navigate';
import {
PRICE_DETAIL_FIELDS, readOnlyValues
, VEHICLE_DETAIL_FIELDS } from './detailConfig';
import {
DYNAMIC_EVENT_CONFIG, PRICE_DETAIL_FIELDS, readOnlyValues, VEHICLE_ASSET_GROUPS
, VEHICLE_DETAIL_FIELDS } from './detailConfig';
import './assessment.css';
import './assessment.css';
const display = (value: unknown) =>
const display = (value: unknown) =>
value === undefined || value === null || value === '' ? '-' : String(value);
value === undefined || value === null || value === '' ? '-' : String(value);
const operationName: Record<string, string> = {
'10': '总部定价师估价',
'20': '驻店人员报价反馈',
'30': '驻店人员驳回',
'40': '总部核价',
'50': '总部核价驳回',
};
function files(value: unknown) {
function files(value: unknown) {
return Array.isArray(value) ? value : [];
return Array.isArray(value) ? value : [];
}
}
...
@@ -69,15 +62,10 @@ export default function AssessmentDetail({ params }: { params: PageParams }) {
...
@@ -69,15 +62,10 @@ export default function AssessmentDetail({ params }: { params: PageParams }) {
<UCard>
<UCard>
<h3>车辆资料</h3>
<h3>车辆资料</h3>
<div className="uc-assess-files">
<div className="uc-assess-files">
{[
{VEHICLE_ASSET_GROUPS.map((group) => {
['车辆图片', files(data.carImageUrls)],
const urls = files(data[group.key]);
['证件资料', files(data.documentUrls)],
return <span key={group.key}>
['车辆视频', files(data.carVideoUrls)],
{group.label}:
['检测报告', files(data.carCheckReportUrls)],
['其他图片', files(data.otherImageUrls)],
].map(([label, urls]) => (
<span key={String(label)}>
{String(label)}:
{Array.isArray(urls) && urls.length
{Array.isArray(urls) && urls.length
? urls.map((url, index) => (
? urls.map((url, index) => (
<a key={String(url)} href={String(url)} target="_blank" rel="noreferrer">
<a key={String(url)} href={String(url)} target="_blank" rel="noreferrer">
...
@@ -85,8 +73,8 @@ export default function AssessmentDetail({ params }: { params: PageParams }) {
...
@@ -85,8 +73,8 @@ export default function AssessmentDetail({ params }: { params: PageParams }) {
</a>
</a>
))
))
: '-'}
: '-'}
</span>
</span>
;
)
)}
}
)}
</div>
</div>
</UCard>
</UCard>
<PriceCard title="总部定价师估价与意见" data={pricing} fallback={data} />
<PriceCard title="总部定价师估价与意见" data={pricing} fallback={data} />
...
@@ -97,29 +85,21 @@ export default function AssessmentDetail({ params }: { params: PageParams }) {
...
@@ -97,29 +85,21 @@ export default function AssessmentDetail({ params }: { params: PageParams }) {
<UAlert type="error" showIcon title="评估动态加载失败" />
<UAlert type="error" showIcon title="评估动态加载失败" />
) : history.data?.length ? (
) : history.data?.length ? (
<div className="uc-assess-history">
<div className="uc-assess-history">
{history.data.map((item, index) => (
{history.data.map((item, index) => {
<div
const config = DYNAMIC_EVENT_CONFIG[String(item.opType)];
return <div
className="uc-assess-history__item"
className="uc-assess-history__item"
key={`${String(item.quoteTime ?? '')}-${index}`}
key={`${String(item.quoteTime ?? '')}-${index}`}
>
>
<div className="uc-assess-history__head">
<div className="uc-assess-history__head">
<b>
<b>
{
operationName[String(item.opType)]
?? '评估动态'}:{display(item.createdBy)}
{
config?.title
?? '评估动态'}:{display(item.createdBy)}
</b>
</b>
<span>{display(item.quoteTime)}</span>
<span>{display(item.quoteTime)}</span>
</div>
</div>
{item.evalPrice !== undefined ? <p>价格:{display(item.evalPrice)} 元</p> : null}
{config?.fields.map((field) => <p key={field.key}>{field.label}:{display(item[field.key])}{field.suffix ? ` ${field.suffix}` : ''}</p>)}
{item.evalOpinion ? <p>意见:{display(item.evalOpinion)}</p> : null}
</div>;
{item.rejectReason ? <p>驳回原因:{display(item.rejectReason)}</p> : null}
})}
{item.rejectSuggestion ? <p>驳回意见:{display(item.rejectSuggestion)}</p> : null}
{item.customerTargetPrice ? (
<p>意向报价:{display(item.customerTargetPrice)} 元</p>
) : null}
{item.customerTargetPriceFeedback ? (
<p>报价反馈:{display(item.customerTargetPriceFeedback)}</p>
) : null}
</div>
))}
</div>
</div>
) : (
) : (
<UEmpty description="暂无评估动态" />
<UEmpty description="暂无评估动态" />
...
...
apps/web/subapps/usedcar/src/pages/Assessment/detailConfig.ts
View file @
cc04d92
...
@@ -12,9 +12,17 @@ const empty = (value: unknown): string =>
...
@@ -12,9 +12,17 @@ const empty = (value: unknown): string =>
export
const
VEHICLE_DETAIL_FIELDS
:
ReadOnlyField
<
AssessmentDetail
>
[]
=
[
export
const
VEHICLE_DETAIL_FIELDS
:
ReadOnlyField
<
AssessmentDetail
>
[]
=
[
{
label
:
'车牌号'
,
value
:
(
data
)
=>
data
.
licensePlate
},
{
label
:
'车牌号'
,
value
:
(
data
)
=>
data
.
licensePlate
},
{
label
:
'车架号'
,
value
:
(
data
)
=>
data
.
vin
},
{
label
:
'车架号'
,
value
:
(
data
)
=>
data
.
vin
},
{
label
:
'车型'
,
value
:
(
data
)
=>
[
data
.
carBrand
,
data
.
carSeriesName
,
data
.
carTypeName
].
filter
(
Boolean
).
join
(
' '
)
},
{
label
:
'车型'
,
value
:
(
data
)
=>
[
data
.
carBrand
,
data
.
carSeriesName
,
data
.
carTypeName
].
filter
(
Boolean
).
join
(
' '
),
},
{
label
:
'上牌时间'
,
value
:
(
data
)
=>
data
.
registrationDate
},
{
label
:
'上牌时间'
,
value
:
(
data
)
=>
data
.
registrationDate
},
{
label
:
'上牌城市'
,
value
:
(
data
)
=>
[
data
.
registrationProvinceName
,
data
.
registrationCityName
].
filter
(
Boolean
).
join
(
''
)
},
{
label
:
'上牌城市'
,
value
:
(
data
)
=>
[
data
.
registrationProvinceName
,
data
.
registrationCityName
].
filter
(
Boolean
).
join
(
''
),
},
{
label
:
'表显里程'
,
value
:
(
data
)
=>
data
.
mileageStr
},
{
label
:
'表显里程'
,
value
:
(
data
)
=>
data
.
mileageStr
},
{
label
:
'门店'
,
value
:
(
data
)
=>
data
.
sellerMerchantName
},
{
label
:
'门店'
,
value
:
(
data
)
=>
data
.
sellerMerchantName
},
{
label
:
'销售顾问'
,
value
:
(
data
)
=>
data
.
sellerName
},
{
label
:
'销售顾问'
,
value
:
(
data
)
=>
data
.
sellerName
},
...
@@ -24,16 +32,82 @@ export const VEHICLE_DETAIL_FIELDS: ReadOnlyField<AssessmentDetail>[] = [
...
@@ -24,16 +32,82 @@ export const VEHICLE_DETAIL_FIELDS: ReadOnlyField<AssessmentDetail>[] = [
{
label
:
'车主联系方式'
,
value
:
(
data
)
=>
data
.
previousOwnerPhone
},
{
label
:
'车主联系方式'
,
value
:
(
data
)
=>
data
.
previousOwnerPhone
},
{
label
:
'评估单下单时间'
,
value
:
(
data
)
=>
data
.
evalOrderTime
},
{
label
:
'评估单下单时间'
,
value
:
(
data
)
=>
data
.
evalOrderTime
},
{
label
:
'评估单编号'
,
value
:
(
data
)
=>
data
.
evalOrderNo
},
{
label
:
'评估单编号'
,
value
:
(
data
)
=>
data
.
evalOrderNo
},
{
label
:
'综合评价'
,
value
:
(
data
)
=>
({
1
:
'优'
,
2
:
'良'
,
3
:
'中'
,
4
:
'差'
}
as
Record
<
number
,
string
>
)[
Number
(
data
.
overallRating
)]
},
{
label
:
'综合评价'
,
value
:
(
data
)
=>
(({
1
:
'优'
,
2
:
'良'
,
3
:
'中'
,
4
:
'差'
})
as
Record
<
number
,
string
>
)[
Number
(
data
.
overallRating
)
],
},
{
label
:
'车况描述'
,
wide
:
true
,
value
:
(
data
)
=>
data
.
conditionDescription
},
{
label
:
'车况描述'
,
wide
:
true
,
value
:
(
data
)
=>
data
.
conditionDescription
},
];
];
export
const
PRICE_DETAIL_FIELDS
:
ReadOnlyField
<
Record
<
string
,
unknown
>>
[]
=
[
export
const
PRICE_DETAIL_FIELDS
:
ReadOnlyField
<
Record
<
string
,
unknown
>>
[]
=
[
{
label
:
'评估价'
,
value
:
(
data
)
=>
data
.
evalPrice
===
undefined
?
'-'
:
`
${
String
(
data
.
evalPrice
)}
元`
},
{
label
:
'评估价'
,
value
:
(
data
)
=>
(
data
.
evalPrice
===
undefined
?
'-'
:
`
${
String
(
data
.
evalPrice
)}
元`
),
},
{
label
:
'总部定价师'
,
value
:
(
data
)
=>
data
.
createdBy
},
{
label
:
'总部定价师'
,
value
:
(
data
)
=>
data
.
createdBy
},
{
label
:
'评估意见'
,
value
:
(
data
)
=>
data
.
evalOpinion
},
{
label
:
'评估意见'
,
value
:
(
data
)
=>
data
.
evalOpinion
},
];
];
export
function
readOnlyValues
<
T
>
(
fields
:
ReadOnlyField
<
T
>
[],
data
:
T
):
Array
<
[
string
,
string
,
boolean
?]
>
{
/** 车辆资料按类别配置;新增资料只需补一项,无需调整页面结构。 */
export
const
VEHICLE_ASSET_GROUPS
=
[
{
label
:
'车辆图片'
,
key
:
'carImageUrls'
},
{
label
:
'证件资料'
,
key
:
'documentUrls'
},
{
label
:
'车辆视频'
,
key
:
'carVideoUrls'
},
{
label
:
'检测报告'
,
key
:
'carCheckReportUrls'
},
{
label
:
'其他图片'
,
key
:
'otherImageUrls'
},
]
as
const
;
interface
DynamicField
{
label
:
string
;
key
:
string
;
suffix
?:
string
;
}
/** 评估动态由操作类型决定展示内容,页面只按该配置渲染。 */
export
const
DYNAMIC_EVENT_CONFIG
:
Record
<
string
,
{
title
:
string
;
fields
:
DynamicField
[]
}
>
=
{
'10'
:
{
title
:
'总部定价师估价'
,
fields
:
[
{
label
:
'评估价'
,
key
:
'evalPrice'
,
suffix
:
'元'
},
{
label
:
'评估意见'
,
key
:
'evalOpinion'
},
],
},
'20'
:
{
title
:
'驻店人员报价反馈'
,
fields
:
[
{
label
:
'意向报价'
,
key
:
'customerTargetPrice'
,
suffix
:
'元'
},
{
label
:
'报价反馈'
,
key
:
'customerTargetPriceFeedback'
},
],
},
'30'
:
{
title
:
'驻店人员驳回'
,
fields
:
[
{
label
:
'驳回原因'
,
key
:
'rejectReason'
},
{
label
:
'驳回意见'
,
key
:
'rejectSuggestion'
},
],
},
'40'
:
{
title
:
'总部核价'
,
fields
:
[
{
label
:
'核价价格'
,
key
:
'evalPrice'
,
suffix
:
'元'
},
{
label
:
'核价意见'
,
key
:
'evalOpinion'
},
],
},
'50'
:
{
title
:
'总部核价驳回'
,
fields
:
[
{
label
:
'驳回原因'
,
key
:
'rejectReason'
},
{
label
:
'驳回意见'
,
key
:
'rejectSuggestion'
},
],
},
};
export
function
readOnlyValues
<
T
>
(
fields
:
ReadOnlyField
<
T
>
[],
data
:
T
,
):
Array
<
[
string
,
string
,
boolean
?]
>
{
return
fields
.
map
((
field
)
=>
[
field
.
label
,
empty
(
field
.
value
(
data
)),
field
.
wide
]);
return
fields
.
map
((
field
)
=>
[
field
.
label
,
empty
(
field
.
value
(
data
)),
field
.
wide
]);
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment