Skip to content
Snippets Groups Projects
Commit 80cdc170 authored by mc16's avatar mc16
Browse files

JAR e projeto novo

parent 2b25af76
Branches
No related tags found
1 merge request!1Bruno teste
File added
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
td{outline-style:solid; outline-width : 2px;
}
.ui-dialog{
min-width:500px;
}
center{padding:2px;}
#data_nota{
width:100%;
}
</style>
<link rel="stylesheet" href="jquery-ui.css" />
<script src="jquery-1.9.1.js"></script>
<script src="jquery-ui.js"></script>
<script src="model/Empresa.js"></script>
<script src="model/Conjunto.js"></script>
<script src="model/DadosEmpresa.js"></script>
<script src="model/MediaRef.js"></script>
<script src="model/NecessidadesNutr.js"></script>
<script src="model/TipoCardapio.js"></script>
<script src="model/Mercadoria.js"></script>
<script src="model/Nota.js"></script>
</head>
</body>
<div id="cadastraNota" title="Dados da nota fiscal" style="display:none">
<table>
<input type=hidden id="dadosNota_id">
<tr><td><input type=text id="numero_nota" placeholder="Numero da nota"></td></tr>
<tr><td><center><input type=date id="data_nota" placeholder="Data"></center></td></tr>
<tr><td><input type=text id="fornecedor_nota" placeholder="Fornecedor"></td></tr>
<tr><td><input type=text id="quantidade_nota" placeholder="Quantidade"></td></tr>
<tr><td><input type=text id="precoMedio_nota" placeholder="Preço médio"></td></tr>
<tr>
<td>
<tbody id = "tmercadorias">
</tbody>
</td>
</tr>
<tr><td><button id="cadastraDadosNota">Salvar</button> <button class="cancelaEditaEmpresa">Cancelar</button></td> </tr>
</table>
</div>
<div id="cadastraMercadoria" title="Dados da mercadoria" style="display:none">
<table>
<input type=hidden id="dadosMercadoria_id">
<tr><td><input type=text id="nome_mercadoria" placeholder="Nome"></td></tr>
<tr><td><input type=text id="medida_mercadoria" placeholder="Valor de unidade"></td></tr>
<tr><td><button id="cadastraDadosMercadoria">Salvar</button> <button class="cancelaEditaEmpresa">Cancelar</button></td> </tr>
</table>
</div>
<div id="verNota" title="Nota" style="display:none">
</div>
<thead>
<table>
<tr>
<td>
<button id="adicionaMercadoria" >Adicionar Mercadoria</button>
</td>
<td>
<button id="adicionaNota" >Adicionar Nota Fiscal</button>
</td>
</tr>
<tr>
<td>
<select id="lista_removeProduto"></select>
<input id="quantidade_removeProduto"type="number" placeholder="Quantidade">
</td>
<td>
<button id="retira_produto">Retirar produto</button>
</td>
</tr>
</table>
<br>
<table>
<thead>
<tr><td>Produto</td><td>Quantidade</td><td>Notas</td></tr>
</thead>
<tbody id="estoque_list">
</tbody>
</table>
<script src="estoque.js">
</script>
</html>
ListaMercadorias = []
ListaNotas = []
function replaceAll(str, de, para){
var pos = str.indexOf(de);
while (pos > -1){
str = str.replace(de, para);
pos = str.indexOf(de);
}
return (str);
}
$("#retira_produto").click( function(){
var produto = lista_removeProduto.options[lista_removeProduto.selectedIndex].value;
var quantidade = parseFloat(quantidade_removeProduto.value);
for(var i in ListaMercadorias){
if(ListaMercadorias[i].getNome() == produto){
ListaMercadorias[i].setQuantidade(
ListaMercadorias[i].getQuantidade()-quantidade
);
}
}
reloadTableMercadoria();
});
function notas_to_options(){
var options = "";
for(var i in ListaMercadorias){
var nome = ListaMercadorias[i].getNome();
options+= "<option value="+nome+">"+nome+"</option>";
}
return options;
}
function verNotas(produto){
var notas = "";
for(var i in ListaNotas){
var nota = ListaNotas[i];
if(nota.getProduto() == produto){
notas+="Número: "+nota.getNumero()+"<br>";
notas+="Data: "+nota.getData()+"<br>";
notas+="Quantidade: "+nota.getQuantidade()+"<br>";
notas+="Fornecedor: "+nota.getFornecedor()+"<br>";
notas+="Valor unitário: "+nota.getValorUnitario()+"<br>";
notas+="<br>";
}
}
$("#verNota").html(notas);
$("#verNota").dialog();
}
function reloadTableMercadoria(){
estoque_list.innerHTML="";
for(var i in ListaMercadorias){
var line = "<tr>";
line += "<td>"+ListaMercadorias[i].getNome()+"</td>";
line += "<td>"+ListaMercadorias[i].getQuantidade()+" ";
line += ListaMercadorias[i].getMedida()+"</td>";
line += "<td><button onClick=verNotas('"+ListaMercadorias[i].getNome()+"');> Ver notas </button></td>";
line += "</tr>";
estoque_list.innerHTML+=line;
}
}
function cadastraMercadoria()
{
ListaMercadorias.push(new Mercadoria(
document.getElementById("nome_mercadoria").value,
document.getElementById("medida_mercadoria").value,
0
));
reloadTableMercadoria();
lista_removeProduto.innerHTML = notas_to_options();
}
function cadastraNota()
{
var e = document.getElementById("mercadoriaEscolhida");
var selecionado= e.options[e.selectedIndex].value;
ListaNotas.push(new NotaFiscal(
document.getElementById("numero_nota").value,
document.getElementById("data_nota").value,
document.getElementById("quantidade_nota").value,
document.getElementById("fornecedor_nota").value,
document.getElementById("precoMedio_nota").value,
selecionado
));
var value = document.getElementById("quantidade_nota").value;
value = parseFloat(value);
for(var i in ListaMercadorias){
if(ListaMercadorias[i].getNome() == selecionado){
ListaMercadorias[i].setQuantidade(
value+ListaMercadorias[i].getQuantidade()
);
}
}
reloadTableMercadoria();
console.log(ListaNotas);
}
$("#adicionaMercadoria").click(function(){
$("#cadastraMercadoria").dialog();
});
$("#adicionaNota").click(function(){
downs = "<form> <select id=mercadoriaEscolhida>";
for(var element in ListaMercadorias)
{
downs += "<option value="+replaceAll( ListaMercadorias[element].getNome(), " ","")+">"+ ListaMercadorias[element].getNome() +"</option>"
}
downs+= "</select> </form>";
document.getElementById("tmercadorias").innerHTML = downs;
$("#cadastraNota").dialog();
});
$("#cadastraDadosMercadoria").click(function(){
cadastraMercadoria();
$(".ui-button").click();
});
$("#cadastraDadosNota").click(function(){
cadastraNota();
$(".ui-button").click();
});
$(".cancelaEditaEmpresa").click( function(){
$(".ui-button").click();
});
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
tiposDePreparo = ["Salada1","Salada2","Prato Principal","Acompanhamento","Bebida","Sobremesa"];
tabelas = ["PNAE","PAT","DRIs"];
refeicoes = ["Café da manhã", "Lanche da manhã", "Almoço", "Lanche da tarde", "Jantar", "Ceia"];
ListaEmpresas = []
ListaNotas = []
ListaMercadoria = []
function replaceAll(str, de, para){
var pos = str.indexOf(de);
while (pos > -1){
str = str.replace(de, para);
pos = str.indexOf(de);
}
return (str);
}
function cadastraEmpresa(){
ListaEmpresas.push(
new Empresa(
document.getElementById("dadosEmpresa_nome").value,
document.getElementById("dadosEmpresa_cnpj").value,
document.getElementById("dadosEmpresa_telefone").value,
document.getElementById("dadosEmpresa_responsavel").value
)
);
atualizaEmpresas();
}
function cadastraNota(){
var e = document.getElementById("mercadoriaEscolhida");
var selecionado = e.options[e.selectedIndex].value;
ListaNotas.push(
new NotaFiscal(
document.getElementById("numero_nota").value,
document.getElementById("data_nota").value,
document.getElementById("quantidade_nota").value,
document.getElementById("fornecedor_nota").value,
document.getElementById("valor_unidade_nota").value,
selecionado
)
);
}
function cadastraMercadoria(){
ListaMercadoria.push(
new Mercadoria(
document.getElementById("nome_mercadoria").value,
document.getElementById("medida_mercadoria").value
)
);
}
function atualizaEmpresas(){
document.getElementById("tbody").innerHTML = "";
var str;
for(var empresa in ListaEmpresas){
str = "<tr>";
str += "<td>"+ListaEmpresas[empresa].getDados().getNome()+"</td>";
str += "<td> <button onClick=alertPublicoEmpresa("+empresa+");>Ver mais dados</button></td>";
str += "<td> <button onClick=alertCardapioEmpresa("+empresa+");>Ver mais dados</button></td>";
str += "<td><button onClick=alertDadosEmpresa("+empresa+");> Ver mais dados </button></td>";
document.getElementById("tbody").innerHTML+=str+"</tr>";
}
}
$(".cancelaEditaEmpresa").click( function(){
$(".ui-button").click();
});
function alertDadosEmpresa(e){
dados = ListaEmpresas[e].getDados();
$("#dadosEmpresa").dialog();
$("#dadosEmpresa_id").val(e);
$("#dadosEmpresa_nome").val(dados.getNome());
$("#dadosEmpresa_cnpj").val(dados.getCNPJ());
$("#dadosEmpresa_telefone").val(dados.getTelefone());
$("#dadosEmpresa_responsavel").val(dados.getResponsavel());
}
function alertPublicoEmpresa(e){
dados = ListaEmpresas[e];
$("#publicoEmpresa").dialog();
$("#publicoEmpresa_id").val(e);
htmlCheckBoxesTabelas = "<ul>";
htmlCheckBoxesRefeicoes = "<ul>";
igual = 0;
if(dados.getNecessidadesNutr())
{
tabs = dados.getNecessidadesNutr().getTabelas()
for(var element in tabelas)
{
for (var e in tabs)
{
if(tabs[e] == tabelas[element])
{
igual = 1;
}
}
if(igual)
{
htmlCheckBoxesTabelas+="<li> <input checked id = "+tabelas[element]+ " type=checkbox>"+tabelas[element]+" </li><br>"
}
else
{
htmlCheckBoxesTabelas+="<li> <input id = "+tabelas[element]+ " type=checkbox>"+tabelas[element]+" </li><br>"
}
igual = 0;
}
igual = 0;
tabs = dados.getNecessidadesNutr().getRefeicoes()
for(var element in refeicoes)
{
for (var e in tabs)
{
if(tabs[e] == refeicoes[element])
{
igual = 1;
}
}
if(igual)
{
htmlCheckBoxesRefeicoes+="<li> <input checked id = "+replaceAll(refeicoes[element], " ", "")+ " type=checkbox>"+refeicoes[element]+" </li><br>"
}
else
{
htmlCheckBoxesRefeicoes+="<li> <input id = "+replaceAll(refeicoes[element], " ","")+ " type=checkbox>"+refeicoes[element]+" </li><br>"
}
igual = 0;
}
}
else
{
for (var element in tabelas)
{
htmlCheckBoxesTabelas+="<li> <input id="+tabelas[element]+" type=checkbox>"+tabelas[element]+" </li><br>"
}
for (var element in refeicoes)
{
htmlCheckBoxesRefeicoes+="<li> <input id="+replaceAll(refeicoes[element], " ","")+" type=checkbox>"+refeicoes[element]+" </li><br>"
}
}
$("#checkBoxesTabelas").html(htmlCheckBoxesTabelas+"</ul>");
$("#checkBoxesRefeicoes").html(htmlCheckBoxesRefeicoes+"</ul>");
}
function alertCardapioEmpresa(e){
dados = ListaEmpresas[e];
$("#cardapioEmpresa").dialog();
$("#cardapioEmpresa_id").val(e);
document.getElementById("tcardapio").innerHTML = "";
colunas = "";
downs = "";
console.log("Dados " + dados)
if(dados.getTiposCardapios())
{
$("#cardapioEmpresa_precoInd").val(dados.getTiposCardapios().getPrecoRef());
$("#cardapioEmpresa_precoTotal").val(dados.getTiposCardapios().getPrecoTotal());
tabs = dados.getConjunto()
colunas="";
for(var object in tabs)
{
colunas += "<tr><td>"+tabs[object].getNome()+"</td>"
colunas += "<td>"+tabs[object].getMedia()+"</td><td>"
aux = tabs[object].getCombinacao();
for(var element in aux)
{
colunas+=aux[element] + " "
}
str = ("onClick=\"alertConjuntoEmpresa("+parseInt(e)+", "+parseInt(object)+");\"")
colunas+="</td><td><button "+str+">Editar</button></td>"
colunas+= "</td></tr>"
}
}
refeicoesEscolhidas = dados.getNecessidadesNutr().getRefeicoes()
downs += "<form> <select id=refeicoesEscolhidas>";
for(var element in refeicoesEscolhidas)
{
downs += "<option value="+replaceAll( refeicoesEscolhidas[element], " ","")+">"+ refeicoesEscolhidas[element] +"</option>"
}
downs+= "</select> </form>";
document.getElementById("tcardapio").innerHTML += colunas;
document.getElementById("tnovo").innerHTML = "";
document.getElementById("dropDown").innerHTML += downs;
}
function alertConjuntoEmpresa(empresa, cardapio){
dados = ListaEmpresas[empresa];
conjuntos = dados.getConjunto()
conjunto = conjuntos[cardapio];
$("#conjuntoEmpresa").dialog();
$("#dadosEmpresa_id").val(empresa);
$("#conjuntoEmpresa_id").val(cardapio);
$("#conjuntoEmpresa_nome").val( conjunto.getNome() );
$("#conjuntoEmpresa_media").val( conjunto.getMedia() );
htmlCheckBoxes = "<ul>";
igual =0;
tabs = conjunto.getCombinacao();
for(var element in tiposDePreparo)
{
for (var e in tabs)
{
if(tabs[e] == tiposDePreparo[element])
{
igual = 1;
}
}
if(igual)
{
htmlCheckBoxes+="<li> <input checked id = "+tiposDePreparo[element].replace(" ","")+ " type=checkbox>"+tiposDePreparo[element]+" </li><br>"
}
else
{
htmlCheckBoxes+="<li> <input id = "+tiposDePreparo[element].replace(" ","")+ " type=checkbox>"+tiposDePreparo[element]+" </li><br>"
}
igual =0;
}
$("#checkBoxesConjunto").html(htmlCheckBoxes+"</ul>");
}
$("#adicionaEmpresa").click(function(){
$("#cadastraEmpresa").dialog();
});
$("#adicionaNota").click(function(){
$("#cadastraNota").dialog();
dropDown = ""
dropDown += "<form> <select id=mercadoriaEscolhida>";
for(m in ListaMercadoria)
{
console.log( ListaMercadoria[m].getNome());
console.log(ListaMercadoria[m].getMedida())
nome = ListaMercadoria[m].getNome();
console.log(nome);
dropDown += "<option value="+replaceAll( nome, " ","")+">"+ nome +"</option>"
}
dropDown+= "</select> </form>";
document.getElementById("tmercadorias").innerHTML += dropDown;
});
$("#adicionaMercadoria").click(function(){
$("#cadastraMercadoria").dialog();
});
$("#cadastraDadosNota").click(function(){
console.log(ListaNotas);
cadastraNota();
console.log(ListaNotas);
$(".ui-button").click();
});
$("#cadastraDadosMercadoria").click(function(){
cadastraMercadoria();
console.log(ListaMercadoria);
$(".ui-button").click();
});
$("#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 = [];
valor.push(document.getElementById("refeicao"+i).value);
valor.push(document.getElementById("nomeCardapio"+i).value);
valor.push(document.getElementById("quantidadeMedia"+i).value);
for(var element in tiposDePreparo)
{
checkBox = document.getElementById( tiposDePreparo[element].replace(" ","")+ i);
if(checkBox.checked)
{
valor.push(1);
}
else {
valor.push(0);
}
}
backupValues.push(valor);
}
var colunas = "<tr><td> <input type=text id = refeicao"+numFaixas+"></td>";
colunas += "<td> <input type=text id = nomeCardapio"+numFaixas+"></td>";
colunas += "<td> <input type=text id = quantidadeMedia"+numFaixas+"></td><td style=\"width:auto;\">";
for(var element in tiposDePreparo)
{
colunas+="<input id = \""+tiposDePreparo[element].replace(" ","")+numFaixas+"\"type=checkbox>"+tiposDePreparo[element]+"</br>"
}
colunas += "</td></tr>"
document.getElementById("tnovo").innerHTML += colunas;
for (var i = 0; i < numFaixas; i++)
{
numero =0;
cardapio = backupValues[i];
document.getElementById("refeicao"+i).value = cardapio[numero];
document.getElementById("nomeCardapio"+i).value = cardapio[numero];
numero++;
document.getElementById("quantidadeMedia"+i).value = cardapio[numero];
for(var element in tiposDePreparo)
{
numero++;
if(cardapio[numero])
{
document.getElementById((tiposDePreparo[element].replace(" ",""))+i).checked = cardapio[numero];
}
}
}
document.getElementById("refeicao"+numFaixas).value = strUser;
});
$("#adicionaIdadesEmpresa").click(function(){
backupValues = [];
numFaixas = $("#tidades").children().length;
for (var i = 0; i < numFaixas; i++){
valor = [];
valor.push(document.getElementById("idadeMinima"+i).value);
valor.push(document.getElementById("idadeMaxima"+i).value);
backupValues.push(valor);
}
var colunas = "<tr><td> <input type=text id = idadeMinima"+numFaixas+"></td><td><input type= text id = idadeMaxima"+numFaixas+">";
colunas += "</td></tr>";
console.log(colunas)
document.getElementById("tidades").innerHTML += colunas;
for (var i = 0; i < numFaixas; i++){
document.getElementById("idadeMinima"+i).value = backupValues[i][0];
document.getElementById("idadeMaxima"+i).value = backupValues[i][1];
}
});
$("#editaDadosEmpresa").click( function(){
dados = ListaEmpresas[ $("#dadosEmpresa_id").val() ].getDados();
dados.setNome($("#dadosEmpresa_nome").val());
dados.setCNPJ($("#dadosEmpresa_cnpj").val());
dados.setTelefone($("#dadosEmpresa_telefone").val());
dados.setResponsavel($("#dadosEmpresa_responsavel").val());
atualizaEmpresas();
$(".ui-button").click();
});
$("#cadastraDadosEmpresa").click( function(){
cadastraEmpresa();
atualizaEmpresas();
$(".ui-button").click();
});
$("#editaConjuntoEmpresa").click( function(){
dados = ListaEmpresas[ $("#dadosEmpresa_id").val() ];
conjuntos = dados.getConjunto()
conjunto = conjuntos[$("#conjuntoEmpresa_id").val()]
conjunto.setNome($("#conjuntoEmpresa_nome").val());
conjunto.setMedia($("#conjuntoEmpresa_media").val());
tabelaPreparacao=[]
for(var element in tiposDePreparo)
{
checkBox = document.getElementById( tiposDePreparo[element].replace(" ",""));
if(checkBox.checked)
{
tabelaPreparacao.push(tiposDePreparo[element]);
}
}
conjunto.setCombinacao(tabelaPreparacao);
atualizaEmpresas();
$(".ui-button").click();
});
$("#editaPublicoEmpresa").click( function(){
dados = ListaEmpresas[ $("#publicoEmpresa_id").val() ];
tabelasDados=[]
refeicoesDados=[]
for(var element in tabelas)
{
checkBoxTabelas = document.getElementById( tabelas[element] );
if(checkBoxTabelas.checked)
{
tabelasDados.push(tabelas[element]);
console.log(tabelas[element]);
}
}
for(var element in refeicoes)
{
checkBoxRefeicoes = document.getElementById( replaceAll( refeicoes[element], " ","") );
if(checkBoxRefeicoes.checked)
{
refeicoesDados.push(refeicoes[element]);
}
}
necessidadesNutr = new NecessidadesNutr(tabelasDados, refeicoesDados)
dados.setNecessidadesNutr(necessidadesNutr);
atualizaEmpresas();
$(".ui-button").click();
});
$("#editaCardapioEmpresa").click( function(){
dados = ListaEmpresas[ $("#cardapioEmpresa_id").val() ];
tabelaPreparacao=[]
tabelasConjunto =[]
if(dados.getConjunto())
{
tabelasConjunto = dados.getConjunto();
}
numFaixas = $("#tnovo").children().length;
for(var i=0; i< numFaixas; i++)
{
tabelaPreparacao=[]
for(var element in tiposDePreparo)
{
checkBox = document.getElementById( tiposDePreparo[element].replace(" ","")+ i);
if(checkBox.checked)
{
tabelaPreparacao.push(tiposDePreparo[element]);
}
}
conjunto = new Conjunto($("#nomeCardapio"+i).val(), $("#quantidadeMedia"+i).val(), tabelaPreparacao);
tabelasConjunto.push(conjunto);
}
if(dados.getTiposCardapios())
{
dados.setConjunto(tabelasConjunto);
dados.setTiposCardapios(new TipoCardapio($("#cardapioEmpresa_precoInd").val(), $("#cardapioEmpresa_precoTotal").val()) );
}
else {
dados.setConjunto(tabelasConjunto);
console.log(dados.getConjunto());
dados.setTiposCardapios(new TipoCardapio($("#cardapioEmpresa_precoInd").val(), $("#cardapioEmpresa_precoTotal").val()) );
}
atualizaEmpresas();
$(".ui-button").click();
});
//Cardápio
class Conjunto{
//Nome do cardapio
getNome(){return this._nome;}
setNome(_nome){this._nome=_nome;}
//Média de clientes por dia do cardápio
getMedia(){return this._media;}
setMedia(_media){this._media=_media;}
//Componentes do cardápio
getCombinacao(){return this._combinacao}
setCombinacao(_combinacao){this._combinacao = _combinacao;}
constructor(nome, media, combinacao)
{
this.setNome(nome);
this.setMedia(media);
this.setCombinacao(combinacao);
}
}
class DadosEmpresa
{
getCNPJ(){ return this._cnpj}
setCNPJ(_cnpj) {this._cnpj = _cnpj;}
getNome(){ return this._nome}
setNome(_nome) {this._nome = _nome;}
getTelefone(){ return this._telefone}
setTelefone(_telefone) {this._telefone = _telefone;}
getResponsavel(){ return this._responsavel}
setResponsavel(_responsavel) {this._responsavel = _responsavel;}
constructor(nome,cnpj,telefone,responsavel){
this.setCNPJ(cnpj);
this.setNome(nome);
this.setTelefone(telefone);
this.setResponsavel(responsavel);
}
}
class Empresa{
getDados(){ return this._dados}
setDados(_cnpj) {this._dados = _cnpj;}
getMediaRef(){ return this._mediaRef}
setMediaRef(_mediaRef) {this._mediaRef = _mediaRef;}
getNecessidadesNutr(){ return this._necessidadesNutr}
setNecessidadesNutr(_necessidadesNutr) {this._necessidadesNutr = _necessidadesNutr;}
getTiposCardapios(){return this._tiposCardapios;}
setTiposCardapios(_tiposCardapios){this._tiposCardapios = _tiposCardapios;}
getConjunto(){return this._conjunto;}
setConjunto(_conjunto){this._conjunto = _conjunto;}
constructor(nome,cnpj,telefone,responsavel){
this.setDados(new DadosEmpresa(nome,cnpj,telefone,responsavel))
}
}
class Mercadoria{
getNome(){return this._nome}
setNome(_nome){this._nome = _nome;}
getMedida(){return this._medida}
setMedida(_medida){this._medida = _medida;}
getQuantidade(){return this._quantidade}
setQuantidade(_quantidade){this._quantidade = _quantidade;}
constructor(nome, medida,quantidade){
this.setNome(nome);
this.setMedida(medida);
this.setQuantidade(quantidade);
}
}
class NecessidadesNutr{
getTabelas(){ return this._tabelas}
setTabelas(_tabelas) {this._tabelas = _tabelas;}
getRefeicoes(){ return this._refeicoes}
setRefeicoes(_refeicoes){this._refeicoes = _refeicoes;}
constructor(tabelas, refeicoes){
this.setTabelas(tabelas);
this.setRefeicoes(refeicoes);
}
}
class NotaFiscal{
getNumero(){return this._numero}
setNumero(_numero){this._numero = _numero;}
getData(){return this._data}
setData(_data){this._data = _data;}
getQuantidade(){return this._quantidade}
setQuantidade(_quantidade){this._quantidade = _quantidade;}
getFornecedor(){return this._fornecedor}
setFornecedor(_fornecedor){this._fornecedor = _fornecedor;}
getValorUnitario(){return this._valor}
setValorUnitario(_valor){this._valor = _valor;}
getProduto(){return this._produto}
setProduto(_produto){this._produto = _produto;}
constructor(numero,data,quantidade,fornecedor, valorUnitario, produto){
this.setNumero(numero);
this.setData(data);
this.setQuantidade(quantidade);
this.setFornecedor(fornecedor);
this.setValorUnitario(valorUnitario);
this.setProduto(produto);
}
}
class TipoCardapio{
getPrecoRef(){return this._precoRef}
setPrecoRef(_precoRef){this._precoRef = _precoRef;}
getPrecoTotal(){return this._precoTotal}
setPrecoTotal(_precoTotal){this._precoTotal = _precoTotal;}
constructor(precoRef, precoTotal)
{
this.setPrecoRef(precoRef);
this.setPrecoTotal(precoTotal);
}
}
File added
<html>
<head>
<meta charset="UTF-8">
<style>
td{outline-style:solid; outline-width : 2px;
}
.ui-dialog{
min-width:500px;
}
center{padding:2px;}
</style>
<link rel="stylesheet" href="jquery-ui.css" />
<script src="jquery-1.9.1.js"></script>
<script src="jquery-ui.js"></script>
<script src="model/Empresa.js"></script>
<script src="model/Conjunto.js"></script>
<script src="model/DadosEmpresa.js"></script>
<script src="model/MediaRef.js"></script>
<script src="model/NecessidadesNutr.js"></script>
<script src="model/TipoCardapio.js"></script>
</head>
</body>
<div id="dadosEmpresa" title="Dados da empresa" style="display:none">
<table>
<input type=hidden id="dadosEmpresa_id">
<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="editaDadosEmpresa">Salvar</button> <button class="cancelaEditaEmpresa">Cancelar</button></td> </tr>
</table>
</div>
<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>
<tr><td id="checkBoxesRefeicoes"></td></tr>
<tr><td colspan=2><center><button id="editaPublicoEmpresa">Salvar</button> <button class="cancelaEditaEmpresa">Cancelar</button></center></td> </tr>
</table>
</div>
<div id="conjuntoEmpresa" title="Cardapio empresa" style="display:none">
<table>
<input type=hidden id="dadosEmpresa_id">
<input type=hidden id="conjuntoEmpresa_id">
<tr><td>Nome: </td> <td><input type=text id="conjuntoEmpresa_nome"></td></tr>
<tr><td>Média: </td> <td><input type=text id="conjuntoEmpresa_media"></td></tr>
<tr><td id="checkBoxesConjunto"></td></tr>
<tr><td colspan=2><center><button id="editaConjuntoEmpresa">Salvar</button> <button class="cancelaEditaEmpresa">Cancelar</button></center></td> </tr>
</table>
</div>
<div id="cardapioEmpresa" title="Cardapio da empresa" style="display:none">
<table>
<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>
<tr>
<td>
<tbody id ="dropDown">
</tbody>
</td>
</tr>
<tr><td colspan=2><center><button id="adicionaCardapioEmpresa">Adicionar Cardápio</button> </center></td> </tr>
<tr>
<td> Refeição </td>
<td> Nome </td>
<td> Media </td>
<td> Ingredientes</td>
<td> Acoes </td>
</tr>
<tbody id ="tcardapio">
</tbody>
<tbody id ="tnovo">
</tbody>
</table>
<tr><td colspan=2><center><button id="editaCardapioEmpresa">Salvar</button> <button class="cancelaEditaEmpresa">Cancelar</button></center></td> </tr>
</table>
</div>
<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> Caracteristicas do cardápio</td>
<td>Ações</td>
</tr>
</thead>
<tbody id ="tbody">
</tbody>
</table>
</body>
<script src="main.js">
</script>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment