89 lines
2.2 KiB
TypeScript
89 lines
2.2 KiB
TypeScript
import request from '@/utils/http'
|
|
import type { QcWorkOrderReceptionDetail } from '@/api/qc-work-order'
|
|
|
|
export interface ProductionWorkOrderItem {
|
|
id: string
|
|
workOrderNo: string
|
|
workOrderType?: string
|
|
protocolNo?: string
|
|
sampleCode?: string
|
|
receptionSource?: string
|
|
receptionSourceLabel?: string
|
|
sampleTypeName?: string
|
|
handlerName?: string
|
|
receptionTime?: string
|
|
workOrderStatus: string
|
|
createTime?: string
|
|
remark?: string
|
|
}
|
|
|
|
export type ProductionWorkOrderDetail = ProductionWorkOrderItem & {
|
|
reception?: QcWorkOrderReceptionDetail
|
|
}
|
|
|
|
export function fetchProductionWorkOrderList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
workOrderStatus?: string
|
|
workOrderType?: string
|
|
createTimeStart?: string
|
|
createTimeEnd?: string
|
|
}) {
|
|
return request.get<{
|
|
list: ProductionWorkOrderItem[]
|
|
total: number
|
|
page: number
|
|
pageSize: number
|
|
totalPages: number
|
|
}>({ url: '/web/admin/production-work-orders', params })
|
|
}
|
|
|
|
export function fetchProductionWorkOrderDetail(id: string) {
|
|
return request.get<ProductionWorkOrderDetail>({ url: `/web/admin/production-work-orders/${id}` })
|
|
}
|
|
|
|
export function fetchCompleteProductionWorkOrder(id: string, data: Record<string, any>) {
|
|
return request.put({ url: `/web/admin/production-work-orders/${id}/complete`, params: data })
|
|
}
|
|
|
|
export function fetchCreateProductionWorkOrder(data: {
|
|
workOrderType?: string
|
|
protocolNo?: string
|
|
sampleCode?: string
|
|
receptionSource?: string
|
|
remark?: string
|
|
}) {
|
|
return request.post<ProductionWorkOrderItem>({
|
|
url: '/web/admin/production-work-orders',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function fetchConfigureProductionWorkOrder(
|
|
id: string,
|
|
data: {
|
|
taskName?: string
|
|
taskType?: string
|
|
routeId?: string
|
|
description?: string
|
|
remark?: string
|
|
}
|
|
) {
|
|
return request.post<ProductionWorkOrderItem>({
|
|
url: `/web/admin/production-work-orders/${id}/configure`,
|
|
data
|
|
})
|
|
}
|
|
|
|
export function fetchUpdateProductionWorkOrder(id: string, data: { remark?: string }) {
|
|
return request.put<ProductionWorkOrderItem>({
|
|
url: `/web/admin/production-work-orders/${id}`,
|
|
data
|
|
})
|
|
}
|
|
|
|
export function fetchDeleteProductionWorkOrder(id: string) {
|
|
return request.del({ url: `/web/admin/production-work-orders/${id}` })
|
|
}
|