Primer commit del sistema avantika sin cambios
This commit is contained in:
226
javascript/envios-recibir-reporte.js
Executable file
226
javascript/envios-recibir-reporte.js
Executable file
@@ -0,0 +1,226 @@
|
||||
Event.observe(window, 'load', function() {
|
||||
|
||||
AddEditProductosListeners = function(e) {
|
||||
|
||||
var el = e.element();
|
||||
var del = el.hasClassName('spanDelete');
|
||||
var id = el.identify();
|
||||
|
||||
if(del == true){
|
||||
DeleteProductoPopup(id);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($('contenido')!= undefined)
|
||||
$('contenido').observe("click", AddEditProductosListeners);
|
||||
|
||||
if($("addProducto") != undefined)
|
||||
$('addProducto').observe("click", function(){ AddProductoDiv(1); });
|
||||
|
||||
});
|
||||
|
||||
function AddProductoDiv(id){
|
||||
|
||||
grayOut(true);
|
||||
|
||||
if(id == 0){
|
||||
$('fview').hide();
|
||||
grayOut(false);
|
||||
return;
|
||||
}
|
||||
$('fview').show();
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/envios-recibir-reporte.php',{
|
||||
method:'post',
|
||||
parameters: {type: "addProducto"},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
FViewOffSet(response);
|
||||
Event.observe($('btnSave'), "click", AddProducto);
|
||||
Event.observe($('fviewclose'), "click", function(){ HideFview(); });
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//AddProductoDiv
|
||||
|
||||
function AddProducto(){
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/envios-recibir-reporte.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: $('frmAgregarProducto').serialize(),
|
||||
onLoading: function(){
|
||||
$("txtLoaderF").innerHTML = LOADER2;
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
$("txtLoaderF").innerHTML = "";
|
||||
|
||||
if(splitResponse[0] == "fail"){
|
||||
ShowStatusPopUp(splitResponse[1]);
|
||||
}else{
|
||||
ShowStatusPopUp(splitResponse[1]);
|
||||
$('contenido').innerHTML = splitResponse[2];
|
||||
HideFview();
|
||||
}
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//AddProducto
|
||||
|
||||
function DeleteProductoPopup(id){
|
||||
|
||||
var message = "Realmente deseas eliminar este producto?";
|
||||
|
||||
if(!confirm(message)){
|
||||
return;
|
||||
}
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/envios-recibir-reporte.php',{
|
||||
method:'post',
|
||||
parameters: {type: "deleteProducto", envRepProdId: id},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
ShowStatus(splitResponse[1]);
|
||||
$('contenido').innerHTML = splitResponse[2];
|
||||
HideFview();
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//DeleteProductoPopup
|
||||
|
||||
function LoadInfoProd(){
|
||||
|
||||
var envioId = $("envioId").value;
|
||||
var code = $("codigoBarra").value;
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/envios-recibir-reporte.php',{
|
||||
method:'post',
|
||||
parameters: {type: "loadInfoProd", codigoBarra: code, envioId:envioId},
|
||||
onLoading: function(){
|
||||
$("txtModelo").innerHTML = LOADER;
|
||||
$("txtCantRec").innerHTML = LOADER;
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
$("txtModelo").innerHTML = splitResponse[1];
|
||||
$("txtCantRec").innerHTML = splitResponse[2];
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//LoadInfoProd
|
||||
|
||||
function Search(){
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/envios-recibir-reporte.php',{
|
||||
method:'post',
|
||||
parameters: $('frmSearch').serialize(),
|
||||
onLoading: function(){
|
||||
$("loadBusqueda").show();
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
$("loadBusqueda").hide();
|
||||
|
||||
$('contenido').innerHTML = splitResponse[1];
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//Search
|
||||
|
||||
function AutorizarProducto(id){
|
||||
|
||||
var message = "Realmente desea autorizar este producto?";
|
||||
|
||||
if(!confirm(message)){
|
||||
return;
|
||||
}
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/envios-recibir-reporte.php',{
|
||||
method:'post',
|
||||
parameters: {type: "autorizarProducto", envRepProdId:id},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "fail"){
|
||||
ShowStatusPopUp(splitResponse[1]);
|
||||
}else{
|
||||
ShowStatus(splitResponse[1]);
|
||||
$('contenido').innerHTML = splitResponse[2];
|
||||
HideFview();
|
||||
}
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//AutorizarProducto
|
||||
|
||||
function RechazarProducto(id){
|
||||
|
||||
var message = "Realmente desea rechazar este producto?";
|
||||
|
||||
if(!confirm(message)){
|
||||
return;
|
||||
}
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/envios-recibir-reporte.php',{
|
||||
method:'post',
|
||||
parameters: {type: "rechazarProducto", envRepProdId:id},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "fail"){
|
||||
ShowStatusPopUp(splitResponse[1]);
|
||||
}else{
|
||||
ShowStatus(splitResponse[1]);
|
||||
$('contenido').innerHTML = splitResponse[2];
|
||||
HideFview();
|
||||
}
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//RechazarProducto
|
||||
|
||||
function CheckKey(e){
|
||||
|
||||
if(window.event)
|
||||
keyCode = window.event.keyCode;
|
||||
else if(e)
|
||||
keyCode=e.which;
|
||||
|
||||
if(keyCode == 13)
|
||||
Search();
|
||||
|
||||
}//CheckKey
|
||||
Reference in New Issue
Block a user