This commit is contained in:
yin 2026-07-02 18:11:23 +08:00
parent 7558b61e33
commit b7826027b9
6 changed files with 72 additions and 35 deletions

View File

@ -167,5 +167,17 @@ export default {
"type": "Type",
"status": "Status",
"address": "Address"
},
"setting": {
"printTemplate": {
"list": {
"STOCK": "Stock Label",
"RECEIPT": "Receipt",
"PICKING": "Picking List",
"PICKIN": "Picking List",
"OUTBOUND": "Outbound Order",
"ENTRY_ORDER": "Entry Order"
}
}
}
}

View File

@ -168,5 +168,17 @@ export default {
"type": "仓库类型",
"status": "仓库状态",
"address": "仓库地址"
},
"setting": {
"printTemplate": {
"list": {
"STOCK": "商品标签",
"RECEIPT": "收货单",
"PICKING": "拣货单",
"PICKIN": "拣货单",
"OUTBOUND": "出库单",
"ENTRY_ORDER": "入库单"
}
}
}
}

View File

@ -18,7 +18,7 @@ export const COMMON_TRANSLATIONS: Record<string, Record<string, string>> = {
'padding': '待同步',
'pedding': '待同步',
'pending': '待同步',
'fin': '已完成',
'fin': '已同步',
'error': '错误',
'none': '未同步'
},
@ -1655,8 +1655,7 @@ export const pendingAvailableFields = [
orderStatusScanField(pendingOrderStatusFilterOptions),
syncStatusScanField,
recheckStatusScanField,
storageAssignScanField,
// storageStatusScanField,
storageStatusScanField,
postStatusScanField,
pickStatusScanField,
packStatusScanField,
@ -1882,8 +1881,10 @@ export const exceptionToolbarButtonKeys = [...pendingToolbarButtonKeys]
export const exceptionToolbarButtons = pickToolbarButtons(exceptionToolbarButtonKeys)
// outboundOrder
export const outboundAvailableFields = pendingAvailableFields
// outboundOrder(保留储位分配筛选,与待处理订单的储位状态区分)
export const outboundAvailableFields = pendingAvailableFields.map((field: any) =>
field.value === 'storage_status' ? storageAssignScanField : field
)
export const outboundColumns = pendingCloums
@ -1977,8 +1978,7 @@ export const expectionOrderAvailableFields = [
orderStatusScanField(exceptionOrderStatusFilterOptions),
syncStatusScanField,
recheckStatusScanField,
storageAssignScanField,
// storageStatusScanField,
storageStatusScanField,
postStatusScanField,
pickStatusScanField,
packStatusScanField,

View File

@ -24,18 +24,6 @@
:layout-key="toolbarLayoutKey"
@action="handleToolbarButtonClick"
/>
<!-- 已迁移至 ScanBox:储位分配 -->
<!-- <el-select
v-model="storageAssignFilter"
placeholder="储位分配"
size="small"
clearable
style="width: 130px"
@change="handleStorageAssignFilterChange"
>
<el-option label="未分配" value="unassigned" />
<el-option label="已完成" value="completed" />
</el-select> -->
<template v-for="(btn, index) in expectionOrderbuttonList" :key="index">
<el-dropdown

View File

@ -26,18 +26,6 @@
:layout-key="toolbarLayoutKey"
@action="handleToolbarButtonClick"
/>
<!-- 已迁移至 ScanBox:储位分配 -->
<!-- <el-select
v-model="storageAssignFilter"
placeholder="储位分配"
size="small"
clearable
style="width: 130px"
@change="handleStorageAssignFilterChange"
>
<el-option label="未分配" value="unassigned" />
<el-option label="已完成" value="completed" />
</el-select> -->
</div>
<!-- 已迁移至 ScanBox:搜索订单号 -->

View File

@ -182,11 +182,15 @@ import { ref, computed, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import { Document, Folder, Plus, Delete, Refresh } from '@element-plus/icons-vue'
import { useI18n } from 'vue-i18n'
import TemplateEditor from './components/TemplateEditor.vue'
import * as TemplatesApi from '@/api/setting.printtemplate/printTemplate'
import { usePrintTemplateStore } from '@/stores/modules/printTemplate'
import { storeToRefs } from 'pinia'
const { t } = useI18n()
const PRINT_TEMPLATE_LIST_I18N_PREFIX = 'setting.printTemplate.list'
const printTemplateStore = usePrintTemplateStore()
const { templateInfo, templateObjects } = storeToRefs(printTemplateStore)
@ -246,6 +250,40 @@ function pickCreatedId(res: any): number | null {
return Number.isFinite(n) ? n : null
}
function toPrintTemplateListI18nKey(businessType: string): string {
return `${PRINT_TEMPLATE_LIST_I18N_PREFIX}.${businessType}`
}
function resolvePresetTreeTitle(node: any): string {
const bt = node?.business_type ?? node?.businessType
if (bt != null && String(bt).trim() !== '') {
return toPrintTemplateListI18nKey(String(bt).trim())
}
const title = typeof node?.title === 'string' ? node.title.trim() : ''
if (title && title.startsWith(`${PRINT_TEMPLATE_LIST_I18N_PREFIX}.`)) {
return title
}
if (title) {
return toPrintTemplateListI18nKey(title)
}
return ''
}
function normalizePresetTree(nodes: any[]): any[] {
if (!Array.isArray(nodes)) return []
return nodes.map((node) => {
const next = { ...node }
if (node?.type === 'category') {
const titleKey = resolvePresetTreeTitle(node)
if (titleKey) next.title = titleKey
}
if (Array.isArray(node?.children) && node.children.length) {
next.children = normalizePresetTree(node.children)
}
return next
})
}
function collectBusinessTypesFromTree(nodes: any[]): { label: string; value: string }[] {
const seen = new Map<string, string>()
const walk = (arr: any[]) => {
@ -255,8 +293,7 @@ function collectBusinessTypesFromTree(nodes: any[]): { label: string; value: str
if (bt != null && String(bt).trim() !== '') {
const key = String(bt)
if (!seen.has(key)) {
const title = typeof n.title === 'string' && n.title && !n.title.includes('.') ? n.title : key
seen.set(key, title)
seen.set(key, resolvePresetTreeTitle(n) || toPrintTemplateListI18nKey(key))
}
}
if (n?.children?.length) walk(n.children)
@ -264,7 +301,7 @@ function collectBusinessTypesFromTree(nodes: any[]): { label: string; value: str
}
walk(nodes)
return [...seen.entries()]
.map(([value, label]) => ({ value, label: `${label} (${value})` }))
.map(([value, titleKey]) => ({ value, label: `${t(titleKey)} (${value})` }))
.sort((a, b) => a.value.localeCompare(b.value))
}
@ -324,7 +361,7 @@ const loadTemplates = async () => {
try {
const res: any = await TemplatesApi.listTemplates({})
if (isApiSuccess(res)) {
filteredPresetTree.value = res.presetTree || []
filteredPresetTree.value = normalizePresetTree(res.presetTree || [])
} else {
ElMessage.error('加载模板失败: ' + (res.message || '未知错误'))
}