fix: 出库列表 permissionMap 基础列改为 null(始终可见),对齐 inbound 模式;单价/小计保留权限控制

This commit is contained in:
yueli
2026-07-21 09:39:16 +08:00
parent 451d7b5719
commit 35690c5b8f
2 changed files with 25 additions and 236 deletions

View File

@ -165,22 +165,24 @@ const handleClearSearch = () => {
}
// 列与权限Code的映射关系数据库中的code
const permissionMap: Record<string, string> = {
outbound_no: 'outbound_list:outbound_no',
outbound_time: 'outbound_list:outbound_time',
outbound_type: 'outbound_list:outbound_type',
total_amount: 'outbound_list:total_amount',
consumer_name: 'outbound_list:consumer_name',
operator_name: 'outbound_list:operator_name',
remark: 'outbound_list:remark',
signature_path: 'outbound_list:signature_path',
// 明细列
sku: 'outbound_list:sku',
name: 'outbound_list:name',
material_type: 'outbound_list:material_type',
category: 'outbound_list:category',
spec_model: 'outbound_list:spec_model',
quantity: 'outbound_list:quantity',
const permissionMap: Record<string, string | null> = {
// 主表基础列 — 始终可见
outbound_no: null,
outbound_time: null,
outbound_type: null,
total_amount: null,
consumer_name: null,
operator_name: null,
remark: null,
signature_path: null,
// 明细列 — 始终可见
sku: null,
name: null,
material_type: null,
category: null,
spec_model: null,
quantity: null,
batch_sn: null,
unit_price: 'outbound_list:unit_price',
subtotal: 'outbound_list:subtotal',
}
@ -190,8 +192,14 @@ const hasColumnPermission = (prop: string) => {
if (userStore.role === 'SUPER_ADMIN' || userStore.username === 'IRIS') {
return true
}
if (!(prop in permissionMap)) {
return false // Default Deny
}
const code = permissionMap[prop]
return code ? userStore.hasPermission(code) : false
if (code === null || code === undefined) {
return true // 基础字段,无需权限
}
return userStore.hasPermission(code)
}
const list = ref([])