73
This commit is contained in:
parent
7558b61e33
commit
b7826027b9
@ -167,5 +167,17 @@ export default {
|
|||||||
"type": "Type",
|
"type": "Type",
|
||||||
"status": "Status",
|
"status": "Status",
|
||||||
"address": "Address"
|
"address": "Address"
|
||||||
|
},
|
||||||
|
"setting": {
|
||||||
|
"printTemplate": {
|
||||||
|
"list": {
|
||||||
|
"STOCK": "Stock Label",
|
||||||
|
"RECEIPT": "Receipt",
|
||||||
|
"PICKING": "Picking List",
|
||||||
|
"PICKIN": "Picking List",
|
||||||
|
"OUTBOUND": "Outbound Order",
|
||||||
|
"ENTRY_ORDER": "Entry Order"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -168,5 +168,17 @@ export default {
|
|||||||
"type": "仓库类型",
|
"type": "仓库类型",
|
||||||
"status": "仓库状态",
|
"status": "仓库状态",
|
||||||
"address": "仓库地址"
|
"address": "仓库地址"
|
||||||
|
},
|
||||||
|
"setting": {
|
||||||
|
"printTemplate": {
|
||||||
|
"list": {
|
||||||
|
"STOCK": "商品标签",
|
||||||
|
"RECEIPT": "收货单",
|
||||||
|
"PICKING": "拣货单",
|
||||||
|
"PICKIN": "拣货单",
|
||||||
|
"OUTBOUND": "出库单",
|
||||||
|
"ENTRY_ORDER": "入库单"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -18,7 +18,7 @@ export const COMMON_TRANSLATIONS: Record<string, Record<string, string>> = {
|
|||||||
'padding': '待同步',
|
'padding': '待同步',
|
||||||
'pedding': '待同步',
|
'pedding': '待同步',
|
||||||
'pending': '待同步',
|
'pending': '待同步',
|
||||||
'fin': '已完成',
|
'fin': '已同步',
|
||||||
'error': '错误',
|
'error': '错误',
|
||||||
'none': '未同步'
|
'none': '未同步'
|
||||||
},
|
},
|
||||||
@ -1655,8 +1655,7 @@ export const pendingAvailableFields = [
|
|||||||
orderStatusScanField(pendingOrderStatusFilterOptions),
|
orderStatusScanField(pendingOrderStatusFilterOptions),
|
||||||
syncStatusScanField,
|
syncStatusScanField,
|
||||||
recheckStatusScanField,
|
recheckStatusScanField,
|
||||||
storageAssignScanField,
|
storageStatusScanField,
|
||||||
// storageStatusScanField,
|
|
||||||
postStatusScanField,
|
postStatusScanField,
|
||||||
pickStatusScanField,
|
pickStatusScanField,
|
||||||
packStatusScanField,
|
packStatusScanField,
|
||||||
@ -1882,8 +1881,10 @@ export const exceptionToolbarButtonKeys = [...pendingToolbarButtonKeys]
|
|||||||
export const exceptionToolbarButtons = pickToolbarButtons(exceptionToolbarButtonKeys)
|
export const exceptionToolbarButtons = pickToolbarButtons(exceptionToolbarButtonKeys)
|
||||||
|
|
||||||
|
|
||||||
// outboundOrder
|
// outboundOrder(保留储位分配筛选,与待处理订单的储位状态区分)
|
||||||
export const outboundAvailableFields = pendingAvailableFields
|
export const outboundAvailableFields = pendingAvailableFields.map((field: any) =>
|
||||||
|
field.value === 'storage_status' ? storageAssignScanField : field
|
||||||
|
)
|
||||||
export const outboundColumns = pendingCloums
|
export const outboundColumns = pendingCloums
|
||||||
|
|
||||||
|
|
||||||
@ -1977,8 +1978,7 @@ export const expectionOrderAvailableFields = [
|
|||||||
orderStatusScanField(exceptionOrderStatusFilterOptions),
|
orderStatusScanField(exceptionOrderStatusFilterOptions),
|
||||||
syncStatusScanField,
|
syncStatusScanField,
|
||||||
recheckStatusScanField,
|
recheckStatusScanField,
|
||||||
storageAssignScanField,
|
storageStatusScanField,
|
||||||
// storageStatusScanField,
|
|
||||||
postStatusScanField,
|
postStatusScanField,
|
||||||
pickStatusScanField,
|
pickStatusScanField,
|
||||||
packStatusScanField,
|
packStatusScanField,
|
||||||
|
|||||||
@ -24,18 +24,6 @@
|
|||||||
:layout-key="toolbarLayoutKey"
|
:layout-key="toolbarLayoutKey"
|
||||||
@action="handleToolbarButtonClick"
|
@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">
|
<template v-for="(btn, index) in expectionOrderbuttonList" :key="index">
|
||||||
<el-dropdown
|
<el-dropdown
|
||||||
|
|||||||
@ -26,18 +26,6 @@
|
|||||||
:layout-key="toolbarLayoutKey"
|
:layout-key="toolbarLayoutKey"
|
||||||
@action="handleToolbarButtonClick"
|
@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>
|
</div>
|
||||||
|
|
||||||
<!-- 已迁移至 ScanBox:搜索订单号 -->
|
<!-- 已迁移至 ScanBox:搜索订单号 -->
|
||||||
|
|||||||
@ -182,11 +182,15 @@ import { ref, computed, onMounted } from 'vue'
|
|||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import type { FormInstance, FormRules } from 'element-plus'
|
import type { FormInstance, FormRules } from 'element-plus'
|
||||||
import { Document, Folder, Plus, Delete, Refresh } from '@element-plus/icons-vue'
|
import { Document, Folder, Plus, Delete, Refresh } from '@element-plus/icons-vue'
|
||||||
|
import { useI18n } from 'vue-i18n'
|
||||||
import TemplateEditor from './components/TemplateEditor.vue'
|
import TemplateEditor from './components/TemplateEditor.vue'
|
||||||
import * as TemplatesApi from '@/api/setting.printtemplate/printTemplate'
|
import * as TemplatesApi from '@/api/setting.printtemplate/printTemplate'
|
||||||
import { usePrintTemplateStore } from '@/stores/modules/printTemplate'
|
import { usePrintTemplateStore } from '@/stores/modules/printTemplate'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
|
|
||||||
|
const { t } = useI18n()
|
||||||
|
const PRINT_TEMPLATE_LIST_I18N_PREFIX = 'setting.printTemplate.list'
|
||||||
|
|
||||||
const printTemplateStore = usePrintTemplateStore()
|
const printTemplateStore = usePrintTemplateStore()
|
||||||
const { templateInfo, templateObjects } = storeToRefs(printTemplateStore)
|
const { templateInfo, templateObjects } = storeToRefs(printTemplateStore)
|
||||||
|
|
||||||
@ -246,6 +250,40 @@ function pickCreatedId(res: any): number | null {
|
|||||||
return Number.isFinite(n) ? n : 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 }[] {
|
function collectBusinessTypesFromTree(nodes: any[]): { label: string; value: string }[] {
|
||||||
const seen = new Map<string, string>()
|
const seen = new Map<string, string>()
|
||||||
const walk = (arr: any[]) => {
|
const walk = (arr: any[]) => {
|
||||||
@ -255,8 +293,7 @@ function collectBusinessTypesFromTree(nodes: any[]): { label: string; value: str
|
|||||||
if (bt != null && String(bt).trim() !== '') {
|
if (bt != null && String(bt).trim() !== '') {
|
||||||
const key = String(bt)
|
const key = String(bt)
|
||||||
if (!seen.has(key)) {
|
if (!seen.has(key)) {
|
||||||
const title = typeof n.title === 'string' && n.title && !n.title.includes('.') ? n.title : key
|
seen.set(key, resolvePresetTreeTitle(n) || toPrintTemplateListI18nKey(key))
|
||||||
seen.set(key, title)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (n?.children?.length) walk(n.children)
|
if (n?.children?.length) walk(n.children)
|
||||||
@ -264,7 +301,7 @@ function collectBusinessTypesFromTree(nodes: any[]): { label: string; value: str
|
|||||||
}
|
}
|
||||||
walk(nodes)
|
walk(nodes)
|
||||||
return [...seen.entries()]
|
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))
|
.sort((a, b) => a.value.localeCompare(b.value))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,7 +361,7 @@ const loadTemplates = async () => {
|
|||||||
try {
|
try {
|
||||||
const res: any = await TemplatesApi.listTemplates({})
|
const res: any = await TemplatesApi.listTemplates({})
|
||||||
if (isApiSuccess(res)) {
|
if (isApiSuccess(res)) {
|
||||||
filteredPresetTree.value = res.presetTree || []
|
filteredPresetTree.value = normalizePresetTree(res.presetTree || [])
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error('加载模板失败: ' + (res.message || '未知错误'))
|
ElMessage.error('加载模板失败: ' + (res.message || '未知错误'))
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user