统一展示平台订单号
This commit is contained in:
@@ -471,7 +471,7 @@ export default function WorkOrdersPanel() {
|
||||
|
||||
function requestDeleteWorkOrder(row: WorkOrder) {
|
||||
modal.confirm({
|
||||
title: `确认删除工单 ${row.workOrderNo}?`,
|
||||
title: `确认删除订单 ${getDisplayOrderNo(row)}?`,
|
||||
content:
|
||||
'删除后工单将从列表中移除,且不可恢复。仅未分配、待完善或已取消且无拼单参与的工单可删除。',
|
||||
okText: '确认删除',
|
||||
@@ -516,7 +516,7 @@ export default function WorkOrdersPanel() {
|
||||
</Typography.Text>
|
||||
) : null}
|
||||
<Typography.Text type="secondary">
|
||||
{row.platformOrderId} · {row.workOrderNo}
|
||||
{getDisplayOrderNo(row)}
|
||||
</Typography.Text>
|
||||
</div>
|
||||
)
|
||||
@@ -782,7 +782,7 @@ export default function WorkOrdersPanel() {
|
||||
<Input
|
||||
allowClear
|
||||
value={keywordInput}
|
||||
placeholder="订单号、工单号或商品名"
|
||||
placeholder="订单号或商品名"
|
||||
style={{ width: 280 }}
|
||||
onChange={(event) => setKeywordInput(event.target.value)}
|
||||
onPressEnter={searchOrders}
|
||||
@@ -852,7 +852,7 @@ export default function WorkOrdersPanel() {
|
||||
<Drawer
|
||||
title={
|
||||
detailOrder
|
||||
? `${detailOrder.productName || '工单详情'} · ${detailOrder.workOrderNo}`
|
||||
? `${detailOrder.productName || '工单详情'} · ${getDisplayOrderNo(detailOrder)}`
|
||||
: '工单详情'
|
||||
}
|
||||
width={860}
|
||||
@@ -884,11 +884,8 @@ export default function WorkOrdersPanel() {
|
||||
<div className="worker-order-detail-stack">
|
||||
<Card title="基础信息" size="small">
|
||||
<Descriptions column={{ xs: 1, md: 2 }} bordered size="small">
|
||||
<Descriptions.Item label="工单号">
|
||||
{detailOrder.workOrderNo}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="平台订单号">
|
||||
{detailOrder.platformOrderId || '-'}
|
||||
{getDisplayOrderNo(detailOrder)}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="源订单 ID">
|
||||
{detailOrder.orderId || '-'}
|
||||
@@ -1038,7 +1035,7 @@ export default function WorkOrdersPanel() {
|
||||
</Drawer>
|
||||
|
||||
<Modal
|
||||
title={`编辑工单 · ${editOrder?.workOrderNo || ''}`}
|
||||
title={`编辑工单 · ${getDisplayOrderNo(editOrder)}`}
|
||||
open={Boolean(editOrder)}
|
||||
onCancel={() => {
|
||||
setEditOrder(null)
|
||||
@@ -1126,7 +1123,7 @@ export default function WorkOrdersPanel() {
|
||||
</Modal>
|
||||
|
||||
<Modal
|
||||
title={`扣减待解冻押金 · ${deductOrder?.workOrderNo || ''}`}
|
||||
title={`扣减待解冻押金 · ${getDisplayOrderNo(deductOrder)}`}
|
||||
open={Boolean(deductOrder)}
|
||||
onCancel={() => {
|
||||
setDeductOrder(null)
|
||||
@@ -1484,6 +1481,10 @@ function formatUserPaymentAmount(order: WorkOrder): string {
|
||||
return paymentFen === null ? '-' : formatMoney(paymentFen)
|
||||
}
|
||||
|
||||
function getDisplayOrderNo(order: Pick<WorkOrder, 'platformOrderId'> | null | undefined): string {
|
||||
return String(order?.platformOrderId || '').trim() || '-'
|
||||
}
|
||||
|
||||
/** 用户付款金额(分);未知返回 null(不参与超价提示) */
|
||||
function getUserPaymentFen(order: WorkOrder): number | null {
|
||||
const material = asRecord(order.material)
|
||||
@@ -1523,7 +1524,7 @@ function ProductNameEditableCell({
|
||||
clickTimerRef.current = null
|
||||
}
|
||||
if (!editable) return
|
||||
setDraft(order.productName || order.workOrderNo)
|
||||
setDraft(order.productName || '')
|
||||
setEditing(true)
|
||||
}
|
||||
|
||||
@@ -1558,7 +1559,7 @@ function ProductNameEditableCell({
|
||||
onClick={handleClick}
|
||||
onDoubleClick={handleDoubleClick}
|
||||
>
|
||||
{order.productName || order.workOrderNo}
|
||||
{order.productName || '未命名商品'}
|
||||
</Typography.Link>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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