cambios en apidenuncias
This commit is contained in:
399
.codex-links/WebIntranet/desgSolicitudesComunicaciones.aspx
Normal file
399
.codex-links/WebIntranet/desgSolicitudesComunicaciones.aspx
Normal file
@@ -0,0 +1,399 @@
|
||||
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.master" CodeBehind="desgSolicitudesComunicaciones.aspx.vb" Inherits="WebIntranet.desgSolicitudesComunicaciones" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="server">
|
||||
|
||||
<asp:HiddenField ID="inciActual" runat="server" value="" />
|
||||
<div id="divConfirmacion" style="position: fixed; z-index: 10;top:0; height: 100vh; width: 100%; background-color: #000000cc; display: none; justify-content: center; align-items: center;">
|
||||
</div>
|
||||
<div class="row pag">
|
||||
<div id="navLateral" class="col-3">
|
||||
<ul>
|
||||
<li id='intPicadaBL' runat="server" class='obtListLat'><a onclick="redirigir()" href="intPicada.aspx">Introducir picada</a></li>
|
||||
<li id='intPicadaPersBL' runat="server" class='obtListLat'><a onclick="redirigir()" href="intPicadaPersonal.aspx">Introducir picada a personal</a></li>
|
||||
<li id='informPicadasBL' class='obtListLat'><a onclick="redirigir()" href="listPicadas.aspx">Informe de listado de picadas</a></li>
|
||||
<li id='informIncidenciasBL' class='obtListLat listActivo'><a onclick="redirigir()" href="listSolicitudesComunicaciones.aspx">Informe de permisos y comunicaciones</a></li>
|
||||
<%--<li id='bolsaDeHorasBL' runat="server" class='obtListLat'><a onclick="redirigir()" href="/bolsaDeHoras.aspx">Bolsa de horas extraordinarias</a></li>--%>
|
||||
<li id='VAAPBCBL' runat="server" class='obtListLat'><a onclick="redirigir()" href="/VAAPBC.aspx">Situación de vacaciones, asuntos particulares y días compensatorios</a></li>
|
||||
<li id='VAAPBCBLpers' runat="server" class='obtListLat'><a onclick="redirigir()" href="/VAAPBCpers.aspx">Situación de vacaciones, asuntos particulares y días compensatorios</a></li>
|
||||
<li id='resumenIncidenciasEntreFechasBL' class='obtListLat'><a onclick="redirigir()" href="/resumenSolicitudesComunicacionesEntreFechas.aspx">Resumen de permisos y comunicaciones entre fechas</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="DesgIncidencia" class="col">
|
||||
<p class="tituloMobile">Desglose de permiso o incidencia</p>
|
||||
<div class="migasDePan">
|
||||
<ul>
|
||||
<li class="migaActiva">/ Control horario</li>
|
||||
<li><a onclick="redirigir()" href="listSolicitudesComunicaciones.aspx">/ Informe de permisos y comunicaciones</a></li>
|
||||
<li class="migaActiva">/ Desglose de permiso o incidencia</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="ModInc" style="background-color: #000000a6; display: none; position: fixed; z-index: 15; top: 0; left: 0; width: 100%; height: 100vh;">
|
||||
</div>
|
||||
|
||||
<div style="display: flex;">
|
||||
<p style="text-align: center; width: 100%; font-weight: bold;" id="mensajeDesgAsis"></p>
|
||||
</div>
|
||||
<div>
|
||||
<div id="tablaIncidencia" style="width:800px;max-width:100%; margin-inline:auto" runat="server" class="cajaTabla">
|
||||
</div>
|
||||
</div>
|
||||
<div id="btnModIncDiv" runat="server" style="display: flex; justify-content: center; margin-top: 15px;"></div>
|
||||
<div id="btnBorrarIncDiv" runat="server" style="display: flex; justify-content: center; margin-top: 15px;"></div>
|
||||
|
||||
<div id="listEstadosInc">
|
||||
<div class="cajaTabla" id="tablaEstadoInc" runat="server">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
var inciActual = ""
|
||||
|
||||
window.addEventListener("load", function (event) {
|
||||
|
||||
inciActual = JSON.parse($("#inciActual").val())
|
||||
|
||||
if (sessionStorage.getItem("mensajeReload") != null) {
|
||||
mensajeReload(sessionStorage.getItem("mensajeReload"))
|
||||
sessionStorage.removeItem("mensajeReload")
|
||||
}
|
||||
})
|
||||
var fichero = ""
|
||||
function archivo(origen) {
|
||||
var file = $('#' + origen)[0].files[0];
|
||||
getBase64(file);
|
||||
function getBase64(file) {
|
||||
var reader = new FileReader();
|
||||
if (file) {
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
reader.onload = function () {
|
||||
//console.log(reader.result);
|
||||
fichero = reader.result.substr(reader.result.indexOf(',') + 1);
|
||||
};
|
||||
reader.onerror = function (error) {
|
||||
// console.log('Error: ', error);
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
function mensajeReload(mensaje) {
|
||||
$('#mensajeDesgAsis').css('color', 'green')
|
||||
document.getElementById('mensajeDesgAsis').innerHTML = mensaje
|
||||
}
|
||||
function CambiarEstado() {
|
||||
//var usuario = document.getElementById('usuarioNav').innerHTML
|
||||
var observaciones = document.getElementById('obsEstado').value
|
||||
var idEstado = parseInt(document.getElementById('selEstadoAsis').value)
|
||||
var fcIn = $('#FdI-I')[0].innerText.substring(8)
|
||||
var fcFn = ($('#FdI-F')[0] != undefined) ? $('#FdI-F')[0].innerText.substring(7) : fcIn
|
||||
var horaIniMan = ($('#HdI-M')[0] != undefined) ? $('#HdI-M')[0].children[1].innerText.substring(8) : "00:00"
|
||||
var horaFinMan = ($('#HdI-M')[0] != undefined) ? $('#HdI-M')[0].children[2].innerText.substring(7) : "00:00"
|
||||
var horaTotMan = ($('#HdI-M')[0] != undefined) ? $('#HdI-M')[0].children[3].innerText.substring(7) : "00:00"
|
||||
var horaIniTar = ($('#HdI-T')[0] != undefined) ? $('#HdI-T')[0].children[1].innerText.substring(8) : "00:00"
|
||||
var horaFinTar = ($('#HdI-T')[0] != undefined) ? $('#HdI-T')[0].children[2].innerText.substring(7) : "00:00"
|
||||
var horaTotTar = ($('#HdI-T')[0] != undefined) ? $('#HdI-T')[0].children[3].innerText.substring(7) : "00:00"
|
||||
var nif = ""
|
||||
var expediente = ""
|
||||
const queryString = window.location.search;
|
||||
const urlParams = new URLSearchParams(queryString)
|
||||
if ((document.getElementById('selEstadoAsis').options[document.getElementById('selEstadoAsis').selectedIndex].text == "RECHAZADA") && (observaciones == "")) {
|
||||
$('#mensajeDesgAsis').css('color', 'red')
|
||||
document.getElementById('mensajeDesgAsis').innerHTML = "Rechazar una incidencia debe ir acompañado de una justificación en el campo de 'Observación estado'"
|
||||
}
|
||||
else {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/desgSolicitudesComunicaciones.aspx/ModificarEstado",
|
||||
data: '{"i":"' + urlParams.get("idAsis") + '","h":"' + urlParams.get("cl") + '","idEstado":' + idEstado + ',"FechaInicio":"' + fcIn + '","FechaFin":"' + fcFn + '","horainiciomanana":"' + horaIniMan + '",' +
|
||||
'"horafinmanana":"' + horaFinMan + '","horastrabajadasmanana":"' + horaTotMan + '","horainiciotarde":"' + horaIniTar + '","horafintarde":"' + horaFinTar + '","horastrabajadastarde":"' + horaTotTar + '",' +
|
||||
// ","nif":"'+nif+'","expediente":"'+ expediente + '",' +//
|
||||
'"observaciones": "' + observaciones + '","fichero":""}',
|
||||
async: true,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
success: function (result) {
|
||||
if (result.d != "") {
|
||||
if (result.d.includes("ERROR--")) {
|
||||
compEr(result.d)
|
||||
return
|
||||
}
|
||||
success = true
|
||||
DesgloseIncidencia = JSON.parse(result.d)
|
||||
if (DesgloseIncidencia[0].resultado == 0) {
|
||||
$("#ModInc").html("")
|
||||
$("#ModInc").css("display", "none")
|
||||
//MostrarDesgIncidencia()
|
||||
//$('#mensajeDesgAsis').css('color', 'green')
|
||||
////MostrarIncidencias()
|
||||
//MostrarDesgIncidencia()
|
||||
//document.getElementById('mensajeDesgAsis').innerHTML = DesgloseIncidencia[0].mensaje
|
||||
sessionStorage.setItem("mensajeReload", DesgloseIncidencia[0].mensaje)
|
||||
window.location.reload()
|
||||
}
|
||||
else {
|
||||
$("#ModInc").html("")
|
||||
$("#ModInc").css("display", "none")
|
||||
$('#mensajeDesgAsis').css('color', 'red')
|
||||
//MostrarIncidencias()
|
||||
//MostrarDesgIncidencia()
|
||||
document.getElementById('mensajeDesgAsis').innerHTML = DesgloseIncidencia[0].mensaje
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (result) {
|
||||
alert('error occured');
|
||||
//alert(result.responseText);
|
||||
$("#iconLoading").css("display", "none")
|
||||
//$(".Loading").hide()
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function totalHorasINM() {
|
||||
if (document.getElementById('inHdI-MI').value != "00:00") {
|
||||
var ini = document.getElementById('inHdI-MI').value
|
||||
var iniHoras = (ini.substring(0, 2) * 60) * 60
|
||||
var iniMins = ini.slice(-2) * 60
|
||||
ini = iniHoras + iniMins
|
||||
|
||||
var end = document.getElementById('inHdI-MF').value
|
||||
var endHoras = (end.substring(0, 2) * 60) * 60
|
||||
var endMins = end.slice(-2) * 60
|
||||
end = endHoras + endMins
|
||||
|
||||
var total = end - ini
|
||||
var h = Math.floor(total / 3600).toString()
|
||||
var m = Math.floor(total % 3600 / 60).toString()
|
||||
|
||||
total = h.padStart(2, "0") + ":" + m.padStart(2, "0")
|
||||
document.getElementById('inHdI-MT').innerText = total
|
||||
}
|
||||
}
|
||||
function totalHorasTardeINT() {
|
||||
if (document.getElementById('inHdI-TI').value != "00:00") {
|
||||
var ini = document.getElementById('inHdI-TI').value
|
||||
var iniHoras = (ini.substring(0, 2) * 60) * 60
|
||||
var iniMins = ini.slice(-2) * 60
|
||||
ini = iniHoras + iniMins
|
||||
|
||||
var end = document.getElementById('inHdI-TF').value
|
||||
var endHoras = (end.substring(0, 2) * 60) * 60
|
||||
var endMins = end.slice(-2) * 60
|
||||
end = endHoras + endMins
|
||||
|
||||
var total = end - ini
|
||||
var h = Math.floor(total / 3600).toString()
|
||||
var m = Math.floor(total % 3600 / 60).toString()
|
||||
|
||||
total = h.padStart(2, "0") + ":" + m.padStart(2, "0")
|
||||
document.getElementById('inHdI-TT').innerText = total
|
||||
}
|
||||
}
|
||||
function modInc() {
|
||||
|
||||
const queryString = window.location.search;
|
||||
const urlParams = new URLSearchParams(queryString)
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/desgSolicitudesComunicaciones.aspx/CargarDesgloseAsis",
|
||||
data: '{"i":"' + urlParams.get("idAsis") + '","h":"' + urlParams.get("cl") + '"}',
|
||||
async: true,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
success: function (result) {
|
||||
if (result.d != "") {
|
||||
if (result.d.Result.includes("ERROR--")) {
|
||||
var error = JSON.parse(result.d.Result)
|
||||
compEr(error.cuerpo)
|
||||
return
|
||||
}
|
||||
success = true
|
||||
|
||||
DesgloseIncidenciaComp = JSON.parse(result.d.Result)
|
||||
DesgloseIncidencia = DesgloseIncidenciaComp.cuerpo
|
||||
var html = ""
|
||||
|
||||
|
||||
var valorIncidencia = DesgloseIncidencia.idIncidenciaControlHorario
|
||||
var DiasCompletos = false
|
||||
var IntervaloDias = false
|
||||
var IntervaloHoras = false
|
||||
var InstanteTemporal = false
|
||||
var editable = false
|
||||
|
||||
//if (DesgloseIncidencia[0].IdEstadoActual == 6 || DesgloseIncidencia[0].IdEstadoActual == 3) {
|
||||
// editable = true
|
||||
//}
|
||||
|
||||
|
||||
|
||||
DiasCompletos = inciActual.AdmiteDiasCompletos
|
||||
IntervaloDias = inciActual.AdmiteRangosFechas
|
||||
IntervaloHoras = inciActual.AdmiteIntervaloHoras
|
||||
InstanteTemporal = inciActual.AdmiteInstanteTemporal
|
||||
|
||||
|
||||
sessionStorage.setItem("idAsistencia", DesgloseIncidencia.idAsistencia)
|
||||
if (DesgloseIncidencia.Observaciones == null) {
|
||||
DesgloseIncidencia.Observaciones = ""
|
||||
}
|
||||
|
||||
html += "<div class='cajaModInc'>" +
|
||||
//"<div style='margin-bottom:10px;'><a class='btnCerrarModInc' onclick='$(\"#ModInc\").html(\"\"); $(\"#ModInc\").css(\"display\",\"none\")'>x</a></div>" +
|
||||
"<table class='tablaPicadas tablaDesgSol'><tr id='inFdI' style=''>" +
|
||||
"<th colspan='2'>FECHA</th>"
|
||||
if (IntervaloDias == true) {
|
||||
html += "<td colspan='3' id='inFdI-I'style=''><span>Inicio: </span><input id='inpIniDesgIn' type='Date' id='inFdi-I' class='inFecha' value='" + DesgloseIncidencia.FechaInicio.substring(0, 10) + "'/></td>" +
|
||||
"<td colspan='3' id='inFdI-F'style=''><span>Final: </span><input id='inpFinDesgIn' type='Date' id='inFdi-F' class='inFecha' value='" + DesgloseIncidencia.FechaFin.substring(0, 10) + "'/></td></tr>"
|
||||
}
|
||||
else {
|
||||
html += "<td colspan='6' id='inFdI-I'style=''><input id='inpIniDesgIn' type='Date' id='inFdi-I' class='inFecha fechainiciosolo' value='" + DesgloseIncidencia.FechaInicio.substring(0, 10) + "'/></td>"
|
||||
|
||||
}
|
||||
html += "<tr><th colspan='2'>INCIDENCIA</th>" +
|
||||
"<td colspan='6'>" + DesgloseIncidencia.DesAsistencia + "</td></tr>"
|
||||
if (IntervaloHoras == true) {
|
||||
html += "<tr id='inHdI-M'style=''><th colspan='2'>HORARIO MAÑANA</th>" +
|
||||
"<td colspan='2'><span>Inicio: </span><input type='time' class='inHora' id='inHdI-MI' value='" + DesgloseIncidencia.HoraInicioManana + "'/></td>" +
|
||||
"<td colspan='2'><span>Final: </span><input type='time' onchange='totalHorasINM()' class='inHora' id='inHdI-MF' value='" + DesgloseIncidencia.HoraFinManana + "'/></td>" +
|
||||
"<td colspan='2'><span>Total: </span><span id='inHdI-MT'>" + DesgloseIncidencia.HorasTraManana + "</input></td></tr>" +
|
||||
"<tr id='inHdI-T'style=''><th colspan='2'>HORARIO TARDE</th>" +
|
||||
"<td colspan='2'><span>Inicio: </span><input type='time' class='inHora' id='inHdI-TI' value='" + DesgloseIncidencia.HoraInicioTarde + "'/></td>" +
|
||||
"<td colspan='2'><span>Final: </span><input type='time' class='inHora' id='inHdI-TF' onchange='totalHorasTardeINT()' value='" + DesgloseIncidencia.HoraFinTarde + "'/></td>" +
|
||||
"<td colspan='2'><span>Total: </span><span id='inHdI-TT'>" + DesgloseIncidencia.HorasTraTarde + "</span></td></tr>"
|
||||
}
|
||||
html += "<tr ><th colspan='2'>OBSERVACIONES</th>" +
|
||||
"<td colspan='6'><textarea style='width:100%' id='inObs'>" + DesgloseIncidencia.Observaciones + "</textarea></td></tr>"
|
||||
if (inciActual.Adjunto == "SI") {
|
||||
"<tr><th colspan='2'>ARCHIVO ADJUNTO</th>" +
|
||||
'<td colspan="6"><input type="file" id="inAdI" onchange="archivo(\'inAdI\')"/></td></tr></table>'
|
||||
}
|
||||
html += "<input style='width:100%; margin-top:15px;' type='button' onclick='guardarCambiosModInc()' value='GUARDAR CAMBIOS' class='btnAzul btnAlargado'/>" +
|
||||
"<input style='width:100%; margin-top:15px;' type='button' onclick='$(\"#ModInc\").html(\"\"); $(\"#ModInc\").css(\"display\",\"none\")' value='CANCELAR' class='btnAlargado'/>"
|
||||
|
||||
$('#ModInc').html(html)
|
||||
$('#ModInc').css('display', 'flex')
|
||||
|
||||
if (DiasCompletos == true && IntervaloDias == true || IntervaloDias == true) {
|
||||
$('#inFdI').css('display', '')
|
||||
$('#inFdI-I').css('display', '')
|
||||
$('#inFdI-F').css('display', '')
|
||||
}
|
||||
if (DiasCompletos == true && IntervaloDias == false) {
|
||||
$('#inFdI').css('display', '')
|
||||
$('#inFdI-I').css('display', '')
|
||||
}
|
||||
if (IntervaloHoras == true) {
|
||||
$('#inHdI-M').css('display', '')
|
||||
$('#inHdI-T').css('display', '')
|
||||
}
|
||||
if (editable == false && DiasCompletos == false && IntervaloDias == false && IntervaloHoras == false) {
|
||||
$('#inFdI').css('display', '')
|
||||
$('#inFdI-I').css('display', '')
|
||||
$('#inFdI-F').css('display', '')
|
||||
$('#inHdI-M').css('display', '')
|
||||
$('#inHdI-T').css('display', '')
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
function guardarCambiosModInc() {
|
||||
$("#divLoading").css("display", "flex")
|
||||
var observaciones = document.getElementById('inObs').value
|
||||
var idEstado = 0
|
||||
var fcIn = $('#inpIniDesgIn').val()
|
||||
var fcFn = $('#inpFinDesgIn').val()
|
||||
var horaIniMan = $('#inHdI-MI').val()
|
||||
var horaFinMan = $('#inHdI-MF').val()
|
||||
var horaTotMan = $('#inHdI-MT').text()
|
||||
var horaIniTar = $('#inHdI-TI').val()
|
||||
var horaFinTar = $('#inHdI-TF').val()
|
||||
var horaTotTar = $('#inHdI-TT').text()
|
||||
const queryString = window.location.search;
|
||||
const urlParams = new URLSearchParams(queryString)
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "./desgSolicitudesComunicaciones.aspx/ModificarEstado",
|
||||
data: '{"i":"' + urlParams.get("idAsis") + '","h":"' + urlParams.get("cl") + '","idEstado":' + idEstado + ',"FechaInicio":"' + fcIn + '","FechaFin":"' + fcFn + '","horainiciomanana":"' + horaIniMan + '",' +
|
||||
'"horafinmanana":"' + horaFinMan + '","horastrabajadasmanana":"' + horaTotMan + '","horainiciotarde":"' + horaIniTar + '","horafintarde":"' + horaFinTar + '","horastrabajadastarde":"' + horaTotTar + '",' +
|
||||
'"observaciones": "' + observaciones + '","fichero":"' + fichero + '"}',
|
||||
async: true,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
success: function (result) {
|
||||
if (result.d != "") {
|
||||
if (result.d.includes("ERROR--")) {
|
||||
compEr(result.d)
|
||||
return
|
||||
}
|
||||
success = true
|
||||
DesgloseIncidencia = JSON.parse(result.d)
|
||||
if (DesgloseIncidencia[0].resultado == 0) {
|
||||
$("#ModInc").html("")
|
||||
$("#ModInc").css("display", "none")
|
||||
$("#divLoading").css("display", "none")
|
||||
window.location.reload()
|
||||
//MostrarDesgIncidencia(sessionStorage.getItem("idAsistencia"))
|
||||
//$('#mensajeDesgAsis').css('color', 'green')
|
||||
//document.getElementById('mensajeDesgAsis').innerHTML = DesgloseIncidencia[0].mensaje
|
||||
//MostrarIncidencias()
|
||||
}
|
||||
else {
|
||||
$("#divLoading").css("display", "none")
|
||||
$("#ModInc").html("")
|
||||
$("#ModInc").css("display", "none")
|
||||
$('#mensajeDesgAsis').css('color', 'red')
|
||||
document.getElementById('mensajeDesgAsis').innerHTML = DesgloseIncidencia[0].mensaje
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (result) {
|
||||
alert('error occured');
|
||||
//alert(result.responseText);
|
||||
$("#iconLoading").css("display", "none")
|
||||
//$(".Loading").hide()
|
||||
}
|
||||
});
|
||||
}
|
||||
function BorrarInc(id) {
|
||||
$('#divConfirmacion').html(' <div class="d-flex flex-column" style="justify-content: center; width: 400px; height: 200px; display: flex; background-color: white; padding: 15px; ">' +
|
||||
'<p style="font-size:15px; text-align: center;">¿Está seguro de que desea eliminar esta incidencia?</p >' +
|
||||
'<input type="button" style="min-width: 100px; margin-bottom: 10px; height: 30px" class="btnAzul btnAlargado" value="ELIMINAR" onclick="confirmarBorrar(' + id + ')" />' +
|
||||
' <input type="button" style="min-width: 100px; height: 30px" value="CANCELAR" onclick="cancelarEnviar()" />' +
|
||||
'</div >')
|
||||
$('#divConfirmacion').css('display', 'flex')
|
||||
}
|
||||
function confirmarBorrar(id) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/desgSolicitudesComunicaciones.aspx/BorrarIncidencia",
|
||||
async: true,
|
||||
data: '{"id":"' + id + '"}',
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
success: function (result) {
|
||||
if (result.d != "") {
|
||||
success = true
|
||||
var respuesta = JSON.parse(result.d)
|
||||
$('#divConfirmacion').html('')
|
||||
$('#divConfirmacion').css('display', 'none')
|
||||
window.location.href = "/listSolicitudesComunicaciones.aspx"
|
||||
//MostrarIncidencias()
|
||||
/* MostrarPagina("listadoDeIncidencias")*/
|
||||
//$('#mensajeListIncidencias').text(respuesta.Mensaje)
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
Reference in New Issue
Block a user