为细胞存储与科研捐赠协议增加 append-only 操作日志,覆盖 Web/小程序 create/update/delete/状态类动作,并在查看弹窗与移动详情提供操作日志入口(Issue #24)。 Co-authored-by: Cursor <cursoragent@cursor.com>
347 lines
8.9 KiB
TypeScript
347 lines
8.9 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
|
|
projectId?: string
|
|
teamId?: string
|
|
keyword?: string
|
|
protocolStatus?: string
|
|
createTimeStart?: string
|
|
createTimeEnd?: string
|
|
sampleCollectTimeStart?: string
|
|
sampleCollectTimeEnd?: string
|
|
}) {
|
|
return request.get<PageList<CollectionProtocolRow>>({
|
|
url: '/web/admin/collection-protocols',
|
|
params
|
|
})
|
|
}
|
|
|
|
export type ProtocolRegionManager = { id: string; nickName: string; regionIds: string[] }
|
|
|
|
export function fetchProtocolRegionManagers() {
|
|
return request.get<{ list: ProtocolRegionManager[] }>({
|
|
url: '/web/admin/collection-protocols/region-managers'
|
|
})
|
|
}
|
|
|
|
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
|
|
samplePayments?: Array<Record<string, unknown>> | null
|
|
attachments?: Array<Record<string, unknown>>
|
|
storageCert?: Record<string, unknown> | null
|
|
}>({
|
|
url: `/web/admin/collection-protocols/${id}`
|
|
})
|
|
}
|
|
|
|
export function fetchCollectionProtocolStatusChanges(protocolId: string) {
|
|
return request.get<{ list: Array<Record<string, unknown>> }>({
|
|
url: `/web/admin/collection-protocols/${protocolId}/status-changes`
|
|
})
|
|
}
|
|
|
|
export function fetchCollectionProtocolOperationLogs(protocolId: string) {
|
|
return request.get<{ list: Array<Record<string, unknown>> }>({
|
|
url: `/web/admin/collection-protocols/${protocolId}/operation-logs`
|
|
})
|
|
}
|
|
|
|
export function fetchCollectionProtocolAuditList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
auditStatus?: string
|
|
collectionProtocolId?: 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
|
|
keyword?: string
|
|
installmentDueDateStart?: string
|
|
installmentDueDateEnd?: string
|
|
}) {
|
|
return request.get<PageList<Record<string, unknown>>>({
|
|
url: '/web/admin/protocol-payment-details/receipt-confirm',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchReceiptConfirmedList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
installmentDueDateStart?: string
|
|
installmentDueDateEnd?: string
|
|
}) {
|
|
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 fetchReceiptConfirmReject(detailId: string) {
|
|
return request.post({
|
|
url: `/web/admin/protocol-payment-details/${detailId}/receipt-reject`,
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchRefundConfirmList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
installmentDueDateStart?: string
|
|
installmentDueDateEnd?: string
|
|
}) {
|
|
return request.get<PageList<Record<string, unknown>>>({
|
|
url: '/web/admin/protocol-payment-details/refund-confirm',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchRefundConfirmedList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
installmentDueDateStart?: string
|
|
installmentDueDateEnd?: string
|
|
}) {
|
|
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 fetchRefundConfirmReject(detailId: string) {
|
|
return request.post({
|
|
url: `/web/admin/protocol-payment-details/${detailId}/refund-reject`,
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export type PaymentDetailDraftPayload = {
|
|
transferType?: string
|
|
transferAmount?: number | null
|
|
transferTime?: string | null
|
|
transferAttachments?: string
|
|
remark?: string
|
|
}
|
|
|
|
export function fetchUpdatePaymentDetailDraft(
|
|
detailId: string,
|
|
data: PaymentDetailDraftPayload,
|
|
options?: { showSuccessMessage?: boolean }
|
|
) {
|
|
return request.put({
|
|
url: `/web/admin/protocol-payment-details/${detailId}`,
|
|
data,
|
|
showSuccessMessage: options?.showSuccessMessage ?? true
|
|
})
|
|
}
|
|
|
|
export function fetchSubmitReceiptFinance(
|
|
detailId: string,
|
|
data?: PaymentDetailDraftPayload,
|
|
options?: { showSuccessMessage?: boolean }
|
|
) {
|
|
return request.post({
|
|
url: `/web/admin/protocol-payment-details/${detailId}/submit-receipt-finance`,
|
|
data: data || {},
|
|
showSuccessMessage: options?.showSuccessMessage !== false
|
|
})
|
|
}
|
|
|
|
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
|
|
installmentDueDateStart?: string
|
|
installmentDueDateEnd?: 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
|
|
})
|
|
}
|
|
|
|
export function fetchInvoiceEligiblePayments(protocolId: string) {
|
|
return request.get<{ list: Record<string, unknown>[]; total: number }>({
|
|
url: `/web/admin/collection-protocols/${protocolId}/invoice-eligible-payments`
|
|
})
|
|
}
|
|
|
|
export function fetchProtocolInvoiceRequests(protocolId: string) {
|
|
return request.get<{ list: Record<string, unknown>[]; total: number }>({
|
|
url: `/web/admin/collection-protocols/${protocolId}/invoice-requests`
|
|
})
|
|
}
|
|
|
|
export function fetchCreateProtocolInvoiceRequest(
|
|
protocolId: string,
|
|
data: {
|
|
paymentDetailIds: string[]
|
|
invoiceTitle?: string
|
|
taxNo?: string
|
|
companyAddress?: string
|
|
companyPhone?: string
|
|
bankName?: string
|
|
bankAccount?: string
|
|
applyRemark?: string
|
|
}
|
|
) {
|
|
return request.post({
|
|
url: `/web/admin/collection-protocols/${protocolId}/invoice-requests`,
|
|
data,
|
|
showSuccessMessage: true
|
|
})
|
|
}
|
|
|
|
export function fetchProtocolInvoiceRequestList(params: {
|
|
status: 'dkp' | 'ykp'
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
}) {
|
|
return request.get<PageList<Record<string, unknown>>>({
|
|
url: '/web/admin/protocol-invoice-requests',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchProtocolInvoicePendingCount() {
|
|
return request.get<{ count: number }>({
|
|
url: '/web/admin/protocol-invoice-requests/pending-count'
|
|
})
|
|
}
|
|
|
|
export function fetchCompleteProtocolInvoiceRequest(
|
|
requestId: string,
|
|
data: { invoiceAttachments: string; financeRemark?: string }
|
|
) {
|
|
return request.put({
|
|
url: `/web/admin/protocol-invoice-requests/${requestId}/complete`,
|
|
data,
|
|
showSuccessMessage: true
|
|
})
|
|
}
|