136 lines
3.4 KiB
TypeScript
136 lines
3.4 KiB
TypeScript
import request from '@/utils/http'
|
|
|
|
type PageList<T> = {
|
|
list: T[]
|
|
total: number
|
|
page: number
|
|
pageSize: number
|
|
totalPages: number
|
|
}
|
|
|
|
/** 采集协议单列表项(camelCase,与后端一致) */
|
|
export type CollectionProtocolRow = Record<string, unknown>
|
|
|
|
export function fetchCollectionProtocolList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
protocolStatus?: string
|
|
}) {
|
|
return request.get<PageList<CollectionProtocolRow>>({
|
|
url: '/web/admin/collection-protocols',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchCollectionProtocolDetail(id: string) {
|
|
return request.get<{
|
|
protocol: Record<string, unknown>
|
|
partyCustomer: Record<string, unknown> | null
|
|
collectionInfo: Record<string, unknown> | null
|
|
samples: Array<Record<string, unknown>> | null
|
|
payment: Record<string, unknown> | null
|
|
paymentDetails: Array<Record<string, unknown>> | null
|
|
attachments?: Array<Record<string, unknown>>
|
|
}>({
|
|
url: `/web/admin/collection-protocols/${id}`
|
|
})
|
|
}
|
|
|
|
export function fetchCollectionProtocolAuditList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
auditStatus?: string
|
|
}) {
|
|
return request.get<PageList<Record<string, unknown>>>({
|
|
url: '/web/admin/collection-protocol-audits',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchSubmitProtocolAudit(
|
|
protocolId: string,
|
|
data: { auditStatus: string; auditRemark?: string },
|
|
options?: { showSuccessMessage?: boolean }
|
|
) {
|
|
return request.post({
|
|
url: `/web/admin/collection-protocols/${protocolId}/audit`,
|
|
data,
|
|
showSuccessMessage: options?.showSuccessMessage ?? true
|
|
})
|
|
}
|
|
|
|
export function fetchReceiptConfirmList(params?: { page?: number; pageSize?: number }) {
|
|
return request.get<PageList<Record<string, unknown>>>({
|
|
url: '/web/admin/protocol-payment-details/receipt-confirm',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchReceiptConfirmSubmit(
|
|
detailId: string,
|
|
data?: { financeConfirmAttachments?: string }
|
|
) {
|
|
return request.post({
|
|
url: `/web/admin/protocol-payment-details/${detailId}/receipt-confirm`,
|
|
data: data || {},
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchRefundConfirmList(params?: { page?: number; pageSize?: number }) {
|
|
return request.get<PageList<Record<string, unknown>>>({
|
|
url: '/web/admin/protocol-payment-details/refund-confirm',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchRefundConfirmSubmit(
|
|
detailId: string,
|
|
data?: { financeConfirmAttachments?: string }
|
|
) {
|
|
return request.post({
|
|
url: `/web/admin/protocol-payment-details/${detailId}/refund-confirm`,
|
|
data: data || {},
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchInstallmentWarningList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
warningType?: string
|
|
}) {
|
|
return request.get<PageList<Record<string, unknown>>>({
|
|
url: '/web/admin/protocol-payment-details/installment-warning',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchCreateCollectionProtocol(data: Record<string, unknown>) {
|
|
return request.post({
|
|
url: '/web/admin/collection-protocols',
|
|
data,
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchUpdateCollectionProtocol(
|
|
id: string,
|
|
data: Record<string, unknown>
|
|
) {
|
|
return request.put({
|
|
url: `/web/admin/collection-protocols/${id}`,
|
|
data,
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchDeleteCollectionProtocol(id: string) {
|
|
return request.del({
|
|
url: `/web/admin/collection-protocols/${id}`,
|
|
showSuccessMessage: true
|
|
})
|
|
}
|