mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminado edit
This commit is contained in:
@ -116,7 +116,11 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row" id="div_solapas_ancho" style="display:none;">
|
||||
<?php if($presupuestoEntity->solapas == true): ?>
|
||||
<div class="row" id="div_solapas_ancho">
|
||||
<?php else: ?>
|
||||
<div class="row" id="div_solapas_ancho" style="display:none;">
|
||||
<?php endif; ?>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="solapas_ancho" class="form-label">
|
||||
|
||||
@ -13,6 +13,8 @@
|
||||
<div id="divAlarmasComparador"></div>
|
||||
<!----------------------------------------------------------------------------->
|
||||
|
||||
<input type="hidden" name="comparador_json_data" id="comparador_json_data" class="form-control" value="<?= isset($presupuestoEntity->comparador_json_data)?$presupuestoEntity->comparador_json_data:'' ?>"></input>
|
||||
|
||||
<div class="divider divider-dark text-start mb-1">
|
||||
<div class="divider-text">
|
||||
<h5><?= lang("Presupuestos.tipoImpresion") ?></h5>
|
||||
@ -20,17 +22,17 @@
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-3 px-4 mt-1">
|
||||
<div class="mb-3">
|
||||
<select id="tipoImpresion" name="tipo_impresion" class="form-control select2bs2" style="width: 100%;">
|
||||
<option id="tipoImpresionNegro" value="negro" <?= isset($presupuestoEntity->comparador_json_data) ? ("negro" == $presupuestoEntity->comparador_json_data->tipo_impresion ? ' selected' : '') : '' ?>>
|
||||
<select id="tipoImpresion" name="comp_tipo_impresion" class="form-control select2bs2" style="width: 100%;">
|
||||
<option id="tipoImpresionNegro" value="negro" <?= isset($presupuestoEntity->comp_tipo_impresion) ? ("negro" == $presupuestoEntity->comp_tipo_impresion ? ' selected' : '') : '' ?>>
|
||||
<?= lang('MaquinasTarifasImpresions.negro') ?>
|
||||
</option>
|
||||
<option value="negrohq" <?= isset($presupuestoEntity->comparador_json_data) ? ("negrohq" == $presupuestoEntity->comparador_json_data->tipo_impresion ? ' selected' : '') : '' ?>>
|
||||
<option value="negrohq" <?= isset($presupuestoEntity->comp_tipo_impresion) ? ("negrohq" == $presupuestoEntity->comp_tipo_impresion ? ' selected' : '') : '' ?>>
|
||||
<?= lang('MaquinasTarifasImpresions.negrohq') ?>
|
||||
</option>
|
||||
<option value="color" <?= isset($presupuestoEntity->comparador_json_data) ? ("color" == $presupuestoEntity->comparador_json_data->tipo_impresion ? ' selected' : '') : '' ?>>
|
||||
<option value="color" <?= isset($presupuestoEntity->comp_tipo_impresion) ? ("color" == $presupuestoEntity->comp_tipo_impresion ? ' selected' : '') : '' ?>>
|
||||
<?= lang('MaquinasTarifasImpresions.color') ?>
|
||||
</option>
|
||||
<option value="colorhq" <?= isset($presupuestoEntity->comparador_json_data) ? ("colorhq" == $presupuestoEntity->comparador_json_data->tipo_impresion ? ' selected' : '') : '' ?>>
|
||||
<option value="colorhq" <?= isset($presupuestoEntity->comp_tipo_impresion) ? ("colorhq" == $presupuestoEntity->comp_tipo_impresion ? ' selected' : '') : '' ?>>
|
||||
<?= lang('MaquinasTarifasImpresions.colorhq') ?>
|
||||
</option>
|
||||
</select>
|
||||
@ -72,10 +74,10 @@
|
||||
<p><?= lang('MaquinasTarifasImpresions.negro') ?></p>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<input type="text" id="compPaginasNegro" name="comp_paginas_negro" placeholder="0" maxLength="5" class="form-control comp_negro_items" value="<?= isset($presupuestoEntity->comparador_json_data->negro) ? (old(0, $presupuestoEntity->comparador_json_data->negro->paginas)) : '0' ?>">
|
||||
<input type="text" id="compPaginasNegro" name="comp_paginas_negro" placeholder="0" maxLength="5" class="form-control comp_negro_items" value="<?= isset($comp_data->bn->paginas) ? (old(0, $comp_data->bn->paginas)) : '0' ?>">
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<select id="compPapelNegro" name="comp_papel_negro" class="form-control select2bs2" style="width: 100%;">
|
||||
<select id="compPapelNegro" name="comp_papel_negro" class="form-control select2bs2 comp_negro_items" style="width: 100%;">
|
||||
<?php if (isset($papelGenericoNegroList) && is_array($papelGenericoNegroList) && !empty($papelGenericoNegroList)) :
|
||||
foreach ($papelGenericoNegroList as $k => $v) : ?>
|
||||
<option value="<?= $v->id ?>">
|
||||
@ -100,7 +102,7 @@
|
||||
<p><?= lang('MaquinasTarifasImpresions.negrohq') ?></p>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<input type="text" id="compPaginasNegrohq" name="comp_paginas_negrohq" placeholder="0" maxLength="5" class="form-control comp_negrohq_items" value="<?= isset($presupuestoEntity->comparador_json_data->negro) ? (old(0, $presupuestoEntity->comparador_json_data->negro->paginas)) : '0' ?>">
|
||||
<input type="text" id="compPaginasNegrohq" name="comp_paginas_negrohq" placeholder="0" maxLength="5" class="form-control comp_negrohq_items" value="<?= isset($comp_data->bnhq->paginas) ? (old(0, $comp_data->bnhq->paginas)) : '0' ?>">
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<select id="compPapelNegrohq" name="comp_papel_negrohq" class="form-control select2bs2 comp_negrohq_items" style="width: 100%;">
|
||||
@ -128,7 +130,7 @@
|
||||
<p><?= lang('MaquinasTarifasImpresions.color') ?></p>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<input type="text" id="compPaginasColor" name="comp_paginas_color" placeholder="0" maxLength="5" class="form-control comp_color_items" value="<?= isset($presupuestoEntity->comparador_json_data->color) ? (old(0, $presupuestoEntity->comparador_json_data->color->paginas)) : '0' ?>">
|
||||
<input type="text" id="compPaginasColor" name="comp_paginas_color" placeholder="0" maxLength="5" class="form-control comp_color_items" value="<?= isset($comp_data->color->paginas) ? (old(0, $comp_data->color->paginas)) : '0' ?>">
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<select id="compPapelColor" name="comp_papel_color" class="form-control select2bs2 comp_color_items" style="width: 100%;">
|
||||
@ -156,7 +158,7 @@
|
||||
<p><?= lang('MaquinasTarifasImpresions.colorhq') ?></p>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<input type="text" id="compPaginasColorhq" name="comp_paginas_colorhq" placeholder="0" maxLength="5" class="form-control comp_colorhq_items" value="<?= isset($presupuestoEntity->comparador_json_data->color) ? (old(0, $presupuestoEntity->comparador_json_data->color->paginas)) : '0' ?>">
|
||||
<input type="text" id="compPaginasColorhq" name="comp_paginas_colorhq" placeholder="0" maxLength="5" class="form-control comp_colorhq_items" value="<?= isset($comp_data->colorhq->paginas) ? (old(0, $comp_data->colorhq->paginas)) : '0' ?>">
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<select id="compPapelColorhq" name="comp_papel_colorhq" class="form-control select2bs2 comp_colorhq_items" style="width: 100%;">
|
||||
@ -227,7 +229,7 @@
|
||||
<label for="compPosPaginasColor" class="form-label">
|
||||
<?= lang('Presupuestos.posicionPagColor') ?>
|
||||
</label>
|
||||
<input type="text" id="compPosPaginasColor" name="comp_pos_paginas_color" maxLength="20" class="form-control" value="<?= isset($presupuestoEntity->comparador_json_data->color->pospaginas) ? (old('', $presupuestoEntity->comparador_json_data->color->pospaginas)) : '' ?>">
|
||||
<input type="text" id="compPosPaginasColor" name="comp_pos_paginas_color" maxLength="20" class="form-control" value="<?= isset($presupuestoEntity->comp_pos_paginas_color) ? (old('', $presupuestoEntity->comp_pos_paginas_color)) : '' ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
<div class="col-md-12 col-lg-8 px-4">
|
||||
@ -434,8 +436,152 @@
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
autosize($('#compCalPaginasColor'));
|
||||
|
||||
function init_comparador() {
|
||||
$('#tipoImpresion').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compPapelNegro').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compGramajeNegro').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compPapelNegrohq').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compGramajeNegrohq').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compPapelColor').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compPapelColorhq').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compGramajeColor').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compGramajeColorhq').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compPapelCubierta').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compGramajeCubierta').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#encuadernacion').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compCarasCubierta').select2({
|
||||
allowClear: false,
|
||||
minimumResultsForSearch: Infinity,
|
||||
});
|
||||
|
||||
$('#papelFormatoId').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
updatePapelesComparador();
|
||||
const paginasColor = document.getElementById('compCalPaginasColor');
|
||||
if (paginasColor.value.length > 0) {
|
||||
computarPaginasColor(paginasColor.value);
|
||||
}
|
||||
|
||||
var comp_data = <?php echo json_encode($comp_data); ?>
|
||||
|
||||
try{
|
||||
$("#compPapelNegro").val(parseInt(comp_data.bn.papel_id)).trigger('change');
|
||||
|
||||
try{
|
||||
var newState = new Option(comp_data.bn.gramaje, comp_data.bn.gramaje, true, true);
|
||||
// Append it to the select
|
||||
$("#compGramajeNegro").append(newState).trigger('change');
|
||||
$('#compGramajeNegro').prop('disabled', false);
|
||||
}catch(e){}
|
||||
}catch(e){}
|
||||
|
||||
try{
|
||||
$("#compPapelNegrohq").val(parseInt(comp_data.bnhq.papel_id)).trigger('change');
|
||||
|
||||
try{
|
||||
var newState = new Option(comp_data.bnhq.gramaje, comp_data.bnhq.gramaje, true, true);
|
||||
// Append it to the select
|
||||
$("#compGramajeNegrohq").append(newState).trigger('change');
|
||||
$('#compGramajeNegrohq').prop('disabled', false);
|
||||
}catch(e){}
|
||||
}catch(e){}
|
||||
|
||||
try{
|
||||
$("#compPapelColor").val(parseInt(comp_data.color.papel_id)).trigger('change');
|
||||
|
||||
try{
|
||||
var newState = new Option(comp_data.color.gramaje, comp_data.color.gramaje, true, true);
|
||||
// Append it to the select
|
||||
$("#compGramajeColor").append(newState).trigger('change');
|
||||
$('#compGramajeColor').prop('disabled', false);
|
||||
}catch(e){}
|
||||
}catch(e){}
|
||||
|
||||
try{
|
||||
$("#compPapelColorhq").val(parseInt(comp_data.colorhq.papel_id)).trigger('change');
|
||||
|
||||
try{
|
||||
var newState = new Option(comp_data.colorhq.gramaje, comp_data.colorhq.gramaje, true, true);
|
||||
// Append it to the select
|
||||
$("#compGramajeColorhq").append(newState).trigger('change');
|
||||
$('#compGramajeColorhq').prop('disabled', false);
|
||||
}catch(e){}
|
||||
}catch(e){}
|
||||
|
||||
try{
|
||||
$("#compCarasCubierta").val(parseInt(comp_data.cubierta.paginas)).trigger('select2:select');
|
||||
try{
|
||||
$("#compPapelCubierta").val(parseInt(comp_data.cubierta.papel_id)).trigger('select2:select');
|
||||
|
||||
try{
|
||||
var newState = new Option(comp_data.cubierta.gramaje, comp_data.cubierta.gramaje, true, true);
|
||||
// Append it to the select
|
||||
$("#compGramajeCubierta").append(newState).trigger('change');
|
||||
$('#compGramajeCubierta').prop('disabled', false);
|
||||
}catch(e){}
|
||||
}catch(e){}
|
||||
}catch(e){}
|
||||
|
||||
var timp = '<?php echo $presupuestoEntity->comp_tipo_impresion; ?>'
|
||||
switch(timp){
|
||||
case 'negro':
|
||||
checkComparadorInt(false,false)
|
||||
break;
|
||||
case 'negrohq':
|
||||
checkComparadorInt(false,true)
|
||||
break;
|
||||
case 'color':
|
||||
checkComparadorInt(true,false)
|
||||
break;
|
||||
case 'colorhq':
|
||||
checkComparadorInt(true,true)
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
computarPaginasColor($('#compPosPaginasColor').val());
|
||||
|
||||
init_comparador();
|
||||
}
|
||||
|
||||
var tableCompIntPlana = new DataTable('#tableCompIntPlana',{
|
||||
scrollX: true,
|
||||
@ -1036,40 +1182,47 @@
|
||||
|
||||
function checkComparadorInt(is_color, is_hq) {
|
||||
|
||||
clearIntLineas(is_color);
|
||||
clearIntRot();
|
||||
$('#title_int_rot').html('<?= lang("Presupuestos.compInteriorRotativa") ?>');
|
||||
$('#title_int_plana').html('<?= lang("Presupuestos.compInteriorPlana") ?>');
|
||||
|
||||
elementos = getIDsComparador(is_color, is_hq)
|
||||
try{
|
||||
|
||||
clearIntLineas(is_color);
|
||||
clearIntRot();
|
||||
$('#title_int_rot').html('<?= lang("Presupuestos.compInteriorRotativa") ?>');
|
||||
$('#title_int_plana').html('<?= lang("Presupuestos.compInteriorPlana") ?>');
|
||||
|
||||
elementos = getIDsComparador(is_color, is_hq)
|
||||
|
||||
if ($(''+ elementos.papel).select2('data').length > 0 &&
|
||||
$(''+ elementos.gramaje).select2('data').length > 0 &&
|
||||
parseInt($(''+ elementos.paginas).val()) > 0 &&
|
||||
checkDatosPedidoForComp()) {
|
||||
if ($(''+ elementos.papel).select2('data').length > 0 &&
|
||||
$(''+ elementos.gramaje).select2('data').length > 0 &&
|
||||
parseInt($(''+ elementos.paginas).val()) > 0 &&
|
||||
checkDatosPedidoForComp()) {
|
||||
|
||||
getLineasIntPlana(is_color, is_hq).then((result) =>{
|
||||
// Para rotativa, si es color el papel y el gramaje tiene que ser igual
|
||||
if(!is_color)
|
||||
{
|
||||
getLineasIntRot(is_hq);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!is_hq){
|
||||
if(($('#compPapelNegro').select2('data')[0].id == $('#compPapelColor').select2('data')[0].id &&
|
||||
$('#compGramajeNegro').select2('data')[0].text.trim() == $('#compGramajeColor').select2('data')[0].text.trim()))
|
||||
{
|
||||
getLineasIntRot(is_hq);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#errorComRot').html('<?= lang("Presupuestos.errores.errorRotColor") ?>');
|
||||
getLineasIntPlana(is_color, is_hq).then((result) =>{
|
||||
// Para rotativa, si es color el papel y el gramaje tiene que ser igual
|
||||
if(!is_color)
|
||||
{
|
||||
getLineasIntRot(is_hq);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!is_hq){
|
||||
if ($('#compPapelNegro').select2('data')>0 && $('#compPapelColor').select2('data')>0 &&
|
||||
$('#compGramajeNegro').select2('data')>0 && $('#compGramajeColor').select2('data')>0)
|
||||
{
|
||||
if(($('#compPapelNegro').select2('data')[0].id == $('#compPapelColor').select2('data')[0].id &&
|
||||
$('#compGramajeNegro').select2('data')[0].text.trim() == $('#compGramajeColor').select2('data')[0].text.trim()))
|
||||
{
|
||||
getLineasIntRot(is_hq);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#errorComRot').html('<?= lang("Presupuestos.errores.errorRotColor") ?>');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}catch(e){}
|
||||
}
|
||||
|
||||
|
||||
@ -1314,4 +1467,6 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
init_comparador();
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@ -25,7 +25,11 @@
|
||||
<label for="created_at" class="form-label">
|
||||
<?= lang('Presupuestos.created_at') ?>
|
||||
</label>
|
||||
<input readonly style="background: #E8E8E8;" id="created_at" name="created_at" maxLength="12" class="form-control" value="<?= old('created_at', (isset($presupuestoEntity->created_at)) ? $presupuestoEntity->created_at : date("d/m/Y")) ?>">
|
||||
<?php if(str_contains($formAction,'edit')): ?>
|
||||
<input readonly style="background: #E8E8E8;" id="updated_at" name="updated_at" maxLength="12" class="form-control" value="<?= old('created_at', (isset($presupuestoEntity->updated_at)) ? date ('d/m/Y', strtotime($presupuestoEntity->updated_at)) : "") ?>">
|
||||
<?php else: ?>
|
||||
<input readonly style="background: #E8E8E8;" id="created_at" name="created_at" maxLength="12" class="form-control" value="<?= old('created_at', (isset($presupuestoEntity->created_at)) ? date ('d/m/Y', strtotime($presupuestoEntity->created_at)) : "") ?>">
|
||||
<?php endif; ?>
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
@ -2959,7 +2959,6 @@ function fill_lp_from_bbdd(){
|
||||
|
||||
if(lp.tipo == 'rot_bn' ||lp.tipo == 'rot_color'){
|
||||
|
||||
console.log(lp)
|
||||
$('#lp_' + lp.tipo + '_numPagColor').val(isNaN(parseFloat(lp.rotativa_pag_color)) ? "" : parseFloat(lp.rotativa_pag_color).toFixed(0))
|
||||
$('#lp_' + lp.tipo + '_totalLinea').val(isNaN(parseFloat(lp.rotativa_total_impresion)) ? "" : parseFloat(lp.rotativa_total_impresion).toFixed(2))
|
||||
$('#lp_' + lp.tipo + '_aFavorFibra').prop('checked', lp.rotativa_a_favor_fibra==0?false:true)
|
||||
@ -3130,6 +3129,9 @@ async function fill_bbdd_from_lp(presupuesto_id){
|
||||
token=response.<?= csrf_token() ?>;
|
||||
yeniden(token);
|
||||
}
|
||||
}).fail(function (jqXHR, textStatus, error) {
|
||||
// Handle error here
|
||||
console.log(jqXHR)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -218,15 +218,6 @@ function getRowFromLineaRot(linea) {
|
||||
|
||||
|
||||
|
||||
function init_comparador() {
|
||||
updatePapelesComparador();
|
||||
const paginasColor = document.getElementById('compCalPaginasColor');
|
||||
if (paginasColor.value.length > 0) {
|
||||
computarPaginasColor(paginasColor.value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function computarPaginasColor(string) {
|
||||
|
||||
var numbers = [];
|
||||
@ -575,3 +566,97 @@ function clearCompTable(){
|
||||
$('#total_comp_plana').html('0.00')
|
||||
$('#total_comp_rot').html('0.00')
|
||||
}
|
||||
|
||||
function generateCompJSON(){
|
||||
|
||||
data = {}
|
||||
|
||||
if( $('#tipoImpresion').select2('data')[0].id == 'negro' || $('#tipoImpresion').select2('data')[0].id == 'color')
|
||||
{
|
||||
try{
|
||||
bn_obj = {
|
||||
"bn":{
|
||||
'paginas': $('#compPaginasNegro').val(),
|
||||
'papel_id': $('#compPapelNegro').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeNegro').select2('data')[0].text.trim(),
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e){
|
||||
bn_obj = {}
|
||||
}
|
||||
$.extend( data, bn_obj );
|
||||
}
|
||||
|
||||
if( $('#tipoImpresion').select2('data')[0].id == 'negrohq' || $('#tipoImpresion').select2('data')[0].id == 'colorhq')
|
||||
{
|
||||
try{
|
||||
bnhq_obj = {
|
||||
"bnhq":{
|
||||
'paginas': $('#compPaginasNegrohq').val(),
|
||||
'papel_id': $('#compPapelNegrohq').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeNegrohq').select2('data')[0].text.trim(),
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e){
|
||||
bnhq_obj = {}
|
||||
}
|
||||
$.extend( data, bnhq_obj );
|
||||
}
|
||||
|
||||
if($('#tipoImpresion').select2('data')[0].id == 'color')
|
||||
{
|
||||
try{
|
||||
color_obj = {
|
||||
"color":{
|
||||
'paginas': $('#compPaginasColor').val(),
|
||||
'papel_id': $('#compPapelColor').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeColor').select2('data')[0].text.trim(),
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e){
|
||||
color_obj = {}
|
||||
}
|
||||
$.extend( data, color_obj );
|
||||
|
||||
}
|
||||
|
||||
|
||||
if($('#tipoImpresion').select2('data')[0].id == 'colorhq')
|
||||
{
|
||||
try{
|
||||
colorhq_obj = {
|
||||
"colorhq":{
|
||||
'paginas': $('#compPaginasColorhq').val(),
|
||||
'papel_id': $('#compPapelColorhq').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeColorhq').select2('data')[0].text.trim(),
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e){
|
||||
colorhq_obj = {}
|
||||
}
|
||||
$.extend( data, colorhq_obj );
|
||||
}
|
||||
|
||||
|
||||
try{
|
||||
cubierta_obj = {
|
||||
"cubierta":{
|
||||
'paginas': $('#compCarasCubierta').select2('data')[0].id,
|
||||
'papel_id': $('#compPapelCubierta').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeCubierta').select2('data')[0].text.trim(),
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e){
|
||||
cubierta_obj = {}
|
||||
}
|
||||
|
||||
$.extend( data, cubierta_obj );
|
||||
|
||||
data_str = JSON.stringify(data)
|
||||
$('#comparador_json_data').val(data_str)
|
||||
}
|
||||
@ -92,65 +92,6 @@
|
||||
});
|
||||
|
||||
|
||||
<?php if(str_contains($formAction,'edit')): ?>
|
||||
$('#papelFormatoId').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#tipoImpresion').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compPapelNegro').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compGramajeNegro').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compPapelNegrohq').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compGramajeNegrohq').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compPapelColor').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compPapelColorhq').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compGramajeColor').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compGramajeColorhq').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compPapelCubierta').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compGramajeCubierta').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#encuadernacion').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compCarasCubierta').select2({
|
||||
allowClear: false,
|
||||
minimumResultsForSearch: Infinity,
|
||||
});
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
@ -172,16 +113,20 @@ else{
|
||||
$('#presupuestoForm').on( "submit", function( event ) {
|
||||
event.preventDefault();
|
||||
$.when(fill_bbdd_from_lp(id).then(function (data, textStatus, jqXHR){
|
||||
generateCompJSON()
|
||||
form = $('#presupuestoForm').serialize()
|
||||
/*$.ajax({
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<?php echo $formAction; ?>",
|
||||
data: form,
|
||||
done: function (data) {
|
||||
yeniden(data.<?= csrf_token() ?>);
|
||||
console.log(data);
|
||||
success: function (data) {
|
||||
yeniden(data.<?= csrf_token() ?>)
|
||||
popSuccessAlert(data.mensaje)
|
||||
}
|
||||
});*/
|
||||
}).fail(function (jqXHR, textStatus, error) {
|
||||
// Handle error here
|
||||
console.log(jqXHR)
|
||||
});;
|
||||
}))
|
||||
|
||||
return false; //stop the actual form post !important!
|
||||
|
||||
Reference in New Issue
Block a user