Update 2022-03-07

This commit is contained in:
Aldarien
2022-03-07 12:42:34 +00:00
parent 67efd83ae3
commit abe01e5592
14 changed files with 243 additions and 251 deletions

View File

@ -257,14 +257,33 @@ function changeProyecto() {
});
$('#unidades').show();
});
$.post('{!!url('', ['p' => 'ajax', 'a' => 'operadores', 'ajax' => true])!!}', {"proyecto": proyecto}, function(data) {
var operadores = $("select[name='operador']");
operadores.html('').append($('<option></option>').attr('value', 0).html('---'));
var info = $.parseJSON(data);
$.each(info, function(i, e) {
operadores.append($('<option></option>').attr('value', e.id).html(e.abreviacion));
});
$.ajax({
url: 'https://provm.cl:8001/proyecto/' + proyecto + '/operadores',
method: 'get',
dataType: 'json'
}).then(function(data) {
var operadoress = $("select[name='operador']");
operadores.html('').append($('<option></option>').attr('value', 0).html('---'));
$.each(data.operadores, function(i, e) {
operadores.append($('<option></option>').attr('value', e.id).html(e.operador.abreviacion));
});
});
/*$.getJSON('http://provm.cl:8001/proyecto/' + proyecto + '/operadores', function(data) {
var operadores = $("select[name='operador']");
operadores.html('').append($('<option></option>').attr('value', 0).html('---'));
$.each(data.operadores, function(i, e) {
operadores.append($('<option></option>').attr('value', e.id).html(e.operador.abreviacion));
});
});
$.post('{!!url('', ['p' => 'ajax', 'a' => 'operadores', 'ajax' => true])!!}', {"proyecto": proyecto}, function(data) {
var operadores = $("select[name='operador']");
operadores.html('').append($('<option></option>').attr('value', 0).html('---'));
var info = $.parseJSON(data);
$.each(info, function(i, e) {
operadores.append($('<option></option>').attr('value', e.id).html(e.abreviacion));
});
});*/
}
function agregarUnidad(tipo, name) {
var proyecto = $("select[name='proyecto']").val();