git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C151
This commit is contained in:
parent
b50020d651
commit
f15280d746
3 changed files with 192 additions and 70 deletions
|
|
@ -47,7 +47,8 @@ var SubDocumento = {
|
|||
Matriz: { Codigo: 1, Descripcion: "Matriz" },
|
||||
Foro: { Codigo: 2, Descripcion: "Foro" },
|
||||
DocumentoAuxiliar: { Codigo: 3, Descripcion: "Documento Auxiliar" },
|
||||
Expediente: { Codigo: 4, Descripcion: "Expediente" }
|
||||
Expediente: { Codigo: 4, Descripcion: "Expediente" },
|
||||
Calendario: { Codigo: 5, Descripcion: "Calendario" }
|
||||
};
|
||||
//
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ jQuery(document).ready(function () {
|
|||
$('#tableMatriz').TableInit(0, false, false, false, false, null, null);
|
||||
$('#tableDocAuxiliares').TableInit(0, false, false, false, false, null, null);
|
||||
$('#tableDocAuxiliares').DataTable().column(3).visible(false);
|
||||
$('#tableDocExpediente').TableInit(0, false, false, false, false, null, null);
|
||||
$('#tableDocExpediente').DataTable().column(3).visible(false);
|
||||
|
||||
$("#tabs").tabs();
|
||||
|
||||
|
|
@ -175,6 +177,7 @@ this.CargarFormulario = function (data) {
|
|||
CargarMatriz();
|
||||
}
|
||||
CargarDocumentosAuxiliares();
|
||||
CargarDocumentosExpediente();
|
||||
ENDREQUEST();
|
||||
}
|
||||
|
||||
|
|
@ -554,79 +557,12 @@ $('#tableUsuarios').on('click', 'button', function () {
|
|||
|
||||
//Documentos Auxiliares
|
||||
|
||||
this.AbrirAdjuntos = function (id) {
|
||||
$('#hiddenSubTipoDocumento').val(id);
|
||||
switch (id) {
|
||||
case 1:
|
||||
SubTipoproyecto = SubDocumento.Matriz.Descripcion;
|
||||
break;
|
||||
case 2:
|
||||
SubTipoproyecto = SubDocumento.Foro.Descripcion;
|
||||
break;
|
||||
case 3:
|
||||
SubTipoproyecto = SubDocumento.DocumentoAuxiliar.Descripcion;
|
||||
break;
|
||||
case 4:
|
||||
SubTipoproyecto = SubDocumento.Expediente.Descripcion;
|
||||
break;
|
||||
}
|
||||
if (EsForo) {
|
||||
DescTipoproyecto = Proyectos.Foro.Descripcion;
|
||||
} else {
|
||||
DescTipoproyecto = Proyectos.PropuestaNormativa.Descripcion;
|
||||
}
|
||||
ActulalizarUpload();
|
||||
$('#modalDocumentosAuxiliares').modal('show');
|
||||
}
|
||||
|
||||
this.GuardarAdjuntos= function (nombre) {
|
||||
|
||||
if (!confirm("Va a ingresar un documento auxiliar .\n ¿Desea continuar?"))
|
||||
{ return; }
|
||||
|
||||
var uri = SinortWCF + '/api/GuardarAdjuntos';
|
||||
var ruta;
|
||||
var Idetipoproyecto;
|
||||
var DesTipoProyecto;
|
||||
if (EsForo) {
|
||||
Idetipoproyecto = Proyectos.Foro.Codigo;
|
||||
DesTipoProyecto = Proyectos.Foro.Descripcion;
|
||||
ruta = Proyectos.Foro.Descripcion + '\\' + model.ProyectoNormativo.IdProyectoNormativo + '\\' + SubTipoproyecto + '\\' + nombre;
|
||||
} else {
|
||||
Idetipoproyecto = Proyectos.PropuestaNormativa.Codigo;
|
||||
DesTipoProyecto = Proyectos.Foro.Descripcion;
|
||||
ruta = Proyectos.PropuestaNormativa.Descripcion + '\\' + model.ProyectoNormativo.IdProyectoNormativo + '\\' + SubTipoproyecto + '\\' + nombre;
|
||||
}
|
||||
var Arraynombre = [];
|
||||
Arraynombre = nombre.split(".");
|
||||
|
||||
|
||||
var AdjuntosDocumentosAuxiliar
|
||||
= {
|
||||
Nombre: $("#txtDescripcionDocAux").val(),
|
||||
Comentario: $("#txtComentarioDocAux").val(),
|
||||
IdTipoDocumento: Idetipoproyecto,
|
||||
DescTipoDocumento : DesTipoProyecto,
|
||||
NumeroTipoDocumento: model.ProyectoNormativo.IdProyectoNormativo,
|
||||
IdSubTipoDocumento: $('#hiddenSubTipoDocumento').val(),
|
||||
DescIdSubTipoDocumento :SubTipoproyecto,
|
||||
RutaFisica: RepositorioLocal + ruta,
|
||||
RutaDescarga : RepositorioVirtual + ruta,
|
||||
TipoArchivo: Arraynombre.pop()
|
||||
}
|
||||
|
||||
model.Adjuntos = AdjuntosDocumentosAuxiliar;
|
||||
|
||||
AjaxPostData(uri, model, false, true, null, null, null);
|
||||
|
||||
}
|
||||
|
||||
this.CargarDocumentosAuxiliares = function () {
|
||||
|
||||
var uri = SinortWCF + '/api/ObtenerAdjuntos';
|
||||
var model = {
|
||||
IdTipoDocumento: 1,
|
||||
IdSubTipoDocumento : 3
|
||||
IdSubTipoDocumento: 3
|
||||
};
|
||||
|
||||
AjaxPostData(uri, model, false, false, CargarTablaDocumentosAuxiliares, null, null);
|
||||
|
|
@ -645,7 +581,7 @@ this.CargarTablaDocumentosAuxiliares = function (data) {
|
|||
var option = $("#ucAbrirDocumento").html();
|
||||
var ext = item.TipoArchivo.toLowerCase();
|
||||
switch (ext) {
|
||||
case 'pdf':
|
||||
case 'pdf':
|
||||
option = replaceAll("[$icon]", "fa-file-pdf-o", option);
|
||||
break;
|
||||
case 'doc':
|
||||
|
|
@ -686,6 +622,146 @@ $('#tableDocAuxiliares').on('click', 'button', function () {
|
|||
window.open(data[3]);
|
||||
|
||||
});
|
||||
|
||||
//Expediente
|
||||
|
||||
this.CargarDocumentosExpediente = function () {
|
||||
|
||||
var uri = SinortWCF + '/api/ObtenerAdjuntos';
|
||||
var model = {
|
||||
IdTipoDocumento: 1,
|
||||
IdSubTipoDocumento: 4
|
||||
};
|
||||
|
||||
AjaxPostData(uri, model, false, false, CargarTablaDocumentosExpediente, null, null);
|
||||
|
||||
}
|
||||
|
||||
this.CargarTablaDocumentosExpediente = function (data) {
|
||||
|
||||
var tableDocExpediente = $('#tableDocExpediente').DataTable();
|
||||
tableDocExpediente.clear().draw();
|
||||
var lista = data;
|
||||
|
||||
$.each(lista, function (key, item) {
|
||||
|
||||
|
||||
var option = $("#ucAbrirDocumento").html();
|
||||
var ext = item.TipoArchivo.toLowerCase();
|
||||
switch (ext) {
|
||||
case 'pdf':
|
||||
option = replaceAll("[$icon]", "fa-file-pdf-o", option);
|
||||
break;
|
||||
case 'doc':
|
||||
option = replaceAll("[$icon]", "fa-file-word-o", option);
|
||||
break;
|
||||
case 'docx':
|
||||
option = replaceAll("[$icon]", "fa-file-word-o", option);
|
||||
break;
|
||||
case 'png':
|
||||
option = replaceAll("[$icon]", "fa-file-image-o", option);
|
||||
break;
|
||||
case 'jpg':
|
||||
option = replaceAll("[$icon]", "fa-file-image-o", option);
|
||||
break;
|
||||
case 'xls':
|
||||
option = replaceAll("[$icon]", "fa-file-excel-o", option);
|
||||
break;
|
||||
case 'xlsx':
|
||||
option = replaceAll("[$icon]", "fa-file-excel-o", option);
|
||||
break;
|
||||
default:
|
||||
option = replaceAll("[$icon]", "fa-file-text", option);
|
||||
}
|
||||
|
||||
tableDocExpediente.row.add([option,
|
||||
item.Nombre,
|
||||
item.UsuarioCreacion,
|
||||
item.RutaDescarga]).draw();
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$('#tableDocExpediente').on('click', 'button', function () {
|
||||
|
||||
var data = $('#tableDocExpediente').DataTable().row($(this).parents('tr')).data();
|
||||
|
||||
window.open(data[3]);
|
||||
|
||||
});
|
||||
|
||||
this.AbrirAdjuntos = function (id) {
|
||||
$('#hiddenSubTipoDocumento').val(id);
|
||||
switch (id) {
|
||||
case 1:
|
||||
SubTipoproyecto = SubDocumento.Matriz.Descripcion;
|
||||
break;
|
||||
case 2:
|
||||
SubTipoproyecto = SubDocumento.Foro.Descripcion;
|
||||
break;
|
||||
case 3:
|
||||
SubTipoproyecto = SubDocumento.DocumentoAuxiliar.Descripcion;
|
||||
break;
|
||||
case 4:
|
||||
SubTipoproyecto = SubDocumento.Expediente.Descripcion;
|
||||
break;
|
||||
case 4:
|
||||
SubTipoproyecto = SubDocumento.Calendario.Descripcion;
|
||||
break;
|
||||
}
|
||||
if (EsForo) {
|
||||
DescTipoproyecto = Proyectos.Foro.Descripcion;
|
||||
} else {
|
||||
DescTipoproyecto = Proyectos.PropuestaNormativa.Descripcion;
|
||||
}
|
||||
ActulalizarUpload();
|
||||
$('#modalDocumentosAuxiliares').modal('show');
|
||||
}
|
||||
|
||||
this.GuardarAdjuntos= function (nombre) {
|
||||
|
||||
if (!confirm("Va a ingresar un documento auxiliar .\n ¿Desea continuar?"))
|
||||
{ return; }
|
||||
|
||||
var uri = SinortWCF + '/api/GuardarAdjuntos';
|
||||
var ruta;
|
||||
var Idetipoproyecto;
|
||||
var DesTipoProyecto;
|
||||
if (EsForo) {
|
||||
Idetipoproyecto = Proyectos.Foro.Codigo;
|
||||
DesTipoProyecto = Proyectos.Foro.Descripcion;
|
||||
ruta = Proyectos.Foro.Descripcion + '\\' + model.ProyectoNormativo.IdProyectoNormativo + '\\' + SubTipoproyecto + '\\' + nombre;
|
||||
} else {
|
||||
Idetipoproyecto = Proyectos.PropuestaNormativa.Codigo;
|
||||
DesTipoProyecto = Proyectos.PropuestaNormativa.Descripcion;
|
||||
ruta = Proyectos.PropuestaNormativa.Descripcion + '\\' + model.ProyectoNormativo.IdProyectoNormativo + '\\' + SubTipoproyecto + '\\' + nombre;
|
||||
}
|
||||
var Arraynombre = [];
|
||||
Arraynombre = nombre.split(".");
|
||||
|
||||
|
||||
var AdjuntosDocumentosAuxiliar
|
||||
= {
|
||||
Nombre: $("#txtDescripcionDocAux").val(),
|
||||
Comentario: $("#txtComentarioDocAux").val(),
|
||||
IdTipoDocumento: Idetipoproyecto,
|
||||
DescTipoDocumento : DesTipoProyecto,
|
||||
NumeroTipoDocumento: model.ProyectoNormativo.IdProyectoNormativo,
|
||||
IdSubTipoDocumento: $('#hiddenSubTipoDocumento').val(),
|
||||
DescIdSubTipoDocumento :SubTipoproyecto,
|
||||
RutaFisica: RepositorioLocal + ruta,
|
||||
RutaDescarga : RepositorioVirtual + ruta,
|
||||
TipoArchivo: Arraynombre.pop()
|
||||
}
|
||||
|
||||
model.Adjuntos = AdjuntosDocumentosAuxiliar;
|
||||
|
||||
AjaxPostData(uri, model, false, true, null, null, null);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function ActulalizarUpload() {
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -268,6 +268,51 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tabs-4">
|
||||
@* Expediente *@
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<table id="tableDocExpediente" class="display">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-1"></th>
|
||||
<th class="col-sm-4">Nombre</th>
|
||||
<th class="col-sm-4">Creado por</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="panel panel-success">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<i class="fa fa-folder-open-o"></i> <label id="lbTituloAccion">Documentos</label>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
@*Usuario*@
|
||||
|
||||
|
||||
<div class="form-group " id="divAbrirDocExpediente">
|
||||
<label class="col-sm-4 control-label ControlsForms">Adjuntar</label>
|
||||
<div class="col-sm-8">
|
||||
<button type="button" id="btnVerAdjuntosExpediente" class="btn btn-success btn-medium btn-margin-catalogo" onclick="javascript: AbrirAdjuntos(4)">
|
||||
<i class=" fa fa-paperclip"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue