diff --git a/src/api/returnunpack/index.ts b/src/api/returnunpack/index.ts new file mode 100644 index 00000000..bd573d70 --- /dev/null +++ b/src/api/returnunpack/index.ts @@ -0,0 +1,338 @@ +import request from '@/utils/request' + +const v = '1.0' + +// ============ returnUnpack.create ============ + +/** returnUnpack.create 请求参数 */ +export type ReturnUnpackCreateParams = { + /** 拆包的运单号(退回包裹运单号,必填,用于反查原单/货主信息) */ + waybill_code: string + /** 摄像头ID列表,如 [1,2,3],关联 wms_camera.id(非正整数会被过滤) */ + camera_ids?: number[] + /** 关联退回收到单ID(wms_return_received.id),非必填,允许独立拆包 */ + return_received_id?: number + /** 备注(最长 500 字符,超出截断) */ + remark?: string +} + +/** returnUnpack.create:开拆包单(明细不在此提交,由 returnUnpack.addDetail 逐件录入) */ +export function returnUnpackCreate(data: ReturnUnpackCreateParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnUnpack.create', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ returnUnpack.addDetail ============ + +/** returnUnpack.addDetail 请求参数 */ +export type ReturnUnpackAddDetailParams = { + /** 拆包单ID(returnUnpack.create 返回的依据) */ + id: number + /** 系统商品ID(wms_stock_warehouse.id),为空即无关联货物 */ + stock_id?: number + /** 数量,默认 1(小于 1 按 1 处理) */ + quantity?: number + /** 产品状态:normal 正常(默认)/ damaged 破损 */ + product_status?: 'normal' | 'damaged' + /** 备注(最长 500 字符,超出截断) */ + remark?: string +} + +/** returnUnpack.addDetail:以拆包单ID为依据录入一条明细 */ +export function returnUnpackAddDetail(data: ReturnUnpackAddDetailParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnUnpack.addDetail', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ returnUnpack.updateDetail ============ + +/** returnUnpack.updateDetail 请求参数 */ +export type ReturnUnpackUpdateDetailParams = { + /** 拆包单ID */ + id: number + /** 明细ID(returnUnpack.addDetail 返回) */ + detail_id: number + /** 数量(小于 1 按 1 处理,变更时才触发主表重算) */ + quantity?: number + /** 备注(最长 500 字符,超出截断) */ + remark?: string +} + +/** returnUnpack.updateDetail:更新明细(仅允许更新 quantity/remark) */ +export function returnUnpackUpdateDetail(data: ReturnUnpackUpdateDetailParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnUnpack.updateDetail', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ returnUnpack.removeDetail ============ + +/** returnUnpack.removeDetail 请求参数 */ +export type ReturnUnpackRemoveDetailParams = { + /** 拆包单ID */ + id: number + /** 明细ID(returnUnpack.addDetail 返回) */ + detail_id: number +} + +/** returnUnpack.removeDetail:删除拆包单下的一条明细(硬删除) */ +export function returnUnpackRemoveDetail(data: ReturnUnpackRemoveDetailParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnUnpack.removeDetail', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ returnUnpack.cancel ============ + +/** returnUnpack.cancel 请求参数 */ +export type ReturnUnpackCancelParams = { + /** 拆包单ID */ + id: number +} + +/** returnUnpack.cancel:取消拆包单(仅供未完成状态作业取消) */ +export function returnUnpackCancel(data: ReturnUnpackCancelParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnUnpack.cancel', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ returnUnpack.submit ============ + +/** returnUnpack.submit 请求参数 */ +export type ReturnUnpackSubmitParams = { + /** 拆包单ID */ + id: number +} + +/** returnUnpack.submit:提交确认(转 completed 终态并回写 end_time) */ +export function returnUnpackSubmit(data: ReturnUnpackSubmitParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnUnpack.submit', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ returnUnpack.list ============ + +/** returnUnpack.list 的 where 筛选条件 */ +export type ReturnUnpackListWhere = { + /** 拆包单号(模糊搜索,传 {operator:'like',value} 或直接值) */ + unpack_no?: string | { operator: string; value: any } + /** 运单号(模糊搜索,传 {operator:'like',value} 或直接值) */ + waybill_code?: string | { operator: string; value: any } + /** 拆包日期范围 { operator:'between'|'gte'|'lte'|'gt'|'lt', value:[start,end] 或单值 } */ + unpack_date?: { operator: 'between' | 'gte' | 'lte' | 'gt' | 'lt'; value: [string, string] | string } + /** 拆包开始时间范围 */ + start_time?: { operator: 'between' | 'gte' | 'lte' | 'gt' | 'lt'; value: [string, string] | string } + /** 拆包结束时间范围 */ + end_time?: { operator: 'between' | 'gte' | 'lte' | 'gt' | 'lt'; value: [string, string] | string } + /** 拆包状态(等值):unpacking 拆包中 / completed 完成 / cancelled 作废 */ + status?: 'unpacking' | 'completed' | 'cancelled' + /** 明细识别状态(等值):none_recognized / partial_recognized / all_recognized */ + detail_status?: 'none_recognized' | 'partial_recognized' | 'all_recognized' + /** 拆包人员工号ID(等值) */ + unpacker_id?: number + /** 关联退回收到单ID(等值) */ + return_received_id?: number + /** 货主ID(等值) */ + store_id?: number + /** 原运单ID(等值) */ + order_express_id?: number + /** 原订单ID(等值) */ + order_id?: number +} + +/** returnUnpack.list 排序参数 */ +export type ReturnUnpackListSort = { + /** 排序字段 */ + sortField?: + | 'id' + | 'created_at' + | 'updated_at' + | 'unpack_date' + | 'start_time' + | 'end_time' + | 'unpack_no' + | 'waybill_code' + /** 排序方向:asc / desc */ + sortOrder?: 'asc' | 'desc' +} + +/** returnUnpack.list 请求参数 */ +export type ReturnUnpackListParams = { + pagination?: { page?: number; pageSize?: number } + where?: ReturnUnpackListWhere + sort?: ReturnUnpackListSort +} + +/** returnUnpack.list:拆包单分页列表(仓库隔离,服务端注入 warehouse_id) */ +export function returnUnpackList(data: ReturnUnpackListParams = {}): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnUnpack.list', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ returnUnpack.detailList ============ + +/** returnUnpack.detailList 的 where 筛选条件 */ +export type ReturnUnpackDetailListWhere = { + /** 拆包单ID(等值) */ + unpack_id?: number + /** 系统商品ID(wms_stock_warehouse.id,等值) */ + stock_id?: number + /** 扫描条码(模糊搜索,传 {operator:'like',value} 或直接值) */ + barcode?: string | { operator: string; value: any } + /** 是否识别(等值):1 识别到系统商品 / 0 非识别物品 */ + is_recognized?: 0 | 1 + /** 产品状态(等值):normal 正常 / damaged 破损 */ + product_status?: 'normal' | 'damaged' +} + +/** returnUnpack.detailList 排序参数 */ +export type ReturnUnpackDetailListSort = { + /** 排序字段 */ + sortField?: 'id' | 'created_at' | 'updated_at' | 'quantity' + /** 排序方向:asc / desc */ + sortOrder?: 'asc' | 'desc' +} + +/** returnUnpack.detailList 请求参数 */ +export type ReturnUnpackDetailListParams = { + pagination?: { page?: number; pageSize?: number } + where?: ReturnUnpackDetailListWhere + sort?: ReturnUnpackDetailListSort +} + +/** returnUnpack.detailList:拆包明细分页列表(命中识别商品时含 stockWarehouse 关联) */ +export function returnUnpackDetailList(data: ReturnUnpackDetailListParams = {}): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnUnpack.detailList', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ returnUnpack.detail ============ + +/** returnUnpack.detail 请求参数 */ +export type ReturnUnpackDetailParams = { + /** 拆包单ID */ + id: number +} + +/** returnUnpack.detail:拆包单详情(主表 + 明细 + 视频副表 + 退回收到单) */ +export function returnUnpackDetail(data: ReturnUnpackDetailParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnUnpack.detail', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ returnUnpack.delete ============ + +/** returnUnpack.delete 请求参数 */ +export type ReturnUnpackDeleteParams = { + /** 拆包单ID */ + id: number +} + +/** returnUnpack.delete:删除拆包单(后台管理,不限制状态) */ +export function returnUnpackDelete(data: ReturnUnpackDeleteParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnUnpack.delete', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ 模块导出 ============ + +export const returnUnpackModule = { + create: returnUnpackCreate, + addDetail: returnUnpackAddDetail, + updateDetail: returnUnpackUpdateDetail, + removeDetail: returnUnpackRemoveDetail, + cancel: returnUnpackCancel, + submit: returnUnpackSubmit, + list: returnUnpackList, + detailList: returnUnpackDetailList, + detail: returnUnpackDetail, + delete: returnUnpackDelete +} diff --git a/src/api/shops/shops.ts b/src/api/shops/shops.ts index 7be4c844..4c096430 100644 --- a/src/api/shops/shops.ts +++ b/src/api/shops/shops.ts @@ -70,13 +70,23 @@ export function shopsEdit(data: { }) } -/** 按店铺所属平台生成授权会话 */ +/** shops.GetAuthorizeSessionKey 响应 */ +export interface ShopAuthorizeSessionKeyResponse { + flag: string + code: number + message: string + data: { + message: string + } +} + +/** 按店铺所属平台生成授权会话(callbackurl 必填;视频号平台另传 appId/toUserName) */ export function shopGetAuthorizeSessionKey(data: { id: number - callbackurl?: string + callbackurl: string appId?: string toUserName?: string -}) { +}): Promise { return request({ url: '/system', method: 'post', diff --git a/src/components/ScanBox/index.vue b/src/components/ScanBox/index.vue index bc7ea2ae..fdcf06ba 100644 --- a/src/components/ScanBox/index.vue +++ b/src/components/ScanBox/index.vue @@ -68,6 +68,7 @@ :class="{ 'field-control--multi': isMultiValueTextOperator(customConditions[field.value].operator) }" > = { 'system/setting/storeExpressBindingPolicy/index':() => import('@/views/system/setting/storeExpressBindingPolicy/index.vue'), 'inbox/message/index': () => import('@/views/inbox/message/index.vue'), 'inbox/group/index': () => import('@/views/inbox/group/index.vue'), + 'express/returnUnpack/index': () => import('@/views/express/returnUnpack/index.vue'), }; \ No newline at end of file diff --git a/src/views/afterSale/detail/AfterSaleDetailDialog.vue b/src/views/afterSale/detail/AfterSaleDetailDialog.vue index 2fb26e68..0258c4d8 100644 --- a/src/views/afterSale/detail/AfterSaleDetailDialog.vue +++ b/src/views/afterSale/detail/AfterSaleDetailDialog.vue @@ -254,7 +254,7 @@ import { type AfterSale, type AfterSaleStep, type AfterSaleRelated, -} from '@/api/afterSale/index' +} from '@/api/aftersale/index' import { orderQueryOrderLogList, type OrderLogListItem } from '@/api/order.index/orderindex' import { getCOSUploadConfig, uploadSuccessNotify } from '@/api/index/index' import { diff --git a/src/views/afterSale/detail/ClaimDialog.vue b/src/views/afterSale/detail/ClaimDialog.vue index 3020eab2..9283da74 100644 --- a/src/views/afterSale/detail/ClaimDialog.vue +++ b/src/views/afterSale/detail/ClaimDialog.vue @@ -35,7 +35,7 @@ + + diff --git a/src/views/express/returnUnpack/returnUnpack-config.ts b/src/views/express/returnUnpack/returnUnpack-config.ts new file mode 100644 index 00000000..5b7d6356 --- /dev/null +++ b/src/views/express/returnUnpack/returnUnpack-config.ts @@ -0,0 +1,86 @@ +import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config' + +// ============================================================ +// 退回拆包(returnUnpack) - ScanBox 筛选字段 +// 对齐 returnUnpack.list 接口文档 where 参数 +// ============================================================ +export const returnUnpackAvailableFields = [ + { + value: 'unpack_no', + label: '拆包单号', + type: 'text', + placeholder: '拆包单号模糊搜索', + operators: ['like'], + defaultOperator: 'like', + }, + { + value: 'waybill_code', + label: '退回运单号', + type: 'text', + placeholder: '运单号模糊搜索', + operators: ['like'], + defaultOperator: 'like', + }, + { + value: 'status', + label: '拆包状态', + type: 'select', + placeholder: '请选择拆包状态', + options: [ + { label: '拆包中', value: 'unpacking' }, + { label: '已完成', value: 'completed' }, + { label: '已作废', value: 'cancelled' }, + ], + }, + { + value: 'detail_status', + label: '明细识别状态', + type: 'select', + placeholder: '请选择明细识别状态', + options: [ + { label: '全部识别', value: 'all_recognized' }, + { label: '部分识别', value: 'partial_recognized' }, + { label: '未识别', value: 'none_recognized' }, + ], + }, + { + value: 'unpack_date', + label: '拆包日期', + type: 'datetimerange', + }, + { + value: 'store_id', + label: '货主', + type: 'select', + placeholder: '请选择货主', + options: [] as { label: string; value: unknown }[], + }, +] + +// ============================================================ +// 退回拆包(returnUnpack) - UpperTable 列配置 +// 对齐 returnUnpack.list 实际响应字段 +// ============================================================ +export const returnUnpackColumns = [ + { prop: 'id', label: 'ID', width: '80', sortable: 'custom' }, + { prop: 'unpack_no', label: '拆包单号', minWidth: '170', showOverflowTooltip: true, copyAction: 'copy' as const }, + { prop: 'waybill_code', label: '退回运单号', minWidth: '180', showOverflowTooltip: true, copyAction: 'copy' as const }, + { prop: 'status', label: '拆包状态', width: '100' }, + { prop: 'detail_status', label: '明细状态', width: '110' }, + { prop: 'total_items', label: '物品种类', width: '90' }, + { prop: 'total_quantity', label: '总数量', width: '90' }, + { prop: 'unpacker_name', label: '拆包人', minWidth: '100', showOverflowTooltip: true }, + { prop: 'unpack_date', label: '拆包日期', width: '130' }, + { prop: 'is_original_return', label: '原单退回', width: '100' }, + { prop: 'store_id', label: '货主ID', width: '90' }, + { prop: 'created_at', label: '创建时间', width: '170', sortable: 'custom' }, + { prop: 'actions', label: '操作', width: '240', fixed: 'right' }, +] + +// ============================================================ +// 工具栏按钮 +// ============================================================ +export const returnUnpackToolbarButtons: ToolbarButtonConfig[] = [ + { key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' }, + { key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' }, +] diff --git a/src/views/message/components/CreateAfterSaleDialog.vue b/src/views/message/components/CreateAfterSaleDialog.vue index 250c0d2d..bc04d39d 100644 --- a/src/views/message/components/CreateAfterSaleDialog.vue +++ b/src/views/message/components/CreateAfterSaleDialog.vue @@ -152,7 +152,7 @@