import request from '@/utils/request' const v = '1.0' /** 与 apidata/data.json 中 list 单项字段一致 */ export interface StorageReportListItem { start_time?: string | null end_time?: string | null stock_id: number store_id: number begin_total: number end_total: number inbound_total: number outbound_total: number store_name?: string item_name?: string barcode?: string item_code?: string space_id?: number | null space_name?: string | null [key: string]: unknown } export interface StorageReportSearchBody { where?: { start_time?: string | Date end_time?: string | Date by_space?: boolean store_ids?: number[] } } /** 与网关返回一致:成功时 data 内含 list */ export interface StorageReportSearchResult { flag?: string code?: number message?: string data?: { list?: StorageReportListItem[] } list?: StorageReportListItem[] } /** 不传或传 `{}` 表示无业务参数(与页面首次打开一致) */ export function searchInventoryReport( data?: StorageReportSearchBody ): Promise { return request({ url: '/system', method: 'post', params: { method: 'storage.report.search', v, timestamp: new Date().getTime() }, data: data ?? {}, isSystemApi: true } as any) }