196 lines
5.0 KiB
TypeScript
196 lines
5.0 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>>
|
|
storageCert?: Record<string, unknown> | null
|
|
}>({
|
|
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 fetchReceiptConfirmedList(params?: { page?: number; pageSize?: number }) {
|
|
return request.get<PageList<Record<string, unknown>>>({
|
|
url: '/web/admin/protocol-payment-details/receipt-confirmed',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchReceiptConfirmSubmit(
|
|
detailId: string,
|
|
data?: { financeConfirmAttachments?: string; financeRemark?: 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 fetchRefundConfirmedList(params?: { page?: number; pageSize?: number }) {
|
|
return request.get<PageList<Record<string, unknown>>>({
|
|
url: '/web/admin/protocol-payment-details/refund-confirmed',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchRefundConfirmSubmit(
|
|
detailId: string,
|
|
data?: { refundFinanceConfirmAttachments?: string; refundFinanceRemark?: string }
|
|
) {
|
|
return request.post({
|
|
url: `/web/admin/protocol-payment-details/${detailId}/refund-confirm`,
|
|
data: data || {},
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchSubmitReceiptFinance(detailId: string) {
|
|
return request.post({
|
|
url: `/web/admin/protocol-payment-details/${detailId}/submit-receipt-finance`,
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchSubmitReceiptFinanceBatch(detailIds: string[]) {
|
|
return request.post({
|
|
url: '/web/admin/protocol-payment-details/submit-receipt-finance-batch',
|
|
data: { detailIds },
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchSubmitRefundFinance(
|
|
detailId: string,
|
|
data: {
|
|
refundAmount: number
|
|
refundRemark?: string
|
|
refundAttachments?: string
|
|
}
|
|
) {
|
|
return request.post({
|
|
url: `/web/admin/protocol-payment-details/${detailId}/submit-refund-finance`,
|
|
data,
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchSubmitRefundFinanceBatch(data: {
|
|
detailIds: string[]
|
|
refundAmount: number
|
|
refundRemark?: string
|
|
refundAttachments?: string
|
|
}) {
|
|
return request.post({
|
|
url: '/web/admin/protocol-payment-details/submit-refund-finance-batch',
|
|
data,
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchPaymentDetailList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
payStatus?: string
|
|
keyword?: string
|
|
transferType?: string
|
|
}) {
|
|
return request.get<PageList<Record<string, unknown>>>({
|
|
url: '/web/admin/protocol-payment-details',
|
|
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
|
|
})
|
|
}
|