feat(web-admin): add QC inspection item template API module.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
52ec964f88
commit
e80dcd8519
1 file changed
+77
@@ -0,0 +1,77 @@
|
||||
import request from '@/utils/http'
|
||||
|
||||
type PageList<T> = {
|
||||
list: T[]
|
||||
total: number
|
||||
page: number
|
||||
pageSize: number
|
||||
totalPages: number
|
||||
}
|
||||
|
||||
export type QcInspectionItemTemplate = {
|
||||
id: string
|
||||
templateName: string
|
||||
labItemIds: string[]
|
||||
thirdPartyItemIds: string[]
|
||||
labItemCount?: number
|
||||
thirdPartyItemCount?: number
|
||||
status: string
|
||||
orderNum?: number
|
||||
remark?: string
|
||||
createTime?: string
|
||||
updateTime?: string
|
||||
}
|
||||
|
||||
export type QcInspectionItemTemplatePayload = {
|
||||
templateName: string
|
||||
labItemIds: string[]
|
||||
thirdPartyItemIds: string[]
|
||||
status?: string
|
||||
orderNum?: number
|
||||
remark?: string
|
||||
}
|
||||
|
||||
export function fetchQcInspectionItemTemplateList(params?: {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
keyword?: string
|
||||
status?: string
|
||||
}) {
|
||||
return request.get<PageList<QcInspectionItemTemplate>>({
|
||||
url: '/web/admin/qc-inspection-item-templates',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchQcInspectionItemTemplatesActive() {
|
||||
return request.get<QcInspectionItemTemplate[]>({
|
||||
url: '/web/admin/qc-inspection-item-templates/active'
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchQcInspectionItemTemplateDetail(id: string) {
|
||||
return request.get<QcInspectionItemTemplate>({
|
||||
url: `/web/admin/qc-inspection-item-templates/${id}`
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchCreateQcInspectionItemTemplate(data: QcInspectionItemTemplatePayload) {
|
||||
return request.post<QcInspectionItemTemplate>({
|
||||
url: '/web/admin/qc-inspection-item-templates',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchUpdateQcInspectionItemTemplate(
|
||||
id: string,
|
||||
data: Partial<QcInspectionItemTemplatePayload>
|
||||
) {
|
||||
return request.put<QcInspectionItemTemplate>({
|
||||
url: `/web/admin/qc-inspection-item-templates/${id}`,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchDeleteQcInspectionItemTemplate(id: string) {
|
||||
return request.del({ url: `/web/admin/qc-inspection-item-templates/${id}` })
|
||||
}
|
||||
Reference in new issue
Block a user