Revert "Удалены колонки Способ закупки и Вид закупа"

This reverts commit f0491bb168.
This commit is contained in:
Rollan_Tuleuov 2026-08-18 11:09:56 +00:00
parent f0491bb168
commit c4c366a36a
3 changed files with 1911 additions and 3 deletions

1866
data.json

File diff suppressed because it is too large Load Diff

View File

@ -101,6 +101,12 @@
<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>
@ -121,6 +127,8 @@
<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>
@ -147,17 +155,39 @@
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="10" class="loading">Ошибка загрузки данных: ' + error.message + '</td></tr>';
}
document.getElementById('tableBody').innerHTML = '<tr><td colspan="12" class="loading">Ошибка загрузки данных: ' + error.message + '</td></tr>';
}
}
@ -209,6 +239,8 @@
'<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>' +
@ -229,6 +261,8 @@
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) {
@ -236,9 +270,11 @@
(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 && matchesBudget;
return matchesSearch && matchesMethod && matchesType && matchesBudget;
});
currentPage = 1;

View File

@ -38,6 +38,8 @@ 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++) {
@ -49,6 +51,8 @@ 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;
@ -73,6 +77,8 @@ function parseExcelData() {
serviceName: String(row[serviceNameIdx] || '').trim(),
department: String(row[departmentIdx] || '').trim(),
budgetType: budgetType,
procurementMethod: procurementMethod,
procurementType: procurementType,
budgetSum: budgetSum,
executedSum: executedSum,
economy: economy,