1093 lines
58 KiB
Plaintext
1093 lines
58 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" id="dvFiltros">
|
|
<%-- 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="100%"
|
|
data-metodo="getcliente"
|
|
runat="server" DataTextField="NombreComercial" DataValueField="CveCliente"
|
|
CssStyle="width: 100%;"
|
|
UsaWebService="true" Enabled="false"></ADS:Dropdownlost>
|
|
</div>
|
|
<%-- Estatus --%>
|
|
<label class="col-md-1 ">Estatus:</label>
|
|
<div class="col-md-1">
|
|
<asp:DropDownList ID="DdlEstatusConsulta" data-text="Todos" AppendDataBoundItems="true" ClientIDMode="Static"
|
|
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-1">
|
|
<asp:DropDownList ID="DdlSubProyectos" data-text="Todos" AppendDataBoundItems="true"
|
|
DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control ddlFiltros input-sm select2me Widthall" ClientIDMode="Static"
|
|
Style="width: 100%;" runat="server">
|
|
</asp:DropDownList>
|
|
</div>
|
|
<%-- Tipo de Unidad --%>
|
|
<label class="col-md-1 ">Tipo de Unidad</label>
|
|
<div class="col-md-1">
|
|
<asp:DropDownList ID="DdlTipoUnidad" data-text="Todos" AppendDataBoundItems="true"
|
|
DataTextField="TipoActivoFijo" DataValueField="CveTipoActivoFijo" CssClass="form-control ddlFiltros input-sm select2me Widthall" ClientIDMode="Static"
|
|
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" ClientIDMode="Static"
|
|
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" OnClientClick="TabAltaClicked">
|
|
<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">
|
|
|
|
<asp:UpdatePanel runat="server" ID="UpCalendario" UpdateMode="Conditional">
|
|
<ContentTemplate>
|
|
<div id="calendar">
|
|
</div>
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
|
|
</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>
|
|
|
|
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
|
|
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvContratos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvContratos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
|
</div>
|
|
|
|
<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,Moneda,CveSubProyecto,NumChoferes,CveVentaRemision,RemisionSerieFolio,RemisionSaldo,TipoEstatus">
|
|
<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("CodigoAF") %>'></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" style="width: 950px;">
|
|
<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">
|
|
<div class="col-md-6">
|
|
<div class="row my-1">
|
|
|
|
<label class="col-md-3 bold text-primary">Folio:</label>
|
|
<div class="col-md-2">
|
|
<asp:TextBox ID="TxtFolio" runat="server" Width="80px" Font-Bold="true" CssClass="textaslabel"></asp:TextBox>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<asp:HyperLink runat="server" Text="" Target="_blank" ID="HypRemision" CssClass="Texto"></asp:HyperLink>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<asp:Label runat="server" ID="LblSaldo"></asp:Label>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row my-1">
|
|
<label class="col-md-3">Cliente</label>
|
|
<div class="col-md-9">
|
|
<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 my-1">
|
|
<label class="col-md-3">
|
|
<asp:Label runat="server" ID="LblSubProyectoModal"></asp:Label>
|
|
</label>
|
|
<div class="col-md-9">
|
|
<asp:DropDownList runat="server" ID="DdlSubProyectoModal" Width="100%" DataValueField="CveSubProyecto" DataTextField="SubProyecto" CssClass="select2me"></asp:DropDownList>
|
|
<asp:RequiredFieldValidator ID="RfvDdlSubProyectoModal" runat="server" ControlToValidate="DdlSubProyectoModal" InitialValue="-1" ErrorMessage="Campo sub Proyecto requerido." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
|
<ajax:ValidatorCalloutExtender ID="VCERfvDdlSubProyectoModal" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlSubProyectoModal" Width="300px"></ajax:ValidatorCalloutExtender>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<label class="col-md-3">Servicio:</label>
|
|
<div class="col-md-9">
|
|
<asp:TextBox ID="TxtDescripcion" runat="server" Width="100%" TextMode="MultiLine"
|
|
Rows="2"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
<label class="col-md-3">Observaciones:</label>
|
|
<div class="col-md-9">
|
|
<asp:TextBox ID="TxtObservaciones" runat="server" Width="100%" TextMode="MultiLine" MaxLength="500"
|
|
Rows="6"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<asp:Label ID="LbEstatus" runat="server" class="col-md-3">Estatus:</asp:Label>
|
|
<div class="col-md-9">
|
|
<asp:DropDownList ID="DdlEstatusContrato" Enabled="false" 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 my-1">
|
|
<label class="col-md-3">Moneda:</label>
|
|
<div class="col-md-9">
|
|
<asp:TextBox ID="TxtMoneda" runat="server" Width="100%" Enabled="false"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-6">
|
|
|
|
<div class="row ">
|
|
<label class="col-md-3"># Pasajeros:</label>
|
|
<div class="col-md-9">
|
|
<asp:TextBox ID="TxtCantidadPasajeros" runat="server" Width="80px"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
<div class="row my-1">
|
|
<label class="col-md-3">Lugar de Salida:</label>
|
|
<div class="col-md-9">
|
|
<asp:TextBox ID="TxtUbicacion" runat="server" Width="100%"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<label class="col-md-3">Fecha Salida:</label>
|
|
<div class="col-md-9">
|
|
<asp:TextBox ID="TxtFechaSalida" runat="server" CssClass="form-control"
|
|
Width="100%"></asp:TextBox>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="row my-1">
|
|
<label class="col-md-3">Fecha Regreso:</label>
|
|
<div class="col-md-9">
|
|
<asp:TextBox ID="TxtFechaRegreso" runat="server" CssClass="form-control"
|
|
Width="100%"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="row my-1">
|
|
<label class="col-md-3">Tipo Unidad</label>
|
|
<div class="col-md-9">
|
|
<asp:DropDownList ID="DdlTipoAF" DataValueField="CveTipoActivoFijo"
|
|
DataTextField="TipoActivoFijo" Class="form-control input-inline"
|
|
Width="100%" runat="server" Enabled="true"
|
|
AutoPostBack="true"
|
|
OnSelectedIndexChanged="DdlTipoAF_SelectedIndexChanged">
|
|
</asp:DropDownList>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row my-1" id="DivAF" runat="server">
|
|
<label class="col-md-3">Unidad</label>
|
|
<div class="col-md-9">
|
|
<asp:DropDownList ID="DdlAF" DataValueField="CveActivoFijo"
|
|
DataTextField="CodDesc" Class="form-control select2me"
|
|
Width="100%" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlAF_SelectedIndexChanged">
|
|
</asp:DropDownList>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row my-1" runat="server" id="DVMotivoCambioAF" visible="false">
|
|
<label class="col-md-3">Motivo Cambio:</label>
|
|
<div class="col-md-9">
|
|
<asp:TextBox ID="TxtMotivoCambioUnidad" CssStyle=" form-control" runat="server" MaxLength="2000" Width="100%"></asp:TextBox>
|
|
<asp:RequiredFieldValidator ID="RfvTxtMotivoCambioUnidad" runat="server" ControlToValidate="TxtMotivoCambioUnidad" ErrorMessage="Campo Motivo Cambio requerido." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
|
<ajax:ValidatorCalloutExtender ID="VCERfvTxtMotivoCambioUnidad" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtMotivoCambioUnidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row my-1">
|
|
<label class="col-md-3">Chofer 1</label>
|
|
<div class="col-md-9">
|
|
<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:DropDownList>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row my-1">
|
|
<label class="col-md-3">Chofer 2 <asp:CheckBox runat="server" ID="chkSegundoChofer" AutoPostBack="true" OnCheckedChanged="chkSegundoChofer_CheckedChanged" /></label>
|
|
<div class="col-md-9" runat="server" id="DVChofer2">
|
|
<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 hidden">
|
|
<label class="col-md-3">Costo dólares:</label>
|
|
<div class="col-md-9">
|
|
<asp:TextBox ID="TxtDolares" CssStyle=" form-control" runat="server" type="number"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row hidden">
|
|
<label class="col-md-3">Costo pesos:</label>
|
|
<div class="col-md-9">
|
|
<asp:TextBox ID="TxtPesos" CssStyle=" form-control" runat="server" type="number"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row hidden">
|
|
<label class="col-md-3">Anticipo:</label>
|
|
<div class="col-md-9">
|
|
<asp:TextBox ID="TxtAnticipo" CssStyle=" form-control" runat="server" type="decimal"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
|
|
</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" UpdateMode="Conditional">
|
|
<ContentTemplate>
|
|
<asp:Button runat="server" ID="BtnModal" OnClick="MostrarModal"></asp:Button>
|
|
<asp:HiddenField runat="server" ID="HdnCveContrato" Value="-1" ClientIDMode="Static" />
|
|
|
|
<%--<asp:Button runat="server" ID="BtnDdlTipoAF" OnClick="BtnDdlTipoAF_Click" ClientIDMode="Static"></asp:Button>--%>
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
</div>
|
|
<asp:HiddenField runat="server" ID="HdnNumContrato" ClientIDMode="Static" />
|
|
<asp:HiddenField runat="server" ID="HidModClienteNombre" ClientIDMode="Static" />
|
|
<asp:HiddenField runat="server" ID="HidModCveCliente" ClientIDMode="Static" />
|
|
<asp:HiddenField runat="server" ID="HidCurrentMonth" ClientIDMode="Static" Value="-1" />
|
|
<asp:HiddenField runat="server" ID="HidCurrentYear" ClientIDMode="Static" Value="-1" />
|
|
<asp:HiddenField runat="server" ID="HidCveTipoAF" Value="-1" ClientIDMode="Static" />
|
|
<asp:HiddenField runat="server" ID="HidNumChoferes" Value="-1" ClientIDMode="Static" />
|
|
<asp:HiddenField runat="server" ID="HidRemisionSerieFolio" Value="-1" ClientIDMode="Static" />
|
|
<asp:HiddenField runat="server" ID="HidCveVentaRemision" Value="-1" ClientIDMode="Static" />
|
|
<asp:HiddenField runat="server" ID="HidRemisionSaldo" Value="-1" ClientIDMode="Static" />
|
|
<asp:HiddenField runat="server" ID="HidCveAF" Value="-1" ClientIDMode="Static" />
|
|
<asp:HiddenField runat="server" ID="HidCveAFDes" Value="-1" 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",
|
|
|
|
};
|
|
var dateAxis;
|
|
|
|
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: true,
|
|
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);
|
|
|
|
// Obtener valores de las cajas de texto
|
|
var fechaI = document.getElementById('<%= txtFechaI.ClientID %>').value;
|
|
var fechaF = document.getElementById('<%= txtFechaF.ClientID %>').value;
|
|
|
|
// Convertir valores a objetos Date
|
|
var minDate = new Date(fechaI.split("/").reverse().join("-"));
|
|
var maxDate = new Date(fechaF.split("/").reverse().join("-"));
|
|
|
|
dateAxis = am5xy.DateAxis.new(root, {
|
|
baseInterval: { timeUnit: "day", count: 1 },
|
|
renderer: am5xy.AxisRendererX.new(root, {
|
|
minorGridEnabled: true,
|
|
minGridDistance: 90
|
|
}),
|
|
min: minDate.getTime(),
|
|
max: maxDate.getTime()
|
|
//min: new Date(2024, 6, 15).getTime(),
|
|
//max: new Date(2024, 6, 31).getTime()
|
|
});
|
|
|
|
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: "UNIDAD: {category}-{unidad} \nCONTRATO: {contrato} \nDURACIÓN: {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);
|
|
|
|
|
|
//MOSTRAR MODAL DE CONTRATO AL HACER CLICK
|
|
series.columns.template.events.on("click", e => {
|
|
let cveContrato = e.target.dataItem.dataContext.cveContrato;
|
|
|
|
$('#<%=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();
|
|
|
|
fetch(url + parametros).then(response => response.json()).then(json => {
|
|
updateEvent(json[0], null, false);
|
|
}).catch(err => console.log('Solicitud fallida', err));
|
|
});
|
|
|
|
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";
|
|
|
|
// ev.target.get("xAxis").zoomToValues(new Date(2024,6,15).getTime(), new Date(2024,6,20).getTime());
|
|
});
|
|
|
|
// Make stuff animate on load
|
|
// https://www.amcharts.com/docs/v5/concepts/animations/
|
|
series.appear();
|
|
chart.appear(1000, 100);
|
|
|
|
|
|
}); // end am5.ready()
|
|
}
|
|
|
|
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;
|
|
var currentUpdateEvent;
|
|
var addStartDate;
|
|
var addEndDate;
|
|
var globalAllDay;
|
|
var view = null;
|
|
var date = null;
|
|
|
|
function InitCalendar() {
|
|
$(document).ready(function () {
|
|
|
|
let mes = parseInt($('#<%=HidCurrentMonth.ClientID%>').val());
|
|
let anio = parseInt($('#<%=HidCurrentYear.ClientID%>').val());
|
|
|
|
Calendario(mes, anio);
|
|
|
|
});
|
|
}
|
|
|
|
function selectDate(start, end, allDay) {
|
|
}
|
|
|
|
function updateEvent(event, element, esCalendario = true) {
|
|
|
|
$('#<%=TxtCantidadPasajeros.ClientID%>').val(event.CantidadPasajeros);
|
|
$('#<%=TxtFolio.ClientID%>').val(event.NumeroContrato);
|
|
$('#<%=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 {
|
|
$('#<%=TxtFechaSalida.ClientID%>').val(formatearFechaISO(event.start));
|
|
}
|
|
$('#<%=TxtFechaRegreso.ClientID%>').val(formatearFechaISO(event.FechaFinal));
|
|
$('#<%=DdlClientes.ClientID%>').val(event.CveCliente);
|
|
|
|
$('#<%=DdlChofer.ClientID%>').val(event.CvePersonal);
|
|
|
|
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);
|
|
$('#<%=TxtMoneda.ClientID%>').val(event.Moneda);
|
|
|
|
//document.getElementById('<%= TxtMoneda.ClientID %>').value = event.Moneda;
|
|
|
|
$('#<%=TxtAnticipo.ClientID%>').val(event.Anticipo);
|
|
$('#<%=HdnCveContrato.ClientID%>').val(event.id);
|
|
$('#<%=DdlTipoAF.ClientID%>').val(event.CveTipoAF);
|
|
$('#<%=DdlSubProyectoModal.ClientID%>').val(event.CveSubProyecto);
|
|
|
|
$('#<%= HidCveTipoAF.ClientID%>').val($('#<%=DdlTipoAF.ClientID%>').val());
|
|
|
|
<%--$('#<%=BtnDdlTipoAF.ClientID%>').click();--%>
|
|
<%--$('#<%=DdlAF.ClientID%>').val(event.CveActivoFijo);--%>
|
|
|
|
$('#HidNumChoferes').val(event.NumChoferes);
|
|
|
|
$('#HidRemisionSerieFolio').val(event.RemisionSerieFolio);
|
|
$('#HidCveVentaRemision').val(event.CveVentaRemision);
|
|
$('#HidRemisionSaldo').val(event.RemisionSaldo);
|
|
$('#HdnNumContrato').val(event.NumeroContrato);
|
|
|
|
if (event.CveActivoFijo > 0) {
|
|
$('#HidCveAF').val(event.CveActivoFijo);
|
|
} else {
|
|
$('#HidCveAF').val('-1');
|
|
}
|
|
|
|
|
|
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 24 horas
|
|
let horas = fecha.getHours().toString().padStart(2, '0');
|
|
let minutos = fecha.getMinutes().toString().padStart(2, '0');
|
|
let segundos = fecha.getSeconds().toString().padStart(2, '0');
|
|
|
|
// Combinar la fecha y la hora
|
|
return `${dia}/${mes}/${año} ${horas}:${minutos}:${segundos}`;
|
|
}
|
|
|
|
|
|
//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(mes = -1, anio = -1) {
|
|
|
|
let fechaActual = new Date();
|
|
if (mes === -1) {
|
|
mes = fechaActual.getMonth() + 1;
|
|
}
|
|
if (anio === -1) {
|
|
anio = fechaActual.getFullYear();
|
|
}
|
|
|
|
|
|
let mesFormateado = ('0' + mes).slice(-2);
|
|
let fechaInicio = `${anio}-${mesFormateado}-01`;
|
|
|
|
var date = new Date();
|
|
var d = date.getDate();
|
|
var m = date.getMonth();
|
|
var y = date.getFullYear();
|
|
var h = {};
|
|
|
|
//alert(fechaInicio);
|
|
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({
|
|
defaultDate: fechaInicio,
|
|
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",
|
|
eventOverlap: false, // No permitir la superposición de eventos
|
|
slotEventOverlap: false, // No permitir la superposición en vistas de agenda
|
|
eventRender: function (event, element) {
|
|
element.css({
|
|
'margin-bottom': '1px',
|
|
'margin-left': '1px',
|
|
'white-space': 'normal', // Permitir el ajuste de texto
|
|
'height': 'auto', // Ajustar la altura automáticamente
|
|
'overflow': 'hidden' // Ocultar cualquier desbordamiento
|
|
});
|
|
element.find('.fc-title').css({
|
|
'white-space': 'normal', // Asegurar que el texto se ajuste
|
|
'line-height': '1.2em' // Ajustar la altura de línea para mejor legibilidad
|
|
});
|
|
|
|
var firstFourChars = event.title.substring(0, 4);
|
|
var restOfTitle = event.title.substring(4);
|
|
|
|
// Aplica el HTML personalizado al elemento del título del evento
|
|
//element.find('.fc-title').html('<span style="color:' + event.colorfont +';">' + firstFourChars + '</span>' + restOfTitle);
|
|
},
|
|
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(),
|
|
CveCliente: $('#C_DdlCliente_Value').val(),
|
|
CveContratoEstatus: $('#DdlEstatusConsulta').val(),
|
|
CveTipoActivoFijo: $('#DdlTipoUnidad').val(),
|
|
CvePersonal: $('#DdlChoferFiltro').val()
|
|
}
|
|
},
|
|
eventDrop: eventDropped,
|
|
eventResize: eventResized,
|
|
viewRender: function (view, element) {
|
|
|
|
let pointDate = view.intervalStart;
|
|
let currentMonth = pointDate.month() + 1;
|
|
let currentYear = pointDate.year();
|
|
|
|
$('#<%=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);
|
|
|
|
|
|
let fechaInicio = `${anio}-${mesFormateado}-01`;
|
|
|
|
return fechaInicio;
|
|
}
|
|
|
|
|
|
function TabAltaClicked(sender, e) {
|
|
|
|
setTimeout(function () {
|
|
InitCalendar();
|
|
|
|
}, 10);
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
</asp:Content>
|