fix: a transfer asks which part the new machine resumes from and names the old machine's .prt to delete (Marcus, 2026-12-01)
The hot folder takes a PNG in about 10 s and the Hoson queues it, so the last part taken is not the one being ripped. The dialog lists the parts (already taken or still in the folder) and asks where to resume once any was taken; the new round starts there, and the parts from there on that the old machine took are named as Hoson .prt files to delete, in the toast, the card and the history. The film card no longer claims which part prints: '2/3 partes com a máquina'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -86,15 +86,16 @@ const residueBadge=item=>badge('! Resíduo aceito','warn','O cliente aceitou imp
|
||||
const PRINTING={imprimindo:['Imprimindo','live','Já ripou, está rodando'],
|
||||
aguardando:['Na vez','wait','Na hot folder, espera os da frente'],
|
||||
ripando:['Ripando','rip','O Flexi está ripando enquanto o anterior roda']};
|
||||
// A film in parts on its machine (items 10 and 13, Dropstar 2026-10-30):
|
||||
// "parte 3/7 imprimindo · 4/7 ripando". Flexi rips the part it took last from
|
||||
// the hot folder while the one before it prints.
|
||||
// A film in parts on its machine (items 10 and 13, Dropstar 2026-10-30): how
|
||||
// many parts the machine has taken. The hot folder takes a PNG in about 10 s
|
||||
// and the Hoson queues it (Marcus, 2026-12-01), so a part taken is not known
|
||||
// to be ripping or printing: the card says only what the folder shows.
|
||||
function partsStep(order){
|
||||
const hot=order.hot;if(!hot||hot.parts<2)return null;
|
||||
const n=hot.parts, t=hot.taken;
|
||||
if(!t)return ['Parte 1/'+n+' na hot folder','wait'];
|
||||
if(t===1)return ['Parte 1/'+n+' ripando','rip'];
|
||||
return ['Parte '+(t-1)+'/'+n+' imprimindo · '+t+'/'+n+' ripando','live'];
|
||||
if(t<n)return [t+'/'+n+' partes com a máquina','live'];
|
||||
return ['As '+n+' partes com a máquina','live'];
|
||||
}
|
||||
async function proofOk(order){
|
||||
await api('/orders/'+order.id+'/proof',{});say('Prova do pedido #'+order.number+' conferida.');await load();
|
||||
@@ -436,7 +437,8 @@ function cardFlags(order){
|
||||
const transfers=order.transfers||[];
|
||||
if(live&&transfers.length){const t=transfers[transfers.length-1];
|
||||
out.push(['warn','Transferido · '+t.from_name+' → '+t.to_name,
|
||||
'Motivo: '+t.reason+' · '+t.created_by+' em '+when(t.created_at)+(t.resumed_from>1?' · recomeçou da parte '+t.resumed_from:'')+'. Confira a emenda de tom.']);}
|
||||
'Motivo: '+t.reason+' · '+t.created_by+' em '+when(t.created_at)+(t.resumed_from>1?' · recomeçou da parte '+t.resumed_from:'')+
|
||||
(t.delete_prt?.length?' · apague da pasta do Hoson da '+t.from_name+': '+t.delete_prt.join(', '):'')+'. Confira a emenda de tom.']);}
|
||||
if(order.snapshot.treatment){
|
||||
const n=Number(order.snapshot.treatment.arts)||1;
|
||||
out.push(['warn','Ajuste Fino · '+n+(n===1?' arte':' artes'),
|
||||
|
||||
@@ -431,12 +431,27 @@ function nextBox(order){
|
||||
const select=node('select');select.required=true;select.setAttribute('aria-label','Máquina que recebe o pedido');
|
||||
for(const m of choices){const o=node('option',m.name);o.value=m.id;select.append(o);}
|
||||
const reason=node('input');reason.maxLength=500;reason.required=true;reason.setAttribute('aria-label','Motivo da transferência');
|
||||
// The hot folder takes a PNG in about 10 s (Marcus, 2026-12-01): a part
|
||||
// the machine took may still wait in its Hoson queue, so whoever moves
|
||||
// the card says where the new machine resumes, after looking at the Hoson.
|
||||
const parts=order.hot_parts||[], taken=parts.some(p=>p.state==='consumed');
|
||||
const resume=node('select');resume.setAttribute('aria-label','Parte de onde a nova máquina recomeça');
|
||||
if(taken){const pick=node('option','Escolha a parte');pick.value='';resume.append(pick);resume.required=true;}
|
||||
for(const p of parts){const o=node('option','Parte '+p.seq+' · '+(p.state==='consumed'?'já pega pela máquina':'ainda na pasta'));
|
||||
o.value=String(p.seq);resume.append(o);}
|
||||
const fields=[field('Máquina',select)];
|
||||
if(parts.length>1||taken)fields.push(field('Recomeçar da parte',resume,'Confira no Hoson qual parte a máquina atual já imprimiu.'));
|
||||
fields.push(field('Motivo',reason,'Fica no card para o Revisor conferir a emenda de tom.'));
|
||||
formDialog('Transferir o pedido #'+order.number,{host:$('drawer'),className:'reason',width:540,
|
||||
text:'O que a máquina atual ainda não pegou sai da pasta dela. A nova recomeça da parte que estava ripando.',
|
||||
fields:[field('Máquina',select),field('Motivo',reason,'Fica no card para o Revisor conferir a emenda de tom.')],
|
||||
label:'Transferir',tone:'red',
|
||||
onsave:async()=>{await api('/orders/'+order.id+'/transfer',{machine_id:select.value,reason:reason.value.trim()});
|
||||
say('Pedido #'+order.number+' transferido.');await load();}});
|
||||
text:'O que a máquina atual ainda não pegou sai da pasta dela.',
|
||||
fields,label:'Transferir',tone:'red',
|
||||
onsave:async()=>{
|
||||
const body={machine_id:select.value,reason:reason.value.trim()};
|
||||
if(parts.length&&resume.value)body.resume_from=Number(resume.value);
|
||||
const done=await api('/orders/'+order.id+'/transfer',body);
|
||||
const prt=done.delete_prt||[];
|
||||
say('Pedido #'+order.number+' transferido.'+(prt.length?' Apague da pasta do Hoson da máquina antiga: '+prt.join(', ')+'.':''),false,prt.length?20000:undefined);
|
||||
await load();}});
|
||||
},'btn quiet lg'));
|
||||
}else if(st==='rev'){
|
||||
if(proofPending(order)){
|
||||
@@ -1321,7 +1336,9 @@ function historyView(order,rows,view){
|
||||
r.operator+(r.machine?', na '+r.machine:''),r.created_at,r.reason));
|
||||
// Machine transfers in Imprimindo (D4), newest first.
|
||||
for(const t of [...(order.transfers||[])].reverse())
|
||||
list.append(entry('Transferido · '+t.from_name+' → '+t.to_name,t.created_by,t.created_at,t.reason));
|
||||
list.append(entry('Transferido · '+t.from_name+' → '+t.to_name,t.created_by,t.created_at,
|
||||
t.reason+(t.resumed_from>1?' · recomeçou da parte '+t.resumed_from:'')+
|
||||
(t.delete_prt?.length?' · apagar do Hoson da '+t.from_name+': '+t.delete_prt.join(', '):'')));
|
||||
// The Redesenho previews (D2), newest first, like the moves above.
|
||||
for(const p of [...previewsOf(order)].reverse()){
|
||||
if(p.decided_at)list.append(entry('Prévia '+p.number+(p.result==='approved'?' aprovada':' reprovada'),p.decided_by,p.decided_at,p.reason));
|
||||
|
||||
Reference in New Issue
Block a user