--Actualizar eventos desde diagrama de grantt
This commit is contained in:
@@ -488,7 +488,13 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
|
||||
DT_SubProyectos.Columns.Add("backgroundColor")
|
||||
DT_EstatusOS.Columns.Add("", GetType(Integer))
|
||||
|
||||
If ObjContratos.GetContratos(-1, usuarioActual_.CveEmpresa, TipoContrato:=34) Then
|
||||
Dim cveContrato As Integer = -1
|
||||
|
||||
If context.Request("cveContrato") IsNot Nothing Then
|
||||
cveContrato = context.Request("cveContrato").ToEntero()
|
||||
End If
|
||||
|
||||
If ObjContratos.GetContratos(cveContrato, usuarioActual_.CveEmpresa, TipoContrato:=34) Then
|
||||
|
||||
If ObjContratos.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
|
||||
@@ -94,10 +94,10 @@
|
||||
<%-- Cliente --%>
|
||||
<label class="col-md-1">Cliente</label>
|
||||
<div class="col-md-2">
|
||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlCliente" Width="86%"
|
||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlCliente" Width="100%"
|
||||
data-metodo="getcliente"
|
||||
runat="server" DataTextField="NombreComercial" DataValueField="CveCliente"
|
||||
CssStyle="width: 86%;"
|
||||
CssStyle="width: 100%;"
|
||||
UsaWebService="true" Enabled="false"></ADS:Dropdownlost>
|
||||
</div>
|
||||
<%-- Estatus --%>
|
||||
@@ -116,7 +116,7 @@
|
||||
<div class="portlet-body row" style="display: none">
|
||||
<%-- Centro de Costos --%>
|
||||
<label class="col-md-1 truncate ">Centro de Costos</label>
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-3">
|
||||
<asp:DropDownList ID="DdlSubProyectos" data-text="Todos" AppendDataBoundItems="true"
|
||||
DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control ddlFiltros input-sm select2me Widthall"
|
||||
Style="width: 100%;" runat="server">
|
||||
@@ -627,7 +627,7 @@
|
||||
series.columns.template.setAll({
|
||||
templateField: "columnSettings",
|
||||
strokeOpacity: 0,
|
||||
tooltipText: "{category}: {openValueX} - {valueX}"
|
||||
tooltipText: "UNIDAD: {unidad} -- CONTRATO: {contrato} -- CÓDIGO: {category} -- DURACIÓN: {openValueX} - {valueX}"
|
||||
});
|
||||
|
||||
series.data.processor = am5.DataProcessor.new(root, {
|
||||
@@ -656,6 +656,21 @@
|
||||
chart.set("scrollbarY", scrollbarY);
|
||||
|
||||
|
||||
//MOSTRAR MODAL DE CONTRATO AL HACER CLICK
|
||||
series.columns.template.events.on("click", e => {
|
||||
let cveContrato = e.target.dataItem.dataContext.cveContrato;
|
||||
|
||||
$('#CveContrato').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();
|
||||
|
||||
fetch(url + parametros).then(response => response.json()).then(json => {
|
||||
console.log(json);
|
||||
updateEvent(json[0],null,false);
|
||||
}).catch(err => console.log('Solicitud fallida', err));
|
||||
});
|
||||
|
||||
series.events.on("datavalidated", function (ev) {
|
||||
let cellSize = 45;
|
||||
|
||||
@@ -671,7 +686,20 @@
|
||||
|
||||
// Set it on chart's container
|
||||
chart.root.dom.style.height = chartHeight + "px";
|
||||
|
||||
//ev.target.get("xAxis").zoomToValues(100, 200);
|
||||
});
|
||||
|
||||
//series.events.once("datavalidated", function(ev) {
|
||||
|
||||
//});
|
||||
|
||||
//chart.events.on("ready", function () {
|
||||
// dateAxis.zoomToDates(
|
||||
// new Date(2024, 7, 4),
|
||||
// new Date(2024, 7, 15)
|
||||
// );
|
||||
//})
|
||||
//root.language.setTranslationAny("May", "Mayo");
|
||||
|
||||
// Make stuff animate on load
|
||||
@@ -705,7 +733,7 @@
|
||||
function selectDate(start, end, allDay) {
|
||||
}
|
||||
|
||||
function updateEvent(event, element) {
|
||||
function updateEvent(event, element, esCalendario = true) {
|
||||
|
||||
$('#<%=TxtCantidadPasajeros.ClientID%>').val(event.CantidadPasajeros);
|
||||
$('#<%=TxtFolio.ClientID%>').val(event.NumeroContrato);
|
||||
@@ -714,8 +742,12 @@
|
||||
$('#<%=TxtUbicacion.ClientID%>').val(event.NombreAcercamiento);
|
||||
|
||||
|
||||
|
||||
if (esCalendario) {
|
||||
$('#<%=TxtFechaSalida.ClientID%>').val(formatearFechaISO(event.start._i));
|
||||
}else{
|
||||
$('#<%=TxtFechaSalida.ClientID%>').val(formatearFechaISO(event.start));
|
||||
}
|
||||
|
||||
$('#<%=TxtFechaRegreso.ClientID%>').val(formatearFechaISO(event.FechaFinal));
|
||||
|
||||
$('#<%=DdlClientes.ClientID%>').val(event.CveCliente);
|
||||
|
||||
@@ -32,8 +32,8 @@ Partial Class RepContratosCalendario
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString
|
||||
txtFechaF.Text = DateTime.Now.AddDays(7).ToShortDateString
|
||||
txtFechaI.Text = DateTime.Now.ToShortDateString
|
||||
txtFechaF.Text = DateTime.Now.AddMonths(1).ToShortDateString
|
||||
InicializaCombos()
|
||||
InicializaCalendar()
|
||||
CargaDatos()
|
||||
@@ -85,7 +85,9 @@ Partial Class RepContratosCalendario
|
||||
New JProperty("columnSettings", New JObject(
|
||||
New JProperty("fill", String.Format("#{0:X6}", random.Next(16777216)))
|
||||
)),
|
||||
New JProperty("task", Row("NombreAF"))
|
||||
New JProperty("unidad", Row("NombreAF")),
|
||||
New JProperty("cveContrato", Row("CveContrato")),
|
||||
New JProperty("contrato", Row("NumeroContrato"))
|
||||
)
|
||||
jsonData.Add(obj)
|
||||
strAF.AppendFormat("{0},", Row("CveAF"))
|
||||
|
||||
Reference in New Issue
Block a user