Matriz de cambios. exportar Excel
git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C446
This commit is contained in:
parent
23c7cc4d83
commit
d04b89e454
2 changed files with 87 additions and 7 deletions
|
|
@ -2330,15 +2330,19 @@ $('#tableDiscusion').on('click', 'button', function () {
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
this.ExportarDocumento = function (TipoComentario, filename) {
|
||||||
|
if (TipoComentario == 'Matriz') {
|
||||||
|
ExportarAExcel(TipoComentario, filename);
|
||||||
|
} else {
|
||||||
|
ExportarADoc(TipoComentario, filename);
|
||||||
|
}
|
||||||
|
}
|
||||||
this.ExportarADoc = function (TipoComentario, filename) {
|
this.ExportarADoc = function (TipoComentario, filename) {
|
||||||
|
|
||||||
var preHtml;
|
var preHtml;
|
||||||
if (TipoComentario == 'Matriz') {
|
|
||||||
preHtml = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:w='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'><head><meta charset='utf-8'><title>SINORT</title></head><body>";
|
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>";
|
||||||
} else {
|
|
||||||
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 postHtml = "</body></html>";
|
||||||
var html = preHtml;
|
var html = preHtml;
|
||||||
|
|
@ -2380,4 +2384,80 @@ this.ExportarADoc = function (TipoComentario, filename) {
|
||||||
ExportarAMsWord(html, filename);
|
ExportarAMsWord(html, filename);
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
this.ExportarAExcel = function (TipoComentario, filename) {
|
||||||
|
|
||||||
|
var preHtml;
|
||||||
|
|
||||||
|
preHtml = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:w='urn:schemas-microsoft-com:office:excel' 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="' + RutaLogoSINORT + 'bannersinort.png" style="margin: 0 auto;" align="middle" width="200"></center></p>';
|
||||||
|
html = html + '<br/>'
|
||||||
|
html = html + '<center><h3>SISTEMA DE NORMATIVA Y REGLAMENTACION TECNICA</h3></center>'
|
||||||
|
html = html + '<br/>'
|
||||||
|
html = html + '<h3>' + ((TipoComentario == 'Matriz') ? 'MATRIZ' : 'FORO') + '</h3>' +
|
||||||
|
'<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;
|
||||||
|
});
|
||||||
|
|
||||||
|
html = html + '<table id="tablaMatriz" border="1" style="width:100%">' +
|
||||||
|
'<thead>' +
|
||||||
|
'<tr style="background-color: #2694D7;">' +
|
||||||
|
'<th> Asunto </th>' +
|
||||||
|
'<th> Capítulo </th>' +
|
||||||
|
'<th> Apartado/Sección/Parráfo </th>' +
|
||||||
|
'<th> Texto Original </th>' +
|
||||||
|
'<th> Texto Propuesto </th>' +
|
||||||
|
'<th> Comentario/Observación/Justificación </th>' +
|
||||||
|
'<th> Respuestas </th>' +
|
||||||
|
'</tr>' +
|
||||||
|
'</thead>' +
|
||||||
|
'<tbody>'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$.each(listaComentariosMatriz, function (key, item) {
|
||||||
|
html = html + '<tr>'
|
||||||
|
html = html + '<td>' + item.Asunto + '</td>'
|
||||||
|
html = html + '<td> algo </td>'
|
||||||
|
html = html + '<td> algo </td>'
|
||||||
|
html = html + '<td> algo </td>'
|
||||||
|
html = html + '<td> algo </td>'
|
||||||
|
html = html + '<td>' + item.Comentario + '</td>';
|
||||||
|
|
||||||
|
|
||||||
|
var listaRespuestasComentariosMatriz = $.grep(model.ProyectoNormativo.ComentariosProyecto, function (data) {
|
||||||
|
return data.IdTipoComentario == ((TipoComentario == 'Matriz') ? Comentarios.Matriz.Codigo : Comentarios.Foro.Codigo) && data.Respuesta == item.IdComentarioProyecto;
|
||||||
|
});
|
||||||
|
html = html + '<td>'
|
||||||
|
$.each(listaRespuestasComentariosMatriz, function (lstkey, lstitem) {
|
||||||
|
html = html + lstitem.Comentario
|
||||||
|
if(listaRespuestasComentariosMatriz.length-1 != lstkey)
|
||||||
|
html = html + ', '
|
||||||
|
|
||||||
|
//html = html + '<p><img src="' + RutaImagenes + 'ios7-contact-outline.png" style="margin: 0 auto;" height="30" width="30">' + lstitem.UsuarioSistema + ' - ' + lstitem.FechaCreacion + '</p>'
|
||||||
|
|
||||||
|
});
|
||||||
|
html = html + '</td>'
|
||||||
|
html = html + '</tr>'
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
html = html + '</tbody>' +
|
||||||
|
'</table>'
|
||||||
|
|
||||||
|
html = html + postHtml;
|
||||||
|
|
||||||
|
ExportarAMsWord(html, filename);
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
@ -188,7 +188,7 @@ background-image:url(http://AYA-VSRV-APPTT:2525/dist/img/ajax-loader.gif);backgr
|
||||||
Matriz Cambios - Nuevo Elemento
|
Matriz Cambios - Nuevo Elemento
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button class="btn btn-info btn-xs btn-margin-catalogo" id="btnExportarMatriz" type="button" onclick="ExportarADoc('Matriz','DocMatriz');">
|
<button class="btn btn-info btn-xs btn-margin-catalogo" id="btnExportarMatriz" type="button" onclick="ExportarDocumento('Matriz', 'DocMatriz');">
|
||||||
<i class="glyphicon glyphicon-export"></i>
|
<i class="glyphicon glyphicon-export"></i>
|
||||||
Exportar
|
Exportar
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue