Починили закрытие сварки, доработали интерфейс
All checks were successful
Deploy MES Core / deploy (push) Successful in 13s
All checks were successful
Deploy MES Core / deploy (push) Successful in 13s
This commit is contained in:
@@ -77,22 +77,30 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form method="post" action="">
|
||||
<form method="post" action="{% url 'assembly_closing' workitem.id %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="action" value="close">
|
||||
|
||||
<div class="row align-items-end g-2">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label text-muted small mb-1">Фактически собрано (шт.)</label>
|
||||
<input type="number" class="form-control border-secondary" name="fact_qty" min="1" max="{{ max_possible }}" value="{{ max_possible }}" {% if max_possible == 0 %}disabled{% endif %}>
|
||||
<input
|
||||
type="number"
|
||||
class="form-control border-secondary"
|
||||
name="fact_qty"
|
||||
min="1"
|
||||
{% if max_possible and max_possible > 0 %}max="{{ max_possible }}"{% endif %}
|
||||
value="{% if max_possible and max_possible > 0 %}{{ max_possible }}{% else %}1{% endif %}"
|
||||
required
|
||||
>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
{% if workitem.machine_id %}
|
||||
<button type="submit" class="btn btn-warning w-100" {% if max_possible == 0 %}disabled{% endif %}>
|
||||
<button type="submit" class="btn btn-warning w-100">
|
||||
Списать компоненты и закрыть сборку
|
||||
</button>
|
||||
{% else %}
|
||||
<button type="button" class="btn btn-warning w-100" data-bs-toggle="modal" data-bs-target="#selectMachineModal" {% if max_possible == 0 %}disabled{% endif %}>
|
||||
<button type="button" class="btn btn-warning w-100" data-bs-toggle="modal" data-bs-target="#selectMachineModal">
|
||||
Выбрать пост и закрыть
|
||||
</button>
|
||||
{% endif %}
|
||||
@@ -113,10 +121,10 @@
|
||||
<div class="modal-body">
|
||||
{% if workshop_machines %}
|
||||
<label class="form-label small text-muted mb-1">Пост</label>
|
||||
<select class="form-select border-secondary" name="machine_id" required>
|
||||
<select class="form-select border-secondary" name="machine_id" {% if not workitem.machine_id %}required{% else %}disabled{% endif %}>
|
||||
<option value="">— выбрать —</option>
|
||||
{% for m in workshop_machines %}
|
||||
<option value="{{ m.id }}">{{ m.name }}</option>
|
||||
<option value="{{ m.id }}">{% if m.workshop %}{{ m.workshop.name }} · {% endif %}{{ m.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% else %}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<div class="card-header border-secondary py-3 d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<h3 class="text-accent mb-1">
|
||||
<i class="bi bi-exclamation-triangle me-2"></i>Позиции без техпроцесса
|
||||
<i class="bi bi-exclamation-triangle me-2"></i>{{ page_title|default:"Проблемные позиции" }}
|
||||
</h3>
|
||||
<div class="small text-muted">
|
||||
Сделка {{ deal.number }}
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<div class="card-body">
|
||||
{% if items %}
|
||||
<div class="text-muted mb-2">Для запуска в производство нужен техпроцесс (операция seq=1).</div>
|
||||
<div class="text-muted mb-2">{{ page_hint|default:"" }}</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle mb-0" data-sortable="1">
|
||||
<thead>
|
||||
|
||||
@@ -601,6 +601,9 @@
|
||||
</div>
|
||||
<div class="modal-footer border-secondary">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Закрыть</button>
|
||||
{% if missing_material_details_url %}
|
||||
<a class="btn btn-outline-accent" href="{{ missing_material_details_url }}" target="_blank">Подробнее</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="container-fluid p-0">
|
||||
<div class="row g-3">
|
||||
<div class="col-lg-5">
|
||||
<form method="post" action="{% url 'product_info' entity.id %}" enctype="multipart/form-data" id="product-info-form">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="action" value="save">
|
||||
@@ -32,22 +34,12 @@
|
||||
<input type="hidden" name="trail" value="{{ request.GET.trail|default:'' }}">
|
||||
|
||||
<div class="row g-2">
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Тип</label>
|
||||
<div class="mt-1"><span class="badge bg-secondary">{{ entity.get_entity_type_display }}</span></div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Обозначение</label>
|
||||
<input class="form-control bg-body text-body border-secondary" name="drawing_number" value="{{ entity.drawing_number }}" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5">
|
||||
<label class="form-label">Наименование</label>
|
||||
<input class="form-control bg-body text-body border-secondary" name="name" value="{{ entity.name }}" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Заполнен</label>
|
||||
<div class="form-check mt-2">
|
||||
<input class="form-check-input" type="checkbox" name="passport_filled" id="pf" {% if entity.passport_filled %}checked{% endif %} {% if not can_edit %}disabled{% endif %}>
|
||||
@@ -55,48 +47,70 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Обозначение</label>
|
||||
<input class="form-control bg-body text-body border-secondary" name="drawing_number" value="{{ entity.drawing_number }}" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Наименование</label>
|
||||
<input class="form-control bg-body text-body border-secondary" name="name" value="{{ entity.name }}" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Масса, кг</label>
|
||||
<input class="form-control bg-body text-body border-secondary" name="weight_kg" value="{% if passport and passport.weight_kg %}{{ passport.weight_kg }}{% endif %}" inputmode="decimal" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Покрытие</label>
|
||||
<input class="form-control bg-body text-body border-secondary" name="coating" value="{% if passport %}{{ passport.coating }}{% endif %}" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Цвет</label>
|
||||
<input class="form-control bg-body text-body border-secondary" name="coating_color" value="{% if passport %}{{ passport.coating_color }}{% endif %}" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Площадь покрытия, м²</label>
|
||||
<input class="form-control bg-body text-body border-secondary" name="coating_area_m2" value="{% if passport and passport.coating_area_m2 %}{{ passport.coating_area_m2 }}{% endif %}" inputmode="decimal" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Покрытие</label>
|
||||
<input class="form-control bg-body text-body border-secondary" name="coating" value="{% if passport %}{{ passport.coating }}{% endif %}" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Цвет</label>
|
||||
<input class="form-control bg-body text-body border-secondary" name="coating_color" value="{% if passport %}{{ passport.coating_color }}{% endif %}" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label class="form-label">Чертёж (PDF)</label>
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="pdf_main" accept="application/pdf" {% if not can_edit %}disabled{% endif %}>
|
||||
{% if entity.pdf_main %}
|
||||
<div class="small mt-1"><a href="{{ entity.pdf_main.url }}" target="_blank">Открыть текущий</a></div>
|
||||
{% endif %}
|
||||
<div class="d-flex gap-2 align-items-center">
|
||||
{% if entity.pdf_main %}
|
||||
<a href="{{ entity.pdf_main.url }}" target="_blank" rel="noopener" class="btn btn-sm btn-outline-danger p-1" title="Чертёж PDF">
|
||||
<i class="bi bi-file-pdf"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="pdf_main" accept="application/pdf" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="col-12">
|
||||
<label class="form-label">DXF/IGES/STEP</label>
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="dxf_file" accept=".dxf,.iges,.igs,.step,.stp" {% if not can_edit %}disabled{% endif %}>
|
||||
{% if entity.dxf_file %}
|
||||
<div class="small mt-1"><a href="{{ entity.dxf_file.url }}" target="_blank">Открыть текущий</a></div>
|
||||
{% endif %}
|
||||
<div class="d-flex gap-2 align-items-center">
|
||||
{% if entity.dxf_file %}
|
||||
<a href="{{ entity.dxf_file.url }}" target="_blank" rel="noopener" class="btn btn-sm btn-outline-info p-1" title="DXF/IGES/STEP">
|
||||
<i class="bi bi-file-earmark-code"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="dxf_file" accept=".dxf,.iges,.igs,.step,.stp" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="col-12">
|
||||
<label class="form-label">Картинка</label>
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="preview" accept="image/*" {% if not can_edit %}disabled{% endif %}>
|
||||
{% if entity.preview %}
|
||||
<div class="small mt-1"><a href="{{ entity.preview.url }}" target="_blank">Открыть текущую</a></div>
|
||||
{% endif %}
|
||||
<div class="d-flex gap-2 align-items-center">
|
||||
{% if entity.preview %}
|
||||
<a href="{{ entity.preview.url }}" target="_blank" rel="noopener" class="btn btn-sm btn-outline-success p-1" title="Картинка">
|
||||
<i class="bi bi-file-earmark-image"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="preview" accept="image/*" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if not can_edit %}
|
||||
@@ -287,6 +301,92 @@
|
||||
</script>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-lg-7">
|
||||
<div class="border border-secondary rounded p-2">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<div class="fw-bold">Состав</div>
|
||||
{% if can_edit %}
|
||||
<button type="button" class="btn btn-outline-accent btn-sm" data-bs-toggle="modal" data-bs-target="#bomAddModal">Добавить компонент</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover mb-0 align-middle">
|
||||
<thead>
|
||||
<tr class="table-custom-header">
|
||||
<th>Тип</th>
|
||||
<th>Обозначение</th>
|
||||
<th>Наименование</th>
|
||||
<th data-sort="false" class="text-center" style="width:110px;">Файлы</th>
|
||||
<th class="text-center" style="width:120px;">Заполнено</th>
|
||||
<th class="text-center">Кол-во</th>
|
||||
<th data-sort="false" class="text-end"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for ln in bom_lines %}
|
||||
<tr role="button" style="cursor:pointer" onclick="window.location.href='{% url 'product_info' ln.child.id %}?next={{ request.get_full_path|urlencode }}&trail={{ trail_child|urlencode }}';">
|
||||
<td class="small text-muted">{{ ln.child.get_entity_type_display }}</td>
|
||||
<td class="fw-bold">{{ ln.child.drawing_number|default:"—" }}</td>
|
||||
<td>{{ ln.child.name }}</td>
|
||||
<td class="text-center" onclick="event.stopPropagation();">
|
||||
{% if ln.child.dxf_file %}
|
||||
<a href="{{ ln.child.dxf_file.url }}" target="_blank" rel="noopener" class="btn btn-sm btn-outline-info p-1 stop-prop" title="DXF/IGES/STEP">
|
||||
<i class="bi bi-file-earmark-code"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if ln.child.pdf_main %}
|
||||
<a href="{{ ln.child.pdf_main.url }}" target="_blank" rel="noopener" class="btn btn-sm btn-outline-danger p-1 stop-prop" title="Чертёж PDF">
|
||||
<i class="bi bi-file-pdf"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if ln.child.preview %}
|
||||
<a href="{{ ln.child.preview.url }}" target="_blank" rel="noopener" class="btn btn-sm btn-outline-success p-1 stop-prop" title="Картинка">
|
||||
<i class="bi bi-file-earmark-image"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{% if ln.child.passport_filled %}
|
||||
<span class="badge bg-success">Да</span>
|
||||
{% else %}
|
||||
<span class="badge bg-secondary">Нет</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-center" style="max-width:220px;" onclick="event.stopPropagation();">
|
||||
<form method="post" action="{% url 'product_info' entity.id %}" class="d-flex gap-2 align-items-center justify-content-center" onclick="event.stopPropagation();">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="action" value="bom_update_qty">
|
||||
<input type="hidden" name="bom_id" value="{{ ln.id }}">
|
||||
<input type="hidden" name="trail" value="{{ request.GET.trail|default:'' }}">
|
||||
<input type="hidden" name="next" value="{{ next }}">
|
||||
<input class="form-control form-control-sm bg-body text-body border-secondary" name="quantity" value="{{ ln.quantity }}" {% if not can_edit %}disabled{% endif %}>
|
||||
<button class="btn btn-outline-secondary btn-sm" type="submit" {% if not can_edit %}disabled{% endif %}>OK</button>
|
||||
</form>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
{% if can_edit %}
|
||||
<form method="post" action="{% url 'product_info' entity.id %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="action" value="bom_delete_line">
|
||||
<input type="hidden" name="bom_id" value="{{ ln.id }}">
|
||||
<input type="hidden" name="trail" value="{{ request.GET.trail|default:'' }}">
|
||||
<input type="hidden" name="next" value="{{ next }}">
|
||||
<button class="btn btn-outline-secondary btn-sm" type="submit">Удалить</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="7" class="text-center text-muted py-4">Пока нет компонентов</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mt-4">
|
||||
@@ -358,72 +458,6 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<hr class="border-secondary my-4">
|
||||
|
||||
<div class="mt-4">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<div class="fw-bold">Состав</div>
|
||||
{% if can_edit %}
|
||||
<button type="button" class="btn btn-outline-accent btn-sm" data-bs-toggle="modal" data-bs-target="#bomAddModal">Добавить компонент</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover mb-0 align-middle">
|
||||
<thead>
|
||||
<tr class="table-custom-header">
|
||||
<th>Тип</th>
|
||||
<th>Обозначение</th>
|
||||
<th>Наименование</th>
|
||||
<th class="text-center" style="width:120px;">Заполнено</th>
|
||||
<th class="text-center">Кол-во</th>
|
||||
<th data-sort="false" class="text-end"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for ln in bom_lines %}
|
||||
<tr role="button" style="cursor:pointer" onclick="window.location.href='{% url 'product_info' ln.child.id %}?next={{ request.get_full_path|urlencode }}&trail={{ trail_child|urlencode }}';">
|
||||
<td class="small text-muted">{{ ln.child.get_entity_type_display }}</td>
|
||||
<td class="fw-bold">{{ ln.child.drawing_number|default:"—" }}</td>
|
||||
<td>{{ ln.child.name }}</td>
|
||||
<td class="text-center">
|
||||
{% if ln.child.passport_filled %}
|
||||
<span class="badge bg-success">Да</span>
|
||||
{% else %}
|
||||
<span class="badge bg-secondary">Нет</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-center" style="max-width:220px;" onclick="event.stopPropagation();">
|
||||
<form method="post" action="{% url 'product_info' entity.id %}" class="d-flex gap-2 align-items-center justify-content-center" onclick="event.stopPropagation();">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="action" value="bom_update_qty">
|
||||
<input type="hidden" name="bom_id" value="{{ ln.id }}">
|
||||
<input type="hidden" name="trail" value="{{ request.GET.trail|default:'' }}">
|
||||
<input type="hidden" name="next" value="{{ next }}">
|
||||
<input class="form-control form-control-sm bg-body text-body border-secondary" name="quantity" value="{{ ln.quantity }}" {% if not can_edit %}disabled{% endif %}>
|
||||
<button class="btn btn-outline-secondary btn-sm" type="submit" {% if not can_edit %}disabled{% endif %}>OK</button>
|
||||
</form>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
{% if can_edit %}
|
||||
<form method="post" action="{% url 'product_info' entity.id %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="action" value="bom_delete_line">
|
||||
<input type="hidden" name="bom_id" value="{{ ln.id }}">
|
||||
<input type="hidden" name="trail" value="{{ request.GET.trail|default:'' }}">
|
||||
<input type="hidden" name="next" value="{{ next }}">
|
||||
<button class="btn btn-outline-secondary btn-sm" type="submit">Удалить</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="6" class="text-center text-muted py-4">Пока нет компонентов</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if can_edit %}
|
||||
<div class="modal fade" id="bomAddModal" tabindex="-1" aria-hidden="true">
|
||||
|
||||
@@ -82,26 +82,38 @@
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Чертёж (PDF)</label>
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="pdf_main" accept="application/pdf" {% if not can_edit %}disabled{% endif %}>
|
||||
{% if entity.pdf_main %}
|
||||
<div class="small mt-1"><a href="{{ entity.pdf_main.url }}" target="_blank">Открыть текущий</a></div>
|
||||
{% endif %}
|
||||
<div class="input-group">
|
||||
{% if entity.pdf_main %}
|
||||
<a href="{{ entity.pdf_main.url }}" target="_blank" rel="noopener" class="btn btn-outline-danger" title="Чертёж PDF">
|
||||
<i class="bi bi-file-pdf"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="pdf_main" accept="application/pdf" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">DXF/IGES/STEP</label>
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="dxf_file" accept=".dxf,.iges,.igs,.step,.stp" {% if not can_edit %}disabled{% endif %}>
|
||||
{% if entity.dxf_file %}
|
||||
<div class="small mt-1"><a href="{{ entity.dxf_file.url }}" target="_blank">Открыть текущий</a></div>
|
||||
{% endif %}
|
||||
<div class="input-group">
|
||||
{% if entity.dxf_file %}
|
||||
<a href="{{ entity.dxf_file.url }}" target="_blank" rel="noopener" class="btn btn-outline-info" title="DXF/IGES/STEP">
|
||||
<i class="bi bi-file-earmark-code"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="dxf_file" accept=".dxf,.iges,.igs,.step,.stp" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Картинка</label>
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="preview" accept="image/*" {% if not can_edit %}disabled{% endif %}>
|
||||
{% if entity.preview %}
|
||||
<div class="small mt-1"><a href="{{ entity.preview.url }}" target="_blank">Открыть текущую</a></div>
|
||||
{% endif %}
|
||||
<div class="input-group">
|
||||
{% if entity.preview %}
|
||||
<a href="{{ entity.preview.url }}" target="_blank" rel="noopener" class="btn btn-outline-success" title="Картинка">
|
||||
<i class="bi bi-file-earmark-image"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="preview" accept="image/*" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 d-flex justify-content-end mt-2">
|
||||
|
||||
@@ -57,26 +57,38 @@
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Чертёж/ТЗ (PDF)</label>
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="pdf_main" accept="application/pdf" {% if not can_edit %}disabled{% endif %}>
|
||||
{% if entity.pdf_main %}
|
||||
<div class="small mt-1"><a href="{{ entity.pdf_main.url }}" target="_blank">Открыть текущий</a></div>
|
||||
{% endif %}
|
||||
<div class="input-group">
|
||||
{% if entity.pdf_main %}
|
||||
<a href="{{ entity.pdf_main.url }}" target="_blank" rel="noopener" class="btn btn-outline-danger" title="Чертёж/ТЗ PDF">
|
||||
<i class="bi bi-file-pdf"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="pdf_main" accept="application/pdf" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">DXF/IGES/STEP</label>
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="dxf_file" accept=".dxf,.iges,.igs,.step,.stp" {% if not can_edit %}disabled{% endif %}>
|
||||
{% if entity.dxf_file %}
|
||||
<div class="small mt-1"><a href="{{ entity.dxf_file.url }}" target="_blank">Открыть текущий</a></div>
|
||||
{% endif %}
|
||||
<div class="input-group">
|
||||
{% if entity.dxf_file %}
|
||||
<a href="{{ entity.dxf_file.url }}" target="_blank" rel="noopener" class="btn btn-outline-info" title="DXF/IGES/STEP">
|
||||
<i class="bi bi-file-earmark-code"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="dxf_file" accept=".dxf,.iges,.igs,.step,.stp" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Картинка</label>
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="preview" accept="image/*" {% if not can_edit %}disabled{% endif %}>
|
||||
{% if entity.preview %}
|
||||
<div class="small mt-1"><a href="{{ entity.preview.url }}" target="_blank">Открыть текущую</a></div>
|
||||
{% endif %}
|
||||
<div class="input-group">
|
||||
{% if entity.preview %}
|
||||
<a href="{{ entity.preview.url }}" target="_blank" rel="noopener" class="btn btn-outline-success" title="Картинка">
|
||||
<i class="bi bi-file-earmark-image"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="preview" accept="image/*" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if not can_edit %}
|
||||
|
||||
@@ -107,26 +107,38 @@
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Чертёж (PDF)</label>
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="pdf_main" accept="application/pdf" {% if not can_edit %}disabled{% endif %}>
|
||||
{% if entity.pdf_main %}
|
||||
<div class="small mt-1"><a href="{{ entity.pdf_main.url }}" target="_blank">Открыть текущий</a></div>
|
||||
{% endif %}
|
||||
<div class="d-flex gap-2 align-items-center">
|
||||
{% if entity.pdf_main %}
|
||||
<a href="{{ entity.pdf_main.url }}" target="_blank" class="btn btn-sm btn-outline-danger p-1" title="PDF">
|
||||
<i class="bi bi-file-pdf"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="pdf_main" accept="application/pdf" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">DXF/IGES/STEP</label>
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="dxf_file" accept=".dxf,.iges,.igs,.step,.stp" {% if not can_edit %}disabled{% endif %}>
|
||||
{% if entity.dxf_file %}
|
||||
<div class="small mt-1"><a href="{{ entity.dxf_file.url }}" target="_blank">Открыть текущий</a></div>
|
||||
{% endif %}
|
||||
<div class="d-flex gap-2 align-items-center">
|
||||
{% if entity.dxf_file %}
|
||||
<a href="{{ entity.dxf_file.url }}" target="_blank" class="btn btn-sm btn-outline-info p-1" title="DXF/IGES/STEP">
|
||||
<i class="bi bi-file-earmark-code"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="dxf_file" accept=".dxf,.iges,.igs,.step,.stp" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Картинка</label>
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="preview" accept="image/*" {% if not can_edit %}disabled{% endif %}>
|
||||
{% if entity.preview %}
|
||||
<div class="small mt-1"><a href="{{ entity.preview.url }}" target="_blank">Открыть текущую</a></div>
|
||||
{% endif %}
|
||||
<div class="d-flex gap-2 align-items-center">
|
||||
{% if entity.preview %}
|
||||
<a href="{{ entity.preview.url }}" target="_blank" class="btn btn-sm btn-outline-success p-1" title="Картинка">
|
||||
<i class="bi bi-file-earmark-image"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="preview" accept="image/*" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
|
||||
@@ -77,28 +77,41 @@
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Чертёж/паспорт (PDF)</label>
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="pdf_main" accept="application/pdf" {% if not can_edit %}disabled{% endif %}>
|
||||
{% if entity.pdf_main %}
|
||||
<div class="small mt-1"><a href="{{ entity.pdf_main.url }}" target="_blank">Открыть текущий</a></div>
|
||||
{% endif %}
|
||||
<div class="d-flex gap-2 align-items-center">
|
||||
{% if entity.pdf_main %}
|
||||
<a href="{{ entity.pdf_main.url }}" target="_blank" class="btn btn-sm btn-outline-danger p-1" title="PDF">
|
||||
<i class="bi bi-file-pdf"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="pdf_main" accept="application/pdf" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">DXF/IGES/STEP</label>
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="dxf_file" accept=".dxf,.iges,.igs,.step,.stp" {% if not can_edit %}disabled{% endif %}>
|
||||
{% if entity.dxf_file %}
|
||||
<div class="small mt-1"><a href="{{ entity.dxf_file.url }}" target="_blank">Открыть текущий</a></div>
|
||||
{% endif %}
|
||||
<div class="d-flex gap-2 align-items-center">
|
||||
{% if entity.dxf_file %}
|
||||
<a href="{{ entity.dxf_file.url }}" target="_blank" class="btn btn-sm btn-outline-info p-1" title="DXF/IGES/STEP">
|
||||
<i class="bi bi-file-earmark-code"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="dxf_file" accept=".dxf,.iges,.igs,.step,.stp" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Картинка</label>
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="preview" accept="image/*" {% if not can_edit %}disabled{% endif %}>
|
||||
{% if entity.preview %}
|
||||
<div class="small mt-1"><a href="{{ entity.preview.url }}" target="_blank">Открыть текущую</a></div>
|
||||
{% endif %}
|
||||
<div class="d-flex gap-2 align-items-center">
|
||||
{% if entity.preview %}
|
||||
<a href="{{ entity.preview.url }}" target="_blank" class="btn btn-sm btn-outline-success p-1" title="Картинка">
|
||||
<i class="bi bi-file-earmark-image"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<input class="form-control bg-body text-body border-secondary" type="file" name="preview" accept="image/*" {% if not can_edit %}disabled{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-12 d-flex justify-content-end mt-2">
|
||||
{% if can_edit %}
|
||||
<button class="btn btn-outline-accent" type="submit">Сохранить</button>
|
||||
|
||||
177
shiftflow/templates/shiftflow/shipping_cart.html
Normal file
177
shiftflow/templates/shiftflow/shipping_cart.html
Normal file
@@ -0,0 +1,177 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="card shadow border-secondary mb-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-truck me-2"></i>Отгрузка</h3>
|
||||
<div class="d-flex gap-2">
|
||||
<a class="btn btn-outline-secondary btn-sm" href="{{ journal_url }}" target="_blank">
|
||||
<i class="bi bi-journal-text me-1"></i>Журнал отгрузки
|
||||
</a>
|
||||
<button type="button" class="btn btn-outline-accent btn-sm" data-bs-toggle="modal" data-bs-target="#addDealModal">
|
||||
<i class="bi bi-plus-lg me-1"></i>Добавить к отгрузке сделку
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form method="post" id="shippingCartForm">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="action" id="shippingAction" value="">
|
||||
<input type="hidden" name="remove_deal_id" id="removeDealId" value="">
|
||||
|
||||
{% if not cart %}
|
||||
<div class="text-muted">Добавь сделку к отгрузке, чтобы выбрать готовые позиции.</div>
|
||||
{% endif %}
|
||||
|
||||
{% for b in cart %}
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header border-secondary py-2 d-flex justify-content-between align-items-center">
|
||||
<div class="fw-bold">Сделка №{{ b.deal.number }}{% if b.deal.company %} · {{ b.deal.company.name }}{% endif %}</div>
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm js-remove-deal" data-deal-id="{{ b.deal.id }}">Убрать</button>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead>
|
||||
<tr class="table-custom-header">
|
||||
<th data-sort="false" style="width:44px;"></th>
|
||||
<th>Позиция</th>
|
||||
<th class="text-center" style="width:120px;">Доступно</th>
|
||||
<th class="text-center" style="width:180px;">К отгрузке</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for r in b.entity_rows %}
|
||||
<tr>
|
||||
<td class="text-center"><input class="form-check-input border-secondary js-pick" type="checkbox" data-target="#qty_d{{ b.deal.id }}_ent_{{ r.entity.id }}"></td>
|
||||
<td><div class="fw-bold">{{ r.entity.drawing_number|default:"—" }} {{ r.entity.name }}</div><div class="small text-muted">{{ r.entity.get_entity_type_display }}</div></td>
|
||||
<td class="text-center fw-bold">{{ r.remaining_ready }}</td>
|
||||
<td class="text-center">
|
||||
<input id="qty_d{{ b.deal.id }}_ent_{{ r.entity.id }}" class="form-control bg-body text-body border-secondary ship-qty" type="number" min="0" step="1" max="{{ r.remaining_ready }}" name="d{{ b.deal.id }}_ent_{{ r.entity.id }}" value="0" data-deal="№{{ b.deal.number }}" data-label="{{ r.entity.drawing_number|default:'—' }} {{ r.entity.name }}" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="4" class="text-center text-muted py-4">Нет готовых позиций к отгрузке</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<div class="d-flex justify-content-end mt-3">
|
||||
{% if can_edit %}
|
||||
<button type="button" class="btn btn-outline-accent" data-bs-toggle="modal" data-bs-target="#shipConfirmModal" id="shipOpenConfirm">Отгрузить</button>
|
||||
{% else %}
|
||||
<button type="button" class="btn btn-outline-secondary" disabled>Отгрузить</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="addDealModal" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content border-secondary">
|
||||
<div class="modal-header border-secondary"><h5 class="modal-title">Добавить сделку к отгрузке</h5><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button></div>
|
||||
<div class="modal-body">
|
||||
<label class="form-label">Сделка (статус: В работе)</label>
|
||||
<select class="form-select bg-body text-body border-secondary" name="add_deal_id">
|
||||
<option value="">— выбери —</option>
|
||||
{% for d in available_deals %}
|
||||
<option value="{{ d.id }}">№{{ d.number }}{% if d.company %} · {{ d.company.name }}{% endif %}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="modal-footer border-secondary">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Отмена</button>
|
||||
<button type="submit" class="btn btn-outline-accent js-action" data-action="add_deal">Добавить</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="shipConfirmModal" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content border-secondary">
|
||||
<div class="modal-header border-secondary"><h5 class="modal-title">Подтвердить отгрузку</h5><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button></div>
|
||||
<div class="modal-body">
|
||||
<div class="small text-muted mb-2">Проверь итоговый список к отгрузке:</div>
|
||||
<div id="shipSummary" class="border border-secondary rounded p-2"></div>
|
||||
<div id="shipSummaryEmpty" class="text-muted d-none">Нечего отгружать (везде 0).</div>
|
||||
</div>
|
||||
<div class="modal-footer border-secondary">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Отмена</button>
|
||||
<button type="submit" class="btn btn-outline-accent js-action" data-action="ship" id="shipConfirmBtn">Принять отгрузку</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const form = document.getElementById('shippingCartForm');
|
||||
const actionEl = document.getElementById('shippingAction');
|
||||
const removeDealId = document.getElementById('removeDealId');
|
||||
const summary = document.getElementById('shipSummary');
|
||||
const empty = document.getElementById('shipSummaryEmpty');
|
||||
const confirmBtn = document.getElementById('shipConfirmBtn');
|
||||
|
||||
function setAction(a){ if(actionEl) actionEl.value = a || ''; }
|
||||
|
||||
document.querySelectorAll('.js-action').forEach(btn => {
|
||||
btn.addEventListener('click', () => setAction(btn.getAttribute('data-action') || ''));
|
||||
});
|
||||
|
||||
document.querySelectorAll('.js-remove-deal').forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
const id = btn.getAttribute('data-deal-id') || '';
|
||||
if (!id) return;
|
||||
if (removeDealId) removeDealId.value = id;
|
||||
setAction('remove_deal');
|
||||
form?.requestSubmit();
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelectorAll('.js-pick').forEach(chk => {
|
||||
chk.addEventListener('change', () => {
|
||||
const target = chk.getAttribute('data-target');
|
||||
const inp = target ? document.querySelector(target) : null;
|
||||
if (!inp) return;
|
||||
if (chk.checked) {
|
||||
inp.disabled = false;
|
||||
const max = inp.getAttribute('max');
|
||||
const v = (max && parseInt(max, 10) > 0) ? String(parseInt(max, 10)) : '1';
|
||||
if (!inp.value || inp.value === '0') inp.value = v;
|
||||
} else {
|
||||
inp.value = '0';
|
||||
inp.disabled = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
document.getElementById('shipOpenConfirm')?.addEventListener('click', () => {
|
||||
const inputs = Array.from(document.querySelectorAll('#shippingCartForm .ship-qty'));
|
||||
const rows = [];
|
||||
inputs.forEach(inp => {
|
||||
if (inp.disabled) return;
|
||||
const raw = (inp.value || '').toString().trim();
|
||||
const val = parseFloat(raw.replace(',', '.'));
|
||||
if (!val || val <= 0) return;
|
||||
rows.push({ deal: inp.getAttribute('data-deal') || '', label: inp.getAttribute('data-label') || '', val });
|
||||
});
|
||||
if (!rows.length) {
|
||||
summary.innerHTML = '';
|
||||
empty.classList.remove('d-none');
|
||||
if (confirmBtn) confirmBtn.disabled = true;
|
||||
return;
|
||||
}
|
||||
empty.classList.add('d-none');
|
||||
if (confirmBtn) confirmBtn.disabled = false;
|
||||
summary.innerHTML = rows.map(r => `<div class="d-flex justify-content-between gap-2"><div>${r.deal} · ${r.label}</div><div class="fw-bold">${r.val}</div></div>`).join('');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
90
shiftflow/templates/shiftflow/shipping_journal.html
Normal file
90
shiftflow/templates/shiftflow/shipping_journal.html
Normal file
@@ -0,0 +1,90 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="card shadow border-secondary mb-3">
|
||||
<div class="card-header border-secondary py-3 d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<h3 class="text-accent mb-1"><i class="bi bi-journal-text me-2"></i>Журнал отгрузки</h3>
|
||||
<div class="small text-muted">Склад отгрузки: {{ shipping_location.name }}</div>
|
||||
</div>
|
||||
<a class="btn btn-outline-secondary btn-sm" href="{% url 'shipping' %}">
|
||||
<i class="bi bi-arrow-left me-1"></i>Назад
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form method="get" class="row g-2 align-items-end mb-3">
|
||||
<input type="hidden" name="filtered" value="1">
|
||||
|
||||
<div class="col-md-5">
|
||||
<label class="small text-muted mb-1 fw-bold">Поиск (сделка):</label>
|
||||
<input
|
||||
type="text"
|
||||
name="q"
|
||||
value="{{ q }}"
|
||||
class="form-control form-control-sm bg-body text-body border-secondary"
|
||||
placeholder="№ сделки, описание, заказчик"
|
||||
onchange="this.form.submit()"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="col-md-auto ms-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()">
|
||||
</div>
|
||||
<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()">
|
||||
</div>
|
||||
|
||||
<div class="col-md-auto">
|
||||
<a href="{% url 'shipping_journal' %}?reset=1" class="btn btn-outline-secondary btn-sm">
|
||||
<i class="bi bi-arrow-counterclockwise me-1"></i>Сброс
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle mb-0" data-sortable="1">
|
||||
<thead>
|
||||
<tr class="table-custom-header">
|
||||
<th style="width:170px;">Дата</th>
|
||||
<th style="width:120px;">Документ</th>
|
||||
<th>Сделки</th>
|
||||
<th>Откуда</th>
|
||||
<th style="width:160px;">Кто</th>
|
||||
<th data-sort="false" class="text-end" style="width:140px;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for r in rows %}
|
||||
<tr>
|
||||
<td class="small">{{ r.transfer.occurred_at|date:"d.m.Y H:i" }}</td>
|
||||
<td class="fw-bold">№{{ r.transfer.id }}</td>
|
||||
<td class="small">
|
||||
{% if r.deals %}
|
||||
{% for d in r.deals %}
|
||||
<div>
|
||||
<span class="fw-bold">№{{ d.number }}</span>
|
||||
{% if d.description %} — {{ d.description }}{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<span class="text-muted">—</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="small">{{ r.transfer.from_location.name }}</td>
|
||||
<td class="small">{{ r.transfer.sender.username|default:"—" }}</td>
|
||||
<td class="text-end">
|
||||
<a class="btn btn-outline-secondary btn-sm" href="{{ r.admin_url }}" target="_blank">Открыть</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="6" class="text-center text-muted py-4">Пока нет отгрузок</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -76,15 +76,15 @@
|
||||
<div class="row g-3 mt-1">
|
||||
<div class="col-lg-4">
|
||||
<div class="small text-muted fw-bold mb-1">Списано</div>
|
||||
{% if card.report.consumptions.all %}
|
||||
{% if card.consumption_rows %}
|
||||
<ul class="mb-0">
|
||||
{% for c in card.report.consumptions.all %}
|
||||
{% for c in card.consumption_rows %}
|
||||
{% if c.stock_item_id and c.stock_item.material_id %}
|
||||
<li>
|
||||
{{ c.stock_item.material.full_name|default:c.stock_item.material.name }}
|
||||
({% if c.stock_item.current_length and c.stock_item.current_width %}{{ c.stock_item.current_length|floatformat:"-g" }}×{{ c.stock_item.current_width|floatformat:"-g" }}{% elif c.stock_item.current_length %}{{ c.stock_item.current_length|floatformat:"-g" }}{% else %}—{% endif %})
|
||||
{% if c.stock_item.deal_id %}<span class="text-muted">(сделка № {{ c.stock_item.deal.number }})</span>{% endif %}
|
||||
{{ c.quantity|floatformat:"-g" }} шт
|
||||
{{ c.quantity|floatformat:"-g" }} шт — масса {% if c.mass_kg or c.mass_kg == 0 %}{{ c.mass_kg|floatformat:1 }}{% else %}—{% endif %} кг
|
||||
</li>
|
||||
{% elif c.stock_item_id and c.stock_item.entity_id %}
|
||||
<li>
|
||||
@@ -119,13 +119,13 @@
|
||||
|
||||
<div class="col-lg-4">
|
||||
<div class="small text-muted fw-bold mb-1">Остаток ДО</div>
|
||||
{% if card.report.remnants.all %}
|
||||
{% if card.remnant_rows %}
|
||||
<ul class="mb-0">
|
||||
{% for r in card.report.remnants.all %}
|
||||
{% for r in card.remnant_rows %}
|
||||
<li>
|
||||
{{ r.material.full_name|default:r.material.name|default:r.material }}
|
||||
({% if r.current_length and r.current_width %}{{ r.current_length|floatformat:"-g" }}×{{ r.current_width|floatformat:"-g" }}{% elif r.current_length %}{{ r.current_length|floatformat:"-g" }}{% else %}—{% endif %})
|
||||
{{ r.quantity|floatformat:"-g" }} шт
|
||||
{{ r.quantity|floatformat:"-g" }} шт — масса {% if r.mass_kg or r.mass_kg == 0 %}{{ r.mass_kg|floatformat:1 }}{% else %}—{% endif %} кг
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user