feat(web-admin): wire protocol sample freight batch UI
Replace per-sample transport fee entry with shared freight batch config in storage and donation protocol dialogs, and show mode/amount in view dialogs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
468a7c5e12
commit
5dd545ba5c
6 files changed
+551
-293
No files matched your search
@@ -0,0 +1,75 @@
|
||||
import request from '@/utils/http'
|
||||
|
||||
export type SampleFreightItem = {
|
||||
sampleSource: 'cell_storage' | 'research_donation'
|
||||
sampleId: string
|
||||
protocolId?: string
|
||||
sampleCode?: string
|
||||
}
|
||||
|
||||
export type SampleFreight = {
|
||||
id: string
|
||||
transportMode: string
|
||||
transportModeLabel?: string
|
||||
freightAmount: number
|
||||
linkedSampleCount?: number
|
||||
createTime?: string
|
||||
items?: Array<SampleFreightItem & { protocolNo?: string }>
|
||||
deleted?: boolean
|
||||
}
|
||||
|
||||
type PageList<T> = { list: T[]; total: number; page: number; pageSize: number }
|
||||
|
||||
export function fetchSampleFreightList(params?: {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
keyword?: string
|
||||
}) {
|
||||
return request.get<PageList<SampleFreight>>({
|
||||
url: '/web/admin/sample-freights',
|
||||
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
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user