统一展示平台订单号
This commit is contained in:
@@ -252,7 +252,7 @@ export default function WorkerHallPage() {
|
||||
<Input
|
||||
allowClear
|
||||
value={keywordInput}
|
||||
placeholder="搜索商品名称 / 订单号 / 工单号"
|
||||
placeholder="搜索商品名称 / 订单号"
|
||||
prefix={<SearchOutlined />}
|
||||
onChange={(event) => {
|
||||
const nextKeyword = event.target.value
|
||||
@@ -353,16 +353,16 @@ export default function WorkerHallPage() {
|
||||
<div className="worker-hall-card-title">
|
||||
<Typography.Link
|
||||
className="worker-hall-card-link"
|
||||
title={order.productName || order.workOrderNo}
|
||||
title={order.productName || '未命名商品'}
|
||||
onClick={() => setDetailOrder(order)}
|
||||
>
|
||||
{order.productName || order.workOrderNo}
|
||||
{order.productName || '未命名商品'}
|
||||
</Typography.Link>
|
||||
<Typography.Text type="secondary">
|
||||
{order.categoryName || '默认分类'}
|
||||
</Typography.Text>
|
||||
<Typography.Text type="secondary">
|
||||
订单号:{order.platformOrderId || order.workOrderNo}
|
||||
订单号:{getDisplayOrderNo(order)}
|
||||
</Typography.Text>
|
||||
</div>
|
||||
|
||||
@@ -471,7 +471,7 @@ export default function WorkerHallPage() {
|
||||
<Drawer
|
||||
title={
|
||||
detailOrder
|
||||
? `${detailOrder.productName || '工单详情'} · ${detailOrder.workOrderNo}`
|
||||
? `${detailOrder.productName || '工单详情'} · ${getDisplayOrderNo(detailOrder)}`
|
||||
: '工单详情'
|
||||
}
|
||||
width={760}
|
||||
@@ -507,11 +507,8 @@ export default function WorkerHallPage() {
|
||||
<Descriptions.Item label="分类">
|
||||
{detailOrder.categoryName || '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="工单号">
|
||||
{detailOrder.workOrderNo}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="平台订单号">
|
||||
{detailOrder.platformOrderId || '-'}
|
||||
{getDisplayOrderNo(detailOrder)}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="接单奖励">
|
||||
{formatMoney(detailOrder.rewardAmount)}
|
||||
@@ -678,6 +675,10 @@ function resolvePublishedTime(order: WorkOrder) {
|
||||
return order.publishedAt || order.createdAt || order.updatedAt
|
||||
}
|
||||
|
||||
function getDisplayOrderNo(order: Pick<WorkOrder, 'platformOrderId'> | null | undefined): string {
|
||||
return String(order?.platformOrderId || '').trim() || '-'
|
||||
}
|
||||
|
||||
function asRecord(value: unknown): Record<string, unknown> {
|
||||
return value && typeof value === 'object' && !Array.isArray(value)
|
||||
? (value as Record<string, unknown>)
|
||||
|
||||
@@ -270,17 +270,17 @@ export default function WorkerOrdersPage() {
|
||||
<Typography.Link
|
||||
strong
|
||||
onClick={() => setDetailOrder(row)}
|
||||
title={row.productName || row.workOrderNo}
|
||||
title={row.productName || '未命名商品'}
|
||||
ellipsis
|
||||
>
|
||||
{row.productName || row.workOrderNo}
|
||||
{row.productName || '未命名商品'}
|
||||
</Typography.Link>
|
||||
<Space size={[4, 4]} wrap>
|
||||
{row.categoryName ? <Tag color="blue">{row.categoryName}</Tag> : null}
|
||||
{row.myShare ? <Tag color="purple">拼单</Tag> : null}
|
||||
</Space>
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12 }} ellipsis={{ tooltip: `${row.workOrderNo} / ${row.platformOrderId || '-'}` }}>
|
||||
{row.workOrderNo}
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12 }} ellipsis={{ tooltip: getDisplayOrderNo(row) }}>
|
||||
{getDisplayOrderNo(row)}
|
||||
</Typography.Text>
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
||||
接单:{formatDateTime(row.assignedAt)}
|
||||
@@ -518,7 +518,7 @@ export default function WorkerOrdersPage() {
|
||||
<Input
|
||||
allowClear
|
||||
value={keywordInput}
|
||||
placeholder="搜索工单号 / 订单号 / 商品名"
|
||||
placeholder="搜索订单号 / 商品名"
|
||||
prefix={<SearchOutlined />}
|
||||
onChange={(event) => {
|
||||
const nextValue = event.target.value
|
||||
@@ -584,7 +584,7 @@ export default function WorkerOrdersPage() {
|
||||
<Drawer
|
||||
title={
|
||||
detailOrder
|
||||
? `${detailOrder.productName || '订单详情'} · ${detailOrder.workOrderNo}`
|
||||
? `${detailOrder.productName || '订单详情'} · ${getDisplayOrderNo(detailOrder)}`
|
||||
: '订单详情'
|
||||
}
|
||||
width={820}
|
||||
@@ -625,11 +625,8 @@ export default function WorkerOrdersPage() {
|
||||
<Descriptions.Item label="分类">
|
||||
{detailOrder.categoryName || '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="工单号">
|
||||
{detailOrder.workOrderNo}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="平台订单号">
|
||||
{detailOrder.platformOrderId || '-'}
|
||||
{getDisplayOrderNo(detailOrder)}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="状态">
|
||||
<Tag color={resolveStatusColor(detailOrder.status)}>
|
||||
@@ -731,7 +728,7 @@ export default function WorkerOrdersPage() {
|
||||
</Drawer>
|
||||
|
||||
<Modal
|
||||
title={`订单备注 · ${noteOrder?.workOrderNo || ''}`}
|
||||
title={`订单备注 · ${getDisplayOrderNo(noteOrder)}`}
|
||||
open={Boolean(noteOrder)}
|
||||
width={460}
|
||||
onCancel={() => {
|
||||
@@ -851,6 +848,10 @@ function hasSubmittedAcceptance(order: WorkOrder) {
|
||||
return order.status === 'pending_acceptance'
|
||||
}
|
||||
|
||||
function getDisplayOrderNo(order: Pick<WorkOrder, 'platformOrderId'> | null | undefined): string {
|
||||
return String(order?.platformOrderId || '').trim() || '-'
|
||||
}
|
||||
|
||||
function canCancelOrder(order: WorkOrder) {
|
||||
return !order.myShare && order.status === 'in_progress'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user