李红攀:V2.0.001小程序的农业溯源

This commit is contained in:
2026-04-23 19:57:52 +08:00
parent 505fda77f0
commit 6f1f32df62
9 changed files with 935 additions and 4 deletions

74
src/api/agri/biz/flow.ts Normal file
View File

@@ -0,0 +1,74 @@
import { http } from '@/http/http'
export interface AgriHarvestSubmitReqVO {
batchType: string
productId?: number
productName?: string
plotId?: number
plotName?: string
farmerId?: number
quantity?: number
unit?: string
harvestTime?: string
remark?: string
}
export interface AgriSortingSubmitReqVO {
batchId: number
weightResult?: number
unqualifiedCategory?: string
imageUrl?: string
remark?: string
}
export interface AgriPackingSubmitReqVO {
batchId: number
netWeight?: number
labelCode?: string
packingTime?: string
remark?: string
}
export interface AgriWarehouseInReqVO {
batchId: number
inMode?: string
warehouseTime?: string
remark?: string
}
export interface AgriShipmentDispatchReqVO {
batchId: number
vehicleNo: string
boxCount?: number
shipmentTime?: string
remark?: string
}
export interface AgriShipmentSignReqVO {
batchId: number
remark?: string
}
export function submitHarvest(data: AgriHarvestSubmitReqVO) {
return http.post<number>('/agri/biz/flow/harvest', data)
}
export function submitSorting(data: AgriSortingSubmitReqVO) {
return http.post<void>('/agri/biz/flow/sorting', data)
}
export function submitPacking(data: AgriPackingSubmitReqVO) {
return http.post<void>('/agri/biz/flow/packing', data)
}
export function submitWarehouseIn(data: AgriWarehouseInReqVO) {
return http.post<void>('/agri/biz/flow/warehouse-in', data)
}
export function dispatchShipment(data: AgriShipmentDispatchReqVO) {
return http.post<void>('/agri/biz/flow/shipment-dispatch', data)
}
export function signShipment(data: AgriShipmentSignReqVO) {
return http.post<void>('/agri/biz/flow/shipment-sign', data)
}

View File

@@ -0,0 +1,45 @@
import type { PageParam, PageResult } from '@/http/types'
import { http } from '@/http/http'
export interface AgriTraceSnapshotVO {
id: number
traceCode: string
batchId: number
batchNo: string
productName?: string
plotName?: string
harvestTime?: string
harvestOperatorId?: number
harvestOperatorName?: string
packingTime?: string
packingOperatorId?: number
packingOperatorName?: string
warehouseTime?: string
warehouseOperatorId?: number
warehouseOperatorName?: string
shipmentTime?: string
shipmentOperatorId?: number
shipmentOperatorName?: string
vehicleNo?: string
invoiceStatus?: string
snapshotJson?: string
}
export interface AgriTraceSnapshotPageReqVO extends PageParam {
batchId?: number
batchNo?: string
traceCode?: string
productName?: string
}
export function getAgriTraceSnapshotPage(params: AgriTraceSnapshotPageReqVO) {
return http.get<PageResult<AgriTraceSnapshotVO>>('/agri/trace/snapshot/page', params)
}
export function getAgriTraceSnapshot(id: number) {
return http.get<AgriTraceSnapshotVO>(`/agri/trace/snapshot/get?id=${id}`)
}
export function getAgriTraceSnapshotByTraceCode(traceCode: string) {
return http.get<AgriTraceSnapshotVO>('/agri/trace/snapshot/get-by-trace-code', { traceCode })
}