Merge branch 'main' into dev
This commit is contained in:
@@ -159,7 +159,7 @@ export default function ConsignmentInventoryPanel() {
|
||||
try {
|
||||
await toggleAdminConsignmentMatching(record.id, checked)
|
||||
message.success(checked ? '已开启该物品匹配' : '已关闭该物品匹配(禁止自动匹配)')
|
||||
inventoriesQuery.refetch()
|
||||
void inventoriesQuery.refetch()
|
||||
} catch (err: any) {
|
||||
message.error(err.message || '切换匹配开关失败')
|
||||
}
|
||||
@@ -204,7 +204,7 @@ export default function ConsignmentInventoryPanel() {
|
||||
message.success(`成功入库 ${count} 件寄售物品!`)
|
||||
setInboundModalOpen(false)
|
||||
inboundForm.resetFields()
|
||||
refresh()
|
||||
await refresh()
|
||||
} catch (err: any) {
|
||||
if (err.errorFields) return
|
||||
message.error(err.message || '创建寄售物品失败')
|
||||
@@ -245,7 +245,7 @@ export default function ConsignmentInventoryPanel() {
|
||||
|
||||
message.success('更新成功!')
|
||||
setEditingItem(null)
|
||||
refresh()
|
||||
await refresh()
|
||||
} catch (err: any) {
|
||||
if (err.errorFields) return
|
||||
message.error(err.message || '更新物品失败')
|
||||
@@ -264,7 +264,7 @@ export default function ConsignmentInventoryPanel() {
|
||||
try {
|
||||
await archiveAdminConsignmentInventory(record.id)
|
||||
message.success('物品已作废')
|
||||
refresh()
|
||||
await refresh()
|
||||
} catch (err: any) {
|
||||
message.error(err.message || '下架失败')
|
||||
}
|
||||
@@ -280,7 +280,7 @@ export default function ConsignmentInventoryPanel() {
|
||||
message.success('物品已退单回库,重新进入待匹配池!')
|
||||
setReturnItem(null)
|
||||
setReturnReason('')
|
||||
refresh()
|
||||
await refresh()
|
||||
} catch (err: any) {
|
||||
message.error(err.message || '退回复库失败')
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ export default function ConsignmentSubmissionsPanel() {
|
||||
function copyPublicLink(token: string) {
|
||||
const origin = window.location.origin
|
||||
const url = `${origin}/#/consignment-collect/${token}`
|
||||
navigator.clipboard.writeText(url)
|
||||
void navigator.clipboard.writeText(url)
|
||||
message.success('收集链接已复制到剪贴板,可直接发给客户!')
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ export default function ConsignmentSubmissionsPanel() {
|
||||
try {
|
||||
await updateAdminConsignmentLink(record.id, { enabled })
|
||||
message.success(enabled ? '链接已开启' : '链接已关闭')
|
||||
linksQuery.refetch()
|
||||
await linksQuery.refetch()
|
||||
} catch (err: any) {
|
||||
message.error(err.message || '更新失败')
|
||||
}
|
||||
@@ -141,8 +141,10 @@ export default function ConsignmentSubmissionsPanel() {
|
||||
const url = `${window.location.origin}/#/consignment-collect/${token}`
|
||||
setCreatedLinkUrl(url)
|
||||
try {
|
||||
navigator.clipboard.writeText(url)
|
||||
} catch {}
|
||||
await navigator.clipboard.writeText(url)
|
||||
} catch {
|
||||
// clipboard access might be unavailable
|
||||
}
|
||||
|
||||
message.success('收集链接生成成功!')
|
||||
setCreateLinkModalOpen(false)
|
||||
@@ -181,7 +183,7 @@ export default function ConsignmentSubmissionsPanel() {
|
||||
|
||||
message.success('审核通过!已正式存入寄售库存待匹配!')
|
||||
setApproveModalItem(null)
|
||||
submissionsQuery.refetch()
|
||||
await submissionsQuery.refetch()
|
||||
} catch (err: any) {
|
||||
if (err.errorFields) return
|
||||
message.error(err.message || '审核入库失败')
|
||||
@@ -196,7 +198,7 @@ export default function ConsignmentSubmissionsPanel() {
|
||||
message.success('已驳回该提报申请')
|
||||
setRejectModalItem(null)
|
||||
setRejectNote('')
|
||||
submissionsQuery.refetch()
|
||||
await submissionsQuery.refetch()
|
||||
} catch (err: any) {
|
||||
message.error(err.message || '驳回失败')
|
||||
}
|
||||
@@ -904,7 +906,7 @@ export default function ConsignmentSubmissionsPanel() {
|
||||
type="primary"
|
||||
icon={<CopyOutlined />}
|
||||
onClick={() => {
|
||||
navigator.clipboard?.writeText(createdLinkUrl)
|
||||
void navigator.clipboard?.writeText(createdLinkUrl)
|
||||
message.success('链接已复制到剪贴板!')
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -169,7 +169,7 @@ export default function ProductMatchPanel() {
|
||||
|
||||
async function runMatchTest() {
|
||||
if (!testPayload.trim()) {
|
||||
message.warning('请选择或粘贴快手原始载荷')
|
||||
message.warning('请选择或粘贴原始订单载荷')
|
||||
return
|
||||
}
|
||||
try {
|
||||
@@ -194,7 +194,7 @@ export default function ProductMatchPanel() {
|
||||
|
||||
const sourceColumns: TableColumnsType<KuaishouMatchSource> = [
|
||||
{
|
||||
title: '快手商品 / SKU',
|
||||
title: '商品 / SKU',
|
||||
key: 'source',
|
||||
render: (_, row) => (
|
||||
<div className="cell-stack">
|
||||
@@ -252,17 +252,30 @@ export default function ProductMatchPanel() {
|
||||
{
|
||||
title: '店铺 / 商品 / SKU',
|
||||
key: 'target',
|
||||
render: (_, row) => (
|
||||
<div className="cell-stack">
|
||||
<Typography.Text ellipsis={{ tooltip: row.itemTitle }}>
|
||||
{row.itemTitle || '-'}
|
||||
</Typography.Text>
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
||||
{formatShopLabel(row.sellerId, shopNameBySellerId)} ·{' '}
|
||||
{row.skuNick || row.relSkuId || '商品默认'}
|
||||
</Typography.Text>
|
||||
</div>
|
||||
),
|
||||
render: (_, row) => {
|
||||
const payload = (row.rawPayload || {}) as Record<string, unknown>
|
||||
const outSkuSn = String(payload.out_sku_sn || payload.outSkuSn || '').trim()
|
||||
const skuLabel = outSkuSn || row.skuNick || row.relSkuId || ''
|
||||
return (
|
||||
<div className="cell-stack">
|
||||
<Typography.Text ellipsis={{ tooltip: row.itemTitle }}>
|
||||
{row.itemTitle || '-'}
|
||||
</Typography.Text>
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
||||
{formatShopLabel(row.sellerId, shopNameBySellerId)} ·{' '}
|
||||
{skuLabel ? (
|
||||
<Typography.Text type={outSkuSn ? undefined : 'secondary'} style={{ fontSize: 12 }}>
|
||||
{outSkuSn ? `编码 ${skuLabel}` : skuLabel}
|
||||
</Typography.Text>
|
||||
) : (
|
||||
<Typography.Text type="danger" style={{ fontSize: 12 }}>
|
||||
无 out_sku_sn
|
||||
</Typography.Text>
|
||||
)}
|
||||
</Typography.Text>
|
||||
</div>
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '结果',
|
||||
@@ -345,7 +358,7 @@ export default function ProductMatchPanel() {
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
style={{ minWidth: 360 }}
|
||||
placeholder="选择已接收的快手原始载荷"
|
||||
placeholder="选择已接收的原始载荷"
|
||||
options={sources.map((source, index) => ({
|
||||
value: index,
|
||||
label: `${formatShopLabel(source.sellerId, shopNameBySellerId)} · ${source.itemTitle} · ${source.skuNick || '商品默认'}`,
|
||||
@@ -363,7 +376,7 @@ export default function ProductMatchPanel() {
|
||||
value={testPayload}
|
||||
onChange={(event) => setTestPayload(event.target.value)}
|
||||
rows={16}
|
||||
placeholder="粘贴快手 send-code 原始载荷"
|
||||
placeholder="粘贴快手 send-code 或拼多多订单原始载荷(含 out_sku_sn)"
|
||||
/>
|
||||
{testResult ? (
|
||||
<div className="page-stack">
|
||||
@@ -380,12 +393,26 @@ export default function ProductMatchPanel() {
|
||||
: '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="具体 SKU">
|
||||
{testResult.context.skuNick || '-'}
|
||||
{testResult.context.skuNick || testResult.context.relSkuId || '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="商品 ID">
|
||||
{testResult.context.relItemId || '-'}
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
<JsonPreview
|
||||
value={{ mappingId: testResult.mappingId, candidates: testResult.candidates }}
|
||||
value={{
|
||||
mappingId: testResult.mappingId,
|
||||
candidates: testResult.candidates,
|
||||
diagnostics: testResult.diagnostics,
|
||||
}}
|
||||
/>
|
||||
{testResult.status !== 'matched' &&
|
||||
testResult.diagnostics?.rejectSamples?.length ? (
|
||||
<Typography.Paragraph type="secondary" style={{ marginBottom: 0 }}>
|
||||
相近未命中模板原因见上方 diagnostics.rejectSamples(常见:来源/平台写成
|
||||
91kaquan/kuaishou、shop_id 绑错店、sku_code 与 out_sku_sn 不一致)。
|
||||
</Typography.Paragraph>
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user