71 lines
3.5 KiB
HTML
71 lines
3.5 KiB
HTML
{% extends "base.html" %}
|
||
{% block title %}Заказы — Стройка{% endblock %}
|
||
{% block page_title %}Заказы{% endblock %}
|
||
{% block topbar_actions %}<a href="{{ url_for('order_add') }}" class="btn btn-primary">+ Новый заказ</a>{% endblock %}
|
||
{% block content %}
|
||
|
||
<!-- Поиск -->
|
||
<form class="filter-bar" method="get" action="{{ url_for('orders_list') }}">
|
||
<div class="filter-group" style="flex: 2;">
|
||
<label>🔍 Поиск</label>
|
||
<input type="text" name="search" value="{{ search or '' }}" placeholder="Номер заказа, контрагент, статус..." class="form-input" style="min-width: 250px;">
|
||
</div>
|
||
<div class="filter-group filter-btns" style="flex-direction: row; align-items: flex-end;">
|
||
<button type="submit" class="btn btn-primary">Найти</button>
|
||
{% if search %}
|
||
<a href="{{ url_for('orders_list', sort=sort) }}" class="btn btn-secondary">Сброс</a>
|
||
{% endif %}
|
||
</div>
|
||
<input type="hidden" name="sort" value="{{ sort or 'date_desc' }}">
|
||
</form>
|
||
|
||
<div class="sort-bar">
|
||
Сортировка:
|
||
<a href="?sort=date_desc{% if search %}&search={{ search }}{% endif %}" class="btn btn-sm {% if sort=='date_desc' %}btn-primary{% else %}btn-secondary{% endif %}">📅 Дата ↓</a>
|
||
<a href="?sort=date_asc{% if search %}&search={{ search }}{% endif %}" class="btn btn-sm {% if sort=='date_asc' %}btn-primary{% else %}btn-secondary{% endif %}">📅 Дата ↑</a>
|
||
<a href="?sort=price_desc{% if search %}&search={{ search }}{% endif %}" class="btn btn-sm {% if sort=='price_desc' %}btn-primary{% else %}btn-secondary{% endif %}">💰 Сумма ↓</a>
|
||
<a href="?sort=price_asc{% if search %}&search={{ search }}{% endif %}" class="btn btn-sm {% if sort=='price_asc' %}btn-primary{% else %}btn-secondary{% endif %}">💰 Сумма ↑</a>
|
||
</div>
|
||
|
||
<div class="table-wrapper">
|
||
<table class="data-table">
|
||
<thead>
|
||
<tr>
|
||
<th>Номер</th>
|
||
<th>Дата</th>
|
||
<th>Дата доставки</th>
|
||
<th>Контрагент</th>
|
||
<th>Тип</th>
|
||
<th>Статус</th>
|
||
<th>Позиций</th>
|
||
<th class="highlight-col">ИТОГО, ₽</th>
|
||
<th>Действия</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for o in orders %}
|
||
<tr>
|
||
<td><strong>{{ o.number }}</strong></td>
|
||
<td>{{ o.order_date }}</td>
|
||
<td>{{ o.delivery_date or '—' }}</td>
|
||
<td>{{ o.counterparty_name }}</td>
|
||
<td><span class="badge">{% if o.counterparty_type==2 %}Приходная{% else %}Расходная{% endif %}</span></td>
|
||
<td><span class="badge">{{ o.status }}</span></td>
|
||
<td>{{ o.items_count }}</td>
|
||
<td class="highlight-col"><strong>{{ "%.2f"|format(o.total) }}</strong></td>
|
||
<td><a href="{{ url_for('order_edit', oid=o.id) }}" class="btn btn-sm btn-edit">✏️ Изменить</a></td>
|
||
</tr>
|
||
{% else %}
|
||
<tr><td colspan="9" style="text-align:center;padding:2rem;color:#aaa">Заказов пока нет</td></tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<div class="table-meta">
|
||
Всего: <strong>{{ orders|length }}</strong> заказов
|
||
{% if search %}
|
||
<span style="margin-left: 1rem;">🔍 Результаты поиска: «{{ search }}»</span>
|
||
{% endif %}
|
||
</div>
|
||
{% endblock %}
|