FIX: onChange
This commit is contained in:
@ -18,6 +18,8 @@
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@include('layout.body.scripts.rut')
|
||||
|
||||
@push('page_scripts')
|
||||
@include('ventas.facturacion.show.factura')
|
||||
@include('ventas.facturacion.show.propietario')
|
||||
|
@ -28,7 +28,11 @@
|
||||
facturas.draw().facturas()
|
||||
},
|
||||
rut: rut => {
|
||||
this.props.rut = rut
|
||||
rut = rut.replaceAll(/~\d|\.|-/g, '')
|
||||
const digito = rut.slice(-1)
|
||||
rut = rut.slice(0, -1)
|
||||
this.props.rut = Rut.format(rut) + '-' + digito
|
||||
document.getElementById('rut'+this.props.index).value = this.props.rut
|
||||
facturas.venta.update().facturas()
|
||||
facturas.draw().facturas()
|
||||
},
|
||||
@ -72,7 +76,7 @@
|
||||
})
|
||||
},
|
||||
rut: () => {
|
||||
document.getElementById('rut'+this.props.index).addEventListener('input', inputEvent => {
|
||||
document.getElementById('rut'+this.props.index).addEventListener('change', inputEvent => {
|
||||
const rut = inputEvent.currentTarget.value
|
||||
if (rut === this.props.rut) {
|
||||
return
|
||||
@ -81,7 +85,7 @@
|
||||
})
|
||||
},
|
||||
nombre: () => {
|
||||
document.getElementById('propietario'+this.props.index).addEventListener('input', inputEvent => {
|
||||
document.getElementById('propietario'+this.props.index).addEventListener('change', inputEvent => {
|
||||
const nombre = inputEvent.currentTarget.value
|
||||
if (nombre === this.props.nombre) {
|
||||
return
|
||||
@ -90,7 +94,7 @@
|
||||
})
|
||||
},
|
||||
direccion: () => {
|
||||
document.getElementById('direccion_propietario'+this.props.index).addEventListener('input', inputEvent => {
|
||||
document.getElementById('direccion_propietario'+this.props.index).addEventListener('change', inputEvent => {
|
||||
const direccion = inputEvent.currentTarget.value
|
||||
if (direccion === this.props.direccion) {
|
||||
return
|
||||
|
Reference in New Issue
Block a user