trabajando en editar plantillas

This commit is contained in:
2024-12-04 12:34:10 +01:00
parent 3fb37af0f8
commit a7cda851f0
15 changed files with 1024 additions and 520 deletions

View File

@ -880,74 +880,6 @@ $(document).on('click', '.btn-remove', function(e) {
<?=$this->endSection() ?>
<?= $this->section("additionalInlineJs") ?>
/**************************************
Tarifas cliente
***************************************/
/*
$('#plantillas').select2({
allowClear: false,
ajax: {
url: '<?= route_to("menuItemsOfClienteplantillaprecios") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
id: 'id',
text: 'nombre',
searchTerm: params.term,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
$('#plantillas').on('change.select2', function(){
const data = $('#plantillas').select2('data');
if(data.length>0){
const domain = window.location.origin
fetch(domain + "/clientes/clienteprecios/update/" + id , {
method: "POST",
body: JSON.stringify({
plantilla_id: data[0].id,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
}),
headers: {
"Content-type": "application/json; charset=UTF-8"
}
}).then(function(){
theTablePrecios.clearPipeline();
theTablePrecios.draw();
})
}
});
$('#convert2template').on('click', function(){
var newAddDialog = $('#convert2Template')
newAddDialog.modal("show");
})
<?= $this->endSection() ?>
<?= $this->section("additionalInlineJs") ?>
/****************************************
Direcciones cliente