Files
ScanLook/templates/cons_sheets/edit_field.html
Javier d955a13f3d v0.13.0 - Add Consumption Sheets module
New module for tracking production consumption with lot scanning:
- Admin configuration for process types (AD WIP, etc.)
- Dynamic table creation per process
- Flexible header/detail field definitions with Excel cell mapping
- Duplicate detection with configurable key field
- Staff scanning interface with duplicate warnings (same session/cross session)
- Excel export using uploaded templates with multi-page support
- Template settings for rows per page and detail start row
2026-01-29 12:33:34 -06:00

81 lines
4.0 KiB
HTML

{% extends "base.html" %}
{% block title %}Edit Field - {{ process.process_name }} - ScanLook{% endblock %}
{% block content %}
<div class="dashboard-container">
<div class="mode-selector">
<a href="{{ url_for('cons_sheets.process_fields', process_id=process.id) }}" class="btn btn-secondary btn-sm">
<i class="fa-solid fa-arrow-left"></i> Back to Fields
</a>
</div>
<div class="form-container" style="max-width: 600px; margin: 0 auto;">
<h1 class="page-title" style="text-align: center;">Edit Field</h1>
<p class="page-subtitle" style="text-align: center; margin-bottom: var(--space-xl);">
{{ process.process_name }} — {{ 'Header' if field.table_type == 'header' else 'Detail' }}
</p>
<form method="POST" class="form-card">
<div class="form-group">
<label class="form-label">Field Name</label>
<input type="text" class="form-input" value="{{ field.field_name }}" disabled
style="opacity: 0.6; font-family: var(--font-mono);">
<p class="form-hint">Cannot be changed (used in database)</p>
</div>
<div class="form-group">
<label for="field_label" class="form-label">Field Label *</label>
<input type="text" id="field_label" name="field_label" class="form-input"
value="{{ field.field_label }}" required autofocus>
</div>
<div class="form-group">
<label for="field_type" class="form-label">Data Type *</label>
<select id="field_type" name="field_type" class="form-input" required>
<option value="TEXT" {% if field.field_type == 'TEXT' %}selected{% endif %}>TEXT</option>
<option value="INTEGER" {% if field.field_type == 'INTEGER' %}selected{% endif %}>INTEGER</option>
<option value="REAL" {% if field.field_type == 'REAL' %}selected{% endif %}>REAL</option>
<option value="DATE" {% if field.field_type == 'DATE' %}selected{% endif %}>DATE</option>
<option value="DATETIME" {% if field.field_type == 'DATETIME' %}selected{% endif %}>DATETIME</option>
</select>
</div>
<div class="form-group">
<label for="max_length" class="form-label">Max Length</label>
<input type="number" id="max_length" name="max_length" class="form-input"
value="{{ field.max_length or '' }}" min="1">
</div>
<div class="form-group">
<label class="checkbox-label">
<input type="checkbox" name="is_required" value="1" {% if field.is_required %}checked{% endif %}>
<span>Required field</span>
</label>
</div>
{% if field.table_type == 'detail' %}
<div class="form-group">
<label class="checkbox-label">
<input type="checkbox" name="is_duplicate_key" value="1" {% if field.is_duplicate_key %}checked{% endif %}>
<span>Use for duplicate detection</span>
</label>
<p class="form-hint">Check this for the field that should be checked for duplicates (e.g., Lot Number)</p>
</div>
{% endif %}
<div class="form-group">
<label for="excel_cell" class="form-label">Excel Cell{% if field.table_type == 'detail' %} (Column){% endif %}</label>
<input type="text" id="excel_cell" name="excel_cell" class="form-input"
value="{{ field.excel_cell or '' }}" style="text-transform: uppercase;">
</div>
<div class="form-actions">
<a href="{{ url_for('cons_sheets.process_fields', process_id=process.id) }}" class="btn btn-secondary">Cancel</a>
<button type="submit" class="btn btn-primary">Save Changes</button>
</div>
</form>
</div>
</div>
{% endblock %}