import request from '@/utils/request' const v = '1.0' export type { OrderWorkbenchListResponse, OrderListPagination } from '@/api/order.index/orderindex' export type OrderWhere = Record export type OrderSort = { sortField?: string sortOrder?: 'asc' | 'desc' | 'ASC' | 'DESC' field?: string order?: 'asc' | 'desc' | 'ASC' | 'DESC' } export type OrderPagination = { page?: number pageSize?: number } export type DeliveryOrderListParams = { pagination?: OrderPagination where?: OrderWhere sort?: OrderSort } export type DeliveryOrderDetailParams = { ids?: Array | string | number id?: number | string order_id?: number | string orderId?: number | string tableType?: string tablePosition?: string type?: string moduleName?: string } /** order.deliveryOrder.list 单条 raw 行(dispatch 模型) */ export type DeliveryOrderListItem = { id: number delivery_order_code: string pre_delivery_order_code?: string pre_delivery_order_id?: string order_type?: string order_flag?: string source_order_codes?: string sys_platform_code?: string sys_platform_name?: string create_at?: string | null place_order_time?: string | null pay_time?: string | null pay_no?: string service_code?: string | null operator_name?: string | null operate_time?: string | null delivery_time?: string | null shop_nick?: string seller_nick?: string | null buyer_nick?: string | null buyer_message?: string seller_message?: string remark?: string total_amount?: string item_amount?: string discount_amount?: string freight?: string ar_amount?: string got_amount?: string service_fee?: string | null logistics_name?: string delivery_type?: string | null /** 重量类型 */ weight_type?: string | number | null is_urgency?: string invoice_flag?: string status?: string name?: string zip_code?: string tel?: string mobile?: string email?: string province?: string city?: string area?: string town?: string detail_address?: string id_type?: string | null id_number?: string | null sync_status?: string items?: string items_count?: number items_total?: number /** 订单商品总重量(g) */ items_weight?: string wave_id?: number wave_no?: string wave_strategy_version?: number wave_scan_result?: number post_status?: string storage_status?: string pick_status?: string pack_status?: string inspection_status?: string print_status?: string claim_status?: string outbound_status?: string lock_status?: string intercept_status?: string basket_number?: string | null recheck_status?: string sys_logistics_name?: string | null express_numbers?: string[] waybill_codes?: string[] } /** order.deliveryOrder.detail 订单头(detail / order) */ export type DeliveryOrderDetailHeader = DeliveryOrderListItem & { warehouse_code?: string | null extend_props?: Record | null source_platform_code?: string source_platform_name?: string create_channel?: string delete_at?: string | null updated_at?: string logistics_code?: string sys_logistics_code?: string express_code?: string logistics_area_code?: string country_code?: string oaid?: string | null store_id?: number warehouse_id?: number from_key?: string | null items_hash?: string items_crc?: number sended_status?: string recheck_time?: string | null step?: number print_lock_status?: string dispatch_lane?: string } /** order.deliveryOrder.detail 商品明细项 */ export type DeliveryOrderDetailItem = { id: number order_id: number actual_price?: string retail_price?: string ext_code?: string inventory_type?: string item_code?: string item_id?: number item_name?: string order_line_no?: string owner_code?: string plan_qty?: number source_order_code?: string sub_source_order_code?: string extend_props?: Record | null stock_id?: number item_snapshot?: Record created_at?: string updated_at?: string createdAt?: string updatedAt?: string images?: string[] } /** order.deliveryOrder.detail 运单信息项 */ export type DeliveryOrderDetailExpressItem = { waybill_code?: string /** 称重重量(g) */ weighing_weight?: number | null sys_logistics_code?: string sys_logistics_name?: string logistics_code?: string logistics_name?: string logistics_interface_id?: number | null business_key?: string created_at?: number | null package_material_id?: number | null package_material_name_snapshot?: string | null } /** order.deliveryOrder.detail 日志项 */ export type DeliveryOrderDetailLogItem = { id: number operation_code: string operator_name?: string created_at: string external_log_type?: string | null external_log_id?: number | string | null platform_code?: string message?: string operation_name?: string platform_name?: string } /** order.deliveryOrder.detail 响应 data */ export type DeliveryOrderDetailPayload = { detail?: DeliveryOrderDetailHeader order?: DeliveryOrderDetailHeader items?: DeliveryOrderDetailItem[] orderItems?: DeliveryOrderDetailItem[] expresses?: DeliveryOrderDetailExpressItem[] logs?: DeliveryOrderDetailLogItem[] waybill_codes?: string[] } export function orderDeliveryOrderList(data: DeliveryOrderListParams = {}): Promise { return request({ url: '/system', method: 'post', params: { method: 'order.deliveryOrder.list', v, timestamp: Date.now() }, data, isSystemApi: true } as any) } export function orderDeliveryOrderDetail(data: DeliveryOrderDetailParams): Promise { return request({ url: '/system', method: 'post', params: { method: 'order.deliveryOrder.detail', v, timestamp: Date.now() }, data, isSystemApi: true } as any) } export const orderDeliveryOrder = { list: orderDeliveryOrderList, detail: orderDeliveryOrderDetail }