80 lines
2.1 KiB
TypeScript
80 lines
2.1 KiB
TypeScript
import { publicPlGet, publicPlPost, publicPlUpload } from '@/utils/http/public-pl'
|
|
|
|
export interface BrandQtyItem {
|
|
brandId: string
|
|
brandName?: string
|
|
qty: number
|
|
}
|
|
|
|
export interface PublicTransportProduct {
|
|
planProductId: string
|
|
productName: string
|
|
aliasName?: string | null
|
|
model?: string
|
|
packageSpec?: string
|
|
unit?: string
|
|
quantity?: number
|
|
remark?: string
|
|
brandMode?: string | null
|
|
brandId?: string | null
|
|
brandName?: string | null
|
|
brandOptions?: { brandId: string; brandName: string }[]
|
|
actualQty?: number | null
|
|
brandQtys?: BrandQtyItem[]
|
|
}
|
|
|
|
export interface PublicTransportPersonnel {
|
|
personnelName: string
|
|
phoneNo?: string
|
|
role?: string
|
|
}
|
|
|
|
export interface PublicTransportPage {
|
|
planNo: string
|
|
planDate?: string
|
|
planType: string
|
|
pickupAddress?: string
|
|
pickupLng?: number | null
|
|
pickupLat?: number | null
|
|
pickupTime?: string
|
|
pickupContact?: string
|
|
pickupNotes?: string
|
|
destinationName?: string
|
|
destinationAddress?: string
|
|
destinationLng?: number | null
|
|
destinationLat?: number | null
|
|
deliveryTime?: string
|
|
deliveryContact?: string
|
|
destinationNotes?: string
|
|
licensePlate?: string
|
|
driverName?: string
|
|
driverPhone?: string
|
|
otherPersonnel?: PublicTransportPersonnel[]
|
|
products: PublicTransportProduct[]
|
|
feedbackRemark?: string
|
|
feedbackImages: string[]
|
|
feedbackQty?: number | null
|
|
feedbackTime?: string
|
|
planVoided?: boolean
|
|
planArchived?: boolean
|
|
}
|
|
|
|
export interface PublicUploadResult {
|
|
fileUrl: string
|
|
fileName?: string
|
|
}
|
|
|
|
export const publicTransportApi = {
|
|
getPage: (token: string) => publicPlGet<PublicTransportPage>(`/public/pl/transport/${token}`),
|
|
saveFeedback: (
|
|
token: string,
|
|
data: {
|
|
feedbackImages?: string[]
|
|
feedbackRemark?: string
|
|
products: { planProductId: string; actualQty: number; brandQtys?: BrandQtyItem[] }[]
|
|
}
|
|
) => publicPlPost<{ success: boolean }>(`/public/pl/transport/${token}/feedback`, data),
|
|
uploadAttachment: (token: string, file: File) =>
|
|
publicPlUpload<PublicUploadResult>(`/public/pl/transport/${token}/attachments`, file)
|
|
}
|