mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
revision ot v2
This commit is contained in:
@ -33,6 +33,7 @@ class OrdenTrabajo {
|
||||
this.datatableColumns = [
|
||||
{ data: 'orden', searchable: true, sortable: true, render: this._renderOrdenTarea.bind(this) },
|
||||
{ data: 'nombre', searchable: true, sortable: true },
|
||||
{ data: 'tarea_estado', searchable: false, sortable: false, render: this._renderTareaEstado.bind(this) },
|
||||
{
|
||||
data: 'maquina_presupuesto_linea', searchable: true, sortable: true, render: (d) => {
|
||||
if (d) {
|
||||
@ -68,10 +69,9 @@ class OrdenTrabajo {
|
||||
*/
|
||||
this.configUploadDropzone = {
|
||||
domElement: '#dropzone-ot-files',
|
||||
nameId: "orden_trabajo_id",
|
||||
getUri: '/produccion/ordentrabajo/get_files',
|
||||
postUri: '/produccion/ordentrabajo/upload_files',
|
||||
resourcePath: 'orden_trabajo/' + this.modelId
|
||||
nameId: "presupuesto_id",
|
||||
getUri: '/presupuestos/presupuestocliente/get_files',
|
||||
postUri: '/presupuestos/presupuestocliente/upload_files'
|
||||
}
|
||||
if ($(this.configUploadDropzone.domElement).length > 0) {
|
||||
this.fileUploadDropzone = new FileUploadDropzone(this.configUploadDropzone)
|
||||
@ -266,6 +266,22 @@ class OrdenTrabajo {
|
||||
</div>`
|
||||
return cell;
|
||||
}
|
||||
_renderTareaEstado(d, t) {
|
||||
let html = `
|
||||
<div class="btn-group dropstart">
|
||||
<button style="background-color:${d.color};color:white" class="btn btn-xs dropdown-toggle" type="button" data-bs-toggle="dropdown">
|
||||
${d.title}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li> <a class="dropdown-item" href="javascript:void(0);">${d.userName}</a> </li>
|
||||
</ul>
|
||||
</div>
|
||||
`
|
||||
if(d.userName == ""){
|
||||
html = `<span style="background-color:${d.color};color:white" class="badge">${d.title}</span>`
|
||||
}
|
||||
return html
|
||||
}
|
||||
_renderOrdenTarea(d, t) {
|
||||
|
||||
return `
|
||||
@ -431,6 +447,13 @@ class OrdenTrabajo {
|
||||
this.fillPreimpresionReview()
|
||||
this.fillPliegos()
|
||||
this.isOtFinalizada = this.summaryData.ot.estado == "F";
|
||||
if (this.isOtFinalizada) {
|
||||
this.btnEraseDate.addClass('d-none').attr('disabled', 'disabled')
|
||||
this.btnErasePedidoDate.addClass('d-none').attr('disabled', 'disabled')
|
||||
} else {
|
||||
this.btnEraseDate.removeClass('d-none').removeAttr('disabled')
|
||||
this.btnErasePedidoDate.removeClass('d-none').removeAttr('disabled')
|
||||
}
|
||||
this.datatableTareas.ajax.reload()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
Reference in New Issue
Block a user