feat(qc): implement material library with CRUD, stock-in, usage tracking and task deduction
This commit is contained in:
1 parent
4137c54588
commit
e6072457fd
9 files changed
+1638
-22
No files matched your search
@@ -0,0 +1,39 @@
|
||||
import request from '@/utils/http'
|
||||
|
||||
type PageList<T> = {
|
||||
list: T[]
|
||||
total: number
|
||||
page: number
|
||||
pageSize: number
|
||||
totalPages: number
|
||||
}
|
||||
|
||||
export type QcMaterialUsage = {
|
||||
id: string
|
||||
materialId: string
|
||||
materialCode: string
|
||||
materialName: string
|
||||
changeType: string
|
||||
changeQty: number
|
||||
stockAfter: number
|
||||
qcTaskId: string
|
||||
qcTaskNo: string
|
||||
sourceType: string
|
||||
remark: string
|
||||
createBy: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
export function fetchQcMaterialUsageList(params?: {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
materialId?: string
|
||||
changeType?: string
|
||||
startTime?: string
|
||||
endTime?: string
|
||||
}) {
|
||||
return request.get<PageList<QcMaterialUsage>>({
|
||||
url: '/web/admin/qc-material-usages',
|
||||
params
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
import request from '@/utils/http'
|
||||
|
||||
type PageList<T> = {
|
||||
list: T[]
|
||||
total: number
|
||||
page: number
|
||||
pageSize: number
|
||||
totalPages: number
|
||||
}
|
||||
|
||||
export type QcMaterial = {
|
||||
id: string
|
||||
materialCode: string
|
||||
materialName: string
|
||||
specModel: string
|
||||
unit: string
|
||||
stockQty: number
|
||||
warningQty: number
|
||||
status: string
|
||||
tenantNo: string
|
||||
orderNum: number
|
||||
remark: string
|
||||
createBy: string
|
||||
createTime: string
|
||||
updateTime: string
|
||||
}
|
||||
|
||||
export type QcMaterialOption = {
|
||||
id: string
|
||||
label: string
|
||||
materialCode: string
|
||||
materialName: string
|
||||
specModel: string
|
||||
unit: string
|
||||
stockQty: number
|
||||
}
|
||||
|
||||
export function fetchQcMaterialList(params?: {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
keyword?: string
|
||||
status?: string
|
||||
}) {
|
||||
return request.get<PageList<QcMaterial>>({
|
||||
url: '/web/admin/qc-materials',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchQcMaterialOptions() {
|
||||
return request.get<QcMaterialOption[]>({
|
||||
url: '/web/admin/qc-materials/options'
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchCreateQcMaterial(data: Record<string, any>) {
|
||||
return request.post<QcMaterial>({
|
||||
url: '/web/admin/qc-materials',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchUpdateQcMaterial(id: string, data: Record<string, any>) {
|
||||
return request.put<QcMaterial>({
|
||||
url: `/web/admin/qc-materials/${id}`,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchDeleteQcMaterial(id: string) {
|
||||
return request.delete<void>({
|
||||
url: `/web/admin/qc-materials/${id}`
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchStockInQcMaterial(id: string, data: { qty: number; remark?: string }) {
|
||||
return request.post<QcMaterial>({
|
||||
url: `/web/admin/qc-materials/${id}/stock-in`,
|
||||
data
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user