mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
añadida posibilidad de guardas negrohq
This commit is contained in:
@ -305,7 +305,7 @@ class PresupuestoAdminEdit {
|
||||
|
||||
if (self.cargandoPresupuesto == false) {
|
||||
|
||||
self.comparador.updateComparador();
|
||||
//self.comparador.updateComparador();
|
||||
|
||||
// Ejecutar los pasos de forma secuencial si están habilitados
|
||||
if (update_lineas) {
|
||||
|
||||
@ -544,7 +544,7 @@ class Comparador {
|
||||
this.gramajeSobrecubierta.setOption(datos.json_data.sobrecubierta.gramaje, datos.json_data.sobrecubierta.gramaje);
|
||||
}
|
||||
if (datos.json_data.guardas) {
|
||||
this.carasGuardas.val(datos.json_data.guardas.paginas_impresion).trigger('change');
|
||||
this.carasGuardas.val(datos.json_data.guardas.paginas).trigger('change');
|
||||
this.papelGuardas.setOption(datos.json_data.guardas.papel_id, datos.json_data.guardas.papel_nombre);
|
||||
this.gramajeGuardas.setOption(datos.json_data.guardas.gramaje, datos.json_data.guardas.gramaje);
|
||||
}
|
||||
@ -1023,8 +1023,10 @@ class Comparador {
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.cargando)
|
||||
if (!this.cargando){
|
||||
$('#paginas').trigger('change');
|
||||
this.updateComparador();
|
||||
}
|
||||
}
|
||||
|
||||
getDataForComp(uso = 'interior') {
|
||||
@ -1891,7 +1893,7 @@ class Comparador {
|
||||
try {
|
||||
guardas_obj = {
|
||||
"guardas": {
|
||||
'paginas_impresion': $('#compCarasGuardas option:selected').val(),
|
||||
'paginas': $('#compCarasGuardas option:selected').val(),
|
||||
'papel_id': $('#compPapelGuardas').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeGuardas').select2('data')[0].text.trim(),
|
||||
},
|
||||
|
||||
@ -1507,6 +1507,21 @@ class LineasPresupuesto {
|
||||
if (linea == 'lp_bn' || linea == 'lp_bnhq' || linea == 'lp_rot_bn') {
|
||||
color = 0;
|
||||
}
|
||||
else if(linea == 'lp_guardas'){
|
||||
if(fromComparador){
|
||||
color = $('#tipoImpresion').val().includes('color') ? 1 : 0;
|
||||
}
|
||||
else{
|
||||
for (let i = 0; i < this.table.rows().data().length; i++) {
|
||||
let row = this.table.row(i).data();
|
||||
if (row.row_id == 'lp_color' || row.row_id == 'lp_colorhq' || row.row_id == 'lp_rot_color') {
|
||||
color = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
color = 0;
|
||||
}
|
||||
}
|
||||
let hq = 1;
|
||||
if (linea == 'lp_bn' || linea == 'lp_color' || linea == 'lp_rot_bn' || linea == 'lp_rot_color') {
|
||||
hq = 0;
|
||||
@ -1723,12 +1738,21 @@ class LineasPresupuesto {
|
||||
tipo = 'color';
|
||||
break;
|
||||
case 'lp_colorhq':
|
||||
case 'lp_guardas':
|
||||
case 'lp_cubierta':
|
||||
case 'lp_sobrecubierta':
|
||||
case 'lp_faja':
|
||||
tipo = 'colorhq';
|
||||
break
|
||||
case 'lp_guardas':
|
||||
tipo = 'negrohq';
|
||||
for (let i = 0; i < this.table.rows().data().length; i++) {
|
||||
let row = this.table.row(i).data();
|
||||
if (row.row_id == 'lp_color' || row.row_id == 'lp_colorhq' || row.row_id == 'lp_rot_color') {
|
||||
tipo = 'colorhq';
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1789,7 +1813,7 @@ class LineasPresupuesto {
|
||||
papel_impresion.init();
|
||||
|
||||
let merma = uso == 'interior' ? $('#merma').val() : $('#mermacubierta').val();
|
||||
uso = ((uso == 'guardas') ? 'cubierta' : uso);
|
||||
uso = ((uso == 'guardas') ? 'interior' : uso);
|
||||
|
||||
let maquinas = new ClassSelect($('#' + tipoLinea + '_maquina'),
|
||||
'/presupuestoadmin/maquinas', 'Seleccione maquina', false,
|
||||
|
||||
Reference in New Issue
Block a user