diff --git a/dist.tar.gz b/dist.tar.gz index b45650cf..e742aee5 100644 Binary files a/dist.tar.gz and b/dist.tar.gz differ diff --git a/src/api/camera/camera.ts b/src/api/camera/camera.ts index 07d5f541..d9ca5a59 100644 --- a/src/api/camera/camera.ts +++ b/src/api/camera/camera.ts @@ -40,14 +40,16 @@ export function create(data: { server_id: number channel_id: number channel_name?: string + custom_name?: string + status?: number + username?: string + password?: string + remark?: string ip?: string port?: number model?: string serial_number?: string stream_type?: string - custom_name?: string - status?: number - remark?: string }) { return request({ url: '/system', @@ -68,14 +70,16 @@ export function update(data: { server_id?: number channel_id?: number channel_name?: string + custom_name?: string + status?: number + username?: string + password?: string + remark?: string ip?: string port?: number model?: string serial_number?: string stream_type?: string - custom_name?: string - status?: number - remark?: string }) { return request({ url: '/system', @@ -90,6 +94,26 @@ export function update(data: { } as any) } +/** 设置摄像头 OSD 文字叠加 */ +export function setOsd(data: { + id: number + text: string + x?: number + y?: number +}) { + return request({ + url: '/system', + method: 'post', + params: { + method: 'camera.setOsd', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + /** 删除摄像头(软删除) */ export function del(data: { id: number }) { return request({ diff --git a/src/api/order.recheckorder/recheckOrder.ts b/src/api/order.recheckorder/recheckOrder.ts index 33b56172..9561aeeb 100644 --- a/src/api/order.recheckorder/recheckOrder.ts +++ b/src/api/order.recheckorder/recheckOrder.ts @@ -419,6 +419,55 @@ export function queryRecheckOrderSingleList( } as any) } +/** order.recheckOrder.batchQuickRecheckByWave 请求参数 */ +export type BatchQuickRecheckByWaveParams = { + wave_ids: number[] | string + waveIds?: number[] | string + wave_id?: number +} + +/** order.recheckOrder.batchQuickRecheckByWave 响应 data */ +export type BatchQuickRecheckByWaveResponse = { + success: unknown[] + failed: unknown[] + success_count: number + failed_count: number +} + +function pickWaveIdsBody(data: BatchQuickRecheckByWaveParams): Record { + if (Array.isArray(data.wave_ids) && data.wave_ids.length > 0) { + return { wave_ids: data.wave_ids } + } + if (typeof data.wave_ids === 'string' && data.wave_ids.trim() !== '') { + return { wave_ids: data.wave_ids.trim() } + } + if (Array.isArray(data.waveIds) && data.waveIds.length > 0) { + return { wave_ids: data.waveIds } + } + if (typeof data.waveIds === 'string' && data.waveIds.trim() !== '') { + return { wave_ids: data.waveIds.trim() } + } + if (data.wave_id !== undefined && data.wave_id !== null) { + return { wave_ids: [data.wave_id] } + } + throw new Error('波次 ID 不能为空(wave_ids / waveIds / wave_id)') +} + +/** order.recheckOrder.batchQuickRecheckByWave:按波次批量快捷复核 */ +export function batchQuickRecheckByWave(data: BatchQuickRecheckByWaveParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'order.recheckOrder.batchQuickRecheckByWave', + v, + timestamp: Date.now() + }, + data: pickWaveIdsBody(data), + isSystemApi: true + } as any) +} + /** order.recheckOrder.confirmIntercept:确认拦截,入参 order_id,匹配单个订单并标记拦截 */ export function confirmIntercept(data: ConfirmRecheckParams): Promise { return request({ @@ -437,6 +486,7 @@ export function confirmIntercept(data: ConfirmRecheckParams): Promise { export const orderRecheckOrder = { scanOrder, batchQuickRecheck, + batchQuickRecheckByWave, confirmRecheck, confirmIntercept, queryRecheckOrderSingleList diff --git a/src/api/print/print.ts b/src/api/print/print.ts index e4c0980a..5636c7b0 100644 --- a/src/api/print/print.ts +++ b/src/api/print/print.ts @@ -348,3 +348,44 @@ export function notify_lock(data?: PrintNotifyLockParams) { data: data ?? {} }) } + +/** print.markWavePrintStatus 请求参数 */ +export type MarkWavePrintStatusParams = { + /** 波次ID(必填,正整数) */ + wave_id: number + /** 目标状态:'printed'=标记已打印,'unprinted'=取消已打印标记。默认 'printed' */ + status?: 'printed' | 'unprinted' +} + +/** print.markWavePrintStatus 响应 data */ +export type MarkWavePrintStatusResponse = { + wave_id?: number + status?: string + print_status?: string + total_orders?: number + affected_orders?: number + order_ids?: Array +} + +/** 标记/取消标记整个波次订单的打印状态 */ +export function markWavePrintStatus(data: MarkWavePrintStatusParams): Promise { + const waveId = Number(data.wave_id) + if (!Number.isFinite(waveId) || waveId <= 0) { + return Promise.reject(new Error('print.markWavePrintStatus:wave_id 必须为正整数')) + } + const body: Record = { wave_id: waveId } + if (data.status) { + body.status = data.status + } + return request({ + url: '/system', + method: 'post', + params: { + method: 'print.markWavePrintStatus', + v, + timestamp: stamp() + }, + data: body, + isSystemApi: true + } as any) +} diff --git a/src/api/shops/shops.ts b/src/api/shops/shops.ts index 108ddcca..7be4c844 100644 --- a/src/api/shops/shops.ts +++ b/src/api/shops/shops.ts @@ -74,6 +74,8 @@ export function shopsEdit(data: { export function shopGetAuthorizeSessionKey(data: { id: number callbackurl?: string + appId?: string + toUserName?: string }) { return request({ url: '/system', diff --git a/src/api/storage.inventory/inventory.ts b/src/api/storage.inventory/inventory.ts index 1cdc1211..7df96180 100644 --- a/src/api/storage.inventory/inventory.ts +++ b/src/api/storage.inventory/inventory.ts @@ -164,6 +164,81 @@ export function getExpiryList(data: any): Promise { data }) } + +/** storage.inventory.export 请求参数 */ +export type InventoryExportParams = { + /** 导出模式:'stock_location'(默认,按商品+库位聚合)| 'storage'(按库存记录逐条导出) */ + exportMode?: 'stock_location' | 'storage' + /** 统一 where 条件对象,与 storage.inventory.list 的 where 语义一致 */ + where?: Record + /** 排序参数 { sortField, sortOrder } */ + sort?: { + sortField?: string + sortOrder?: 'ASC' | 'DESC' + } + /** 是否按批次查询导出,对齐查询模式 group_by_batch */ + group_by_batch?: boolean +} + +/** storage.inventory.export 响应 data */ +export type InventoryExportResponse = { + task_id?: string + status?: string + progress?: number + message?: string + update_time?: number +} + +/** 提交库存导出异步任务 */ +export function exportInventory(data: InventoryExportParams = {}): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'storage.inventory.export', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +/** storage.inventory.exportTaskProgress 请求参数 */ +export type ExportTaskProgressParams = { + task_id?: string + taskId?: string +} + +/** storage.inventory.exportTaskProgress 响应 data */ +export type ExportTaskProgressResponse = { + task_id?: string + status?: string + progress?: number + message?: string + result?: Record + error?: string + download_url?: string +} + +/** 按 task_id 查询库存导出任务进度 */ +export function exportTaskProgress(data: ExportTaskProgressParams): Promise { + const taskId = data.task_id || data.taskId + if (!taskId) { + throw new Error('task_id 不能为空') + } + return request({ + url: '/system', + method: 'post', + params: { + method: 'storage.inventory.exportTaskProgress', + v, + timestamp: new Date().getTime() + }, + data: { task_id: taskId }, + isSystemApi: true + } as any) +} // export function transaction(data:any) { // return request({ // url: '/system', diff --git a/src/components/ExportModeDropdown.vue b/src/components/ExportModeDropdown.vue index 620cfefe..42b90645 100644 --- a/src/components/ExportModeDropdown.vue +++ b/src/components/ExportModeDropdown.vue @@ -10,29 +10,55 @@ {{ label }}