@@ -547,7 +545,7 @@
-
+
@@ -612,7 +610,7 @@
// Set themes
// https://www.amcharts.com/docs/v5/concepts/themes/
root.setThemes([
- am5themes_Animated.new(root)
+ am5themes_Animated.new(root)
]);
// Create chart
@@ -638,17 +636,17 @@
// Create axes
// https://www.amcharts.com/docs/v5/charts/xy-chart/axes/
var yAxis = chart.yAxes.push(
- am5xy.CategoryAxis.new(root, {
- categoryField: "category",
- renderer: am5xy.AxisRendererY.new(root, {
- inversed: true,
- minorGridEnabled: true
- }),
- tooltip: am5.Tooltip.new(root, {
- themeTags: ["axis"],
- animationDuration: 200
- })
- })
+ am5xy.CategoryAxis.new(root, {
+ categoryField: "category",
+ renderer: am5xy.AxisRendererY.new(root, {
+ inversed: true,
+ minorGridEnabled: true
+ }),
+ tooltip: am5.Tooltip.new(root, {
+ themeTags: ["axis"],
+ animationDuration: 200
+ })
+ })
);
yAxis.data.setAll(categorias);
@@ -674,7 +672,7 @@
});
var xAxis = chart.xAxes.push(
- dateAxis
+ dateAxis
);
chart.topAxesContainer.children.push(dateAxis);
@@ -728,14 +726,14 @@
$('#<%=HdnCveContrato.ClientID%>').val(cveContrato);
- let url = '/Ashx/CargaEventos.ashx?METODO=contrato_transportes' ;
- let parametros = '&cveContrato=' + cveContrato +'&U=' + '<%= UsuarioActual.CveUsuario %>' + '&E='+ '<%= UsuarioActual.CveEmpresa %>'+ '&tipoVista=' + '<%= RBTipoVista.Text %>' + '&CveUsuarioPara:' + $('#DdlTecnico').val(); + '&CveSubProyecto:' + $('#DdlSubProyecto').val();
-
+ let url = '/Ashx/CargaEventos.ashx?METODO=contrato_transportes';
+ let parametros = '&cveContrato=' + cveContrato + '&U=' + '<%= UsuarioActual.CveUsuario %>' + '&E=' + '<%= UsuarioActual.CveEmpresa %>' + '&tipoVista=' + '<%= RBTipoVista.Text %>' + '&CveUsuarioPara:' + $('#DdlTecnico').val(); + '&CveSubProyecto:' + $('#DdlSubProyecto').val();
+
fetch(url + parametros).then(response => response.json()).then(json => {
- updateEvent(json[0],null,false);
- }).catch(err => console.log('Solicitud fallida', err));
+ updateEvent(json[0], null, false);
+ }).catch(err => console.log('Solicitud fallida', err));
});
-
+
series.events.on("datavalidated", function (ev) {
let cellSize = 45;
@@ -752,7 +750,7 @@
// Set it on chart's container
chart.root.dom.style.height = chartHeight + "px";
- // ev.target.get("xAxis").zoomToValues(new Date(2024,6,15).getTime(), new Date(2024,6,20).getTime());
+ // ev.target.get("xAxis").zoomToValues(new Date(2024,6,15).getTime(), new Date(2024,6,20).getTime());
});
// Make stuff animate on load
@@ -764,11 +762,11 @@
}); // end am5.ready()
}
- function zoomAxis(anioI,mesI,diaI,anioF,mesF,diaF) {
+ function zoomAxis(anioI, mesI, diaI, anioF, mesF, diaF) {
setTimeout(() => {
dateAxis.zoomToDates(new Date(anioI, mesI, diaI), new Date(anioF, mesF, diaF));
}, 1500);
-
+
}
var PrimeraCargaCalendario = true;
@@ -780,12 +778,12 @@
var date = null;
function InitCalendar() {
- $(document).ready(function () {
+ $(document).ready(function () {
- let mes = parseInt($('#<%=HidCurrentMonth.ClientID%>').val());
- let anio = parseInt($('#<%=HidCurrentYear.ClientID%>').val());
-
- Calendario(mes,anio);
+ let mes = parseInt($('#<%=HidCurrentMonth.ClientID%>').val());
+ let anio = parseInt($('#<%=HidCurrentYear.ClientID%>').val());
+
+ Calendario(mes, anio);
});
}
@@ -800,17 +798,26 @@
$('#<%=TxtObservaciones.ClientID%>').val(event.Observaciones);
$('#<%=TxtDescripcion.ClientID%>').val(event.description);
$('#<%=TxtUbicacion.ClientID%>').val(event.NombreAcercamiento);
-
+
if (esCalendario) {
$('#<%=TxtFechaSalida.ClientID%>').val(formatearFechaISO(event.start._i));
- }else{
+ } else {
$('#<%=TxtFechaSalida.ClientID%>').val(formatearFechaISO(event.start));
- }
+ }
$('#<%=TxtFechaRegreso.ClientID%>').val(formatearFechaISO(event.FechaFinal));
$('#<%=DdlClientes.ClientID%>').val(event.CveCliente);
-
+
$('#<%=DdlChofer.ClientID%>').val(event.CvePersonal);
- $('#<%=DdlChofer2.ClientID%>').val(event.CvePersonal2);
+
+ if (event.CvePersonal2 > 0) {
+ $('#<%=chkSegundoChofer.ClientID%>').prop('checked', true);
+ setTimeout(function () { $('#<%=DdlChofer2.ClientID%>').val(event.CvePersonal2).change(); }, 500);;
+ ;
+ } else {
+ $('#<%=chkSegundoChofer.ClientID%>').prop('checked', false);
+ $('#<%=DdlChofer2.ClientID%>').val(-1);
+ }
+
$('#<%=DdlEstatusContrato.ClientID%>').val(event.CveEventoEstatus);
$('#<%=TxtDolares.ClientID%>').val(event.Dolares);
$('#<%=TxtPesos.ClientID%>').val(event.Pesos);
@@ -823,7 +830,7 @@
$('#<%=DdlTipoAF.ClientID%>').val(event.CveTipoAF);
$('#<%=DdlSubProyectoModal.ClientID%>').val(event.CveSubProyecto);
- $('#<%= HidCveTipoAF.ClientID%>').val( $('#<%=DdlTipoAF.ClientID%>').val() );
+ $('#<%= HidCveTipoAF.ClientID%>').val($('#<%=DdlTipoAF.ClientID%>').val());
<%--$('#<%=BtnDdlTipoAF.ClientID%>').click();--%>
<%--$('#<%=DdlAF.ClientID%>').val(event.CveActivoFijo);--%>
@@ -833,14 +840,14 @@
$('#HidRemisionSerieFolio').val(event.RemisionSerieFolio);
$('#HidCveVentaRemision').val(event.CveVentaRemision);
$('#HidRemisionSaldo').val(event.RemisionSaldo);
- $('#HdnNumContrato').val(event.NumeroContrato);
+ $('#HdnNumContrato').val(event.NumeroContrato);
if (event.CveActivoFijo > 0) {
$('#HidCveAF').val(event.CveActivoFijo);
} else {
$('#HidCveAF').val('-1');
- }
-
+ }
+
if (event.NombreComercial !== null) {
$('#HidModClienteNombre').val('');
@@ -850,7 +857,7 @@
$('#HidModCveCliente').val(event.CveCliente);
- $('#<%=BtnModal.ClientID%>').click();
+ $('#<%=BtnModal.ClientID%>').click();
}
@@ -872,71 +879,71 @@
}
- //function formatearFechaISO(fechaISO) {
- // let fecha = new Date(fechaISO);
+ //function formatearFechaISO(fechaISO) {
+ // let fecha = new Date(fechaISO);
- // // Formatear la fecha en DD/MM/YYYY
- // let dia = fecha.getDate().toString().padStart(2, '0');
- // let mes = (fecha.getMonth() + 1).toString().padStart(2, '0'); // getMonth() devuelve mes de 0-11
- // let año = fecha.getFullYear();
+ // // Formatear la fecha en DD/MM/YYYY
+ // let dia = fecha.getDate().toString().padStart(2, '0');
+ // let mes = (fecha.getMonth() + 1).toString().padStart(2, '0'); // getMonth() devuelve mes de 0-11
+ // let año = fecha.getFullYear();
- // // Formatear la hora en formato 12 horas con AM/PM
- // let horas = fecha.getHours();
- // let minutos = fecha.getMinutes().toString().padStart(2, '0');
- // let periodo = 'a. m.';
- // if (horas >= 12) {
- // periodo = 'p. m.';
- // horas = horas > 12 ? horas - 12 : horas; // Convertir hora de formato 24 a 12 horas
- // }
- // if (horas === 0) horas = 12; // Medianoche se muestra como 12 a.m.
- // horas = horas.toString().padStart(2, '0');
+ // // Formatear la hora en formato 12 horas con AM/PM
+ // let horas = fecha.getHours();
+ // let minutos = fecha.getMinutes().toString().padStart(2, '0');
+ // let periodo = 'a. m.';
+ // if (horas >= 12) {
+ // periodo = 'p. m.';
+ // horas = horas > 12 ? horas - 12 : horas; // Convertir hora de formato 24 a 12 horas
+ // }
+ // if (horas === 0) horas = 12; // Medianoche se muestra como 12 a.m.
+ // horas = horas.toString().padStart(2, '0');
- // // Combinar la fecha y la hora
- // return `${dia}/${mes}/${año} ${horas}:${minutos}:00 ${periodo}`;
- //}
+ // // Combinar la fecha y la hora
+ // return `${dia}/${mes}/${año} ${horas}:${minutos}:00 ${periodo}`;
+ //}
- function RadionButtonSelectedValueSet(name, SelectdValue) {
- $('input[name="' + name + '"][value="' + SelectdValue + '"]').prop('checked', true);
+ function RadionButtonSelectedValueSet(name, SelectdValue) {
+ $('input[name="' + name + '"][value="' + SelectdValue + '"]').prop('checked', true);
+ }
+
+ function updateEventOnDropResize(event, allDay) {
+ var eventToUpdate = {
+ id: event.id,
+ start: event.start
+ };
+
+ if (event.end === null) {
+ eventToUpdate.end = eventToUpdate.start;
+ }
+ else {
+ eventToUpdate.end = event.end;
+ }
+ var endDate;
+ if (!event.allDay) {
+ endDate = new Date(eventToUpdate.end + 60 * 60000);
+ endDate = endDate.toJSON();
+ }
+ else {
+ endDate = eventToUpdate.end.toJSON();
}
- function updateEventOnDropResize(event, allDay) {
- var eventToUpdate = {
- id: event.id,
- start: event.start
- };
+ eventToUpdate.start = eventToUpdate.start.toJSON();
+ eventToUpdate.end = eventToUpdate.end.toJSON(); //endDate;
+ eventToUpdate.allDay = event.allDay;
- if (event.end === null) {
- eventToUpdate.end = eventToUpdate.start;
- }
- else {
- eventToUpdate.end = event.end;
- }
- var endDate;
- if (!event.allDay) {
- endDate = new Date(eventToUpdate.end + 60 * 60000);
- endDate = endDate.toJSON();
- }
- else {
- endDate = eventToUpdate.end.toJSON();
- }
+ PageMethods.ActualizaEvento(eventToUpdate, UpdateTimeSuccess);
+ }
- eventToUpdate.start = eventToUpdate.start.toJSON();
- eventToUpdate.end = eventToUpdate.end.toJSON(); //endDate;
- eventToUpdate.allDay = event.allDay;
+ function eventDropped(event, dayDelta, minuteDelta, allDay, revertFunc) {
+ if ($(this).data("qtip")) $(this).qtip("destroy");
+ updateEventOnDropResize(event);
+ }
- PageMethods.ActualizaEvento(eventToUpdate, UpdateTimeSuccess);
- }
+ function eventResized(event, dayDelta, minuteDelta, revertFunc) {
+ if ($(this).data("qtip")) $(this).qtip("destroy");
- function eventDropped(event, dayDelta, minuteDelta, allDay, revertFunc) {
- if ($(this).data("qtip")) $(this).qtip("destroy");
- updateEventOnDropResize(event);
- }
-
- function eventResized(event, dayDelta, minuteDelta, revertFunc) {
- if ($(this).data("qtip")) $(this).qtip("destroy");
-
- updateEventOnDropResize(event);
- }
+ updateEventOnDropResize(event);
+ }
function Calendario(mes = -1, anio = -1) {
@@ -1045,39 +1052,39 @@
$('#<%=HidCurrentMonth.ClientID%>').val(currentMonth);
$('#<%=HidCurrentYear.ClientID%>').val(currentYear);
}
-
+
});
}
- function obtenerFechaInicio(mes = -1, anio = -1) {
- let fechaActual = new Date();
-
- if (mes === -1) {
- mes = fechaActual.getMonth() + 1; // getMonth() es base 0, así que se suma 1
- }
- if (anio === -1) {
- anio = fechaActual.getFullYear();
- }
-
-
- let mesFormateado = ('0' + mes).slice(-2);
+ function obtenerFechaInicio(mes = -1, anio = -1) {
+ let fechaActual = new Date();
-
- let fechaInicio = `${anio}-${mesFormateado}-01`;
+ if (mes === -1) {
+ mes = fechaActual.getMonth() + 1; // getMonth() es base 0, así que se suma 1
+ }
+ if (anio === -1) {
+ anio = fechaActual.getFullYear();
+ }
- return fechaInicio;
- }
+
+ let mesFormateado = ('0' + mes).slice(-2);
+
+
+ let fechaInicio = `${anio}-${mesFormateado}-01`;
+
+ return fechaInicio;
+ }
function TabAltaClicked(sender, e) {
setTimeout(function () {
InitCalendar();
-
+
}, 10);
-
+
}
-
+