239 lines
5.5 KiB
TypeScript
239 lines
5.5 KiB
TypeScript
import request from '@/utils/http'
|
|
|
|
/**
|
|
* 订单与订单页依赖的少量接口(其余业务 API 已移除,需要时再加回)。
|
|
*/
|
|
|
|
export function fetchOrderList(params: {
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
status?: string
|
|
orderStatus?: string
|
|
deliveryStatus?: string
|
|
payStatus?: string
|
|
paymentMethod?: string
|
|
regionId?: string
|
|
clientId?: string
|
|
startDate?: string
|
|
endDate?: string
|
|
}) {
|
|
return request.get<{
|
|
list: Api.Order.OrderItem[]
|
|
total: number
|
|
page: number
|
|
pageSize: number
|
|
totalPages: number
|
|
}>({
|
|
url: '/web/admin/orders',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchOrderDetail(id: string) {
|
|
return request.get<Api.Order.OrderDetail>({
|
|
url: `/web/admin/orders/${id}`
|
|
})
|
|
}
|
|
|
|
export function fetchAssignDelivery(data: {
|
|
orderId: string
|
|
deliverId: string
|
|
deliveryDeadlineAt: string
|
|
dispatchRemark?: string
|
|
}) {
|
|
return request.post({
|
|
url: `/web/admin/orders/${data.orderId}/assign-deliverer`,
|
|
params: {
|
|
deliverId: data.deliverId,
|
|
deliveryDeadlineAt: data.deliveryDeadlineAt,
|
|
dispatchRemark: data.dispatchRemark || ''
|
|
}
|
|
})
|
|
}
|
|
|
|
export function fetchReviewCancel(data: { orderId: string; approved: boolean; note?: string }) {
|
|
return request.post({
|
|
url: `/web/admin/orders/${data.orderId}/review-cancel`,
|
|
params: { approved: data.approved, note: data.note }
|
|
})
|
|
}
|
|
|
|
export function fetchCancelOrder(data: {
|
|
orderId: string
|
|
reason: string
|
|
note?: string
|
|
evidenceImageUrls?: string[]
|
|
}) {
|
|
return request.post({
|
|
url: `/web/admin/orders/${data.orderId}/cancel`,
|
|
params: {
|
|
reason: data.reason,
|
|
note: data.note,
|
|
evidenceImageUrls: data.evidenceImageUrls || []
|
|
}
|
|
})
|
|
}
|
|
|
|
export function fetchOrderAdjusts(orderId: string) {
|
|
return request.get({
|
|
url: `/web/admin/orders/${orderId}/adjusts`
|
|
})
|
|
}
|
|
|
|
export function fetchAdjustOrder(data: {
|
|
orderId: string
|
|
adjustments?: Array<{
|
|
orderItemId: string
|
|
adjustType: 'reduce' | 'delete' | 'substitute' | 'increase'
|
|
newQuantity?: number
|
|
newProductId?: string
|
|
reason: string
|
|
}>
|
|
addressUpdate?: {
|
|
deliveryAddress?: string
|
|
contactPerson?: string
|
|
contactPhone?: string
|
|
reason?: string
|
|
}
|
|
}) {
|
|
return request.post({
|
|
url: `/web/admin/orders/${data.orderId}/adjust`,
|
|
params: {
|
|
adjustments: data.adjustments || [],
|
|
addressUpdate: data.addressUpdate || undefined
|
|
}
|
|
})
|
|
}
|
|
|
|
export function fetchOrderItems(orderId: string) {
|
|
return request.get({
|
|
url: `/web/admin/orders/${orderId}/items`
|
|
})
|
|
}
|
|
|
|
export function fetchPriceVersionDetail(id: string) {
|
|
return request.get({
|
|
url: `/web/admin/price-versions/${id}`
|
|
})
|
|
}
|
|
|
|
export function fetchUploadAttachment(data: FormData) {
|
|
return request.post<{
|
|
id: string
|
|
fileName: string
|
|
fileUrl: string
|
|
fileSize: number
|
|
fileSizeDisplay?: string
|
|
fileType?: string
|
|
}>({
|
|
url: '/web/admin/attachment/upload',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function fetchAttachmentDownloadUrl(data: { fileUrl: string; fileName?: string }) {
|
|
return request.post<{ downloadUrl: string }>({
|
|
url: '/web/admin/attachment/download-url',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function fetchUploadProductImage(data: FormData) {
|
|
return request.post({
|
|
url: '/web/admin/products/upload-image',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function fetchSystemConfig() {
|
|
return request.get({
|
|
url: '/web/admin/system-config/settings'
|
|
})
|
|
}
|
|
|
|
// ─── 临床应用缴费 ─────────────────────────────────────
|
|
|
|
export function fetchClinicalPayments(params: any) {
|
|
return request.get({
|
|
url: '/web/admin/clinical-payments',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchClinicalPaymentDetail(id: string) {
|
|
return request.get({
|
|
url: `/web/admin/clinical-payments/${id}`
|
|
})
|
|
}
|
|
|
|
export function submitClinicalReceipt(id: string, data?: Record<string, unknown>) {
|
|
return request.post({
|
|
url: `/web/admin/clinical-payments/${id}/submit-receipt`,
|
|
params: data
|
|
})
|
|
}
|
|
|
|
export function batchSubmitClinicalReceipt(ids: string[], data?: Record<string, unknown>) {
|
|
return request.post({
|
|
url: '/web/admin/clinical-payments/submit-receipt-batch',
|
|
params: { paymentIds: ids, ...data }
|
|
})
|
|
}
|
|
|
|
export function confirmClinicalReceipt(id: string, data: any) {
|
|
return request.post({
|
|
url: `/web/admin/clinical-payments/${id}/confirm-receipt`,
|
|
params: data
|
|
})
|
|
}
|
|
|
|
export function submitClinicalRefund(id: string, data: any) {
|
|
return request.post({
|
|
url: `/web/admin/clinical-payments/${id}/submit-refund`,
|
|
params: data
|
|
})
|
|
}
|
|
|
|
export function batchSubmitClinicalRefund(ids: string[], data: any) {
|
|
return request.post({
|
|
url: '/web/admin/clinical-payments/submit-refund-batch',
|
|
params: { ...data, paymentIds: ids }
|
|
})
|
|
}
|
|
|
|
export function confirmClinicalRefund(id: string, data: any) {
|
|
return request.post({
|
|
url: `/web/admin/clinical-payments/${id}/confirm-refund`,
|
|
params: data
|
|
})
|
|
}
|
|
|
|
export function fetchClinicalReceiptPending(params: any) {
|
|
return request.get({
|
|
url: '/web/admin/clinical-payments/receipt-pending',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchClinicalReceiptConfirmed(params: any) {
|
|
return request.get({
|
|
url: '/web/admin/clinical-payments/receipt-confirmed',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchClinicalRefundPending(params: any) {
|
|
return request.get({
|
|
url: '/web/admin/clinical-payments/refund-pending',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchClinicalRefundConfirmed(params: any) {
|
|
return request.get({
|
|
url: '/web/admin/clinical-payments/refund-confirmed',
|
|
params
|
|
})
|
|
}
|