提交
This commit is contained in:
1 parent
725774ef0c
commit
c3be9d1dce
176 files changed
+41925
-6342
No files matched your search
@@ -0,0 +1,123 @@
|
||||
import dbRequest from '@/utils/http/db'
|
||||
import type { InventoryRecord } from '@/api/db/inventory'
|
||||
import type { Plan } from '@/api/db/plans'
|
||||
|
||||
export interface WeighingRecord {
|
||||
id: string
|
||||
vehicleNo: string
|
||||
planNo?: string
|
||||
productId?: string
|
||||
cargoName: string
|
||||
specification?: string
|
||||
businessType: '入库' | '出库'
|
||||
batchNo?: string
|
||||
supplier: string
|
||||
consignee: string
|
||||
grossWeight: number
|
||||
grossWeightTime: string
|
||||
tareWeight: number
|
||||
tareWeightTime: string
|
||||
deduction?: number
|
||||
netWeight: number
|
||||
plannedQuantity?: number
|
||||
executedQuantity?: number
|
||||
purchasePlanId?: string
|
||||
inboundOutboundId?: string
|
||||
weighingPoint?: string
|
||||
remarks?: string
|
||||
currentQuantity?: number
|
||||
isVoided: number
|
||||
createdAt: string
|
||||
inventoryDate?: string
|
||||
}
|
||||
|
||||
export interface WeighingCreate {
|
||||
vehicleNo: string
|
||||
planNo?: string
|
||||
productId: string
|
||||
businessType: '入库' | '出库'
|
||||
batchNo?: string
|
||||
supplier: string
|
||||
consignee: string
|
||||
grossWeight: number
|
||||
grossWeightTime: string
|
||||
tareWeight: number
|
||||
tareWeightTime: string
|
||||
deduction?: number
|
||||
netWeight: number
|
||||
plannedQuantity?: number
|
||||
executedQuantity?: number
|
||||
purchasePlanId?: string
|
||||
inboundOutboundId?: string
|
||||
weighingPoint?: string
|
||||
remarks?: string
|
||||
currentQuantity?: number
|
||||
}
|
||||
|
||||
export interface WeighingUpdate {
|
||||
vehicleNo?: string
|
||||
planNo?: string
|
||||
productId?: string
|
||||
cargoName?: string
|
||||
specification?: string
|
||||
businessType?: '入库' | '出库'
|
||||
batchNo?: string
|
||||
supplier?: string
|
||||
consignee?: string
|
||||
grossWeight?: number
|
||||
grossWeightTime?: string
|
||||
tareWeight?: number
|
||||
tareWeightTime?: string
|
||||
deduction?: number
|
||||
netWeight?: number
|
||||
plannedQuantity?: number
|
||||
executedQuantity?: number
|
||||
purchasePlanId?: string
|
||||
inboundOutboundId?: string
|
||||
weighingPoint?: string
|
||||
remarks?: string
|
||||
currentQuantity?: number
|
||||
isVoided?: number
|
||||
}
|
||||
|
||||
export interface WeighingRelatedData {
|
||||
plan: Plan | null
|
||||
inventory: InventoryRecord | null
|
||||
}
|
||||
|
||||
export interface WeighingListParams {
|
||||
q?: string
|
||||
dateFrom?: string
|
||||
dateTo?: string
|
||||
planNo?: string
|
||||
batchNo?: string
|
||||
vehicleNo?: string
|
||||
cargoName?: string
|
||||
supplier?: string
|
||||
consignee?: string
|
||||
businessType?: '入库' | '出库'
|
||||
}
|
||||
|
||||
export const weighingApi = {
|
||||
list(params?: WeighingListParams) {
|
||||
return dbRequest.get<WeighingRecord[]>('/weighing', { params })
|
||||
},
|
||||
get(id: string) {
|
||||
return dbRequest.get<WeighingRecord>(`/weighing/${id}`)
|
||||
},
|
||||
getRelated(id: string) {
|
||||
return dbRequest.get<WeighingRelatedData>(`/weighing/${id}/related`)
|
||||
},
|
||||
create(payload: WeighingCreate) {
|
||||
return dbRequest.post<WeighingRecord>('/weighing', payload)
|
||||
},
|
||||
update(id: string, payload: WeighingUpdate) {
|
||||
return dbRequest.patch<WeighingRecord>(`/weighing/${id}`, payload)
|
||||
},
|
||||
void(id: string) {
|
||||
return dbRequest.post<void>(`/weighing/${id}/void`)
|
||||
},
|
||||
delete(id: string) {
|
||||
return dbRequest.delete<void>(`/weighing/${id}`)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user