mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into 'feat/catalogo'
Main See merge request jjimenez/safekat!707
This commit is contained in:
@ -68,7 +68,6 @@ class Chat {
|
||||
}
|
||||
|
||||
if (this.chatHistoryBody[0]) {
|
||||
//console.log("History body");
|
||||
this.scrollbarChatHistory = new PerfectScrollbar(this.chatHistoryBody[0], {
|
||||
wheelPropagation: false,
|
||||
suppressScrollX: true,
|
||||
@ -126,12 +125,10 @@ class Chat {
|
||||
<span class="item-text">${state.text}</span>
|
||||
<span class="badge text-bg-secondary">${state.desc ?? ''}</span>
|
||||
</div>`)
|
||||
console.log(state)
|
||||
return $state;
|
||||
}
|
||||
this.selectClientUser.init()
|
||||
this.selectItem.on('change', () => {
|
||||
console.log(this.selectClientUser.getVal(),this.selectClientUser.getText())
|
||||
if (this.selectClientUser.getVal()) {
|
||||
this.sendBtnMessageDepartment.attr('disabled', null)
|
||||
} else {
|
||||
@ -181,6 +178,15 @@ class Chat {
|
||||
this.initSelectClient()
|
||||
// setInterval(this._getChatMessage.bind(this), 10000)
|
||||
}
|
||||
initOrdenTrabajo() {
|
||||
this.chatType = "ot"
|
||||
this._handleGetChatList()
|
||||
this.sendBtnMessageDepartment.on("click", this._sendMessage.bind(this))
|
||||
this.sendBtnMessageDepartmentClient.on("click", this._sendMessage.bind(this))
|
||||
this.messageInput.on("keypress", this._sendMessagePressKey.bind(this))
|
||||
this.initSelectClient()
|
||||
// setInterval(this._getChatMessage.bind(this), 10000)
|
||||
}
|
||||
initContacts() {
|
||||
this.chatType = "internal"
|
||||
|
||||
|
||||
@ -14,11 +14,14 @@ class OrdenTrabajoDatatable {
|
||||
{ data: 'cliente_nombre', searchable: false, sortable: false },
|
||||
{ data: 'presupuesto_titulo', searchable: false, sortable: false },
|
||||
{ data: 'ubicacion_nombre', searchable: false, sortable: false },
|
||||
{ data: 'total_tirada', searchable: false, sortable: false ,render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||
{ data: 'total_tirada', searchable: false, sortable: false, render: (d) => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'tipo_presupuesto_impresion', searchable: false, sortable: false },
|
||||
{
|
||||
data: 'logo', searchable: false, sortable: false, render: (d, t) => {
|
||||
return `<img src="${d}" width="30px" height="30px" alt="logo-impresion" />`
|
||||
return `<div class="logo-container">
|
||||
<img class="d-block" src="${d.logo}" width="45px" height="45px" alt="logo-impresion" />
|
||||
${d.imposicion ? `<span class="imposicion-overlay-image">${d.imposicion ?? ""}</span>` : ''}
|
||||
</div>`
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -50,8 +53,9 @@ class OrdenTrabajoDatatable {
|
||||
bottomStart: 'info',
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
columnDefs : [
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
|
||||
],
|
||||
serverSide: true,
|
||||
pageLength: 25,
|
||||
@ -59,7 +63,11 @@ class OrdenTrabajoDatatable {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/datatable'
|
||||
ajax: '/produccion/ordentrabajo/datatable',
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
$(row).css("border-left",`10px solid ${data.logo.color}`)
|
||||
$(row).css("border-right",`10px solid ${data.logo.color}`)
|
||||
}
|
||||
});
|
||||
}
|
||||
initPendientes() {
|
||||
@ -71,8 +79,9 @@ class OrdenTrabajoDatatable {
|
||||
bottomStart: 'info',
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
columnDefs : [
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
|
||||
],
|
||||
serverSide: true,
|
||||
pageLength: 25,
|
||||
@ -80,7 +89,12 @@ class OrdenTrabajoDatatable {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/datatable_pendientes'
|
||||
ajax: '/produccion/ordentrabajo/datatable_pendientes',
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
initFerroPendiente() {
|
||||
@ -94,11 +108,19 @@ class OrdenTrabajoDatatable {
|
||||
},
|
||||
serverSide: true,
|
||||
pageLength: 25,
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
|
||||
],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/datatable_ferro_pendiente'
|
||||
ajax: '/produccion/ordentrabajo/datatable_ferro_pendiente',
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
||||
}
|
||||
});
|
||||
}
|
||||
initFerroOk() {
|
||||
@ -111,12 +133,20 @@ class OrdenTrabajoDatatable {
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
serverSide: true,
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
|
||||
],
|
||||
pageLength: 25,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/datatable_ferro_ok'
|
||||
ajax: '/produccion/ordentrabajo/datatable_ferro_ok',
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
12
httpdocs/assets/js/safekat/pages/chatOrdenTrabajo.js
Normal file
12
httpdocs/assets/js/safekat/pages/chatOrdenTrabajo.js
Normal file
@ -0,0 +1,12 @@
|
||||
import Chat from '../components/chat.js'
|
||||
import InternalMessages from "../components/internalMessagesSection.js"
|
||||
$(function () {
|
||||
let chat = new Chat($("#chat-orden-trabajo"))
|
||||
chat.init()
|
||||
chat.initOrdenTrabajo()
|
||||
if ($("#internal_messages_chat").length > 0) {
|
||||
let internalMessages = new InternalMessages($("#internal_messages_chat"))
|
||||
internalMessages.init()
|
||||
}
|
||||
|
||||
})
|
||||
@ -4,7 +4,7 @@ $(() => {
|
||||
margin: 2,
|
||||
filename: "PDF_OrdenTrabajo_" + $(".pdf-wrapper").data("id") + ".pdf",
|
||||
image: { type: 'jpeg', quality: 1 },
|
||||
html2canvas: { scale: 3 },
|
||||
html2canvas: { scale: 4 },
|
||||
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
|
||||
};
|
||||
let elementToPdf = $('body')[0]
|
||||
|
||||
@ -399,7 +399,9 @@ class PresupuestoAdminEdit {
|
||||
self.tipo_impresion.val(response.data.tipo_impresion);
|
||||
self.POD.val(response.data.POD);
|
||||
|
||||
AutoNumeric.getAutoNumericElement($('#total_aceptado_revisado')[0]).set(response.data.total_aceptado_revisado);
|
||||
const totalAceptadoRevisado = response.data.total_aceptado_revisado != null ?
|
||||
response.data.total_aceptado_revisado : response.data.resumen.total_aceptado;
|
||||
AutoNumeric.getAutoNumericElement($('#total_aceptado_revisado')[0]).set(totalAceptadoRevisado);
|
||||
|
||||
$('#aprobado_by_at').html(response.data.aprobado_by_at);
|
||||
|
||||
|
||||
@ -414,6 +414,9 @@ class Resumen {
|
||||
if (total_aceptado_revisado && total_aceptado_revisado != 0) {
|
||||
data.total_aceptado_revisado = total_aceptado_revisado;
|
||||
}
|
||||
else{
|
||||
data.total_aceptado_revisado = data.total_aceptado;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import Ajax from "../../components/ajax.js"
|
||||
import ClassSelect from "../../components/select2.js";
|
||||
import DatePicker from "../../components/datepicker.js";
|
||||
import { alertConfirmationDelete, alertSuccess } from "../../components/alerts/sweetAlert.js";
|
||||
import { alertConfirmAction, alertConfirmationDelete, alertSuccess } from "../../components/alerts/sweetAlert.js";
|
||||
import Modal from "../../components/modal.js"
|
||||
import FileUploadDropzone from '../../components/forms/fileUploadDropzone.js';
|
||||
class OrdenTrabajo {
|
||||
@ -26,7 +26,7 @@ class OrdenTrabajo {
|
||||
{ data: 'nombre', searchable: true, sortable: true, width: "20%" },
|
||||
{ data: 'maquina_presupuesto_linea', searchable: true, sortable: true, width: "20%" },
|
||||
{ data: 'maquina_tarea', searchable: false, sortable: false, render: this._renderMaquinaSelectTable.bind(this), width: "20%" },
|
||||
// { data: 'imposicion_id', searchable: false, sortable: false },
|
||||
{ data: 'imposicion', searchable: false, sortable: false, render: this._renderImposicionSelectTable.bind(this) },
|
||||
{ data: 'tiempo_estimado', searchable: false, sortable: false },
|
||||
{ data: 'tiempo_real', searchable: false, sortable: false },
|
||||
{
|
||||
@ -42,13 +42,13 @@ class OrdenTrabajo {
|
||||
nameId: "orden_trabajo_id",
|
||||
getUri: '/produccion/ordentrabajo/get_files',
|
||||
postUri: '/produccion/ordentrabajo/upload_files',
|
||||
resourcePath : 'orden_trabajo/' + this.modelId
|
||||
resourcePath: 'orden_trabajo/' + this.modelId
|
||||
}
|
||||
if ($(this.configUploadDropzone.domElement).length > 0) {
|
||||
this.fileUploadDropzone = new FileUploadDropzone(this.configUploadDropzone)
|
||||
}
|
||||
}
|
||||
initDropFiles(){
|
||||
initDropFiles() {
|
||||
if ($(this.configUploadDropzone.domElement).length > 0) {
|
||||
this.fileUploadDropzone.init()
|
||||
}
|
||||
@ -60,13 +60,7 @@ class OrdenTrabajo {
|
||||
dateFormat: "Y-m-d",
|
||||
allowInput: true,
|
||||
}
|
||||
this.tiempoProcesamiento = new DatePicker(this.otForm.find("#ot-tiempo-procesamiento"), {
|
||||
dateFormat: "H:i",
|
||||
enableTime: true,
|
||||
noCalendar: true,
|
||||
time_24hr: true,
|
||||
allowInput: true,
|
||||
})
|
||||
this.tiempoProcesamiento = this.otForm.find("#ot-tiempo-procesamiento")
|
||||
this.fechaImpresion = new DatePicker(this.otForm.find("#ot-fecha-impresion"), option)
|
||||
this.fechaEncuadernado = new DatePicker(this.otForm.find("#ot-fecha-encuadernado"), option)
|
||||
this.fechaEntregaExterno = new DatePicker(this.otForm.find("#ot-fecha-entrega-externo"), option)
|
||||
@ -78,18 +72,45 @@ class OrdenTrabajo {
|
||||
this.ferroOk = new DatePicker(this.otForm.find("#ot-ferro-ok"), option)
|
||||
this.plakeneTraslucido = new DatePicker(this.otForm.find("#ot-plakene-traslucido"), option)
|
||||
this.impresionColor = new DatePicker(this.otForm.find("#ot-impresion-color"), option)
|
||||
this.impresionBN = new DatePicker(this.otForm.find("#ot-impresion-bn"), option)
|
||||
|
||||
this.portada = new DatePicker(this.otForm.find("#ot-portada"), option)
|
||||
this.plastificadoMate = new DatePicker(this.otForm.find("#ot-plastificado-mate"), option)
|
||||
this.prepGuillotina = new DatePicker(this.otForm.find("#ot-prep-guillotina"), option)
|
||||
this.prepCosido = new DatePicker(this.otForm.find("#ot-prep-cosido"), option)
|
||||
this.prepGrapado = new DatePicker(this.otForm.find("#ot-prep-grapado"), option)
|
||||
this.prepSolapa = new DatePicker(this.otForm.find("#ot-prep-solapa"), option)
|
||||
|
||||
this.prepPrototipo = new DatePicker(this.otForm.find("#ot-prep-prototipo"), option)
|
||||
this.prepMarcapaginas = new DatePicker(this.otForm.find("#ot-prep-marcapaginas"), option)
|
||||
this.prepRetractilado = new DatePicker(this.otForm.find("#ot-prep-retractilado"), option)
|
||||
this.prepRetractilado5 = new DatePicker(this.otForm.find("#ot-prep-retractilado5"), option)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
this.espiral = new DatePicker(this.otForm.find("#ot-espiral"), option)
|
||||
this.embalaje = new DatePicker(this.otForm.find("#ot-embalaje"), option)
|
||||
this.envio = new DatePicker(this.otForm.find("#ot-envio"), option)
|
||||
|
||||
//REVISION PREIMPRESION
|
||||
this.preFormatoAt = new DatePicker(this.otForm.find("#ot-preformato-date"), option)
|
||||
this.preLomoAt = new DatePicker(this.otForm.find("#ot-prelomo-date"), option)
|
||||
this.preSolapaAt = new DatePicker(this.otForm.find("#ot-presolapa-date"), option)
|
||||
this.preCodBarrasAt = new DatePicker(this.otForm.find("#ot-precodbarras-date"), option)
|
||||
this.preImposicionAt = new DatePicker(this.otForm.find("#ot-preimposicion-date"), option)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
eventTareas() {
|
||||
this.otForm.on("change", ".select-maquina-tarea-datatable", this.handleTareaChange.bind(this))
|
||||
this.otForm.on("change", ".orden-tarea", this.handleTareaChange.bind(this))
|
||||
this.otForm.on("change", ".select-imposicion-tarea-datatable", this.handleTareaChange.bind(this))
|
||||
this.otForm.on("click", ".increase-order", (event) => {
|
||||
const input_orden_tarea = $(event.currentTarget).parent().parent().find('.orden-tarea')
|
||||
let actual_value = parseInt(input_orden_tarea.val())
|
||||
@ -105,6 +126,7 @@ class OrdenTrabajo {
|
||||
}
|
||||
unbindEventTareas() {
|
||||
this.otForm.off("change", ".select-maquina-tarea-datatable")
|
||||
this.otForm.off("change", ".select-imposicion-tarea-datatable")
|
||||
this.otForm.off("change", ".orden-tarea")
|
||||
this.otForm.off("click", ".increase-order")
|
||||
this.otForm.off("click", ".decrease-order")
|
||||
@ -117,7 +139,7 @@ class OrdenTrabajo {
|
||||
this.tareasTableItem.on("xhr.dt", this.unbindEventTareas.bind(this))
|
||||
this.otForm.on("click", "#btn-upload-portada", this.handleUploadPortada.bind(this))
|
||||
this.otForm.on("click", "#btn-delete-portada", this.handleDeletePortada.bind(this))
|
||||
this.otForm.on("click", "#btn-finalizar-orden-pedido", this.handleFinalizarPedido.bind(this))
|
||||
this.btnFinalizarPedido.on("click", this.handleFinalizarPedido.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))
|
||||
@ -172,6 +194,14 @@ class OrdenTrabajo {
|
||||
<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'}">
|
||||
<option value="${d.imposicion_id}" selected="selected">${d.name ?? ''}</option>
|
||||
</select>`
|
||||
return render
|
||||
|
||||
}
|
||||
_renderActionCell(d, t) {
|
||||
|
||||
@ -195,7 +225,6 @@ class OrdenTrabajo {
|
||||
}
|
||||
createSelectMaquinaTarea() {
|
||||
try {
|
||||
console.log("Create selects")
|
||||
this.summaryData.tasks.forEach(element => {
|
||||
let selectItem = this.item.find("#select-maquina-tarea-" + element.id);
|
||||
if (element.presupuesto_linea_id && element.is_corte == false) this.createSelectMaquinaImpresion(selectItem)
|
||||
@ -204,6 +233,26 @@ class OrdenTrabajo {
|
||||
if (element.presupuesto_manipulado_id || element.is_corte) this.createSelectMaquinaManipulado(selectItem)
|
||||
if (element.presupuesto_preimpresion_id) this.createSelectMaquinaAll(selectItem)
|
||||
if (element.presupuesto_extra_id) this.createSelectMaquinaAll(selectItem)
|
||||
if (this.summaryData.impresion_interior_bn) {
|
||||
let isTareaImpresionInteriorBN = this.summaryData.impresion_interior_bn?.presupuesto_linea_id == element.presupuesto_linea_id && element.is_corte == false
|
||||
if (isTareaImpresionInteriorBN) {
|
||||
let selectItemImposicion = this.item.find("#select-imposicion-tarea-" + element.id);
|
||||
this.createSelectImposicion(selectItemImposicion)
|
||||
} else {
|
||||
let selectItemImposicion = this.item.find("#select-imposicion-tarea-" + element.id);
|
||||
selectItemImposicion.addClass("d-none");
|
||||
}
|
||||
}
|
||||
if (this.summaryData.impresion_interior_color) {
|
||||
let isTareaImpresionInteriorColor = this.summaryData.impresion_interior_color?.presupuesto_linea_id == element.presupuesto_linea_id && element.is_corte == false
|
||||
if (isTareaImpresionInteriorColor) {
|
||||
let selectItemImposicion = this.item.find("#select-imposicion-tarea-" + element.id);
|
||||
this.createSelectImposicion(selectItemImposicion)
|
||||
} else {
|
||||
let selectItemImposicion = this.item.find("#select-imposicion-tarea-" + element.id);
|
||||
selectItemImposicion.addClass("d-none");
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
} finally {
|
||||
@ -262,6 +311,25 @@ class OrdenTrabajo {
|
||||
maquinaSelects.reset()
|
||||
}
|
||||
}
|
||||
createSelectImposicion(selectItem) {
|
||||
let imposicionId = selectItem.data("imposicion-id")
|
||||
let imposicionSelect = new ClassSelect(selectItem, `/imposiciones/select`, "Seleccione una imposición", true);
|
||||
|
||||
imposicionSelect.config.templateResult = (state) => {
|
||||
let $state = $(`
|
||||
<div class="d-flex flex-column justify-content-start align-items-start gap-1">
|
||||
<span class="item-text">${state.text}</span>
|
||||
<span class="badge text-bg-secondary">${state.desc ?? ''}</span>
|
||||
</div>`)
|
||||
return $state;
|
||||
}
|
||||
imposicionSelect.init();
|
||||
if (imposicionId) {
|
||||
imposicionSelect.setVal(imposicionId)
|
||||
} else {
|
||||
imposicionSelect.reset()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -277,15 +345,19 @@ class OrdenTrabajo {
|
||||
try {
|
||||
this.summaryData = data
|
||||
this.otForm.off("change", ".ot-date")
|
||||
this.otForm.off("change", ".ot-pedido")
|
||||
this.otForm.off("change", ".ot-pedido-check")
|
||||
this.otForm.off("change", ".ot-preview")
|
||||
this.fillOtDetails()
|
||||
this.fillOtDates()
|
||||
this.fillPreimpresionReview()
|
||||
this.datatableTareas.ajax.reload()
|
||||
} catch (error) {
|
||||
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.otForm.on("change", ".ot-date", this.handleDateChange.bind(this))
|
||||
this.otForm.on("change", ".ot-pedido", this.handlePedidoChange.bind(this))
|
||||
this.otForm.on("change", ".ot-pedido-check", this.handlePedidoCheckChange.bind(this))
|
||||
this.otForm.on("change", ".ot-preview", this.handlePreimpresionReviewChange.bind(this))
|
||||
Notiflix.Block.remove('.section-block');
|
||||
|
||||
@ -294,7 +366,7 @@ class OrdenTrabajo {
|
||||
}
|
||||
handleSummaryError(error) {
|
||||
Notiflix.Block.remove('.section-block');
|
||||
}
|
||||
}
|
||||
fillPreimpresionReview() {
|
||||
this.otForm.find("[name=fecha_entrega_warning]").prop("checked", this.summaryData.ot.fecha_entrega_warning)
|
||||
this.otForm.find("[name=fecha_entrega_warning_revised]").prop("checked", this.summaryData.ot.fecha_entrega_warning_revised)
|
||||
@ -305,41 +377,57 @@ class OrdenTrabajo {
|
||||
this.otForm.find("[name=revisar_codigo_barras]").prop("checked", this.summaryData.ot.revisar_codigo_barras)
|
||||
this.otForm.find("[name=realizar_imposicion]").prop("checked", this.summaryData.ot.realizar_imposicion)
|
||||
this.otForm.find("[name=enviar_impresion]").prop("checked", this.summaryData.ot.enviar_impresion)
|
||||
this.otForm.find("[name=inaplazable]").prop("checked", this.summaryData.pedido.inaplazable)
|
||||
|
||||
|
||||
|
||||
}
|
||||
fillOtDetails() {
|
||||
const progreso = this.summaryData.ot.progreso
|
||||
// this.otForm.find("#ot-progress-bar").attr('aria-valuenow', progreso).text(progreso + "%").css("width", progreso + "%")
|
||||
// this.otForm.find("#ot-paginas").text(this.summaryData.presupuesto.paginas)
|
||||
// this.otForm.find("#ot-tirada").text(this.summaryData.presupuesto.tirada)
|
||||
// this.otForm.find("#ot-merma").text(this.summaryData.presupuesto.merma)
|
||||
this.otForm.find("#ot-progress-bar").attr('aria-valuenow', progreso).text(progreso + "%").css("width", progreso + "%")
|
||||
}
|
||||
fillOtDates() {
|
||||
this.fechaImpresion.setDate(this.summaryData.dates.fecha_impresion_at)
|
||||
this.fechaEncuadernado.setDate(this.summaryData.dates.fecha_encuadernado_at)
|
||||
// this.fechaEntregaExterno.setDate(this.summaryData.dates.fecha_entrega_externo_)
|
||||
this.fechaEntregaReal.setDate(this.summaryData.dates.fecha_entrega_real_at)
|
||||
this.fechaEntregaEstimada.setDate(this.summaryData.dates.fecha_entrega_at)
|
||||
this.fechaImpresion.setDate(this.summaryData.pedido.fecha_impresion)
|
||||
this.fechaEncuadernado.setDate(this.summaryData.pedido.fecha_encuadernado)
|
||||
this.fechaEntregaExterno.setDate(this.summaryData.pedido.fecha_entrega_externo)
|
||||
this.fechaEntregaReal.setDate(this.summaryData.pedido.fecha_entrega_real)
|
||||
// this.fechaEntregaEstimada.setDate(this.summaryData.pedido.fecha_entrega_at)
|
||||
|
||||
this.pendienteFerro.setDate(this.summaryData.dates.pendiente_ferro_at)
|
||||
this.ferroCliente.setDate(this.summaryData.dates.ferro_en_cliente_at)
|
||||
this.ferroOk.setDate(this.summaryData.dates.ferro_ok_at)
|
||||
// this.plakeneTraslucido.setDate(this.summaryData.dates.fecha_impresion_at)
|
||||
this.impresionColor.setDate(this.summaryData.dates.interior_color_at)
|
||||
this.impresionBN.setDate(this.summaryData.dates.interior_bn_at)
|
||||
this.portada.setDate(this.summaryData.dates.cubierta_at)
|
||||
this.plastificadoMate.setDate(this.summaryData.dates.plastificado_at)
|
||||
this.prepGuillotina.setDate(this.summaryData.dates.corte_at)
|
||||
this.prepCosido.setDate(this.summaryData.dates.cosido_at)
|
||||
this.prepSolapa.setDate(this.summaryData.dates.solapa_at)
|
||||
this.prepGrapado.setDate(this.summaryData.dates.grapado_at)
|
||||
|
||||
this.prepPrototipo.setDate(this.summaryData.dates.prototipo_at)
|
||||
this.prepMarcapaginas.setDate(this.summaryData.dates.marcapaginas_at)
|
||||
this.prepRetractilado.setDate(this.summaryData.dates.retractilado_at)
|
||||
this.prepRetractilado5.setDate(this.summaryData.dates.retractilado5_at)
|
||||
|
||||
this.espiral.setDate(this.summaryData.dates.fecha_impresion_at)
|
||||
this.embalaje.setDate(this.summaryData.dates.embalaje_at)
|
||||
this.envio.setDate(this.summaryData.dates.envio_at)
|
||||
this.pedidoEnEsperaCheck.prop("checked",this.summaryData.ot.is_pedido_espera);
|
||||
if(this.summaryData.ot.pedido_espera_by){
|
||||
this.pedidoEnEsperaBy.text([this.summaryData.ot.pedido_espera_by.first_name,this.summaryData.ot.pedido_espera_by.last_name].join(" "))
|
||||
}else{
|
||||
this.pedidoEnEsperaCheck.prop("checked", this.summaryData.ot.is_pedido_espera);
|
||||
this.tiempoProcesamiento.val(this.summaryData.tiempo_procesamiento);
|
||||
if (this.summaryData.ot.pedido_espera_by) {
|
||||
this.pedidoEnEsperaBy.text([this.summaryData.ot.pedido_espera_by.first_name, this.summaryData.ot.pedido_espera_by.last_name].join(" "))
|
||||
} else {
|
||||
this.pedidoEnEsperaBy.text("");
|
||||
}
|
||||
this.otEstado.val(this.summaryData.ot.estado)
|
||||
this.preFormatoAt.setDate(this.summaryData.dates.pre_formato_at)
|
||||
this.preLomoAt.setDate(this.summaryData.dates.pre_lomo_at)
|
||||
this.preSolapaAt.setDate(this.summaryData.dates.pre_solapa_at)
|
||||
this.preCodBarrasAt.setDate(this.summaryData.dates.pre_codbarras_at)
|
||||
this.preImposicionAt.setDate(this.summaryData.dates.pre_imposicion_at)
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -349,7 +437,6 @@ class OrdenTrabajo {
|
||||
const data = {}
|
||||
data[key] = $(event.currentTarget).val()
|
||||
data["orden_trabajo_tarea_id"] = $(event.currentTarget).data("id")
|
||||
console.log(data);
|
||||
const ajax = new Ajax(
|
||||
"/produccion/ordentrabajo/update/tarea",
|
||||
data,
|
||||
@ -379,7 +466,6 @@ class OrdenTrabajo {
|
||||
}
|
||||
handleTareaChangeError(error) { }
|
||||
handleOtComment(event) {
|
||||
console.log($(event.currentTarget).val())
|
||||
const ajax = new Ajax(
|
||||
"/produccion/ordentrabajo/update",
|
||||
{
|
||||
@ -405,7 +491,6 @@ class OrdenTrabajo {
|
||||
data[key] = $(event.currentTarget).val()
|
||||
data["orden_trabajo_id"] = this.modelId
|
||||
data["name"] = key;
|
||||
console.log(data)
|
||||
const ajax = new Ajax(
|
||||
"/produccion/ordentrabajo/update/date",
|
||||
data,
|
||||
@ -426,6 +511,36 @@ class OrdenTrabajo {
|
||||
}
|
||||
}
|
||||
handleDateChangeError(errors) { }
|
||||
handlePedidoChange(event) {
|
||||
const key = $(event.currentTarget).attr("name")
|
||||
const data = {}
|
||||
const element = $(event.currentTarget);
|
||||
data[key] = $(event.currentTarget).val()
|
||||
data["orden_trabajo_id"] = this.modelId
|
||||
data["name"] = key;
|
||||
const ajax = new Ajax(
|
||||
"/produccion/ordentrabajo/update/pedido/date",
|
||||
data,
|
||||
null,
|
||||
this.handleDateChangeSuccess.bind(this, element),
|
||||
this.handleDateChangeError.bind(this)
|
||||
)
|
||||
ajax.post();
|
||||
}
|
||||
handlePedidoCheckChange(event) {
|
||||
const key = $(event.currentTarget).attr("name")
|
||||
const data = {}
|
||||
data[key] = $(event.currentTarget).is(":checked") ? 1 : 0
|
||||
data["orden_trabajo_id"] = this.modelId
|
||||
const ajax = new Ajax(
|
||||
"/produccion/ordentrabajo/update/pedido",
|
||||
data,
|
||||
null,
|
||||
this.handlePreimpresionReviewChangeSuccess.bind(this),
|
||||
this.handlePreimpresionReviewChangeError.bind(this)
|
||||
)
|
||||
ajax.post();
|
||||
}
|
||||
handlePreimpresionReviewChange(event) {
|
||||
const key = $(event.currentTarget).attr("name")
|
||||
const data = {}
|
||||
@ -534,7 +649,12 @@ class OrdenTrabajo {
|
||||
this.handleEstadoChangeSuccess.bind(this),
|
||||
this.handleEstadoChangeError.bind(this)
|
||||
);
|
||||
ajax.post()
|
||||
alertConfirmAction("Esta acción marcará la orden de trabjao como FINALIZADA")
|
||||
.then(result => {
|
||||
if (result.isConfirmed) {
|
||||
ajax.post()
|
||||
}
|
||||
})
|
||||
}
|
||||
handleEstadoChangeSuccess(response) {
|
||||
popSuccessAlert(response.message)
|
||||
|
||||
@ -151,6 +151,9 @@ class PlanningRotativa {
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
this.getColorOtStatus(row,data)
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/planning/rotativa/datatable'
|
||||
});
|
||||
@ -165,7 +168,9 @@ class PlanningRotativa {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatablePlanaColumns,
|
||||
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
this.getColorOtStatus(row,data)
|
||||
},
|
||||
ajax: {
|
||||
url : '/produccion/ordentrabajo/planning/plana/datatable',
|
||||
data : d => {
|
||||
@ -245,7 +250,7 @@ class PlanningRotativa {
|
||||
this.tablePlanningPlana.on('change', ".pliegos-check", this.calcPliegosCheck.bind(this))
|
||||
}
|
||||
_renderBtnAction(d) {
|
||||
return `<a href="/produccion/ordentrabajo/edit/${d.otId}" class="ot-tarea-comment" data-id="${d.otId}"><i class="ti ti-eye"></i></a>`
|
||||
return `<a href="/produccion/ordentrabajo/edit/${d.data.otId}" class="ot-tarea-comment" data-id="${d.data.otId}"><i class="ti ti-eye"></i></a>`
|
||||
}
|
||||
_columnFiltering() {
|
||||
this.api().columns()
|
||||
@ -362,7 +367,15 @@ class PlanningRotativa {
|
||||
}
|
||||
toggleCorteError(){
|
||||
}
|
||||
|
||||
getColorOtStatus(row,data){
|
||||
let ajax = new Ajax("/produccion/ordentrabajo/color/"+data.otId,null,null,
|
||||
(response) => {
|
||||
$(row).css("border-left",`10px solid ${response.color}`)
|
||||
$(row).css("border-right",`10px solid ${response.color}`)
|
||||
},null
|
||||
)
|
||||
ajax.get()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user