| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import { publicPlGet, publicPlPost, publicPlUpload } from '@/utils/http/public-pl'
- export interface PublicIoOrderItem {
- id: string
- productNo?: string
- productName?: string
- specification?: string
- unit?: string
- planQty?: number
- actualQty?: number
- packageSpec?: string
- remark?: string
- }
- export interface PublicIoOrderPage {
- title?: string
- orderNo?: string
- status?: string
- businessType?: string
- partnerCompany?: string
- vehicleNo?: string
- planNo?: string
- planDate?: string
- planRemark?: string
- pickupAddress?: string
- pickupLng?: number | null
- pickupLat?: number | null
- pickupTime?: string
- pickupNotes?: string
- destinationName?: string
- destinationAddress?: string
- destinationLng?: number | null
- destinationLat?: number | null
- deliveryTime?: string
- destinationNotes?: string
- siteFeedbackRemark?: string
- siteFeedbackImages?: string[]
- siteFeedbackTime?: string
- voided: boolean
- items: PublicIoOrderItem[]
- }
- export function createPublicIoOrderApi(kind: 'inbound' | 'outbound') {
- const base = `/public/pl/${kind}`
- return {
- getPage: (token: string) => publicPlGet<PublicIoOrderPage>(`${base}/${token}`),
- saveFeedback: (
- token: string,
- data: {
- remark?: string
- images?: string[]
- items: { id: string; actualQty: number }[]
- }
- ) => publicPlPost<{ success: boolean }>(`${base}/${token}/feedback`, data),
- uploadAttachment: (token: string, file: File) =>
- publicPlUpload<{ fileUrl: string }>(`${base}/${token}/attachments`, file)
- }
- }
- export const publicInboundOrderApi = createPublicIoOrderApi('inbound')
- export const publicOutboundOrderApi = createPublicIoOrderApi('outbound')
|