Доработали генерацию сменных заданий
All checks were successful
Deploy MES Core / deploy (push) Successful in 10s
All checks were successful
Deploy MES Core / deploy (push) Successful in 10s
This commit is contained in:
@@ -43,9 +43,9 @@
|
||||
</div>
|
||||
|
||||
{% if user_role in 'admin,technologist,clerk' %}
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-auto">
|
||||
<label class="small text-muted mb-1 fw-bold">Учёт 1С:</label>
|
||||
<select name="is_synced" class="form-select form-select-sm bg-body text-body border-secondary" onchange="this.form.submit()">
|
||||
<select name="is_synced" class="form-select form-select-sm bg-body text-body border-secondary registry-filter-1c" onchange="this.form.submit()">
|
||||
<option value="" {% if not is_synced %}selected{% endif %}>Все</option>
|
||||
<option value="1" {% if is_synced == '1' %}selected{% endif %}>Учтено</option>
|
||||
<option value="0" {% if is_synced == '0' %}selected{% endif %}>Ожидает</option>
|
||||
@@ -53,13 +53,13 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-auto">
|
||||
<label class="small text-muted mb-1 fw-bold">С:</label>
|
||||
<input type="date" name="start_date" class="form-control form-control-sm bg-body text-body border-secondary" value="{{ start_date }}" onchange="this.form.submit()">
|
||||
<input type="date" name="start_date" class="form-control form-control-sm bg-body text-body border-secondary registry-filter-date" value="{{ start_date }}" onchange="this.form.submit()">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-auto">
|
||||
<label class="small text-muted mb-1 fw-bold">По:</label>
|
||||
<input type="date" name="end_date" class="form-control form-control-sm bg-body text-body border-secondary" value="{{ end_date }}" onchange="this.form.submit()">
|
||||
<input type="date" name="end_date" class="form-control form-control-sm bg-body text-body border-secondary registry-filter-date" value="{{ end_date }}" onchange="this.form.submit()">
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 text-end mt-auto">
|
||||
|
||||
@@ -4,8 +4,13 @@
|
||||
{% include 'shiftflow/partials/_filter.html' %}
|
||||
|
||||
<div class="card shadow border-secondary">
|
||||
<div class="card-header border-secondary py-3">
|
||||
<div class="card-header border-secondary py-3 d-flex justify-content-between align-items-center">
|
||||
<h3 class="text-accent mb-0"><i class="bi bi-list-task me-2"></i>Реестр заданий</h3>
|
||||
{% if user_role in 'admin,technologist,master' %}
|
||||
<a class="btn btn-outline-secondary btn-sm" target="_blank" href="{% url 'registry_print' %}?{{ request.GET.urlencode }}">
|
||||
<i class="bi bi-printer me-1"></i>Печать
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="card-body p-0">
|
||||
|
||||
148
shiftflow/templates/shiftflow/registry_print.html
Normal file
148
shiftflow/templates/shiftflow/registry_print.html
Normal file
@@ -0,0 +1,148 @@
|
||||
{% load static %}
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Сменное задание</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="{% static 'css/style.css' %}">
|
||||
<style>
|
||||
body { background: #fff; color: #000; }
|
||||
.print-table { width: 100%; border-collapse: collapse; }
|
||||
.print-table th, .print-table td { border: 1px solid #000; padding: 4px 6px; font-size: 12px; vertical-align: top; }
|
||||
.print-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 8px; }
|
||||
.print-title { font-size: 16px; font-weight: 700; margin: 0; }
|
||||
.print-meta { font-size: 12px; }
|
||||
.center { text-align: center; }
|
||||
.blank { height: 18px; }
|
||||
.sign-row { display: flex; justify-content: space-between; gap: 24px; margin-top: 18px; font-size: 12px; }
|
||||
.sign-line { flex: 1; border-bottom: 1px solid #000; height: 16px; }
|
||||
@media print {
|
||||
.no-print { display: none !important; }
|
||||
.page { page-break-after: always; }
|
||||
.page:last-child { page-break-after: auto; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container-fluid my-3 no-print d-flex gap-2">
|
||||
<button class="btn btn-sm btn-outline-secondary" onclick="window.print()">
|
||||
Печать
|
||||
</button>
|
||||
<a class="btn btn-sm btn-outline-secondary" href="{% url 'registry' %}?{{ request.GET.urlencode }}">
|
||||
Назад
|
||||
</a>
|
||||
<div class="ms-auto small text-muted">
|
||||
{{ printed_at|date:"d.m.Y H:i" }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% for machine, items in groups %}
|
||||
<div class="container-fluid page my-3">
|
||||
<div class="print-header">
|
||||
<div>
|
||||
<h1 class="print-title">Сменное задание</h1>
|
||||
<div class="print-meta">Станок: <strong>{{ machine.name }}</strong></div>
|
||||
</div>
|
||||
<div class="print-meta text-end">
|
||||
{% if print_date %}Дата: <strong>{{ print_date|date:"d.m.y" }}</strong>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if machine.machine_type == 'sheet' %}
|
||||
<table class="print-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">Материал</th>
|
||||
<th colspan="5">Изделие</th>
|
||||
<th colspan="2">Остаток</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Вид</th>
|
||||
<th style="width: 170px;">Размеры</th>
|
||||
|
||||
<th style="width: 90px;">План, шт</th>
|
||||
<th style="width: 90px;">Факт, шт</th>
|
||||
<th style="width: 90px;">Толщина, мм</th>
|
||||
<th>Наименование</th>
|
||||
<th style="width: 90px;">Сделка</th>
|
||||
|
||||
<th style="width: 90px;">ДО</th>
|
||||
<th style="width: 90px;">Отход, кг</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
<tr>
|
||||
<td>{{ item.task.material.full_name|default:item.task.material.name|default:"-" }}</td>
|
||||
<td class="blank"></td>
|
||||
|
||||
<td class="center">{{ item.quantity_plan }}</td>
|
||||
<td class="blank"></td>
|
||||
<td class="center">{{ item.task.size_value|default:"-" }}</td>
|
||||
<td>{{ item.task.drawing_name|default:"Б/ч" }}</td>
|
||||
<td class="center">{{ item.task.deal.number|default:"-" }}</td>
|
||||
|
||||
<td class="blank"></td>
|
||||
<td class="blank"></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<table class="print-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">Материал</th>
|
||||
<th colspan="5">Изделие</th>
|
||||
<th colspan="2">Остаток</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Вид</th>
|
||||
<th style="width: 90px;">Длина, мм</th>
|
||||
<th style="width: 90px;">Кол-во, шт</th>
|
||||
|
||||
<th style="width: 90px;">Длина, мм</th>
|
||||
<th style="width: 90px;">План, шт</th>
|
||||
<th style="width: 90px;">Факт, шт</th>
|
||||
<th>Чертеж (если есть)</th>
|
||||
<th style="width: 90px;">Сделка</th>
|
||||
|
||||
<th style="width: 90px;">ДО, мм</th>
|
||||
<th style="width: 90px;">Отход, кг</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
<tr>
|
||||
<td>{{ item.task.material.full_name|default:item.task.material.name|default:"-" }}</td>
|
||||
<td class="blank"></td>
|
||||
<td class="blank"></td>
|
||||
|
||||
<td class="center">{{ item.task.size_value|default:"-" }}</td>
|
||||
<td class="center">{{ item.quantity_plan }}</td>
|
||||
<td class="blank"></td>
|
||||
<td>{{ item.task.drawing_name|default:"Б/ч" }}</td>
|
||||
<td class="center">{{ item.task.deal.number|default:"-" }}</td>
|
||||
|
||||
<td class="blank"></td>
|
||||
<td class="blank"></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
<div class="sign-row">
|
||||
<div style="display:flex; gap:8px; align-items:flex-end;">
|
||||
<div>Оператор</div><div class="sign-line"></div>
|
||||
</div>
|
||||
<div style="display:flex; gap:8px; align-items:flex-end;">
|
||||
<div>Выдал</div><div class="sign-line"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user