Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
queue
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cristian Mauricio Diaz Canales
queue
Commits
f5affe25
Commit
f5affe25
authored
Dec 23, 2022
by
Cristian Mauricio Diaz Canales
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementacion Pad Numerico - Ingreso Rut
parent
f65e4f84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
109 additions
and
5 deletions
+109
-5
resources/views/issue_token/index.blade.php
resources/views/issue_token/index.blade.php
+109
-5
No files found.
resources/views/issue_token/index.blade.php
View file @
f5affe25
@
extends
(
'layout.call_page'
)
@
extends
(
'layout.call_page'
)
@
section
(
'content'
)
@
section
(
'content'
)
<!--
BEGIN
:
Page
Main
-->
<!--
BEGIN
:
Page
Main
-->
<
style
>
.
numeric
-
pad
{
display
:
inline
-
grid
;
grid
-
template
-
columns
:
repeat
(
3
,
1
fr
);
grid
-
gap
:
7
px
;
}
.
numeric
-
pad
button
{
width
:
80
px
;
height
:
50
px
;
font
-
size
:
20
px
;
}
</
style
>
<
div
id
=
"loader-wrapper"
>
<
div
id
=
"loader-wrapper"
>
<
div
id
=
"loader"
></
div
>
<
div
id
=
"loader"
></
div
>
...
@@ -33,7 +46,7 @@
...
@@ -33,7 +46,7 @@
</section>
</section>
</div>
</div>
<!-- Modal Structure -->
<!-- Modal Structure -->
<div id="
modal1
" class="
modal
modal
-
fixed
-
footer
" style="
max
-
height
:
30
%
;
width
:
8
0
%
">
<div id="
modal1
" class="
modal
modal
-
fixed
-
footer
" style="
max
-
height
:
70
%
;
width
:
5
0
%
">
<form id="
details_form
">
<form id="
details_form
">
<div class="
modal
-
content
" style="
padding
-
bottom
:
0
">
<div class="
modal
-
content
" style="
padding
-
bottom
:
0
">
<div id="
inline
-
form
">
<div id="
inline
-
form
">
...
@@ -60,10 +73,26 @@
...
@@ -60,10 +73,26 @@
</div>
</div>
</div>
</div>
<div class="
input
-
field
col
s4
" id="
rut_tab
">
<input id="
rut
" name="
rut
" type="
text
" value="" data-error="
.
rut
">
<div class="
input
-
field
col
-
lg
-
4
s4
" id="
rut_tab
">
<input id="
rut
" name="
rut
" type="
text
" value="" oninput="
formatearRut
(
this
);
" data-error="
.
rut
">
<label for="
rut
">
{
{__('messages.settings.rut')}
}
</label>
<label for="
rut
">
{
{__('messages.settings.rut')}
}
</label>
<div class="
rut
">
<div class="
rut
">
<span><b>Ingrese su rut para poder solicitar su número de atención</b></span>
<div class="
input
-
field
numeric
-
pad
" style="
padding
-
left
:
150
px
;
">
<button onclick="
escribirValor
(
1
,
event
)
">1</button>
<button onclick="
escribirValor
(
2
,
event
)
">2</button>
<button onclick="
escribirValor
(
3
,
event
)
">3</button>
<button onclick="
escribirValor
(
4
,
event
)
">4</button>
<button onclick="
escribirValor
(
5
,
event
)
">5</button>
<button onclick="
escribirValor
(
6
,
event
)
">6</button>
<button onclick="
escribirValor
(
7
,
event
)
">7</button>
<button onclick="
escribirValor
(
8
,
event
)
">8</button>
<button onclick="
escribirValor
(
9
,
event
)
">9</button>
<button onclick="
escribirValor
(
-
2
,
event
)
">K</button>
<button onclick="
escribirValor
(
0
,
event
)
">0</button>
<button onclick="
escribirValor
(
-
1
,
event
)
">Del</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -87,6 +116,78 @@
...
@@ -87,6 +116,78 @@
})
})
var
service
;
var
service
;
var
Fn
=
{
// Valida el rut con su cadena completa "XXXXXXXX-X"
validaRut
:
function
(
rutCompleto
)
{
rutCompleto
=
rutCompleto
.
replace
(
"‐"
,
"-"
);
if
(
!/^
[
0
-
9
]
+
[
-|
‐
]{
1
}[
0
-
9
kK
]{
1
}
$
/.
test
(
rutCompleto
))
return
false
;
var
tmp
=
rutCompleto
.
split
(
'-'
);
var
digv
=
tmp
[
1
];
var
rut
=
tmp
[
0
];
if
(
digv
==
'K'
)
digv
=
'k'
;
return
(
Fn
.
dv
(
rut
)
==
digv
);
},
dv
:
function
(
T
){
var
M
=
0
,
S
=
1
;
for
(;
T
;
T
=
Math
.
floor
(
T
/
10
))
S
=
(
S
+
T
%
10
*
(
9
-
M
++%
6
))
%
11
;
return
S
?
S
-
1
:
'k'
;
}
}
function
formatearRut
(
input
){
let
value
=
input
.
value
.
replace
(
/
\
./
g
,
''
)
.
replace
(
'-'
,
''
);
if
(
value
.
match
(
/^
(
\d
{
2
})(
\d
{
3
}){
2
}(
\w
{
1
})
$
/
))
{
value
=
value
.
replace
(
/^
(
\d
{
2
})(
\d
{
3
})(
\d
{
3
})(
\w
{
1
})
$
/
,
'$1.$2.$3-$4'
);
}
else
if
(
value
.
match
(
/^
(
\d
)(
\d
{
3
}){
2
}(
\w
{
0
,
1
})
$
/
))
{
value
=
value
.
replace
(
/^
(
\d
)(
\d
{
3
})(
\d
{
3
})(
\w
{
0
,
1
})
$
/
,
'$1.$2.$3-$4'
);
}
else
if
(
value
.
match
(
/^
(
\d
)(
\d
{
3
})(
\d
{
0
,
2
})
$
/
))
{
value
=
value
.
replace
(
/^
(
\d
)(
\d
{
3
})(
\d
{
0
,
2
})
$
/
,
'$1.$2.$3'
);
}
else
if
(
value
.
match
(
/^
(
\d
)(
\d
{
0
,
2
})
$
/
))
{
value
=
value
.
replace
(
/^
(
\d
)(
\d
{
0
,
2
})
$
/
,
'$1.$2'
);
}
input
.
value
=
value
;
}
function
formatearRutPorValor
(
val
){
let
value
=
val
.
replace
(
/
\
./
g
,
''
)
.
replace
(
'-'
,
''
);
if
(
value
.
match
(
/^
(
\d
{
2
})(
\d
{
3
}){
2
}(
\w
{
1
})
$
/
))
{
value
=
value
.
replace
(
/^
(
\d
{
2
})(
\d
{
3
})(
\d
{
3
})(
\w
{
1
})
$
/
,
'$1.$2.$3-$4'
);
}
else
if
(
value
.
match
(
/^
(
\d
)(
\d
{
3
}){
2
}(
\w
{
0
,
1
})
$
/
))
{
value
=
value
.
replace
(
/^
(
\d
)(
\d
{
3
})(
\d
{
3
})(
\w
{
0
,
1
})
$
/
,
'$1.$2.$3-$4'
);
}
else
if
(
value
.
match
(
/^
(
\d
)(
\d
{
3
})(
\d
{
0
,
2
})
$
/
))
{
value
=
value
.
replace
(
/^
(
\d
)(
\d
{
3
})(
\d
{
0
,
2
})
$
/
,
'$1.$2.$3'
);
}
else
if
(
value
.
match
(
/^
(
\d
)(
\d
{
0
,
2
})
$
/
))
{
value
=
value
.
replace
(
/^
(
\d
)(
\d
{
0
,
2
})
$
/
,
'$1.$2'
);
}
$
(
"#rut"
)
.
val
(
value
);
}
function
escribirValor
(
number
,
event
){
event
.
preventDefault
();
let
inputValue
=
$
(
"#rut"
)
.
val
();
if
(
number
==
-
1
){
inputValue
=
inputValue
.
slice
(
0
,
-
1
);
}
else
if
(
number
==
-
2
){
inputValue
=
inputValue
+
""
+
"K"
;
}
else
{
inputValue
=
inputValue
+
""
+
number
}
$
(
"#rut"
)
.
focus
();
$
(
"#rut"
)
.
val
(
inputValue
);
formatearRutPorValor
(
$
(
"#rut"
)
.
val
());
}
function
queueDept
(
value
)
{
function
queueDept
(
value
)
{
if
(
value
.
ask_email
==
1
||
value
.
ask_name
==
1
||
value
.
ask_phone
==
1
||
value
.
ask_rut
==
1
)
{
if
(
value
.
ask_email
==
1
||
value
.
ask_name
==
1
||
value
.
ask_phone
==
1
||
value
.
ask_rut
==
1
)
{
if
(
value
.
ask_email
==
1
)
$
(
'#email_tab'
)
.
show
();
if
(
value
.
ask_email
==
1
)
$
(
'#email_tab'
)
.
show
();
...
@@ -95,8 +196,11 @@
...
@@ -95,8 +196,11 @@
else
$
(
'#name_tab'
)
.
hide
();
else
$
(
'#name_tab'
)
.
hide
();
if
(
value
.
ask_phone
==
1
)
$
(
'#phone_tab'
)
.
show
();
if
(
value
.
ask_phone
==
1
)
$
(
'#phone_tab'
)
.
show
();
else
$
(
'#phone_tab'
)
.
hide
()
else
$
(
'#phone_tab'
)
.
hide
()
if
(
value
.
ask_rut
==
1
)
$
(
'#rut_tab'
)
.
show
();
if
(
value
.
ask_rut
==
1
)
{
else
$
(
'#rut_tab'
)
.
hide
();
$
(
'#rut_tab'
)
.
show
();
}
else
{
$
(
'#rut_tab'
)
.
hide
();
}
service
=
value
;
service
=
value
;
$
(
'#modal_button'
)
.
removeAttr
(
'disabled'
);
$
(
'#modal_button'
)
.
removeAttr
(
'disabled'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment