fix(tenant): 收紧双站运营提号与录单边界
This commit is contained in:
@@ -10,6 +10,13 @@ export type AvailableListingSourceType = '' | 'external' | 'internal'
|
||||
|
||||
export interface AdminPickup {
|
||||
id: number
|
||||
tenant_id: number
|
||||
tenant_code: string
|
||||
tenant_name: string
|
||||
source_tenant_id: number
|
||||
source_tenant_code: string
|
||||
source_tenant_name: string
|
||||
is_cross_tenant: boolean
|
||||
pickup_no: string
|
||||
listing_id: number
|
||||
listing_no: string
|
||||
@@ -91,6 +98,10 @@ export interface AdminPickupProcessEvent {
|
||||
|
||||
export interface AvailableListing {
|
||||
id: number
|
||||
source_tenant_id: number
|
||||
source_tenant_code: string
|
||||
source_tenant_name: string
|
||||
is_cross_tenant: boolean
|
||||
listing_no: string
|
||||
account_id: number
|
||||
account_title: string
|
||||
|
||||
@@ -51,7 +51,9 @@ const voucherUploading = ref(false)
|
||||
const manualActionID = ref(0)
|
||||
const selectedManual = ref<FinanceDisbursementItem | null>(null)
|
||||
const summary = ref<FinanceDisbursementListSummary>(emptySummary())
|
||||
const canManageManual = computed(() => adminSession.hasPermission('finance:manual_disbursement'))
|
||||
const canManageManual = computed(
|
||||
() => adminSession.isSuperAdmin && adminSession.hasPermission('finance:manual_disbursement')
|
||||
)
|
||||
|
||||
const manualCategories = [
|
||||
{ value: 'user_compensation', label: '用户补偿' },
|
||||
|
||||
@@ -41,7 +41,9 @@ const total = ref(0)
|
||||
const currentPage = ref(1)
|
||||
const currentPageSize = ref(20)
|
||||
const summary = ref<OperatingExpenseListSummary>(emptySummary())
|
||||
const canManage = computed(() => adminSession.hasPermission('finance:operating_expense'))
|
||||
const canManage = computed(
|
||||
() => adminSession.isSuperAdmin && adminSession.hasPermission('finance:operating_expense')
|
||||
)
|
||||
|
||||
const filters = reactive({
|
||||
date_type: 'created' as 'created' | 'occurred',
|
||||
|
||||
@@ -462,6 +462,19 @@ function readSnapshotResources(summary: Record<string, unknown> | null): Snapsho
|
||||
<dt>提号编号</dt>
|
||||
<dd>{{ pickup.pickup_no }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>提号站点</dt>
|
||||
<dd>{{ pickup.tenant_name || pickup.tenant_code || '-' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>货源站点</dt>
|
||||
<dd>
|
||||
{{ pickup.source_tenant_name || pickup.source_tenant_code || '-' }}
|
||||
<el-tag v-if="pickup.is_cross_tenant" type="warning" size="small" effect="light">
|
||||
跨站提号
|
||||
</el-tag>
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>上架编号</dt>
|
||||
<dd>{{ listingCode }}</dd>
|
||||
|
||||
@@ -604,8 +604,22 @@ function listingSourceText(item: AvailableListing) {
|
||||
return item.source_channel ? `${label} · ${item.source_channel}` : label
|
||||
}
|
||||
|
||||
function siteName(code: string, name: string) {
|
||||
return name || code || '未配置站点'
|
||||
}
|
||||
|
||||
function pickupSiteText(row: AdminPickup) {
|
||||
if (!row.is_cross_tenant) return '本站货源'
|
||||
return `跨站 · ${siteName(row.source_tenant_code, row.source_tenant_name)}`
|
||||
}
|
||||
|
||||
function listingSiteText(item: AvailableListing) {
|
||||
const source = siteName(item.source_tenant_code, item.source_tenant_name)
|
||||
return item.is_cross_tenant ? `跨站 · ${source}` : `本站 · ${source}`
|
||||
}
|
||||
|
||||
function listingOptionLabel(item: AvailableListing) {
|
||||
return `${listingSourceText(item)} · ${item.listing_no} · ${item.account_title} · ${formatCentWithSymbol(listingOwnerTotalCent(item))} / ${formatCentWithSymbol(item.listing_price_cent)}`
|
||||
return `${listingSiteText(item)} · ${listingSourceText(item)} · ${item.listing_no} · ${item.account_title} · ${formatCentWithSymbol(listingOwnerTotalCent(item))} / ${formatCentWithSymbol(item.listing_price_cent)}`
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -615,7 +629,7 @@ function listingOptionLabel(item: AvailableListing) {
|
||||
<div class="page-header">
|
||||
<p class="eyebrow">Admin Pickup</p>
|
||||
<h1>线下提号</h1>
|
||||
<p>管理员线下提号,站内上传结算到钱包,平台代管通过线下结算确认打款。</p>
|
||||
<p>各站点独立管理提号记录,可选择本站或另一站点货源;结算仍进入货源站点号主钱包。</p>
|
||||
</div>
|
||||
<div class="toolbar-actions">
|
||||
<el-dropdown
|
||||
@@ -710,6 +724,13 @@ function listingOptionLabel(item: AvailableListing) {
|
||||
|
||||
<el-table v-loading="loading" :data="items" class="table-panel">
|
||||
<el-table-column prop="pickup_no" label="提号编号" width="190" />
|
||||
<el-table-column label="站点关系" width="170">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.is_cross_tenant ? 'warning' : 'info'" effect="light" size="small">
|
||||
{{ pickupSiteText(row) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="account_title" label="账号" min-width="180" />
|
||||
<el-table-column label="区服/平台" width="150">
|
||||
<template #default="{ row }"
|
||||
@@ -923,6 +944,13 @@ function listingOptionLabel(item: AvailableListing) {
|
||||
:value="item.id"
|
||||
>
|
||||
<div class="listing-option">
|
||||
<el-tag
|
||||
:type="item.is_cross_tenant ? 'warning' : 'info'"
|
||||
effect="light"
|
||||
size="small"
|
||||
>
|
||||
{{ listingSiteText(item) }}
|
||||
</el-tag>
|
||||
<el-tag
|
||||
:type="pickupSourceTagType(item.account_source)"
|
||||
effect="light"
|
||||
@@ -944,6 +972,9 @@ function listingOptionLabel(item: AvailableListing) {
|
||||
</el-form-item>
|
||||
<el-form-item v-if="selectedListing" label="来源确认">
|
||||
<div class="selected-source">
|
||||
<el-tag :type="selectedListing.is_cross_tenant ? 'warning' : 'info'" effect="light">
|
||||
{{ listingSiteText(selectedListing) }}
|
||||
</el-tag>
|
||||
<el-tag :type="pickupSourceTagType(selectedListing.account_source)" effect="light">
|
||||
{{ pickupSourceLabel(selectedListing.account_source) }}
|
||||
</el-tag>
|
||||
|
||||
@@ -77,6 +77,7 @@ interface NavItem {
|
||||
icon: Component
|
||||
permission?: string
|
||||
shared?: boolean
|
||||
platformOnly?: boolean
|
||||
}
|
||||
|
||||
interface NavGroup {
|
||||
@@ -122,7 +123,6 @@ const allNavGroups: NavGroup[] = [
|
||||
to: adminPath('pickup'),
|
||||
icon: Switch,
|
||||
permission: 'order:pickup',
|
||||
shared: true,
|
||||
},
|
||||
{ label: '商品管理', to: adminPath('listings'), icon: Shop, permission: 'listing:view' },
|
||||
{
|
||||
@@ -245,7 +245,6 @@ const allNavGroups: NavGroup[] = [
|
||||
to: adminPath('manual-entries'),
|
||||
icon: EditPen,
|
||||
permission: 'cs_manual_entry:view',
|
||||
shared: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -277,6 +276,7 @@ const allNavGroups: NavGroup[] = [
|
||||
to: adminPath('finance/operating-expenses'),
|
||||
icon: Money,
|
||||
permission: 'finance:operating_expense',
|
||||
platformOnly: true,
|
||||
},
|
||||
{
|
||||
label: '资金流水',
|
||||
@@ -361,6 +361,7 @@ const allNavGroups: NavGroup[] = [
|
||||
const allNavItems = allNavGroups.flatMap(group => group.children)
|
||||
|
||||
function canAccessNavItem(item: NavItem) {
|
||||
if (item.platformOnly && !adminSession.isSuperAdmin) return false
|
||||
if (adminSession.isSuperAdmin) return true
|
||||
if (!item.permission) return true
|
||||
return adminSession.hasPermission(item.permission)
|
||||
|
||||
@@ -205,7 +205,7 @@ export function isPlatformOpsHostname(
|
||||
const host = hostname.trim().toLowerCase()
|
||||
if (!host) return false
|
||||
const configured = ((import.meta.env.VITE_OPS_DOMAIN as string) || '').trim().toLowerCase()
|
||||
if (configured && host === configured) return true
|
||||
if (configured) return host === configured
|
||||
return host.startsWith('ops.')
|
||||
}
|
||||
|
||||
|
||||
+13
-10
@@ -54,6 +54,7 @@ function stripVantRemoteIconFont() {
|
||||
const frontendPort = Number(process.env.DEV_FRONTEND_PORT || process.env.PORT || 5189)
|
||||
const backendPort = Number(process.env.DEV_BACKEND_PORT || 18088)
|
||||
const apiProxyTarget = process.env.VITE_API_PROXY_TARGET || `http://127.0.0.1:${backendPort}`
|
||||
const opsHost = (process.env.VITE_OPS_DOMAIN || 'ops.localhost').trim()
|
||||
|
||||
export default defineConfig({
|
||||
// 禁止 vite 清屏,避免把后端启动日志(GIN 路由、迁移等)从终端滚动缓冲里抹掉
|
||||
@@ -92,16 +93,18 @@ export default defineConfig({
|
||||
xfwd: true,
|
||||
},
|
||||
},
|
||||
allowedHosts: [
|
||||
'dachui.localhost',
|
||||
'jieyou.localhost',
|
||||
'ops.localhost',
|
||||
'221329.cc.cd',
|
||||
'd4aa-77-93-89-84.ngrok-free.app',
|
||||
'frp-bus.com',
|
||||
'www.u499731.nyat.app',
|
||||
'fn.221329.xyz',
|
||||
],
|
||||
allowedHosts: Array.from(
|
||||
new Set([
|
||||
'dachui.localhost',
|
||||
'jieyou.localhost',
|
||||
opsHost,
|
||||
'221329.cc.cd',
|
||||
'd4aa-77-93-89-84.ngrok-free.app',
|
||||
'frp-bus.com',
|
||||
'www.u499731.nyat.app',
|
||||
'fn.221329.xyz',
|
||||
])
|
||||
),
|
||||
},
|
||||
build: {
|
||||
rollupOptions: {
|
||||
|
||||
Reference in New Issue
Block a user