|
|
|
@ -2683,6 +2683,9 @@ let supplierTotalCount = 0; |
|
|
|
moduleAccessCounter.set(module, 0); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
// 更新分页状态 |
|
|
|
updatePaginationStatus(); |
|
|
|
} else { |
|
|
|
// 首次使用,初始化计数器 |
|
|
|
allModules.forEach(module => { |
|
|
|
@ -4253,7 +4256,10 @@ let supplierTotalCount = 0; |
|
|
|
</div> |
|
|
|
`; |
|
|
|
} |
|
|
|
} else { |
|
|
|
|
|
|
|
// 更新分页状态 |
|
|
|
updatePaginationStatus(); |
|
|
|
} else { |
|
|
|
console.error('获取浏览详细数据失败:', data.message); |
|
|
|
content.innerHTML = ` |
|
|
|
<div style="text-align: center; padding: 3rem; color: var(--danger-color);"> |
|
|
|
@ -4645,6 +4651,9 @@ let supplierTotalCount = 0; |
|
|
|
const permanentCachedData = cacheManager.getPermanent('suppliersData'); |
|
|
|
if (permanentCachedData) { |
|
|
|
console.log('使用永久缓存数据加载供应商列表'); |
|
|
|
// 更新总记录数 |
|
|
|
supplierTotalCount = permanentCachedData.totalCount || permanentCachedData.total || 0; |
|
|
|
console.log('从永久缓存更新总记录数:', supplierTotalCount); |
|
|
|
// 立即显示永久缓存数据 |
|
|
|
updateSuppliersUI(permanentCachedData, searchTerm); |
|
|
|
// 后台加载最新数据 |
|
|
|
@ -4656,6 +4665,9 @@ let supplierTotalCount = 0; |
|
|
|
const cachedData = cacheManager.get(cacheKey); |
|
|
|
if (cachedData) { |
|
|
|
console.log('使用普通缓存数据加载供应商列表'); |
|
|
|
// 更新总记录数 |
|
|
|
supplierTotalCount = cachedData.totalCount || cachedData.total || 0; |
|
|
|
console.log('从普通缓存更新总记录数:', supplierTotalCount); |
|
|
|
// 立即显示缓存数据 |
|
|
|
updateSuppliersUI(cachedData, searchTerm); |
|
|
|
// 后台加载最新数据 |
|
|
|
@ -4683,10 +4695,12 @@ let supplierTotalCount = 0; |
|
|
|
|
|
|
|
if (data.success) { |
|
|
|
const tbody = document.querySelector('#supplierTable tbody'); |
|
|
|
const cardTitle = document.querySelector('.card-title'); |
|
|
|
// 使用更精确的选择器,选择供应商列表卡片的标题 |
|
|
|
const supplierCard = document.querySelector('#supplierTable').closest('.card'); |
|
|
|
const cardTitle = supplierCard ? supplierCard.querySelector('.card-title') : null; |
|
|
|
|
|
|
|
// 更新总记录数 |
|
|
|
supplierTotalCount = data.totalCount || 0; |
|
|
|
supplierTotalCount = data.totalCount || data.total || 0; |
|
|
|
console.log('总记录数:', supplierTotalCount); |
|
|
|
|
|
|
|
// 在标题旁边显示数据总数 |
|
|
|
@ -4810,8 +4824,8 @@ let supplierTotalCount = 0; |
|
|
|
const prevBtn = document.getElementById('supplierPrevPageBtn'); |
|
|
|
const nextBtn = document.getElementById('supplierNextPageBtn'); |
|
|
|
const currentPageEl = document.getElementById('currentPage'); |
|
|
|
// 选择分页控件中的supplier-count元素 |
|
|
|
const supplierCountEl = document.querySelector('.supplier-count'); |
|
|
|
// 选择分页控件中的供应商数量元素,使用id选择器更精确 |
|
|
|
const supplierCountEl = document.getElementById('paginationSupplierCount'); |
|
|
|
|
|
|
|
console.log('分页控件元素:', { |
|
|
|
prevBtn: !!prevBtn, |
|
|
|
@ -4847,7 +4861,7 @@ let supplierTotalCount = 0; |
|
|
|
.then(data => { |
|
|
|
if (data.success) { |
|
|
|
// 更新总记录数 |
|
|
|
supplierTotalCount = data.totalCount || 0; |
|
|
|
supplierTotalCount = data.totalCount || data.total || 0; |
|
|
|
// 缓存数据 |
|
|
|
cacheManager.set(cacheKey, data); |
|
|
|
// 更新永久缓存 |
|
|
|
@ -4867,10 +4881,12 @@ let supplierTotalCount = 0; |
|
|
|
function updateSuppliersUI(data, searchTerm = '') { |
|
|
|
if (data.success) { |
|
|
|
const tbody = document.querySelector('#supplierTable tbody'); |
|
|
|
const cardTitle = document.querySelector('.card-title'); |
|
|
|
// 使用更精确的选择器,选择供应商列表卡片的标题 |
|
|
|
const supplierCard = document.querySelector('#supplierTable').closest('.card'); |
|
|
|
const cardTitle = supplierCard ? supplierCard.querySelector('.card-title') : null; |
|
|
|
|
|
|
|
// 更新总记录数 |
|
|
|
supplierTotalCount = data.totalCount || 0; |
|
|
|
supplierTotalCount = data.totalCount || data.total || 0; |
|
|
|
|
|
|
|
// 在标题旁边显示数据总数 |
|
|
|
if (cardTitle) { |
|
|
|
@ -4932,6 +4948,9 @@ let supplierTotalCount = 0; |
|
|
|
console.error('获取对接人列表失败:', error); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
// 更新分页状态 |
|
|
|
updatePaginationStatus(); |
|
|
|
} else { |
|
|
|
console.error('获取供应商数据失败:', data.message); |
|
|
|
} |
|
|
|
|