Подправил интерфейс реестра, вывод на печать, добавил уборку станка из сменки
All checks were successful
Deploy MES Core / deploy (push) Successful in 12s

This commit is contained in:
2026-04-16 22:42:52 +03:00
parent 3c40695664
commit b48bf0947a
5 changed files with 25 additions and 8 deletions

View File

@@ -19,7 +19,14 @@
{% for wi in workitems %}
<tr class="workitem-row" data-href="{% url 'workitem_detail' wi.id %}">
<td class="small">{{ wi.date|date:"d.m.y" }}</td>
<td><span class="text-accent fw-bold">{{ wi.deal.number|default:"-" }}</span></td>
<td>
<span
class="text-accent fw-bold"
title="{% if wi.deal.description %}{{ wi.deal.description|striptags }}{% endif %}{% if wi.deal.company %}{% if wi.deal.description %} · {% endif %}{{ wi.deal.company.name }}{% endif %}{% if wi.deal.due_date %}{% if wi.deal.description or wi.deal.company %} · {% endif %}до {{ wi.deal.due_date|date:'d.m.Y' }}{% endif %}"
>
{{ wi.deal.number|default:"-" }}
</span>
</td>
<td>
{% if wi.machine %}
<span class="badge bg-dark border border-secondary">{{ wi.workshop.name|default:"—" }}/{{ wi.machine.name }}</span>
@@ -33,7 +40,10 @@
{{ wi.operation.name|default:wi.stage|default:"—" }}
</td>
<td class="fw-bold">
{{ wi.entity.drawing_number|default:"—" }} {{ wi.entity.name }}
{% if wi.entity.drawing_number %}
{{ wi.entity.drawing_number }}
{% endif %}
{{ wi.entity.name }}
</td>
<td class="small text-muted">
{% if wi.entity.planned_material %}

View File

@@ -56,7 +56,6 @@
<th style="width:160px;">Материал</th>
<th style="width:80px;" class="center">План</th>
<th style="width:80px;" class="center">Факт</th>
<th style="width:90px;">Статус</th>
</tr>
</thead>
<tbody>
@@ -75,7 +74,6 @@
</td>
<td class="center">{{ wi.quantity_plan }}</td>
<td class="center">{{ wi.quantity_done }}</td>
<td>{{ wi.status|default:"planned" }}</td>
</tr>
{% endfor %}
</tbody>

View File

@@ -509,7 +509,7 @@ class RegistryView(LoginRequiredMixin, ListView):
it.fact_bar_class = 'bg-success' if it.status in ['done', 'partial'] else 'bg-warning'
context['items'] = items
work_qs = WorkItem.objects.select_related('deal', 'entity', 'entity__planned_material', 'operation', 'machine', 'workshop')
work_qs = WorkItem.objects.select_related('deal', 'deal__company', 'entity', 'entity__planned_material', 'operation', 'machine', 'workshop')
m_ids = [int(i) for i in self.request.GET.getlist('m_ids') if str(i).isdigit()]
if m_ids:
@@ -881,8 +881,9 @@ class WorkItemUpdateView(LoginRequiredMixin, View):
wi.quantity_reported = qty_reported
changed_fields.append('quantity_reported')
if machine_id is not None and role in ['admin', 'technologist', 'master']:
wi.machine_id = machine_id
if role in ['admin', 'technologist', 'master'] and 'machine_id' in request.POST:
# Пустое значение из селекта «— без станка —» должно очищать привязку станка.
wi.machine_id = (int(machine_id) if machine_id is not None else None)
changed_fields.append('machine')
if date_raw and role in ['admin', 'technologist']:

View File

@@ -40,6 +40,14 @@ body {
color: #e9ecef !important;
}
.navbar.sticky-top {
z-index: 1030;
}
.navbar.sticky-top {
z-index: 1030;
}
/* --- РЕЕСТР --- */
/* Делаем строку таблицы визуально кликабельной */

View File

@@ -1,4 +1,4 @@
<nav class="navbar navbar-expand-lg border-bottom shadow-sm">
<nav class="navbar navbar-expand-lg border-bottom shadow-sm sticky-top">
<div class="container-fluid">
<a class="navbar-brand fw-bold text-accent" href="/">
<i class="bi bi-gear-fill me-2"></i>ShiftFlow