Commit 3c9a0ed1 by Billy Larru

[EDIT registro_justificacion.js, registrando archivos seleccionados]

parent a9b6c8f8
...@@ -49,14 +49,18 @@ const registrarJustificacion = () => { ...@@ -49,14 +49,18 @@ const registrarJustificacion = () => {
let observacion = $("#txtObservacion").val() let observacion = $("#txtObservacion").val()
let numero_documentos_adjuntos = $("#txtNumeroDocumentosAdjuntos").val() let numero_documentos_adjuntos = $("#txtNumeroDocumentosAdjuntos").val()
let documentos_adjuntados = "" let documentos_adjuntados = ""
let documentos = []; let documentosSeleccionados = $("#cfDocumentos")[0].files;
let documentos = []
documentos.push({url: "https://picsum.photos/300/300/?random"}) // documentosSeleccionados.forEach((file) => {
documentos.push({url: "https://picsum.photos/300/300/?random"}) // })
let estado = 1 for (let i = 0, length = documentosSeleccionados.length; i < length; i++) {
documentos.push({url: "https://picsum.photos/300/300/?random"})
}
let estado = 0
let params = { let params = {
trabajador_id, trabajador_id,
...@@ -71,14 +75,19 @@ const registrarJustificacion = () => { ...@@ -71,14 +75,19 @@ const registrarJustificacion = () => {
motivo, motivo,
observacion, observacion,
numero_documentos_adjuntos, numero_documentos_adjuntos,
documentos,
estado estado
} }
ajaxWebService.post(URI_JUSTIFICACION, params) ajaxWebService.post(URI_JUSTIFICACION, params)
.then((response) => { .then((response) => {
if (response.status) { if (response.status) {
console.log(response.message) swal({
console.log(response.data) type: 'success',
title: '¡Justificación registrada!',
showConfirmButton: false,
timer: 1500
});
} }
}) })
} }
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</div> </div>
<div class="form-group col-md-10"> <div class="form-group col-md-10">
<label class="control-label">Adjuntar documentos</label> <label class="control-label">Adjuntar documentos</label>
<input type="file" class="file-styled-primary form-control" multiple> <input type="file" class="file-styled-primary form-control" id="cfDocumentos" multiple>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment