Uso de script central de rut
This commit is contained in:
@ -150,6 +150,7 @@
|
|||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
@include('layout.body.scripts.rut')
|
||||||
@push('page_scripts')
|
@push('page_scripts')
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
const regiones = [
|
const regiones = [
|
||||||
@ -158,7 +159,7 @@
|
|||||||
@endforeach
|
@endforeach
|
||||||
]
|
]
|
||||||
|
|
||||||
class Rut {
|
class RutHandler {
|
||||||
ids
|
ids
|
||||||
patterns
|
patterns
|
||||||
valid
|
valid
|
||||||
@ -222,7 +223,7 @@
|
|||||||
if (!this.is().like(rut) || (not_suspicious && this.is().suspicious(rut))) {
|
if (!this.is().like(rut) || (not_suspicious && this.is().suspicious(rut))) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return this.get().verifier(rut).toLowerCase() === this.calculate().verifier(this.get().digits(rut))
|
return Rut.validar(this.get().digits(rut), this.get().verifier(rut))
|
||||||
}
|
}
|
||||||
verify(event) {
|
verify(event) {
|
||||||
this.alert().valid()
|
this.alert().valid()
|
||||||
@ -407,7 +408,7 @@
|
|||||||
return lines.join("\n")
|
return lines.join("\n")
|
||||||
}
|
}
|
||||||
activate() {
|
activate() {
|
||||||
new Rut({id: '#rut', alert_id: '#alert_rut', valid: this.valid})
|
new RutHandler({id: '#rut', alert_id: '#alert_rut', valid: this.valid})
|
||||||
const comuna = new Comuna('#comuna')
|
const comuna = new Comuna('#comuna')
|
||||||
new Region({id: '#region', comuna})
|
new Region({id: '#region', comuna})
|
||||||
}
|
}
|
||||||
@ -469,7 +470,7 @@
|
|||||||
return [lines.join("\n"), this.persona.draw()].join("\n")
|
return [lines.join("\n"), this.persona.draw()].join("\n")
|
||||||
}
|
}
|
||||||
activate() {
|
activate() {
|
||||||
new Rut({id: '#rut_sociedad', alert_id: '#alert_rut_sociedad'})
|
new RutHandler({id: '#rut_sociedad', alert_id: '#alert_rut_sociedad'})
|
||||||
const comuna = new Comuna('#comuna_sociedad')
|
const comuna = new Comuna('#comuna_sociedad')
|
||||||
new Region({id: '#region_sociedad', comuna})
|
new Region({id: '#region_sociedad', comuna})
|
||||||
this.persona.activate()
|
this.persona.activate()
|
||||||
@ -542,7 +543,7 @@
|
|||||||
}
|
}
|
||||||
activate() {
|
activate() {
|
||||||
this.persona.activate()
|
this.persona.activate()
|
||||||
new Rut({id: '#rut_otro', alert_id: '#alert_rut_otro'})
|
new RutHandler({id: '#rut_otro', alert_id: '#alert_rut_otro'})
|
||||||
const comuna = new Comuna('#comuna_otro')
|
const comuna = new Comuna('#comuna_otro')
|
||||||
new Region({id: '#region_otro', comuna})
|
new Region({id: '#region_otro', comuna})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user