统一展示平台订单号
This commit is contained in:
@@ -471,7 +471,7 @@ export default function WorkOrdersPanel() {
|
|||||||
|
|
||||||
function requestDeleteWorkOrder(row: WorkOrder) {
|
function requestDeleteWorkOrder(row: WorkOrder) {
|
||||||
modal.confirm({
|
modal.confirm({
|
||||||
title: `确认删除工单 ${row.workOrderNo}?`,
|
title: `确认删除订单 ${getDisplayOrderNo(row)}?`,
|
||||||
content:
|
content:
|
||||||
'删除后工单将从列表中移除,且不可恢复。仅未分配、待完善或已取消且无拼单参与的工单可删除。',
|
'删除后工单将从列表中移除,且不可恢复。仅未分配、待完善或已取消且无拼单参与的工单可删除。',
|
||||||
okText: '确认删除',
|
okText: '确认删除',
|
||||||
@@ -516,7 +516,7 @@ export default function WorkOrdersPanel() {
|
|||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
) : null}
|
) : null}
|
||||||
<Typography.Text type="secondary">
|
<Typography.Text type="secondary">
|
||||||
{row.platformOrderId} · {row.workOrderNo}
|
{getDisplayOrderNo(row)}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -782,7 +782,7 @@ export default function WorkOrdersPanel() {
|
|||||||
<Input
|
<Input
|
||||||
allowClear
|
allowClear
|
||||||
value={keywordInput}
|
value={keywordInput}
|
||||||
placeholder="订单号、工单号或商品名"
|
placeholder="订单号或商品名"
|
||||||
style={{ width: 280 }}
|
style={{ width: 280 }}
|
||||||
onChange={(event) => setKeywordInput(event.target.value)}
|
onChange={(event) => setKeywordInput(event.target.value)}
|
||||||
onPressEnter={searchOrders}
|
onPressEnter={searchOrders}
|
||||||
@@ -852,7 +852,7 @@ export default function WorkOrdersPanel() {
|
|||||||
<Drawer
|
<Drawer
|
||||||
title={
|
title={
|
||||||
detailOrder
|
detailOrder
|
||||||
? `${detailOrder.productName || '工单详情'} · ${detailOrder.workOrderNo}`
|
? `${detailOrder.productName || '工单详情'} · ${getDisplayOrderNo(detailOrder)}`
|
||||||
: '工单详情'
|
: '工单详情'
|
||||||
}
|
}
|
||||||
width={860}
|
width={860}
|
||||||
@@ -884,11 +884,8 @@ export default function WorkOrdersPanel() {
|
|||||||
<div className="worker-order-detail-stack">
|
<div className="worker-order-detail-stack">
|
||||||
<Card title="基础信息" size="small">
|
<Card title="基础信息" size="small">
|
||||||
<Descriptions column={{ xs: 1, md: 2 }} bordered size="small">
|
<Descriptions column={{ xs: 1, md: 2 }} bordered size="small">
|
||||||
<Descriptions.Item label="工单号">
|
|
||||||
{detailOrder.workOrderNo}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item label="平台订单号">
|
<Descriptions.Item label="平台订单号">
|
||||||
{detailOrder.platformOrderId || '-'}
|
{getDisplayOrderNo(detailOrder)}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="源订单 ID">
|
<Descriptions.Item label="源订单 ID">
|
||||||
{detailOrder.orderId || '-'}
|
{detailOrder.orderId || '-'}
|
||||||
@@ -1038,7 +1035,7 @@ export default function WorkOrdersPanel() {
|
|||||||
</Drawer>
|
</Drawer>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
title={`编辑工单 · ${editOrder?.workOrderNo || ''}`}
|
title={`编辑工单 · ${getDisplayOrderNo(editOrder)}`}
|
||||||
open={Boolean(editOrder)}
|
open={Boolean(editOrder)}
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
setEditOrder(null)
|
setEditOrder(null)
|
||||||
@@ -1126,7 +1123,7 @@ export default function WorkOrdersPanel() {
|
|||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
title={`扣减待解冻押金 · ${deductOrder?.workOrderNo || ''}`}
|
title={`扣减待解冻押金 · ${getDisplayOrderNo(deductOrder)}`}
|
||||||
open={Boolean(deductOrder)}
|
open={Boolean(deductOrder)}
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
setDeductOrder(null)
|
setDeductOrder(null)
|
||||||
@@ -1484,6 +1481,10 @@ function formatUserPaymentAmount(order: WorkOrder): string {
|
|||||||
return paymentFen === null ? '-' : formatMoney(paymentFen)
|
return paymentFen === null ? '-' : formatMoney(paymentFen)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getDisplayOrderNo(order: Pick<WorkOrder, 'platformOrderId'> | null | undefined): string {
|
||||||
|
return String(order?.platformOrderId || '').trim() || '-'
|
||||||
|
}
|
||||||
|
|
||||||
/** 用户付款金额(分);未知返回 null(不参与超价提示) */
|
/** 用户付款金额(分);未知返回 null(不参与超价提示) */
|
||||||
function getUserPaymentFen(order: WorkOrder): number | null {
|
function getUserPaymentFen(order: WorkOrder): number | null {
|
||||||
const material = asRecord(order.material)
|
const material = asRecord(order.material)
|
||||||
@@ -1523,7 +1524,7 @@ function ProductNameEditableCell({
|
|||||||
clickTimerRef.current = null
|
clickTimerRef.current = null
|
||||||
}
|
}
|
||||||
if (!editable) return
|
if (!editable) return
|
||||||
setDraft(order.productName || order.workOrderNo)
|
setDraft(order.productName || '')
|
||||||
setEditing(true)
|
setEditing(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1558,7 +1559,7 @@ function ProductNameEditableCell({
|
|||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
onDoubleClick={handleDoubleClick}
|
onDoubleClick={handleDoubleClick}
|
||||||
>
|
>
|
||||||
{order.productName || order.workOrderNo}
|
{order.productName || '未命名商品'}
|
||||||
</Typography.Link>
|
</Typography.Link>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ export default function WorkerHallPage() {
|
|||||||
<Input
|
<Input
|
||||||
allowClear
|
allowClear
|
||||||
value={keywordInput}
|
value={keywordInput}
|
||||||
placeholder="搜索商品名称 / 订单号 / 工单号"
|
placeholder="搜索商品名称 / 订单号"
|
||||||
prefix={<SearchOutlined />}
|
prefix={<SearchOutlined />}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
const nextKeyword = event.target.value
|
const nextKeyword = event.target.value
|
||||||
@@ -353,16 +353,16 @@ export default function WorkerHallPage() {
|
|||||||
<div className="worker-hall-card-title">
|
<div className="worker-hall-card-title">
|
||||||
<Typography.Link
|
<Typography.Link
|
||||||
className="worker-hall-card-link"
|
className="worker-hall-card-link"
|
||||||
title={order.productName || order.workOrderNo}
|
title={order.productName || '未命名商品'}
|
||||||
onClick={() => setDetailOrder(order)}
|
onClick={() => setDetailOrder(order)}
|
||||||
>
|
>
|
||||||
{order.productName || order.workOrderNo}
|
{order.productName || '未命名商品'}
|
||||||
</Typography.Link>
|
</Typography.Link>
|
||||||
<Typography.Text type="secondary">
|
<Typography.Text type="secondary">
|
||||||
{order.categoryName || '默认分类'}
|
{order.categoryName || '默认分类'}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
<Typography.Text type="secondary">
|
<Typography.Text type="secondary">
|
||||||
订单号:{order.platformOrderId || order.workOrderNo}
|
订单号:{getDisplayOrderNo(order)}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -471,7 +471,7 @@ export default function WorkerHallPage() {
|
|||||||
<Drawer
|
<Drawer
|
||||||
title={
|
title={
|
||||||
detailOrder
|
detailOrder
|
||||||
? `${detailOrder.productName || '工单详情'} · ${detailOrder.workOrderNo}`
|
? `${detailOrder.productName || '工单详情'} · ${getDisplayOrderNo(detailOrder)}`
|
||||||
: '工单详情'
|
: '工单详情'
|
||||||
}
|
}
|
||||||
width={760}
|
width={760}
|
||||||
@@ -507,11 +507,8 @@ export default function WorkerHallPage() {
|
|||||||
<Descriptions.Item label="分类">
|
<Descriptions.Item label="分类">
|
||||||
{detailOrder.categoryName || '-'}
|
{detailOrder.categoryName || '-'}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="工单号">
|
|
||||||
{detailOrder.workOrderNo}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item label="平台订单号">
|
<Descriptions.Item label="平台订单号">
|
||||||
{detailOrder.platformOrderId || '-'}
|
{getDisplayOrderNo(detailOrder)}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="接单奖励">
|
<Descriptions.Item label="接单奖励">
|
||||||
{formatMoney(detailOrder.rewardAmount)}
|
{formatMoney(detailOrder.rewardAmount)}
|
||||||
@@ -678,6 +675,10 @@ function resolvePublishedTime(order: WorkOrder) {
|
|||||||
return order.publishedAt || order.createdAt || order.updatedAt
|
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> {
|
function asRecord(value: unknown): Record<string, unknown> {
|
||||||
return value && typeof value === 'object' && !Array.isArray(value)
|
return value && typeof value === 'object' && !Array.isArray(value)
|
||||||
? (value as Record<string, unknown>)
|
? (value as Record<string, unknown>)
|
||||||
|
|||||||
@@ -270,17 +270,17 @@ export default function WorkerOrdersPage() {
|
|||||||
<Typography.Link
|
<Typography.Link
|
||||||
strong
|
strong
|
||||||
onClick={() => setDetailOrder(row)}
|
onClick={() => setDetailOrder(row)}
|
||||||
title={row.productName || row.workOrderNo}
|
title={row.productName || '未命名商品'}
|
||||||
ellipsis
|
ellipsis
|
||||||
>
|
>
|
||||||
{row.productName || row.workOrderNo}
|
{row.productName || '未命名商品'}
|
||||||
</Typography.Link>
|
</Typography.Link>
|
||||||
<Space size={[4, 4]} wrap>
|
<Space size={[4, 4]} wrap>
|
||||||
{row.categoryName ? <Tag color="blue">{row.categoryName}</Tag> : null}
|
{row.categoryName ? <Tag color="blue">{row.categoryName}</Tag> : null}
|
||||||
{row.myShare ? <Tag color="purple">拼单</Tag> : null}
|
{row.myShare ? <Tag color="purple">拼单</Tag> : null}
|
||||||
</Space>
|
</Space>
|
||||||
<Typography.Text type="secondary" style={{ fontSize: 12 }} ellipsis={{ tooltip: `${row.workOrderNo} / ${row.platformOrderId || '-'}` }}>
|
<Typography.Text type="secondary" style={{ fontSize: 12 }} ellipsis={{ tooltip: getDisplayOrderNo(row) }}>
|
||||||
{row.workOrderNo}
|
{getDisplayOrderNo(row)}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
||||||
接单:{formatDateTime(row.assignedAt)}
|
接单:{formatDateTime(row.assignedAt)}
|
||||||
@@ -518,7 +518,7 @@ export default function WorkerOrdersPage() {
|
|||||||
<Input
|
<Input
|
||||||
allowClear
|
allowClear
|
||||||
value={keywordInput}
|
value={keywordInput}
|
||||||
placeholder="搜索工单号 / 订单号 / 商品名"
|
placeholder="搜索订单号 / 商品名"
|
||||||
prefix={<SearchOutlined />}
|
prefix={<SearchOutlined />}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
const nextValue = event.target.value
|
const nextValue = event.target.value
|
||||||
@@ -584,7 +584,7 @@ export default function WorkerOrdersPage() {
|
|||||||
<Drawer
|
<Drawer
|
||||||
title={
|
title={
|
||||||
detailOrder
|
detailOrder
|
||||||
? `${detailOrder.productName || '订单详情'} · ${detailOrder.workOrderNo}`
|
? `${detailOrder.productName || '订单详情'} · ${getDisplayOrderNo(detailOrder)}`
|
||||||
: '订单详情'
|
: '订单详情'
|
||||||
}
|
}
|
||||||
width={820}
|
width={820}
|
||||||
@@ -625,11 +625,8 @@ export default function WorkerOrdersPage() {
|
|||||||
<Descriptions.Item label="分类">
|
<Descriptions.Item label="分类">
|
||||||
{detailOrder.categoryName || '-'}
|
{detailOrder.categoryName || '-'}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="工单号">
|
|
||||||
{detailOrder.workOrderNo}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item label="平台订单号">
|
<Descriptions.Item label="平台订单号">
|
||||||
{detailOrder.platformOrderId || '-'}
|
{getDisplayOrderNo(detailOrder)}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="状态">
|
<Descriptions.Item label="状态">
|
||||||
<Tag color={resolveStatusColor(detailOrder.status)}>
|
<Tag color={resolveStatusColor(detailOrder.status)}>
|
||||||
@@ -731,7 +728,7 @@ export default function WorkerOrdersPage() {
|
|||||||
</Drawer>
|
</Drawer>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
title={`订单备注 · ${noteOrder?.workOrderNo || ''}`}
|
title={`订单备注 · ${getDisplayOrderNo(noteOrder)}`}
|
||||||
open={Boolean(noteOrder)}
|
open={Boolean(noteOrder)}
|
||||||
width={460}
|
width={460}
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
@@ -851,6 +848,10 @@ function hasSubmittedAcceptance(order: WorkOrder) {
|
|||||||
return order.status === 'pending_acceptance'
|
return order.status === 'pending_acceptance'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getDisplayOrderNo(order: Pick<WorkOrder, 'platformOrderId'> | null | undefined): string {
|
||||||
|
return String(order?.platformOrderId || '').trim() || '-'
|
||||||
|
}
|
||||||
|
|
||||||
function canCancelOrder(order: WorkOrder) {
|
function canCancelOrder(order: WorkOrder) {
|
||||||
return !order.myShare && order.status === 'in_progress'
|
return !order.myShare && order.status === 'in_progress'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user