mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'add/view_logistica_principal' of https://git.imnavajas.es/jjimenez/safekat into add/view_logistica_principal
This commit is contained in:
@ -16,6 +16,9 @@ class OrdenTrabajo {
|
||||
this.tareaCommentModal = new Modal($("#modalCommentTarea"))
|
||||
this.alertOrdenTrabajo = this.item.find("#alert-orden-trabajo");
|
||||
this.btnFinalizarPedido = this.item.find("#btn-finalizar-orden-pedido")
|
||||
this.btnReactivarOt = this.item.find("#btn-reactivar-orden-pedido")
|
||||
this.isOtFinalizada = false;
|
||||
|
||||
this.btnResetTareas = this.item.find("#btn-reset-tareas")
|
||||
this.pedidoEnEsperaCheck = this.item.find("#ot-pedido-espera");
|
||||
this.pedidoEnEsperaBy = this.item.find("#pedido_espera_by");
|
||||
@ -140,6 +143,8 @@ class OrdenTrabajo {
|
||||
this.otForm.on("click", "#btn-upload-portada", this.handleUploadPortada.bind(this))
|
||||
this.otForm.on("click", "#btn-delete-portada", this.handleDeletePortada.bind(this))
|
||||
this.btnFinalizarPedido.on("click", this.handleFinalizarPedido.bind(this))
|
||||
this.btnReactivarOt.on("click", this.handleReactivarPedido.bind(this))
|
||||
|
||||
this.tareasTableItem.on("click", ".ot-tarea-btn-delete", this.handleTareaDeleteConfirmation.bind(this))
|
||||
this.item.on("click", "#btn-reset-tareas", this.handleResetTareasDeleteConfirmation.bind(this))
|
||||
this.otForm.on("click", ".ot-tarea-comment", this.handleNoteTarea.bind(this))
|
||||
@ -190,14 +195,14 @@ class OrdenTrabajo {
|
||||
}
|
||||
_renderMaquinaSelectTable(d, t) {
|
||||
this.tareasId.push(d.id)
|
||||
return `<select id="select-maquina-tarea-${d.id}" data-maquina-id="${d.maquina_id}" data-id="${d.id}" name="maquina_id" class="select2 form-select select-maquina-tarea-datatable ${d.maquina_id ? '' : 'is-invalid'}">
|
||||
return `<select id="select-maquina-tarea-${d.id}" data-maquina-id="${d.maquina_id}" data-id="${d.id}" name="maquina_id" class="select2 form-select select-maquina-tarea-datatable ${d.maquina_id ? '' : 'is-invalid'}" ${this.isOtFinalizada ? "disabled" : ""}>
|
||||
<option value="${d.maquina_id}" selected="selected">${d.maquina_name ?? ''}</option>
|
||||
</select>`
|
||||
|
||||
}
|
||||
_renderImposicionSelectTable(d, t) {
|
||||
|
||||
let render = `<select id="select-imposicion-tarea-${d.id}" data-imposicion-id="${d.imposicion_id}" data-id="${d.id}" name="imposicion_id" class="select2 form-select select-imposicion-tarea-datatable ${d.imposicion_id ? '' : 'is-invalid'}">
|
||||
let render = `<select id="select-imposicion-tarea-${d.id}" data-imposicion-id="${d.imposicion_id}" data-id="${d.id}" name="imposicion_id" class="select2 form-select select-imposicion-tarea-datatable ${d.imposicion_id ? '' : 'is-invalid'}" ${this.isOtFinalizada ? "disabled" : ""}>
|
||||
<option value="${d.imposicion_id}" selected="selected">${d.name ?? ''}</option>
|
||||
</select>`
|
||||
return render
|
||||
@ -206,8 +211,10 @@ class OrdenTrabajo {
|
||||
_renderActionCell(d, t) {
|
||||
|
||||
let cell = `<div class="d-flex justify-content-start align-items-center gap-1">
|
||||
<a type="button" class="btn btn-xs ot-tarea-comment" data-id="${d.id}"><i class="ti ti-${d.comment ? "message" : "note"} ti-sm mx-2"></i></a>
|
||||
<a type="button" class="btn btn-xs ot-tarea-btn-delete" data-id="${d.id}"><i class="ti ti-trash ti-sm mx-2"></i></a>
|
||||
<a type="button" class="btn btn-xs ot-tarea-comment" data-id="${d.id}">
|
||||
<i class="ti ti-${d.comment ? "message" : "note"} ti-sm mx-2"></i>
|
||||
</a>
|
||||
<a type="button" class="btn btn-xs ot-tarea-btn-delete" data-id="${d.id}"><i class="ti ti-trash ti-sm mx-2 ${this.isOtFinalizada ? "d-none" : ""}" ></i></a>
|
||||
</div>`
|
||||
return cell;
|
||||
}
|
||||
@ -215,7 +222,7 @@ class OrdenTrabajo {
|
||||
|
||||
return `
|
||||
<div class="d-flex justify-content-between aling-items-center gap-2 orden-tarea-cell">
|
||||
<input type="text" style="min-width:5rem" data-id="${d.id}" class="form-control form-control-sm orden-tarea mr-2" name="orden" value="${d.orden}">
|
||||
<input type="text" style="min-width:5rem" data-id="${d.id}" class="form-control form-control-sm orden-tarea mr-2" name="orden" value="${d.orden}" ${this.isOtFinalizada ? "disabled" : ""}>
|
||||
<div class="btn-group-vertical">
|
||||
<button type="button" class="btn btn-primary btn-outlined btn-xs increase-order"><i class="ti ti-chevron-up ti-xs"></i></button>
|
||||
<button type="button" class="btn btn-primary btn-xs decrease-order" data-id="${d.id}"><i class="ti ti-chevron-down ti-xs"></i></button>
|
||||
@ -351,6 +358,7 @@ class OrdenTrabajo {
|
||||
this.fillOtDetails()
|
||||
this.fillOtDates()
|
||||
this.fillPreimpresionReview()
|
||||
this.isOtFinalizada = this.summaryData.ot.estado == "F";
|
||||
this.datatableTareas.ajax.reload()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
@ -649,7 +657,7 @@ class OrdenTrabajo {
|
||||
this.handleEstadoChangeSuccess.bind(this),
|
||||
this.handleEstadoChangeError.bind(this)
|
||||
);
|
||||
alertConfirmAction("Esta acción marcará la orden de trabjao como FINALIZADA")
|
||||
alertConfirmAction("Esta acción marcará la orden de trabajo como FINALIZADA")
|
||||
.then(result => {
|
||||
if (result.isConfirmed) {
|
||||
ajax.post()
|
||||
@ -660,8 +668,28 @@ class OrdenTrabajo {
|
||||
popSuccessAlert(response.message)
|
||||
this.alertOrdenTrabajo.removeClass("alert-info").addClass("alert-success")
|
||||
this.btnFinalizarPedido.prop("disabled", true);
|
||||
window.location.reload();
|
||||
}
|
||||
handleEstadoChangeError() { }
|
||||
handleReactivarPedido() {
|
||||
const ajax = new Ajax(
|
||||
"/produccion/ordentrabajo/update",
|
||||
{
|
||||
orden_trabajo_id: this.modelId,
|
||||
estado: 'I'
|
||||
},
|
||||
null,
|
||||
this.handleEstadoChangeSuccess.bind(this),
|
||||
this.handleEstadoChangeError.bind(this)
|
||||
);
|
||||
alertConfirmAction("Esta acción reactivará la orden de trabajo.")
|
||||
.then(result => {
|
||||
if (result.isConfirmed) {
|
||||
ajax.post()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
handleTareaDeleteConfirmation(event) {
|
||||
const orden_tarea_id = $(event.currentTarget).data("id")
|
||||
alertConfirmationDelete("¿Estás seguro de realizar esta acción?")
|
||||
|
||||
@ -173,10 +173,11 @@ table td{
|
||||
color: white;
|
||||
}
|
||||
.cmyk{
|
||||
background-image: url('/themes/vuexy/img/safekat/presupuestos/cmyk.png')
|
||||
background-image: url('/themes/vuexy/img/safekat/presupuestos/cmyk.png');
|
||||
background-size: 110px;
|
||||
text-shadow: 0px 0px 1px black;
|
||||
stroke:black;
|
||||
color : white;
|
||||
text-shadow: 0px 0px 2px black;
|
||||
stroke:white;
|
||||
}
|
||||
.bn{
|
||||
background : black;
|
||||
|
||||
Reference in New Issue
Block a user