Удалены колонки Способ закупки и Вид закупа
This commit is contained in:
parent
6b5b3a51f3
commit
f0491bb168
42
index.html
42
index.html
@ -101,12 +101,6 @@
|
||||
<div class="filters">
|
||||
<div class="filters-row">
|
||||
<input type="text" id="searchInput" placeholder="Поиск по названию услуги, подразделению...">
|
||||
<select id="procurementMethodFilter">
|
||||
<option value="">Все способы закупки</option>
|
||||
</select>
|
||||
<select id="procurementTypeFilter">
|
||||
<option value="">Все виды закупа</option>
|
||||
</select>
|
||||
<select id="budgetTypeFilter">
|
||||
<option value="">Все типы бюджета</option>
|
||||
<option value="БКВ">БКВ</option>
|
||||
@ -127,8 +121,6 @@
|
||||
<th onclick="sort('serviceName')">Наименование ↕</th>
|
||||
<th onclick="sort('department')">Подразделение ↕</th>
|
||||
<th onclick="sort('budgetType')">Тип бюджета ↕</th>
|
||||
<th onclick="sort('procurementMethod')">Способ закупки ↕</th>
|
||||
<th onclick="sort('procurementType')">Вид закупа ↕</th>
|
||||
<th class="amount" onclick="sort('budgetSum')">Бюджет закупок, тг ↕</th>
|
||||
<th class="amount" onclick="sort('executedSum')">Сумма поставки, тг ↕</th>
|
||||
<th class="amount" onclick="sort('economy')">Экономия, тг ↕</th>
|
||||
@ -155,39 +147,17 @@
|
||||
let currentSort = null;
|
||||
let sortAsc = true;
|
||||
|
||||
function populateFilters() {
|
||||
const methods = [...new Set(allData.map(r => r.procurementMethod).filter(Boolean))].sort();
|
||||
const types = [...new Set(allData.map(r => r.procurementType).filter(Boolean))].sort();
|
||||
|
||||
const methodSelect = document.getElementById('procurementMethodFilter');
|
||||
const typeSelect = document.getElementById('procurementTypeFilter');
|
||||
|
||||
methods.forEach(m => {
|
||||
const opt = document.createElement('option');
|
||||
opt.value = m;
|
||||
opt.textContent = m;
|
||||
methodSelect.appendChild(opt);
|
||||
});
|
||||
|
||||
types.forEach(t => {
|
||||
const opt = document.createElement('option');
|
||||
opt.value = t;
|
||||
opt.textContent = t;
|
||||
typeSelect.appendChild(opt);
|
||||
});
|
||||
}
|
||||
|
||||
async function loadData() {
|
||||
try {
|
||||
const response = await fetch('data.json');
|
||||
allData = await response.json();
|
||||
filteredData = [...allData];
|
||||
populateFilters();
|
||||
renderStats();
|
||||
renderTable();
|
||||
updatePagination();
|
||||
} catch (error) {
|
||||
document.getElementById('tableBody').innerHTML = '<tr><td colspan="12" class="loading">Ошибка загрузки данных: ' + error.message + '</td></tr>';
|
||||
document.getElementById('tableBody').innerHTML = '<tr><td colspan="10" class="loading">Ошибка загрузки данных: ' + error.message + '</td></tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -239,8 +209,6 @@
|
||||
'<td>' + (r.serviceName || '-') + '</td>' +
|
||||
'<td>' + (r.department || '-') + '</td>' +
|
||||
'<td>' + (r.budgetType || '-') + '</td>' +
|
||||
'<td>' + (r.procurementMethod || '-') + '</td>' +
|
||||
'<td>' + (r.procurementType || '-') + '</td>' +
|
||||
'<td class="amount">' + formatAmount(r.budgetSum || 0) + '</td>' +
|
||||
'<td class="amount">' + formatAmount(r.executedSum || 0) + '</td>' +
|
||||
'<td class="amount" style="color: ' + (r.economy > 0 ? '#22c55e' : '#666') + '">' + formatAmount(r.economy || 0) + '</td>' +
|
||||
@ -261,8 +229,6 @@
|
||||
|
||||
function applyFilters() {
|
||||
const search = document.getElementById('searchInput').value.toLowerCase();
|
||||
const procurementMethod = document.getElementById('procurementMethodFilter').value;
|
||||
const procurementType = document.getElementById('procurementTypeFilter').value;
|
||||
const budgetType = document.getElementById('budgetTypeFilter').value;
|
||||
|
||||
filteredData = allData.filter(function(r) {
|
||||
@ -270,11 +236,9 @@
|
||||
(r.serviceName && r.serviceName.toLowerCase().includes(search)) ||
|
||||
(r.department && r.department.toLowerCase().includes(search));
|
||||
|
||||
const matchesMethod = !procurementMethod || r.procurementMethod === procurementMethod;
|
||||
const matchesType = !procurementType || r.procurementType === procurementType;
|
||||
const matchesBudget = !budgetType || r.budgetType === budgetType;
|
||||
|
||||
return matchesSearch && matchesMethod && matchesType && matchesBudget;
|
||||
return matchesSearch && matchesBudget;
|
||||
});
|
||||
|
||||
currentPage = 1;
|
||||
|
||||
@ -38,8 +38,6 @@ function parseExcelData() {
|
||||
const uniqueObjectIdIdx = findColumn(['Уникальный номер объекта']);
|
||||
const lotNumberIdx = findColumn(['Номер лота']);
|
||||
const departmentIdx = findColumn(['Завод', 'МВЗ', 'Текст МВЗ']);
|
||||
const procurementMethodIdx = findColumn(['Способ закупки']);
|
||||
const procurementTypeIdx = findColumn(['Вид закупа']);
|
||||
|
||||
const data = [];
|
||||
for (let i = 1; i < rows.length; i++) {
|
||||
@ -51,8 +49,6 @@ function parseExcelData() {
|
||||
const sppElement = String(row[sppElementIdx] || '').trim();
|
||||
const uniqueObjectId = String(row[uniqueObjectIdIdx] || '').trim();
|
||||
const lotNumber = String(row[lotNumberIdx] || '').trim();
|
||||
const procurementMethod = String(row[procurementMethodIdx] || '').trim();
|
||||
const procurementType = String(row[procurementTypeIdx] || '').trim();
|
||||
|
||||
// Экономия = Бюджет - Сумма поставки
|
||||
const economy = budgetSum - executedSum;
|
||||
@ -77,8 +73,6 @@ function parseExcelData() {
|
||||
serviceName: String(row[serviceNameIdx] || '').trim(),
|
||||
department: String(row[departmentIdx] || '').trim(),
|
||||
budgetType: budgetType,
|
||||
procurementMethod: procurementMethod,
|
||||
procurementType: procurementType,
|
||||
budgetSum: budgetSum,
|
||||
executedSum: executedSum,
|
||||
economy: economy,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user