862 lines
45 KiB
Plaintext
862 lines
45 KiB
Plaintext
<%@ Page Title="Transportes V&A - Calendario" Language="VB" MasterPageFile="~/Site.master"
|
|
AutoEventWireup="false" CodeFile="RepContratosCalendario.aspx.vb" Inherits="RepContratosCalendario" %>
|
|
|
|
<%@ Register Assembly="TimePicker" Namespace="MKB.TimePicker" TagPrefix="cc1" %>
|
|
|
|
<asp:Content ID="Content1" ContentPlaceHolderID="Css" runat="Server">
|
|
<style type="text/css">
|
|
.tipo_vista {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 2rem;
|
|
}
|
|
|
|
.my-1 {
|
|
margin-block: 1rem;
|
|
}
|
|
|
|
.miGrid {
|
|
color: white;
|
|
}
|
|
|
|
#chartdiv {
|
|
width: 100%;
|
|
height: 600px;
|
|
}
|
|
</style>
|
|
</asp:Content>
|
|
|
|
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
|
|
Calendario de Viajes
|
|
</asp:Content>
|
|
|
|
<asp:Content ID="Content3" ContentPlaceHolderID="H" runat="Server">
|
|
<li>
|
|
<asp:LinkButton ID="LnkPdf" runat="server"><i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
|
</li>
|
|
<li>
|
|
<asp:LinkButton ID="LnkExcel" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
|
</li>
|
|
</asp:Content>
|
|
|
|
<asp:Content ID="Content4" ContentPlaceHolderID="C" runat="Server">
|
|
<asp:Panel ID="PnlGeneral" runat="server">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<%-- Filtros --%>
|
|
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
|
<ContentTemplate>
|
|
<div class="portlet solid grey-cascade portlet-filter">
|
|
<%-- Filtro Visible - Consulta --%>
|
|
<div class="portlet-title portlet-filterT smalltitle">
|
|
<div class="tools">
|
|
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" OnClick="BtnConsultar_Click" />
|
|
<a href="javascript:;" class="expand"></a>
|
|
</div>
|
|
<div class="titlefiltros caption">
|
|
<div class="row" style="height: 32px;">
|
|
<%-- Fecha Inicial --%>
|
|
<label class="col-md-1 truncate">Fecha Inicial</label>
|
|
<div class="col-md-1" style="min-width: 115px">
|
|
<div class="input-group input-sm input-small date date-picker "
|
|
data-date-format="dd/mm/yyyy"
|
|
style="width: 100px !important; padding: 0px;">
|
|
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control"
|
|
MaxLength="10"></asp:TextBox>
|
|
<span class="input-group-btn ">
|
|
<asp:LinkButton ID="imgCalendario" class="btn default" Text="<i class='fa fa-calendar'></i>"
|
|
runat="server"></asp:LinkButton>
|
|
</span>
|
|
</div>
|
|
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI"
|
|
Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
|
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI"
|
|
PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
|
</div>
|
|
<%-- Fecha Final --%>
|
|
<label class="col-md-1 truncate">Fecha Fin</label>
|
|
<div class="col-md-1" style="min-width: 115px">
|
|
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy"
|
|
style="width: 100px !important; padding: 0px;">
|
|
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control"
|
|
MaxLength="10"></asp:TextBox>
|
|
<span class="input-group-btn ">
|
|
<asp:LinkButton ID="imgCalendarioF" class="btn default "
|
|
Text="<i class='fa fa-calendar'></i>"
|
|
runat="server"></asp:LinkButton>
|
|
</span>
|
|
</div>
|
|
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF"
|
|
Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
|
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF"
|
|
PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
|
</div>
|
|
<%-- Cliente --%>
|
|
<label class="col-md-1">Cliente</label>
|
|
<div class="col-md-2">
|
|
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlCliente" Width="86%"
|
|
data-metodo="getcliente"
|
|
runat="server" DataTextField="NombreComercial" DataValueField="CveCliente"
|
|
CssStyle="width: 86%;"
|
|
UsaWebService="true" Enabled="false"></ADS:Dropdownlost>
|
|
</div>
|
|
<%-- Estatus --%>
|
|
<label class="col-md-1 ">Estatus:</label>
|
|
<div class="col-md-2">
|
|
<asp:DropDownList ID="DdlEstatusConsulta" data-text="Todos" AppendDataBoundItems="true"
|
|
DataTextField="ContratoEstatus"
|
|
DataValueField="CveContratoEstatus" CssClass="form-control ddlFiltros input-sm select2me Widthall"
|
|
Style="width: 100%;" runat="server">
|
|
</asp:DropDownList>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<%-- Filtro Oculto --%>
|
|
<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">
|
|
<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">
|
|
</asp:DropDownList>
|
|
</div>
|
|
<%-- Tipo de Unidad --%>
|
|
<label class="col-md-1 ">Tipo de Unidad</label>
|
|
<div class="col-md-2">
|
|
<asp:DropDownList ID="DdlTipoUnidad" data-text="Todos" AppendDataBoundItems="true"
|
|
DataTextField="TipoActivoFijo" DataValueField="CveTipoActivoFijo" CssClass="form-control ddlFiltros input-sm select2me Widthall"
|
|
Style="width: 100%;" runat="server">
|
|
</asp:DropDownList>
|
|
</div>
|
|
<%-- Chofer --%>
|
|
<label class="col-md-1 ">Chofer:</label>
|
|
<div class="col-md-2">
|
|
<asp:DropDownList ID="DdlChoferFiltro" data-text="Todos" AppendDataBoundItems="true"
|
|
DataTextField="NombreCompleto" DataValueField="CvePersonal" CssClass="form-control ddlFiltros input-sm select2me Widthall"
|
|
Style="width: 100%;" runat="server">
|
|
</asp:DropDownList>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<ajax:TabContainer ID="Tab" runat="server" Width="100%" ActiveTabIndex="0">
|
|
<%--Calendario Tab--%>
|
|
<ajax:TabPanel ID="TabAlta" runat="server" HeaderText="Calendario">
|
|
<ContentTemplate>
|
|
|
|
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
|
|
<div class="portlet-title portlet-filterT smalltitle">
|
|
<div class="tools">
|
|
</div>
|
|
<div class="titlefiltros caption">
|
|
</div>
|
|
<div class="row" style="height: 32px;">
|
|
<label class="col-md-1">Tipo Vista: </label>
|
|
<div class="col-md-2">
|
|
<asp:RadioButtonList ID="RBTipoVista" runat="server" AutoPostBack="True" RepeatDirection="Horizontal" OnSelectedIndexChanged="RBTipoVista_SelectedIndexChanged">
|
|
<asp:ListItem Text="Fecha de Salida" Value="fecha" Selected="True" />
|
|
<asp:ListItem Text="Duración" Value="duracion" />
|
|
</asp:RadioButtonList>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="portlet-body" style="display: none">
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12 col-sm-12">
|
|
<div class="portlet light calendar ">
|
|
<div class="tipo_vista">
|
|
<div>
|
|
<h4 class="bold ribbon-color-success"> </h4>
|
|
</div>
|
|
</div>
|
|
<div class="portlet-body">
|
|
<div id="calendar">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</ContentTemplate>
|
|
</ajax:TabPanel>
|
|
<%--Contratos Tab--%>
|
|
<ajax:TabPanel ID="TabCont" runat="server" HeaderText="Contratos">
|
|
<ContentTemplate>
|
|
<%-- Contratos --%>
|
|
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
|
<ContentTemplate>
|
|
<asp:GridView ID="GvContratos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
|
|
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn miGrid"
|
|
GridLines="None"
|
|
data-sort="true" DataKeyNames="CveContrato, NumeroContrato, DescripcionContrato, Ubicacion, FechaInicial, FechaFinal, CveCliente, NombreComercial, CveTipoAF, Importe, ImporteMin, ImporteMax, Observaciones, CveAF, CveChofer, CveChofer2, CveContratosEstatus, CantidadPasajeros,CveMoneda">
|
|
<Columns>
|
|
<asp:TemplateField HeaderText="Contrato">
|
|
<ItemTemplate>
|
|
<asp:HyperLink ForeColor="White" runat="server" NavigateUrl='<%# "~/Transportes/RepContratoDetalle.aspx?CveContrato=" + If(Eval("CveContrato") IsNot DBNull.Value, Eval("CveContrato").ToString(), String.Empty) %>'
|
|
Text='<%# Eval("NumeroContrato") %>'></asp:HyperLink>
|
|
</ItemTemplate>
|
|
</asp:TemplateField>
|
|
|
|
<asp:TemplateField ItemStyle-Width="120px">
|
|
<HeaderTemplate>
|
|
Fecha<br />
|
|
Salida
|
|
|
|
</HeaderTemplate>
|
|
<ItemTemplate>
|
|
<asp:Literal ID="LtlFechaI" runat="server" Text='<%# Eval("FechaInicial", "{0:dd/MM/yyyy HH:mm}") %>'></asp:Literal>
|
|
</ItemTemplate>
|
|
</asp:TemplateField>
|
|
|
|
<asp:TemplateField HeaderText="Viaje">
|
|
<ItemTemplate>
|
|
<asp:Literal ID="LtlDescripcionContrato" runat="server" Text='<%# Eval("DescripcionContrato") %>'></asp:Literal>
|
|
</ItemTemplate>
|
|
</asp:TemplateField>
|
|
|
|
<asp:TemplateField HeaderText="Cliente">
|
|
<ItemTemplate>
|
|
<asp:Literal ID="LtNombreComercial" runat="server" Text='<%# Eval("NombreComercial") %>'></asp:Literal>
|
|
</ItemTemplate>
|
|
</asp:TemplateField>
|
|
|
|
<asp:TemplateField HeaderText="Chofer">
|
|
<ItemTemplate>
|
|
<asp:Literal ID="LtlChofer" runat="server" Text='<%# Eval("NombreChofer") %>'></asp:Literal>
|
|
</ItemTemplate>
|
|
</asp:TemplateField>
|
|
|
|
<asp:TemplateField HeaderText="Chofer2">
|
|
<ItemTemplate>
|
|
<asp:Literal ID="LtlChofer2" runat="server" Text='<%# Eval("NombreChofer2") %>'></asp:Literal>
|
|
</ItemTemplate>
|
|
</asp:TemplateField>
|
|
|
|
<asp:TemplateField HeaderText="Unidad">
|
|
<ItemTemplate>
|
|
<asp:Literal ID="LtlAF" runat="server" Text='<%# Eval("NombreAF") %>'></asp:Literal>
|
|
</ItemTemplate>
|
|
</asp:TemplateField>
|
|
|
|
<asp:TemplateField HeaderText="Fecha Final" ItemStyle-Width="100px">
|
|
<HeaderTemplate>
|
|
Fecha<br />
|
|
Regreso
|
|
|
|
</HeaderTemplate>
|
|
<ItemTemplate>
|
|
<asp:Literal ID="LtlFechaFinal" runat="server" Text='<%# Eval("FechaFinal", "{0:d}") %>'></asp:Literal>
|
|
</ItemTemplate>
|
|
</asp:TemplateField>
|
|
|
|
<asp:TemplateField HeaderText="Estatus">
|
|
<ItemTemplate>
|
|
<asp:Label ID="LtlContrato" runat="server" Text='<%# Eval("ContratoEstatus") %>'>
|
|
</asp:Label>
|
|
</ItemTemplate>
|
|
</asp:TemplateField>
|
|
|
|
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Acciones">
|
|
<ItemTemplate>
|
|
<asp:LinkButton ID="BtnEditar" runat="server" AlternateText="Editar" OnClick="UpdateModal"
|
|
CssClass="btn btn-circle btn-xs green" Text="<i class='fa fa-pencil'></i>" />
|
|
</ItemTemplate>
|
|
</asp:TemplateField>
|
|
</Columns>
|
|
</asp:GridView>
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
</ContentTemplate>
|
|
</ajax:TabPanel>
|
|
<%--Calendario Tab--%>
|
|
<ajax:TabPanel ID="TabGrantt" runat="server" HeaderText="Cronograma">
|
|
<ContentTemplate>
|
|
<asp:UpdatePanel ID="UPPGantt" runat="server" UpdateMode="Conditional">
|
|
<ContentTemplate>
|
|
<div class="portlet solid grey-cascade portlet-filter">
|
|
<div class="portlet-title portlet-filterT smalltitle">
|
|
<div class="tools">
|
|
<a href="javascript:;" class="expand"></a>
|
|
</div>
|
|
<div class="titlefiltros caption">
|
|
<div class="row" style="height: 32px;">
|
|
<label class="col-md-1 truncate">Tipo Vista:</label>
|
|
<div class="col-md-1">
|
|
<asp:DropDownList ID="DdlTipoVista" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoVista_SelectedIndexChanged" CssClass="form-control select2me input-sm select2me Widthall"
|
|
Style="width: 100%;" runat="server">
|
|
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
|
|
<asp:ListItem Text="Solo Viaje" Value="1"></asp:ListItem>
|
|
</asp:DropDownList>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div id="chartdiv"></div>
|
|
</div>
|
|
</div>
|
|
</ContentTemplate>
|
|
</ajax:TabPanel>
|
|
</ajax:TabContainer>
|
|
</div>
|
|
</div>
|
|
</asp:Panel>
|
|
<%-- Modal --%>
|
|
<div id="ModalActualizar" class="modal ADS fade" role="dialog">
|
|
<asp:UpdatePanel runat="server" ID="UpModal" UpdateMode="Conditional">
|
|
<ContentTemplate>
|
|
<div class="modal-dialog rowpadding">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
<h4 class="modal-title" id="myModalLabel" runat="server">Actualizar Contrato</h4>
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
<div class="row my-1">
|
|
<label class="col-md-4 bold text-primary">Folio:</label>
|
|
<div class="col-md-8">
|
|
<asp:TextBox ID="TxtFolio" runat="server" Width="100%"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row my-1">
|
|
<label class="col-md-4 bold text-primary">Numero de Pasajeros:</label>
|
|
<div class="col-md-8">
|
|
<asp:TextBox ID="TxtCantidadPasajeros" runat="server" Width="100%"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row my-1">
|
|
<label class="col-md-4">Cliente</label>
|
|
<div class="col-md-8">
|
|
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente"
|
|
runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"
|
|
UsaWebService="true" Enabled="false"></ADS:Dropdownlost>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<label class="col-md-4">Servicio:</label>
|
|
<div class="col-md-8">
|
|
<asp:TextBox ID="TxtDescripcion" runat="server" Width="100%" TextMode="MultiLine"
|
|
Rows="2"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<label class="col-md-4">Observaciones:</label>
|
|
<div class="col-md-8">
|
|
<asp:TextBox ID="TxtObservaciones" runat="server" Width="100%" TextMode="MultiLine"
|
|
Rows="2"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row my-1">
|
|
<label class="col-md-4">Lugar de Salida:</label>
|
|
<div class="col-md-8">
|
|
<asp:TextBox ID="TxtUbicacion" runat="server" Width="100%"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<label class="col-md-4">Fecha Salida:</label>
|
|
<div class="col-md-8">
|
|
<asp:TextBox ID="TxtFechaSalida" runat="server" CssClass="form-control"
|
|
Width="100%"></asp:TextBox>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row my-1">
|
|
<label class="col-md-4">Fecha Regreso:</label>
|
|
<div class="col-md-8">
|
|
<asp:TextBox ID="TxtFechaRegreso" runat="server" CssClass="form-control"
|
|
Width="100%"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row my-1">
|
|
<label class="col-md-4">Moneda:</label>
|
|
<div class="col-md-8">
|
|
<asp:TextBox ID="TxtMoneda" runat="server" ReadOnly="true" Width="100%"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row my-1">
|
|
<label class="col-md-4">Tipo Unidad</label>
|
|
<div class="col-md-8">
|
|
<asp:DropDownList ID="DdlTipoAF" DataValueField="CveTipoActivoFijo"
|
|
DataTextField="TipoActivoFijo" Class="form-control input-inline"
|
|
Width="100%" runat="server" Enabled="true">
|
|
</asp:DropDownList>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row my-1" id="DivAF" runat="server">
|
|
<label class="col-md-4">Unidad</label>
|
|
<div class="col-md-8">
|
|
<asp:DropDownList ID="DdlAF" DataValueField="CveActivoFijo"
|
|
DataTextField="CodDesc" Class="form-control select2me"
|
|
Width="100%" runat="server">
|
|
</asp:DropDownList>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row my-1">
|
|
<label class="col-md-4">Chofer 1</label>
|
|
<div class="col-md-8">
|
|
<asp:DropDownList ID="DdlChofer" AppendDataBoundItems="true" DataValueField="CvePersonal"
|
|
DataTextField="NombreCompleto" Class="table-group-action-input form-control input-inline select2me"
|
|
Width="100%" runat="server">
|
|
<asp:ListItem Value="-1" Selected="True">Seleccione</asp:ListItem>
|
|
</asp:DropDownList>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row my-1">
|
|
<label class="col-md-4">Chofer 2</label>
|
|
<div class="col-md-8">
|
|
<asp:DropDownList ID="DdlChofer2" AppendDataBoundItems="true" DataValueField="CvePersonal"
|
|
DataTextField="NombreCompleto" Class="table-group-action-input form-control input-inline select2me"
|
|
Width="100%" runat="server">
|
|
</asp:DropDownList>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<asp:Label ID="LbEstatus" runat="server" class="col-md-4">Estatus:</asp:Label>
|
|
<div class="col-md-8">
|
|
<asp:DropDownList ID="DdlEstatusContrato" runat="server" Class="table-group-action-input form-control input-inline select2me"
|
|
AppendDataBoundItems="true" DataValueField="CveContratoEstatus"
|
|
DataTextField="ContratoEstatus"
|
|
Width="100%">
|
|
</asp:DropDownList>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row hidden">
|
|
<label class="col-md-4">Costo dólares:</label>
|
|
<div class="col-md-8">
|
|
<asp:TextBox ID="TxtDolares" CssStyle=" form-control" runat="server" type="number"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row hidden">
|
|
<label class="col-md-4">Costo pesos:</label>
|
|
<div class="col-md-8">
|
|
<asp:TextBox ID="TxtPesos" CssStyle=" form-control" runat="server" type="number"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row hidden">
|
|
<label class="col-md-4">Anticipo:</label>
|
|
<div class="col-md-8">
|
|
<asp:TextBox ID="TxtAnticipo" CssStyle=" form-control" runat="server" type="decimal"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<asp:Button ID="BtnGuardar" OnClick="UpdateContrato" runat="server" CssClass="btn btn-primary"
|
|
Text="Actualizar"
|
|
ValidationGroup="GrpGuardar"></asp:Button>
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
</div>
|
|
|
|
<div style="display: none">
|
|
|
|
<asp:UpdatePanel ID="UpCommando" runat="server">
|
|
<ContentTemplate>
|
|
<asp:Button runat="server" ID="BtnModal" OnClick="MostrarModal"></asp:Button>
|
|
<asp:HiddenField runat="server" ID="CveContrato" Value="-1" ClientIDMode="Static" />
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
</div>
|
|
<asp:HiddenField runat="server" ID="HidModClienteNombre" ClientIDMode="Static" />
|
|
<asp:HiddenField runat="server" ID="HidModCveCliente" ClientIDMode="Static" />
|
|
</asp:Content>
|
|
|
|
<asp:Content ID="Content5" ContentPlaceHolderID="JS" runat="Server">
|
|
<script src="https://cdn.amcharts.com/lib/5/index.js"></script>
|
|
<script src="https://cdn.amcharts.com/lib/5/xy.js"></script>
|
|
<script src="https://cdn.amcharts.com/lib/5/themes/Animated.js"></script>
|
|
<script>
|
|
// Create root element
|
|
// https://www.amcharts.com/docs/v5/getting-started/#Root_element
|
|
var root = am5.Root.new("chartdiv");
|
|
|
|
var am5locales_es_ES = {
|
|
"Jan": "Enero",
|
|
"Feb": "Febrero",
|
|
"Mar": "Marzo",
|
|
"Apr": "Abril",
|
|
"May": "Mayo",
|
|
"Jun": "Junio",
|
|
"Jul": "Julio",
|
|
"Aug": "Agosto",
|
|
"Sep": "Septiembre",
|
|
"Oct": "Octubre",
|
|
"Nov": "Noviembre",
|
|
"Dec": "Diciembre",
|
|
|
|
"January": "Enero",
|
|
"February": "Febrero",
|
|
"March": "Marzo",
|
|
"April": "Abril",
|
|
"June": "Junio",
|
|
"July": "Julio",
|
|
"August": "Agosto",
|
|
"September": "Septiembre",
|
|
"October": "Octubre",
|
|
"November": "Noviembre",
|
|
"December": "Diciembre",
|
|
|
|
};
|
|
|
|
function cargaDiagramaGrant(data, categorias, TipoVista) {
|
|
|
|
am5.ready(function () {
|
|
//SI YA HAY GRAFICA, QUITA LA ACTUAL PARA HACER UNA NUEVA
|
|
root.container.children.clear();
|
|
|
|
root.dateFormatter.setAll({
|
|
dateFormat: "dd/MM/yyyy HH:mm",
|
|
dateFields: ["valueX", "openValueX"]
|
|
});
|
|
|
|
root.locale = am5locales_es_ES;
|
|
|
|
// Set themes
|
|
// https://www.amcharts.com/docs/v5/concepts/themes/
|
|
root.setThemes([
|
|
am5themes_Animated.new(root)
|
|
]);
|
|
|
|
// Create chart
|
|
// https://www.amcharts.com/docs/v5/charts/xy-chart/
|
|
var chart = root.container.children.push(am5xy.XYChart.new(root, {
|
|
panX: false,
|
|
panY: false,
|
|
wheelX: "panX",
|
|
wheelY: "zoomX",
|
|
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, {
|
|
centerX: am5.p50,
|
|
x: am5.p50
|
|
}))
|
|
|
|
var colors = chart.get("colors");
|
|
|
|
// 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
|
|
})
|
|
})
|
|
);
|
|
|
|
yAxis.data.setAll(categorias);
|
|
|
|
var dateAxis = am5xy.DateAxis.new(root, {
|
|
baseInterval: { timeUnit: "minute", count: 1 },
|
|
renderer: am5xy.AxisRendererX.new(root, {
|
|
minorGridEnabled: true,
|
|
minGridDistance: 90
|
|
})
|
|
});
|
|
|
|
var xAxis = chart.xAxes.push(
|
|
dateAxis
|
|
);
|
|
|
|
chart.topAxesContainer.children.push(dateAxis);
|
|
|
|
// Add series
|
|
// https://www.amcharts.com/docs/v5/charts/xy-chart/series/
|
|
var series = chart.series.push(am5xy.ColumnSeries.new(root, {
|
|
xAxis: xAxis,
|
|
yAxis: yAxis,
|
|
openValueXField: "fromDate",
|
|
valueXField: "toDate",
|
|
categoryYField: "category",
|
|
sequencedInterpolation: true
|
|
}));
|
|
|
|
series.columns.template.setAll({
|
|
templateField: "columnSettings",
|
|
strokeOpacity: 0,
|
|
tooltipText: "{category}: {openValueX} - {valueX}"
|
|
});
|
|
|
|
series.data.processor = am5.DataProcessor.new(root, {
|
|
dateFields: ["fromDate", "toDate"],
|
|
dateFormat: "yyyy-MM-dd HH:mm"
|
|
});
|
|
series.data.setAll(data);
|
|
|
|
// Add scrollbars
|
|
//chart.set("scrollbarX", am5.Scrollbar.new(root, {
|
|
// orientation: "horizontal"
|
|
//}));
|
|
|
|
// Scrollbar X
|
|
var scrollbarX = am5.Scrollbar.new(root, {
|
|
orientation: "horizontal"
|
|
});
|
|
|
|
var scrollbarY = am5.Scrollbar.new(root, {
|
|
orientation: "vertical"
|
|
});
|
|
|
|
chart.set("scrollbarX", scrollbarX);
|
|
chart.bottomAxesContainer.children.push(scrollbarX);
|
|
|
|
chart.set("scrollbarY", scrollbarY);
|
|
|
|
|
|
series.events.on("datavalidated", function (ev) {
|
|
let cellSize = 45;
|
|
|
|
if (TipoVista == 1) {
|
|
cellSize = 60;
|
|
}
|
|
//let series = ev.target;
|
|
//let chart = series.chart;
|
|
let xAxis = chart.xAxes.getIndex(0);
|
|
|
|
// Calculate how we need to adjust chart height
|
|
let chartHeight = categorias.length * cellSize + xAxis.height() + chart.get("paddingTop", 0) + chart.get("paddingBottom", 0);
|
|
|
|
// Set it on chart's container
|
|
chart.root.dom.style.height = chartHeight + "px";
|
|
});
|
|
//root.language.setTranslationAny("May", "Mayo");
|
|
|
|
// Make stuff animate on load
|
|
// https://www.amcharts.com/docs/v5/concepts/animations/
|
|
series.appear();
|
|
chart.appear(1000, 100);
|
|
|
|
}); // end am5.ready()
|
|
}
|
|
|
|
var PrimeraCargaCalendario = true;
|
|
var currentUpdateEvent;
|
|
var addStartDate;
|
|
var addEndDate;
|
|
var globalAllDay;
|
|
var view = null;
|
|
var date = null;
|
|
|
|
function InitCalendar() {
|
|
$(document).ready(function () {
|
|
Calendario();
|
|
});
|
|
}
|
|
|
|
function selectDate(start, end, allDay) {
|
|
}
|
|
|
|
function updateEvent(event, element) {
|
|
$('#<%=TxtCantidadPasajeros.ClientID%>').val(event.CantidadPasajeros);
|
|
$('#<%=TxtFolio.ClientID%>').val(event.NumeroContrato);
|
|
$('#<%=TxtObservaciones.ClientID%>').val(event.title);
|
|
$('#<%=TxtDescripcion.ClientID%>').val(event.title);
|
|
$('#<%=TxtUbicacion.ClientID%>').val(event.NombreAcercamiento);
|
|
|
|
<%--$('#<%=TxtFechaSalida.ClientID%>').val(event.start._i);
|
|
$('#<%=TxtFechaRegreso.ClientID%>').val(event.end._i);--%>
|
|
|
|
$('#<%=TxtFechaSalida.ClientID%>').val(formatearFechaISO(event.start._i));
|
|
$('#<%=TxtFechaRegreso.ClientID%>').val(formatearFechaISO(event.FechaFinal));
|
|
|
|
$('#<%=DdlClientes.ClientID%>').val(event.CveCliente);
|
|
$('#<%=DdlAF.ClientID%>').val(event.CveActivoFijo);
|
|
$('#<%=DdlChofer.ClientID%>').val(event.CvePersonal);
|
|
$('#<%=DdlChofer2.ClientID%>').val(event.CvePersonal2);
|
|
$('#<%=DdlEstatusContrato.ClientID%>').val(event.CveEventoEstatus);
|
|
$('#<%=TxtDolares.ClientID%>').val(event.Dolares);
|
|
$('#<%=TxtPesos.ClientID%>').val(event.Pesos);
|
|
$('#<%=TxtAnticipo.ClientID%>').val(event.Anticipo);
|
|
$('#<%=CveContrato.ClientID%>').val(event.id);
|
|
|
|
|
|
if (event.NombreComercial !== null) {
|
|
$('#HidModClienteNombre').val('');
|
|
} else {
|
|
$('#HidModClienteNombre').val(event.NombreComercial);
|
|
}
|
|
|
|
$('#HidModCveCliente').val(event.CveCliente);
|
|
|
|
$('#<%=BtnModal.ClientID%>').click();
|
|
}
|
|
|
|
|
|
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 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}`;
|
|
}
|
|
|
|
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();
|
|
}
|
|
|
|
eventToUpdate.start = eventToUpdate.start.toJSON();
|
|
eventToUpdate.end = eventToUpdate.end.toJSON(); //endDate;
|
|
eventToUpdate.allDay = event.allDay;
|
|
|
|
PageMethods.ActualizaEvento(eventToUpdate, UpdateTimeSuccess);
|
|
}
|
|
|
|
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);
|
|
}
|
|
|
|
function Calendario() {
|
|
var date = new Date();
|
|
var d = date.getDate();
|
|
var m = date.getMonth();
|
|
var y = date.getFullYear();
|
|
var h = {};
|
|
|
|
if ($('#calendar').width() <= 400) {
|
|
$('#calendar').addClass("mobile");
|
|
h = {
|
|
left: 'title, prev, next',
|
|
center: '',
|
|
right: 'today,month,agendaWeek,agendaDay'
|
|
};
|
|
} else {
|
|
$('#calendar').removeClass("mobile");
|
|
|
|
h = {
|
|
left: 'title',
|
|
center: '',
|
|
right: 'prev,next,today,month,agendaWeek,agendaDay'
|
|
};
|
|
}
|
|
|
|
$('#calendar').fullCalendar('destroy');
|
|
$('#calendar').fullCalendar({
|
|
header: h,
|
|
monthNames: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
|
|
monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
|
|
dayNames: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
|
|
dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb'],
|
|
buttonText: {
|
|
today: 'Hoy',
|
|
week: 'Semana',
|
|
month: 'Mes',
|
|
day: 'Día'
|
|
},
|
|
eventClick: updateEvent,
|
|
selectable: true,
|
|
selectHelper: true,
|
|
select: selectDate,
|
|
editable: true,
|
|
minTime: "00:00:00",
|
|
maxTime: "24:00:00",
|
|
events: {
|
|
url: '/Ashx/CargaEventos.ashx',
|
|
type: 'GET',
|
|
data: {
|
|
U: ' <%= UsuarioActual.CveUsuario %>',
|
|
E: '<%= UsuarioActual.CveEmpresa %>',
|
|
tipoVista: '<%= RBTipoVista.Text %>',
|
|
METODO: 'contrato_transportes',
|
|
CveUsuarioPara: $('#DdlTecnico').val(),
|
|
CveSubProyecto: $('#DdlSubProyecto').val()
|
|
}
|
|
},
|
|
eventDrop: eventDropped,
|
|
eventResize: eventResized
|
|
});
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
</asp:Content>
|