front/src/api/order/platformStore.ts
zzh 5191d1981f feat: 仓储模块前端、菜单同步扩展及相关页面优化
新增仓储模块页面与 API、店铺授权/店铺订单页面及路由权限目录;
扩展菜单管理同步能力支持二级子菜单与三级按钮;优化公告、仓库地址、下单等页面。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-11 15:19:35 +08:00

48 lines
2.6 KiB
TypeScript

import { axiosInstance } from '@/api/rbac'
import { assertBusinessOk, omsUrl, parseListPayload, unwrapData } from '@/api/oms/common'
function postList(path: string, body: Record<string, unknown>) {
return axiosInstance.post(omsUrl(path), body).then((res) => parseListPayload(res.data))
}
function postOk(path: string, body: Record<string, unknown>) {
return axiosInstance.post(omsUrl(path), body).then((res) => {
assertBusinessOk(res.data)
return unwrapData(res.data)
})
}
function getData(path: string, params?: Record<string, unknown>) {
return axiosInstance.get(omsUrl(path), { params }).then((res) => unwrapData(res.data))
}
// Platform store
export const getPlatformStoreList = (body: Record<string, unknown>) =>
postList('/order/platform-store/list', body)
export const getPlatformStoreAuthUrl = (body: Record<string, unknown>) =>
postOk('/order/platform-store/auth-url', body)
export const savePlatformStore = (body: Record<string, unknown>) => postOk('/order/platform-store/save', body)
export const deletePlatformStore = (ids: number[]) => postOk('/order/platform-store/delete', { ids })
// Platform store order
export const getPlatformStoreOrderList = (body: Record<string, unknown>) =>
postList('/order/platform-store-order/list', body)
export const getPlatformStoreOrderDetail = (id: number, customerId?: number) =>
getData('/order/platform-store-order/detail', { id, customerId })
export const getPlatformStoreOrderSummary = (params?: Record<string, unknown>) =>
getData('/order/platform-store-order/summary', params)
export const syncPlatformStoreOrderStatus = (ids: number[], customerId?: number) =>
postOk('/order/platform-store-order/sync-status', { ids, customerId })
export const readyToShipPlatformStoreOrder = (ids: number[], customerId?: number) =>
postOk('/order/platform-store-order/ready-to-ship', { ids, customerId })
export const matchPlatformStoreOrderInventory = (body: Record<string, unknown>) =>
postOk('/order/platform-store-order/match-inventory', body)
export const batchMatchPlatformStoreOrderInventory = (body: Record<string, unknown>) =>
postOk('/order/platform-store-order/batch-match-inventory', body)
export const fetchPlatformStoreOrderLabel = (id: number, customerId?: number) =>
postOk('/order/platform-store-order/fetch-label', { id, customerId })
export const togglePlatformStoreOrderSuspend = (body: Record<string, unknown>) =>
postOk('/order/platform-store-order/toggle-suspend', body)
export const deletePlatformStoreOrder = (ids: number[], customerId?: number) =>
postOk('/order/platform-store-order/delete', { ids, customerId })