Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
nutricao
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
31
Issues
31
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PET Computação
nutricao
Commits
208950aa
Commit
208950aa
authored
Apr 19, 2017
by
mc16
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tentativa de melhorar interface
parent
e2c3e153
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
28 deletions
+61
-28
main.js
main.js
+30
-7
prototipo.html
prototipo.html
+31
-21
No files found.
main.js
View file @
208950aa
...
...
@@ -18,10 +18,10 @@ function replaceAll(str, de, para){
function
cadastraEmpresa
(){
ListaEmpresas
.
push
(
new
Empresa
(
document
.
getElementById
(
"
nomeEmpresa
"
).
value
,
document
.
getElementById
(
"
cnpj
"
).
value
,
document
.
getElementById
(
"
telefone
"
).
value
,
document
.
getElementById
(
"
responsavel
"
).
value
document
.
getElementById
(
"
dadosEmpresa_nome
"
).
value
,
document
.
getElementById
(
"
dadosEmpresa_
cnpj
"
).
value
,
document
.
getElementById
(
"
dadosEmpresa_
telefone
"
).
value
,
document
.
getElementById
(
"
dadosEmpresa_
responsavel
"
).
value
)
);
atualizaEmpresas
();
...
...
@@ -144,6 +144,8 @@ function alertCardapioEmpresa(e){
$
(
"
#cardapioEmpresa_id
"
).
val
(
e
);
document
.
getElementById
(
"
tcardapio
"
).
innerHTML
=
""
;
colunas
=
""
;
downs
=
""
;
console
.
log
(
"
Dados
"
+
dados
)
if
(
dados
.
getTiposCardapios
())
{
$
(
"
#cardapioEmpresa_precoInd
"
).
val
(
dados
.
getTiposCardapios
().
getPrecoRef
());
...
...
@@ -166,9 +168,20 @@ function alertCardapioEmpresa(e){
}
}
refeicoesEscolhidas
=
dados
.
getNecessidadesNutr
().
getRefeicoes
()
console
.
log
(
"
Dados
"
+
dados
)
console
.
log
(
"
Refeicoes
"
+
refeicoesEscolhidas
);
downs
+=
"
<form> <select id=
"
+
refeicoesEscolhidas
+
"
>
"
;
for
(
var
element
in
refeicoesEscolhidas
)
{
downs
+=
"
<option value=
"
+
replaceAll
(
refeicoesEscolhidas
[
element
],
"
"
,
""
)
+
"
>
"
+
refeicoesEscolhidas
[
element
]
+
"
</option>
"
console
.
log
(
refeicoesEscolhidas
[
element
]);
}
downs
+=
"
</select> </form>
"
;
document
.
getElementById
(
"
tcardapio
"
).
innerHTML
+=
colunas
;
document
.
getElementById
(
"
tnovo
"
).
innerHTML
=
""
;
document
.
getElementById
(
"
dropDown
"
).
innerHTML
+=
downs
;
}
function
alertConjuntoEmpresa
(
empresa
,
cardapio
){
...
...
@@ -209,14 +222,18 @@ function alertConjuntoEmpresa(empresa, cardapio){
}
$
(
"
#adicionaEmpresa
"
).
click
(
function
(){
$
(
"
#cadastraEmpresa
"
).
dialog
();
}
});
$
(
"
#adicionaCardapioEmpresa
"
).
click
(
function
(){
backupValues
=
[];
numFaixas
=
$
(
"
#tnovo
"
).
children
().
length
;
var
e
=
document
.
getElementById
(
"
refeicoesEscolhidas
"
);
var
strUser
=
e
.
options
[
e
.
selectedIndex
].
value
;
console
.
log
(
strUser
)
for
(
var
i
=
0
;
i
<
numFaixas
;
i
++
)
{
valor
=
[];
...
...
@@ -304,6 +321,12 @@ $("#editaDadosEmpresa").click( function(){
$
(
"
.ui-button
"
).
click
();
});
$
(
"
#cadastraDadosEmpresa
"
).
click
(
function
(){
cadastraEmpresa
();
atualizaEmpresas
();
$
(
"
.ui-button
"
).
click
();
});
$
(
"
#editaConjuntoEmpresa
"
).
click
(
function
(){
dados
=
ListaEmpresas
[
$
(
"
#dadosEmpresa_id
"
).
val
()
];
...
...
@@ -349,7 +372,7 @@ $("#editaPublicoEmpresa").click( function(){
}
necessidadesNutr
=
new
NecessidadesNutr
(
tabelasDados
,
refeicoesDados
)
dados
.
setNecessidadesNutr
(
necessidadesNutr
);
...
...
prototipo.html
View file @
208950aa
...
...
@@ -48,7 +48,17 @@
</table>
</div>
<div
id=
"publicoEmpresa"
title=
"Público Alvo"
style=
"display:none"
>
<div
id=
"cadastraEmpresa"
title=
"Dados da empresa"
style=
"display:none"
>
<table>
<tr><td><input
type=
text
id=
"dadosEmpresa_nome"
></td></tr>
<tr><td><input
type=
text
id=
"dadosEmpresa_cnpj"
></td></tr>
<tr><td><input
type=
text
id=
"dadosEmpresa_telefone"
></td></tr>
<tr><td><input
type=
text
id=
"dadosEmpresa_responsavel"
></td></tr>
<tr><td><button
id=
"cadastraDadosEmpresa"
>
Salvar
</button>
<button
class=
"cancelaEditaEmpresa"
>
Cancelar
</button></td>
</tr>
</table>
</div>
<div
id=
"publicoEmpresa"
title=
"Publico Alvo"
style=
"display:none"
>
<table>
<input
type=
hidden
id=
"publicoEmpresa_id"
>
<tr><td
id=
"checkBoxesTabelas"
></td></tr>
...
...
@@ -57,7 +67,7 @@
</table>
</div>
<div
id=
"conjuntoEmpresa"
title=
"Card
á
pio empresa"
style=
"display:none"
>
<div
id=
"conjuntoEmpresa"
title=
"Card
a
pio empresa"
style=
"display:none"
>
<table>
<input
type=
hidden
id=
"dadosEmpresa_id"
>
<input
type=
hidden
id=
"conjuntoEmpresa_id"
>
...
...
@@ -73,25 +83,19 @@
<input
type=
hidden
id=
"cardapioEmpresa_id"
>
<tr><td>
Preço refeição:
</td><td><input
type=
text
id=
"cardapioEmpresa_precoInd"
></td></tr>
<tr><td>
Preço total:
</td><td><input
type=
text
id=
"cardapioEmpresa_precoTotal"
></td></tr>
<div
class=
"dropdown"
>
<button
onclick=
"myFunction()"
class=
"dropbtn"
>
Dropdown
</button>
<div
id=
"myDropdown"
class=
"dropdown-content"
>
<a
href=
"#home"
>
Home
</a>
<a
href=
"#about"
>
About
</a>
<a
href=
"#contact"
>
Contact
</a>
</div>
</div>
<tr>
<td>
<tbody
id =
"dropDown"
>
</tbody>
</td>
</tr>
<tr><td
colspan=
2
><center><button
id=
"adicionaCardapioEmpresa"
>
Adicionar Cardápio
</button>
</center></td>
</tr>
<table>
<thead>
<tr>
<td>
Nome
</td>
<td>
M
é
dia
</td>
<td>
M
e
dia
</td>
<td>
Ingredientes
</td>
<td>
A
çõ
es
</td>
<td>
A
co
es
</td>
</tr>
</thead>
<tbody
id =
"tcardapio"
>
</tbody>
...
...
@@ -103,14 +107,20 @@
</table>
</div>
<tr><td><button
id=
"adicionaEmpresa"
>
Adicionar Empresa
</button></td></tr>
<thead>
<thead>
<table>
<tr>
<td>
<button
id=
"adicionaEmpresa"
>
Adicionar Empresa
</button>
</td>
</tr>
</table>
<table>
<tr>
<td>
Dados da empresa
</td>
<td>
Publico alvo/clientes
</td>
<td>
Características do card
á
pio
</td>
<td>
A
çõ
es
</td>
<td>
Características do cardpio
</td>
<td>
A
co
es
</td>
</tr>
</thead>
<tbody
id =
"tbody"
>
...
...
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