Suche-Druck: eigenes Standard-Template je Typ (format_templates.search_default)
Neues Boolean-Feld search_default an format_templates: je ein Brief- und ein Kuvert-Template als Standard für den Schnelldruck im Suche-Reiter markieren. Der Schnelldruck bevorzugt dieses Template, sonst das dem Auftragsformat zugeordnete Standard (default_format), sonst den Fallback. Kann bewusst dasselbe Template wie das normale Standard sein. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -392,7 +392,7 @@ const Board = defineComponent({
|
||||
} }),
|
||||
ladeJobs(),
|
||||
ladeMachines(),
|
||||
api.get('/items/format_templates', { params: { limit: -1, fields: 'id,key,name,type,width,height,xpos,ypos,scale,rotation,default_format' } }),
|
||||
api.get('/items/format_templates', { params: { limit: -1, fields: 'id,key,name,type,width,height,xpos,ypos,scale,rotation,default_format,search_default' } }).catch(() => api.get('/items/format_templates', { params: { limit: -1, fields: 'id,key,name,type,width,height,xpos,ypos,scale,rotation,default_format' } })),
|
||||
api.get('/items/muster_settings', { params: { fields: 'text_du,text_sie' } }).catch(() => ({ data: { data: { text_du: '', text_sie: '' } } })),
|
||||
api.get('/items/muster_texts', { params: { limit: -1, filter: { active: { _eq: true } }, sort: 'sort', fields: 'id,label,text' } }).catch(() => ({ data: { data: [] } })),
|
||||
]);
|
||||
@@ -482,15 +482,18 @@ const Board = defineComponent({
|
||||
}
|
||||
return res;
|
||||
});
|
||||
// In den Einstellungen als „Standard für Suche-Druck" markiertes Template je
|
||||
// Typ. Hat beim Schnelldruck Vorrang (kann dasselbe wie default_format sein).
|
||||
const tplSuchStandard = (typ) => templates.value.find((t) => t.type === typ && t.search_default) || null;
|
||||
// Schnelldruck: NUR den gewählten Empfänger (Briefnummer) des Typs in die
|
||||
// Warteschlange geben. Das Template kommt aus der in den Einstellungen dem
|
||||
// Auftragsformat zugeordneten Vorlage (default_format), sonst der Fallback.
|
||||
// Warteschlange geben. Template-Reihenfolge: eigenes Suche-Standard-Template →
|
||||
// dem Auftragsformat zugeordnetes Standard (default_format) → Fallback.
|
||||
async function schnelldruck(o, nr, typ) {
|
||||
const machine = aktiveMaschinen.value[0]?.id || null;
|
||||
if (!machine) { fehler.value = 'Keine aktive Maschine verfügbar.'; return; }
|
||||
const tpl = typ === 'umschlag'
|
||||
? (tplForFormat(o.envelope_format, 'umschlag') || tplByKey(ENVELOPE_TPL[o.envelope_format] || 'kuvert_a_v1', 'umschlag'))
|
||||
: (tplForFormat(o.format?.key, 'brief') || tplByKey(LETTER_TPL[o.format?.key] || 'a4_single', 'brief'));
|
||||
? (tplSuchStandard('umschlag') || tplForFormat(o.envelope_format, 'umschlag') || tplByKey(ENVELOPE_TPL[o.envelope_format] || 'kuvert_a_v1', 'umschlag'))
|
||||
: (tplSuchStandard('brief') || tplForFormat(o.format?.key, 'brief') || tplByKey(LETTER_TPL[o.format?.key] || 'a4_single', 'brief'));
|
||||
if (!tpl?.id) {
|
||||
fehler.value = `Kein Standard-Template für ${typ === 'umschlag' ? 'Kuvert' : 'Schriftstück'} hinterlegt – bitte in den Einstellungen (Format-Templates) ein Standardformat zuordnen.`;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user