Opciones 8 9 10 11 12 Validaciones
git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C212
This commit is contained in:
parent
6fc0a29384
commit
b029b62acd
1 changed files with 149 additions and 8 deletions
|
|
@ -61,8 +61,9 @@ jQuery(document).ready(function () {
|
|||
IdProyectoNormativo: ROT47(IDPropuesta.toString())
|
||||
};
|
||||
IdPropuestaNormativa = ROT47(IDPropuesta.toString());
|
||||
getDataModel();
|
||||
|
||||
ObtenerPropuesta();
|
||||
getDataModel();
|
||||
|
||||
if ($("#txtPromotorProyecto").val() == UsuarioSistema) {
|
||||
$("#txtFechaFinalizacion").noReadOnly();
|
||||
|
|
@ -99,6 +100,12 @@ this.getDataModel = function () {
|
|||
|
||||
$("#btnAgregarComentario").unbind("click");
|
||||
$("#btnAgregarComentario").click(function () {
|
||||
|
||||
if (ValidarPermisos('Ingreso y actualización de área de foro').length <= 0 || $('#txtEstado').val() != "Inicial") {
|
||||
toastr.warning('No tiene permisos para ejecutar esta opción', Message_Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
$("#divRespuesta").empty();
|
||||
$("#lblcomentario").text("Comentario");
|
||||
$("#txtAsunto").val('');
|
||||
|
|
@ -118,6 +125,7 @@ this.getDataModel = function () {
|
|||
|
||||
$("#btnAgregarElemento").unbind("click");
|
||||
$("#btnAgregarElemento").click(function () {
|
||||
|
||||
$("#divRespuestaMatriz").empty();
|
||||
$("#lblComentarioMatriz").text("Comentario");
|
||||
$("#txtAsuntoMatriz").val('');
|
||||
|
|
@ -161,16 +169,24 @@ this.getDataModel = function () {
|
|||
$("#txtEstado").readOnly();
|
||||
$('#btnModificar').disable();
|
||||
|
||||
if (ValidarPermisos('Ingreso y actualización de área de proyecto').length <= 0 || $('#txtEstado').val() != "Inicial" ) {
|
||||
$("#tabs").tabs({
|
||||
disabled: [2]
|
||||
});
|
||||
}
|
||||
|
||||
if (ValidarPermisos('Accesar expediente de foro').length <= 0 || $('#txtEstado').val() != "Inicial") {
|
||||
$("#tabs").tabs({
|
||||
disabled: [3]
|
||||
});
|
||||
}
|
||||
|
||||
CargarUsuarios();
|
||||
}
|
||||
|
||||
|
||||
this.ActualizarItem = function (accion) {
|
||||
|
||||
//if (!$("#formDetallePropuesta").valid()) {
|
||||
// toastr.warning("Ingresar todos los campos que son requeridos.");
|
||||
// return false;
|
||||
//}
|
||||
|
||||
if (!confirm((accion == true) ? "Se guardarán los cambios.\n ¿Desea continuar?" : "Desea eliminar el registro.\n ¿Desea continuar?"))
|
||||
{ return; }
|
||||
|
|
@ -1189,6 +1205,18 @@ $('#tableDocMatriz').on('click', 'button', function () {
|
|||
});
|
||||
|
||||
this.AbrirAdjuntos = function (id) {
|
||||
|
||||
if (id == 2 && ValidarPermisos('Accesar documentos auxiliares del foro').length <= 0) {
|
||||
toastr.warning('No tiene permisos para ejecutar esta opción', Message_Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (id == 3 && ValidarPermisos('Accesar expediente de propuesta normativa').length <= 0) {
|
||||
toastr.warning('No tiene permisos para ejecutar esta opción', Message_Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$('#hiddenSubTipoDocumento').val(id);
|
||||
|
||||
|
||||
|
|
@ -1555,3 +1583,116 @@ $('#tableDocEvento').on('click', 'button', function () {
|
|||
window.open(data[4]);
|
||||
|
||||
});
|
||||
|
||||
this.Export2Doc = function (element, filename) {
|
||||
|
||||
var preHtml = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:w='urn:schemas-microsoft-com:office:word' xmlns='http://www.w3.org/TR/REC-html40'><head><meta charset='utf-8'><title>Export HTML To Doc</title></head><body>";
|
||||
var postHtml = "</body></html>";
|
||||
var html = preHtml + document.getElementById(element).innerHTML + postHtml;
|
||||
|
||||
var blob = new Blob(['\ufeff', html], {
|
||||
type: 'application/msword'
|
||||
});
|
||||
|
||||
// Specify link url
|
||||
var url = 'data:application/vnd.ms-word;charset=utf-8,' + encodeURIComponent(html);
|
||||
|
||||
// Specify file name
|
||||
filename = filename ? filename + '.doc' : 'document.doc';
|
||||
|
||||
// Create download link element
|
||||
var downloadLink = document.createElement("a");
|
||||
|
||||
document.body.appendChild(downloadLink);
|
||||
|
||||
if (navigator.msSaveOrOpenBlob) {
|
||||
navigator.msSaveOrOpenBlob(blob, filename);
|
||||
} else {
|
||||
// Create a link to the file
|
||||
downloadLink.href = url;
|
||||
|
||||
// Setting the file name
|
||||
downloadLink.download = filename;
|
||||
|
||||
//triggering the function
|
||||
downloadLink.click();
|
||||
}
|
||||
|
||||
document.body.removeChild(downloadLink);
|
||||
|
||||
};
|
||||
|
||||
|
||||
this.ExportarADoc = function (TipoComentario, filename) {
|
||||
|
||||
var preHtml = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:w='urn:schemas-microsoft-com:office:word' xmlns='http://www.w3.org/TR/REC-html40'><head><meta charset='utf-8'><title>SINORT</title></head><body>";
|
||||
var postHtml = "</body></html>";
|
||||
var html = preHtml;
|
||||
|
||||
html = html + '<p><center><img src="http://localhost/AYA.SlnSinort/dist/img/bannersinort.png" style="margin: 0 auto;" align="middle" width="300"></center></p>' ;
|
||||
html = html + '<br/>'
|
||||
html = html + '<center><h1>SISTEMA DE NORMATIVA Y REGULACION TECNICA DEL AyA</h1></center>'
|
||||
html = html + '<br/>'
|
||||
html = html + '<h1>' + ((TipoComentario == 'Matriz') ? 'MATRIZ' : 'FORO') + '</h1>' +
|
||||
'<p>PROYECTO NORMATIVO N. ' + model.ProyectoNormativo.IdProyectoNormativo + ' NOMBRE: ' + model.ProyectoNormativo.NombreProyectoNormativo + '</p>' ;
|
||||
|
||||
html = html + '<hr/>'
|
||||
|
||||
var listaComentariosMatriz = $.grep(model.ProyectoNormativo.ComentariosProyecto, function (data) {
|
||||
return data.IdTipoComentario == ((TipoComentario == 'Matriz') ? Comentarios.Matriz.Codigo : Comentarios.Foro.Codigo) && data.Respuesta == null;
|
||||
});
|
||||
|
||||
|
||||
$.each(listaComentariosMatriz, function (key, item) {
|
||||
html = html + '<p><img src="http://localhost/AYA.SlnSinort/bower_components/Ionicons/png/512/chatbubble-working.png" style="margin: 0 auto;" height="30" width="30"><font face="verdana" color="green">ASUNTO :' + item.Asunto + '</font></p>'
|
||||
html = html + '<p><img src="http://localhost/AYA.SlnSinort/bower_components/Ionicons/png/512/chatbubbles.png" style="margin: 0 auto;" height="30" width="30">Comentario : ' + item.Comentario + '</p>';
|
||||
|
||||
|
||||
var listaRespuestasComentariosMatriz = $.grep(model.ProyectoNormativo.ComentariosProyecto, function (data) {
|
||||
return data.IdTipoComentario == ((TipoComentario == 'Matriz') ? Comentarios.Matriz.Codigo : Comentarios.Foro.Codigo) && data.Respuesta == item.IdComentarioProyecto;
|
||||
});
|
||||
|
||||
$.each(listaRespuestasComentariosMatriz, function (lstkey, lstitem) {
|
||||
html = html + '<p><img src="http://localhost/AYA.SlnSinort/bower_components/Ionicons/png/512/ios7-redo.png" style="margin: 0 auto;" height="30" width="30"><font face="verdana" color="blue"> Respuesta ' + lstitem.Comentario + '</font></p>'
|
||||
html = html + '<p><img src="http://localhost/AYA.SlnSinort/bower_components/Ionicons/png/512/ios7-contact-outline.png" style="margin: 0 auto;" height="30" width="30">' + lstitem.UsuarioSistema + ' - ' + lstitem.FechaCreacion + '</p>'
|
||||
html = html + '<hr/>'
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
html = html + postHtml;
|
||||
|
||||
var blob = new Blob(['\ufeff', html], {
|
||||
type: 'application/msword'
|
||||
});
|
||||
|
||||
// Specify link url
|
||||
//var url = 'data:application/vnd.ms-word;charset=utf-8,' + encodeURIComponent(html);
|
||||
var url = 'data:application/vnd.ms-word;charset=utf-8,' + encodeURIComponent(html);
|
||||
|
||||
// Specify file name
|
||||
filename = filename ? filename + '.doc' : 'document.doc';
|
||||
|
||||
// Create download link element
|
||||
var downloadLink = document.createElement("a");
|
||||
|
||||
document.body.appendChild(downloadLink);
|
||||
|
||||
if (navigator.msSaveOrOpenBlob) {
|
||||
navigator.msSaveOrOpenBlob(blob, filename);
|
||||
} else {
|
||||
// Create a link to the file
|
||||
downloadLink.href = url;
|
||||
|
||||
// Setting the file name
|
||||
downloadLink.download = filename;
|
||||
|
||||
//triggering the function
|
||||
downloadLink.click();
|
||||
}
|
||||
|
||||
document.body.removeChild(downloadLink);
|
||||
|
||||
|
||||
};
|
||||
Loading…
Add table
Reference in a new issue