Parcourir la source

feat(web-admin): 扩展出入库单与公共页 TypeScript 类型

为 enrichment 返回的取送货、产品编号、包装规格与单位标签补齐前端类型。

Co-authored-by: Cursor <cursoragent@cursor.com>
zlwu il y a 3 mois
Parent
commit
8b7f6d99c8
2 fichiers modifiés avec 169 ajouts et 0 suppressions
  1. 108 0
      web-admin/src/api/pl/index.ts
  2. 61 0
      web-admin/src/api/pl/public-io-order.ts

+ 108 - 0
web-admin/src/api/pl/index.ts

@@ -680,11 +680,21 @@ export interface TransportSiteLink {
   siteFeedbackTime?: string
   siteFeedbackTime?: string
 }
 }
 
 
+export interface TransportIoOrderBrief {
+  kind: string
+  orderId: string
+  orderNo: string
+  siteAccessToken?: string
+  siteUrl?: string
+  status?: string
+}
+
 export interface PlanArrangeInfo {
 export interface PlanArrangeInfo {
   driverUrl?: string
   driverUrl?: string
   licensePlate?: string
   licensePlate?: string
   siteRecords?: TransportSiteLink[]
   siteRecords?: TransportSiteLink[]
   inventoryRecords?: TransportInventoryLink[]
   inventoryRecords?: TransportInventoryLink[]
+  ioOrder?: TransportIoOrderBrief
 }
 }
 
 
 export interface TransportArrangeResult extends Transport {
 export interface TransportArrangeResult extends Transport {
@@ -692,6 +702,104 @@ export interface TransportArrangeResult extends Transport {
   driverUrl?: string
   driverUrl?: string
   siteRecords?: TransportSiteLink[]
   siteRecords?: TransportSiteLink[]
   inventoryRecords?: TransportInventoryLink[]
   inventoryRecords?: TransportInventoryLink[]
+  ioOrder?: TransportIoOrderBrief
+}
+
+export interface PlIoOrderItem {
+  id: string
+  orderId: string
+  planProductId: string
+  productId?: string
+  productNo?: string
+  productName?: string
+  specification?: string
+  unit?: string
+  unitLabel?: string
+  planQty?: number
+  actualQty?: number
+  qtySource?: string
+  packageSpec?: string
+  remark?: string
+}
+
+export interface PlIoOrder {
+  id: string
+  orderNo: string
+  planId: string
+  transportId: string
+  status: string
+  partnerCompany?: string
+  vehicleNo?: string
+  planNo?: string
+  planDate?: string
+  businessType?: 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
+  siteAccessToken?: string
+  siteUrl?: string
+  siteFeedbackRemark?: string
+  siteFeedbackImages?: string[]
+  siteFeedbackTime?: string
+  siteFirstSubmittedAt?: string
+  remark?: string
+  productSummary?: string
+  actualQtyTotal?: number
+  kind: string
+  items?: PlIoOrderItem[]
+  createTime?: string
+  updateTime?: string
+}
+
+export interface PlIoOrderQuery {
+  orderNo?: string
+  planNo?: string
+  status?: string
+  partnerCompany?: string
+  vehicleNo?: string
+  q?: string
+  page?: number
+  pageSize?: number
+}
+
+export interface PlIoOrderListResponse {
+  total: number
+  list: PlIoOrder[]
+}
+
+export const inboundOrderApi = {
+  list: (params?: PlIoOrderQuery) =>
+    request.get<PlIoOrderListResponse>('/transport/inbound/', { params }),
+  get: (id: string) => request.get<PlIoOrder>(`/transport/inbound/${id}`),
+  getByPlan: (planId: string) =>
+    request.get<PlIoOrder | null>(`/transport/inbound/by-plan/${planId}`),
+  patch: (id: string, data: Record<string, unknown>) =>
+    request.patch<PlIoOrder>(`/transport/inbound/${id}`, data),
+  siteUrl: (id: string) =>
+    request.get<{ siteUrl?: string; siteAccessToken?: string }>(`/transport/inbound/${id}/site-url`)
+}
+
+export const outboundOrderApi = {
+  list: (params?: PlIoOrderQuery) =>
+    request.get<PlIoOrderListResponse>('/transport/outbound/', { params }),
+  get: (id: string) => request.get<PlIoOrder>(`/transport/outbound/${id}`),
+  getByPlan: (planId: string) =>
+    request.get<PlIoOrder | null>(`/transport/outbound/by-plan/${planId}`),
+  patch: (id: string, data: Record<string, unknown>) =>
+    request.patch<PlIoOrder>(`/transport/outbound/${id}`, data),
+  siteUrl: (id: string) =>
+    request.get<{ siteUrl?: string; siteAccessToken?: string }>(
+      `/transport/outbound/${id}/site-url`
+    )
 }
 }
 
 
 export interface TransportQuery {
 export interface TransportQuery {

+ 61 - 0
web-admin/src/api/pl/public-io-order.ts

@@ -0,0 +1,61 @@
+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')