diff --git a/src/api/returnunpack/index.ts b/src/api/returnunpack/index.ts index bd573d70..4f54cfaa 100644 --- a/src/api/returnunpack/index.ts +++ b/src/api/returnunpack/index.ts @@ -37,8 +37,10 @@ export function returnUnpackCreate(data: ReturnUnpackCreateParams): Promise export type ReturnUnpackAddDetailParams = { /** 拆包单ID(returnUnpack.create 返回的依据) */ id: number - /** 系统商品ID(wms_stock_warehouse.id),为空即无关联货物 */ - stock_id?: number + /** 系统商品ID(wms_stock_warehouse.id),为空即无关联货物(商品名称标注未知商品) */ + stock_id?: number | null + /** 扫描条码(最长100字符,仅作记录,不参与商品匹配) */ + barcode?: string /** 数量,默认 1(小于 1 按 1 处理) */ quantity?: number /** 产品状态:normal 正常(默认)/ damaged 破损 */ diff --git a/src/api/returnwaybill/index.ts b/src/api/returnwaybill/index.ts new file mode 100644 index 00000000..f147f7e7 --- /dev/null +++ b/src/api/returnwaybill/index.ts @@ -0,0 +1,161 @@ +import request from '@/utils/request' + +const v = '1.0' + +// ============ returnWaybill.create ============ + +/** returnWaybill.create 请求参数 */ +export type ReturnWaybillCreateParams = { + /** 运单号(登记入参,必填,trim 后不能为空) */ + waybill_code: string + /** 货主ID(必填,正整数,需存在 wms_store_warehouse 中 store_id + warehouse_id 合约记录) */ + store_id: number + /** 备注(可选,最长 500 字符,超出截断) */ + remark?: string +} + +/** returnWaybill.create:运单退回登记(录入「货主 + 运单号」退回关系) */ +export function returnWaybillCreate(data: ReturnWaybillCreateParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnWaybill.create', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ returnWaybill.update ============ + +/** returnWaybill.update 请求参数 */ +export type ReturnWaybillUpdateParams = { + /** 登记记录主键ID(必填,正整数) */ + id: number + /** 运单号(可选,改运单号,trim 后不能为空字符串) */ + waybill_code?: string + /** 货主ID(可选,改货主ID;变更时校验新货主在当前仓库的合约) */ + store_id?: number + /** 备注(可选,最长 500 字符,超出截断) */ + remark?: string +} + +/** returnWaybill.update:修改登记(id 必填,可改 waybill_code/store_id/remark) */ +export function returnWaybillUpdate(data: ReturnWaybillUpdateParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnWaybill.update', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ returnWaybill.list ============ + +/** returnWaybill.list 的 where 筛选条件 */ +export type ReturnWaybillListWhere = { + /** 运单号(模糊搜索,传 {operator:'like',value} 或直接值) */ + waybill_code?: string | { operator: string; value: any } + /** 货主ID(等值) */ + store_id?: number + /** 是否已通知(等值):1 已通知 / 0 未通知 */ + is_notified?: 0 | 1 + /** 是否退回(等值):1 已退回 / 0 未退回 */ + is_back?: 0 | 1 + /** 登记日期范围 { operator:'between'|'gte'|'lte'|'gt'|'lt', value:[start,end] 或单值 } */ + created_at?: { operator: 'between' | 'gte' | 'lte' | 'gt' | 'lt'; value: [string, string] | string } +} + +/** returnWaybill.list 排序参数 */ +export type ReturnWaybillListSort = { + /** 排序字段 */ + sortField?: 'id' | 'created_at' | 'updated_at' | 'waybill_code' + /** 排序方向:asc / desc */ + sortOrder?: 'asc' | 'desc' +} + +/** returnWaybill.list 请求参数 */ +export type ReturnWaybillListParams = { + pagination?: { page?: number; pageSize?: number } + where?: ReturnWaybillListWhere + sort?: ReturnWaybillListSort +} + +/** returnWaybill.list:运单退回登记分页列表(仓库隔离,服务端注入 warehouse_id) */ +export function returnWaybillList(data: ReturnWaybillListParams = {}): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnWaybill.list', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ returnWaybill.detail ============ + +/** returnWaybill.detail 请求参数 */ +export type ReturnWaybillDetailParams = { + /** 登记记录主键ID(必填,正整数) */ + id: number +} + +/** returnWaybill.detail:运单退回登记详情(仓库隔离校验) */ +export function returnWaybillDetail(data: ReturnWaybillDetailParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnWaybill.detail', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ returnWaybill.delete ============ + +/** returnWaybill.delete 请求参数 */ +export type ReturnWaybillDeleteParams = { + /** 登记记录主键ID(必填,正整数) */ + id: number +} + +/** returnWaybill.delete:删除运单退回登记(物理删除,表 paranoid:false) */ +export function returnWaybillDelete(data: ReturnWaybillDeleteParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnWaybill.delete', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + +// ============ 模块导出 ============ + +export const returnWaybillModule = { + create: returnWaybillCreate, + update: returnWaybillUpdate, + list: returnWaybillList, + detail: returnWaybillDetail, + delete: returnWaybillDelete +} diff --git a/src/api/setting.warehouse/settingwarehouse.ts b/src/api/setting.warehouse/settingwarehouse.ts index 96bfa1d6..141162a8 100644 --- a/src/api/setting.warehouse/settingwarehouse.ts +++ b/src/api/setting.warehouse/settingwarehouse.ts @@ -33,6 +33,7 @@ export type SettingWarehouseSenderConfig = { district_name?: string town_name?: string address?: string + receiver_address?: string } export const WAREHOUSE_SENDER_FIELD_KEYS = [ @@ -42,7 +43,8 @@ export const WAREHOUSE_SENDER_FIELD_KEYS = [ 'city_name', 'district_name', 'town_name', - 'address' + 'address', + 'receiver_address' ] as const export const DEFAULT_WAREHOUSE_SENDER_FIELDS: Required = { @@ -52,7 +54,8 @@ export const DEFAULT_WAREHOUSE_SENDER_FIELDS: Required = { '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'), + 'express/returnwaybill/index': () => import('@/views/express/returnwaybill/index.vue'), + 'express/returnUnpackwork/index': () => import('@/views/express/returnUnpackwork/index.vue'), }; \ No newline at end of file diff --git a/src/views/express/returnUnpack/components/StockPickerDialog.vue b/src/views/express/returnUnpack/components/StockPickerDialog.vue new file mode 100644 index 00000000..14e24e4c --- /dev/null +++ b/src/views/express/returnUnpack/components/StockPickerDialog.vue @@ -0,0 +1,197 @@ + + + + + diff --git a/src/views/express/returnUnpack/index.vue b/src/views/express/returnUnpack/index.vue index f4b099c1..06222467 100644 --- a/src/views/express/returnUnpack/index.vue +++ b/src/views/express/returnUnpack/index.vue @@ -24,30 +24,6 @@ @action="handleToolbarButtonClick" /> -
- - - 开拆包单 -
@@ -99,21 +75,6 @@ @@ -189,12 +150,6 @@
拆包明细({{ detailList.length }}) - 录明细
@@ -221,76 +176,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/src/views/express/returnUnpackwork/index.vue b/src/views/express/returnUnpackwork/index.vue new file mode 100644 index 00000000..967d52b1 --- /dev/null +++ b/src/views/express/returnUnpackwork/index.vue @@ -0,0 +1,1327 @@ + + + + + \ No newline at end of file diff --git a/src/views/express/returnwaybill/index.vue b/src/views/express/returnwaybill/index.vue new file mode 100644 index 00000000..0be3ddda --- /dev/null +++ b/src/views/express/returnwaybill/index.vue @@ -0,0 +1,647 @@ + + + + + diff --git a/src/views/express/returnwaybill/returnwaybill-config.ts b/src/views/express/returnwaybill/returnwaybill-config.ts new file mode 100644 index 00000000..b41ff59c --- /dev/null +++ b/src/views/express/returnwaybill/returnwaybill-config.ts @@ -0,0 +1,64 @@ +import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config' + +// ============================================================ +// 运单退回登记(returnWaybill) - ScanBox 筛选字段 +// 对齐 returnWaybill.list 接口文档 where 参数 +// ============================================================ +export const returnWaybillAvailableFields = [ + { + value: 'waybill_code', + label: '运单号', + type: 'text', + placeholder: '运单号模糊搜索', + operators: ['like'], + defaultOperator: 'like', + }, + { + value: 'store_id', + label: '货主', + type: 'select', + placeholder: '请选择货主', + options: [] as { label: string; value: unknown }[], + }, + { + value: 'is_notified', + label: '是否已通知', + type: 'boolean', + placeholder: '请选择是否已通知', + }, + { + value: 'is_back', + label: '是否退回', + type: 'boolean', + placeholder: '请选择是否退回', + }, + { + value: 'created_at', + label: '登记时间', + type: 'datetimerange', + }, +] + +// ============================================================ +// 运单退回登记(returnWaybill) - UpperTable 列配置 +// 对齐 returnWaybill.list 实际响应字段 +// ============================================================ +export const returnWaybillColumns = [ + { prop: 'id', label: 'ID', width: '80', sortable: 'custom' }, + { prop: 'waybill_code', label: '运单号', minWidth: '180', showOverflowTooltip: true, copyAction: 'copy' as const }, + { prop: 'store_id', label: '货主ID', width: '100' }, + { prop: 'is_notified', label: '是否已通知', width: '110' }, + { prop: 'is_back', label: '是否退回', width: '100' }, + { prop: 'remark', label: '备注', minWidth: '140', showOverflowTooltip: true }, + { prop: 'created_at', label: '登记时间', width: '170', sortable: 'custom' }, + { prop: 'updated_at', label: '更新时间', width: '170', sortable: 'custom' }, + { prop: 'actions', label: '操作', width: '200', fixed: 'right' }, +] + +// ============================================================ +// 工具栏按钮 +// ============================================================ +export const returnWaybillToolbarButtons: 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/system/setting/basicManagement/index.vue b/src/views/system/setting/basicManagement/index.vue index 6fddba27..f1b765bd 100644 --- a/src/views/system/setting/basicManagement/index.vue +++ b/src/views/system/setting/basicManagement/index.vue @@ -356,6 +356,7 @@ const FALLBACK_FIELDS: NormalizedField[] = [ { key: 'district_name', label: '默认发件区/县', type: 'string', maxLength: 50 }, { key: 'town_name', label: '默认发件镇/街道', type: 'string', maxLength: 50 }, { key: 'address', label: '默认发件详细地址', type: 'string', maxLength: 200 }, + { key: 'receiver_address', label: '仓库收货地址', type: 'string', maxLength: 500, description: '退货/退件收件地址,一行文本' }, { key: 'auto_outbound_rules', label: '自动出库规则',