feat(worker-platform): 接单平台工单详情抽屉支持卖家与买家资料一键复制与单项复制
1. 寄售赠送进度卡片右上角新增【一键复制卖家资料】按钮,一键聚合复制卖家角色昵称、游戏ID、区服、系统、联系方式(微信/QQ/手机)、提报/仓库单号及备注; 2. 资料信息卡片右上角新增【一键复制买家资料】按钮,一键复制买家提交的全部表单字段; 3. 卖家资料与买家资料的各项字段值(角色名、数字ID、区服、系统、联系方式、单号等)右侧均补充内联一键复制小图标,支持快捷单项提取。
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
CheckOutlined,
|
CheckOutlined,
|
||||||
|
CopyOutlined,
|
||||||
DeleteOutlined,
|
DeleteOutlined,
|
||||||
EditOutlined,
|
EditOutlined,
|
||||||
FormOutlined,
|
FormOutlined,
|
||||||
@@ -1295,6 +1296,63 @@ export default function WorkOrdersPanel() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function copyBuyerMaterialInfo(order: WorkOrder) {
|
||||||
|
const items = getMaterialDetailItems(order).filter((item) => String(item.value || '').trim())
|
||||||
|
if (items.length === 0) {
|
||||||
|
message.warning('当前工单暂无买家资料')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const lines = items.map((item) => `${item.label}: ${item.value}`)
|
||||||
|
navigator.clipboard
|
||||||
|
.writeText(lines.join('\n'))
|
||||||
|
.then(() => message.success('买家资料已复制到剪贴板'))
|
||||||
|
.catch(() => message.error('复制失败,请手动复制'))
|
||||||
|
}
|
||||||
|
|
||||||
|
function copyConsignmentSellerInfo(order: WorkOrder) {
|
||||||
|
const consignmentInfo = getConsignmentFulfillment(order)
|
||||||
|
const sellerFields = order.gift?.boosterMaterial?.fields || {}
|
||||||
|
const gameNickname = String(
|
||||||
|
sellerFields.gameNickname || consignmentInfo?.buyerName || '',
|
||||||
|
).trim()
|
||||||
|
const gameId = String(sellerFields.gameId || consignmentInfo?.sellerGameId || '').trim()
|
||||||
|
const serverZone = String(sellerFields.serverZone || consignmentInfo?.serverZone || '').trim()
|
||||||
|
const system = String(sellerFields.system || consignmentInfo?.system || '').trim()
|
||||||
|
const sellerContact = String(
|
||||||
|
sellerFields.sellerContact || consignmentInfo?.sellerContact || '',
|
||||||
|
).trim()
|
||||||
|
const sellerPhone = String(
|
||||||
|
sellerFields.sellerPhone || consignmentInfo?.sellerPhone || '',
|
||||||
|
).trim()
|
||||||
|
const sourceSubmissionNo = String(
|
||||||
|
sellerFields.sourceSubmissionNo || consignmentInfo?.sourceSubmissionNo || '',
|
||||||
|
).trim()
|
||||||
|
const inventoryNo = String(
|
||||||
|
sellerFields.inventoryNo || consignmentInfo?.inventoryNo || '',
|
||||||
|
).trim()
|
||||||
|
const note = String(order.gift?.boosterMaterial?.note || consignmentInfo?.remark || '').trim()
|
||||||
|
|
||||||
|
const lines: string[] = []
|
||||||
|
if (gameNickname) lines.push(`卖家角色昵称: ${gameNickname}`)
|
||||||
|
if (gameId) lines.push(`卖家游戏ID: ${gameId}`)
|
||||||
|
if (serverZone) lines.push(`区服: ${serverZone}`)
|
||||||
|
if (system) lines.push(`系统: ${system}`)
|
||||||
|
if (sellerContact) lines.push(`卖家微信/QQ: ${sellerContact}`)
|
||||||
|
if (sellerPhone) lines.push(`卖家手机: ${sellerPhone}`)
|
||||||
|
if (sourceSubmissionNo) lines.push(`提报单号: ${sourceSubmissionNo}`)
|
||||||
|
if (inventoryNo) lines.push(`仓库单号: ${inventoryNo}`)
|
||||||
|
if (note) lines.push(`卖家备注: ${note}`)
|
||||||
|
|
||||||
|
if (lines.length === 0) {
|
||||||
|
message.warning('当前工单暂无可复制的卖家资料')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
navigator.clipboard
|
||||||
|
.writeText(lines.join('\n'))
|
||||||
|
.then(() => message.success('卖家资料已复制到剪贴板'))
|
||||||
|
.catch(() => message.error('复制失败,请手动复制'))
|
||||||
|
}
|
||||||
|
|
||||||
const columns: TableColumnsType<WorkOrder> = [
|
const columns: TableColumnsType<WorkOrder> = [
|
||||||
{
|
{
|
||||||
title: '订单',
|
title: '订单',
|
||||||
@@ -2093,7 +2151,19 @@ export default function WorkOrdersPanel() {
|
|||||||
</Descriptions>
|
</Descriptions>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card title="资料信息" size="small">
|
<Card
|
||||||
|
title="资料信息"
|
||||||
|
size="small"
|
||||||
|
extra={
|
||||||
|
<Button
|
||||||
|
size="small"
|
||||||
|
icon={<CopyOutlined />}
|
||||||
|
onClick={() => copyBuyerMaterialInfo(detailOrder)}
|
||||||
|
>
|
||||||
|
一键复制买家资料
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
>
|
||||||
{renderDetailFieldValues(getMaterialDetailItems(detailOrder), '当前还没有填写资料')}
|
{renderDetailFieldValues(getMaterialDetailItems(detailOrder), '当前还没有填写资料')}
|
||||||
<div style={{ marginTop: 12 }}>
|
<div style={{ marginTop: 12 }}>
|
||||||
<Typography.Text type="secondary">买家主页截图</Typography.Text>
|
<Typography.Text type="secondary">买家主页截图</Typography.Text>
|
||||||
@@ -2109,15 +2179,30 @@ export default function WorkOrdersPanel() {
|
|||||||
isInternalConsignmentOrder(detailOrder) || isConsignmentOrder(detailOrder)
|
isInternalConsignmentOrder(detailOrder) || isConsignmentOrder(detailOrder)
|
||||||
const consignmentInfo = getConsignmentFulfillment(detailOrder)
|
const consignmentInfo = getConsignmentFulfillment(detailOrder)
|
||||||
const sellerFields = detailOrder.gift.boosterMaterial?.fields || {}
|
const sellerFields = detailOrder.gift.boosterMaterial?.fields || {}
|
||||||
const sellerContact =
|
const sellerNickname = String(
|
||||||
sellerFields.sellerContact || String(consignmentInfo?.sellerContact || '')
|
sellerFields.gameNickname || consignmentInfo?.buyerName || '',
|
||||||
const sellerPhone =
|
).trim()
|
||||||
sellerFields.sellerPhone || String(consignmentInfo?.sellerPhone || '')
|
const sellerGameId = String(
|
||||||
const inventoryNo =
|
sellerFields.gameId || consignmentInfo?.sellerGameId || '',
|
||||||
sellerFields.inventoryNo || String(consignmentInfo?.inventoryNo || '')
|
).trim()
|
||||||
const sourceSubmissionNo =
|
const sellerServerZone = String(
|
||||||
sellerFields.sourceSubmissionNo ||
|
sellerFields.serverZone || consignmentInfo?.serverZone || '',
|
||||||
String(consignmentInfo?.sourceSubmissionNo || '')
|
).trim()
|
||||||
|
const sellerSystem = String(
|
||||||
|
sellerFields.system || consignmentInfo?.system || '',
|
||||||
|
).trim()
|
||||||
|
const sellerContact = String(
|
||||||
|
sellerFields.sellerContact || consignmentInfo?.sellerContact || '',
|
||||||
|
).trim()
|
||||||
|
const sellerPhone = String(
|
||||||
|
sellerFields.sellerPhone || consignmentInfo?.sellerPhone || '',
|
||||||
|
).trim()
|
||||||
|
const inventoryNo = String(
|
||||||
|
sellerFields.inventoryNo || consignmentInfo?.inventoryNo || '',
|
||||||
|
).trim()
|
||||||
|
const sourceSubmissionNo = String(
|
||||||
|
sellerFields.sourceSubmissionNo || consignmentInfo?.sourceSubmissionNo || '',
|
||||||
|
).trim()
|
||||||
const effectiveNote = String(
|
const effectiveNote = String(
|
||||||
detailOrder.gift?.boosterMaterial?.note || consignmentInfo?.remark || '',
|
detailOrder.gift?.boosterMaterial?.note || consignmentInfo?.remark || '',
|
||||||
).trim()
|
).trim()
|
||||||
@@ -2127,7 +2212,7 @@ export default function WorkOrdersPanel() {
|
|||||||
title={isConsignment ? '寄售赠送进度' : '好友赠送进度'}
|
title={isConsignment ? '寄售赠送进度' : '好友赠送进度'}
|
||||||
size="small"
|
size="small"
|
||||||
extra={
|
extra={
|
||||||
<Space>
|
<Space wrap>
|
||||||
{isInternalConsignmentOrder(detailOrder) ? (
|
{isInternalConsignmentOrder(detailOrder) ? (
|
||||||
<Tag color="cyan">内部寄售匹配</Tag>
|
<Tag color="cyan">内部寄售匹配</Tag>
|
||||||
) : isConsignment ? (
|
) : isConsignment ? (
|
||||||
@@ -2140,6 +2225,15 @@ export default function WorkOrdersPanel() {
|
|||||||
<Tag color={resolveGiftPhaseColor(detailOrder.gift.phase)}>
|
<Tag color={resolveGiftPhaseColor(detailOrder.gift.phase)}>
|
||||||
{formatGiftPhase(detailOrder.gift.phase, isConsignment)}
|
{formatGiftPhase(detailOrder.gift.phase, isConsignment)}
|
||||||
</Tag>
|
</Tag>
|
||||||
|
{isConsignment ? (
|
||||||
|
<Button
|
||||||
|
size="small"
|
||||||
|
icon={<CopyOutlined />}
|
||||||
|
onClick={() => copyConsignmentSellerInfo(detailOrder)}
|
||||||
|
>
|
||||||
|
一键复制卖家资料
|
||||||
|
</Button>
|
||||||
|
) : null}
|
||||||
{detailOrder.capabilities?.canConfirmFriend && canManageProblem ? (
|
{detailOrder.capabilities?.canConfirmFriend && canManageProblem ? (
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -2194,35 +2288,70 @@ export default function WorkOrdersPanel() {
|
|||||||
</Descriptions>
|
</Descriptions>
|
||||||
<Descriptions column={{ xs: 1, md: 2 }} bordered size="small">
|
<Descriptions column={{ xs: 1, md: 2 }} bordered size="small">
|
||||||
<Descriptions.Item label={isConsignment ? '卖家角色昵称' : '游戏昵称'}>
|
<Descriptions.Item label={isConsignment ? '卖家角色昵称' : '游戏昵称'}>
|
||||||
<span className="worker-order-detail-value">
|
{sellerNickname ? (
|
||||||
{String(
|
<Space size={6} align="center">
|
||||||
sellerFields.gameNickname || consignmentInfo?.buyerName || '',
|
<span className="worker-order-detail-value">{sellerNickname}</span>
|
||||||
).trim() || '-'}
|
<Typography.Text
|
||||||
</span>
|
copyable={{
|
||||||
|
text: sellerNickname,
|
||||||
|
tooltips: ['复制昵称', '已复制'],
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
) : (
|
||||||
|
<span className="worker-order-detail-value">-</span>
|
||||||
|
)}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={isConsignment ? '卖家游戏ID' : '游戏ID'}>
|
<Descriptions.Item label={isConsignment ? '卖家游戏ID' : '游戏ID'}>
|
||||||
<span className="worker-order-detail-value">
|
{sellerGameId ? (
|
||||||
{String(
|
<Space size={6} align="center">
|
||||||
sellerFields.gameId || consignmentInfo?.sellerGameId || '',
|
<span className="worker-order-detail-value">{sellerGameId}</span>
|
||||||
).trim() || '-'}
|
<Typography.Text
|
||||||
</span>
|
copyable={{
|
||||||
|
text: sellerGameId,
|
||||||
|
tooltips: ['复制游戏ID', '已复制'],
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
) : (
|
||||||
|
<span className="worker-order-detail-value">-</span>
|
||||||
|
)}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="区服">
|
<Descriptions.Item label="区服">
|
||||||
|
{sellerServerZone ? (
|
||||||
|
<Space size={6} align="center">
|
||||||
<span className="worker-order-detail-value">
|
<span className="worker-order-detail-value">
|
||||||
{String(
|
{sellerServerZone}
|
||||||
sellerFields.serverZone || consignmentInfo?.serverZone || '',
|
|
||||||
).trim() || '-'}
|
|
||||||
</span>
|
</span>
|
||||||
|
<Typography.Text
|
||||||
|
copyable={{
|
||||||
|
text: sellerServerZone,
|
||||||
|
tooltips: ['复制区服', '已复制'],
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
) : (
|
||||||
|
<span className="worker-order-detail-value">-</span>
|
||||||
|
)}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="系统">
|
<Descriptions.Item label="系统">
|
||||||
<span className="worker-order-detail-value">
|
{sellerSystem ? (
|
||||||
{String(
|
<Space size={6} align="center">
|
||||||
sellerFields.system || consignmentInfo?.system || '',
|
<span className="worker-order-detail-value">{sellerSystem}</span>
|
||||||
).trim() || '-'}
|
<Typography.Text
|
||||||
</span>
|
copyable={{
|
||||||
|
text: sellerSystem,
|
||||||
|
tooltips: ['复制系统', '已复制'],
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
) : (
|
||||||
|
<span className="worker-order-detail-value">-</span>
|
||||||
|
)}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
{isConsignment && (sellerContact || sellerPhone) ? (
|
{isConsignment && (sellerContact || sellerPhone) ? (
|
||||||
<Descriptions.Item label="卖家联系方式" span={2}>
|
<Descriptions.Item label="卖家联系方式" span={2}>
|
||||||
|
<Space size={6} align="center" wrap>
|
||||||
<span className="worker-order-detail-value">
|
<span className="worker-order-detail-value">
|
||||||
{[
|
{[
|
||||||
sellerContact ? `微信/QQ: ${sellerContact}` : '',
|
sellerContact ? `微信/QQ: ${sellerContact}` : '',
|
||||||
@@ -2231,10 +2360,23 @@ export default function WorkOrdersPanel() {
|
|||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.join(' / ')}
|
.join(' / ')}
|
||||||
</span>
|
</span>
|
||||||
|
<Typography.Text
|
||||||
|
copyable={{
|
||||||
|
text: [
|
||||||
|
sellerContact ? `微信/QQ: ${sellerContact}` : '',
|
||||||
|
sellerPhone ? `手机: ${sellerPhone}` : '',
|
||||||
|
]
|
||||||
|
.filter(Boolean)
|
||||||
|
.join(' '),
|
||||||
|
tooltips: ['复制联系方式', '已复制'],
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
) : null}
|
) : null}
|
||||||
{isConsignment && (inventoryNo || sourceSubmissionNo) ? (
|
{isConsignment && (inventoryNo || sourceSubmissionNo) ? (
|
||||||
<Descriptions.Item label="寄售单号" span={2}>
|
<Descriptions.Item label="寄售单号" span={2}>
|
||||||
|
<Space size={6} align="center" wrap>
|
||||||
<span className="worker-order-detail-value">
|
<span className="worker-order-detail-value">
|
||||||
{[
|
{[
|
||||||
sourceSubmissionNo ? `提报单: ${sourceSubmissionNo}` : '',
|
sourceSubmissionNo ? `提报单: ${sourceSubmissionNo}` : '',
|
||||||
@@ -2243,6 +2385,13 @@ export default function WorkOrdersPanel() {
|
|||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.join(' / ')}
|
.join(' / ')}
|
||||||
</span>
|
</span>
|
||||||
|
<Typography.Text
|
||||||
|
copyable={{
|
||||||
|
text: sourceSubmissionNo || inventoryNo,
|
||||||
|
tooltips: ['复制单号', '已复制'],
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
) : null}
|
) : null}
|
||||||
<Descriptions.Item
|
<Descriptions.Item
|
||||||
|
|||||||
@@ -84,7 +84,9 @@ export function renderDetailFieldValues(items: DetailFieldItem[], emptyText: str
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Descriptions column={1} bordered size="small">
|
<Descriptions column={1} bordered size="small">
|
||||||
{items.map((item) => (
|
{items.map((item) => {
|
||||||
|
const val = String(item.value || '').trim()
|
||||||
|
return (
|
||||||
<Descriptions.Item
|
<Descriptions.Item
|
||||||
key={item.key}
|
key={item.key}
|
||||||
label={
|
label={
|
||||||
@@ -94,11 +96,17 @@ export function renderDetailFieldValues(items: DetailFieldItem[], emptyText: str
|
|||||||
</Space>
|
</Space>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<span className="worker-order-detail-value">
|
{val ? (
|
||||||
{String(item.value || '').trim() || '-'}
|
<Space size={6} align="center">
|
||||||
</span>
|
<span className="worker-order-detail-value">{val}</span>
|
||||||
|
<Typography.Text copyable={{ text: val, tooltips: ['复制', '已复制'] }} />
|
||||||
|
</Space>
|
||||||
|
) : (
|
||||||
|
<span className="worker-order-detail-value">-</span>
|
||||||
|
)}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
))}
|
)
|
||||||
|
})}
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user