feat: Ajuste Fino Redesenho in the cart (Marcus 12/11, slice R1)
Under each art the Prumo warns about, the customer can choose Ajuste Fino or Ajuste Fino Redesenho (vectorize or redraw, per art, +48 h, no batch price). It is a disabled product until Gestão prices it in the Site tab; the server charges it per chosen art, Tiny gets a DTFIMP.AJF.RED line and two more business days, the card shows 'Redesenho · N artes' and the designer gate applies. The preview loop is slice R2. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -483,8 +483,9 @@ function avisosDaFolha(a,nome,i,aceito,aceitavel=false){
|
||||
'usou e envie de novo. '+(varios?'Os círculos vermelhos na prévia mostram onde estão.':'O círculo vermelho na prévia mostra onde está.')+
|
||||
(aceitavel?' Se '+(varios?'os pontos são':'o ponto é')+' da própria arte, marque abaixo.</p>'+aceite:'</p>');
|
||||
}
|
||||
// Ajuste Fino (front 1a): under a Prumo warning, the customer may hand this
|
||||
// art to the designer. One choice per art; the cart has the general switch.
|
||||
// Ajuste Fino (front 1a) and Ajuste Fino Redesenho (front 1b): under a Prumo
|
||||
// warning, the customer may hand this art to the designer. One service per
|
||||
// art, chosen radio-like; the cart has the general switch for the basic one.
|
||||
function temAvisoFolha(x){
|
||||
const a=x.an;
|
||||
if(!a || a.grande) return false;
|
||||
@@ -498,11 +499,25 @@ function temAvisoArte(a){
|
||||
(typeof mista==='function' && mista(tracoDaArte(a))));
|
||||
}
|
||||
function ajusteLinha(i,attr){
|
||||
if(!(TAXA_TRATAMENTO>0)) return '';
|
||||
const marcado=ajusteTudo || (attr==='data-ajuste' ? folhas[i].ajuste : artes[i].ajuste);
|
||||
return '<label class="aceiteRes ajusteArte"><input type="checkbox" '+attr+'="'+i+'"'+
|
||||
(marcado?' checked':'')+'>'+
|
||||
'<span>Quer que um designer resolva? <b>Ajuste Fino</b> — '+rs(TAXA_TRATAMENTO)+'</span></label>';
|
||||
const folha=attr==='data-ajuste';
|
||||
const x=folha?folhas[i]:artes[i];
|
||||
const basico=TAXA_TRATAMENTO>0, redesenhado=TAXA_REDESENHO>0;
|
||||
if(!basico && !redesenhado) return '';
|
||||
let linha='';
|
||||
if(basico){
|
||||
const marcado=ajusteTudo || !!x.ajuste;
|
||||
linha+='<label class="aceiteRes ajusteArte"><input type="checkbox" '+attr+'="'+i+'"'+
|
||||
(marcado?' checked':'')+'>'+
|
||||
'<span>Quer que um designer resolva? <b>Ajuste Fino</b> — '+rs(TAXA_TRATAMENTO)+'</span></label>';
|
||||
}
|
||||
if(redesenhado){
|
||||
const attrRedesenhado=folha?'data-redesenho':'data-redesenhoa';
|
||||
linha+='<label class="aceiteRes ajusteArte"><input type="checkbox" '+attrRedesenhado+'="'+i+'"'+
|
||||
(x.redesenho?' checked':'')+'>'+
|
||||
'<span>Precisa redesenhar ou vetorizar? <b>Ajuste Fino Redesenho</b> — '+rs(TAXA_REDESENHO)+
|
||||
' (com prévia, +48 h)</span></label>';
|
||||
}
|
||||
return linha;
|
||||
}
|
||||
function detalhesDaFolha(a,i,aberto){
|
||||
const linhas = a.grande
|
||||
@@ -612,7 +627,16 @@ function pintaFolha(){
|
||||
}));
|
||||
$('lista').querySelectorAll('[data-ajuste]').forEach(el=>el.addEventListener('change',()=>{
|
||||
if(ajusteTudo) materializaAjuste();
|
||||
folhas[+el.dataset.ajuste].ajuste=el.checked;
|
||||
const x=folhas[+el.dataset.ajuste];
|
||||
x.ajuste=el.checked;
|
||||
if(el.checked) x.redesenho=false;
|
||||
pintaFolha(); pintaPedido();
|
||||
}));
|
||||
$('lista').querySelectorAll('[data-redesenho]').forEach(el=>el.addEventListener('change',()=>{
|
||||
if(ajusteTudo) materializaAjuste();
|
||||
const x=folhas[+el.dataset.redesenho];
|
||||
x.redesenho=el.checked;
|
||||
if(el.checked) x.ajuste=false;
|
||||
pintaFolha(); pintaPedido();
|
||||
}));
|
||||
$('lista').querySelectorAll('[data-det]').forEach(d=>d.addEventListener('toggle',()=>{
|
||||
@@ -745,7 +769,16 @@ function pintaArtes(){
|
||||
artes[+el.dataset.residuoa].residuoAceito=el.checked; pintaArtes();}));
|
||||
$('lista').querySelectorAll('[data-ajustea]').forEach(el=>el.addEventListener('change',()=>{
|
||||
if(ajusteTudo) materializaAjuste();
|
||||
artes[+el.dataset.ajustea].ajuste=el.checked;
|
||||
const a=artes[+el.dataset.ajustea];
|
||||
a.ajuste=el.checked;
|
||||
if(el.checked) a.redesenho=false;
|
||||
pintaArtes(); pintaPedido();
|
||||
}));
|
||||
$('lista').querySelectorAll('[data-redesenhoa]').forEach(el=>el.addEventListener('change',()=>{
|
||||
if(ajusteTudo) materializaAjuste();
|
||||
const a=artes[+el.dataset.redesenhoa];
|
||||
a.redesenho=el.checked;
|
||||
if(el.checked) a.ajuste=false;
|
||||
pintaArtes(); pintaPedido();
|
||||
}));
|
||||
$('lista').querySelectorAll('[data-cm]').forEach(i=>i.addEventListener('change',()=>{artes[+i.dataset.cm].cm=+i.value||0;pintaArtes();}));
|
||||
|
||||
Reference in New Issue
Block a user