Warenwirtschaft: F-18 — Zwischenspeichern oben/mittig/unten, Notizfeld für Touch vergrößerbar und auto-wachsend
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
2859aa0dbb
commit
aa2fcc4656
5 changed files with 55 additions and 3 deletions
|
|
@ -1,6 +1,9 @@
|
|||
@php
|
||||
// Achtung: in diesem Template nur die Block-Form von php-Direktiven verwenden (Blade-Compiler-Falle, siehe AP-23).
|
||||
$isEdit = $isEdit ?? false;
|
||||
// AP-43/F-18: Zwischenspeichern an mehreren Stellen (oben, vor dem Ergebnis, unten) —
|
||||
// nur solange die Produktion noch nicht gebucht ist.
|
||||
$canDraft = ! $isEdit || ($model && $model->isDraft());
|
||||
|
||||
// AP-28: Vorbelegung der Produktionsergebnis-Zeilen (old() > bestehende Outputs > leer = Default aus Planung per JS).
|
||||
$initialOutputs = old('outputs');
|
||||
|
|
@ -60,9 +63,21 @@
|
|||
#recipe-ingredient-lines .input-group-text {
|
||||
font-size: 16px;
|
||||
}
|
||||
/* F-18: Notizfeld auf dem iPad groß genug und per Finger/automatisch vergrößerbar */
|
||||
#notes {
|
||||
min-height: 88px;
|
||||
font-size: 16px;
|
||||
resize: vertical;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@if ($canDraft)
|
||||
<div class="d-flex justify-content-end mb-2">
|
||||
<button type="submit" name="save_mode" value="draft" class="btn btn-sm btn-outline-primary btn-save-draft" formnovalidate>{{ __('Zwischenspeichern (Entwurf)') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-12 col-md-6">
|
||||
<label for="product_id">{{ __('Produkt') }}</label>
|
||||
|
|
@ -157,9 +172,16 @@
|
|||
|
||||
<div class="form-group">
|
||||
<label for="notes">{{ __('Notizen') }}</label>
|
||||
<textarea name="notes" id="notes" class="form-control" rows="2">{{ old('notes', $model?->notes) }}</textarea>
|
||||
{{-- F-18: wächst beim Tippen automatisch mit (siehe _scripts), zusätzlich manuell vergrößerbar --}}
|
||||
<textarea name="notes" id="notes" class="form-control" rows="2" style="resize: vertical;">{{ old('notes', $model?->notes) }}</textarea>
|
||||
</div>
|
||||
|
||||
@if ($canDraft)
|
||||
<div class="d-flex justify-content-end mb-2">
|
||||
<button type="submit" name="save_mode" value="draft" class="btn btn-sm btn-outline-primary btn-save-draft" formnovalidate>{{ __('Zwischenspeichern (Entwurf)') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- AP-28: Produktionsergebnis — treibt den Produktbestand (mehrere Output-Produkte möglich) --}}
|
||||
<hr>
|
||||
<h6>{{ __('Produktionsergebnis') }}</h6>
|
||||
|
|
|
|||
|
|
@ -574,11 +574,23 @@
|
|||
}
|
||||
}
|
||||
|
||||
// F-18: Notizfeld wächst automatisch mit dem Text (iPad: kein Ziehen am Rand nötig).
|
||||
function autoGrowNotes() {
|
||||
var el = document.getElementById('notes');
|
||||
if (!el) {
|
||||
return;
|
||||
}
|
||||
el.style.height = 'auto';
|
||||
el.style.height = Math.max(el.scrollHeight, el.offsetHeight) + 'px';
|
||||
}
|
||||
$('#notes').on('input', autoGrowNotes);
|
||||
|
||||
$(document).ready(function () {
|
||||
if ($('#product_id').val() && $('#location_id').val()) {
|
||||
loadRecipe();
|
||||
}
|
||||
initOutputs();
|
||||
autoGrowNotes();
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<button type="submit" name="save_mode" value="complete" class="btn btn-primary" id="btn-submit-production">{{ __('Produktion abschließen') }}</button>
|
||||
{{-- AP-43: Zwischenspeichern als Entwurf — ohne Pflichtfeld-/Bestandsprüfung, bucht keinen Bestand. --}}
|
||||
<button type="submit" name="save_mode" value="draft" class="btn btn-outline-primary" id="btn-save-draft" formnovalidate>{{ __('Zwischenspeichern (Entwurf)') }}</button>
|
||||
<button type="submit" name="save_mode" value="draft" class="btn btn-outline-primary btn-save-draft" id="btn-save-draft" formnovalidate>{{ __('Zwischenspeichern (Entwurf)') }}</button>
|
||||
<a href="{{ route('admin.inventory.productions.index') }}" class="btn btn-outline-secondary">{{ __('Abbrechen') }}</a>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<button type="submit" name="save_mode" value="complete" class="btn btn-primary" id="btn-submit-production">{{ __('Produktion abschließen') }}</button>
|
||||
{{-- AP-43: „Zwischenspeichern" nur solange die Produktion noch nicht gebucht ist (Entwurf). --}}
|
||||
@if ($model->isDraft())
|
||||
<button type="submit" name="save_mode" value="draft" class="btn btn-outline-primary" id="btn-save-draft" formnovalidate>{{ __('Zwischenspeichern (Entwurf)') }}</button>
|
||||
<button type="submit" name="save_mode" value="draft" class="btn btn-outline-primary btn-save-draft" id="btn-save-draft" formnovalidate>{{ __('Zwischenspeichern (Entwurf)') }}</button>
|
||||
@endif
|
||||
<a href="{{ route('admin.inventory.productions.show', $model) }}" class="btn btn-outline-secondary">{{ __('Abbrechen') }}</a>
|
||||
</form>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue