fix: remove duplicate permissionMap declaration and eliminate infinite polling interval in stocktake page
This commit is contained in:
@ -808,40 +808,6 @@ const stockColumns = [
|
||||
]
|
||||
const allColumns = [...baseColumns, ...stockColumns]
|
||||
|
||||
// 列与权限Code的映射关系(数据库中的code)
|
||||
const permissionMap: Record<string, string> = {
|
||||
id: 'inbound_semi:id',
|
||||
base_id: 'inbound_semi:base_id',
|
||||
company_name: 'inbound_semi:company_name',
|
||||
material_name: 'inbound_semi:material_name',
|
||||
category: 'inbound_semi:category',
|
||||
material_type: 'inbound_semi:material_type',
|
||||
spec_model: 'inbound_semi:spec_model',
|
||||
unit: 'inbound_semi:unit',
|
||||
sku: 'inbound_semi:sku',
|
||||
inbound_date: 'inbound_semi:inbound_date',
|
||||
barcode: 'inbound_semi:barcode',
|
||||
sn_bn: 'inbound_semi:sn_bn',
|
||||
status: 'inbound_semi:status',
|
||||
quality_status: 'inbound_semi:quality_status',
|
||||
qty_inbound: 'inbound_semi:qty_inbound',
|
||||
qty_stock: 'inbound_semi:qty_stock',
|
||||
qty_available: 'inbound_semi:qty_available',
|
||||
warehouse_loc: 'inbound_semi:warehouse_loc',
|
||||
bom_code: 'inbound_semi:bom_code',
|
||||
bom_version: 'inbound_semi:bom_version',
|
||||
work_order_code: 'inbound_semi:work_order_code',
|
||||
raw_material_cost: 'inbound_semi:raw_material_cost',
|
||||
unit_total_cost: 'inbound_semi:unit_total_cost',
|
||||
total_price: 'inbound_semi:total_price',
|
||||
production_manager: 'inbound_semi:production_manager',
|
||||
production_start_time: 'inbound_semi:production_start_time',
|
||||
production_end_time: 'inbound_semi:production_end_time',
|
||||
arrival_photo: 'inbound_semi:arrival_photo',
|
||||
quality_report_link: 'inbound_semi:quality_report_link',
|
||||
detail_link: 'inbound_semi:detail_link',
|
||||
}
|
||||
|
||||
// 根据用户权限初始化列显示状态
|
||||
// 初始化列显示状态(移除权限限制,添加 localStorage 支持)
|
||||
const initColumnPermissions = () => {
|
||||
|
||||
@ -473,9 +473,6 @@ const inputQty = ref<number | undefined>(undefined)
|
||||
const inputRemark = ref('')
|
||||
const qtyInputRef = ref()
|
||||
|
||||
// ★ 新增: 多人协同心跳刷新定时器
|
||||
let syncTimer: any = null
|
||||
|
||||
// ★ 新增: 静默刷新数据(不弹loading)
|
||||
const syncData = async () => {
|
||||
try {
|
||||
@ -592,19 +589,8 @@ async function fetchBorrowedQuantities(items: StockItem[]): Promise<void> {
|
||||
|
||||
onMounted(async () => {
|
||||
await checkServerDraft()
|
||||
// ★ 启动多人协同心跳轮询(每5秒静默刷新)
|
||||
syncTimer = setInterval(() => {
|
||||
syncData()
|
||||
}, 5000)
|
||||
})
|
||||
|
||||
// ★ 新增: 组件卸载时清除定时器
|
||||
onUnmounted(() => {
|
||||
if (syncTimer) {
|
||||
clearInterval(syncTimer)
|
||||
syncTimer = null
|
||||
}
|
||||
})
|
||||
|
||||
const checkServerDraft = async () => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user