统一展示平台订单号

This commit is contained in:
yml2213
2026-08-15 14:54:56 +08:00
parent d433518038
commit edccf03eb0
3 changed files with 35 additions and 32 deletions
@@ -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>
)
}