parent
caf6801753
commit
b552532d5f
3 changed files with 237 additions and 21 deletions
|
|
@ -18,13 +18,16 @@ namespace webAgenciaVirtual
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (context.Request.QueryString["tipo"] != null && context.Request.QueryString["id"] != null && context.Request.QueryString["carpeta"] != null)
|
|
||||||
{
|
|
||||||
string pathrefer = context.Request.UrlReferrer.ToString();
|
string pathrefer = context.Request.UrlReferrer.ToString();
|
||||||
//string Serverpath = HttpContext.Current.Server.MapPath("DocumentosSINORT");
|
//string Serverpath = HttpContext.Current.Server.MapPath("DocumentosSINORT");
|
||||||
string Serverpath = ConfigurationManager.AppSettings["FileRepository"].ToString();
|
string Serverpath = ConfigurationManager.AppSettings["FileRepository"].ToString();
|
||||||
|
if (context.Request.QueryString["id"] != null){
|
||||||
Serverpath += context.Request.QueryString["tipo"].ToString() + "\\" + context.Request.QueryString["id"].ToString() + "\\" + context.Request.QueryString["carpeta"].ToString();
|
Serverpath += context.Request.QueryString["tipo"].ToString() + "\\" + context.Request.QueryString["id"].ToString() + "\\" + context.Request.QueryString["carpeta"].ToString();
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
Serverpath += context.Request.QueryString["tipo"].ToString();
|
||||||
|
}
|
||||||
var postedFile = context.Request.Files[0];
|
var postedFile = context.Request.Files[0];
|
||||||
string ext = Path.GetExtension(postedFile.FileName);
|
string ext = Path.GetExtension(postedFile.FileName);
|
||||||
//if (ext == ".pdf" || ext == ".PDF")
|
//if (ext == ".pdf" || ext == ".PDF")
|
||||||
|
|
@ -86,7 +89,7 @@ namespace webAgenciaVirtual
|
||||||
// context.Response.Write("errorEXT");
|
// context.Response.Write("errorEXT");
|
||||||
// return;
|
// return;
|
||||||
//}
|
//}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception exp)
|
catch (Exception exp)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,14 @@
|
||||||
var model = {};
|
var model = {};
|
||||||
var Nombre;
|
var Nombre;
|
||||||
var IdFichaTecnica;
|
var IdFichaTecnica;
|
||||||
|
var NombreDocumento;
|
||||||
|
var DescTipoproyecto;
|
||||||
jQuery(document).ready(function () {
|
jQuery(document).ready(function () {
|
||||||
|
|
||||||
getDataModel();
|
getDataModel();
|
||||||
|
$('#tableDocFichaTecnica').TableInit(0, false, false, false, false, null, null);
|
||||||
|
$('#tableDocFichaTecnica').DataTable().column(0).visible(false);
|
||||||
|
$('#tableDocFichaTecnica').DataTable().column(4).visible(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.getDataModel = function () {
|
this.getDataModel = function () {
|
||||||
|
|
@ -658,3 +662,139 @@ $('#tablePalabrasClaves').on('click', 'button', function () {
|
||||||
$('#modalPalabrasClaves').modal('hide');
|
$('#modalPalabrasClaves').modal('hide');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
//Adjuntos
|
||||||
|
this.AbrirAdjuntos = function () {
|
||||||
|
DescTipoproyecto = 'Ficha Tecnica';
|
||||||
|
ActualizarUpload();
|
||||||
|
$('#modalDocumentosAuxiliares').modal('show');
|
||||||
|
}
|
||||||
|
this.GuardarAdjuntos = function (nombre) {
|
||||||
|
|
||||||
|
var uri = SinortWCF + '/api/GuardarAdjuntos';
|
||||||
|
|
||||||
|
var nombredoc = replaceAll(" ", "_", nombre);
|
||||||
|
var ruta = DescTipoproyecto + '\\' + nombredoc;
|
||||||
|
var Idetipoproyecto = 3;
|
||||||
|
|
||||||
|
var Arraynombre = [];
|
||||||
|
Arraynombre = nombredoc.split(".");
|
||||||
|
|
||||||
|
|
||||||
|
var AdjuntosDocumentosAuxiliar
|
||||||
|
= {
|
||||||
|
Nombre: $("#txtDescripcionDocAux").val(),
|
||||||
|
Comentario: $("#txtComentarioDocAux").val(),
|
||||||
|
IdTipoDocumento: Idetipoproyecto,
|
||||||
|
DescTipoDocumento: DescTipoproyecto,
|
||||||
|
RutaFisica: RepositorioLocal + ruta,
|
||||||
|
RutaDescarga: RepositorioVirtual + ruta,
|
||||||
|
TipoArchivo: Arraynombre.pop()
|
||||||
|
}
|
||||||
|
|
||||||
|
model.Adjuntos = AdjuntosDocumentosAuxiliar;
|
||||||
|
|
||||||
|
AjaxPostData(uri, model, true, false, CargarGridDocumento, null, null);
|
||||||
|
|
||||||
|
}
|
||||||
|
function ActualizarUpload() {
|
||||||
|
|
||||||
|
|
||||||
|
$('#fileupload').fileupload({
|
||||||
|
|
||||||
|
url: FileUploadHandler + '/FileUploadHandler.ashx?tipo=' + DescTipoproyecto,
|
||||||
|
type: 'POST',
|
||||||
|
|
||||||
|
add: function (e, data) {
|
||||||
|
|
||||||
|
data.submit();
|
||||||
|
},
|
||||||
|
progress: function (e, data) {
|
||||||
|
var progress = parseInt(data.loaded / data.total * 100, 10);
|
||||||
|
$('#progress .progress-bar').css(
|
||||||
|
'width',
|
||||||
|
progress + '%'
|
||||||
|
);
|
||||||
|
|
||||||
|
var tableAdjuntos = $('#tableAdjuntos').DataTable();
|
||||||
|
|
||||||
|
$.each(data.files, function (index, file) {
|
||||||
|
|
||||||
|
NombreDocumento = file.name;
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
success: function (response, status) {
|
||||||
|
|
||||||
|
GuardarAdjuntos(NombreDocumento);
|
||||||
|
$('#progress .progress-bar').css(
|
||||||
|
'width', '0%');
|
||||||
|
ENDREQUEST();
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
error: function (error) {
|
||||||
|
|
||||||
|
if (error.status = "200") {
|
||||||
|
|
||||||
|
$('#progress .progress-bar').css(
|
||||||
|
'width', '0%');
|
||||||
|
ENDREQUEST();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
this.CargarGridDocumento = function (data) {
|
||||||
|
|
||||||
|
var tipo = $('#hiddenSubTipoDocumento').val();
|
||||||
|
var lista = data.Adjuntos;
|
||||||
|
|
||||||
|
var option = $("#ucAbrirDocumento").html();
|
||||||
|
var ext = lista.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);
|
||||||
|
}
|
||||||
|
|
||||||
|
var tableDocFichaTecnica = $('#tableDocFichaTecnica').DataTable();
|
||||||
|
tableDocFichaTecnica.clear().draw();
|
||||||
|
tableDocFichaTecnica.row.add([lista.IdDocumentoAdjunto,
|
||||||
|
option,
|
||||||
|
lista.Nombre,
|
||||||
|
lista.UsuarioCreacion,
|
||||||
|
lista.RutaDescarga]).draw();
|
||||||
|
|
||||||
|
|
||||||
|
$('#fileupload').prop("disabled", true);
|
||||||
|
}
|
||||||
|
$('#tableDocFichaTecnica').on('click', 'button', function () {
|
||||||
|
|
||||||
|
var data = $('#tableDocFichaTecnica').DataTable().row($(this).parents('tr')).data();
|
||||||
|
|
||||||
|
window.open(data[4]);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
@ -15,27 +15,19 @@
|
||||||
|
|
||||||
@*---------------------Nombre Documento Tecnico ---------------------------------------------------------*@
|
@*---------------------Nombre Documento Tecnico ---------------------------------------------------------*@
|
||||||
<div class="form-group " id="divNombreDocumento">
|
<div class="form-group " id="divNombreDocumento">
|
||||||
<label class="col-sm-4 control-label ControlsForms" id="lblNombreDocumento">Nombre del documento técnico</label>
|
<label class="col-sm-4 control-label ControlsForms" id="lblNombreDocumento">Documento técnico</label>
|
||||||
<div class="input-group input-group-sm col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
<div class="input-group input-group-sm col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||||
<input id="hiddenNombreDocumento" type="hidden">
|
<button type="button" id="btnVerAdjuntos" class="btn btn-success btn-medium btn-margin-catalogo" onclick="javascript: AbrirAdjuntos()">
|
||||||
<input name="txtNombreDocumento" title="" class="form-control TextBoxCatalogo inputWarning error" id="txtNombreDocumento" required="required" type="text" readonly="readonly" data-original-title="">
|
<i class=" fa fa-paperclip"></i>
|
||||||
|
</button>
|
||||||
<span class="input-group-btn">
|
|
||||||
<button class="btn btn-default btn-medium" id="btn_eliminarNombreDocumento" type="button">
|
|
||||||
<i class="fa fa-close"></i>
|
|
||||||
</button>
|
|
||||||
<button class="btn btn-success btn-medium btn-margin-catalogo" id="btnBuscarNombreDocumento" type="button">
|
|
||||||
<i class="fa fa-search"></i>
|
|
||||||
</button>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@*---------------------Identificacion---------------------------------------------------------*@
|
@*---------------------Identificacion---------------------------------------------------------*@
|
||||||
<div class="form-group " id="divIdentificacion">
|
<div class="form-group " id="divIdentificacion">
|
||||||
<label class="col-sm-4 control-label ControlsForms" id="lblIdentificacion">Identificación</label>
|
<label class="col-sm-4 control-label ControlsForms" id="lblIdentificacion">Identificación</label>
|
||||||
<div class="input-group input-group-sm col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
<div class="input-group input-group-sm col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||||
<textarea name="txtAreaIdentificacion" rows="8" cols="31" id="txtAreaIdentificacion" style="resize: none"></textarea>
|
<textarea name="txtAreaIdentificacion" rows="8" cols="33" id="txtAreaIdentificacion" style="resize: none"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -269,10 +261,91 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="ucAbrirDocumento" style="display:none;">
|
||||||
|
<span>
|
||||||
|
<button type="button" id="btnAbrirAdjuntos" class="btn btn-default btn-xs">
|
||||||
|
<i class="fa [$icon]"></i>
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
@section Modals{
|
@section Modals{
|
||||||
|
|
||||||
|
|
||||||
|
@*---------------------Adjuntar documentos ---------------------------------------------------------*@
|
||||||
|
<div class="modal fade" id="modalDocumentosAuxiliares" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" style="display: none;z-index:1600;">
|
||||||
|
<div class="modal-dialog modal-lg" style="width:40%;">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
<h4 class="modal-title">Documentos</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
@*---------------------Descripción ---------------------------------------------------------*@
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label ControlsForms" id="lblDescDocAux">Descripción</label>
|
||||||
|
<div class="input-group input-group-sm col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||||
|
<input type="text" id="txtDescripcionDocAux" name="txtDescripcionDocAux" class="form-control imput-xs" required="required" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@*---------------------Comentario ---------------------------------------------------------*@
|
||||||
|
<div class="form-group " id="divComentarioDocAux">
|
||||||
|
<label class="col-sm-4 control-label ControlsForms" id="lblComentarioDocAux">Comentario</label>
|
||||||
|
<div class="input-group input-group-sm col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
||||||
|
<textarea name="txtComentarioDocAux" rows="5" cols="39" id="txtComentarioDocAux" style="resize: none"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@*---------------------Adjuntar ---------------------------------------------------------*@
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label ControlsForms">Adjuntar Documento</label>
|
||||||
|
<div class="input-group input-group-sm col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
||||||
|
<span class="btn btn-success fileinput-button" title="Adjuntar Documento">
|
||||||
|
<i class="fa fa-paperclip"></i>
|
||||||
|
<input type="file" id="fileupload" name="file" />
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<button type="button" id="btnEliminarAdjuntos" class="btn btn-danger btn-medium btn-margin-catalogo" onclick="javascript: EliminarAdjunto()">
|
||||||
|
<i class=" fa fa-close"></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div id="progress" class="progress">
|
||||||
|
<div class="progress-bar progress-bar-success"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
@*---------------------Documento ---------------------------------------------------------*@
|
||||||
|
<table id="tableDocFichaTecnica" class="display">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th></th>
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">Cerrar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue