Files
zkxw/web-admin/src/api/sample-freight.ts
T
zlwuandCursor db31990ebe feat: 细胞存储缴费催缴、统一样本信息与协议支付能力增强
汇总近期业务改动:催缴菜单与后端、样本信息快捷登记与进度、运费关联、客户档案扩展、协议优惠/期次与押金划转,并同步 SQL 迁移与管理端页面收敛。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-10 21:20:37 +08:00

102 lines
2.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import request from '@/utils/http'
export type SampleFreightItem = {
sampleSource: 'cell_storage' | 'research_donation'
sampleId: string
protocolId?: string
sampleCode?: string
protocolNo?: string
sampleTypeName?: string
motherName?: string
newbornName?: string
freightId?: string
}
export type SampleFreight = {
id: string
/** 运费批次号,格式 YF+YYYYMMDD+001~999 */
freightNo?: string
transportMode: string
transportModeLabel?: string
freightAmount: number
linkedSampleCount?: number
createBy?: string
createByName?: string
createTime?: string
items?: SampleFreightItem[]
deleted?: boolean
}
type PageList<T> = { list: T[]; total: number; page: number; pageSize: number }
export function fetchSampleFreightList(params?: {
page?: number
pageSize?: number
keyword?: string
transportMode?: string
sampleSource?: string
createTimeFrom?: string
createTimeTo?: string
includeItems?: boolean
}) {
return request.get<PageList<SampleFreight>>({
url: '/web/admin/sample-freights',
params
})
}
export function fetchSampleFreightSampleOptions(params?: {
page?: number
pageSize?: number
keyword?: string
sampleSource?: string
}) {
return request.get<PageList<SampleFreightItem>>({
url: '/web/admin/sample-freights/sample-options',
params
})
}
export function fetchSampleFreightDetail(id: string) {
return request.get<SampleFreight>({ url: `/web/admin/sample-freights/${id}` })
}
export function fetchCreateSampleFreight(data: {
transportMode: string
freightAmount: number
items: SampleFreightItem[]
}) {
return request.post<SampleFreight>({
url: '/web/admin/sample-freights',
data,
showSuccessMessage: true
})
}
export function fetchUpdateSampleFreight(
id: string,
data: { transportMode?: string; freightAmount?: number }
) {
return request.put<SampleFreight>({
url: `/web/admin/sample-freights/${id}`,
data,
showSuccessMessage: true
})
}
export function fetchLinkSampleFreight(id: string, items: SampleFreightItem[]) {
return request.post<SampleFreight>({
url: `/web/admin/sample-freights/${id}/link`,
data: { items },
showSuccessMessage: true
})
}
export function fetchUnlinkSampleFreight(id: string, items: SampleFreightItem[]) {
return request.post<SampleFreight>({
url: `/web/admin/sample-freights/${id}/unlink`,
data: { items },
showSuccessMessage: true
})
}