mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
add select imposicion datatable
This commit is contained in:
@ -4,7 +4,12 @@ import ImposicionEsquemaDrawing from '../imposicionEsquemaDrawing.js';
|
||||
class ImposicionEsquemaForm {
|
||||
constructor(domItem) {
|
||||
this.item = domItem
|
||||
this.drawing = new ImposicionEsquemaDrawing($("#imposicion-esquema-drawing"))
|
||||
if ($("#imposicion-esquema-drawing").length > 0) {
|
||||
|
||||
this.drawing = new ImposicionEsquemaDrawing($("#imposicion-esquema-drawing"))
|
||||
} else {
|
||||
this.drawing = null
|
||||
}
|
||||
this.modelId = this.item.data("id");
|
||||
this.btnSubmitUpdateImposicion = this.item.find("#btnSubmitUpdateImposicionEsquema")
|
||||
this.btnSubmitNewImposicion = this.item.find("#btnSubmitNewImposicionEsquema")
|
||||
@ -29,31 +34,34 @@ class ImposicionEsquemaForm {
|
||||
|
||||
}
|
||||
init() {
|
||||
this.item.on("change", "#esquema-rows", (event) => {
|
||||
let rows = $(event.currentTarget).val()
|
||||
this.drawing.setRows(rows)
|
||||
})
|
||||
this.item.on("change", "#esquema-rotativa", (event) => {
|
||||
let rotativa = $(event.currentTarget).prop("checked")
|
||||
this.drawing.setRotativa(rotativa)
|
||||
})
|
||||
this.item.on("change", "#esquema-cosido", (event) => {
|
||||
let cosido = $(event.currentTarget).prop("checked")
|
||||
this.drawing.setCosido(cosido)
|
||||
})
|
||||
this.item.on("change", "#esquema-orientacion", (event) => {
|
||||
let orientation = $(event.currentTarget).val()
|
||||
this.drawing.setOrientation(orientation)
|
||||
})
|
||||
this.item.on("change", "#esquema-columns", (event) => {
|
||||
let columns = $(event.currentTarget).val()
|
||||
this.drawing.setColumns(columns)
|
||||
})
|
||||
if (this.modelId) {
|
||||
this.btnSubmitUpdateImposicion.on("click", this.handleUpdate.bind(this))
|
||||
this.handleGetData()
|
||||
} else {
|
||||
this.initNew()
|
||||
if (this.drawing) {
|
||||
this.drawing.setOrientation($("#esquema-orientacion").val())
|
||||
this.item.on("change", "#esquema-rows", (event) => {
|
||||
let rows = $(event.currentTarget).val()
|
||||
this.drawing.setRows(rows)
|
||||
})
|
||||
this.item.on("change", "#esquema-rotativa", (event) => {
|
||||
let rotativa = $(event.currentTarget).prop("checked")
|
||||
this.drawing.setRotativa(rotativa)
|
||||
})
|
||||
this.item.on("change", "#esquema-cosido", (event) => {
|
||||
let cosido = $(event.currentTarget).prop("checked")
|
||||
this.drawing.setCosido(cosido)
|
||||
})
|
||||
this.item.on("change", "#esquema-orientacion", (event) => {
|
||||
let orientation = $(event.currentTarget).val()
|
||||
this.drawing.setOrientation(orientation)
|
||||
})
|
||||
this.item.on("change", "#esquema-columns", (event) => {
|
||||
let columns = $(event.currentTarget).val()
|
||||
this.drawing.setColumns(columns)
|
||||
})
|
||||
if (this.modelId) {
|
||||
this.btnSubmitUpdateImposicion.on("click", this.handleUpdate.bind(this))
|
||||
this.handleGetData()
|
||||
} else {
|
||||
this.initNew()
|
||||
}
|
||||
}
|
||||
}
|
||||
initNew() {
|
||||
@ -156,6 +164,7 @@ class ImposicionEsquemaForm {
|
||||
this.disable()
|
||||
this.item.find(".invalid-feedback").remove()
|
||||
this.btnSubmitNewImposicion.addClass("d-none")
|
||||
this.btnSubmitUpdateImposicion.addClass("d-none")
|
||||
popSuccessAlert(response.message)
|
||||
}
|
||||
postErrorNew(error) {
|
||||
|
||||
Reference in New Issue
Block a user