82 lines
1.7 KiB
TypeScript
82 lines
1.7 KiB
TypeScript
import request from '@/utils/http'
|
|
|
|
type PageList<T> = {
|
|
list: T[]
|
|
total: number
|
|
page: number
|
|
pageSize: number
|
|
totalPages: number
|
|
}
|
|
|
|
export type QcTask = {
|
|
id: string
|
|
workOrderId: string
|
|
workOrderNo?: string
|
|
taskNo: string
|
|
taskType: string
|
|
itemCode: string
|
|
itemName: string
|
|
companyId?: string
|
|
companyName?: string
|
|
feeAmount?: number
|
|
taskStatus: string
|
|
thirdPartyAttachments?: string
|
|
attachmentFiles?: Array<{ id?: string; fileUrl: string; fileName?: string; fileType?: string }>
|
|
completedTime?: string
|
|
completedBy?: string
|
|
remark?: string
|
|
createTime?: string
|
|
updateTime?: string
|
|
}
|
|
|
|
export type QcTaskDetail = QcTask & {
|
|
protocolNo?: string
|
|
sampleCode?: string
|
|
attachmentFiles?: Array<{ id?: string; fileUrl: string; fileName?: string }>
|
|
results?: Array<{
|
|
paramName: string
|
|
paramUnit?: string
|
|
paramType: string
|
|
paramValue: string
|
|
}>
|
|
}
|
|
|
|
export function fetchQcTaskList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
taskType?: string
|
|
taskStatus?: string
|
|
workOrderId?: string
|
|
}) {
|
|
return request.get<PageList<QcTask>>({
|
|
url: '/web/admin/qc-tasks',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchQcTaskDetail(id: string) {
|
|
return request.get<QcTaskDetail>({
|
|
url: `/web/admin/qc-tasks/${id}`
|
|
})
|
|
}
|
|
|
|
export function fetchStartQcTask(id: string) {
|
|
return request.post<QcTask>({
|
|
url: `/web/admin/qc-tasks/${id}/start`
|
|
})
|
|
}
|
|
|
|
export function fetchCompleteQcTask(id: string) {
|
|
return request.post<QcTask>({
|
|
url: `/web/admin/qc-tasks/${id}/complete`
|
|
})
|
|
}
|
|
|
|
export function fetchUpdateQcTaskAttachments(id: string, thirdPartyAttachments: string) {
|
|
return request.put<QcTask>({
|
|
url: `/web/admin/qc-tasks/${id}/attachments`,
|
|
data: { thirdPartyAttachments }
|
|
})
|
|
}
|