feat(consignment): 寄卖配置、内部匹配与打手端升级
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import { apiDelete, apiGet, apiPatch, apiPost, apiPut } from '@/lib/http'
|
||||
import type {
|
||||
AdminConsignmentProfilesResponse,
|
||||
ConsignmentContactSupporter,
|
||||
ConsignmentInventory,
|
||||
ConsignmentMatchCandidatesResponse,
|
||||
ConsignmentProfile,
|
||||
ConsignmentStatsSummary,
|
||||
ConsignmentSubmission,
|
||||
InventoryMatchableOrders,
|
||||
@@ -10,6 +13,54 @@ import type {
|
||||
WorkOrderInventoryMatchOptions,
|
||||
} from '@/types/consignment'
|
||||
|
||||
// --- 分类级寄卖配置 ---
|
||||
|
||||
export function fetchAdminConsignmentProfiles() {
|
||||
return apiGet<AdminConsignmentProfilesResponse>(
|
||||
'/api/v1/admin/worker-platform/consignment/profiles',
|
||||
)
|
||||
}
|
||||
|
||||
export function saveAdminConsignmentProfile(payload: Record<string, unknown>) {
|
||||
return apiPost<{ profile: ConsignmentProfile }>(
|
||||
'/api/v1/admin/worker-platform/consignment/profiles',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function publishAdminConsignmentProfile(profileId: number | string) {
|
||||
return apiPost<{ profile: ConsignmentProfile }>(
|
||||
`/api/v1/admin/worker-platform/consignment/profiles/${profileId}/publish`,
|
||||
{},
|
||||
)
|
||||
}
|
||||
|
||||
export function archiveAdminConsignmentProfile(profileId: number | string) {
|
||||
return apiPost<{ profile: ConsignmentProfile }>(
|
||||
`/api/v1/admin/worker-platform/consignment/profiles/${profileId}/archive`,
|
||||
{},
|
||||
)
|
||||
}
|
||||
|
||||
// --- 内部匹配(工单侧手动匹配) ---
|
||||
|
||||
export function fetchAdminConsignmentMatchCandidates(workOrderId: number | string) {
|
||||
return apiGet<ConsignmentMatchCandidatesResponse>(
|
||||
'/api/v1/admin/worker-platform/consignment/match-candidates',
|
||||
{ workOrderId },
|
||||
)
|
||||
}
|
||||
|
||||
export function matchAdminConsignmentWorkOrder(payload: {
|
||||
workOrderId: number
|
||||
inventoryIds: number[]
|
||||
}) {
|
||||
return apiPost<{ matched: boolean; matchedCount: number }>(
|
||||
'/api/v1/admin/worker-platform/consignment/match',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
// --- 对接客服名单 ---
|
||||
|
||||
export function fetchAdminConsignmentContacts(params?: { keyword?: string; enabled?: string }) {
|
||||
|
||||
Reference in New Issue
Block a user