提交
This commit is contained in:
1 parent
e1d6de45a3
commit
5ad07c8cac
616 files changed
+181132
-35125
No files matched your search
+127
-41
@@ -27,24 +27,113 @@ export type Material = {
|
||||
updateTime: string
|
||||
}
|
||||
|
||||
export type MaterialStockLog = {
|
||||
/** 入库批次列表行 */
|
||||
export type MaterialBatch = {
|
||||
id: string
|
||||
batchId: string
|
||||
materialId: string
|
||||
materialCode: string
|
||||
materialName: string
|
||||
changeType: string
|
||||
changeQty: number
|
||||
stockBefore: number
|
||||
stockAfter: number
|
||||
receiver: string
|
||||
purpose: string
|
||||
category: string
|
||||
specModel: string
|
||||
unit: string
|
||||
stockInNo: string
|
||||
stockInDate: string
|
||||
expireDate: string
|
||||
catalogNo: string
|
||||
batchNo: string
|
||||
manufacturer: string
|
||||
unitPrice: number
|
||||
amount: number
|
||||
inQty: number
|
||||
remainingQty: number
|
||||
stockQty: number
|
||||
warningQty: number
|
||||
status: string
|
||||
remark: string
|
||||
createBy: string
|
||||
createByName?: string
|
||||
createTime: string
|
||||
updateTime: string
|
||||
}
|
||||
|
||||
export type MaterialOption = {
|
||||
id: string
|
||||
label: string
|
||||
materialCode: string
|
||||
materialName: string
|
||||
category: string
|
||||
specModel: string
|
||||
unit: string
|
||||
stockQty: number
|
||||
}
|
||||
|
||||
export type MaterialBatchOption = {
|
||||
id: string
|
||||
batchId: string
|
||||
stockInNo: string
|
||||
stockInDate?: string
|
||||
expireDate?: string
|
||||
materialId: string
|
||||
materialCode: string
|
||||
materialName: string
|
||||
category?: string
|
||||
specModel: string
|
||||
unit: string
|
||||
batchNo: string
|
||||
catalogNo: string
|
||||
manufacturer: string
|
||||
unitPrice?: number
|
||||
amount?: number
|
||||
remainingQty: number
|
||||
label: string
|
||||
}
|
||||
|
||||
export type StockInPayload = {
|
||||
stockInNo: string
|
||||
stockInDate: string
|
||||
expireDate: string
|
||||
catalogNo: string
|
||||
batchNo: string
|
||||
manufacturer: string
|
||||
unitPrice: number
|
||||
amount: number
|
||||
qty: number
|
||||
remark?: string
|
||||
stockInTime?: string
|
||||
}
|
||||
|
||||
export type BatchStockInLine = StockInPayload & {
|
||||
materialId: string
|
||||
materialCode?: string
|
||||
materialName?: string
|
||||
specModel?: string
|
||||
unit?: string
|
||||
}
|
||||
|
||||
export function fetchMaterialBatchList(params?: {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
keyword?: string
|
||||
materialId?: string
|
||||
category?: string
|
||||
status?: string
|
||||
}) {
|
||||
return request.get<PageList<MaterialBatch>>({
|
||||
url: '/web/admin/material-batches',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchMaterialBatchOptions(params?: {
|
||||
keyword?: string
|
||||
materialId?: string
|
||||
onlyAvailable?: boolean
|
||||
}) {
|
||||
return request.get<MaterialBatchOption[]>({
|
||||
url: '/web/admin/material-batches/options',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchMaterialList(params?: {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
@@ -59,7 +148,7 @@ export function fetchMaterialList(params?: {
|
||||
}
|
||||
|
||||
export function fetchMaterialOptions() {
|
||||
return request.get<{ id: string; label: string; materialCode: string }[]>({
|
||||
return request.get<MaterialOption[]>({
|
||||
url: '/web/admin/materials/options'
|
||||
})
|
||||
}
|
||||
@@ -84,61 +173,58 @@ export function fetchDeleteMaterial(id: string) {
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchStockInMaterial(
|
||||
id: string,
|
||||
data: { qty: number; remark?: string; stockInTime?: string }
|
||||
) {
|
||||
return request.post<Material>({
|
||||
url: `/web/admin/materials/${id}/stock-in`,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchStockOutMaterial(
|
||||
id: string,
|
||||
data: { qty: number; receiver?: string; purpose?: string; remark?: string; stockOutTime?: string }
|
||||
) {
|
||||
return request.post<Material>({
|
||||
url: `/web/admin/materials/${id}/stock-out`,
|
||||
export function fetchStockInMaterial(materialId: string, data: StockInPayload) {
|
||||
return request.post<MaterialBatch>({
|
||||
url: `/web/admin/materials/${materialId}/stock-in`,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchBatchStockInMaterial(data: {
|
||||
items: { materialId: string; qty: number; remark?: string }[]
|
||||
items: BatchStockInLine[]
|
||||
remark?: string
|
||||
stockInTime?: string
|
||||
}) {
|
||||
return request.post<{ count: number }>({
|
||||
url: '/web/admin/materials/batch-stock-in',
|
||||
url: '/web/admin/material-batches/batch-stock-in',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchUpdateMaterialBatch(id: string, data: Record<string, any>) {
|
||||
return request.put<MaterialBatch>({
|
||||
url: `/web/admin/material-batches/${id}`,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchDeleteMaterialBatch(id: string) {
|
||||
return request.delete<void>({
|
||||
url: `/web/admin/material-batches/${id}`
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchBatchStockOutMaterial(data: {
|
||||
items: { materialId: string; qty: number; remark?: string }[]
|
||||
items: { batchId: string; qty: number; usageUnit?: string; remark?: string }[]
|
||||
receiver?: string
|
||||
purpose?: string
|
||||
remark?: string
|
||||
stockOutTime?: string
|
||||
}) {
|
||||
return request.post<{ count: number }>({
|
||||
url: '/web/admin/materials/batch-stock-out',
|
||||
url: '/web/admin/material-batches/batch-stock-out',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchMaterialStockLogList(params?: {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
materialId?: string
|
||||
changeType?: string
|
||||
startTime?: string
|
||||
endTime?: string
|
||||
keyword?: string
|
||||
export function fetchBatchDiscardMaterial(data: {
|
||||
items: { batchId: string; qty: number; usageUnit?: string; remark?: string }[]
|
||||
discardReason: string
|
||||
remark?: string
|
||||
discardTime?: string
|
||||
}) {
|
||||
return request.get<PageList<MaterialStockLog>>({
|
||||
url: '/web/admin/material-stock-logs',
|
||||
params
|
||||
return request.post<{ count: number }>({
|
||||
url: '/web/admin/material-batches/batch-discard',
|
||||
data
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user