mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminado y arreglado otros bugs
This commit is contained in:
@ -178,6 +178,13 @@ $('#btnBack').on('click', function() {
|
||||
});
|
||||
|
||||
function finalizarPresupuesto(confirmar){
|
||||
|
||||
let isColor = false;
|
||||
if($('#colorColorDiv').hasClass('checked') || $('#colorColorHqDiv').hasClass('checked'))
|
||||
isColor = true;
|
||||
let isHq = false;
|
||||
if($('#colorNegroDiv').hasClass('checked') || $('#colorColorHqDiv').hasClass('checked'))
|
||||
isHq = true;
|
||||
|
||||
const paths = window.location.pathname.split("/").filter(path => path !== "");
|
||||
let id=0;
|
||||
@ -197,8 +204,8 @@ function finalizarPresupuesto(confirmar){
|
||||
paginasColor: $('#paginasColor').val(),
|
||||
tipo: $('.custom-option-tipo.checked').attr('id').replace('Div', ''),
|
||||
tapa: $('#tapaDura').is(':checked') ? 'dura' : 'blanda',
|
||||
isColor: $('#colorNegroDiv').hasClass('checked') ? 0 : 1,
|
||||
isHq: $('#calidadEstandarDiv').hasClass('checked') ? 0 : 1,
|
||||
isColor: isColor,
|
||||
isHq: isHq,
|
||||
papelInterior: $('#papelInterior option:selected').val(),
|
||||
papelInteriorNombre: $('#papelInterior option:selected').text().trim(),
|
||||
gramajeInterior: $('#gramajeInterior option:selected').text(),
|
||||
@ -283,6 +290,7 @@ function finalizarPresupuesto(confirmar){
|
||||
|
||||
if(Object.keys(response).length > 0) {
|
||||
if(response.status > 0){
|
||||
if(confirmar || window.location.href.includes("add"))
|
||||
window.location.href = response.url + '/' + response.status;
|
||||
}
|
||||
|
||||
|
||||
@ -50,13 +50,21 @@
|
||||
|
||||
const lastColNr = $('#tableOfPresupuestos').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `
|
||||
<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
||||
</div>
|
||||
</td>`;
|
||||
if(data.estado == 'borrador')
|
||||
return `
|
||||
<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
||||
</div>
|
||||
</td>`;
|
||||
else
|
||||
return `
|
||||
<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
|
||||
// Setup - add a text input to each footer cell
|
||||
|
||||
@ -51,13 +51,23 @@
|
||||
|
||||
const lastColNr = $('#tableOfPresupuestos').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `
|
||||
<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
||||
</div>
|
||||
</td>`;
|
||||
if (data.estado == 'aceptado') {
|
||||
return `
|
||||
<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
</div>
|
||||
</td>`;
|
||||
}
|
||||
else{
|
||||
return `
|
||||
<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
||||
</div>
|
||||
</td>`;
|
||||
}
|
||||
};
|
||||
|
||||
// Setup - add a text input to each footer cell
|
||||
|
||||
Reference in New Issue
Block a user