1
This commit is contained in:
parent
4822637729
commit
5cd18ae9de
@ -598,8 +598,8 @@ export function orderPendingOrderParseAddress(
|
||||
},
|
||||
data,
|
||||
isSystemApi: true,
|
||||
// 地址解析可能调用外部服务,延长超时时间至 35 秒
|
||||
timeout: 35000,
|
||||
// 地址解析可能调用外部服务,延长超时时间至 60 秒
|
||||
timeout: 60000,
|
||||
} as any);
|
||||
}
|
||||
|
||||
|
||||
@ -121,7 +121,7 @@ export function packingGet(id: number): Promise<{
|
||||
export type PackingSetEndTimeParams = {
|
||||
/** 打包任务ID(必填) */
|
||||
id: number
|
||||
/** 结束时间 YYYY-MM-DD HH:mm:ss 格式(必填) */
|
||||
/** 结束时间(ISO 8601 格式,如 2026-07-27T11:00:00.000Z,必填) */
|
||||
end_time: string
|
||||
}
|
||||
|
||||
|
||||
@ -62,6 +62,10 @@ export const DEFAULT_WAREHOUSE_SENDER_FIELDS: Required<SettingWarehouseSenderCon
|
||||
export type SettingWarehouseSubjectConfig = SettingWarehouseSenderConfig & {
|
||||
enable_external_express_code?: boolean
|
||||
auto_outbound_rules?: SettingWarehouseAutoOutboundRules
|
||||
/** 散单打包最大时长,单位:分钟,默认 3 */
|
||||
single_order_pack_max_minutes?: number
|
||||
/** 团购打包最大时长,单位:分钟,默认 40 */
|
||||
group_order_pack_max_minutes?: number
|
||||
max_wave_quantity?: number
|
||||
min_group_order_fetch_quantity?: number
|
||||
max_notice_webhook_count?: number
|
||||
@ -136,6 +140,14 @@ export function normalizeWarehouseSubjectConfig(
|
||||
.map((v) => v.trim())
|
||||
}
|
||||
|
||||
// 打包最大时长(分钟,须为大于 0 的整数;默认 散单 3 / 团购 40)
|
||||
const singlePackMax = Number(base.single_order_pack_max_minutes)
|
||||
base.single_order_pack_max_minutes =
|
||||
Number.isFinite(singlePackMax) && singlePackMax > 0 ? Math.trunc(singlePackMax) : 3
|
||||
const groupPackMax = Number(base.group_order_pack_max_minutes)
|
||||
base.group_order_pack_max_minutes =
|
||||
Number.isFinite(groupPackMax) && groupPackMax > 0 ? Math.trunc(groupPackMax) : 40
|
||||
|
||||
return base as SettingWarehouseSubjectConfig
|
||||
}
|
||||
|
||||
|
||||
@ -51,12 +51,11 @@ export function shopsDel(data: { id: number }) {
|
||||
})
|
||||
}
|
||||
|
||||
/** 编辑店铺 */
|
||||
/** 编辑店铺(仅允许修改 platform_code / custom_name) */
|
||||
export function shopsEdit(data: {
|
||||
id: number
|
||||
platform_code?: string
|
||||
custom_name?: string
|
||||
shop_name?: string
|
||||
}) {
|
||||
return request({
|
||||
url: '/system',
|
||||
|
||||
@ -38,10 +38,14 @@ export type WaybillWarehouseListWhere = {
|
||||
hasWeighingWeight?: boolean
|
||||
/** 关键词搜索:同时匹配运单号、主单号、订单号 */
|
||||
keyword?: string
|
||||
/** 创建时间起始,格式 YYYY-MM-DD */
|
||||
/** 创建时间起始,格式 YYYY-MM-DD(兼容旧写法) */
|
||||
createdAtStart?: string
|
||||
/** 创建时间截止,格式 YYYY-MM-DD */
|
||||
/** 创建时间截止,格式 YYYY-MM-DD(兼容旧写法) */
|
||||
createdAtEnd?: string
|
||||
/** 创建时间范围:{ operator: 'between', value: [起始时间, 结束时间] } */
|
||||
createdAt?: { operator: string; value: string[] }
|
||||
/** 运单ID列表(勾选导出,按 wms_order_express.id 精确过滤) */
|
||||
ids?: number[]
|
||||
}
|
||||
|
||||
/** waybill.warehouse.list 排序参数 */
|
||||
|
||||
@ -83,6 +83,14 @@
|
||||
</template>
|
||||
<template #column-operation="{ row }">
|
||||
<div class="wave-operation-actions">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
@click.stop="openSetEndTimeDialog(row)"
|
||||
>
|
||||
设置结束时间
|
||||
</el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
size="small"
|
||||
@ -142,6 +150,16 @@
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="设备ID">{{ (detail.device_ids || []).join(',') || '—' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="包含录像">
|
||||
<el-tag :type="hasVideoConfig[resolveHasVideoVal(detail)]?.tagType || 'info'" size="small">
|
||||
{{ hasVideoConfig[resolveHasVideoVal(detail)]?.text || '—' }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="录像可用">
|
||||
<el-tag :type="videoEnableConfig[resolveVideoEnableVal(detail)]?.tagType || 'info'" size="small">
|
||||
{{ videoEnableConfig[resolveVideoEnableVal(detail)]?.text || '—' }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注">{{ detail.remark || '—' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="运单号">
|
||||
<template v-if="detail.expresses && detail.expresses.length">
|
||||
@ -575,18 +593,17 @@ const setEndTimeForm = reactive({
|
||||
end_time: ''
|
||||
})
|
||||
|
||||
/** 计算结束时间默认值:已有结束时间→解析已有时间;无→开始时间+5分钟;否则当前时间 */
|
||||
/** 计算结束时间默认值(文档:已有结束时间→当前时间;无→开始时间+5分钟;否则当前时间) */
|
||||
function computeDefaultEndTime(): string {
|
||||
const fmt = 'YYYY-MM-DD HH:mm:ss'
|
||||
if (operatingRow.value?.end_time) {
|
||||
const existing = dayjs(operatingRow.value.end_time)
|
||||
if (existing.isValid()) {
|
||||
return existing.format(fmt)
|
||||
}
|
||||
// 已有结束时间 → 默认为当前时间
|
||||
return dayjs().format(fmt)
|
||||
}
|
||||
if (operatingRow.value?.start_time) {
|
||||
const start = dayjs(operatingRow.value.start_time)
|
||||
if (start.isValid()) {
|
||||
// 无结束时间 → 默认为开始时间+5分钟
|
||||
return start.add(5, 'minute').format(fmt)
|
||||
}
|
||||
}
|
||||
@ -609,7 +626,8 @@ async function handleSetEndTime() {
|
||||
try {
|
||||
const res = await packingSetEndTime({
|
||||
id: Number(operatingRow.value.id),
|
||||
end_time: setEndTimeForm.end_time
|
||||
// 转 ISO 8601 格式(如 2026-07-27T11:00:00.000Z)
|
||||
end_time: dayjs(setEndTimeForm.end_time).toISOString()
|
||||
})
|
||||
const codeOk = [200, 20000, 1, 0].includes(res.code)
|
||||
if (!codeOk) {
|
||||
|
||||
@ -132,9 +132,11 @@ export const packingColumns = [
|
||||
{ prop: 'waybill_code', label: '运单号', minWidth: 160, copyAction: 'copy' as const, copyValue: (row: any) => getWaybill(row), formatter: (row: any) => getWaybill(row) || '—' },
|
||||
{ prop: 'wave_no', label: '波次号', minWidth: 140, copyAction: 'copy' as const },
|
||||
{ prop: 'warehouse_id', label: '仓库ID', width: 100 },
|
||||
{ prop: 'workbench_id', label: '工作台ID', width: 100 },
|
||||
{ prop: 'operator_text', label: '打包员', width: 100 },
|
||||
{ prop: 'workbench_name', label: '工作台', width: 120, formatter: (row: any) => row.workbench_name || '—' },
|
||||
{ prop: 'workbench_barcode', label: '工作台条码', width: 130 },
|
||||
{ prop: 'workbench_type', label: '工作台类型', width: 110, formatter: (row: any) => row.workbench_type || '—' },
|
||||
{ prop: 'pack_quantity', label: '打包数量', width: 100, sortable: true },
|
||||
{ prop: 'item_quantity', label: '商品数量', width: 100 },
|
||||
{ prop: 'sku_count', label: 'SKU数', width: 80 },
|
||||
@ -164,7 +166,7 @@ export const packingColumns = [
|
||||
{ prop: 'has_video', label: '包含录像', width: 90 },
|
||||
{ prop: 'video_enable', label: '录像可用', width: 90 },
|
||||
{ prop: 'videos', label: '录像', width: 110 },
|
||||
{ prop: 'operation', label: '操作', width: 100, fixed: 'right' }
|
||||
{ prop: 'operation', label: '操作', width: 180, fixed: 'right' }
|
||||
]
|
||||
|
||||
// =============================================================================
|
||||
@ -174,6 +176,7 @@ export const packingColumns = [
|
||||
export const PACKING_SCAN_FIELD_GROUPS = {
|
||||
basic: '基础信息',
|
||||
workflow: '流程状态',
|
||||
time: '时间范围',
|
||||
} as const
|
||||
|
||||
type PackingScanFieldGroupKey = keyof typeof PACKING_SCAN_FIELD_GROUPS
|
||||
@ -254,6 +257,27 @@ export const baseAvailableFields = [
|
||||
{ label: '不可用', value: 2 }
|
||||
]
|
||||
}),
|
||||
packingScanField('time', {
|
||||
label: '开始时间',
|
||||
value: 'start_time',
|
||||
type: 'datetimerange' as const,
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间'
|
||||
}),
|
||||
packingScanField('time', {
|
||||
label: '结束时间',
|
||||
value: 'end_time',
|
||||
type: 'datetimerange' as const,
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间'
|
||||
}),
|
||||
packingScanField('time', {
|
||||
label: '创建时间',
|
||||
value: 'create_time',
|
||||
type: 'datetimerange' as const,
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间'
|
||||
}),
|
||||
]
|
||||
|
||||
/** 创建完整筛选字段(注入仓库选择组件) */
|
||||
|
||||
@ -432,9 +432,9 @@ async function handleRegister() {
|
||||
if (res && (res.code === 1 || res.code === 200 || res.code === 20000)) {
|
||||
const data = res.data ?? res
|
||||
if (data.duplicated) {
|
||||
ElMessage.warning(`该运单号 30 日内已登记(记录ID ${data.id}),已返回第一次登记结果`)
|
||||
ElMessage.warning(`该运单号 30 日内已登记(记录ID ${data.record?.id ?? data.id}),已返回第一次登记结果`)
|
||||
} else if (data.is_original_return) {
|
||||
ElMessage.success(`登记成功:命中原单退回,原运单ID ${data.order_express_id}`)
|
||||
ElMessage.success(`登记成功:命中原单退回,原运单ID ${data.record?.order_express_id ?? data.order_express_id}`)
|
||||
} else {
|
||||
ElMessage.success('登记成功')
|
||||
}
|
||||
|
||||
@ -467,7 +467,7 @@ export const FIELD_DICT: Record<string, FieldDefinition> = {
|
||||
createdAtStart: {
|
||||
key: 'createdAtStart',
|
||||
label: '创建时间',
|
||||
scanBox: { type: 'daterange', group: SCANBOX_GROUPS.time },
|
||||
scanBox: { type: 'datetimerange', group: SCANBOX_GROUPS.time },
|
||||
table: null,
|
||||
slot: null
|
||||
},
|
||||
@ -752,11 +752,12 @@ export function buildWhereConditions(rawConditions: Record<string, any>): Record
|
||||
continue
|
||||
}
|
||||
|
||||
// createdAtStart 日期范围 → 拆分为 createdAtStart / createdAtEnd
|
||||
// createdAtStart 日期时间范围 → where.createdAt = { operator: 'between', value: [start, end] }
|
||||
if (key === 'createdAtStart' && Array.isArray(value)) {
|
||||
const [start, end] = value
|
||||
if (start) where.createdAtStart = start
|
||||
if (end) where.createdAtEnd = end
|
||||
if (start && end) {
|
||||
where.createdAt = { operator: 'between', value: [start, end] }
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@ -1299,7 +1299,7 @@ const DELIVERY_CODE_CHECK_BATCH_SIZE = 5
|
||||
const DELIVERY_CODE_CHECK_MAX_CONCURRENT = 5
|
||||
|
||||
/** 单次批量解析地址的最大条数(与接口文档一致) */
|
||||
const PARSE_ADDRESS_BATCH_SIZE = 20
|
||||
const PARSE_ADDRESS_BATCH_SIZE = 50
|
||||
|
||||
/** 批量解析地址:返回与输入 address 一一对应的解析结果(失败项为 null) */
|
||||
async function batchParseAddresses(addresses: string[]): Promise<(PendingOrderParseAddressData | null)[]> {
|
||||
|
||||
@ -123,9 +123,6 @@
|
||||
<el-form-item label="自定义名称" prop="custom_name">
|
||||
<el-input v-model="formData.custom_name" placeholder="最大 100 字符" maxlength="100" show-word-limit />
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺名称" prop="shop_name">
|
||||
<el-input v-model="formData.shop_name" placeholder="最大 100 字符" maxlength="100" show-word-limit />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="dialogMode === 'create'">
|
||||
<el-text type="info" size="small">
|
||||
店铺名称由服务端生成待授权占位名,完成平台授权后将自动同步真实店铺名。
|
||||
@ -576,20 +573,17 @@ async function submitForm() {
|
||||
if (!formData.id) return
|
||||
const platformCode = formData.platform_code.trim()
|
||||
const customName = formData.custom_name.trim()
|
||||
const shopName = formData.shop_name.trim()
|
||||
if (!platformCode && !customName && !shopName) {
|
||||
ElMessage.warning('请至少修改平台、自定义名称或店铺名称')
|
||||
if (!platformCode && !customName) {
|
||||
ElMessage.warning('请至少修改平台或自定义名称')
|
||||
return
|
||||
}
|
||||
const payload: {
|
||||
id: number
|
||||
platform_code?: string
|
||||
custom_name?: string
|
||||
shop_name?: string
|
||||
} = { id: formData.id }
|
||||
if (platformCode) payload.platform_code = platformCode
|
||||
if (customName) payload.custom_name = customName
|
||||
if (shopName) payload.shop_name = shopName
|
||||
|
||||
const res: any = await shopsEdit(payload)
|
||||
if (!isSuccess(res)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user