Доработали апдейт пунктов заданий
All checks were successful
Deploy MES Core / deploy (push) Successful in 9s
All checks were successful
Deploy MES Core / deploy (push) Successful in 9s
This commit is contained in:
@@ -12,6 +12,14 @@
|
||||
|
||||
<form method="post" id="mainForm" class="card-body p-4">
|
||||
{% csrf_token %}
|
||||
|
||||
{% if errors %}
|
||||
<div class="alert alert-danger mb-4">
|
||||
{% for e in errors %}
|
||||
<div>{{ e }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="row g-3 mb-4 border-bottom border-secondary pb-3 text-body">
|
||||
<div class="col-md-4">
|
||||
@@ -56,15 +64,15 @@
|
||||
<div class="row g-3 mt-3 text-start">
|
||||
<div class="col-md-4">
|
||||
<label class="small text-muted">Взятый материал</label>
|
||||
<input type="text" name="material_taken" class="form-control border-secondary" value="{{ item.material_taken }}" placeholder="Напр: 3 трубы по 12м">
|
||||
<input type="text" name="material_taken" class="form-control border-secondary" value="{{ item.material_taken }}" placeholder="Напр: 3 трубы по 12м" required>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="small text-muted">Деловой отход</label>
|
||||
<input type="text" name="usable_waste" class="form-control border-secondary" value="{{ item.usable_waste }}" placeholder="Напр: кусок 1500мм">
|
||||
<label class="small text-muted">Остаток ДО</label>
|
||||
<input type="text" name="usable_waste" class="form-control border-secondary" value="{{ item.usable_waste }}" placeholder="Напр: 0.8м / 12кг" required>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="small text-muted">Лом (кг)</label>
|
||||
<input type="number" step="0.01" name="scrap_weight" class="form-control border-secondary" value="{{ item.scrap_weight }}">
|
||||
<input type="number" step="0.01" min="0" name="scrap_weight" class="form-control border-secondary" value="{{ item.scrap_weight }}" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -74,10 +82,27 @@
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if user_role == 'admin' %}
|
||||
{% if user_role in 'admin,technologist' %}
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-4">
|
||||
<label class="small text-muted">Дата смены</label>
|
||||
<input type="date" name="date" class="form-control border-secondary" value="{{ item.date|date:'Y-m-d' }}">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="small text-muted">Станок</label>
|
||||
<select name="machine" class="form-select border-secondary">
|
||||
{% for m in machines %}
|
||||
<option value="{{ m.id }}" {% if item.machine.id == m.id %}selected{% endif %}>{{ m.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="small text-muted">План на смену (шт)</label>
|
||||
<input type="number" name="quantity_plan" class="form-control border-secondary" value="{{ item.quantity_plan }}">
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label class="small text-muted">Статус задания (Админ)</label>
|
||||
<label class="small text-muted">Статус задания</label>
|
||||
<select name="status" class="form-select border-secondary">
|
||||
{% for val, name in form.fields.status.choices %}
|
||||
<option value="{{ val }}" {% if item.status == val %}selected{% endif %}>{{ name }}</option>
|
||||
@@ -88,19 +113,52 @@
|
||||
<label class="small text-muted">Факт (шт)</label>
|
||||
<input type="number" name="quantity_fact" class="form-control border-secondary" value="{{ item.quantity_fact }}">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="small text-muted">Взятый материал</label>
|
||||
<input type="text" name="material_taken" class="form-control border-secondary" value="{{ item.material_taken }}" placeholder="Напр: 3 трубы по 12м">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="small text-muted">Деловой отход</label>
|
||||
<input type="text" name="usable_waste" class="form-control border-secondary" value="{{ item.usable_waste }}" placeholder="Напр: кусок 1500мм">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="small text-muted">Лом (кг)</label>
|
||||
<input type="number" step="0.01" name="scrap_weight" class="form-control border-secondary" value="{{ item.scrap_weight }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-check form-switch p-3 rounded border border-warning mb-4 bg-body-tertiary d-flex justify-content-between align-items-center">
|
||||
<label class="form-check-label fw-bold ms-2" for="sync1c">Списано в 1С</label>
|
||||
<input class="form-check-input ms-0" style="width: 3em; height: 1.5em;" type="checkbox" name="is_synced_1c" id="sync1c" {% if item.is_synced_1c %}checked{% endif %}>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if user_role in 'admin,clerk' %}
|
||||
{% if item.status == 'done' or item.quantity_fact > 0 %}
|
||||
{% if user_role == 'clerk' %}
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-4">
|
||||
<small class="text-muted d-block">Взятый материал</small>
|
||||
<strong>{{ item.material_taken|default:"-" }}</strong>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<small class="text-muted d-block">Остаток ДО</small>
|
||||
<strong>{{ item.usable_waste|default:"-" }}</strong>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<small class="text-muted d-block">Лом (кг)</small>
|
||||
<strong>{{ item.scrap_weight }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if item.status == 'done' or item.status == 'partial' %}
|
||||
<div class="form-check form-switch p-3 rounded border border-warning mb-4 bg-body-tertiary d-flex justify-content-between align-items-center">
|
||||
<label class="form-check-label fw-bold ms-2" for="sync1c">Списано в 1С</label>
|
||||
<input class="form-check-input ms-0" style="width: 3em; height: 1.5em;" type="checkbox" name="is_synced_1c" id="sync1c" {% if item.is_synced_1c %}checked{% endif %}>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="text-muted small mb-4"><i class="bi bi-info-circle me-1"></i>Списание будет доступно после выполнения.</div>
|
||||
<div class="text-muted small mb-4"><i class="bi bi-info-circle me-1"></i>Списание будет доступно после закрытия (Выполнено/Частично).</div>
|
||||
{% endif %}
|
||||
{% if user_role == 'clerk' %}<input type="hidden" name="quantity_fact" value="{{ item.quantity_fact }}">{% endif %}
|
||||
<input type="hidden" name="quantity_fact" value="{{ item.quantity_fact }}">
|
||||
{% endif %}
|
||||
|
||||
<div class="d-flex justify-content-between mt-4">
|
||||
|
||||
@@ -22,8 +22,11 @@
|
||||
<div class="small text-muted mb-1 fw-bold">Статус:</div>
|
||||
<div class="d-flex flex-wrap gap-1">
|
||||
{% if user_role == 'operator' %}
|
||||
<input type="hidden" name="statuses" value="work">
|
||||
<span class="badge bg-primary">В работе</span>
|
||||
<input type="checkbox" class="btn-check" name="statuses" id="s_work" value="work" {% if 'work' in selected_statuses %}checked{% endif %} onchange="this.form.submit()">
|
||||
<label class="btn btn-outline-primary btn-sm" for="s_work">В работе</label>
|
||||
|
||||
<input type="checkbox" class="btn-check" name="statuses" id="s_closed" value="closed" {% if 'closed' in selected_statuses %}checked{% endif %} onchange="this.form.submit()">
|
||||
<label class="btn btn-outline-success btn-sm" for="s_closed">Завершено</label>
|
||||
{% else %}
|
||||
<input type="checkbox" class="btn-check" name="statuses" id="s_work" value="work" {% if 'work' in selected_statuses %}checked{% endif %} onchange="this.form.submit()">
|
||||
<label class="btn btn-outline-primary btn-sm" for="s_work">В работе</label>
|
||||
@@ -72,7 +75,10 @@
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
const s = document.querySelector('input[name="start_date"]');
|
||||
const e = document.querySelector('input[name="end_date"]');
|
||||
const today = new Date().toISOString().slice(0,10);
|
||||
const now = new Date();
|
||||
const mm = String(now.getMonth() + 1).padStart(2, '0');
|
||||
const dd = String(now.getDate()).padStart(2, '0');
|
||||
const today = `${now.getFullYear()}-${mm}-${dd}`;
|
||||
if (s && !s.value) s.value = today;
|
||||
if (e && !e.value) e.value = today;
|
||||
});
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge {% if item.status == 'work' %}bg-primary{% elif item.status == 'done' %}bg-success{% else %}bg-secondary{% endif %}">
|
||||
<span class="badge {% if item.status == 'work' %}bg-primary{% elif item.status == 'done' %}bg-success{% elif item.status == 'partial' %}bg-success-subtle text-success-emphasis border border-success-subtle{% else %}bg-secondary{% endif %}">
|
||||
{{ item.get_status_display }}
|
||||
</span>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user