git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C9
This commit is contained in:
parent
c4093b8f28
commit
d006f8e3e4
3 changed files with 103 additions and 42 deletions
|
|
@ -1,4 +1,4 @@
|
|||
$("#formCatalogo").EnableValidationToolTip();
|
||||
|
||||
var DataCatalogo;
|
||||
var id_column = 1;
|
||||
var Item = {};
|
||||
|
|
@ -40,13 +40,6 @@ this.getDataModel = function () {
|
|||
});
|
||||
|
||||
|
||||
$('#btnFormalizador').unbind('click');
|
||||
$('#btnFormalizador').click(function () {
|
||||
SelectedCatalog = "Formalizador";
|
||||
CargarDataCatalogo($('#btnFormalizador').attr('direccion_api'), null, "1");
|
||||
});
|
||||
|
||||
|
||||
obtenerItems();
|
||||
|
||||
|
||||
|
|
@ -56,50 +49,59 @@ this.obtenerItems = function () {
|
|||
|
||||
|
||||
var uri = CatalogosWCF + '/api/ObtenerEmisoresPN';
|
||||
var DTO = JSON.stringify(Item);
|
||||
//$.getJSON(uri).done(function (data) {
|
||||
|
||||
$.getJSON(server + uri).done(function (data) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: uri,
|
||||
cache: false,
|
||||
data: DTO,
|
||||
contentType: 'application/json; charset=utf-8',
|
||||
dataType: 'json',
|
||||
success: function (response, data) {
|
||||
|
||||
$('#TableItems').TableInit(0, false, true, true, false, null, null);
|
||||
$('#TableItems').TableInit(0, false, true, true, false, null, null);
|
||||
|
||||
var TableItems = $('#TableItems').DataTable();
|
||||
var TableItems = $('#TableItems').DataTable();
|
||||
|
||||
$.each(data, function (key, item) {
|
||||
$.each(data, function (key, item) {
|
||||
|
||||
|
||||
var option = $("#ucItemsCatalogo").html();
|
||||
var option = $("#ucItemsCatalogo").html();
|
||||
|
||||
option = replaceAll("[$CodItem]", item.IdEjecutivo, option);
|
||||
option = replaceAll("[$CodItem]", item.IdTipoEmisor, option);
|
||||
|
||||
var stateIcon = $("#ucItemsIcon").html();
|
||||
var stateIcon = $("#ucItemsIcon").html();
|
||||
|
||||
if (item.Estado == false) {
|
||||
stateIcon = replaceAll("[$icon]", "fa-check-circle", stateIcon);
|
||||
stateIcon = replaceAll("[$state_color]", "muted", stateIcon);
|
||||
if (item.Estado == false) {
|
||||
stateIcon = replaceAll("[$icon]", "fa-check-circle", stateIcon);
|
||||
stateIcon = replaceAll("[$state_color]", "muted", stateIcon);
|
||||
|
||||
option = replaceAll("[$opcion]", "Habilitar", option);
|
||||
option = replaceAll("[$icon]", "fa-check", option);
|
||||
option = replaceAll("[$value]", "1", option);
|
||||
option = replaceAll("[$opcion]", "Habilitar", option);
|
||||
option = replaceAll("[$icon]", "fa-check", option);
|
||||
option = replaceAll("[$value]", "1", option);
|
||||
}
|
||||
else {
|
||||
stateIcon = replaceAll("[$icon]", "fa-check-circle", stateIcon);
|
||||
stateIcon = replaceAll("[$state_color]", "success", stateIcon);
|
||||
|
||||
option = replaceAll("[$opcion]", "Deshabilitar", option);
|
||||
option = replaceAll("[$icon]", "fa-times", option);
|
||||
option = replaceAll("[$value]", "0", option);
|
||||
}
|
||||
|
||||
TableItems.row.add([stateIcon,
|
||||
item.IdTipoEmisor,
|
||||
item.Descripcion,
|
||||
option]).draw();
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
ENDREQUEST();
|
||||
}
|
||||
else {
|
||||
stateIcon = replaceAll("[$icon]", "fa-check-circle", stateIcon);
|
||||
stateIcon = replaceAll("[$state_color]", "success", stateIcon);
|
||||
|
||||
option = replaceAll("[$opcion]", "Deshabilitar", option);
|
||||
option = replaceAll("[$icon]", "fa-times", option);
|
||||
option = replaceAll("[$value]", "0", option);
|
||||
}
|
||||
|
||||
TableItems.row.add([stateIcon,
|
||||
item.IdTipoEmisor,
|
||||
item.Descripcion,
|
||||
option]).draw();
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
ENDREQUEST();
|
||||
|
||||
}).fail(function (jqxhr, textStatus, error) {
|
||||
|
||||
toastr.error("Ha ocurrido un error inesperado. Vuela a intentarlo mas tarde");
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
var CatalogosWCF = $("#hiddenSinortCatalogosWCF").val();
|
||||
var SinortWCF = $("#hiddenSinortWCF").val();
|
||||
var server = "http://" + location.host + "/AYA.SlnSynor.WCF/";
|
||||
|
||||
function Mensajes(mensaje) {
|
||||
if (mensaje.CodigoRespuesta === "1") {
|
||||
|
|
@ -198,4 +199,61 @@ $.fn.TableInit = function (columnOrder, order, bPaginate, bFilter, bInfo, column
|
|||
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
$.fn.EnableValidationToolTip = function () {
|
||||
|
||||
this.validate({
|
||||
|
||||
ignore: "not:hidden",
|
||||
|
||||
showErrors: function (errorMap, errorList) {
|
||||
|
||||
|
||||
$.each(this.validElements(), function (index, element) {
|
||||
var $element = $(element);
|
||||
|
||||
if ($element.prop("type") == "select-one") {
|
||||
if ($element.attr('required')) {
|
||||
$element.removeClass("selectWarning").addClass("inputSuccess");
|
||||
}
|
||||
else {
|
||||
$element.removeClass("selectWarning");
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if ($element.attr('required')) {
|
||||
$element.removeClass("inputWarning").addClass("inputSuccess");
|
||||
}
|
||||
else {
|
||||
$element.removeClass("inputWarning");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$element.data("title", "").removeClass("error").tooltip("destroy");
|
||||
|
||||
});
|
||||
|
||||
$.each(errorList, function (index, error) {
|
||||
var $element = $(error.element);
|
||||
|
||||
if ($element.prop("type") == "select-one") {
|
||||
$element.removeClass("inputSuccess").addClass("selectWarning");
|
||||
}
|
||||
else {
|
||||
$element.removeClass("inputSuccess").addClass("inputWarning");
|
||||
}
|
||||
|
||||
//if ($element.data("role") != undefined) {
|
||||
// $("#" + $element.data("role")).tooltip("destroy").data("title", error.message).addClass("error").tooltip({ placement: 'right', trigger: 'hover', container: 'body' });
|
||||
//} else {
|
||||
$element.tooltip("destroy").data("title", error.message).addClass("error").tooltip({ placement: 'right', trigger: 'hover', container: 'body' });
|
||||
//}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
|
@ -89,5 +89,6 @@
|
|||
|
||||
|
||||
|
||||
@Scripts.Render("~/Script-Global")
|
||||
@Scripts.Render("~/Script-Catalogos")
|
||||
|
||||
@Scripts.Render("~/Sinort-Scripts/EmisorPN.js")
|
||||
Loading…
Add table
Reference in a new issue