feat:寄卖增加对接客服,db脚本迁移修复
This commit is contained in:
@@ -28,6 +28,7 @@ import {
|
||||
resolveManualMatchRequirement,
|
||||
type ManualMatchType,
|
||||
} from '@/utils/consignment-manual-match'
|
||||
import { formatConsignmentContactSupporter } from '@/utils/consignment-contact'
|
||||
import { formatDateTime } from '@/utils/date-time'
|
||||
import { notifyVoucherConsume } from '@/utils/voucher-consume'
|
||||
|
||||
@@ -45,6 +46,10 @@ type Selected = {
|
||||
/** 供货打手(用于回显供货来源) */
|
||||
workerId?: number | null
|
||||
workerName?: string
|
||||
/** 对接客服(用于履约前核对归属) */
|
||||
contactSupporterName?: string
|
||||
contactSupporterPhone?: string
|
||||
contactSupporterWechat?: string
|
||||
}
|
||||
|
||||
export type ConsignmentManualMatchModalProps = {
|
||||
@@ -79,6 +84,11 @@ export default function ConsignmentManualMatchModal({
|
||||
workerId: number | null
|
||||
workerName: string
|
||||
} | null>(null)
|
||||
const [inventoryContact, setInventoryContact] = useState<{
|
||||
contactSupporterName: string
|
||||
contactSupporterPhone: string
|
||||
contactSupporterWechat: string
|
||||
} | null>(null)
|
||||
const [selected, setSelected] = useState<Selected | null>(null)
|
||||
const [confirmedPartial, setConfirmedPartial] = useState(false)
|
||||
const [confirmedMismatch, setConfirmedMismatch] = useState(false)
|
||||
@@ -94,6 +104,7 @@ export default function ConsignmentManualMatchModal({
|
||||
setConfirmedMismatch(false)
|
||||
setMatchNote('')
|
||||
setInventoryInboundAt('')
|
||||
setInventoryContact(null)
|
||||
}
|
||||
|
||||
const load = async () => {
|
||||
@@ -116,6 +127,11 @@ export default function ConsignmentManualMatchModal({
|
||||
workerId: res.data?.inventory?.workerId ?? null,
|
||||
workerName: res.data?.inventory?.workerName || '',
|
||||
})
|
||||
setInventoryContact({
|
||||
contactSupporterName: res.data?.inventory?.contactSupporterName || '',
|
||||
contactSupporterPhone: res.data?.inventory?.contactSupporterPhone || '',
|
||||
contactSupporterWechat: res.data?.inventory?.contactSupporterWechat || '',
|
||||
})
|
||||
} else if (workOrder) {
|
||||
const res = await fetchWorkOrderConsignmentMatchOptions(workOrder.workOrderId)
|
||||
setOptions(res.data?.options || [])
|
||||
@@ -319,7 +335,8 @@ export default function ConsignmentManualMatchModal({
|
||||
? `${option.inventory.diamondLevel}钻`
|
||||
: ''}{' '}
|
||||
· 货源 {option.inventory.workerName || '未关联打手'} · 结算价 ¥
|
||||
{(Number(option.inventory.costPriceFen || 0) / 100).toFixed(2)}
|
||||
{(Number(option.inventory.costPriceFen || 0) / 100).toFixed(2)} ·
|
||||
对接客服 {formatConsignmentContactSupporter(option.inventory).text}
|
||||
{option.inventory.inboundAt || option.inventory.createdAt ? (
|
||||
<>
|
||||
{' '}
|
||||
@@ -356,6 +373,9 @@ export default function ConsignmentManualMatchModal({
|
||||
conflicts: option.conflicts,
|
||||
workerId: option.inventory.workerId,
|
||||
workerName: option.inventory.workerName,
|
||||
contactSupporterName: option.inventory.contactSupporterName,
|
||||
contactSupporterPhone: option.inventory.contactSupporterPhone,
|
||||
contactSupporterWechat: option.inventory.contactSupporterWechat,
|
||||
})
|
||||
setConfirmedPartial(false)
|
||||
setConfirmedMismatch(false)
|
||||
@@ -439,6 +459,9 @@ export default function ConsignmentManualMatchModal({
|
||||
conflicts: order.conflicts,
|
||||
workerId: inventoryWorker?.workerId ?? null,
|
||||
workerName: inventoryWorker?.workerName || '',
|
||||
contactSupporterName: inventoryContact?.contactSupporterName || '',
|
||||
contactSupporterPhone: inventoryContact?.contactSupporterPhone || '',
|
||||
contactSupporterWechat: inventoryContact?.contactSupporterWechat || '',
|
||||
})
|
||||
setConfirmedPartial(false)
|
||||
setConfirmedMismatch(false)
|
||||
@@ -492,6 +515,9 @@ export default function ConsignmentManualMatchModal({
|
||||
<Tag color="default">内部库存现货(无打手关联)</Tag>
|
||||
)}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="对接客服">
|
||||
{formatConsignmentContactSupporter(selected).text}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="匹配判定">
|
||||
<Tag color={describeManualMatchType(selected.matchType).color}>
|
||||
{describeManualMatchType(selected.matchType).label}
|
||||
|
||||
Reference in New Issue
Block a user