This commit is contained in:
2026-09-19 17:02:11 +08:00
parent 4eb17ece4f
commit 514abf6eda
33 changed files with 525 additions and 223 deletions
@@ -57,6 +57,14 @@ test('keeps overseas warehouse writes behind operation-specific button permissio
assert.match(returns, /v-if="canCreate" type="primary" @click="openCreate"/)
})
test('keeps all four overseas warehouse create buttons in the shared left-aligned table toolbar', () => {
for (const service of ['labeling', 'transfer', 'disposal']) {
assert.match(routes, new RegExp(`props: \\{ service: '${service}' \\}`))
}
assert.match(services, /<DataTable[\s\S]*?<template #toolbar-actions><el-button v-if="canCreate"/)
assert.match(returns, /<DataTable[\s\S]*?<template #toolbar-actions><el-button v-if="canCreate"/)
})
test('publishes all overseas operation permissions in the enterprise role editor', () => {
for (const permission of [
'merchant:overseas-warehouse:last-mile-order:list',
+1 -3
View File
@@ -1,4 +1,4 @@
import { Boxes, PackageX, RefreshCcw, Tags, Truck, Warehouse } from '@lucide/vue'
import { PackageX, RefreshCcw, Tags, Truck, Warehouse } from '@lucide/vue'
import type { ClientModuleManifest } from '../types.ts'
export const overseasWarehouseModule = {
@@ -65,13 +65,11 @@ export const overseasWarehouseModule = {
path: 'overseas-warehouse/return-inventory', name: 'overseas-return-inventory',
component: () => import('./views/ReturnInventoryView.vue'), release: 'active',
meta: { title: '退货库存', description: '按箱号和 SKU 查询海外仓退货实收库存', permission: 'merchant:overseas-warehouse:return-inventory:list' },
navigation: { key: 'overseas-return-inventory', icon: Boxes },
},
{
path: 'overseas-warehouse/return-cartons', name: 'overseas-return-cartons',
component: () => import('./views/ReturnInventoryView.vue'), props: { cartonOnly: true }, release: 'active',
meta: { title: '退货箱号管理', description: '查询签收及合箱生成的退货箱号和箱内库存', permission: 'merchant:overseas-warehouse:return-inventory:list' },
navigation: { key: 'overseas-return-cartons', icon: Boxes },
},
{
path: 'overseas-warehouse/return-cartons/:cartonMark/detail', name: 'overseas-return-carton-detail',
@@ -223,7 +223,6 @@ onMounted(() => { if (props.detailPage) void Promise.all([loadCartonDetail(), lo
<el-alert v-if="warehouseError" :title="warehouseError" type="warning" show-icon :closable="false"><el-button link type="primary" @click="loadWarehouses">重试加载海外仓</el-button></el-alert>
<div class="return-inventory-table">
<DataTable v-model:page="query.page" v-model:page-size="query.size" :data="currentRows" :columns="currentColumns" :loading="loading" :total="total" :page-sizes="[20, 50, 100]" :row-actions="rowActions" :empty-text="loadError ? '库存加载失败,请核对权限或重试' : '暂无数据'">
<template #toolbar><strong>{{ props.cartonOnly ? '退货箱号' : activeTab === 'summary' ? 'SKU 汇总库存' : '箱号明细' }}</strong><span>共 {{ total }} 条</span></template>
<template #warehouse="{ row }">{{ warehouseLabel(row.overseasWarehouseId) }}</template>
<template #status="{ row }"><el-tag effect="light">{{ cartonStatusLabel(row.status) }}</el-tag></template>
<template #dimensions="{ row }">{{ row.length && row.width && row.height ? `${row.length} × ${row.width} × ${row.height} cm` : '—' }}</template>
@@ -167,7 +167,6 @@ watch(() => [query.page, query.size] as const, ([nextPage, nextSize], [previousP
<QueryToolbar v-model="queryModel" layout="grid" ariaLabel="退货签收筛选" :fields="queryFields" @search="search" />
<div class="return-table-card">
<DataTable v-model:page="query.page" v-model:page-size="query.size" :data="rows" :columns="tableColumns" :loading="loading" :total="total" :page-sizes="[15, 30, 50, 100]" :row-actions="rowActions" row-key="returnNo" empty-text="暂无退货预报">
<template #toolbar><strong>退货签收</strong><span>共 {{ total }} 条</span></template>
<template #toolbar-actions><el-button v-if="canCreate" type="primary" @click="openCreate"><Plus :size="16" />新建退货预报</el-button></template>
<template #warehouse="{ row }">{{ operationWarehouseLabel(row.overseasWarehouseId) }}</template>
<template #relabel="{ row }"><el-tag v-if="row.needRelabel" type="warning" effect="light">需要换标</el-tag><span v-else>否</span></template>
@@ -1080,7 +1080,6 @@ function selectRelabelInventory(inboundOrderId: string) {
<QueryToolbar v-model="listQueryModel" layout="grid" :ariaLabel="`${config.title}筛选`" :fields="listQueryFields" :search-on-reset="false" @search="query" @reset="resetListQuery" />
<div class="warehouse-card warehouse-table-card">
<DataTable v-model:page="page" v-model:page-size="pageSize" :data="submittedRows" :columns="listColumns" :loading="loading" :total="total" :page-sizes="[15, 30, 50, 100]" :row-actions="listRowActions" :empty-text="config.emptyText">
<template #toolbar><strong>{{ config.title }}</strong><span>共 {{ total }} 条</span></template>
<template #toolbar-actions><el-button v-if="canCreate" type="primary" @click="openCreate"><Plus :size="16" />{{ props.service === 'relabel' ? '新建退货换标单' : props.service === 'transfer' ? '新增订单' : `新增${config.title}` }}</el-button></template>
<template v-if="props.service === 'transfer' && submittedRows.some((item) => item.__status === 'WAIT_CUSTOMER_CONFIRMATION')" #before-table><div class="warehouse-list-notice">部分入库完成订单已有 PDA 实测数据,请在对应行确认测量数据。</div></template>
</DataTable>