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 e0240807
authored
Nov 20, 2026
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改二手车列表的一些详情页面
1 parent
146c5e50
Pipeline
#578
for
e0240807
failed
in 0 seconds
Changes
25
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
2643 additions
and
1114 deletions
apps/web/subapps/usedcar/package.json
apps/web/subapps/usedcar/src/main.tsx
apps/web/subapps/usedcar/src/pages/Assessment/AssessmentDetail.tsx
apps/web/subapps/usedcar/src/pages/Assessment/EvaluatePage.tsx
apps/web/subapps/usedcar/src/pages/Assessment/assessment.css
apps/web/subapps/usedcar/src/pages/Condition/ConditionDetail.tsx
apps/web/subapps/usedcar/src/pages/Condition/condition.css
apps/web/subapps/usedcar/src/pages/Condition/conditionConfig.ts
apps/web/subapps/usedcar/src/pages/Condition/index.tsx
apps/web/subapps/usedcar/src/pages/CustomerGroup/GroupCodeEditor.tsx
apps/web/subapps/usedcar/src/pages/CustomerGroup/customerGroup.css
apps/web/subapps/usedcar/src/pages/Delivery/DeliveryDetail.tsx
apps/web/subapps/usedcar/src/pages/Delivery/delivery.css
apps/web/subapps/usedcar/src/pages/Handover/HandoverDetailModal.tsx → apps/web/subapps/usedcar/src/pages/Handover/HandoverDetailDrawer.tsx
apps/web/subapps/usedcar/src/pages/Handover/index.tsx
apps/web/subapps/usedcar/src/pages/Leads/LeadDetail.tsx
apps/web/subapps/usedcar/src/pages/Leads/leads.css
apps/web/subapps/usedcar/src/pages/Operation/ContractDetail.tsx
apps/web/subapps/usedcar/src/pages/Operation/ContractEdit.tsx
apps/web/subapps/usedcar/src/pages/Operation/components/SunshineDetailDrawer.tsx
apps/web/subapps/usedcar/src/pages/Operation/components/SunshineTab.tsx
apps/web/subapps/usedcar/src/pages/Operation/contractDetail.css
apps/web/subapps/usedcar/src/pages/Vehicles/VehicleDetail.tsx
apps/web/subapps/usedcar/src/pages/Vehicles/vehicles.css
apps/web/subapps/usedcar/src/styles/detail.css
apps/web/subapps/usedcar/package.json
View file @
e024080
{
{
"name"
:
"@uj/web-usedcar"
,
"name"
:
"@uj/web-usedcar"
,
"version"
:
"0.0.1
0
"
,
"version"
:
"0.0.1
1
"
,
"private"
:
true
,
"private"
:
true
,
"type"
:
"module"
,
"type"
:
"module"
,
"scripts"
:
{
"scripts"
:
{
...
...
apps/web/subapps/usedcar/src/main.tsx
View file @
e024080
...
@@ -5,6 +5,7 @@ import { App } from './App';
...
@@ -5,6 +5,7 @@ import { App } from './App';
import { installGlobalUnhandledRejectionHandler } from '@uj/ui';
import { installGlobalUnhandledRejectionHandler } from '@uj/ui';
import '@uj/design-tokens/tokens.css';
import '@uj/design-tokens/tokens.css';
import './index.css';
import './index.css';
import './styles/detail.css';
// 全应用未处理 promise rejection 兜底:async 调用漏 catch 时弹红色错误 toast。
// 全应用未处理 promise rejection 兜底:async 调用漏 catch 时弹红色错误 toast。
installGlobalUnhandledRejectionHandler();
installGlobalUnhandledRejectionHandler();
...
...
apps/web/subapps/usedcar/src/pages/Assessment/AssessmentDetail.tsx
View file @
e024080
import type { ReactNode } from 'react';
import { useQuery } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query';
import { UAlert, UButton, UCard, UEmpty, UResult } from '@uj/ui';
import { UAlert, UButton, UCard, U
Descriptions, U
Empty, UResult } from '@uj/ui';
import { downloadCenter } from '@uj/platform-sdk';
import { downloadCenter } from '@uj/platform-sdk';
import {
CombiForm, PageShell, type FieldSchema
} from '@/components';
import {
PageShell
} from '@/components';
import { useAccess } from '@/access';
import { useAccess } from '@/access';
import { assessmentApi, type AssessmentDetail as Detail } from '@/api';
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 { errorDetail } from '@/utils/error';
import { errorDetail } from '@/utils/error';
import { DYNAMIC_EVENT_CONFIG, PRICE_DETAIL_FIELDS, readOnlyValues, VEHICLE_ASSET_GROUPS, 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) =>
...
@@ -48,74 +55,140 @@ export default function AssessmentDetail({ params }: { params: PageParams }) {
...
@@ -48,74 +55,140 @@ export default function AssessmentDetail({ params }: { params: PageParams }) {
const checks = Array.isArray(data.priceHistoryListDTO)
const checks = Array.isArray(data.priceHistoryListDTO)
? data.priceHistoryListDTO.filter((item) => Number(item.opType) === 40)
? data.priceHistoryListDTO.filter((item) => Number(item.opType) === 40)
: [];
: [];
const model = [data.carBrand, data.carSeriesName, data.carTypeName].filter(Boolean).join(' ');
const events = history.data ?? [];
return (
return (
<PageShell title="评估单详情" description="查看车辆资料、总部估价、核价意见和评估动态。">
<PageShell title="评估单详情" description="查看车辆资料、总部估价、核价意见和评估动态。">
{detail.isError ? <UAlert type="error" showIcon title="评估单详情加载失败" description={errorDetail(detail.error)} /> : null}
{detail.isError ? (
<div className="uc-assess-detail">
<UAlert
<UCard>
type="error"
<h3>车辆信息</h3>
showIcon
<ReadOnlyForm items={readOnlyValues(VEHICLE_DETAIL_FIELDS, data)} />
title="评估单详情加载失败"
</UCard>
description={errorDetail(detail.error)}
<UCard>
/>
<h3>车辆资料</h3>
) : null}
<div className="uc-assess-files">
<UCard className="uc-detail-card" loading={detail.isPending}>
{VEHICLE_ASSET_GROUPS.map((group) => {
<div className="uc-detail-dossier">
const urls = files(data[group.key]);
<div className="uc-detail-dossier__identity">
return <span key={group.key}>
<div className="uc-detail-dossier__name">
{group.label}:
{model || '-'}
{Array.isArray(urls) && urls.length
{data.licensePlate ? (
? urls.map((url, index) => (
<span className="uc-detail-dossier__chip">{String(data.licensePlate)}</span>
<UButton
) : null}
key={String(url)}
</div>
type="link"
<div className="uc-detail-dossier__code">评估单编号:{display(data.evalOrderNo)}</div>
size="small"
onClick={() =>
downloadCenter.url({
source: 'usedcar',
sourceLabel: '二手车管理 / 评估管理 / 车辆资料',
label: `${String(group.label)} · 文件 ${index + 1}`,
url: String(url),
silent: true,
dedupeKey: `usedcar-assess-file-${String(url)}`,
})
}
>
文件 {index + 1}{' '}
</UButton>
))
: '-'}
</span>;
})}
</div>
</div>
</UCard>
<div className="uc-detail-dossier__meta">
<PriceCard title="总部定价师估价与意见" data={pricing} fallback={data} />
<MetaItem label="评估单状态">{display(data.status)}</MetaItem>
<PriceCard title="核价与意见" data={checks} />
<MetaItem label="门店">{display(data.sellerMerchantName)}</MetaItem>
<UCard>
<MetaItem label="下单时间">{display(data.evalOrderTime)}</MetaItem>
<h3>评估动态</h3>
</div>
{history.isError ? (
</div>
<UAlert type="error" showIcon title="评估动态加载失败" description={errorDetail(history.error)} />
</UCard>
) : history.data?.length ? (
<div className="uc-detail-split">
<div className="uc-assess-history">
<div className="uc-detail-split__main">
{history.data.map((item, index) => {
<UCard className="uc-detail-card" loading={detail.isPending}>
const config = DYNAMIC_EVENT_CONFIG[String(item.opType)];
<CardHead title="车辆信息" />
return <div
<div className="uc-detail-card__body">
className="uc-assess-history__item"
<ReadOnlyForm items={readOnlyValues(VEHICLE_DETAIL_FIELDS, data)} />
key={`${String(item.quoteTime ?? '')}-${index}`}
</div>
>
</UCard>
<div className="uc-assess-history__head">
<PriceCard
<b>
title="总部定价师估价与意见"
{config?.title ?? '评估动态'}:{display(item.createdBy)}
data={pricing}
</b>
fallback={data}
<span>{display(item.quoteTime)}</span>
loading={detail.isPending}
</div>
/>
{config?.fields.map((field) => <p key={field.key}>{field.label}:{display(item[field.key])}{field.suffix ? ` ${field.suffix}` : ''}</p>)}
<PriceCard title="核价与意见" data={checks} loading={detail.isPending} />
</div>;
</div>
})}
<div className="uc-detail-split__rail">
<UCard className="uc-detail-card" loading={detail.isPending}>
<CardHead title="车辆资料" />
<div className="uc-detail-card__body">
<div className="uc-detail-files">
{VEHICLE_ASSET_GROUPS.map((group) => {
const urls = files(data[group.key]);
return (
<div className="uc-detail-files__row" key={group.key}>
<span className="uc-detail-files__label">{group.label}</span>
<span className="uc-detail-files__value">
{urls.length
? urls.map((url, index) => (
<UButton
key={String(url)}
type="link"
size="small"
onClick={() =>
downloadCenter.url({
source: 'usedcar',
sourceLabel: '二手车管理 / 评估管理 / 车辆资料',
label: `${String(group.label)} · 文件 ${index + 1}`,
url: String(url),
silent: true,
dedupeKey: `usedcar-assess-file-${String(url)}`,
})
}
>
文件 {index + 1}
</UButton>
))
: '-'}
</span>
</div>
);
})}
</div>
</div>
</div>
) : (
</UCard>
<UEmpty description="暂无评估动态" />
<UCard className="uc-detail-card" loading={history.isPending}>
)}
<CardHead title="评估动态" aux={events.length ? `共 ${events.length} 条` : undefined} />
</UCard>
<div className="uc-detail-card__body">
{history.isError ? (
<UAlert
type="error"
showIcon
title="评估动态加载失败"
description={errorDetail(history.error)}
/>
) : events.length ? (
<div className="uc-detail-timeline">
{events.map((item, index) => {
const config = DYNAMIC_EVENT_CONFIG[String(item.opType)];
return (
<div
className="uc-detail-timeline__item"
key={`${String(item.quoteTime ?? '')}-${index}`}
>
<span className="uc-detail-timeline__marker" />
<div>
<div className="uc-detail-timeline__head">
<span className="uc-detail-timeline__title">
{config?.title ?? '评估动态'}:{display(item.createdBy)}
</span>
<span className="uc-detail-timeline__time">
{display(item.quoteTime)}
</span>
</div>
<div className="uc-detail-timeline__body">
{config?.fields.map((field) => (
<div key={field.key}>
<span className="uc-detail-timeline__label">{field.label}:</span>
{display(item[field.key])}
{field.suffix ? ` ${field.suffix}` : ''}
</div>
))}
</div>
</div>
</div>
);
})}
</div>
) : (
<UEmpty description="暂无评估动态" />
)}
</div>
</UCard>
</div>
</div>
</div>
</PageShell>
</PageShell>
);
);
...
@@ -124,31 +197,59 @@ function PriceCard({
...
@@ -124,31 +197,59 @@ function PriceCard({
title,
title,
data,
data,
fallback,
fallback,
loading,
}: {
}: {
title: string;
title: string;
data: Array<Record<string, unknown>>;
data: Array<Record<string, unknown>>;
fallback?: Detail;
fallback?: Detail;
loading?: boolean;
}) {
}) {
const items = data.length ? data : fallback ? [fallback] : [];
const items = data.length ? data : fallback ? [fallback] : [];
return (
return (
<UCard>
<UCard className="uc-detail-card" loading={loading}>
<h3>{title}</h3>
<CardHead title={title} aux={items.length > 1 ? `共 ${items.length} 轮` : undefined} />
{items.length ? (
<div className="uc-detail-card__body">
items.map((item, index) => (
{items.length ? (
<ReadOnlyForm key={index} items={readOnlyValues(PRICE_DETAIL_FIELDS, item)} />
items.map((item, index) => (
))
<div className="uc-detail-block" key={index}>
) : (
<ReadOnlyForm items={readOnlyValues(PRICE_DETAIL_FIELDS, item)} />
<UEmpty description="暂无信息" />
</div>
)}
))
) : (
<UEmpty description="暂无信息" />
)}
</div>
</UCard>
</UCard>
);
);
}
}
function ReadOnlyForm({ items }: { items: Array<[string, string, boolean?]> }) {
function ReadOnlyForm({ items }: { items: Array<[string, string, boolean?]> }) {
const values = Object.fromEntries(items.map(([label, value]) => [label, value]));
return (
const fields: FieldSchema<Record<string, string>>[] = items.map(([label]) => ({
<UDescriptions
name: label,
className="uc-detail-descriptions"
label,
column={{ xs: 1, sm: 2 }}
type: 'input',
styles={{ label: { width: 112, whiteSpace: 'nowrap' } }}
}));
items={items.map(([label, value, wide]) => ({
return <CombiForm mode="detail" fields={fields} initialValues={values} />;
key: label,
label,
children: value,
span: wide ? 2 : 1,
}))}
/>
);
}
function CardHead({ title, aux }: { title: string; aux?: string }) {
return (
<div className="uc-detail-card__head">
<h2 className="uc-detail-card__title">{title}</h2>
{aux ? <span className="uc-detail-card__aux">{aux}</span> : null}
</div>
);
}
function MetaItem({ label, children }: { label: string; children: ReactNode }) {
return (
<div className="uc-detail-dossier__item">
<span className="uc-detail-dossier__label">{label}</span>
<span className="uc-detail-dossier__value">{children}</span>
</div>
);
}
}
apps/web/subapps/usedcar/src/pages/Assessment/EvaluatePage.tsx
View file @
e024080
...
@@ -5,10 +5,10 @@ import {
...
@@ -5,10 +5,10 @@ import {
UButton,
UButton,
UCard,
UCard,
UDescriptions,
UDescriptions,
UEmpty,
UForm,
UForm,
UModal,
UModal,
UResult,
UResult,
UText,
useUMessage,
useUMessage,
} from '@uj/ui';
} from '@uj/ui';
import { CombiForm, PageShell, type FieldSchema } from '@/components';
import { CombiForm, PageShell, type FieldSchema } from '@/components';
...
@@ -18,7 +18,7 @@ import { UC } from '@/permissions/codes';
...
@@ -18,7 +18,7 @@ import { UC } from '@/permissions/codes';
import type { PageParams } from '@/routes';
import type { PageParams } from '@/routes';
import { errorDetail } from '@/utils/error';
import { errorDetail } from '@/utils/error';
import { goTo } from '../Leads/navigate';
import { goTo } from '../Leads/navigate';
import { readOnlyValues, VEHICLE_DETAIL_FIELDS } from './detailConfig';
import {
DYNAMIC_EVENT_CONFIG,
readOnlyValues, VEHICLE_DETAIL_FIELDS } from './detailConfig';
import './assessment.css';
import './assessment.css';
/**
/**
...
@@ -35,6 +35,16 @@ type RejectValues = { rejectReason: string; rejectSuggestion: string };
...
@@ -35,6 +35,16 @@ type RejectValues = { rejectReason: string; rejectSuggestion: string };
const display = (value: unknown) =>
const display = (value: unknown) =>
value === undefined || value === null || value === '' ? '-' : String(value);
value === undefined || value === null || value === '' ? '-' : String(value);
/** 动态字段文案:与详情页 DYNAMIC_EVENT_CONFIG 同一套语义,这里按实际下发字段取值。 */
const EVENT_FIELD_LABEL: Record<string, string> = {
evalPrice: '评估价',
evalOpinion: '评估意见',
checkPrice: '核价',
checkOpinion: '核价意见',
rejectReason: '驳回原因',
rejectSuggestion: '驳回意见',
};
const integerRule = (label: string) => [
const integerRule = (label: string) => [
{ required: true, message: `请输入${label}` },
{ required: true, message: `请输入${label}` },
{
{
...
@@ -174,62 +184,91 @@ export default function EvaluatePage({ params }: { params: PageParams }) {
...
@@ -174,62 +184,91 @@ export default function EvaluatePage({ params }: { params: PageParams }) {
<PageShell
<PageShell
title={isCheck ? '评估核价' : '车辆评估'}
title={isCheck ? '评估核价' : '车辆评估'}
description={isCheck ? '录入核价与核价意见,或驳回该评估单。' : '录入评估价与评估意见,或驳回该评估单。'}
description={isCheck ? '录入核价与核价意见,或驳回该评估单。' : '录入评估价与评估意见,或驳回该评估单。'}
actions={<UButton onClick={() => goTo('assessment')}>返回列表</UButton>}
>
>
{detail.isError ? (
{detail.isError ? (
<UAlert type="error" showIcon title="评估单加载失败" description={errorDetail(detail.error)} />
<UAlert type="error" showIcon title="评估单加载失败" description={errorDetail(detail.error)} />
) : null}
) : null}
<div className="uc-assess-detail">
<div className="uc-detail-stack">
<UCard>
<UCard className="uc-detail-card" loading={detail.isPending}>
<h3>车辆信息</h3>
<CardHead title="车辆信息" />
<UDescriptions
<div className="uc-detail-card__body">
column={2}
<UDescriptions
size="small"
className="uc-detail-descriptions"
items={readOnlyValues(VEHICLE_DETAIL_FIELDS, data as AssessmentDetail).map(
column={{ xs: 1, sm: 2 }}
([label, value]) => ({ key: label, label, children: display(value) }),
styles={{ label: { width: 112, whiteSpace: 'nowrap' } }}
)}
items={readOnlyValues(VEHICLE_DETAIL_FIELDS, data as AssessmentDetail).map(
/>
([label, value, wide]) => ({
key: label,
label,
children: display(value),
span: wide ? 2 : 1,
}),
)}
/>
</div>
</UCard>
</UCard>
<UCard>
<UCard className="uc-detail-card">
<h3>{isCheck ? '核价与意见' : '总部定价师估价与意见'}</h3>
<CardHead title={isCheck ? '核价与意见' : '总部定价师估价与意见'} />
<CombiForm mode="form" form={form} fields={fields} layout="vertical" onSubmit={onSave} />
<div className="uc-detail-card__body">
<CombiForm mode="form" form={form} fields={fields} layout="vertical" onSubmit={onSave} />
</div>
</UCard>
</UCard>
<UCard>
<UCard
className="uc-detail-card" loading={history.isPending}
>
<
h3>评估动态</h3>
<
CardHead
{history.data?.length ? (
title="评估动态"
<div className="uc-assess-dynamics">
aux={history.data?.length ? `共 ${history.data.length} 条` : undefined}
{history.data.map((item, index) => (
/>
<div key={index} className="uc-assess-dynamic
">
<div className="uc-detail-card__body
">
<UText type="secondary">
{history.data?.length ? (
{display(item.opType)} · {display(item.createdDate)} · {display(item.createdBy)}
<div className="uc-detail-timeline">
</UText>
{history.data.map((item, index) => (
<div>
<div
key={index} className="uc-detail-timeline__item"
>
{Object.entries(item)
<span className="uc-detail-timeline__marker" />
.filter(([key, value]) =
>
<div
>
['evalPrice', 'evalOpinion', 'checkPrice', 'checkOpinion', 'rejectReason', 'rejectSuggestion'].includes(key) &&
<div className="uc-detail-timeline__head">
value !== undefined &&
<span className="uc-detail-timeline__title">
value !== '',
{DYNAMIC_EVENT_CONFIG[String(item.opType)]?.title ?? '评估动态'}:
)
{display(item.createdBy)}
.map(([key, value]) => (
</span>
<span
key={key} style={{ marginRight: 16 }}
>
<span
className="uc-detail-timeline__time"
>
{
key}:{String(valu
e)}
{
display(item.createdDat
e)}
</span>
</span>
))}
</div>
<div className="uc-detail-timeline__body">
{Object.entries(item)
.filter(
([key, value]) =>
key in EVENT_FIELD_LABEL && value !== undefined && value !== '',
)
.map(([key, value]) => (
<div key={key}>
<span className="uc-detail-timeline__label">
{EVENT_FIELD_LABEL[key]}:
</span>
{String(value)}
</div>
))}
</div>
</div>
</div>
</div>
</div>
))}
))}
</div>
</div>
) : (
) : (
<UEmpty description="暂无评估动态" />
<UText type="secondary">暂无评估动态</UText>
)}
)}
</div>
</UCard>
</UCard>
</div>
</div>
<div
style={{ display: 'flex', gap: 8, justifyContent: 'flex-end', padding: '12px 0' }}
>
<div
className="uc-assess-actions"
>
<UButton type="primary" loading={submit.isPending} onClick={() => form.submit()}>
<UButton type="primary" loading={submit.isPending} onClick={() => form.submit()}>
保存
保存
</UButton>
</UButton>
<UButton onClick={() => setRejectOpen(true)}>驳回</UButton>
<UButton type="default" onClick={() => setRejectOpen(true)}>
<UButton onClick={() => goTo('assessment')}>关闭</UButton>
驳回
</UButton>
<UButton type="default" onClick={() => goTo('assessment')}>
关闭
</UButton>
</div>
</div>
<UModal
<UModal
open={rejectOpen}
open={rejectOpen}
...
@@ -249,3 +288,11 @@ export default function EvaluatePage({ params }: { params: PageParams }) {
...
@@ -249,3 +288,11 @@ export default function EvaluatePage({ params }: { params: PageParams }) {
</PageShell>
</PageShell>
);
);
}
}
function CardHead({ title, aux }: { title: string; aux?: string }) {
return (
<div className="uc-detail-card__head">
<h2 className="uc-detail-card__title">{title}</h2>
{aux ? <span className="uc-detail-card__aux">{aux}</span> : null}
</div>
);
}
apps/web/subapps/usedcar/src/pages/Assessment/assessment.css
View file @
e024080
...
@@ -7,54 +7,9 @@
...
@@ -7,54 +7,9 @@
border-radius
:
4px
;
border-radius
:
4px
;
background
:
var
(
--uj-surface-3
);
background
:
var
(
--uj-surface-3
);
}
}
.uc-assess-detail
{
.uc-assess-actions
{
display
:
grid
;
gap
:
16px
;
}
.uc-assess-detail
h3
{
margin
:
0
0
14px
;
font-size
:
15px
;
}
.uc-assess-history
{
display
:
grid
;
gap
:
12px
;
}
.uc-assess-history__item
{
border-left
:
2px
solid
var
(
--uj-primary
);
padding-left
:
14px
;
}
.uc-assess-history__head
{
display
:
flex
;
justify-content
:
space-between
;
margin-bottom
:
6px
;
}
.uc-assess-files
{
display
:
flex
;
display
:
flex
;
flex-wrap
:
wrap
;
justify-content
:
flex-end
;
gap
:
8px
;
gap
:
8px
;
}
padding
:
12px
0
;
.uc-assess-files
a
{
color
:
var
(
--uj-primary
);
}
.uc-assess-readonly-form__grid
{
display
:
grid
;
grid-template-columns
:
repeat
(
2
,
minmax
(
0
,
1
fr
));
column-gap
:
24px
;
}
.uc-assess-readonly-form
.ant-form-item
{
margin-bottom
:
12px
;
}
.uc-assess-readonly-form
.ant-form-item-label
{
min-width
:
132px
;
}
.uc-assess-readonly-form__wide
{
grid-column
:
span
2
;
}
@media
(
max-width
:
760px
)
{
.uc-assess-readonly-form__grid
{
grid-template-columns
:
1
fr
;
}
.uc-assess-readonly-form__wide
{
grid-column
:
auto
;
}
}
}
apps/web/subapps/usedcar/src/pages/Condition/ConditionDetail.tsx
View file @
e024080
import { useEffect, useMemo, useState } from 'react';
import { useEffect, useMemo, useState
, type ReactNode
} from 'react';
import dayjs from 'dayjs';
import dayjs from 'dayjs';
import { useQuery } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query';
import {
import {
CaretRightOutlined,
CheckCircleFilled,
DownOutlined,
ExclamationCircleFilled,
PictureOutlined,
SearchOutlined,
} from '@ant-design/icons';
import {
UAlert,
UAlert,
UButton,
UButton,
UCard,
UCheckbox,
UCheckbox,
UDatePicker,
UDatePicker,
UEmpty,
UForm,
UForm,
UImage,
UImage,
UInput,
UInput,
...
@@ -15,14 +25,23 @@ import {
...
@@ -15,14 +25,23 @@ import {
useUMessage,
useUMessage,
} from '@uj/ui';
} from '@uj/ui';
import { CombiForm } from '@/components';
import { CombiForm } from '@/components';
import { PageShell } from '@/components';
import { PageShell
, type FieldOption
} from '@/components';
import { carConditionApi, commonApi } from '@/api';
import { carConditionApi, commonApi } from '@/api';
import { useAccess } from '@/access';
import { useAccess } from '@/access';
import { UC } from '@/permissions/codes';
import { UC } from '@/permissions/codes';
import { errorDetail } from '@/utils/error';
import { errorDetail } from '@/utils/error';
import type { PageParams } from '@/routes';
import type { PageParams } from '@/routes';
import { goTo } from '../Leads/navigate';
import {
import { BASE_FIELDS, colorLabel, PRICE_FIELDS, type ConditionValues } from './conditionConfig';
AI_REPORT_STATUS,
BASE_FIELDS,
CONDITION_STATUS,
colorLabel,
labelOf,
PRICE_FIELDS,
statusTone,
type ConditionValues,
} from './conditionConfig';
import './condition.css';
type Row = Record<string, unknown> & {
type Row = Record<string, unknown> & {
id: string | number;
id: string | number;
...
@@ -184,6 +203,11 @@ function districtOptions(value: unknown) {
...
@@ -184,6 +203,11 @@ function districtOptions(value: unknown) {
value: String(item.code ?? ''),
value: String(item.code ?? ''),
}));
}));
}
}
/** 单选 onChange 的 option 在 antd 类型里是「单项 | 数组」,这里只取单项的字符串 label。 */
function optionLabel(option: unknown): string | undefined {
const single = (Array.isArray(option) ? option[0] : option) as { label?: unknown } | undefined;
return typeof single?.label === 'string' ? single.label : undefined;
}
export default function ConditionDetail({ params }: { params: PageParams }) {
export default function ConditionDetail({ params }: { params: PageParams }) {
const { canPoint } = useAccess();
const { canPoint } = useAccess();
...
@@ -252,6 +276,8 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
...
@@ -252,6 +276,8 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
enabled: Boolean(seriesId),
enabled: Boolean(seriesId),
});
});
const photos = useMemo(() => (data ? sourcePhotos(data) : []), [data]);
const photos = useMemo(() => (data ? sourcePhotos(data) : []), [data]);
const photoFilled = photos.filter((photo) => photo.url).length;
const requiredReady = photos.length >= 8 && photos.slice(0, 8).every((photo) => photo.url);
useEffect(() => {
useEffect(() => {
if (!detail.data) return;
if (!detail.data) return;
const normalized = unwrap(detail.data) as Detail;
const normalized = unwrap(detail.data) as Detail;
...
@@ -469,7 +495,7 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
...
@@ -469,7 +495,7 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
if (field.name === 'vin') return <UInput onBlur={() => void checkVin()} />;
if (field.name === 'vin') return <UInput onBlur={() => void checkVin()} />;
if (field.name === 'brandModel')
if (field.name === 'brandModel')
return (
return (
<div className="uc-condition-
detail__
compound">
<div className="uc-condition-compound">
<USelect
<USelect
value={brandId as string}
value={brandId as string}
options={brandRows.map((item) => ({ value: String(item.id), label: text(item.name) }))}
options={brandRows.map((item) => ({ value: String(item.id), label: text(item.name) }))}
...
@@ -555,14 +581,14 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
...
@@ -555,14 +581,14 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
: undefined;
: undefined;
if (region)
if (region)
return (
return (
<div className="uc-condition-
detail__
compound">
<div className="uc-condition-compound">
<USelect
<USelect
value={form.getFieldValue(region.provinceName) as string}
value={form.getFieldValue(region.provinceName) as string}
options={districtOptions(provinces.data)}
options={districtOptions(provinces.data)}
placeholder="请选择省"
placeholder="请选择省"
onChange={(value, option) =>
onChange={(value, option) =>
form.setFieldsValue({
form.setFieldsValue({
[region.provinceName]: option
?.label
,
[region.provinceName]: option
Label(option)
,
[region.provinceId]: value,
[region.provinceId]: value,
[region.cityName]: undefined,
[region.cityName]: undefined,
[region.cityId]: undefined,
[region.cityId]: undefined,
...
@@ -574,7 +600,10 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
...
@@ -574,7 +600,10 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
options={districtOptions(region.cities)}
options={districtOptions(region.cities)}
placeholder="请选择市"
placeholder="请选择市"
onChange={(value, option) =>
onChange={(value, option) =>
form.setFieldsValue({ [region.cityName]: option?.label, [region.cityId]: value })
form.setFieldsValue({
[region.cityName]: optionLabel(option),
[region.cityId]: value,
})
}
}
/>
/>
</div>
</div>
...
@@ -589,7 +618,7 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
...
@@ -589,7 +618,7 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
label: text(item.staffName ?? item.userName ?? item.name),
label: text(item.staffName ?? item.userName ?? item.name),
}))}
}))}
onChange={(value, option) =>
onChange={(value, option) =>
form.setFieldsValue({ sellerUserId: value, sellerName: option
?.label
})
form.setFieldsValue({ sellerUserId: value, sellerName: option
Label(option)
})
}
}
/>
/>
);
);
...
@@ -608,7 +637,7 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
...
@@ -608,7 +637,7 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
);
);
form.setFieldsValue({
form.setFieldsValue({
conversionUserId: value,
conversionUserId: value,
conversionName: option
?.label
,
conversionName: option
Label(option)
,
conversionMerchantId: staff?.yqMerchantId,
conversionMerchantId: staff?.yqMerchantId,
conversionMerchantName: staff?.yqMerchantName,
conversionMerchantName: staff?.yqMerchantName,
});
});
...
@@ -625,174 +654,235 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
...
@@ -625,174 +654,235 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
if (!record)
if (!record)
return <UResult status="404" title="未找到车况信息" subTitle="详情地址缺少车况单编号。" />;
return <UResult status="404" title="未找到车况信息" subTitle="详情地址缺少车况单编号。" />;
return (
return (
<PageShell>
<PageShell
<div className="uc-condition-detail">
title="车况信息详情"
<header className="uc-condition-detail__header">
description="核对一线回传的车况描述与照片,完善评估单基础信息,生成评估单或 AI 收车报告。"
<div>
actions={
<div className="uc-condition-detail__header-left">
<UButton
<h1 className="uc-condition-detail__title">车况信息详情</h1>
type="primary"
disabled={Number(data?.status) === 1}
loading={creatingAssessment}
onClick={() => void createAssessment()}
>
一键生成评估单
</UButton>
}
>
{detail.isError ? (
<UAlert
type="error"
showIcon
title="车况详情加载失败"
description={errorDetail(detail.error)}
/>
) : null}
<UCard className="uc-detail-card" loading={detail.isPending}>
<div className="uc-detail-dossier">
<div className="uc-detail-dossier__identity">
<div className="uc-detail-dossier__name">
{text(data?.brandModel)}
{data?.licensePlate ? (
<span className="uc-detail-dossier__chip">{String(data.licensePlate)}</span>
) : null}
</div>
<div className="uc-detail-dossier__code">编号:{text(data?.carConditionCode)}</div>
</div>
<div className="uc-detail-dossier__meta">
<MetaItem label="来源">
<span className="uc-condition-source">
<span className="uc-condition-source">
来源:
{SOURCE_LABEL[String(data?.source ?? '')] ?? text(data?.sourceName ?? data?.source)}
{SOURCE_LABEL[String(data?.source ?? '')] ?? text(data?.sourceName ?? data?.source)}
</span>
</span>
</div>
</MetaItem>
{data?.carConditionCode && (
<MetaItem label="车况单状态">
<div className="uc-condition-detail__meta">
{statusValue(data?.status, CONDITION_STATUS, '1')}
编号:{text(data?.carConditionCode)}
</MetaItem>
</div>
<MetaItem label="收车报告状态">
)}
{statusValue(data?.aiReportStatus, AI_REPORT_STATUS, '2', '3')}
</div>
</MetaItem>
<div>
<MetaItem label="提交时间">{text(data?.entryTime)}</MetaItem>
<UButton type="default" onClick={() => goTo('condition')}>
返回列表
</UButton>
<UButton
type="primary"
disabled={Number(data?.status) === 1}
loading={creatingAssessment}
onClick={() => void createAssessment()}
>
一键生成评估单
</UButton>
</div>
</div>
</header>
</div>
{detail.isError ? (
</UCard>
<UAlert
<div className="uc-condition-detail">
type="error"
<aside className="uc-condition-detail__rail">
showIcon
<UCard className="uc-detail-card" loading={detail.isPending}>
title="车况详情加载失败"
<CardHead title="一线回传车况描述" />
description={errorDetail(detail.error)}
<div className="uc-detail-card__body">
/>
{data?.conditionDescription ? (
) : null}
<div className="uc-condition-desc">{String(data.conditionDescription)}</div>
<div className="uc-condition-detail__body">
) : (
<aside className="uc-condition-detail__left">
<UEmpty description="暂无车况描述" />
<section className="uc-condition-detail__block">
)}
<h2 className="uc-condition-detail__block-title">一线回传车况描述</h2>
</div>
<div className="uc-condition-detail__description">
</UCard>
{text(data?.conditionDescription)}
<UCard className="uc-detail-card" loading={detail.isPending}>
</div>
<CardHead
</section>
title="一线回传照片"
<section className="uc-condition-detail__block">
aux={photos.length ? `已回传 ${photoFilled}/${photos.length}` : undefined}
<h2 className="uc-condition-detail__block-title">一线回传照片</h2>
/>
<div className="uc-condition-detail__photos">
<div className="uc-detail-card__body">
{photos.length
<div className="uc-condition-photos">
? photos.map((photo) => (
{photos.map((photo) => (
<figure className="uc-condition-detail__photo" key={photo.url}>
<figure className="uc-condition-photo" key={photo.subtype}>
{photo.video ? (
<div className="uc-condition-photo__media">
<button
{photo.video ? (
type="button"
<button
className="uc-condition-detail__video-button"
type="button"
onClick={() => setVideoUrl(photo.url)}
className="uc-condition-photo__video"
>
onClick={() => setVideoUrl(photo.url)}
<video className="uc-condition-detail__video" muted src={photo.url} />
>
<span>播放视频</span>
<video muted preload="metadata" src={photo.url} />
</button>
<span className="uc-condition-photo__play">
) : (
<CaretRightOutlined />
<UImage
</span>
src={photo.url}
</button>
width="100%"
) : photo.url ? (
height={110}
<UImage
styles={{
src={photo.url}
image: { width: '100%', height: '110px', objectFit: 'cover' },
width="100%"
}}
styles={{
/>
image: { width: '100%', height: '100%', objectFit: 'cover' },
)}
}}
<figcaption>{photo.caption}</figcaption>
/>
</figure>
) : (
))
<div className="uc-condition-photo__empty">
: '暂无照片'}
<PictureOutlined />
<span>未回传</span>
</div>
)}
</div>
<figcaption>
{photo.caption}
{photo.subtype === 41 ? (
<span className="uc-condition-photo__optional">选传</span>
) : null}
</figcaption>
</figure>
))}
</div>
</div>
</section>
{photos.length ? (
</aside>
requiredReady ? (
<main className="uc-condition-detail__right">
<div className="uc-condition-photos__note uc-condition-photos__note--ok">
<section>
<CheckCircleFilled />
<div className="uc-condition-detail__section-head">
必传照片已齐,可生成评估单。
<div>
</div>
<h2 className="uc-condition-detail__section-title uc-inline">完善评估单基础信息</h2>
) : (
<UButton className="uc-inline" type="link" loading={updatingBase} onClick={() => void updateBase()}>
<div className="uc-condition-photos__note uc-condition-photos__note--warn">
<ExclamationCircleFilled />
生成评估单需补齐前 8 张必传照片。
</div>
)
) : null}
</div>
</UCard>
</aside>
<main className="uc-condition-detail__workspace">
<UCard className="uc-detail-card" loading={detail.isPending}>
<CardHead
title="完善评估单基础信息"
actions={
<>
<UButton
size="small"
type="default"
loading={updatingBase}
onClick={() => void updateBase()}
>
更新
更新
</UButton>
</UButton>
</div>
<UButton
<span>
size="small"
<UButton type="link" onClick={() => setBaseOpen((open) => !open)}>
type="text"
onClick={() => setBaseOpen((open) => !open)}
icon={
<DownOutlined
className={
baseOpen
? 'uc-condition-chevron'
: 'uc-condition-chevron uc-condition-chevron--closed'
}
/>
}
>
{baseOpen ? '收起' : '展开'}
{baseOpen ? '收起' : '展开'}
</UButton>
</UButton>
</span>
</>
</div>
}
{baseOpen ? (
/>
<>
{baseOpen ? (
<div className="uc-condition-detail__model-reference">
<div className="uc-detail-card__body">
车型参考:{text(data?.brandModel)}
<div className="uc-condition-reference">
</div>
<span className="uc-condition-reference__label">车型参考</span>
<span className="uc-condition-reference__value">{text(data?.brandModel)}</span>
</div>
<div className="uc-condition-form">
<CombiForm
<CombiForm
mode="form"
mode="form"
form={form}
form={form}
fields={BASE_FIELDS}
fields={BASE_FIELDS}
layout="horizontal"
layout="horizontal"
labelWidth={150}
labelWidth={180}
sectionContentStyle={{
display: 'grid',
gridTemplateColumns: 'repeat(2, minmax(0, 1fr))',
columnGap: 24,
}}
renderControl={renderBaseControl}
renderControl={renderBaseControl}
/>
/>
</>
</div>
) : null}
</div>
</section>
) : null}
<section>
</UCard>
<h2 className="uc-condition-detail__section-title">
<UCard className="uc-detail-card" loading={detail.isPending}>
补充核心压价策略(终极融合引擎)
<CardHead title="补充核心压价策略(终极融合引擎)" />
</h2>
<div className="uc-detail-card__body">
<CombiForm
<div className="uc-condition-form">
mode="form"
<CombiForm
form={form}
mode="form"
fields={PRICE_FIELDS}
form={form}
layout="horizontal"
fields={PRICE_FIELDS}
labelWidth={150}
layout="horizontal"
sectionContentStyle={{
labelWidth={180}
display: 'grid',
/>
gridTemplateColumns: 'repeat(2, minmax(0, 1fr))',
</div>
columnGap: 24,
<div className="uc-condition-third">
}}
<div className="uc-condition-third__head">
/>
<UCheckbox
<div className="uc-condition-detail__third">
checked={thirdReport}
<UCheckbox
onChange={(event) => {
checked={thirdReport}
if (thirdReportPresent !== true) {
onChange={(event) => {
message.warning('未查询到事故报告,请先查询事故报告。');
if (thirdReportPresent !== true) {
setThirdReport(false);
message.warning('未查询到事故报告,请先查询事故报告。');
return;
setThirdReport(false);
}
return;
setThirdReport(event.target.checked);
}
}}
setThirdReport(event.target.checked);
>
}}
附加条件:融合高阶第三方出险报告
>
</UCheckbox>
附加条件:融合高阶第三方出险报告
<UButton
</UCheckbox>
size="small"
<UButton
type="default"
type="link"
icon={<SearchOutlined />}
loading={checkingThirdReport}
loading={checkingThirdReport}
onClick={() => void checkThirdPartyReport()}
onClick={() => void checkThirdPartyReport()}
>
>
查询事故报告
查询事故报告
</UButton>
</UButton>
<div>
</div>
<div className="uc-condition-third__desc">
勾选后,系统会校验车架号历史报告,并将严重碰撞和维保记录合并到 AI 收车报告中。
勾选后,系统会校验车架号历史报告,并将严重碰撞和维保记录合并到 AI 收车报告中。
</div>
</div>
{thirdReportPresent === false ? (
{thirdReportPresent === false ? (
<div className="uc-condition-detail__third-warning">
<div className="uc-condition-third__status uc-condition-third__status--warn">
<ExclamationCircleFilled />
未查询到事故报告,请先使用“查询事故报告”。
未查询到事故报告,请先使用“查询事故报告”。
</div>
</div>
) : null}
) : null}
{thirdReportPresent === true && thirdReport ? (
{thirdReportPresent === true && thirdReport ? (
<div className="uc-condition-detail__third-success">
<div className="uc-condition-third__status uc-condition-third__status--ok">
<CheckCircleFilled />
校验通过:已匹配到历史理赔记录,将随表单合并生成。
校验通过:已匹配到历史理赔记录,将随表单合并生成。
</div>
</div>
) : null}
) : null}
</div>
</div>
</
section
>
</
div
>
<
footer className="uc-condition-detail__footer
">
<
div className="uc-detail-card__foot
">
<UButton
<UButton
type="primary"
type="primary"
loading={creatingReport}
loading={creatingReport}
...
@@ -800,9 +890,9 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
...
@@ -800,9 +890,9 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
>
>
生成AI收车报告
生成AI收车报告
</UButton>
</UButton>
</
footer
>
</
div
>
</
main
>
</
UCard
>
</
div
>
</
main
>
</div>
</div>
<UModal
<UModal
open={Boolean(videoUrl)}
open={Boolean(videoUrl)}
...
@@ -811,9 +901,37 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
...
@@ -811,9 +901,37 @@ export default function ConditionDetail({ params }: { params: PageParams }) {
onCancel={() => setVideoUrl('')}
onCancel={() => setVideoUrl('')}
>
>
{videoUrl ? (
{videoUrl ? (
<video className="uc-condition-
detail__
video-preview" controls autoPlay src={videoUrl} />
<video className="uc-condition-video-preview" controls autoPlay src={videoUrl} />
) : null}
) : null}
</UModal>
</UModal>
</PageShell>
</PageShell>
);
);
}
}
function statusValue(value: unknown, options: FieldOption[], success: string, failed?: string) {
if (value === undefined || value === null || value === '') return '-';
return (
<span className={`uc-detail-status uc-detail-status--${statusTone(value, success, failed)}`}>
{labelOf(options, value)}
</span>
);
}
function CardHead({ title, aux, actions }: { title: string; aux?: string; actions?: ReactNode }) {
return (
<div className="uc-detail-card__head">
<h2 className="uc-detail-card__title">{title}</h2>
{aux ? <span className="uc-detail-card__aux">{aux}</span> : null}
{actions ? <div className="uc-detail-card__actions">{actions}</div> : null}
</div>
);
}
function MetaItem({ label, children }: { label: string; children: ReactNode }) {
return (
<div className="uc-detail-dossier__item">
<span className="uc-detail-dossier__label">{label}</span>
<span className="uc-detail-dossier__value">{children}</span>
</div>
);
}
apps/web/subapps/usedcar/src/pages/Condition/condition.css
View file @
e024080
.uc-condition-status
{
/* 车况页私有样式。卡片解剖/档案条/状态点等通用部分在 src/styles/detail.css。 */
display
:
inline-flex
;
align-items
:
center
;
gap
:
8px
;
color
:
var
(
--uj-text-2
);
}
.uc-inline
{
display
:
inline-block
;
}
.uc-condition-status
::before
{
content
:
''
;
width
:
6px
;
height
:
6px
;
border-radius
:
50%
;
background
:
var
(
--uj-text-4
);
}
.uc-condition-status--success
::before
{
background
:
var
(
--uj-primary
);
}
.uc-condition-status--pending
::before
{
background
:
var
(
--uj-text-4
);
}
.uc-condition-status--progress
::before
{
background
:
var
(
--uj-warning
);
}
.uc-condition-status--failed
::before
{
background
:
var
(
--uj-error
);
}
.uc-condition-drawer
.ant-drawer-body
{
padding
:
0
;
background
:
var
(
--uj-bg
);
}
.uc-condition-detail
{
.uc-condition-detail
{
min-height
:
100%
;
}
.uc-condition-detail__header
{
display
:
flex
;
justify-content
:
space-between
;
gap
:
16px
;
padding
:
16px
20px
;
background
:
var
(
--uj-surface
);
border-bottom
:
1px
solid
var
(
--uj-border
);
}
.uc-condition-detail__header-left
{
display
:
flex
;
align-items
:
center
;
flex-wrap
:
wrap
;
gap
:
10px
12px
;
}
.uc-condition-detail__title
{
margin
:
0
;
color
:
var
(
--uj-text-1
);
font-size
:
20px
;
}
.uc-condition-source
{
display
:
inline-flex
;
align-items
:
center
;
height
:
24px
;
padding
:
0
10px
;
font-size
:
12px
;
font-weight
:
normal
;
color
:
#5584f2
;
background
:
#ecf5ff
;
border
:
1px
solid
#d9ecff
;
border-radius
:
4px
;
line-height
:
1
;
white-space
:
nowrap
;
}
.uc-condition-detail__meta
{
margin-top
:
8px
;
color
:
var
(
--uj-text-3
);
}
.uc-condition-detail__body
{
display
:
grid
;
display
:
grid
;
grid-template-columns
:
minmax
(
280px
,
32%
)
minmax
(
0
,
1
fr
);
grid-template-columns
:
minmax
(
300px
,
340px
)
minmax
(
0
,
1
fr
);
gap
:
var
(
--uj-space-module
);
align-items
:
start
;
align-items
:
start
;
background
:
var
(
--uj-surface
);
}
.uc-condition-detail__left
{
padding
:
16px
;
border-right
:
1px
solid
var
(
--uj-border
);
}
}
.uc-condition-detail__right
{
.uc-condition-detail__rail
,
.uc-condition-detail__workspace
{
display
:
grid
;
gap
:
var
(
--uj-space-module
);
min-width
:
0
;
min-width
:
0
;
}
}
.uc-condition-detail__block
{
margin-bottom
:
20px
;
.uc-condition-chevron
{
transition
:
transform
0.2s
var
(
--uj-ease-out
);
}
}
.uc-condition-detail__block-title
,
.uc-condition-chevron--closed
{
.uc-condition-detail__section-title
{
transform
:
rotate
(
-90deg
);
margin
:
0
0
12px
;
color
:
var
(
--uj-text-1
);
font-size
:
16px
;
font-weight
:
600
;
}
}
.uc-condition-detail__section-head
{
display
:
flex
;
.uc-condition-source
{
display
:
inline-flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
space-between
;
padding
:
1px
8px
;
gap
:
12px
;
color
:
var
(
--uj-info
);
}
font-size
:
var
(
--uj-font-xs
);
.uc-condition-detail__section-head
.uc-condition-detail__section-title
{
margin-bottom
:
12px
;
}
.uc-condition-detail__model-reference
{
margin
:
0
0
12px
;
padding
:
10px
14px
;
color
:
var
(
--uj-warning
);
background
:
var
(
--uj-warning-soft
);
border
:
1px
solid
var
(
--uj-warning-border
);
border-radius
:
4px
;
}
.uc-condition-detail__description
{
white-space
:
pre-wrap
;
line-height
:
1.6
;
line-height
:
1.6
;
white-space
:
nowrap
;
background
:
var
(
--uj-info-soft
);
border
:
1px
solid
var
(
--uj-info-border
);
border-radius
:
var
(
--uj-radius-sm
);
}
/* ---- 左栏:车况描述 + 回传照片 ---- */
.uc-condition-desc
{
color
:
var
(
--uj-text-2
);
color
:
var
(
--uj-text-2
);
font-size
:
var
(
--uj-font-md
);
line-height
:
1.7
;
white-space
:
pre-wrap
;
overflow-wrap
:
anywhere
;
}
}
.uc-condition-
detail__
photos
{
.uc-condition-photos
{
display
:
grid
;
display
:
grid
;
grid-template-columns
:
repeat
(
2
,
minmax
(
0
,
1
fr
));
grid-template-columns
:
repeat
(
auto-fill
,
minmax
(
120px
,
1
fr
));
gap
:
1
6
px
;
gap
:
1
2
px
;
}
}
.uc-condition-
detail__
photo
{
.uc-condition-photo
{
margin
:
0
;
margin
:
0
;
min-width
:
0
;
min-width
:
0
;
overflow
:
hidden
;
}
}
.uc-condition-detail__photo
.ant-image
{
.uc-condition-photo__media
{
display
:
block
;
position
:
relative
;
width
:
100%
;
aspect-ratio
:
4
/
3
;
height
:
110px
;
overflow
:
hidden
;
overflow
:
hidden
;
background
:
var
(
--uj-surface-2
);
border
:
1px
solid
var
(
--uj-border
);
border
:
1px
solid
var
(
--uj-border
);
border-radius
:
6px
;
border-radius
:
var
(
--uj-radius-md
)
;
background
:
var
(
--uj-bg
)
;
transition
:
border-color
0.2s
;
}
}
.uc-condition-detail__photo
.ant-image
img
,
.uc-condition-photo
:hover
.uc-condition-photo__media
{
.uc-condition-detail__video
{
border-color
:
var
(
--uj-border-strong
);
}
.uc-condition-photo__media
.ant-image
{
display
:
block
;
width
:
100%
;
width
:
100%
;
height
:
110px
;
height
:
100%
;
object-fit
:
cover
;
}
}
.uc-condition-detail__photo
figcaption
{
.uc-condition-photo__media
.ant-image
img
{
margin-top
:
6px
;
transition
:
transform
0.25s
var
(
--uj-ease-out
);
color
:
var
(
--uj-text-3
);
font-size
:
12px
;
}
}
.uc-condition-detail__video-button
{
.uc-condition-photo
:hover
.ant-image
img
{
position
:
relative
;
transform
:
scale
(
1.04
);
}
.uc-condition-photo__empty
{
position
:
absolute
;
inset
:
0
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
gap
:
4px
;
color
:
var
(
--uj-text-4
);
font-size
:
var
(
--uj-font-xs
);
}
.uc-condition-photo__empty
.anticon
{
font-size
:
20px
;
}
.uc-condition-photo__video
{
position
:
absolute
;
inset
:
0
;
display
:
block
;
width
:
100%
;
width
:
100%
;
height
:
100%
;
padding
:
0
;
padding
:
0
;
border
:
0
;
border
:
0
;
background
:
transparent
;
background
:
transparent
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.uc-condition-detail__video-button
span
{
.uc-condition-photo__video
video
{
display
:
block
;
width
:
100%
;
height
:
100%
;
object-fit
:
cover
;
}
.uc-condition-photo__video
::after
{
content
:
''
;
position
:
absolute
;
position
:
absolute
;
inset
:
0
;
inset
:
0
;
background
:
linear-gradient
(
180deg
,
rgba
(
11
,
20
,
55
,
0
)
55%
,
rgba
(
11
,
20
,
55
,
0.45
)
100%
);
pointer-events
:
none
;
}
.uc-condition-photo__play
{
position
:
absolute
;
top
:
50%
;
left
:
50%
;
z-index
:
1
;
display
:
grid
;
display
:
grid
;
place-items
:
center
;
place-items
:
center
;
color
:
var
(
--uj-on-primary
);
width
:
32px
;
background
:
color-mix
(
in
srgb
,
var
(
--uj-brand-1
)
45%
,
transparent
);
height
:
32px
;
color
:
var
(
--uj-primary
);
font-size
:
14px
;
background
:
rgba
(
255
,
255
,
255
,
0.92
);
border-radius
:
50%
;
box-shadow
:
var
(
--uj-shadow-raise
);
translate
:
-50%
-50%
;
transition
:
transform
0.2s
var
(
--uj-ease-out
);
}
}
.uc-condition-detail__video-preview
{
.uc-condition-photo__video
:hover
.uc-condition-photo__play
{
display
:
block
;
transform
:
scale
(
1.1
);
width
:
100%
;
}
max-height
:
70vh
;
.uc-condition-photo
figcaption
{
background
:
var
(
--uj-brand-1
);
display
:
flex
;
align-items
:
baseline
;
gap
:
4px
;
margin-top
:
6px
;
color
:
var
(
--uj-text-3
);
font-size
:
var
(
--uj-font-xs
);
line-height
:
1.5
;
}
.uc-condition-photo__optional
{
color
:
var
(
--uj-text-4
);
}
.uc-condition-photo__optional
::before
{
content
:
'·'
;
margin-right
:
4px
;
}
.uc-condition-photos__note
{
display
:
flex
;
align-items
:
center
;
gap
:
6px
;
margin-top
:
12px
;
font-size
:
var
(
--uj-font-xs
);
line-height
:
1.6
;
}
.uc-condition-photos__note--warn
{
color
:
var
(
--uj-warning
);
}
.uc-condition-photos__note--ok
{
color
:
var
(
--uj-success
);
}
/* ---- 右栏:表单 ---- */
/* 车型参考是只读信息带:淡底无边框,不与卡片外框抢线。 */
.uc-condition-reference
{
display
:
flex
;
align-items
:
baseline
;
gap
:
8px
;
margin-bottom
:
16px
;
padding
:
8px
12px
;
font-size
:
var
(
--uj-font-sm
);
line-height
:
1.6
;
background
:
var
(
--uj-surface-2
);
border-radius
:
var
(
--uj-radius-md
);
}
}
.uc-condition-detail__right
section
{
.uc-condition-reference__label
{
padding
:
16px
20px
;
flex
:
none
;
border-bottom
:
6px
solid
var
(
--uj-bg
);
color
:
var
(
--uj-text-3
);
}
.uc-condition-reference__value
{
color
:
var
(
--uj-text-1
);
overflow-wrap
:
anywhere
;
}
}
.uc-condition-detail__form
{
/* CombiForm 的分区容器是裸 div,栅格落在这里才能被媒体查询接管(内联样式压不过)。 */
.uc-condition-form
>
form
>
section
>
div
{
display
:
grid
;
display
:
grid
;
grid-template-columns
:
repeat
(
2
,
minmax
(
0
,
1
fr
));
grid-template-columns
:
repeat
(
2
,
minmax
(
0
,
1
fr
));
gap
:
0
24px
;
column-gap
:
24px
;
}
}
.uc-condition-detail__compound
{
.uc-condition-form
.ant-form-item
{
margin-bottom
:
16px
;
}
.uc-condition-form
.ant-form-item-label
>
label
{
color
:
var
(
--uj-text-2
);
}
.uc-condition-compound
{
display
:
grid
;
display
:
grid
;
grid-template-columns
:
repeat
(
2
,
minmax
(
0
,
1
fr
));
grid-template-columns
:
repeat
(
2
,
minmax
(
0
,
1
fr
));
gap
:
8px
;
gap
:
8px
;
width
:
100%
;
width
:
100%
;
}
}
.uc-condition-detail__third
{
padding
:
14px
16px
;
/* ---- 第三方出险报告:软面板无边框,状态行用语义色 ---- */
color
:
var
(
--uj-text-2
);
.uc-condition-third
{
padding
:
12px
16px
;
background
:
var
(
--uj-primary-soft
);
background
:
var
(
--uj-primary-soft
);
border-radius
:
6px
;
border-radius
:
var
(
--uj-radius-lg
)
;
}
}
.uc-condition-detail__third-warning
{
.uc-condition-third__head
{
display
:
flex
;
flex-wrap
:
wrap
;
align-items
:
center
;
gap
:
8px
12px
;
}
.uc-condition-third__head
.ant-checkbox-wrapper
{
color
:
var
(
--uj-text-1
);
font-size
:
var
(
--uj-font-md
);
}
.uc-condition-third__head
.ant-btn
{
margin-left
:
auto
;
}
.uc-condition-third__desc
{
margin-top
:
8px
;
margin-top
:
8px
;
color
:
var
(
--uj-warning
);
color
:
var
(
--uj-text-3
);
font-size
:
var
(
--uj-font-xs
);
line-height
:
1.7
;
}
}
.uc-condition-detail__third-success
{
.uc-condition-third__status
{
display
:
flex
;
align-items
:
center
;
gap
:
6px
;
margin-top
:
8px
;
margin-top
:
8px
;
font-size
:
var
(
--uj-font-xs
);
line-height
:
1.6
;
}
.uc-condition-third__status--warn
{
color
:
var
(
--uj-warning
);
}
.uc-condition-third__status--ok
{
color
:
var
(
--uj-success
);
color
:
var
(
--uj-success
);
}
}
.uc-condition-detail__footer
{
display
:
flex
;
.uc-condition-video-preview
{
justify-content
:
center
;
display
:
block
;
padding
:
24px
;
width
:
100%
;
background
:
var
(
--uj-surface
);
max-height
:
70vh
;
background
:
var
(
--uj-brand-1
);
border-radius
:
var
(
--uj-radius-md
);
}
}
@media
(
max-width
:
900px
)
{
.uc-condition-detail__body
{
@media
(
max-width
:
1100px
)
{
.uc-condition-detail
{
grid-template-columns
:
1
fr
;
grid-template-columns
:
1
fr
;
}
}
.uc-condition-detail__left
{
}
border-right
:
0
;
@media
(
max-width
:
700px
)
{
border-bottom
:
1px
solid
var
(
--uj-border
);
.uc-condition-form
>
form
>
section
>
div
{
}
.uc-condition-detail__form
{
grid-template-columns
:
1
fr
;
grid-template-columns
:
1
fr
;
}
}
/* itemStyle/labelCol 是内联样式,单列与竖排标签只能在这里压回去。 */
.uc-condition-form
.ant-form-item
{
flex-direction
:
column
;
grid-column
:
auto
!important
;
}
.uc-condition-form
.ant-form-item-label
{
flex
:
none
!important
;
max-width
:
100%
;
padding
:
0
0
4px
;
text-align
:
left
;
}
.uc-condition-form
.ant-form-item-label
>
label
{
height
:
auto
;
}
.uc-condition-form
.ant-form-item-label
>
label
::after
{
content
:
none
;
}
}
}
apps/web/subapps/usedcar/src/pages/Condition/conditionConfig.ts
View file @
e024080
...
@@ -40,6 +40,10 @@ const requiredInput = (label: string) => [
...
@@ -40,6 +40,10 @@ const requiredInput = (label: string) => [
{
required
:
true
,
whitespace
:
true
,
message
:
`请填写
${
label
}
`
},
{
required
:
true
,
whitespace
:
true
,
message
:
`请填写
${
label
}
`
},
];
];
/**
* 字段顺序即两列栅格的落位顺序:相邻两项语义成对(标识/地区/日期/价格/颜色/评价/人员/证件),
* 单格字段共 30 个恰好排满 15 行,不留半空行;跨两列的长文本统一收在末尾。
*/
export
const
BASE_FIELDS
:
FieldSchema
<
ConditionValues
>
[]
=
[
export
const
BASE_FIELDS
:
FieldSchema
<
ConditionValues
>
[]
=
[
{
{
name
:
'licensePlate'
,
name
:
'licensePlate'
,
...
@@ -48,14 +52,6 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
...
@@ -48,14 +52,6 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
rules
:
requiredInput
(
'车牌号'
),
rules
:
requiredInput
(
'车牌号'
),
inputProps
:
{
maxLength
:
10
},
inputProps
:
{
maxLength
:
10
},
},
},
{
name
:
'registrationDate'
,
label
:
'上牌时间'
,
type
:
'date'
,
rules
:
required
(
'上牌时间'
)
},
{
name
:
'brandModel'
,
label
:
'车型'
,
type
:
'input'
,
rules
:
requiredInput
(
'车型'
),
inputProps
:
{
maxLength
:
100
},
},
{
{
name
:
'vin'
,
name
:
'vin'
,
label
:
'车架号'
,
label
:
'车架号'
,
...
@@ -70,6 +66,13 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
...
@@ -70,6 +66,13 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
.
replace
(
/
[^
A-HJ-NPR-Z0-9
]
/g
,
''
)
.
replace
(
/
[^
A-HJ-NPR-Z0-9
]
/g
,
''
)
.
slice
(
0
,
17
),
.
slice
(
0
,
17
),
},
},
{
name
:
'brandModel'
,
label
:
'车型'
,
type
:
'input'
,
rules
:
requiredInput
(
'车型'
),
inputProps
:
{
maxLength
:
100
},
},
{
name
:
'engineNumber'
,
label
:
'发动机号'
,
type
:
'input'
,
inputProps
:
{
maxLength
:
20
}
},
{
name
:
'engineNumber'
,
label
:
'发动机号'
,
type
:
'input'
,
inputProps
:
{
maxLength
:
20
}
},
{
{
name
:
'registrationCityName'
,
name
:
'registrationCityName'
,
...
@@ -85,6 +88,8 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
...
@@ -85,6 +88,8 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
rules
:
requiredInput
(
'车辆所在地'
),
rules
:
requiredInput
(
'车辆所在地'
),
inputProps
:
{
maxLength
:
100
},
inputProps
:
{
maxLength
:
100
},
},
},
{
name
:
'registrationDate'
,
label
:
'上牌时间'
,
type
:
'date'
,
rules
:
required
(
'上牌时间'
)
},
{
name
:
'productionDate'
,
label
:
'生产日期'
,
type
:
'date'
,
rules
:
required
(
'生产日期'
)
},
{
{
name
:
'displayMileage'
,
name
:
'displayMileage'
,
label
:
'表显里程'
,
label
:
'表显里程'
,
...
@@ -93,6 +98,13 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
...
@@ -93,6 +98,13 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
inputProps
:
{
maxLength
:
6
},
inputProps
:
{
maxLength
:
6
},
},
},
{
{
name
:
'guidePrice'
,
label
:
'指导价(元)'
,
type
:
'input'
,
rules
:
[{
required
:
true
,
pattern
:
/^
\d
+
(\.\d{1,2})?
$/
,
message
:
'请输入有效指导价'
}],
inputProps
:
{
maxLength
:
10
},
},
{
name
:
'vehicleCategory'
,
name
:
'vehicleCategory'
,
label
:
'车辆类别'
,
label
:
'车辆类别'
,
type
:
'select'
,
type
:
'select'
,
...
@@ -103,19 +115,32 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
...
@@ -103,19 +115,32 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
rules
:
required
(
'车辆类别'
),
rules
:
required
(
'车辆类别'
),
},
},
{
{
name
:
'usageType'
,
label
:
'使用性质'
,
type
:
'select'
,
options
:
[
{
value
:
1
,
label
:
'非营运'
},
{
value
:
2
,
label
:
'营运'
},
{
value
:
3
,
label
:
'营转非'
},
],
rules
:
required
(
'使用性质'
),
},
{
name
:
'emissionStandard'
,
name
:
'emissionStandard'
,
label
:
'排放标准'
,
label
:
'排放标准'
,
type
:
'select'
,
type
:
'select'
,
options
:
[
3
,
4
,
5
,
6
].
map
((
value
)
=>
({
value
,
label
:
`国
${
value
}
`
})),
options
:
[
3
,
4
,
5
,
6
].
map
((
value
)
=>
({
value
,
label
:
`国
${
value
}
`
})),
rules
:
required
(
'排放标准'
),
rules
:
required
(
'排放标准'
),
},
},
{
name
:
'productionDate'
,
label
:
'生产日期'
,
type
:
'date'
,
rules
:
required
(
'生产日期'
)
},
{
{
name
:
'guidePrice'
,
name
:
'ownerType'
,
label
:
'指导价(元)'
,
label
:
'所有人性质'
,
type
:
'input'
,
type
:
'select'
,
rules
:
[{
required
:
true
,
pattern
:
/^
\d
+
(\.\d{1,2})?
$/
,
message
:
'请输入有效指导价'
}],
options
:
[
inputProps
:
{
maxLength
:
10
},
{
value
:
1
,
label
:
'个人'
},
{
value
:
2
,
label
:
'单位'
},
],
rules
:
required
(
'所有人性质'
),
},
},
{
{
name
:
'sunroof'
,
name
:
'sunroof'
,
...
@@ -129,6 +154,13 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
...
@@ -129,6 +154,13 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
rules
:
required
(
'天窗'
),
rules
:
required
(
'天窗'
),
},
},
{
{
name
:
'overallRating'
,
label
:
'综合评价'
,
type
:
'select'
,
options
:
[
'优'
,
'良'
,
'中'
,
'差'
].
map
((
label
,
index
)
=>
({
value
:
index
+
1
,
label
})),
rules
:
required
(
'综合评价'
),
},
{
name
:
'interiorColor'
,
name
:
'interiorColor'
,
label
:
'内饰颜色'
,
label
:
'内饰颜色'
,
type
:
'select'
,
type
:
'select'
,
...
@@ -142,6 +174,20 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
...
@@ -142,6 +174,20 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
options
:
COLORS
,
options
:
COLORS
,
rules
:
required
(
'外观颜色'
),
rules
:
required
(
'外观颜色'
),
},
},
{
name
:
'hasAccident'
,
label
:
'是否事故车'
,
type
:
'select'
,
options
:
YES_NO
,
rules
:
required
(
'是否事故车'
),
},
{
name
:
'buyNewCar'
,
label
:
'是否购买新车'
,
type
:
'select'
,
options
:
YES_NO
,
rules
:
required
(
'是否购买新车'
),
},
{
name
:
'sellerMerchantName'
,
label
:
'门店'
,
type
:
'input'
,
disabled
:
true
},
{
name
:
'sellerMerchantName'
,
label
:
'门店'
,
type
:
'input'
,
disabled
:
true
},
{
name
:
'sellerName'
,
label
:
'销售顾问'
,
type
:
'input'
,
inputProps
:
{
maxLength
:
50
}
},
{
name
:
'sellerName'
,
label
:
'销售顾问'
,
type
:
'input'
,
inputProps
:
{
maxLength
:
50
}
},
{
name
:
'conversionName'
,
label
:
'驻店人员'
,
type
:
'input'
,
inputProps
:
{
maxLength
:
50
}
},
{
name
:
'conversionName'
,
label
:
'驻店人员'
,
type
:
'input'
,
inputProps
:
{
maxLength
:
50
}
},
...
@@ -164,13 +210,6 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
...
@@ -164,13 +210,6 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
.
slice
(
0
,
11
),
.
slice
(
0
,
11
),
},
},
{
{
name
:
'previousOwnerAddress'
,
label
:
'原车主住址'
,
type
:
'textarea'
,
itemStyle
:
{
gridColumn
:
'span 2'
},
textareaProps
:
{
maxLength
:
200
,
rows
:
2
,
showCount
:
true
},
},
{
name
:
'keyCount'
,
name
:
'keyCount'
,
label
:
'钥匙数量'
,
label
:
'钥匙数量'
,
type
:
'input'
,
type
:
'input'
,
...
@@ -188,46 +227,11 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
...
@@ -188,46 +227,11 @@ export const BASE_FIELDS: FieldSchema<ConditionValues>[] = [
{
name
:
'annualInspectionExpiry'
,
label
:
'年审到期日'
,
type
:
'date'
},
{
name
:
'annualInspectionExpiry'
,
label
:
'年审到期日'
,
type
:
'date'
},
{
name
:
'commercialInsuranceExpiry'
,
label
:
'商业险到期'
,
type
:
'date'
},
{
name
:
'commercialInsuranceExpiry'
,
label
:
'商业险到期'
,
type
:
'date'
},
{
{
name
:
'usageType'
,
name
:
'previousOwnerAddress'
,
label
:
'使用性质'
,
label
:
'原车主住址'
,
type
:
'select'
,
type
:
'textarea'
,
options
:
[
itemStyle
:
{
gridColumn
:
'span 2'
},
{
value
:
1
,
label
:
'非营运'
},
textareaProps
:
{
maxLength
:
200
,
rows
:
2
,
showCount
:
true
},
{
value
:
2
,
label
:
'营运'
},
{
value
:
3
,
label
:
'营转非'
},
],
rules
:
required
(
'使用性质'
),
},
{
name
:
'ownerType'
,
label
:
'所有人性质'
,
type
:
'select'
,
options
:
[
{
value
:
1
,
label
:
'个人'
},
{
value
:
2
,
label
:
'单位'
},
],
rules
:
required
(
'所有人性质'
),
},
{
name
:
'overallRating'
,
label
:
'综合评价'
,
type
:
'select'
,
options
:
[
'优'
,
'良'
,
'中'
,
'差'
].
map
((
label
,
index
)
=>
({
value
:
index
+
1
,
label
})),
rules
:
required
(
'综合评价'
),
},
{
name
:
'hasAccident'
,
label
:
'是否事故车'
,
type
:
'select'
,
options
:
YES_NO
,
rules
:
required
(
'是否事故车'
),
},
{
name
:
'buyNewCar'
,
label
:
'是否购买新车'
,
type
:
'select'
,
options
:
YES_NO
,
rules
:
required
(
'是否购买新车'
),
},
},
{
{
name
:
'conditionDescription'
,
name
:
'conditionDescription'
,
...
@@ -274,6 +278,14 @@ export const PRICE_FIELDS: FieldSchema<ConditionValues>[] = [
...
@@ -274,6 +278,14 @@ export const PRICE_FIELDS: FieldSchema<ConditionValues>[] = [
type
:
'input'
,
type
:
'input'
,
rules
:
[{
required
:
true
,
pattern
:
/^
\d{1,9}
$/
,
message
:
'请输入有效车辆公里数'
}],
rules
:
[{
required
:
true
,
pattern
:
/^
\d{1,9}
$/
,
message
:
'请输入有效车辆公里数'
}],
},
},
{
name
:
'prepCost'
,
label
:
'整备成本预估(元)'
,
type
:
'input'
,
inputProps
:
{
maxLength
:
9
}
},
{
name
:
'marketRisk'
,
label
:
'市场与行情风险'
,
type
:
'input'
,
itemStyle
:
{
gridColumn
:
'span 2'
},
inputProps
:
{
maxLength
:
100
},
},
{
{
name
:
'reportConditionDescription'
,
name
:
'reportConditionDescription'
,
label
:
'车况描述(瑕疵/维保详述)'
,
label
:
'车况描述(瑕疵/维保详述)'
,
...
@@ -298,9 +310,15 @@ export const PRICE_FIELDS: FieldSchema<ConditionValues>[] = [
...
@@ -298,9 +310,15 @@ export const PRICE_FIELDS: FieldSchema<ConditionValues>[] = [
rules
:
requiredInput
(
'历史与状态'
),
rules
:
requiredInput
(
'历史与状态'
),
textareaProps
:
{
maxLength
:
100
,
rows
:
3
,
showCount
:
true
},
textareaProps
:
{
maxLength
:
100
,
rows
:
3
,
showCount
:
true
},
},
},
{
name
:
'prepCost'
,
label
:
'整备成本预估(元)'
,
type
:
'input'
,
inputProps
:
{
maxLength
:
9
}
},
{
name
:
'marketRisk'
,
label
:
'市场与行情风险'
,
type
:
'input'
,
inputProps
:
{
maxLength
:
100
}
},
];
];
export
const
labelOf
=
(
options
:
FieldOption
[],
value
:
unknown
)
=>
export
const
labelOf
=
(
options
:
FieldOption
[],
value
:
unknown
)
=>
options
.
find
((
item
)
=>
String
(
item
.
value
)
===
String
(
value
))?.
label
??
'-'
;
options
.
find
((
item
)
=>
String
(
item
.
value
)
===
String
(
value
))?.
label
??
'-'
;
/** 状态点色调:列表与详情档案条共用同一套判定,避免两处各写一份漂移。 */
export
const
statusTone
=
(
value
:
unknown
,
success
:
string
,
failed
?:
string
)
=>
{
if
(
String
(
value
)
===
success
)
return
'success'
;
if
(
failed
!==
undefined
&&
String
(
value
)
===
failed
)
return
'failed'
;
if
(
String
(
value
)
===
'0'
)
return
'pending'
;
return
'progress'
;
};
apps/web/subapps/usedcar/src/pages/Condition/index.tsx
View file @
e024080
...
@@ -16,7 +16,7 @@ import { UC } from '@/permissions/codes';
...
@@ -16,7 +16,7 @@ import { UC } from '@/permissions/codes';
import { loadUsedcarRemoteConfig } from '../../api/core/config-center';
import { loadUsedcarRemoteConfig } from '../../api/core/config-center';
import { errorDetail } from '@/utils/error';
import { errorDetail } from '@/utils/error';
import { goTo } from '../Leads/navigate';
import { goTo } from '../Leads/navigate';
import { AI_REPORT_STATUS, CONDITION_STATUS, labelOf } from './conditionConfig';
import { AI_REPORT_STATUS, CONDITION_STATUS, labelOf
, statusTone
} from './conditionConfig';
import './condition.css';
import './condition.css';
type Filters = Record<string, unknown> & {
type Filters = Record<string, unknown> & {
...
@@ -35,12 +35,6 @@ type Row = Record<string, unknown> & {
...
@@ -35,12 +35,6 @@ type Row = Record<string, unknown> & {
type PageResult = { records: Row[]; total: number };
type PageResult = { records: Row[]; total: number };
const text = (value: unknown) =>
const text = (value: unknown) =>
value === undefined || value === null || value === '' ? '-' : String(value);
value === undefined || value === null || value === '' ? '-' : String(value);
const statusTone = (value: unknown, success: string, failed?: string) => {
if (String(value) === success) return 'success';
if (failed !== undefined && String(value) === failed) return 'failed';
if (String(value) === '0') return 'pending';
return 'progress';
};
export default function Condition() {
export default function Condition() {
const { canPoint } = useAccess();
const { canPoint } = useAccess();
...
@@ -114,7 +108,7 @@ export default function Condition() {
...
@@ -114,7 +108,7 @@ export default function Condition() {
dataIndex: 'status',
dataIndex: 'status',
width: 130,
width: 130,
render: (value: unknown) => (
render: (value: unknown) => (
<span className={`uc-
condition-status uc-condition
-status--${statusTone(value, '1')}`}>
<span className={`uc-
detail-status uc-detail
-status--${statusTone(value, '1')}`}>
{labelOf(CONDITION_STATUS, value)}
{labelOf(CONDITION_STATUS, value)}
</span>
</span>
),
),
...
@@ -124,7 +118,7 @@ export default function Condition() {
...
@@ -124,7 +118,7 @@ export default function Condition() {
dataIndex: 'aiReportStatus',
dataIndex: 'aiReportStatus',
width: 130,
width: 130,
render: (value: unknown) => (
render: (value: unknown) => (
<span className={`uc-
condition-status uc-condition
-status--${statusTone(value, '2', '3')}`}>
<span className={`uc-
detail-status uc-detail
-status--${statusTone(value, '2', '3')}`}>
{labelOf(AI_REPORT_STATUS, value)}
{labelOf(AI_REPORT_STATUS, value)}
</span>
</span>
),
),
...
...
apps/web/subapps/usedcar/src/pages/CustomerGroup/GroupCodeEditor.tsx
View file @
e024080
import { useEffect, useMemo, useState } from 'react';
import { useEffect, useMemo, useState
, type ReactNode
} from 'react';
import { useQuery } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query';
import { UAlert, UButton, UCard, UForm, UInput, UModal, UResult, useUMessage } from '@uj/ui';
import {
UAlert,
UButton,
UCard,
UEmpty,
UForm,
UInput,
UModal,
UResult,
useUMessage,
} from '@uj/ui';
import { CombiForm, DataTable, PageShell, type FieldSchema } from '@/components';
import { CombiForm, DataTable, PageShell, type FieldSchema } from '@/components';
import { getLiveCodeDetail, liveCodeApi } from '@/api';
import { getLiveCodeDetail, liveCodeApi } from '@/api';
import { useAccess } from '@/access';
import { useAccess } from '@/access';
import { UC } from '@/permissions/codes';
import { UC } from '@/permissions/codes';
import { errorDetail } from '@/utils/error';
import { errorDetail } from '@/utils/error';
import { goTo } from '../Leads/navigate';
import { goTo } from '../Leads/navigate';
import './customerGroup.css';
type Group = Record<string, unknown> & {
type Group = Record<string, unknown> & {
groupChatId: string;
groupChatId: string;
...
@@ -217,58 +228,78 @@ export default function GroupCodeEditor({ params }: Props) {
...
@@ -217,58 +228,78 @@ export default function GroupCodeEditor({ params }: Props) {
if (!(editing ? canPoint(UC.GROUP_UPDATE) : canPoint(UC.GROUP_CREATE)))
if (!(editing ? canPoint(UC.GROUP_UPDATE) : canPoint(UC.GROUP_CREATE)))
return <UResult status="403" title="无操作群活码的权限" subTitle="请联系管理员开通权限。" />;
return <UResult status="403" title="无操作群活码的权限" subTitle="请联系管理员开通权限。" />;
return (
return (
<PageShell
<PageShell title={editing ? '修改群活码' : '创建群活码'}>
title={editing ? '修改群活码' : '创建群活码'}
<div className="uc-detail-stack">
extra={<UButton onClick={() => goTo('customer-group')}>返回</UButton>}
<UCard className="uc-detail-card">
>
<CardHead title="基础信息" />
<UCard title="基础信息" size="small">
<div className="uc-detail-card__body">
<CombiForm
<div className="uc-group-form">
mode="form"
<CombiForm
form={form}
mode="form"
fields={fields}
form={form}
layout="horizontal"
fields={fields}
labelWidth={140}
layout="horizontal"
sectionContentStyle={{ display: 'grid', gridTemplateColumns: 'repeat(2, minmax(0, 1fr))', gap: '0 24px' }}
labelWidth={140}
onSubmit={(values) => void save(values)}
sectionContentStyle={{
/>
display: 'grid',
</UCard>
gridTemplateColumns: 'repeat(2, minmax(0, 1fr))',
<UCard
gap: '0 24px',
title="群池配置"
}}
size="small"
onSubmit={(values) => void save(values)}
style={{ marginTop: 16 }}
/>
extra={
</div>
<UButton type="primary" onClick={() => setPickerOpen(true)}>
</div>
从企微后台添加群聊
</UCard>
<UCard className="uc-detail-card">
<CardHead
title="群池配置"
aux={`已关联 ${groups.length} 个群`}
actions={
<UButton type="primary" onClick={() => setPickerOpen(true)}>
从企微后台添加群聊
</UButton>
}
/>
<div className="uc-detail-card__body">
<p className="uc-group-tip">
支持最多选择1000个群聊,系统将按列表顺序自动分配状态为“空闲”的群。序号即分配顺序。
</p>
{groups.length ? (
<div className="uc-group-pool">
{groups.map((item, index) => (
<span key={item.groupChatId} className="uc-group-chip">
<span className="uc-group-chip__index">{index + 1}</span>
<span className="uc-group-chip__name" title={item.groupChatName}>
{item.groupChatName}
</span>
{!item.disabled ? (
<button
type="button"
className="uc-group-chip__remove"
aria-label={`移除${item.groupChatName}`}
onClick={() =>
setGroups((old) =>
old.filter((row) => row.groupChatId !== item.groupChatId),
)
}
>
×
</button>
) : null}
</span>
))}
</div>
) : (
<UEmpty description="尚未关联群聊" />
)}
</div>
</UCard>
<div className="uc-group-actions">
<UButton onClick={() => goTo('customer-group')}>取消</UButton>
<UButton type="primary" loading={saving} onClick={() => form.submit()}>
保存
</UButton>
</UButton>
}
>
<p>已关联 {groups.length} 个群</p>
<p className="uj-page-tip">
支持最多选择1000个群聊,系统将按列表顺序自动分配状态为“空闲”的群。
</p>
<div className="uj-group-tags">
{groups.map((item) => (
<span key={item.groupChatId} className="uj-group-tag">
{item.groupChatName}
{!item.disabled ? (
<button
type="button"
onClick={() =>
setGroups((old) => old.filter((row) => row.groupChatId !== item.groupChatId))
}
>
×
</button>
) : null}
</span>
))}
</div>
</div>
</UCard>
<div className="uj-page-footer-actions">
<UButton onClick={() => goTo('customer-group')}>取消</UButton>
<UButton type="primary" loading={saving} onClick={() => form.submit()}>
保存
</UButton>
</div>
</div>
<GroupPicker
<GroupPicker
open={pickerOpen}
open={pickerOpen}
...
@@ -283,3 +314,12 @@ export default function GroupCodeEditor({ params }: Props) {
...
@@ -283,3 +314,12 @@ export default function GroupCodeEditor({ params }: Props) {
</PageShell>
</PageShell>
);
);
}
}
function CardHead({ title, aux, actions }: { title: string; aux?: string; actions?: ReactNode }) {
return (
<div className="uc-detail-card__head">
<h2 className="uc-detail-card__title">{title}</h2>
{aux ? <span className="uc-detail-card__aux">{aux}</span> : null}
{actions ? <div className="uc-detail-card__actions">{actions}</div> : null}
</div>
);
}
apps/web/subapps/usedcar/src/pages/CustomerGroup/customerGroup.css
View file @
e024080
...
@@ -9,41 +9,92 @@
...
@@ -9,41 +9,92 @@
max-width
:
360px
;
max-width
:
360px
;
}
}
.uj-group-tags
{
/* 群活码编辑页:表单限宽避免输入框拉通整屏,群池用带序号的徽章网格表达分配顺序。 */
display
:
flex
;
.uc-group-form
{
flex-wrap
:
wrap
;
max-width
:
960px
;
}
.uc-group-tip
{
margin
:
0
0
12px
;
color
:
var
(
--uj-text-3
);
font-size
:
var
(
--uj-font-xs
);
}
.uc-group-pool
{
display
:
grid
;
grid-template-columns
:
repeat
(
auto-fill
,
minmax
(
240px
,
1
fr
));
gap
:
8px
;
gap
:
8px
;
min-height
:
32px
;
}
}
.u
j-group-tag
{
.u
c-group-chip
{
display
:
inline-
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
gap
:
8px
;
gap
:
8px
;
max-width
:
320px
;
min-width
:
0
;
padding
:
4px
8px
;
padding
:
6px
10px
;
border-radius
:
var
(
--uj-radius-md
);
background
:
var
(
--uj-surface-2
);
transition
:
background
0.15s
var
(
--uj-ease-out
);
}
.uc-group-chip
:hover
{
background
:
var
(
--uj-surface-3
);
}
.uc-group-chip__index
{
flex
:
none
;
display
:
inline-grid
;
place-items
:
center
;
width
:
20px
;
height
:
20px
;
border-radius
:
50%
;
background
:
var
(
--uj-surface
);
color
:
var
(
--uj-text-3
);
font-size
:
var
(
--uj-font-xs
);
font-variant-numeric
:
var
(
--uj-num
);
}
.uc-group-chip__name
{
flex
:
1
;
min-width
:
0
;
overflow
:
hidden
;
overflow
:
hidden
;
border
:
1px
solid
var
(
--ant-color-border
);
color
:
var
(
--uj-text-1
);
border-radius
:
4px
;
font-size
:
var
(
--uj-font-sm
);
color
:
var
(
--ant-color-text
);
white-space
:
nowrap
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
}
}
.u
j-group-tag
button
{
.u
c-group-chip__remove
{
flex
:
none
;
flex
:
none
;
width
:
16px
;
height
:
16px
;
padding
:
0
;
padding
:
0
;
border
:
0
;
border
:
0
;
border-radius
:
50%
;
background
:
transparent
;
background
:
transparent
;
color
:
inherit
;
color
:
var
(
--uj-text-4
)
;
cursor
:
pointer
;
cursor
:
pointer
;
font-size
:
1
8
px
;
font-size
:
1
4
px
;
line-height
:
1
;
line-height
:
1
;
transition
:
color
0.15s
var
(
--uj-ease-out
),
background
0.15s
var
(
--uj-ease-out
);
}
.uc-group-chip__remove
:hover
{
color
:
var
(
--uj-error
);
background
:
var
(
--uj-surface
);
}
}
.u
j-page-footer
-actions
{
.u
c-group
-actions
{
display
:
flex
;
display
:
flex
;
justify-content
:
flex-end
;
justify-content
:
flex-end
;
gap
:
12px
;
gap
:
8px
;
margin-top
:
16px
;
padding
:
12px
0
;
}
@media
(
max-width
:
700px
)
{
.uc-group-pool
{
grid-template-columns
:
1
fr
;
}
}
}
apps/web/subapps/usedcar/src/pages/Delivery/DeliveryDetail.tsx
View file @
e024080
import type { ReactNode } from 'react';
import { useQuery } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query';
import { UAlert, U
Button, UCard
, UImage, UResult } from '@uj/ui';
import { UAlert, U
Card, UEmpty
, UImage, UResult } from '@uj/ui';
import { CombiForm, PageShell, type FieldSchema } from '@/components';
import { CombiForm, PageShell, type FieldSchema } from '@/components';
import { deliveryOrderApi } from '@/api';
import { deliveryOrderApi } from '@/api';
import { useAccess } from '@/access';
import { useAccess } from '@/access';
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 { errorDetail } from '@/utils/error';
import { errorDetail } from '@/utils/error';
import './delivery.css';
import './delivery.css';
type Detail = Record<string, unknown> & { id: string; confirmImages?: string };
type Detail = Record<string, unknown> & { id: string; confirmImages?: string };
...
@@ -85,36 +85,28 @@ const DETAIL_SECTIONS: Array<{ title: string; fields: FieldSchema<Record<string,
...
@@ -85,36 +85,28 @@ const DETAIL_SECTIONS: Array<{ title: string; fields: FieldSchema<Record<string,
['custodianPhone', '车辆保管人联系方式'],
['custodianPhone', '车辆保管人联系方式'],
]),
]),
},
},
{
title: '交付图片',
fields: [
{
name: 'confirmImages',
label: '交付图片',
type: 'input',
render: (v) => {
const images = String(v ?? '')
.split(/,\s*(?=https?:\/\/)/)
.filter(Boolean);
return images.length ? (
<div className="uc-delivery-images">
{images.map((url) => (
<UImage key={url} src={url} width={90} height={90} />
))}
</div>
) : (
'-'
);
},
},
],
},
];
];
const LOG_FIELDS = make([
/** 交付图片独立成卡:逗号分隔的 URL 串解析规则与原配置一致。 */
['operationName', '操作类型'],
function DeliveryImages({ value }: { value: unknown }) {
['opUserName', '操作人'],
const images = String(value ?? '')
['createdDate', '操作时间'],
.split(/,\s*(?=https?:\/\/)/)
]);
.filter(Boolean);
if (!images.length) return <UEmpty description="暂无交付图片" />;
return (
<div className="uc-delivery-images">
{images.map((url) => (
<UImage
key={url}
src={url}
width="100%"
height={112}
className="uc-delivery-image"
styles={{ image: { objectFit: 'cover' } }}
/>
))}
</div>
);
}
const OPERATION_NAME_MAP: Record<string, string> = {
const OPERATION_NAME_MAP: Record<string, string> = {
1: '创建交付工单',
1: '创建交付工单',
2: '确认客户到店',
2: '确认客户到店',
...
@@ -141,6 +133,8 @@ export default function DeliveryDetail({ params }: { params: PageParams }) {
...
@@ -141,6 +133,8 @@ export default function DeliveryDetail({ params }: { params: PageParams }) {
<UResult status="403" title="无查看交付单详情的权限" subTitle="请联系管理员开通对应权限。" />
<UResult status="403" title="无查看交付单详情的权限" subTitle="请联系管理员开通对应权限。" />
);
);
const data = query.data ?? { id: params.id };
const data = query.data ?? { id: params.id };
const logRows = logs.data ?? [];
const sectionOf = (title: string) => DETAIL_SECTIONS.find((item) => item.title === title);
return (
return (
<PageShell title="交付单详情">
<PageShell title="交付单详情">
{query.isError ? (
{query.isError ? (
...
@@ -151,39 +145,147 @@ export default function DeliveryDetail({ params }: { params: PageParams }) {
...
@@ -151,39 +145,147 @@ export default function DeliveryDetail({ params }: { params: PageParams }) {
description={errorDetail(query.error)}
description={errorDetail(query.error)}
/>
/>
) : null}
) : null}
<div className="uc-delivery-detail">
<UCard className="uc-detail-card" loading={query.isPending}>
{DETAIL_SECTIONS.map((section) => (
<div className="uc-detail-dossier">
<UCard key={section.title} title={section.title}>
<div className="uc-detail-dossier__identity">
<CombiForm
<div className="uc-detail-dossier__name">
mode="detail"
{text(data.vehicleTitle)}
detailColumns={2}
{data.licensePlate ? (
labelWidth={128}
<span className="uc-detail-dossier__chip">{String(data.licensePlate)}</span>
fields={section.fields}
) : null}
initialValues={data}
</div>
/>
<div className="uc-detail-dossier__code">交付单编号:{text(data.deliveryOrderId)}</div>
</div>
<div className="uc-detail-dossier__meta">
<MetaItem label="交付单状态">{status(data.orderStatus)}</MetaItem>
<MetaItem label="交付方式">{delivery(data.deliveryType)}</MetaItem>
<MetaItem label="创建时间">{text(data.createdDate)}</MetaItem>
</div>
</div>
</UCard>
<div className="uc-detail-split">
<div className="uc-detail-split__main">
{['车辆信息', '交易信息', '交付与物流信息'].map((title) => {
const section = sectionOf(title);
return section ? (
<SectionCard
key={title}
title={title}
fields={section.fields}
data={data}
loading={query.isPending}
/>
) : null;
})}
<UCard className="uc-detail-card" loading={query.isPending}>
<CardHead title="交付图片" />
<div className="uc-detail-card__body">
<DeliveryImages value={data.confirmImages} />
</div>
</UCard>
</UCard>
))}
</div>
{logs.data?.length ? (
<div className="uc-detail-split__rail">
<UCard title="操作日志">
{['交付单信息', '拍卖信息', '交付联系信息'].map((title) => {
{logs.data.map((item) => (
const section = sectionOf(title);
<CombiForm
return section ? (
key={item.id}
<SectionCard
mode="detail"
key={title}
detailColumns={2}
title={title}
labelWidth={128}
fields={section.fields}
initialValues={{
data={data}
...item,
loading={query.isPending}
operationName: OPERATION_NAME_MAP[String(item.opType)] ?? '-',
columns={1}
}}
fields={LOG_FIELDS}
/>
/>
))}
) : null;
})}
<UCard className="uc-detail-card" loading={logs.isPending}>
<CardHead
title="操作日志"
aux={logRows.length ? `共 ${logRows.length} 条` : undefined}
/>
<div className="uc-detail-card__body">
{logs.isError ? (
<UAlert
type="error"
showIcon
title="操作日志加载失败"
description={errorDetail(logs.error)}
/>
) : logRows.length ? (
<div className="uc-detail-timeline">
{logRows.map((item) => (
<div className="uc-detail-timeline__item" key={item.id}>
<span className="uc-detail-timeline__marker" />
<div>
<div className="uc-detail-timeline__head">
<span className="uc-detail-timeline__title">
{OPERATION_NAME_MAP[String(item.opType)] ?? '-'}
</span>
<span className="uc-detail-timeline__time">{text(item.createdDate)}</span>
</div>
<div className="uc-detail-timeline__body">
<div>
<span className="uc-detail-timeline__label">操作人:</span>
{text(item.opUserName)}
</div>
</div>
</div>
</div>
))}
</div>
) : (
<UEmpty description="暂无操作日志" />
)}
</div>
</UCard>
</UCard>
) : null}
</div>
</div>
<div className="uc-delivery-detail-actions">
<UButton onClick={() => goTo('delivery')}>返回</UButton>
</div>
</div>
</PageShell>
</PageShell>
);
);
}
}
function SectionCard({
title,
fields,
data,
loading,
columns = 2,
}: {
title: string;
fields: FieldSchema<Record<string, unknown>>[];
data: Record<string, unknown>;
loading?: boolean;
columns?: 1 | 2;
}) {
return (
<UCard className="uc-detail-card" loading={loading}>
<CardHead title={title} />
<div className="uc-detail-card__body">
<div className="uc-detail-descriptions">
<CombiForm
mode="detail"
detailColumns={columns}
labelWidth={columns === 1 ? 140 : 128}
fields={fields}
initialValues={data}
/>
</div>
</div>
</UCard>
);
}
function CardHead({ title, aux }: { title: string; aux?: string }) {
return (
<div className="uc-detail-card__head">
<h2 className="uc-detail-card__title">{title}</h2>
{aux ? <span className="uc-detail-card__aux">{aux}</span> : null}
</div>
);
}
function MetaItem({ label, children }: { label: string; children: ReactNode }) {
return (
<div className="uc-detail-dossier__item">
<span className="uc-detail-dossier__label">{label}</span>
<span className="uc-detail-dossier__value">{children}</span>
</div>
);
}
apps/web/subapps/usedcar/src/pages/Delivery/delivery.css
View file @
e024080
.uc-delivery-detail
{
/* 交付单详情私有样式。卡片/档案条/时间线等通用部分在 src/styles/detail.css。 */
.uc-delivery-images
{
display
:
grid
;
display
:
grid
;
gap
:
16px
;
grid-template-columns
:
repeat
(
auto-fill
,
minmax
(
112px
,
1
fr
));
gap
:
12px
;
}
}
.uc-delivery-
detail
.ant-descriptions-view
>
tabl
e
{
.uc-delivery-
image.ant-imag
e
{
width
:
100%
;
width
:
100%
;
table-layout
:
fixed
;
overflow
:
hidden
;
border
:
1px
solid
var
(
--uj-border
);
border-radius
:
var
(
--uj-radius-md
);
transition
:
border-color
0.2s
;
}
}
.uc-delivery-detail
.ant-descriptions-item-label
{
.uc-delivery-image.ant-image
:hover
{
width
:
128px
;
border-color
:
var
(
--uj-border-strong
);
min-width
:
128px
;
white-space
:
nowrap
;
}
}
.uc-delivery-images
{
.uc-delivery-image.ant-image
.ant-image-img
{
display
:
flex
;
transition
:
transform
0.25s
var
(
--uj-ease-out
);
flex-wrap
:
wrap
;
gap
:
12px
;
align-items
:
center
;
}
}
.uc-delivery-detail-actions
{
.uc-delivery-image.ant-image
:hover
.ant-image-img
{
display
:
flex
;
transform
:
scale
(
1.04
);
justify-content
:
center
;
margin-top
:
16px
;
}
}
apps/web/subapps/usedcar/src/pages/Handover/HandoverDetail
Modal
.tsx
→
apps/web/subapps/usedcar/src/pages/Handover/HandoverDetail
Drawer
.tsx
View file @
e024080
import { useState } from 'react';
import { useState
, type ReactNode
} from 'react';
import { useQuery } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query';
import { UAlert, UButton, U
Image, UModal
} from '@uj/ui';
import { UAlert, UButton, U
Card, UDrawer, UImage
} from '@uj/ui';
import {
CombiForm, DataTable, type DataTableColumn, type FieldSchema
} from '@/components';
import {
DataTable, type DataTableColumn
} from '@/components';
import { staffHandoverApi } from '@/api';
import { staffHandoverApi } from '@/api';
import { errorDetail } from '@/utils/error';
import { errorDetail } from '@/utils/error';
import './handover.css';
import './handover.css';
type Row = Record<string, unknown> & { id: string | number };
type Row = Record<string, unknown> & { id: string | number };
const text = (v: unknown) => (v === undefined || v === null || v === '' ? '-' : String(v));
const text = (v: unknown) => (v === undefined || v === null || v === '' ? '-' : String(v));
const detailFields = (items: Array<[string, string]>): FieldSchema<Record<string, unknown>>[] =>
export default function HandoverDetailDrawer({
items.map(([name, label]) => ({ name, label, type: 'input', render: text }));
export default function HandoverDetailModal({
record,
record,
onClose,
onClose,
}: {
}: {
...
@@ -26,6 +24,7 @@ export default function HandoverDetailModal({
...
@@ -26,6 +24,7 @@ export default function HandoverDetailModal({
enabled: Boolean(record),
enabled: Boolean(record),
});
});
const data = q.data ?? {};
const data = q.data ?? {};
const assets = (data.details as Record<string, unknown>[]) ?? [];
const columns = [
const columns = [
['评估单号', 'evalOrderNo'],
['评估单号', 'evalOrderNo'],
['门店', 'sellerMerchantName'],
['门店', 'sellerMerchantName'],
...
@@ -66,29 +65,47 @@ export default function HandoverDetailModal({
...
@@ -66,29 +65,47 @@ export default function HandoverDetailModal({
},
},
);
);
return (
return (
<UModal open={Boolean(record)} title="详情" width={1080} footer={null} onCancel={onClose}>
<UDrawer
<CombiForm
open={Boolean(record)}
mode="detail"
title="交接详情"
detailColumns={3}
size={1000}
labelWidth={128}
onClose={onClose}
fields={detailFields([
styles={{
['handoverBatchNo', '交接批次号'],
body: {
['handoverTime', '操作时间'],
padding: 16,
['createdBy', '操作人'],
background: 'var(--uj-bg)',
])}
display: 'flex',
initialValues={data}
flexDirection: 'column',
/>
gap: 'var(--uj-space-module)',
<h3>待交接资产列表</h3>
},
}}
>
{q.isError ? (
{q.isError ? (
<UAlert type="error" showIcon title="详情加载失败" description={errorDetail(q.error)} />
<UAlert type="error" showIcon title="详情加载失败" description={errorDetail(q.error)} />
) : (
) : null}
<DataTable<Record<string, unknown>>
<UCard className="uc-detail-card" loading={q.isPending}>
rowKey="evalOrderNo"
<div className="uc-detail-dossier">
columns={columns}
<div className="uc-detail-dossier__identity">
dataSource={(data.details as Record<string, unknown>[]) ?? []}
<div className="uc-detail-dossier__name">交接批次 {text(data.handoverBatchNo)}</div>
pagination={false}
</div>
/>
<div className="uc-detail-dossier__meta">
)}
<MetaItem label="操作时间">{text(data.handoverTime)}</MetaItem>
<MetaItem label="操作人">{text(data.createdBy)}</MetaItem>
</div>
</div>
</UCard>
<UCard className="uc-detail-card">
<CardHead title="待交接资产" aux={`共 ${assets.length} 项`} />
<div className="uc-detail-card__body">
<DataTable<Record<string, unknown>>
rowKey="evalOrderNo"
columns={columns}
dataSource={assets}
loading={q.isPending || q.isFetching}
pagination={false}
/>
</div>
</UCard>
{previewUrl ? (
{previewUrl ? (
<div className="uc-handover-image-viewer" onClick={() => setPreviewUrls([])}>
<div className="uc-handover-image-viewer" onClick={() => setPreviewUrls([])}>
<div
<div
...
@@ -125,6 +142,22 @@ export default function HandoverDetailModal({
...
@@ -125,6 +142,22 @@ export default function HandoverDetailModal({
</div>
</div>
</div>
</div>
) : null}
) : null}
</UModal>
</UDrawer>
);
}
function CardHead({ title, aux }: { title: string; aux?: string }) {
return (
<div className="uc-detail-card__head">
<h2 className="uc-detail-card__title">{title}</h2>
{aux ? <span className="uc-detail-card__aux">{aux}</span> : null}
</div>
);
}
function MetaItem({ label, children }: { label: string; children: ReactNode }) {
return (
<div className="uc-detail-dossier__item">
<span className="uc-detail-dossier__label">{label}</span>
<span className="uc-detail-dossier__value">{children}</span>
</div>
);
);
}
}
apps/web/subapps/usedcar/src/pages/Handover/index.tsx
View file @
e024080
...
@@ -13,7 +13,7 @@ import { staffHandoverApi } from '@/api';
...
@@ -13,7 +13,7 @@ import { staffHandoverApi } from '@/api';
import { useAccess } from '@/access';
import { useAccess } from '@/access';
import { UC } from '@/permissions/codes';
import { UC } from '@/permissions/codes';
import { errorDetail } from '@/utils/error';
import { errorDetail } from '@/utils/error';
import HandoverDetail
Modal from './HandoverDetailModal
';
import HandoverDetail
Drawer from './HandoverDetailDrawer
';
import CreateHandoverModal from './CreateHandoverModal';
import CreateHandoverModal from './CreateHandoverModal';
type Filters = Record<string, unknown> & { name?: string; dateValue?: [Dayjs, Dayjs] };
type Filters = Record<string, unknown> & { name?: string; dateValue?: [Dayjs, Dayjs] };
type Row = Record<string, unknown> & { id: string | number };
type Row = Record<string, unknown> & { id: string | number };
...
@@ -129,7 +129,7 @@ export default function Handover() {
...
@@ -129,7 +129,7 @@ export default function Handover() {
}}
}}
/>
/>
</UCard>
</UCard>
<HandoverDetail
Modal
record={detail} onClose={() => setDetail(undefined)} />
<HandoverDetail
Drawer
record={detail} onClose={() => setDetail(undefined)} />
<CreateHandoverModal
<CreateHandoverModal
open={create}
open={create}
onClose={() => setCreate(false)}
onClose={() => setCreate(false)}
...
...
apps/web/subapps/usedcar/src/pages/Leads/LeadDetail.tsx
View file @
e024080
import type { ReactNode } from 'react';
import { useQuery } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query';
import { UAlert, UButton, UCard, UDescriptions, UEmpty, UResult, UTable, UTag } from '@uj/ui';
import { UAlert, UButton, UCard, UDescriptions, UEmpty, UResult, UTable, UTag } from '@uj/ui';
import { PageShell } from '@/components';
import { PageShell } from '@/components';
...
@@ -8,26 +9,103 @@ import type { PageParams } from '@/routes';
...
@@ -8,26 +9,103 @@ import type { PageParams } from '@/routes';
import { errorDetail } from '@/utils/error';
import { errorDetail } from '@/utils/error';
import './leads.css';
import './leads.css';
const levelDescription: Record<string, string> = { O: '客情回复,确认交车时间', H: '1日内跟进', A: '2日内跟进', B: '5天内跟进', C: '10天跟进', D: '20天跟进' };
const levelDescription: Record<string, string> = {
const followStyle: Record<number, string> = { 1: '电话', 2: '微信', 3: '到店', 4: '上门', 5: '短信', 6: '其他' };
O: '客情回复,确认交车时间',
const followResult: Record<number, string> = { 1: '邀约验车', 2: '客户考虑中', 3: '不卖旧车', 4: '还在考虑收购价', 5: '还没定新车', 6: '成功收车', 7: '其他' };
H: '1日内跟进',
A: '2日内跟进',
B: '5天内跟进',
C: '10天跟进',
D: '20天跟进',
};
const followStyle: Record<number, string> = {
1: '电话',
2: '微信',
3: '到店',
4: '上门',
5: '短信',
6: '其他',
};
const followResult: Record<number, string> = {
1: '邀约验车',
2: '客户考虑中',
3: '不卖旧车',
4: '还在考虑收购价',
5: '还没定新车',
6: '成功收车',
7: '其他',
};
const displacement: Record<number, string> = { 1: '收车置换', 2: '不收车置换', 3: '未确定' };
const displacement: Record<number, string> = { 1: '收车置换', 2: '不收车置换', 3: '未确定' };
const detection: Record<number, string> = { 1: '到店', 2: '远程', 3: '第三方', 4: '上门' };
const detection: Record<number, string> = { 1: '到店', 2: '远程', 3: '第三方', 4: '上门' };
const failReason: Record<number, string> = { 1: '客户自行处理', 2: '家人不同意', 3: '客户决定增购', 4: '旧车已处置', 5: '其他' };
const failReason: Record<number, string> = {
const operationType: Record<number, string> = { 1: '创建线索', 2: '新增跟进', 3: '状态变更', 4: '意向等级变更' };
1: '客户自行处理',
const statusText: Record<string, string> = { '1': '待跟进', '2': '跟进中', '3': '暂败', '4': '成功收车' };
2: '家人不同意',
3: '客户决定增购',
4: '旧车已处置',
5: '其他',
};
const operationType: Record<number, string> = {
1: '创建线索',
2: '新增跟进',
3: '状态变更',
4: '意向等级变更',
};
const statusText: Record<string, string> = {
'1': '待跟进',
'2': '跟进中',
'3': '暂败',
'4': '成功收车',
};
function display(value: unknown): string { return value === undefined || value === null || value === '' ? '-' : String(value); }
function display(value: unknown): string {
function model(detail: LeadDetail): string { return [detail.carBrand, detail.carChildsBrandName, detail.carSeriesName, detail.carTypeName].filter(Boolean).join('-') || '-'; }
return value === undefined || value === null || value === '' ? '-' : String(value);
}
function model(detail: LeadDetail): string {
return (
[detail.carBrand, detail.carChildsBrandName, detail.carSeriesName, detail.carTypeName]
.filter(Boolean)
.join('-') || '-'
);
}
function FollowItem({ item }: { item: FollowRecord }) {
function FollowItem({ item }: { item: FollowRecord }) {
const result = Number(item.followResult);
const result = Number(item.followResult);
const rows: Array<[string, unknown]> = [
const rows: Array<[string, unknown, boolean?]> = [
['跟进人', item.followUserName], ['跟进方式', followStyle[Number(item.followStyle)]], ['跟进结果', followResult[result]],
['跟进人', item.followUserName],
...(result === 1 ? [['置换类型', displacement[Number(item.displacementType)]], ['检测方式', detection[Number(item.detectionMode)]]] as Array<[string, unknown]> : []),
['跟进方式', followStyle[Number(item.followStyle)]],
...(result === 3 ? [['暂败原因', failReason[Number(item.failReason)]]] as Array<[string, unknown]> : []),
['跟进结果', followResult[result]],
['意向等级', item.customerIntentLevelChange], ['下一次跟进时间', item.nextFollowTime], ['跟进内容', item.followRemark],
...(result === 1
? ([
['置换类型', displacement[Number(item.displacementType)]],
['检测方式', detection[Number(item.detectionMode)]],
] as Array<[string, unknown]>)
: []),
...(result === 3
? ([['暂败原因', failReason[Number(item.failReason)]]] as Array<[string, unknown]>)
: []),
['意向等级', item.customerIntentLevelChange],
['下一次跟进时间', item.nextFollowTime],
['跟进内容', item.followRemark, true],
];
];
return <div className="uc-lead-follow__item"><div className="uc-lead-follow__head"><b>{Number(item.followRecordType) === 2 ? '24小时内跟进线索' : '跟进线索'}</b><span>{display(item.createdDate)}</span></div><div className="uc-lead-follow__body">{rows.map(([label, value]) => <span key={label}>{label}:<b>{display(value)}</b></span>)}</div></div>;
return (
<div className="uc-detail-timeline__item">
<span className="uc-detail-timeline__marker" />
<div>
<div className="uc-detail-timeline__head">
<span className="uc-detail-timeline__title">
{Number(item.followRecordType) === 2 ? '24小时内跟进线索' : '跟进线索'}
</span>
<span className="uc-detail-timeline__time">{display(item.createdDate)}</span>
</div>
<div className="uc-lead-follow__body">
{rows.map(([label, value, wide]) => (
<span key={label} className={wide ? 'uc-lead-follow__wide' : undefined}>
<span className="uc-detail-timeline__label">{label}:</span>
{display(value)}
</span>
))}
</div>
</div>
</div>
);
}
}
/** 线索详情为独立路由页面:/usedcar/leads/:id。 */
/** 线索详情为独立路由页面:/usedcar/leads/:id。 */
...
@@ -35,30 +113,220 @@ export default function LeadDetail({ params }: { params: PageParams }) {
...
@@ -35,30 +113,220 @@ export default function LeadDetail({ params }: { params: PageParams }) {
const { canPoint } = useAccess();
const { canPoint } = useAccess();
const allowed = canPoint(UC.LEAD_DETAIL);
const allowed = canPoint(UC.LEAD_DETAIL);
const id = params.id;
const id = params.id;
const detail = useQuery({ queryKey: ['usedcar', 'lead', id], queryFn: () => leadsApi.detail(id), enabled: allowed && Boolean(id) });
const detail = useQuery({
const follows = useQuery({ queryKey: ['usedcar', 'lead', id, 'follows'], queryFn: () => leadsApi.followRecords(id), enabled: allowed && Boolean(id) });
queryKey: ['usedcar', 'lead', id],
const logs = useQuery({ queryKey: ['usedcar', 'lead', id, 'logs'], queryFn: () => leadsApi.operationLogs(id), enabled: allowed && Boolean(id) });
queryFn: () => leadsApi.detail(id),
if (!allowed) return <UResult status="403" title="无查看线索详情的权限" subTitle="请联系管理员开通“查看详情”权限。" />;
enabled: allowed && Boolean(id),
});
const follows = useQuery({
queryKey: ['usedcar', 'lead', id, 'follows'],
queryFn: () => leadsApi.followRecords(id),
enabled: allowed && Boolean(id),
});
const logs = useQuery({
queryKey: ['usedcar', 'lead', id, 'logs'],
queryFn: () => leadsApi.operationLogs(id),
enabled: allowed && Boolean(id),
});
if (!allowed)
return (
<UResult
status="403"
title="无查看线索详情的权限"
subTitle="请联系管理员开通“查看详情”权限。"
/>
);
if (!id) return <UResult status="404" title="未找到线索" subTitle="详情地址缺少线索编号。" />;
if (!id) return <UResult status="404" title="未找到线索" subTitle="详情地址缺少线索编号。" />;
const data: LeadDetail = detail.data ?? { id };
const data: LeadDetail = detail.data ?? { id };
const status = String(data.cluesStatus ?? '');
const status = String(data.cluesStatus ?? '');
const followStatus = Number(data.followTimeStatus);
const followStatus = Number(data.followTimeStatus);
return <PageShell title="线索详情" description="查看线索基础信息、跟进记录和操作日志。">
const level = String(data.customerIntentLevel ?? '');
{detail.isError ? <UAlert type="error" showIcon title="线索详情加载失败" description={errorDetail(detail.error)} action={<UButton type="link" onClick={() => void detail.refetch()}>重试</UButton>} /> : null}
const gradeTone = ['o', 'h', 'a', 'b', 'c'].includes(level.toLowerCase())
<div className="uc-lead-detail">
? level.toLowerCase()
<div className="uc-lead-detail__top">
: 'none';
<UCard><h3 className="uc-lead-detail__title">基础信息 {status ? <UTag color={status === '2' ? 'green' : status === '3' ? 'red' : status === '4' ? 'purple' : 'blue'}>{statusText[status]}</UTag> : null} {followStatus ? <UTag color={followStatus === 1 ? 'orange' : 'red'}>{followStatus === 1 ? '临期' : '已超期'}</UTag> : null}</h3>
const followRows = follows.data ?? [];
<UDescriptions column={2} size="small">
return (
<UDescriptions.Item label="线索 ID">{display(data.cluesNo)}</UDescriptions.Item><UDescriptions.Item label="录入时间">{display(data.enterTime)}</UDescriptions.Item>
<PageShell title="线索详情" description="查看线索基础信息、跟进记录和操作日志。">
<UDescriptions.Item label="线索门店">{display(data.sellerMerchantName)}</UDescriptions.Item><UDescriptions.Item label="推荐销售顾问">{display(data.sellerName)}</UDescriptions.Item>
{detail.isError ? (
<UDescriptions.Item label="车主姓名">{display(data.carOwnerName)}</UDescriptions.Item><UDescriptions.Item label="车主电话">{display(data.carOwnerPhone)}</UDescriptions.Item>
<UAlert
<UDescriptions.Item label="评估品牌车型" span={2}>{model(data)}</UDescriptions.Item><UDescriptions.Item label="最近跟进时间">{display(data.latestFollowTime)}</UDescriptions.Item><UDescriptions.Item label="下一次跟进时间">{display(data.nextFollowTime)}</UDescriptions.Item>
type="error"
</UDescriptions>
showIcon
</UCard>
title="线索详情加载失败"
<div><UCard><h3 className="uc-lead-detail__title">客户意向等级</h3><p><strong>{display(data.customerIntentLevel)}级</strong>{' '}{levelDescription[String(data.customerIntentLevel)] ?? '-'}</p><p>下一次跟进时间:{display(data.nextFollowTime)}</p></UCard><UCard style={{ marginTop: 16 }}><h3 className="uc-lead-detail__title">备注说明</h3><p>{display(data.remark === undefined ? '暂无备注' : data.remark)}</p></UCard></div>
description={errorDetail(detail.error)}
action={
<UButton type="link" onClick={() => void detail.refetch()}>
重试
</UButton>
}
/>
) : null}
<UCard className="uc-detail-card" loading={detail.isPending}>
<div className="uc-detail-dossier">
<div className="uc-detail-dossier__identity">
<div className="uc-detail-dossier__name">
{model(data)}
{level ? <span className="uc-detail-dossier__chip">{level}级</span> : null}
</div>
<div className="uc-detail-dossier__code">线索 ID:{display(data.cluesNo)}</div>
</div>
<div className="uc-detail-dossier__meta">
{status ? (
<MetaItem label="线索状态">
<UTag
color={
status === '2'
? 'green'
: status === '3'
? 'red'
: status === '4'
? 'purple'
: 'blue'
}
>
{statusText[status]}
</UTag>
</MetaItem>
) : null}
{followStatus ? (
<MetaItem label="跟进时效">
<UTag color={followStatus === 1 ? 'orange' : 'red'}>
{followStatus === 1 ? '临期' : '已超期'}
</UTag>
</MetaItem>
) : null}
<MetaItem label="线索门店">{display(data.sellerMerchantName)}</MetaItem>
<MetaItem label="录入时间">{display(data.enterTime)}</MetaItem>
</div>
</div>
</UCard>
<div className="uc-detail-split">
<div className="uc-detail-split__main">
<UCard className="uc-detail-card" loading={detail.isPending}>
<CardHead title="基础信息" />
<div className="uc-detail-card__body">
<UDescriptions
className="uc-detail-descriptions"
column={{ xs: 1, sm: 2 }}
styles={{ label: { width: 112, whiteSpace: 'nowrap' } }}
items={[
{
key: 'merchant',
label: '线索门店',
children: display(data.sellerMerchantName),
},
{ key: 'seller', label: '推荐销售顾问', children: display(data.sellerName) },
{ key: 'owner', label: '车主姓名', children: display(data.carOwnerName) },
{ key: 'phone', label: '车主电话', children: display(data.carOwnerPhone) },
{ key: 'model', label: '评估品牌车型', span: 2, children: model(data) },
{
key: 'latest',
label: '最近跟进时间',
children: display(data.latestFollowTime),
},
{ key: 'next', label: '下一次跟进时间', children: display(data.nextFollowTime) },
]}
/>
</div>
</UCard>
<UCard className="uc-detail-card" loading={follows.isPending}>
<CardHead
title="跟进记录"
aux={followRows.length ? `共 ${followRows.length} 条 · 时间倒序` : undefined}
/>
<div className="uc-detail-card__body">
{follows.isError ? (
<UAlert
type="error"
showIcon
title="跟进记录加载失败"
description={errorDetail(follows.error)}
/>
) : followRows.length ? (
<div className="uc-detail-timeline">
{followRows.map((item, index) => (
<FollowItem item={item} key={`${item.createdDate ?? ''}-${index}`} />
))}
</div>
) : (
<UEmpty description="暂无跟进记录" />
)}
</div>
</UCard>
<UCard className="uc-detail-card" loading={logs.isPending}>
<CardHead title="操作日志" />
<div className="uc-detail-card__body">
{logs.isError ? (
<UAlert
type="error"
showIcon
title="操作日志加载失败"
description={errorDetail(logs.error)}
/>
) : (
<UTable<OperationLog>
rowKey={(_, index) => String(index)}
pagination={false}
dataSource={logs.data ?? []}
columns={[
{ title: '操作时间', dataIndex: 'opTime', render: display },
{ title: '操作人', dataIndex: 'opUserName', render: display },
{
title: '操作类型',
dataIndex: 'opType',
render: (value) => operationType[Number(value)] ?? '-',
},
{ title: '操作内容', dataIndex: 'opContent', render: display },
]}
/>
)}
</div>
</UCard>
</div>
<div className="uc-detail-split__rail">
<UCard className="uc-detail-card" loading={detail.isPending}>
<CardHead title="客户意向等级" />
<div className="uc-detail-card__body">
<div className="uc-lead-grade">
<span className={`uc-lead-grade__badge uc-lead-grade__badge--${gradeTone}`}>
{level || '-'}
</span>
<div className="uc-lead-grade__text">
<div className="uc-lead-grade__desc">{levelDescription[level] ?? '-'}</div>
<div className="uc-lead-grade__next">
下一次跟进时间:{display(data.nextFollowTime)}
</div>
</div>
</div>
</div>
</UCard>
<UCard className="uc-detail-card" loading={detail.isPending}>
<CardHead title="备注说明" />
<div className="uc-detail-card__body">
<p className="uc-lead-remark">
{data.remark === undefined || data.remark === null || data.remark === ''
? '暂无备注'
: String(data.remark)}
</p>
</div>
</UCard>
</div>
</div>
</div>
<UCard><h3 className="uc-lead-detail__title">跟进记录(共 {follows.data?.length ?? 0} 条,时间倒序)</h3>{follows.isError ? <UAlert type="error" showIcon title="跟进记录加载失败" description={errorDetail(follows.error)} /> : follows.data?.length ? <div className="uc-lead-follow">{follows.data.map((item, index) => <FollowItem item={item} key={`${item.createdDate ?? ''}-${index}`} />)}</div> : <UEmpty description="暂无跟进记录" />}</UCard>
</PageShell>
<UCard><h3 className="uc-lead-detail__title">操作日志</h3>{logs.isError ? <UAlert type="error" showIcon title="操作日志加载失败" description={errorDetail(logs.error)} /> : <UTable<OperationLog> rowKey={(_, index) => String(index)} pagination={false} dataSource={logs.data ?? []} columns={[{ title: '操作时间', dataIndex: 'opTime', render: display }, { title: '操作人', dataIndex: 'opUserName', render: display }, { title: '操作类型', dataIndex: 'opType', render: (value) => operationType[Number(value)] ?? '-' }, { title: '操作内容', dataIndex: 'opContent', render: display }]} />}</UCard>
);
}
function CardHead({ title, aux }: { title: string; aux?: string }) {
return (
<div className="uc-detail-card__head">
<h2 className="uc-detail-card__title">{title}</h2>
{aux ? <span className="uc-detail-card__aux">{aux}</span> : null}
</div>
);
}
function MetaItem({ label, children }: { label: string; children: ReactNode }) {
return (
<div className="uc-detail-dossier__item">
<span className="uc-detail-dossier__label">{label}</span>
<span className="uc-detail-dossier__value">{children}</span>
</div>
</div>
</PageShell>
;
)
;
}
}
apps/web/subapps/usedcar/src/pages/Leads/leads.css
View file @
e024080
.uc-lead-reminder
{
margin
:
0
0
12px
;
color
:
var
(
--uj-warning
);
}
.uc-lead-reminder
{
.uc-lead-reminder
strong
{
color
:
var
(
--uj-error
);
font-weight
:
500
;
}
margin
:
0
0
12px
;
.uc-lead-level
{
display
:
inline-flex
;
align-items
:
center
;
gap
:
7px
;
}
color
:
var
(
--uj-warning
);
.uc-lead-level
b
{
display
:
inline-grid
;
place-items
:
center
;
width
:
22px
;
height
:
22px
;
border-radius
:
50%
;
color
:
var
(
--uj-on-primary
);
background
:
var
(
--uj-lead-none
);
}
}
.uc-lead-level--o
b
{
background
:
var
(
--uj-lead-o
);
}
.uc-lead-level--h
b
{
background
:
var
(
--uj-lead-h
);
}
.uc-lead-level--a
b
{
background
:
var
(
--uj-lead-a
);
}
.uc-lead-level--b
b
{
background
:
var
(
--uj-lead-b
);
}
.uc-lead-level--c
b
{
background
:
var
(
--uj-lead-c
);
}
.uc-lead-reminder
strong
{
.uc-lead-detail
{
display
:
grid
;
gap
:
16px
;
}
.uc-lead-detail__top
{
display
:
grid
;
grid-template-columns
:
minmax
(
0
,
1
fr
)
300px
;
gap
:
16px
;
}
.uc-lead-detail__title
{
margin
:
0
0
14px
;
font-size
:
15px
;
}
.uc-lead-detail__empty
{
padding
:
28px
;
text-align
:
center
;
color
:
var
(
--uj-text-3
);
}
.uc-lead-follow
{
display
:
grid
;
gap
:
12px
;
}
.uc-lead-follow__item
{
border-left
:
2px
solid
var
(
--uj-primary
);
padding-left
:
14px
;
}
.uc-lead-follow__head
{
display
:
flex
;
justify-content
:
space-between
;
margin-bottom
:
8px
;
}
.uc-lead-follow__body
{
background
:
var
(
--uj-surface-3
);
padding
:
12px
;
border-radius
:
6px
;
display
:
grid
;
gap
:
6px
;
}
.uc-lead-follow__body
span
{
color
:
var
(
--uj-text-2
);
}
.uc-lead-follow__body
b
{
color
:
var
(
--uj-text-1
);
font-weight
:
400
;
}
color
:
var
(
--uj-error
);
@media
(
max-width
:
900px
)
{
.uc-lead-detail__top
{
grid-template-columns
:
1
fr
;
}
}
font-weight
:
500
;
}
.uc-lead-level
{
display
:
inline-flex
;
align-items
:
center
;
gap
:
7px
;
}
.uc-lead-level
b
{
display
:
inline-grid
;
place-items
:
center
;
width
:
22px
;
height
:
22px
;
border-radius
:
50%
;
color
:
var
(
--uj-on-primary
);
background
:
var
(
--uj-lead-none
);
}
.uc-lead-level--o
b
{
background
:
var
(
--uj-lead-o
);
}
.uc-lead-level--h
b
{
background
:
var
(
--uj-lead-h
);
}
.uc-lead-level--a
b
{
background
:
var
(
--uj-lead-a
);
}
.uc-lead-level--b
b
{
background
:
var
(
--uj-lead-b
);
}
.uc-lead-level--c
b
{
background
:
var
(
--uj-lead-c
);
}
/* 线索详情私有样式。卡片/档案条/时间线等通用部分在 src/styles/detail.css。 */
.uc-lead-follow__body
{
display
:
grid
;
grid-template-columns
:
repeat
(
2
,
minmax
(
0
,
1
fr
));
gap
:
4px
16px
;
margin-top
:
6px
;
color
:
var
(
--uj-text-1
);
font-size
:
var
(
--uj-font-sm
);
line-height
:
1.6
;
overflow-wrap
:
anywhere
;
}
.uc-lead-follow__wide
{
grid-column
:
span
2
;
}
.uc-lead-grade
{
display
:
flex
;
align-items
:
center
;
gap
:
14px
;
}
.uc-lead-grade__badge
{
flex
:
none
;
display
:
inline-grid
;
place-items
:
center
;
width
:
44px
;
height
:
44px
;
border-radius
:
50%
;
color
:
var
(
--uj-on-primary
);
font-size
:
var
(
--uj-font-lg
);
font-weight
:
600
;
background
:
var
(
--uj-lead-none
);
}
.uc-lead-grade__badge--o
{
background
:
var
(
--uj-lead-o
);
}
.uc-lead-grade__badge--h
{
background
:
var
(
--uj-lead-h
);
}
.uc-lead-grade__badge--a
{
background
:
var
(
--uj-lead-a
);
}
.uc-lead-grade__badge--b
{
background
:
var
(
--uj-lead-b
);
}
.uc-lead-grade__badge--c
{
background
:
var
(
--uj-lead-c
);
}
.uc-lead-grade__desc
{
color
:
var
(
--uj-text-1
);
font-size
:
var
(
--uj-font-sm
);
font-weight
:
600
;
line-height
:
1.5
;
}
.uc-lead-grade__next
{
margin-top
:
4px
;
color
:
var
(
--uj-text-3
);
font-size
:
var
(
--uj-font-xs
);
font-variant-numeric
:
var
(
--uj-num
);
}
.uc-lead-remark
{
margin
:
0
;
color
:
var
(
--uj-text-2
);
font-size
:
var
(
--uj-font-sm
);
line-height
:
1.7
;
white-space
:
pre-wrap
;
overflow-wrap
:
anywhere
;
}
@media
(
max-width
:
700px
)
{
.uc-lead-follow__body
{
grid-template-columns
:
1
fr
;
}
.uc-lead-follow__wide
{
grid-column
:
auto
;
}
}
apps/web/subapps/usedcar/src/pages/Operation/ContractDetail.tsx
View file @
e024080
import { useState } from 'react';
import { useState
, type ReactNode
} from 'react';
import { useMutation, useQuery } from '@tanstack/react-query';
import { useMutation, useQuery } from '@tanstack/react-query';
import {
import {
UAlert,
UAlert,
...
@@ -56,8 +56,7 @@ export default function ContractDetail({ params }: { params: PageParams }) {
...
@@ -56,8 +56,7 @@ export default function ContractDetail({ params }: { params: PageParams }) {
});
});
const save = useMutation({
const save = useMutation({
mutationFn: (next: string) =>
mutationFn: (next: string) => contractApi.getContractEdit({ id, description: next }),
contractApi.getContractEdit({ id, description: next }),
onSuccess: () => {
onSuccess: () => {
msg.success('操作成功');
msg.success('操作成功');
goTo('operation');
goTo('operation');
...
@@ -73,10 +72,7 @@ export default function ContractDetail({ params }: { params: PageParams }) {
...
@@ -73,10 +72,7 @@ export default function ContractDetail({ params }: { params: PageParams }) {
subTitle="请联系管理员开通“合同详情”权限。"
subTitle="请联系管理员开通“合同详情”权限。"
/>
/>
);
);
if (!id)
if (!id) return <UResult status="404" title="未找到合同" subTitle="详情地址缺少合同记录 id。" />;
return (
<UResult status="404" title="未找到合同" subTitle="详情地址缺少合同记录 id。" />
);
const data: Detail = detail.data ?? { id };
const data: Detail = detail.data ?? { id };
const signers = parseSigners(data.electronicContractField);
const signers = parseSigners(data.electronicContractField);
...
@@ -125,11 +121,6 @@ export default function ContractDetail({ params }: { params: PageParams }) {
...
@@ -125,11 +121,6 @@ export default function ContractDetail({ params }: { params: PageParams }) {
<PageShell
<PageShell
title="合同详情"
title="合同详情"
description="查看合同状态、合同信息、合同内容、签署人信息与操作记录。"
description="查看合同状态、合同信息、合同内容、签署人信息与操作记录。"
actions={
<UButton type="default" size="small" onClick={() => goTo('operation')}>
返回列表
</UButton>
}
>
>
{detail.isError ? (
{detail.isError ? (
<UAlert
<UAlert
...
@@ -145,55 +136,86 @@ export default function ContractDetail({ params }: { params: PageParams }) {
...
@@ -145,55 +136,86 @@ export default function ContractDetail({ params }: { params: PageParams }) {
/>
/>
) : null}
) : null}
<div className="uc-contract-detail">
<UCard className="uc-detail-card" loading={detail.isPending}>
<UCard>
<div className="uc-detail-dossier">
<h3 className="uc-contract-detail__title">
<div className="uc-detail-dossier__identity">
合同状态
<div className="uc-detail-dossier__name">
<UTag color={dictTone(DICT.status, data.electronicContractStatus)}>
{contractModel(data)}
{dictValue(DICT.status, data.electronicContractStatus)}
<span className="uc-detail-dossier__chip">
</UTag>
{dictValue(DICT.contractType, data.electronicContractType)}
</h3>
</span>
<UDescriptions column={2} size="small">
</div>
<UDescriptions.Item label="合同流转状态">
<div className="uc-detail-dossier__code">评估单编号:{display(data.evalOrderNo)}</div>
{dictValue(DICT.status, data.electronicContractStatus)}
</div>
</UDescriptions.Item>
<div className="uc-detail-dossier__meta">
<UDescriptions.Item label="评估单编号">{display(data.evalOrderNo)}</UDescriptions.Item>
<MetaItem label="合同状态">
<UDescriptions.Item label="合同来源">{dictValue(DICT.source, data.source)}</UDescriptions.Item>
<UTag color={dictTone(DICT.status, data.electronicContractStatus)}>
<UDescriptions.Item label="付款方式">
{dictValue(DICT.status, data.electronicContractStatus)}
</UTag>
</MetaItem>
<MetaItem label="合同来源">{dictValue(DICT.source, data.source)}</MetaItem>
<MetaItem label="付款方式">
{dictValue(DICT.paymentMethod, data.paymentMethod)}
{dictValue(DICT.paymentMethod, data.paymentMethod)}
</UDescriptions.Item>
</MetaItem>
</UDescriptions>
<MetaItem label="合同金额">
<h4 className="uc-contract-detail__subtitle">付款信息</h4>
{oaAudits.length ? (
<UTable<ContractOaAudit>
rowKey={(_, index) => String(index)}
size="small"
pagination={false}
dataSource={oaAudits}
columns={payColumns}
scroll={{ x: 900 }}
/>
) : (
<UEmpty description="暂无付款信息" />
)}
</UCard>
<UCard>
<h3 className="uc-contract-detail__title">合同信息</h3>
<UDescriptions column={2} size="small">
<UDescriptions.Item label="合同类型">
{dictValue(DICT.contractType, data.electronicContractType)}
</UDescriptions.Item>
<UDescriptions.Item label="合同车型">{contractModel(data)}</UDescriptions.Item>
<UDescriptions.Item label="合同模板">{display(data.docTemplateName)}</UDescriptions.Item>
<UDescriptions.Item label="合同金额">
{data.contractPrice === undefined || data.contractPrice === ''
{data.contractPrice === undefined || data.contractPrice === ''
? '-'
? '-'
: `¥${String(data.contractPrice)}`}
: `¥${String(data.contractPrice)}`}
</UDescriptions.Item>
</MetaItem>
<UDescriptions.Item label="合同描述" span={2}>
</div>
</div>
</UCard>
<div className="uc-detail-stack">
<UCard className="uc-detail-card" loading={detail.isPending}>
<CardHead
title="付款信息"
aux={oaAudits.length ? `共 ${oaAudits.length} 笔` : undefined}
/>
<div className="uc-detail-card__body">
{oaAudits.length ? (
<UTable<ContractOaAudit>
rowKey={(_, index) => String(index)}
size="small"
pagination={false}
dataSource={oaAudits}
columns={payColumns}
scroll={{ x: 900 }}
/>
) : (
<UEmpty description="暂无付款信息" />
)}
</div>
</UCard>
<UCard className="uc-detail-card" loading={detail.isPending}>
<CardHead title="合同信息" />
<div className="uc-detail-card__body">
<UDescriptions
className="uc-detail-descriptions"
column={{ xs: 1, sm: 2 }}
styles={{ label: { width: 112, whiteSpace: 'nowrap' } }}
items={[
{
key: 'type',
label: '合同类型',
children: dictValue(DICT.contractType, data.electronicContractType),
},
{ key: 'model', label: '合同车型', children: contractModel(data) },
{ key: 'template', label: '合同模板', children: display(data.docTemplateName) },
{
key: 'price',
label: '合同金额',
children:
data.contractPrice === undefined || data.contractPrice === ''
? '-'
: `¥${String(data.contractPrice)}`,
},
]}
/>
<div className="uc-contract-desc">
<span className="uc-contract-desc__label">合同描述</span>
<UInput.TextArea
<UInput.TextArea
className="uc-contract-detail__desc"
value={currentDescription === '-' ? '' : currentDescription}
value={currentDescription === '-' ? '' : currentDescription}
onChange={(event) => setDescription(event.target.value)}
onChange={(event) => setDescription(event.target.value)}
maxLength={200}
maxLength={200}
...
@@ -201,12 +223,11 @@ export default function ContractDetail({ params }: { params: PageParams }) {
...
@@ -201,12 +223,11 @@ export default function ContractDetail({ params }: { params: PageParams }) {
rows={3}
rows={3}
placeholder="请输入合同描述"
placeholder="请输入合同描述"
/>
/>
</
UDescriptions.Item
>
</
div
>
</
UDescriptions
>
</
div
>
<div className="uc-
contract-detail__actions
">
<div className="uc-
detail-card__foot
">
<UButton
<UButton
type="primary"
type="primary"
size="small"
loading={save.isPending}
loading={save.isPending}
disabled={!currentDescription || currentDescription === '-'}
disabled={!currentDescription || currentDescription === '-'}
onClick={() => void save.mutate(currentDescription === '-' ? '' : currentDescription)}
onClick={() => void save.mutate(currentDescription === '-' ? '' : currentDescription)}
...
@@ -216,119 +237,158 @@ export default function ContractDetail({ params }: { params: PageParams }) {
...
@@ -216,119 +237,158 @@ export default function ContractDetail({ params }: { params: PageParams }) {
</div>
</div>
</UCard>
</UCard>
<UCard>
<UCard className="uc-detail-card" loading={detail.isPending}>
<h3 className="uc-contract-detail__title">合同内容</h3>
<CardHead title="合同内容" />
{fieldItems.length ? (
<div className="uc-detail-card__body">
<div className="uc-contract-detail__fields">
{fieldItems.length ? (
{fieldItems.map((item, index) => {
<div className="uc-contract-fields">
const urls = splitUrls(item.value);
{fieldItems.map((item, index) => {
const type = urls.length ? fileType(urls[0]) : 'unknown';
const urls = splitUrls(item.value);
return (
const type = urls.length ? fileType(urls[0]) : 'unknown';
<div className="uc-contract-detail__field" key={`${String(item.label)}-${index}`}>
<span className="uc-contract-detail__field-label">{display(item.label)}:</span>
<span className="uc-contract-detail__field-value">
{urls.length ? (
urls.map((url, urlIndex) =>
type === 'image' ? (
<img
className="uc-contract-detail__thumb"
key={`${url}-${urlIndex}`}
src={ossThumb(url)}
alt={String(item.label ?? '合同资料')}
onClick={() =>
downloadCenter.url({
source: 'usedcar',
sourceLabel: '二手车管理 / 运营管理 / 合同内容',
label: `${String(item.label ?? '合同资料')} · 图片 ${urlIndex + 1}`,
url,
// 点缩略图是要看原图,不是要把文件存到磁盘。
preview: true,
silent: true,
dedupeKey: `usedcar-contract-field-${url}`,
})
}
/>
) : type === 'video' ? (
<UButton
type="link"
size="small"
key={`${url}-${urlIndex}`}
onClick={() =>
downloadCenter.url({
source: 'usedcar',
sourceLabel: '二手车管理 / 运营管理 / 合同内容',
label: `${String(item.label ?? '合同资料')} · 视频 ${urlIndex + 1}`,
url,
preview: true,
silent: true,
dedupeKey: `usedcar-contract-field-${url}`,
})
}
>
视频 {urlIndex + 1}
</UButton>
) : (
<span key={`${url}-${urlIndex}`}>{url}</span>
),
)
) : (
display(item.value)
)}
</span>
</div>
);
})}
</div>
) : (
<UEmpty description="暂无合同内容" />
)}
</UCard>
<UCard>
<h3 className="uc-contract-detail__title">签署人信息</h3>
{([1, 2] as const).map((side) => (
<div className="uc-contract-detail__signer" key={side}>
<h4 className="uc-contract-detail__subtitle">
{side === 1 ? '甲方' : '乙方'}
</h4>
<UDescriptions column={2} size="small">
{SIGNER_FIELDS.map((field) => {
let value: string;
if (field.kind === 'side') value = side === 1 ? '甲方' : '乙方';
else if (field.kind === 'type') value = signerTypeName(data, side);
else if (field.kind === 'idType') value = '身份证/营业执照';
else {
const key = side === 1 ? field.keyA : field.keyB;
value = display(key ? signers[key] : undefined);
}
return (
return (
<UDescriptions.Item label={field.title} key={field.title}>
<div className="uc-contract-field" key={`${String(item.label)}-${index}`}>
{value}
<span className="uc-contract-field__label">{display(item.label)}</span>
</UDescriptions.Item>
<span className="uc-contract-field__value">
{urls.length
? urls.map((url, urlIndex) =>
type === 'image' ? (
<img
className="uc-contract-field__thumb"
key={`${url}-${urlIndex}`}
src={ossThumb(url)}
alt={String(item.label ?? '合同资料')}
onClick={() =>
downloadCenter.url({
source: 'usedcar',
sourceLabel: '二手车管理 / 运营管理 / 合同内容',
label: `${String(item.label ?? '合同资料')} · 图片 ${urlIndex + 1}`,
url,
// 点缩略图是要看原图,不是要把文件存到磁盘。
preview: true,
silent: true,
dedupeKey: `usedcar-contract-field-${url}`,
})
}
/>
) : type === 'video' ? (
<UButton
type="link"
size="small"
key={`${url}-${urlIndex}`}
onClick={() =>
downloadCenter.url({
source: 'usedcar',
sourceLabel: '二手车管理 / 运营管理 / 合同内容',
label: `${String(item.label ?? '合同资料')} · 视频 ${urlIndex + 1}`,
url,
preview: true,
silent: true,
dedupeKey: `usedcar-contract-field-${url}`,
})
}
>
视频 {urlIndex + 1}
</UButton>
) : (
<span key={`${url}-${urlIndex}`}>{url}</span>
),
)
: display(item.value)}
</span>
</div>
);
);
})}
})}
</UDescriptions>
</div>
</div>
) : (
))}
<UEmpty description="暂无合同内容" />
)}
</div>
</UCard>
</UCard>
<UCard>
<UCard className="uc-detail-card" loading={detail.isPending}>
<h3 className="uc-contract-detail__title">操作记录</h3>
<CardHead title="签署人信息" />
{logs.length ? (
<div className="uc-detail-card__body">
<div className="uc-contract-detail__logs">
<div className="uc-contract-signers">
{logs.map((item, index) => (
{([1, 2] as const).map((side) => (
<div className="uc-contract-detail__log" key={`${String(item.createdDate)}-${index}`}>
<div className="uc-contract-signer" key={side}>
<b>{logTypeName(item.opType)}</b>
<div className="uc-contract-signer__head">
<span>操作人:{display(item.createdBy)}</span>
{side === 1 ? '甲方' : '乙方'}
<span>操作时间:{display(item.createdDate)}</span>
<span className="uc-contract-signer__type">{signerTypeName(data, side)}</span>
</div>
<UDescriptions
className="uc-detail-descriptions"
column={1}
styles={{ label: { width: 110, whiteSpace: 'nowrap' } }}
items={SIGNER_FIELDS.map((field) => {
let value: string;
if (field.kind === 'side') value = side === 1 ? '甲方' : '乙方';
else if (field.kind === 'type') value = signerTypeName(data, side);
else if (field.kind === 'idType') value = '身份证/营业执照';
else {
const key = side === 1 ? field.keyA : field.keyB;
value = display(key ? signers[key] : undefined);
}
return { key: field.title, label: field.title, children: value };
})}
/>
</div>
</div>
))}
))}
</div>
</div>
) : (
</div>
<UEmpty description="暂无操作记录" />
</UCard>
)}
<UCard className="uc-detail-card" loading={detail.isPending}>
<CardHead title="操作记录" aux={logs.length ? `共 ${logs.length} 条` : undefined} />
<div className="uc-detail-card__body">
{logs.length ? (
<div className="uc-detail-timeline">
{logs.map((item, index) => (
<div
className="uc-detail-timeline__item"
key={`${String(item.createdDate)}-${index}`}
>
<span className="uc-detail-timeline__marker" />
<div>
<div className="uc-detail-timeline__head">
<span className="uc-detail-timeline__title">
{logTypeName(item.opType)}
</span>
<span className="uc-detail-timeline__time">
{display(item.createdDate)}
</span>
</div>
<div className="uc-detail-timeline__body">
<div>
<span className="uc-detail-timeline__label">操作人:</span>
{display(item.createdBy)}
</div>
</div>
</div>
</div>
))}
</div>
) : (
<UEmpty description="暂无操作记录" />
)}
</div>
</UCard>
</UCard>
</div>
</div>
</PageShell>
</PageShell>
);
);
}
}
function CardHead({ title, aux }: { title: string; aux?: string }) {
return (
<div className="uc-detail-card__head">
<h2 className="uc-detail-card__title">{title}</h2>
{aux ? <span className="uc-detail-card__aux">{aux}</span> : null}
</div>
);
}
function MetaItem({ label, children }: { label: string; children: ReactNode }) {
return (
<div className="uc-detail-dossier__item">
<span className="uc-detail-dossier__label">{label}</span>
<span className="uc-detail-dossier__value">{children}</span>
</div>
);
}
apps/web/subapps/usedcar/src/pages/Operation/ContractEdit.tsx
View file @
e024080
...
@@ -20,6 +20,7 @@ import { UC } from '@/permissions/codes';
...
@@ -20,6 +20,7 @@ import { UC } from '@/permissions/codes';
import type { PageParams } from '@/routes';
import type { PageParams } from '@/routes';
import { errorDetail } from '@/utils/error';
import { errorDetail } from '@/utils/error';
import { goTo } from '../Leads/navigate';
import { goTo } from '../Leads/navigate';
import './contractDetail.css';
/**
/**
* 合同编辑独立页(源 contract/edit.vue):
* 合同编辑独立页(源 contract/edit.vue):
...
...
apps/web/subapps/usedcar/src/pages/Operation/components/SunshineDetailDrawer.tsx
0 → 100644
View file @
e024080
import type { ReactNode } from 'react';
import { useQuery } from '@tanstack/react-query';
import { UAlert, UCard, UDrawer, UEmpty, UTable } from '@uj/ui';
import { operationApi, type Sunshine } from '@/api';
/** 空值统一占位(与 usedcar 其它页面 text() 一致)。 */
const text = (value: unknown): string =>
value === undefined || value === null || value === '' ? '-' : String(value);
/** 源 constants.js vehicleCategoryOpt:carType 存 confId,展示 confValue。 */
const CAR_TYPE_LABEL: Record<string, string> = { '1': '置换车', '2': '报废车' };
type LogRow = {
operator?: string;
operateTime?: string;
operateContent?: string;
[key: string]: unknown;
};
const LOG_COLUMNS = [
{ title: '操作人', dataIndex: 'operator', render: text },
{ title: '操作时间', dataIndex: 'operateTime', render: text },
{ title: '操作内容', dataIndex: 'operateContent', render: text },
];
/**
* 阳光激励详情抽屉:与源 sunshine/components/detail.vue 一致,
* 打开时并行拉详情(details)与操作日志(log/page),不再拿列表行数据充当详情。
*/
export default function SunshineDetailDrawer({
record,
onClose,
}: {
record: Sunshine | null;
onClose: () => void;
}) {
const id = record?.id ?? '';
const detail = useQuery({
queryKey: ['op', 'sun', 'detail', id],
queryFn: () => operationApi.sunshineDetail(id),
enabled: Boolean(id),
});
const logs = useQuery({
queryKey: ['op', 'sun', 'log', id],
queryFn: () => operationApi.sunshineLog(id),
enabled: Boolean(id),
});
const data: Partial<Sunshine> = detail.data ?? record ?? {};
const logRows: LogRow[] = Array.isArray(logs.data) ? (logs.data as LogRow[]) : [];
return (
<UDrawer
open={Boolean(record)}
title="阳光激励详情"
size={640}
onClose={onClose}
styles={{
body: {
padding: 16,
background: 'var(--uj-bg)',
display: 'flex',
flexDirection: 'column',
gap: 'var(--uj-space-module)',
},
}}
>
{detail.isError ? <UAlert type="error" showIcon title="详情加载失败" /> : null}
<UCard className="uc-detail-card" loading={detail.isPending}>
<div className="uc-detail-dossier">
<div className="uc-detail-dossier__identity">
<div className="uc-detail-dossier__name">
{text(data.sellerMerchantName)}
<span className="uc-detail-dossier__chip">
{CAR_TYPE_LABEL[String(data.carType)] ?? text(data.carType)}
</span>
</div>
</div>
<div className="uc-detail-dossier__meta">
<MetaItem label="激励价格">
{data.sunlightInspiresPrice === undefined
? '-'
: `${String(data.sunlightInspiresPrice)}元`}
</MetaItem>
<MetaItem label="录入时间">{text(data.createdDate)}</MetaItem>
</div>
</div>
</UCard>
<UCard className="uc-detail-card">
<div className="uc-detail-card__head">
<h2 className="uc-detail-card__title">操作日志</h2>
{logRows.length ? (
<span className="uc-detail-card__aux">共 {logRows.length} 条</span>
) : null}
</div>
<div className="uc-detail-card__body">
{logRows.length ? (
<UTable<LogRow>
rowKey={(_, index) => String(index)}
size="small"
pagination={false}
dataSource={logRows}
columns={LOG_COLUMNS}
loading={logs.isPending || logs.isFetching}
/>
) : (
<UEmpty description="暂无操作日志" />
)}
</div>
</UCard>
</UDrawer>
);
}
function MetaItem({ label, children }: { label: string; children: ReactNode }) {
return (
<div className="uc-detail-dossier__item">
<span className="uc-detail-dossier__label">{label}</span>
<span className="uc-detail-dossier__value">{children}</span>
</div>
);
}
apps/web/subapps/usedcar/src/pages/Operation/components/SunshineTab.tsx
View file @
e024080
...
@@ -13,7 +13,7 @@ import { dashboardApi, operationApi, type StoreItem, type Sunshine } from '@/api
...
@@ -13,7 +13,7 @@ import { dashboardApi, operationApi, type StoreItem, type Sunshine } from '@/api
import { UC } from '@/permissions/codes';
import { UC } from '@/permissions/codes';
import { SUNSHINE_COLUMNS } from './tableConfig';
import { SUNSHINE_COLUMNS } from './tableConfig';
import SunshineFormModal from './SunshineFormModal';
import SunshineFormModal from './SunshineFormModal';
import SunshineDetail
Modal from './SunshineDetailModal
';
import SunshineDetail
Drawer from './SunshineDetailDrawer
';
import { downloadCenter } from '@uj/platform-sdk';
import { downloadCenter } from '@uj/platform-sdk';
import { errorDetail } from '@/utils/error';
import { errorDetail } from '@/utils/error';
...
@@ -155,7 +155,7 @@ export default function SunshineTab() {
...
@@ -155,7 +155,7 @@ export default function SunshineTab() {
/>
/>
</UCard>
</UCard>
<SunshineFormModal record={edit} onClose={() => setEdit(null)} onSaved={reload} />
<SunshineFormModal record={edit} onClose={() => setEdit(null)} onSaved={reload} />
<SunshineDetail
Modal
record={detail} onClose={() => setDetail(null)} />
<SunshineDetail
Drawer
record={detail} onClose={() => setDetail(null)} />
<ConfirmModal
<ConfirmModal
open={Boolean(pendingDelete)}
open={Boolean(pendingDelete)}
content="请确认是否要执行当前操作?删除后不可恢复。"
content="请确认是否要执行当前操作?删除后不可恢复。"
...
...
apps/web/subapps/usedcar/src/pages/Operation/contractDetail.css
View file @
e024080
.uc-contract-detail
{
display
:
grid
;
gap
:
16px
;
}
/* 合同详情私有样式。卡片/档案条/时间线等通用部分在 src/styles/detail.css。 */
.uc-contract-detail__title
{
display
:
flex
;
align-items
:
center
;
gap
:
10px
;
margin
:
0
0
16px
;
font-size
:
15px
;
}
.uc-contract-detail__subtitle
{
margin
:
16px
0
8px
;
font-size
:
13px
;
color
:
var
(
--uj-text-2
);
}
/* ContractEdit(合同编辑页)也复用这两个类,保持其原有观感。 */
.uc-contract-detail__desc
{
max-width
:
100%
;
}
.uc-contract-detail
{
.uc-contract-detail__actions
{
display
:
flex
;
justify-content
:
flex-end
;
margin-top
:
12px
;
}
display
:
grid
;
.uc-contract-detail__fields
{
display
:
grid
;
gap
:
12px
;
}
gap
:
var
(
--uj-space-module
);
.uc-contract-detail__field
{
display
:
grid
;
grid-template-columns
:
140px
minmax
(
0
,
1
fr
);
gap
:
8px
;
align-items
:
start
;
}
}
.uc-contract-detail__field-label
{
color
:
var
(
--uj-text-2
);
}
.uc-contract-detail__title
{
.uc-contract-detail__field-value
{
display
:
flex
;
flex-wrap
:
wrap
;
gap
:
8px
;
align-items
:
center
;
}
display
:
flex
;
.uc-contract-detail__thumb
{
width
:
72px
;
height
:
72px
;
object-fit
:
cover
;
border-radius
:
6px
;
cursor
:
zoom-in
;
border
:
1px
solid
var
(
--uj-border
,
#e5e7eb
);
}
align-items
:
center
;
.uc-contract-detail__signer
+
.uc-contract-detail__signer
{
margin-top
:
8px
;
}
gap
:
10px
;
.uc-contract-detail__logs
{
display
:
grid
;
gap
:
10px
;
}
margin
:
0
0
16px
;
.uc-contract-detail__log
{
display
:
flex
;
gap
:
20px
;
align-items
:
center
;
border-left
:
2px
solid
var
(
--uj-primary
);
padding-left
:
14px
;
color
:
var
(
--uj-text-2
);
}
font-size
:
var
(
--uj-font-lg
);
.uc-contract-detail__log
b
{
color
:
var
(
--uj-text-1
);
font-weight
:
500
;
}
}
.uc-contract-desc
{
display
:
grid
;
gap
:
6px
;
margin-top
:
12px
;
}
.uc-contract-desc__label
{
color
:
var
(
--uj-text-3
);
font-size
:
var
(
--uj-font-sm
);
}
.uc-contract-fields
{
display
:
grid
;
gap
:
12px
;
}
.uc-contract-field
{
display
:
grid
;
grid-template-columns
:
140px
minmax
(
0
,
1
fr
);
gap
:
8px
;
align-items
:
start
;
}
.uc-contract-field__label
{
color
:
var
(
--uj-text-3
);
font-size
:
var
(
--uj-font-sm
);
line-height
:
1.6
;
}
.uc-contract-field__value
{
display
:
flex
;
flex-wrap
:
wrap
;
gap
:
8px
;
align-items
:
center
;
color
:
var
(
--uj-text-1
);
font-size
:
var
(
--uj-font-sm
);
line-height
:
1.6
;
overflow-wrap
:
anywhere
;
}
.uc-contract-field__thumb
{
width
:
88px
;
height
:
88px
;
object-fit
:
cover
;
border-radius
:
var
(
--uj-radius-md
);
cursor
:
zoom-in
;
border
:
1px
solid
var
(
--uj-border
);
transition
:
border-color
0.2s
;
}
.uc-contract-field__thumb
:hover
{
border-color
:
var
(
--uj-border-strong
);
}
/* 甲乙双方并排软面板:淡底无边框,不与卡片外框抢线。 */
.uc-contract-signers
{
display
:
grid
;
grid-template-columns
:
repeat
(
2
,
minmax
(
0
,
1
fr
));
gap
:
12px
;
}
.uc-contract-signer
{
padding
:
12px
16px
;
background
:
var
(
--uj-surface-2
);
border-radius
:
var
(
--uj-radius-lg
);
}
.uc-contract-signer__head
{
display
:
flex
;
align-items
:
center
;
gap
:
8px
;
margin-bottom
:
10px
;
color
:
var
(
--uj-text-1
);
font-size
:
var
(
--uj-font-sm
);
font-weight
:
600
;
}
.uc-contract-signer__type
{
padding
:
1px
8px
;
color
:
var
(
--uj-text-3
);
font-size
:
var
(
--uj-font-xs
);
font-weight
:
normal
;
background
:
var
(
--uj-surface
);
border
:
1px
solid
var
(
--uj-border
);
border-radius
:
var
(
--uj-radius-sm
);
}
@media
(
max-width
:
900px
)
{
@media
(
max-width
:
900px
)
{
.uc-contract-detail__field
{
grid-template-columns
:
1
fr
;
}
.uc-contract-signers
{
.uc-contract-detail__log
{
flex-direction
:
column
;
gap
:
4px
;
}
grid-template-columns
:
1
fr
;
}
.uc-contract-field
{
grid-template-columns
:
1
fr
;
gap
:
2px
;
}
}
}
apps/web/subapps/usedcar/src/pages/Vehicles/VehicleDetail.tsx
View file @
e024080
import { useEffect, useMemo, useState } from 'react';
import { useEffect, useMemo, useState
, type ReactNode
} from 'react';
import { useQuery } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query';
import dayjs, { type Dayjs } from 'dayjs';
import dayjs, { type Dayjs } from 'dayjs';
import { UAlert, UButton, UCard, UDatePicker, UForm, UModal, UResult, useUMessage } from '@uj/ui';
import { UAlert, UButton, UCard, UDatePicker, UForm, UModal, UResult, useUMessage } from '@uj/ui';
...
@@ -245,138 +245,177 @@ export default function VehicleDetail({ params }: { params: PageParams }) {
...
@@ -245,138 +245,177 @@ export default function VehicleDetail({ params }: { params: PageParams }) {
description={errorDetail(detail.error)}
description={errorDetail(detail.error)}
/>
/>
) : null}
) : null}
<div className="uc-vehicle-detail">
<UCard className="uc-detail-card" loading={detail.isPending}>
{editing ? (
<div className="uc-detail-dossier">
<UCard>
<div className="uc-detail-dossier__identity">
<CombiForm
<div className="uc-detail-dossier__name">
mode="form"
{display(data.carTypeName)}
form={form}
{data.licensePlate ? (
fields={editFields}
<span className="uc-detail-dossier__chip">{String(data.licensePlate)}</span>
initialValues={{}}
) : null}
layout="horizontal"
</div>
labelWidth={128}
<div className="uc-detail-dossier__code">车源号:{display(data.sourceNo)}</div>
sectionContentStyle={{
</div>
display: 'grid',
<div className="uc-detail-dossier__meta">
gridTemplateColumns: 'repeat(2, minmax(0, 1fr))',
<MetaItem label="车辆状态">{statusLabel(currentStatus)}</MetaItem>
columnGap: 24,
<MetaItem label="车辆来源门店">{display(data.sourceStoreName)}</MetaItem>
}}
<MetaItem label="车辆创建时间">{display(data.createTime)}</MetaItem>
renderSectionTitle={(title) => (
</div>
<h3 className="uc-vehicle-detail__section-title">{title}</h3>
</div>
)}
</UCard>
renderControl={(field) =>
<div className="uc-detail-split">
field.name === 'sellingTime' ? <UDatePicker disabled={!sold} /> : undefined
<div className="uc-detail-split__main">
}
{editing ? (
onSubmit={() => setConfirmOpen(true)}
<UCard className="uc-detail-card">
/>
<CardHead title="编辑车辆信息" />
</UCard>
<div className="uc-detail-card__body">
) : null}
<CombiForm
{!editing ? (
mode="form"
<UCard title="车辆状态与保管信息">
form={form}
<CombiForm
fields={editFields}
mode="detail"
initialValues={{}}
detailColumns={2}
layout="horizontal"
labelWidth={128}
labelWidth={128}
fields={[
sectionContentStyle={{
{ name: 'carStatus', label: '车辆状态', type: 'input', render: statusLabel },
display: 'grid',
{ name: 'carCreator', label: '车辆创建人', type: 'input', render: display },
gridTemplateColumns: 'repeat(2, minmax(0, 1fr))',
{ name: 'storageLocation', label: '保管地', type: 'input', render: display },
columnGap: 24,
{ name: 'custodian', label: '保管人', type: 'input', render: display },
}}
{
renderSectionTitle={(title) => <h3 className="uc-vehicle-section">{title}</h3>}
name: 'custodyContract',
renderControl={(field) =>
label: '代保管合同',
field.name === 'sellingTime' ? <UDatePicker disabled={!sold} /> : undefined
type: 'input',
}
render: (value) => <FilePreview value={value} />,
onSubmit={() => setConfirmOpen(true)}
},
/>
{
</div>
name: 'deliveryConfirmation',
<div className="uc-detail-card__foot">
label: '交车确认书',
<UButton type="default" onClick={() => goTo('vehicles')}>
type: 'input',
关闭
render: (value) => <FilePreview value={value} />,
</UButton>
},
<UButton type="primary" loading={saving} onClick={() => form.submit()}>
{
保存
name: 'supplementaryAgreement',
</UButton>
label: '补充协议',
</div>
type: 'input',
</UCard>
render: (value) => <FilePreview value={value} />,
) : null}
},
<UCard className="uc-detail-card" loading={detail.isPending}>
]}
<CardHead title="车辆信息" />
initialValues={data}
<div className="uc-detail-card__body">
/>
<div className="uc-detail-descriptions">
<CombiForm
mode="detail"
detailColumns={2}
labelWidth={128}
fields={readFields([
['licensePlate', '车牌号'],
['vin', '车架号'],
['sourceNo', '车源号'],
['carTypeName', '车型'],
['listingDate', '上牌时间'],
['listingCity', '上牌城市'],
['mileage', '表显里程'],
['usageType', '使用性质'],
['ownerType', '所有人性质'],
['hasAccident', '是否事故'],
['sunroof', '天窗'],
['sourceStoreName', '车辆来源门店'],
['createTime', '车辆创建时间'],
['originalOwner', '原车主姓名'],
['ownerContact', '原车主联系方式'],
['insuranceExpiry', '交强险到期日'],
['inspectionExpiry', '年审到期日'],
['msrp', '新车指导价'],
['productionDate', '车辆生产日期'],
['source', '车辆来源'],
['vehicleNotes', '车辆备注'],
])}
initialValues={data}
/>
</div>
</div>
</UCard>
</UCard>
) : null}
<UCard title="车辆采购与卖出信息">
<CombiForm
mode="detail"
detailColumns={2}
labelWidth={128}
fields={readFields([
['purchasePrice', '收车价'],
['purchaseTime', '收车时间'],
['sellingPrice', '卖出价'],
['sellingTime', '卖出时间'],
['seller', '卖出方'],
['sellingNotes', '车辆卖出备注'],
])}
initialValues={data}
/>
</UCard>
<UCard title="车辆信息">
<CombiForm
mode="detail"
detailColumns={2}
labelWidth={128}
fields={readFields([
['licensePlate', '车牌号'],
['vin', '车架号'],
['sourceNo', '车源号'],
['carTypeName', '车型'],
['listingDate', '上牌时间'],
['listingCity', '上牌城市'],
['mileage', '表显里程'],
['usageType', '使用性质'],
['ownerType', '所有人性质'],
['hasAccident', '是否事故'],
['sunroof', '天窗'],
['sourceStoreName', '车辆来源门店'],
['createTime', '车辆创建时间'],
['originalOwner', '原车主姓名'],
['ownerContact', '原车主联系方式'],
['insuranceExpiry', '交强险到期日'],
['inspectionExpiry', '年审到期日'],
['msrp', '新车指导价'],
['productionDate', '车辆生产日期'],
['source', '车辆来源'],
['vehicleNotes', '车辆备注'],
])}
initialValues={data}
/>
</UCard>
<UCard title="牌证信息">
<CombiForm
mode="detail"
detailColumns={2}
labelWidth={128}
fields={readFields([
['keyCode', '钥匙编码'],
['keyCount', '钥匙数'],
['transfersNumber', '过户次数'],
])}
initialValues={data}
/>
</UCard>
</div>
{editing ? (
<div className="uc-vehicle-detail-actions">
<UButton type="primary" loading={saving} onClick={() => form.submit()}>
保存
</UButton>
<UButton onClick={() => goTo('vehicles')}>关闭</UButton>
</div>
</div>
) : (
<div className="uc-detail-split__rail">
<div className="uc-vehicle-detail-actions">
{!editing ? (
<UButton onClick={() => goTo('vehicles')}>返回</UButton>
<UCard className="uc-detail-card" loading={detail.isPending}>
<CardHead title="车辆状态与保管信息" />
<div className="uc-detail-card__body">
<div className="uc-detail-descriptions">
<CombiForm
mode="detail"
detailColumns={1}
labelWidth={110}
fields={[
{ name: 'carStatus', label: '车辆状态', type: 'input', render: statusLabel },
{ name: 'carCreator', label: '车辆创建人', type: 'input', render: display },
{ name: 'storageLocation', label: '保管地', type: 'input', render: display },
{ name: 'custodian', label: '保管人', type: 'input', render: display },
{
name: 'custodyContract',
label: '代保管合同',
type: 'input',
render: (value) => <FilePreview value={value} />,
},
{
name: 'deliveryConfirmation',
label: '交车确认书',
type: 'input',
render: (value) => <FilePreview value={value} />,
},
{
name: 'supplementaryAgreement',
label: '补充协议',
type: 'input',
render: (value) => <FilePreview value={value} />,
},
]}
initialValues={data}
/>
</div>
</div>
</UCard>
) : null}
<UCard className="uc-detail-card" loading={detail.isPending}>
<CardHead title="车辆采购与卖出信息" />
<div className="uc-detail-card__body">
<div className="uc-detail-descriptions">
<CombiForm
mode="detail"
detailColumns={1}
labelWidth={110}
fields={readFields([
['purchasePrice', '收车价'],
['purchaseTime', '收车时间'],
['sellingPrice', '卖出价'],
['sellingTime', '卖出时间'],
['seller', '卖出方'],
['sellingNotes', '车辆卖出备注'],
])}
initialValues={data}
/>
</div>
</div>
</UCard>
<UCard className="uc-detail-card" loading={detail.isPending}>
<CardHead title="牌证信息" />
<div className="uc-detail-card__body">
<div className="uc-detail-descriptions">
<CombiForm
mode="detail"
detailColumns={1}
labelWidth={110}
fields={readFields([
['keyCode', '钥匙编码'],
['keyCount', '钥匙数'],
['transfersNumber', '过户次数'],
])}
initialValues={data}
/>
</div>
</div>
</UCard>
</div>
</div>
)}
</div>
<UModal
<UModal
open={confirmOpen}
open={confirmOpen}
title="提示"
title="提示"
...
@@ -389,3 +428,18 @@ export default function VehicleDetail({ params }: { params: PageParams }) {
...
@@ -389,3 +428,18 @@ export default function VehicleDetail({ params }: { params: PageParams }) {
</PageShell>
</PageShell>
);
);
}
}
function CardHead({ title }: { title: string }) {
return (
<div className="uc-detail-card__head">
<h2 className="uc-detail-card__title">{title}</h2>
</div>
);
}
function MetaItem({ label, children }: { label: string; children: ReactNode }) {
return (
<div className="uc-detail-dossier__item">
<span className="uc-detail-dossier__label">{label}</span>
<span className="uc-detail-dossier__value">{children}</span>
</div>
);
}
apps/web/subapps/usedcar/src/pages/Vehicles/vehicles.css
View file @
e024080
...
@@ -6,35 +6,34 @@
...
@@ -6,35 +6,34 @@
border-radius
:
4px
;
border-radius
:
4px
;
background
:
var
(
--ant-color-fill-quaternary
);
background
:
var
(
--ant-color-fill-quaternary
);
}
}
.uc-vehicle-detail
{
/* 编辑表单的分节标题:与卡头同一套竖签语言,但弱一级。 */
display
:
grid
;
.uc-vehicle-section
{
gap
:
16px
;
}
.uc-vehicle-detail
.ant-descriptions-view
>
table
{
width
:
100%
;
table-layout
:
fixed
;
}
.uc-vehicle-detail
.ant-descriptions-item-label
{
width
:
128px
;
min-width
:
128px
;
white-space
:
nowrap
;
}
.uc-vehicle-detail-actions
{
display
:
flex
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
gap
:
12px
;
gap
:
8px
;
margin-top
:
16px
;
}
.uc-vehicle-detail__section-title
{
margin
:
0
0
16px
;
margin
:
0
0
16px
;
padding-bottom
:
12px
;
color
:
var
(
--uj-text-1
);
border-bottom
:
1px
solid
var
(
--ant-color-border-secondary
);
font-size
:
var
(
--uj-font-md
);
font-size
:
16px
;
font-weight
:
600
;
}
.uc-vehicle-section
::before
{
content
:
''
;
flex
:
none
;
width
:
3px
;
height
:
12px
;
border-radius
:
1px
;
background
:
var
(
--uj-border-strong
);
}
/* 后续分节与上一节之间用通长发丝线分开(标题是每个 section 的首个子节点)。 */
form
>
section
+
section
>
.uc-vehicle-section
{
margin-top
:
8px
;
padding-top
:
16px
;
border-top
:
1px
solid
var
(
--uj-divider
);
}
}
.uc-vehicle-file
{
.uc-vehicle-file
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
width
:
24
0px
;
max-width
:
26
0px
;
min-width
:
0
;
min-width
:
0
;
}
}
.uc-vehicle-file__name
{
.uc-vehicle-file__name
{
...
...
apps/web/subapps/usedcar/src/styles/detail.css
0 → 100644
View file @
e024080
/* ============ 详情页共享样式层 ============
线只有一种粗细(1px)、两种颜色:卡片外框 --uj-border,卡头/卡脚分隔 --uj-divider,
且一律通长。区块之间靠卡片边界与模块间距分开,不用粗色条、列边框或半截线。
车况/评估/合同/车辆/交付/线索/离职继承的详情共用这一套,页面私有样式留在各自 css。 */
.uc-detail-stack
{
display
:
grid
;
gap
:
var
(
--uj-space-module
);
min-width
:
0
;
}
/* 主栏 + 右栏按 1.6:1 比例分宽:右栏要放得下单列长字段(编号/时间/地址),
固定窄栏会把内容挤成逐字换行。窄屏收为单列。 */
.uc-detail-split
{
display
:
grid
;
grid-template-columns
:
minmax
(
0
,
1.6
fr
)
minmax
(
340px
,
1
fr
);
gap
:
var
(
--uj-space-module
);
align-items
:
start
;
}
.uc-detail-split__main
,
.uc-detail-split__rail
{
display
:
grid
;
gap
:
var
(
--uj-space-module
);
min-width
:
0
;
}
/* ---- 卡片解剖:头(标题+辅助+动作)/ 体 / 脚,所有卡同一套 ---- */
.uc-detail-card
>
.ant-card-body
{
padding
:
0
;
}
.uc-detail-card__head
{
display
:
flex
;
align-items
:
center
;
gap
:
8px
;
min-height
:
48px
;
padding
:
8px
16px
;
border-bottom
:
1px
solid
var
(
--uj-divider
);
}
/* 收起/空态时卡头是最后一个节点:去掉底线,避免与卡片外框叠出双线。 */
.uc-detail-card__head
:last-child
{
border-bottom
:
0
;
}
.uc-detail-card__title
{
display
:
flex
;
align-items
:
center
;
gap
:
8px
;
margin
:
0
;
color
:
var
(
--uj-text-1
);
font-size
:
var
(
--uj-font-lg
);
font-weight
:
600
;
line-height
:
1.4
;
}
.uc-detail-card__title
::before
{
content
:
''
;
flex
:
none
;
width
:
3px
;
height
:
14px
;
border-radius
:
1px
;
background
:
var
(
--uj-primary
);
}
.uc-detail-card__aux
{
color
:
var
(
--uj-text-3
);
font-size
:
var
(
--uj-font-xs
);
font-variant-numeric
:
var
(
--uj-num
);
white-space
:
nowrap
;
}
.uc-detail-card__actions
{
display
:
flex
;
align-items
:
center
;
gap
:
4px
;
margin-left
:
auto
;
}
.uc-detail-card__body
{
padding
:
16px
;
}
.uc-detail-card__foot
{
display
:
flex
;
justify-content
:
flex-end
;
gap
:
8px
;
padding
:
12px
16px
;
border-top
:
1px
solid
var
(
--uj-divider
);
}
/* ---- 档案条:主体名称 + 标志芯片 + 编号 | 状态 / 关键元信息 ---- */
.uc-detail-dossier
{
display
:
flex
;
flex-wrap
:
wrap
;
align-items
:
center
;
justify-content
:
space-between
;
gap
:
12px
32px
;
padding
:
12px
16px
;
}
.uc-detail-dossier__identity
{
display
:
grid
;
gap
:
4px
;
min-width
:
0
;
}
.uc-detail-dossier__name
{
display
:
flex
;
flex-wrap
:
wrap
;
align-items
:
center
;
gap
:
8px
;
color
:
var
(
--uj-text-1
);
font-size
:
var
(
--uj-font-lg
);
font-weight
:
600
;
line-height
:
1.4
;
overflow-wrap
:
anywhere
;
}
.uc-detail-dossier__chip
{
flex
:
none
;
padding
:
2px
8px
;
color
:
var
(
--uj-text-1
);
font-size
:
var
(
--uj-font-xs
);
font-weight
:
600
;
font-variant-numeric
:
var
(
--uj-num
);
letter-spacing
:
0.4px
;
background
:
var
(
--uj-surface-2
);
border
:
1px
solid
var
(
--uj-border-strong
);
border-radius
:
var
(
--uj-radius-sm
);
}
.uc-detail-dossier__code
{
color
:
var
(
--uj-text-3
);
font-size
:
var
(
--uj-font-xs
);
font-variant-numeric
:
var
(
--uj-num
);
}
.uc-detail-dossier__meta
{
display
:
flex
;
flex-wrap
:
wrap
;
align-items
:
flex-start
;
gap
:
12px
28px
;
}
.uc-detail-dossier__item
{
display
:
grid
;
gap
:
4px
;
}
.uc-detail-dossier__label
{
color
:
var
(
--uj-text-3
);
font-size
:
var
(
--uj-font-xs
);
line-height
:
1.4
;
}
.uc-detail-dossier__value
{
display
:
flex
;
align-items
:
center
;
gap
:
6px
;
color
:
var
(
--uj-text-1
);
font-size
:
var
(
--uj-font-sm
);
line-height
:
1.5
;
font-variant-numeric
:
var
(
--uj-num
);
}
/* ---- 状态点:列表与详情共用同一套色调判定 ---- */
.uc-detail-status
{
display
:
inline-flex
;
align-items
:
center
;
gap
:
8px
;
color
:
var
(
--uj-text-2
);
}
.uc-detail-status
::before
{
content
:
''
;
width
:
6px
;
height
:
6px
;
border-radius
:
50%
;
background
:
var
(
--uj-text-4
);
}
.uc-detail-status--success
::before
{
background
:
var
(
--uj-primary
);
}
.uc-detail-status--pending
::before
{
background
:
var
(
--uj-text-4
);
}
.uc-detail-status--progress
::before
{
background
:
var
(
--uj-warning
);
}
.uc-detail-status--failed
::before
{
background
:
var
(
--uj-error
);
}
/* ---- 只读描述表:标签弱化、值强调,行距统一,末行不留底距 ---- */
.uc-detail-descriptions
.ant-descriptions-view
>
table
{
width
:
100%
;
table-layout
:
fixed
;
}
.uc-detail-descriptions
.ant-descriptions-item-label
{
color
:
var
(
--uj-text-3
);
font-size
:
var
(
--uj-font-sm
);
vertical-align
:
top
;
padding-bottom
:
12px
;
}
.uc-detail-descriptions
.ant-descriptions-item-content
{
color
:
var
(
--uj-text-1
);
font-size
:
var
(
--uj-font-sm
);
vertical-align
:
top
;
padding-bottom
:
12px
;
overflow-wrap
:
anywhere
;
}
.uc-detail-descriptions
.ant-descriptions-row
:last-child
>
td
{
padding-bottom
:
0
;
}
/* ---- 时间线:8px 圆点 + 1px 竖线,替代粗左边框块 ---- */
.uc-detail-timeline
{
display
:
grid
;
}
.uc-detail-timeline__item
{
display
:
grid
;
grid-template-columns
:
16px
minmax
(
0
,
1
fr
);
column-gap
:
12px
;
padding-bottom
:
16px
;
}
.uc-detail-timeline__item
:last-child
{
padding-bottom
:
0
;
}
.uc-detail-timeline__marker
{
position
:
relative
;
}
.uc-detail-timeline__marker
::before
{
content
:
''
;
position
:
absolute
;
top
:
5px
;
left
:
50%
;
width
:
8px
;
height
:
8px
;
border-radius
:
50%
;
background
:
var
(
--uj-primary
);
box-shadow
:
0
0
0
3px
var
(
--uj-primary-soft
);
translate
:
-50%
0
;
}
.uc-detail-timeline__marker
::after
{
content
:
''
;
position
:
absolute
;
top
:
18px
;
bottom
:
-16px
;
left
:
50%
;
width
:
1px
;
background
:
var
(
--uj-divider
);
}
.uc-detail-timeline__item
:last-child
.uc-detail-timeline__marker
::after
{
content
:
none
;
}
.uc-detail-timeline__head
{
display
:
flex
;
flex-wrap
:
wrap
;
align-items
:
baseline
;
justify-content
:
space-between
;
gap
:
4px
12px
;
}
.uc-detail-timeline__title
{
color
:
var
(
--uj-text-1
);
font-size
:
var
(
--uj-font-sm
);
font-weight
:
600
;
line-height
:
1.5
;
}
.uc-detail-timeline__time
{
color
:
var
(
--uj-text-3
);
font-size
:
var
(
--uj-font-xs
);
font-variant-numeric
:
var
(
--uj-num
);
white-space
:
nowrap
;
}
.uc-detail-timeline__body
{
display
:
grid
;
gap
:
4px
;
margin-top
:
6px
;
color
:
var
(
--uj-text-2
);
font-size
:
var
(
--uj-font-sm
);
line-height
:
1.6
;
overflow-wrap
:
anywhere
;
}
.uc-detail-timeline__label
{
color
:
var
(
--uj-text-3
);
}
/* ---- 同一卡片内多轮记录:通长发丝线分隔 ---- */
.uc-detail-block
+
.uc-detail-block
{
margin-top
:
16px
;
padding-top
:
16px
;
border-top
:
1px
solid
var
(
--uj-divider
);
}
/* ---- 附件/资料行:标签定宽弱化,链接可换行 ---- */
.uc-detail-files
{
display
:
grid
;
gap
:
10px
;
}
.uc-detail-files__row
{
display
:
grid
;
grid-template-columns
:
96px
minmax
(
0
,
1
fr
);
gap
:
8px
;
align-items
:
baseline
;
}
.uc-detail-files__label
{
color
:
var
(
--uj-text-3
);
font-size
:
var
(
--uj-font-sm
);
}
.uc-detail-files__value
{
display
:
flex
;
flex-wrap
:
wrap
;
align-items
:
center
;
gap
:
0
4px
;
min-width
:
0
;
font-size
:
var
(
--uj-font-sm
);
}
@media
(
max-width
:
1100px
)
{
.uc-detail-split
{
grid-template-columns
:
1
fr
;
}
}
@media
(
max-width
:
700px
)
{
.uc-detail-dossier
{
gap
:
12px
20px
;
}
.uc-detail-dossier__meta
{
gap
:
12px
20px
;
}
.uc-detail-files__row
{
grid-template-columns
:
1
fr
;
gap
:
2px
;
}
}
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