190 lines
4.8 KiB
TypeScript
190 lines
4.8 KiB
TypeScript
import request from '@/utils/http'
|
|
|
|
type PageList<T> = {
|
|
list: T[]
|
|
total: number
|
|
page: number
|
|
pageSize: number
|
|
totalPages?: number
|
|
}
|
|
|
|
export function fetchSamplePayments(protocolId: string) {
|
|
return request.get<Array<Record<string, unknown>>>({
|
|
url: `/web/admin/collection-protocols/${protocolId}/sample-payments`
|
|
})
|
|
}
|
|
|
|
export function fetchPutSamplePayments(
|
|
protocolId: string,
|
|
data: { samplePayments: Array<Record<string, unknown>> }
|
|
) {
|
|
return request.put({
|
|
url: `/web/admin/collection-protocols/${protocolId}/sample-payments`,
|
|
data,
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchCreatePaymentTransfer(data: Record<string, unknown>) {
|
|
return request.post({
|
|
url: '/web/admin/payment-transfers',
|
|
data,
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchUpdatePaymentTransfer(transferId: string, data: Record<string, unknown>) {
|
|
return request.put({
|
|
url: `/web/admin/payment-transfers/${transferId}`,
|
|
data,
|
|
showSuccessMessage: false
|
|
})
|
|
}
|
|
|
|
export function fetchSubmitPaymentTransferFinance(
|
|
transferId: string,
|
|
options?: { showSuccessMessage?: boolean }
|
|
) {
|
|
return request.post({
|
|
url: `/web/admin/payment-transfers/${transferId}/submit-receipt-finance`,
|
|
showSuccessMessage: options?.showSuccessMessage !== false
|
|
})
|
|
}
|
|
|
|
export function fetchWithdrawPaymentTransfer(transferId: string) {
|
|
return request.post({
|
|
url: `/web/admin/payment-transfers/${transferId}/withdraw`,
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchDeletePaymentTransfer(transferId: string) {
|
|
return request.del({
|
|
url: `/web/admin/payment-transfers/${transferId}`,
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchPaymentTransferList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
payStatus?: string
|
|
keyword?: string
|
|
installmentDueDateStart?: string
|
|
installmentDueDateEnd?: string
|
|
}) {
|
|
return request.get<PageList<Record<string, unknown>>>({
|
|
url: '/web/admin/payment-transfers',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchPaymentTransferReceiptConfirmList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
installmentDueDateStart?: string
|
|
installmentDueDateEnd?: string
|
|
}) {
|
|
return request.get<PageList<Record<string, unknown>>>({
|
|
url: '/web/admin/payment-transfers/receipt-confirm',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchPaymentTransferReceiptConfirmedList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
installmentDueDateStart?: string
|
|
installmentDueDateEnd?: string
|
|
}) {
|
|
return request.get<PageList<Record<string, unknown>>>({
|
|
url: '/web/admin/payment-transfers/receipt-confirmed',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchConfirmPaymentTransfer(
|
|
transferId: string,
|
|
data?: { financeConfirmAttachments?: string; financeRemark?: string }
|
|
) {
|
|
return request.post({
|
|
url: `/web/admin/payment-transfers/${transferId}/receipt-confirm`,
|
|
data: data || {},
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchRejectPaymentTransfer(transferId: string, data?: { financeRemark?: string }) {
|
|
return request.post({
|
|
url: `/web/admin/payment-transfers/${transferId}/receipt-reject`,
|
|
data: data || {},
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchProtocolRefundRecords(protocolId: string) {
|
|
return request.get<Array<Record<string, unknown>>>({
|
|
url: `/web/admin/collection-protocols/${protocolId}/refund-records`
|
|
})
|
|
}
|
|
|
|
export function fetchCreateProtocolRefundRecord(protocolId: string, data: Record<string, unknown>) {
|
|
return request.post({
|
|
url: `/web/admin/collection-protocols/${protocolId}/refund-records`,
|
|
data,
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchUpdateProtocolRefundRecord(recordId: string, data: Record<string, unknown>) {
|
|
return request.put({
|
|
url: `/web/admin/protocol-refund-records/${recordId}`,
|
|
data,
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchDeleteProtocolRefundRecord(recordId: string) {
|
|
return request.del({
|
|
url: `/web/admin/protocol-refund-records/${recordId}`,
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchSamplePaymentList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
payMode?: string
|
|
progressStatus?: string
|
|
installmentDueDateStart?: string
|
|
installmentDueDateEnd?: string
|
|
}) {
|
|
return request.get<PageList<Record<string, unknown>>>({
|
|
url: '/web/admin/sample-payments',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchSamplePaymentDetail(samplePaymentId: string) {
|
|
return request.get<Record<string, unknown>>({
|
|
url: `/web/admin/sample-payments/${samplePaymentId}`
|
|
})
|
|
}
|
|
|
|
export function fetchPaymentChaseList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
chaseType?: string
|
|
payMode?: string
|
|
salesUserId?: string
|
|
}) {
|
|
return request.get<PageList<Record<string, unknown>>>({
|
|
url: '/web/admin/payment-chase',
|
|
params
|
|
})
|
|
}
|