From b5fccadf514928d1979adaec173c0bf581eea60e Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 7 May 2024 17:18:06 -0700 Subject: [PATCH] - --- Transportes/RepContratosCalendario.aspx | 53 ++++++++++++++++++++-- Transportes/RepContratosCalendario.aspx.vb | 21 +++++++-- 2 files changed, 64 insertions(+), 10 deletions(-) diff --git a/Transportes/RepContratosCalendario.aspx b/Transportes/RepContratosCalendario.aspx index 9645e1181..aa7504d5c 100644 --- a/Transportes/RepContratosCalendario.aspx +++ b/Transportes/RepContratosCalendario.aspx @@ -188,7 +188,7 @@ <%--Contratos Tab--%> - + <%-- Contratos --%> @@ -279,12 +279,37 @@ <%--Calendario Tab--%> -
-
-
+ + + +
+
+
+ +
+
+
+ + +
+ + + + +
+
+
+
+
+
+
+
+
+ @@ -541,7 +566,7 @@ layout: root.verticalLayout, paddingLeft: 0 })); - + // Add legend // https://www.amcharts.com/docs/v5/charts/xy-chart/legend-xy-series/ var legend = chart.children.push(am5.Legend.new(root, { @@ -625,6 +650,24 @@ chart.set("scrollbarY", scrollbarY); + /// evento para ajustar el alto del row + var cellSize = 30; + chart.events.on("datavalidated", function (ev) { + + // Get objects of interest + var chart = ev.target; + var categoryAxis = chart.yAxes.getIndex(0); + + // Calculate how we need to adjust chart height + var adjustHeight = chart.data.length * cellSize - categoryAxis.pixelHeight; + + // get current chart height + var targetHeight = chart.pixelHeight + adjustHeight; + + // Set it on chart's container + chart.svgContainer.htmlElement.style.height = targetHeight + "px"; + }); + // Make stuff animate on load // https://www.amcharts.com/docs/v5/concepts/animations/ series.appear(); diff --git a/Transportes/RepContratosCalendario.aspx.vb b/Transportes/RepContratosCalendario.aspx.vb index d6923c233..81f09aa7f 100644 --- a/Transportes/RepContratosCalendario.aspx.vb +++ b/Transportes/RepContratosCalendario.aspx.vb @@ -48,21 +48,21 @@ Partial Class RepContratosCalendario If CveCliente = 0 Then CveCliente = -1 If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlCliente.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveEstatus:=DdlEstatusConsulta.SelectedValue.ToEntero, CveTipoContrato:=34) Then - DtAvance = ObjContratos.DtResultados.Copy() + DtAvance = ObjContratos.DtResultados.Copy() + CargaCronograma(DdlTipoVista.SelectedValue.ToEntero) End If GvContratos.DataSource = DtAvance ObjContratos.Dispose() GvContratos.DataBind() UpTitulos.Update() - - CargaCronograma() + End Sub - Private Sub CargaCronograma() + Private Sub CargaCronograma(Optional TipoVista As Integer = -1) If DtAvance IsNot Nothing Then - Dim DtUnidades As DataTable = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros("Codigo <> '' AND MedidaVehicular IN (2,3)", " SubTipoActivoFijo DESC ", {"Codigo"}) + Dim DtUnidades As DataTable = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros("Codigo <> '' AND MedidaVehicular IN (2,3)", " SubTipoActivoFijo DESC ", {"Codigo", "CveActivoFijo"}) 'For Each Row As DataRow In DtAvance.Rows ' If String.IsNullOrEmpty(Row("CodigoAF").ToString()) Then @@ -76,6 +76,7 @@ Partial Class RepContratosCalendario Dim random = New Random() 'DATOS + Dim strAF As New StringBuilder For Each Row As DataRow In DtAvance.FiltraParametros("CodigoAF <> ''").Rows Dim obj As New JObject( New JProperty("category", Row("CodigoAF")), @@ -87,8 +88,13 @@ Partial Class RepContratosCalendario New JProperty("task", Row("NombreAF")) ) jsonData.Add(obj) + strAF.AppendFormat("{0},", Row("CveAF")) Next + If TipoVista = 1 Then 'solo con viajes + DtUnidades = DtUnidades.FiltraParametros($"CveActivoFijo IN ({strAF.ToString})") + End If + 'CATEGORIAS 'AGREGAR TODAS LAS UNIDADES For Each Row As DataRow In DtUnidades.Rows Dim obj As New JObject( @@ -98,6 +104,7 @@ Partial Class RepContratosCalendario Next RegistraScript($"cargaDiagramaGrant({jsonData.ToString()},{jsonCategorias.ToString()});", "A1") + UPPGantt.Update() End If End Sub Private Sub InicializaCalendar() @@ -253,4 +260,8 @@ Partial Class RepContratosCalendario InicializaCalendar() CargaCronograma() End Sub + + Protected Sub DdlTipoVista_SelectedIndexChanged(sender As Object, e As EventArgs) + CargaCronograma(DdlTipoVista.SelectedValue.ToEntero) + End Sub End Class