mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
feat:errores presupuesto
This commit is contained in:
@ -11,7 +11,11 @@ class ErrorPresupuestoForm {
|
||||
this.inputDatos = this.item.find("#datos-presupuesto")
|
||||
this.inputComments = this.item.find("#comments-presupuesto")
|
||||
this.errorPresupuestoId = this.item.find("#error-presupuesto-id").attr("value")
|
||||
this.updateBtnIcon = this.item.find("#update-button-icon")
|
||||
this.updateBtnIcon = this.item.find(".button-update-comment")
|
||||
this.checkVisto = this.item.find("#error-presupuesto-visto")
|
||||
this.loader = this.item.find("#update-button-loader")
|
||||
this.btnIcon = this.item.find("#update-button-icon")
|
||||
|
||||
}
|
||||
init() {
|
||||
this.item.on("click",".button-update-comment",this.handlePostErrorPresupuesto.bind(this))
|
||||
@ -32,10 +36,15 @@ class ErrorPresupuestoForm {
|
||||
this.inputPresupuestoUserId.val(data.data.presupuestoUser)
|
||||
this.inputDatos.val(data.data.datos)
|
||||
this.inputComments.val(data.data.comment)
|
||||
this.updateBtnIcon.removeClass()
|
||||
this.updateBtnIcon.addClass("ti ti-md ti-send")
|
||||
this.updateBtnIcon.prop("disabled",false)
|
||||
this.checkVisto.prop("checked",parseInt(data.data.visto) == 1 ? true : false)
|
||||
this.setLoader(false)
|
||||
|
||||
}
|
||||
setLoader(state = true){
|
||||
this.loader.prop("hidden",!state)
|
||||
this.btnIcon.prop("hidden",state)
|
||||
}
|
||||
handleGetErrorPresupuestoError(){}
|
||||
handlePostErrorPresupuesto()
|
||||
{
|
||||
@ -43,8 +52,8 @@ class ErrorPresupuestoForm {
|
||||
{
|
||||
"comments" : this.inputComments.val()
|
||||
}
|
||||
this.updateBtnIcon.removeClass()
|
||||
this.updateBtnIcon.addClass("spinner-border spinner-border-lg text-secondary")
|
||||
this.updateBtnIcon.prop("disabled",true)
|
||||
this.setLoader()
|
||||
const ajax = new Ajax(
|
||||
`/configuracion/errores-presupuesto/edit/${this.errorPresupuestoId}`,
|
||||
data,
|
||||
@ -55,8 +64,6 @@ class ErrorPresupuestoForm {
|
||||
ajax.post()
|
||||
}
|
||||
handlePostErrorPresupuestoSuccess(){
|
||||
this.updateBtnIcon.removeClass()
|
||||
this.updateBtnIcon.addClass("ti ti-md ti-check")
|
||||
|
||||
this.handleGetErrorPresupuesto()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user