diff --git a/src/api/returnReceived/index.ts b/src/api/returnReceived/index.ts new file mode 100644 index 00000000..e2e3935e --- /dev/null +++ b/src/api/returnReceived/index.ts @@ -0,0 +1,129 @@ +import request from '@/utils/request' + +const v = '1.0' + +// ============ returnReceived.create ============ + +/** returnReceived.create 请求参数 */ +export type ReturnReceivedCreateParams = { + /** 退回收件运单号(扫描到的退回包裹单号) */ + waybill_code: string + /** 备注 */ + remark?: string +} + +/** returnReceived.create:退回包裹扫码登记(30日内同仓库同单号幂等,以第一次为准) */ +export function returnReceivedCreate(data: ReturnReceivedCreateParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnReceived.create', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ returnReceived.list ============ + +/** returnReceived.list 的 where 筛选条件 */ +export type ReturnReceivedListWhere = { + /** 退回收件运单号(模糊搜索,传 {operator:'like',value} 或直接值) */ + waybill_code?: string | { operator: string; value: any } + /** 扫描日期范围 { operator:'between'|'gte'|'lte', value:[start,end] 或单值 } */ + scan_date?: { operator: 'between' | 'gte' | 'lte'; value: [string, string] | string } + /** 扫描人员工号ID(等值) */ + scanner_id?: number + /** 货主ID(等值) */ + store_id?: number + /** 是否原单退回:true=有关联原运单,false=无关联 */ + is_original_return?: boolean +} + +/** returnReceived.list 排序参数 */ +export type ReturnReceivedListSort = { + /** 排序字段:id / scan_date / created_at / updated_at / waybill_code */ + sortField?: 'id' | 'scan_date' | 'created_at' | 'updated_at' | 'waybill_code' + /** 排序方向:asc / desc */ + sortOrder?: 'asc' | 'desc' +} + +/** returnReceived.list 请求参数 */ +export type ReturnReceivedListParams = { + pagination?: { page?: number; pageSize?: number } + where?: ReturnReceivedListWhere + sort?: ReturnReceivedListSort +} + +/** returnReceived.list:退回收到登记分页列表(仓库隔离,服务端注入 warehouse_id) */ +export function returnReceivedList(data: ReturnReceivedListParams = {}): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnReceived.list', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ returnReceived.detail ============ + +/** returnReceived.detail 请求参数 */ +export type ReturnReceivedDetailParams = { + /** 登记记录主键ID */ + id: number +} + +/** returnReceived.detail:退回收到登记详情(含原运单与货主合约备注,命中时) */ +export function returnReceivedDetail(data: ReturnReceivedDetailParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnReceived.detail', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ returnReceived.delete ============ + +/** returnReceived.delete 请求参数 */ +export type ReturnReceivedDeleteParams = { + /** 登记记录主键ID */ + id: number +} + +/** returnReceived.delete:删除退回收到登记记录(物理删除,仅本仓库记录) */ +export function returnReceivedDelete(data: ReturnReceivedDeleteParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnReceived.delete', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ 模块导出 ============ + +export const returnReceivedModule = { + create: returnReceivedCreate, + list: returnReceivedList, + detail: returnReceivedDetail, + delete: returnReceivedDelete +} diff --git a/src/lang/en-US.ts b/src/lang/en-US.ts index 6e7b2525..5d8eb045 100644 --- a/src/lang/en-US.ts +++ b/src/lang/en-US.ts @@ -77,15 +77,6 @@ export default { 'waybill':'waybill', 'inbox_messages':'messages', 'inbox_groups':'groups', - '':'', - '':'', - '':'', - '':'', - '':'', - '':'', - '':'', - '':'', - '':'', }, "login": { "title": "Login", diff --git a/src/lang/zh-CN.ts b/src/lang/zh-CN.ts index a3bb2baf..afaac6a1 100644 --- a/src/lang/zh-CN.ts +++ b/src/lang/zh-CN.ts @@ -80,13 +80,6 @@ export default { 'waybill':'运单', 'inbox_messages':'消息', 'inbox_groups':'群组', - '':'', - '':'', - '':'', - '':'', - '':'', - '':'', - '':'', }, "login": { "title": "登录", diff --git a/src/router/map.ts b/src/router/map.ts index d7fe9f6f..1c7c3359 100644 --- a/src/router/map.ts +++ b/src/router/map.ts @@ -68,6 +68,9 @@ export const componentMap: Record = { 'data/packingflow': () => import('@/views/data/packingflow/index.vue'), 'system/setting/printcomputer/index':() => import('@/views/system/setting/printcomputer/index.vue'), 'express/index':() => import('@/views/express/waybill/index.vue'), + /** 退回收件登记 */ + 'express/returnReceived/index':() => import('@/views/express/returnReceived/index.vue'), + 'express/returnReceived':() => import('@/views/express/returnReceived/index.vue'), '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'), diff --git a/src/views/afterSale/detail/AfterSaleDetailDialog.vue b/src/views/afterSale/detail/AfterSaleDetailDialog.vue index c3a8ce9e..2fb26e68 100644 --- a/src/views/afterSale/detail/AfterSaleDetailDialog.vue +++ b/src/views/afterSale/detail/AfterSaleDetailDialog.vue @@ -135,6 +135,8 @@ {{ detail.related.order.source_order_codes }} {{ detail.related.order.items_total }} {{ detail.related.order.items_weight }} + {{ formatMoney((detail.related.order as any).total_amount) }} + {{ formatMoney((detail.related.order as any).item_amount) }}
@@ -280,6 +282,11 @@ const claimStatusLabel = (c: string) => CLAIM_STATUS_MAP[c] ?? c ?? '-' const claimStatusTagType = (c: string) => CLAIM_STATUS_TAG_MAP[c] ?? 'info' const parseOperatorName = (s: string) => { try { const o = JSON.parse(s); return o.name || o.id || '-' } catch { return s || '-' } } const statusTimelineType = (s: any) => ({ pending: 'warning', processing: 'primary', completed: 'success', closed: 'info' } as any)[s] ?? 'info' +const formatMoney = (v: any) => { + if (v === null || v === undefined || v === '') return '-' + const n = Number(v) + return isNaN(n) ? '-' : '¥' + n.toFixed(2) +} // ==================== 订单操作状态映射 ==================== const ORDER_OP_LABELS: Record> = { @@ -290,11 +297,29 @@ const ORDER_OP_LABELS: Record> = { pick: { none: '未拣货', padding: '拣货中', fin: '已拣货' }, pack: { none: '未打包', padding: '打包中', fin: '已打包' }, post: { none: '未分配运单号', padding: '分配中', fin: '已分配运单号', timeout: '超时', error: '错误' }, - intercept:{ none: '未拦截', pending: '待拦截', success: '已拦截' }, + intercept:{ + none: '无拦截', + requesting: '请求拦截中', + requested: '已请求拦截', + intercepting: '拦截执行中', + intercepted_in_transit: '运输途中已拦截', + intercepted_at_warehouse: '仓库已拦截', + returning: '退回中', + returned: '已退回', + delivered_by_mistake: '误派送', + timeout: '拦截超时', + cancelled: '已取消拦截', + failed: '拦截失败', + exception: '拦截异常', + }, } const ORDER_OP_TAGS: Record = { fin: 'success', padding: 'warning', pedding: 'warning', pending: 'warning', none: 'info', error: 'danger', timeout: 'danger', reject: 'danger', success: 'success', + requesting: 'warning', requested: 'warning', intercepting: 'warning', + intercepted_in_transit: 'success', intercepted_at_warehouse: 'success', + returning: 'warning', returned: 'success', + delivered_by_mistake: 'danger', cancelled: 'info', failed: 'danger', exception: 'danger', } function orderOpLabel(cat: string, val: string) { return ORDER_OP_LABELS[cat]?.[val] ?? val ?? '-' } function orderOpTag(val: string) { return ORDER_OP_TAGS[val] ?? 'info' } diff --git a/src/views/express/returnReceived/index.vue b/src/views/express/returnReceived/index.vue new file mode 100644 index 00000000..7143639f --- /dev/null +++ b/src/views/express/returnReceived/index.vue @@ -0,0 +1,520 @@ + + + + + diff --git a/src/views/express/returnReceived/returnReceived-config.ts b/src/views/express/returnReceived/returnReceived-config.ts new file mode 100644 index 00000000..5bf36c75 --- /dev/null +++ b/src/views/express/returnReceived/returnReceived-config.ts @@ -0,0 +1,67 @@ +import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config' + +// ============================================================ +// 退回收件(returnReceived) - ScanBox 筛选字段 +// 对齐 returnReceived.list 接口文档 where 参数 +// ============================================================ +export const returnReceivedAvailableFields = [ + { + value: 'waybill_code', + label: '退回收件运单号', + type: 'text', + placeholder: '运单号模糊搜索', + operators: ['like'], + defaultOperator: 'like', + }, + { + value: 'scan_date', + label: '扫描时间', + type: 'datetimerange', + }, + { + value: 'scanner_id', + label: '扫描人员工号', + type: 'number', + placeholder: '工号ID等值匹配', + operators: ['eq'], + defaultOperator: 'eq', + }, + { + value: 'store_id', + label: '货主', + type: 'select', + placeholder: '请选择货主', + options: [] as { label: string; value: unknown }[], + }, + { + value: 'is_original_return', + label: '是否原单退回', + type: 'boolean', + placeholder: '请选择是否原单退回', + }, +] + +// ============================================================ +// 退回收件(returnReceived) - UpperTable 列配置 +// 对齐 returnReceived.list 实际响应字段 +// ============================================================ +export const returnReceivedColumns = [ + { prop: 'waybill_code', label: '退回收件运单号', minWidth: '180', showOverflowTooltip: true, sortable: 'custom' }, + { prop: 'scan_date', label: '扫描日期', width: '170', sortable: 'custom' }, + { prop: 'scanner_name', label: '扫描人员', minWidth: '100', showOverflowTooltip: true }, + { prop: 'is_original_return', label: '是否原单退回', width: '110' }, + { prop: 'store_remark', label: '货主备注', minWidth: '140', showOverflowTooltip: true }, + { prop: 'order_express_id', label: '原运单ID', width: '100' }, + { prop: 'order_id', label: '原订单ID', width: '100' }, + { prop: 'remark', label: '备注', minWidth: '120', showOverflowTooltip: true }, + { prop: 'created_at', label: '登记时间', width: '170', sortable: 'custom' }, + { prop: 'actions', label: '操作', width: '140', fixed: 'right' }, +] + +// ============================================================ +// 工具栏按钮 +// ============================================================ +export const returnReceivedToolbarButtons: ToolbarButtonConfig[] = [ + { key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' }, + { key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' }, +]