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 fdcdc2e9
authored
Nov 17, 2026
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增交接单创建和详情页面及相关样式
1 parent
4fbe2bf2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
382 additions
and
4 deletions
apps/web/subapps/usedcar/src/pages/Handover/CreateHandoverModal.tsx
apps/web/subapps/usedcar/src/pages/Handover/HandoverDetailModal.tsx
apps/web/subapps/usedcar/src/pages/Handover/handover.css
apps/web/subapps/usedcar/src/pages/Handover/index.tsx
apps/web/subapps/usedcar/src/pages/Handover/CreateHandoverModal.tsx
0 → 100644
View file @
fdcdc2e
This diff is collapsed.
Click to expand it.
apps/web/subapps/usedcar/src/pages/Handover/HandoverDetailModal.tsx
0 → 100644
View file @
fdcdc2e
import { useState } from 'react';
import { useQuery } from '@tanstack/react-query';
import { UAlert, UButton, UImage, UModal } from '@uj/ui';
import { CombiForm, DataTable, type FieldSchema } from '@/components';
import { staffHandoverApi } from '@/api';
import { errorDetail } from '@/utils/error';
import './handover.css';
type Row = Record<string, unknown> & { id: string | number };
const text = (v: unknown) => (v === undefined || v === null || v === '' ? '-' : String(v));
const detailFields = (items: Array<[string, string]>): FieldSchema<Record<string, unknown>>[] =>
items.map(([name, label]) => ({ name, label, type: 'input', render: text }));
export default function HandoverDetailModal({
record,
onClose,
}: {
record: Row | undefined;
onClose: () => void;
}) {
const [previewUrls, setPreviewUrls] = useState<string[]>([]);
const [previewIndex, setPreviewIndex] = useState(0);
const previewUrl = previewUrls[previewIndex];
const q = useQuery({
queryKey: ['handover-detail', record?.id],
queryFn: () =>
staffHandoverApi.getStaffHandoverDetail<Record<string, unknown>>({ id: record?.id }),
enabled: Boolean(record),
});
const data = q.data ?? {};
const columns = [
['评估单号', 'evalOrderNo'],
['门店', 'sellerMerchantName'],
['车型', 'carModel'],
['车牌', 'licensePlate'],
].map(([title, dataIndex]) => ({ title, dataIndex, width: 160, line: 1, render: text }));
columns.push(
{
title: '当时协议状态',
dataIndex: 'signCustodyStatus',
width: 130,
render: (v: unknown) => (v ? '已签署' : '未签署'),
},
{
title: '凭证',
dataIndex: 'proofUrls',
width: 130,
render: (v: unknown) =>
Array.isArray(v) && v.length ? (
<UButton
type="link"
onClick={() => {
setPreviewUrls(v.map(String));
setPreviewIndex(0);
}}
>
查看凭证
</UButton>
) : (
'-'
),
},
);
return (
<UModal open={Boolean(record)} title="详情" width={1080} footer={null} onCancel={onClose}>
<CombiForm
mode="detail"
detailColumns={3}
labelWidth={128}
fields={detailFields([
['handoverBatchNo', '交接批次号'],
['handoverTime', '操作时间'],
['createdBy', '操作人'],
])}
initialValues={data}
/>
<h3>待交接资产列表</h3>
{q.isError ? (
<UAlert type="error" showIcon title="详情加载失败" description={errorDetail(q.error)} />
) : (
<DataTable<Record<string, unknown>>
rowKey="evalOrderNo"
columns={columns}
dataSource={(data.details as Record<string, unknown>[]) ?? []}
pagination={false}
/>
)}
{previewUrl ? (
<div className="uc-handover-image-viewer" onClick={() => setPreviewUrls([])}>
<div
className="uc-handover-image-viewer__content"
onClick={(event) => event.stopPropagation()}
>
{previewUrls.length > 1 ? (
<UButton
className="uc-handover-image-viewer__arrow uc-handover-image-viewer__arrow--left"
disabled={previewIndex === 0}
onClick={() => setPreviewIndex((x) => x - 1)}
>
‹
</UButton>
) : null}
{previewUrl.split('?')[0].toLowerCase().endsWith('.pdf') ? (
<iframe className="uc-handover-proof-preview" src={previewUrl} title="交接凭证" />
) : (
<UImage
src={previewUrl}
preview={false}
className="uc-handover-image-viewer__image"
/>
)}
{previewUrls.length > 1 ? (
<UButton
className="uc-handover-image-viewer__arrow uc-handover-image-viewer__arrow--right"
disabled={previewIndex === previewUrls.length - 1}
onClick={() => setPreviewIndex((x) => x + 1)}
>
›
</UButton>
) : null}
</div>
</div>
) : null}
</UModal>
);
}
apps/web/subapps/usedcar/src/pages/Handover/handover.css
0 → 100644
View file @
fdcdc2e
.uc-handover-steps
{
display
:
flex
;
align-items
:
flex-start
;
justify-content
:
center
;
gap
:
16px
;
margin
:
8px
0
24px
;
}
.uc-handover-steps
>
div
{
color
:
var
(
--ant-color-text-description
);
text-align
:
center
;
font-size
:
28px
;
}
.uc-handover-steps
small
{
display
:
block
;
font-size
:
16px
;
}
.uc-handover-steps
.is-active
{
color
:
var
(
--ant-color-primary
);
}
.uc-handover-steps
.is-success
{
color
:
var
(
--ant-color-primary
);
}
.uc-handover-steps
>
span
{
width
:
28%
;
height
:
1px
;
margin-top
:
16px
;
background
:
var
(
--ant-color-border
);
}
.uc-handover-notice
{
margin-bottom
:
20px
;
padding
:
16px
;
background
:
var
(
--ant-color-fill-quaternary
);
}
.uc-handover-notice--warning
{
border-inline-start
:
3px
solid
var
(
--ant-color-warning
);
}
.uc-handover-users
{
display
:
grid
;
grid-template-columns
:
1
fr
1
fr
;
gap
:
48px
;
padding
:
0
12px
24px
;
}
.uc-handover-users
.ant-select
{
width
:
100%
!important
;
}
.uc-handover-agree
{
margin-top
:
16px
;
}
.uc-handover-footer
{
display
:
flex
;
justify-content
:
flex-end
;
gap
:
12px
;
}
.uc-handover-proof-actions
{
display
:
inline-flex
;
align-items
:
center
;
}
.uc-handover-proof-preview
{
width
:
100%
;
height
:
560px
;
border
:
0
;
}
.uc-handover-image-viewer
{
position
:
fixed
;
inset
:
0
;
z-index
:
1100
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
background
:
color-mix
(
in
srgb
,
var
(
--ant-color-bg-mask
)
88%
,
transparent
);
}
.uc-handover-image-viewer__content
{
position
:
relative
;
max-width
:
90vw
;
max-height
:
90vh
;
}
.uc-handover-image-viewer__image
{
display
:
block
;
max-width
:
90vw
;
max-height
:
90vh
;
}
.uc-handover-image-viewer__image
.ant-image-img
{
display
:
block
;
max-width
:
90vw
;
max-height
:
90vh
;
object-fit
:
contain
;
}
.uc-handover-image-viewer__arrow
{
position
:
fixed
;
top
:
50%
;
z-index
:
1
;
width
:
56px
;
height
:
56px
;
padding
:
0
;
border
:
0
;
border-radius
:
50%
;
background
:
color-mix
(
in
srgb
,
var
(
--ant-color-text
)
48%
,
transparent
);
color
:
var
(
--ant-color-text-light-solid
);
display
:
inline-flex
;
align-items
:
center
;
justify-content
:
center
;
font-size
:
44px
;
line-height
:
1
;
transform
:
translateY
(
-50%
);
}
.uc-handover-image-viewer__arrow--left
{
left
:
50px
;
}
.uc-handover-image-viewer__arrow--right
{
right
:
50px
;
}
.uc-handover-image-viewer__arrow
>
span
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
width
:
100%
;
height
:
100%
;
line-height
:
1
;
transform
:
translateY
(
-2px
);
}
apps/web/subapps/usedcar/src/pages/Handover/index.tsx
View file @
fdcdc2e
import { RoutePlaceholder } from '@/features/shared/RoutePlaceholder';
import { useMemo, useState } from 'react';
import { useQuery } from '@tanstack/react-query';
/** menu_code 1002608 · 离职继承 · usedcar:handover:view */
import type { Dayjs } from 'dayjs';
import { UAlert, UCard, UResult } from '@uj/ui';
import {
DataTable,
PageShell,
SearchForm,
type FieldSchema,
type RowActionSchema,
} from '@/components';
import { staffHandoverApi } from '@/api';
import { useAccess } from '@/access';
import { UC } from '@/permissions/codes';
import { errorDetail } from '@/utils/error';
import HandoverDetailModal from './HandoverDetailModal';
import CreateHandoverModal from './CreateHandoverModal';
type Filters = Record<string, unknown> & { name?: string; dateValue?: [Dayjs, Dayjs] };
type Row = Record<string, unknown> & { id: string | number };
type Result = { records: Row[]; total: number };
const HANDOVER_TYPE: Record<string, string> = { 1: '普通交接', 2: '实物交接' };
const text = (value: unknown) =>
value === undefined || value === null || value === '' ? '-' : String(value);
function paramsOf(f: Filters) {
const { dateValue, ...rest } = f;
return {
...rest,
...(dateValue
? {
startTime: dateValue[0].format('YYYY-MM-DD HH:mm:ss'),
endTime: dateValue[1].format('YYYY-MM-DD HH:mm:ss'),
}
: {}),
};
}
export default function Handover() {
export default function Handover() {
return <RoutePlaceholder title="离职继承" route="/usedcar/handover" />;
const { canPoint } = useAccess();
const [f, setF] = useState<Filters>({});
const [p, setP] = useState({ current: 1, size: 10 });
const [detail, setDetail] = useState<Row>();
const [create, setCreate] = useState(false);
const params = useMemo(() => paramsOf(f), [f]);
const q = useQuery({
queryKey: ['handover', params, p],
queryFn: () =>
staffHandoverApi.getStaffHandover<Result>({
currentPage: p.current,
pageSize: p.size,
t: params,
}),
enabled: canPoint(UC.HANDOVER_VIEW),
});
const fields: FieldSchema<Filters>[] = [
{
name: 'name',
label: '原责任人/新接收人',
type: 'input',
essential: true,
inputProps: { maxLength: 20 },
},
{ name: 'dateValue', label: '交接时间', type: 'dateRange' },
];
const columns = [
{ title: '交接批次号', dataIndex: 'handoverBatchNo', width: 156, line: 1, render: text },
{ title: '交接时间', dataIndex: 'handoverTime', width: 140, line: 1, render: text },
{
title: '原责任人(离职)',
width: 176,
render: (_: unknown, r: Row) => `${text(r.originalUserName)}/${text(r.originalMerchantName)}`,
},
{
title: '新接收人',
width: 176,
render: (_: unknown, r: Row) => `${text(r.newUserName)}/${text(r.newMerchantName)}`,
},
{ title: '交接资产数/辆', dataIndex: 'assetCount', width: 140, render: text },
{
title: '交接类型',
dataIndex: 'handoverType',
width: 130,
render: (v: unknown) => HANDOVER_TYPE[String(v)] ?? '-',
},
];
const rows: RowActionSchema<Row>[] = [
{ label: '详情', permission: UC.HANDOVER_DETAIL, onClick: setDetail },
];
if (!canPoint(UC.HANDOVER_VIEW))
return (
<UResult status="403" title="无访问离职继承的权限" subTitle="请联系管理员开通访问权限。" />
);
return (
<PageShell fill title="离职继承">
<UCard className="uj-filter-card" size="small">
<SearchForm
fields={fields}
onSearch={(v) => {
setF(v);
setP((x) => ({ ...x, current: 1 }));
}}
onReset={() => setF({})}
/>
</UCard>
{q.isError ? (
<UAlert
type="error"
showIcon
title="离职继承列表加载失败"
description={errorDetail(q.error)}
/>
) : null}
<UCard size="small" fill>
<DataTable<Row>
rowKey="id"
fillHeight
columns={columns}
dataSource={q.data?.records ?? []}
loading={q.isPending || q.isFetching}
rowActions={rows}
actions={
canPoint(UC.HANDOVER_CREATE)
? [{ label: '新增人员交接', type: 'primary', onClick: () => setCreate(true) }]
: []
}
pagination={{
current: p.current,
pageSize: p.size,
total: q.data?.total ?? 0,
onChange: (current, size) => setP({ current, size }),
}}
/>
</UCard>
<HandoverDetailModal record={detail} onClose={() => setDetail(undefined)} />
<CreateHandoverModal
open={create}
onClose={() => setCreate(false)}
onSuccess={() => void q.refetch()}
/>
</PageShell>
);
}
}
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