Update alpha v0.920

This commit is contained in:
2026-03-01 20:23:39 +03:00
parent 6e8fdecc4b
commit 23b20109f1
4 changed files with 289 additions and 92 deletions

View File

@@ -238,10 +238,7 @@
{% if session.get('role') in ('admin','storekeeper') %}
<button class="btn btn-outline-primary" type="button" id="toggleSearchForm" aria-label="Поиск">&#128269;</button>
<button class="btn btn-outline-secondary" type="button" id="toggleCatalogForm">Каталог</button>
<form method="post" action="/orders/low_stock">
<button class="btn btn-warning" type="submit">Добавить в заказы (≤ 1)</button>
</form>
<button class="btn btn-outline-secondary" type="button" id="toggleIssueCancel">Отменить выдачу</button>
<button class="btn btn-outline-secondary" type="button" id="toggleIssueCancel">Отменить выдачу</button>
<button class="btn btn-outline-primary" type="button" id="toggleOrderForm">Заказать картридж</button>
{% endif %}
<a class="btn btn-success" href="/report/cartridges.xlsx">Экспорт в Excel</a>
@@ -1319,7 +1316,7 @@
</tr>
{% for b,m,q,minq in items %}
{% set model_key = (m or '')|trim|lower %}
<tr class="js-cartridge-row {{ 'table-danger' if (q < minq) or (model_key in orphan_model_keys) else '' }}"
<tr class="js-cartridge-row {{ 'table-danger' if (q == 1) or (q < minq) or (model_key in orphan_model_keys) else '' }}"
data-barcode="{{ b }}"
data-model="{{ m or '' }}"
data-quantity="{{ q }}">

View File

@@ -29,56 +29,33 @@
}
</style>
<div class="orders-page">
<div class="d-flex align-items-center justify-content-between mb-3">
<h3 class="mb-0">Заказанные картриджи</h3>
<div class="d-flex gap-2">
{% if session.get('role') in ('admin','storekeeper') %}
<button class="btn btn-outline-primary" type="button" id="toggleOrderAdd">Добавить заказ</button>
<form method="post" action="/orders/clear" onsubmit="return confirm('Очистить все заказы?');">
<button class="btn btn-outline-danger" type="submit">Очистить заказы</button>
</form>
{% endif %}
<a class="btn btn-success" href="/report/orders.xlsx">Экспорт в Excel</a>
<div class="d-flex align-items-center justify-content-between mb-3">
<h3 class="mb-0">Заказанные картриджи</h3>
<div class="d-flex gap-2">
{% if session.get('role') in ('admin','storekeeper') %}
<form method="post" action="/orders/clear" onsubmit="return confirm('Очистить все заказы?');">
<button class="btn btn-outline-danger" type="submit">Очистить заказы</button>
</form>
{% endif %}
<a class="btn btn-success" href="/report/orders.xlsx">Экспорт в Excel</a>
</div>
</div>
</div>
<div class="card mb-3 d-none" id="orderAddCard">
<div class="card-body">
<form method="post" action="/order_by_model" class="row g-2 align-items-center">
<div class="col-md-6">
<input name="model" class="form-control" placeholder="Модель картриджа">
</div>
<div class="col-md-2">
<input name="quantity" class="form-control" placeholder="Количество" value="1">
</div>
<div class="col-md-2 d-grid">
<button class="btn btn-primary">Добавить в заказ</button>
</div>
</form>
</div>
</div>
<script>
(function() {
const toggleBtn = document.getElementById('toggleOrderAdd');
const card = document.getElementById('orderAddCard');
if (!toggleBtn || !card) return;
toggleBtn.addEventListener('click', () => {
card.classList.toggle('d-none');
});
})();
</script>
<table class="table table-striped table-sm">
<tr><th>Дата</th><th>Штрихкод</th><th>Модель</th><th>Количество</th></tr>
{% for last_date, barcode, model, qty in rows %}
<tr>
<td>{{ last_date }}</td>
<td>{{ barcode }}</td>
<td>{{ model }}</td>
<td>{{ qty }}</td>
</tr>
{% endfor %}
</table>
<table class="table table-striped table-sm">
<tr>
<th>Модель картриджа</th>
<th>Модель устройства</th>
<th>Количество</th>
<th>Дата добавления заказа</th>
</tr>
{% for last_date, model, device_model, qty in rows %}
<tr>
<td>{{ model }}</td>
<td>{{ device_model }}</td>
<td>{{ qty }}</td>
<td>{{ last_date }}</td>
</tr>
{% endfor %}
</table>
</div>
{% endblock %}