1566 - Operação

This commit is contained in:
2018-08-07 14:39:48 -03:00
parent 518076f90f
commit 23f629f1de
10 changed files with 73 additions and 30 deletions
+3
View File
@@ -100,6 +100,9 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
engine.getLayout('pnlTitulo').getRootComposition().setVisible(false);
engine.getLayout('pnlInclusao').getRootComposition().setVisible(true);
engine.getWidgetController('btnVoltar').getButton().setVisible(true);
engine.getField('idPesquisaLista')['setValue(java.lang.String)'](null);
engine.getField('listaPrincipal').refresh();
engine.getField('idPesquisa')['setValue(java.lang.Object)'](null);
engine.getField('idDescricao').focus();
+3
View File
@@ -99,6 +99,9 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
engine.getLayout('pnlTitulo').getRootComposition().setVisible(false);
engine.getLayout('pnlInclusao').getRootComposition().setVisible(true);
engine.getWidgetController('btnVoltar').getButton().setVisible(true);
engine.getField('idPesquisaLista')['setValue(java.lang.String)'](null);
engine.getField('listaPrincipal').refresh();
engine.getField('idPesquisa')['setValue(java.lang.Object)'](null);
engine.getField('idChave').focus();
@@ -99,6 +99,9 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
engine.getLayout('pnlTitulo').getRootComposition().setVisible(false);
engine.getLayout('pnlInclusao').getRootComposition().setVisible(true);
engine.getWidgetController('btnVoltar').getButton().setVisible(true);
engine.getField('idPesquisaLista')['setValue(java.lang.String)'](null);
engine.getField('listaPrincipal').refresh();
engine.getField('idPesquisa')['setValue(java.lang.Object)'](null);
engine.getField('idChave').focus();
@@ -102,6 +102,9 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
engine.getLayout('pnlTitulo').getRootComposition().setVisible(false);
engine.getLayout('pnlInclusao').getRootComposition().setVisible(true);
engine.getWidgetController('btnVoltar').getButton().setVisible(true);
engine.getField('idPesquisaLista')['setValue(java.lang.String)'](null);
engine.getField('listaPrincipal').refresh();
engine.getField('idPesquisa')['setValue(java.lang.Object)'](null);
engine.getField('idRazao').focus();
+4 -1
View File
@@ -103,6 +103,9 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
engine.getLayout('pnlTitulo').getRootComposition().setVisible(false);
engine.getLayout('pnlInclusao').getRootComposition().setVisible(true);
engine.getWidgetController('btnVoltar').getButton().setVisible(true);
engine.getField('idPesquisaLista')['setValue(java.lang.String)'](null);
engine.getField('listaPrincipal').refresh();
engine.getField('idPesquisa')['setValue(java.lang.Object)'](null);
engine.getField('idChave').focus();
@@ -387,7 +390,7 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
</DBSearchField>
<HorizontalLayout width="100%" spacing="true">
<TextField id="idChave" type="number" caption="Código" width="100%" expandRatio="0.08" />
<TextField id="idDescricao" type="string" caption="Nome" required="true" width="100%" expandRatio="1" />
<TextField id="idDescricao" type="string" text-transform="uppercase" caption="Nome" required="true" width="100%" expandRatio="1" />
</HorizontalLayout>
<HorizontalLayout width="70%" spacing="true">
<DateField id="idAdmissao" type="date" caption="Admissão" resolution="DAY" width="100%" expandRatio="0.3"/>
+3
View File
@@ -100,6 +100,9 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
engine.getLayout('pnlTitulo').getRootComposition().setVisible(false);
engine.getLayout('pnlInclusao').getRootComposition().setVisible(true);
//engine.getWidgetController('btnVoltar').getButton().setVisible(true);
engine.getField('idPesquisaLista')['setValue(java.lang.String)'](null);
engine.getField('listaPrincipal').refresh();
engine.getField('idPesquisa')['setValue(java.lang.Object)'](null);
engine.getField('idChave').focus();
+10 -9
View File
@@ -12,13 +12,12 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
"nome" : "socios" ,
"sequence" : "socio_seq" ,
"idTabela" : "CODIGO",
"campos" : ["CODIGO", "NOME", "PERCENTUAL_PARTICIPACAO" ],
"camposTable" : ["CODIGO", "NOME", "PERCENTUAL_PARTICIPACAO" ]
"campos" : ["CODIGO", "NOME" ],
"camposTable" : ["CODIGO", "NOME" ]
},
"relaciona" : [ ["CODIGO","idChave","Number"] ,
["NOME","idDescricao","String"],
["PERCENTUAL_PARTICIPACAO","idPercentual","Number"]
["NOME","idDescricao","String"]
] ,
"validacaoExclusao" : [ ["SELECT 0 AS CONTAR FROM SOCIOS WHERE CODIGO = ", "Existem registros ligados a esta tabela"],
["SELECT COUNT(CHAVE_RESPONSAVEL) AS CONTAR FROM CONTROLE_DESPESAS_PESSOAIS WHERE CHAVE_RESPONSAVEL = ", "Existem registros ligados a esta tabela."]
@@ -99,6 +98,9 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
engine.getLayout('pnlTitulo').getRootComposition().setVisible(false);
engine.getLayout('pnlInclusao').getRootComposition().setVisible(true);
engine.getWidgetController('btnVoltar').getButton().setVisible(true);
engine.getField('idPesquisaLista')['setValue(java.lang.String)'](null);
engine.getField('listaPrincipal').refresh();
engine.getField('idPesquisa')['setValue(java.lang.Object)'](null);
engine.getField('idChave').focus();
@@ -210,12 +212,11 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
"nome" : "socios" ,
"sequence" : "socio_seq" ,
"idTabela" : "CODIGO",
"campos" : ["CODIGO", "NOME", "PERCENTUAL_PARTICIPACAO" ],
"camposTable" : ["CODIGO", "NOME", "PERCENTUAL_PARTICIPACAO" ]
"campos" : ["CODIGO", "NOME" ],
"camposTable" : ["CODIGO", "NOME" ]
},
"relaciona" : [ ["CODIGO","idChave","Number"] ,
["NOME","idDescricao","String"],
["PERCENTUAL_PARTICIPACAO","idPercentual","Number"],
["NOME","idDescricao","String"]
] ,
"validacaoExclusao" :
@@ -379,7 +380,6 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
<HorizontalLayout spacing="true" width="100%">
<TextField id="idChave" type="number" caption="Código" width="100%" expandRatio="0.08" />
<TextField id="idDescricao" type="string" text-transform="uppercase" caption="Nome" required="true" width="100%" expandRatio="1" />
<DecimalField type="decimal" id="idPercentual" caption="Percentual" width="100%" expandRatio="0.1" />
</HorizontalLayout>
</VerticalLayout>
</Tab>
@@ -394,6 +394,7 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
<onClickScript language="JavaScript">
<![CDATA[
importClass(Packages.br.com.davinti.base.vaadin.components.layout.MessageBox);
function run() {
if (engine.isValid()) {
if ((engine.getGlobalVariable('validarDuplicidade')(engine.getField('idDescricao').getValue())) && (!engine.getField('idChave').getValue())) {
+25 -6
View File
@@ -12,12 +12,13 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
"nome" : "subcategoria" ,
"sequence" : "subcategoria_seq" ,
"idTabela" : "CODIGO",
"campos" : ["CODIGO", "DESCRICAO" ],
"camposTable" : ["CODIGO", "DESCRICAO" ]
"campos" : ["CODIGO", "DESCRICAO", "CODIGO_CATEGORIA" ],
"camposTable" : ["CODIGO", "DESCRICAO", "CODIGO_CATEGORIA" ]
},
"relaciona" : [ ["CODIGO","idChave","Number"] ,
["DESCRICAO","idDescricao","String"]
["DESCRICAO","idDescricao","String"] ,
["CODIGO_CATEGORIA","idCategoria","Number"]
] ,
"validacaoExclusao" : [ ["SELECT 0 AS CONTAR FROM CATEGORIA WHERE CODIGO = ", "Existem registros ligados a esta tabela"],
["SELECT count(chave_subcategoria) AS CONTAR FROM CONTROLE_DESPESAS_OPERACIONAIS WHERE CHAVE_SUBCATEGORIA = ", "Existem registros ligados a esta tabela"]
@@ -60,6 +61,7 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
var config = engine.getGlobalVariable('config');
var lib = libService.loadScript('lib_cadastro_padrao');
var retorno = lib.fncLimpaCampos(config);
engine.getField('idCategoria')['setValue(java.lang.Object)'](null);
};
var habilitaCampos = function(lHabilita){
@@ -98,6 +100,10 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
engine.getLayout('pnlTitulo').getRootComposition().setVisible(false);
engine.getLayout('pnlInclusao').getRootComposition().setVisible(true);
engine.getWidgetController('btnVoltar').getButton().setVisible(true);
engine.getField('idPesquisaLista')['setValue(java.lang.String)'](null);
engine.getField('listaPrincipal').refresh();
engine.getField('idCategoria')['setValue(java.lang.Object)'](null);
engine.getField('idPesquisa')['setValue(java.lang.Object)'](null);
engine.getField('idChave').focus();
@@ -209,11 +215,12 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
"nome" : "subcategoria" ,
"sequence" : "subcategoria_seq" ,
"idTabela" : "CODIGO",
"campos" : ["CODIGO", "DESCRICAO" ],
"camposTable" : ["CODIGO", "DESCRICAO" ]
"campos" : ["CODIGO", "DESCRICAO", "CODIGO_CATEGORIA" ],
"camposTable" : ["CODIGO", "DESCRICAO", "CODIGO_CATEGORIA" ]
},
"relaciona" : [ ["CODIGO","idChave","Number"] ,
["DESCRICAO","idDescricao","String"]
["DESCRICAO","idDescricao","String"],
["CODIGO_CATEGORIA","idCategoria","Number"]
] ,
"validacaoExclusao" :
@@ -325,6 +332,7 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
<column name="CODIGO" caption="Código"/>
<column name="DESCRICAO" caption="Descrição"/>
</columns>
</DBTable>
</VerticalLayout>
@@ -377,6 +385,17 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
<HorizontalLayout width="100%" spacing="true">
<TextField id="idChave" type="string" caption="Código" width="100%" expandRatio="0.08" />
<TextField id="idDescricao" text-transform="uppercase" type="string" caption="Nome" required="true" width="100%" expandRatio="1" />
<DBComboBox type="number" required="true" id="idCategoria" allowNullSelection="true" caption="Categoria" description="Selecione a categoria que será vinculada" width="100%" expandRatio="0.4">
<datasource>
<freeQuery connection-key="vitruvio">
<![CDATA[
Select c.codigo, c.descricao from categoria c
]]>
</freeQuery>
</datasource>
<key-field>CODIGO</key-field>
<caption-field>DESCRICAO</caption-field>
</DBComboBox>
</HorizontalLayout>
</VerticalLayout>
</Tab>
+9 -7
View File
@@ -6,7 +6,6 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
<description>Cadastro de Veículos</description>
<afterFormRenderScript language="JavaScript">
<![CDATA[
/*, */
var config = { "tabela" :
{
"conexao" : "vitruvio",
@@ -103,6 +102,9 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
engine.getLayout('pnlTitulo').getRootComposition().setVisible(false);
engine.getLayout('pnlInclusao').getRootComposition().setVisible(true);
engine.getWidgetController('btnVoltar').getButton().setVisible(true);
engine.getField('idPesquisaLista')['setValue(java.lang.String)'](null);
engine.getField('listaPrincipal').refresh();
engine.getField('idPesquisa')['setValue(java.lang.Object)'](null);
engine.getField('idChave').focus();
@@ -385,12 +387,12 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
</DBSearchField>
<HorizontalLayout width="60%" spacing="true">
<TextField type="number" id="idChave" caption="Código" width="100%" expandRatio="0.08" />
<TextField type="string" id="idPlaca" text-transform="uppercase" caption="Placa" required="true" width="100%" expandRatio="1" />
<TextField type="string" id="idPlaca" text-transform="uppercase" caption="Placa" maxLength="8" required="true" width="100%" expandRatio="0.15" />
<TextField type="string" id="idModelo" text-transform="uppercase" caption="Modelo" width="100%" expandRatio="1" />
</HorizontalLayout>
<HorizontalLayout width="100%" spacing="true" >
<TextField type="string" id="idModelo" caption="Modelo" required="true" width="100%" expandRatio="0.45" />
<TextField type="string" id="idMarca" caption="Marca" required="true" width="100%" expandRatio="0.45" />
<NumericField type="number" id="idAno" caption="Ano" required="true" width="100%" expandRatio="0.1" maximumValue="2999" />
<HorizontalLayout width="60%" spacing="true" >
<TextField type="string" id="idMarca" text-transform="uppercase" caption="Marca" width="100%" expandRatio="1" />
<NumericField type="number" id="idAno" caption="Ano" width="100%" expandRatio="0.15" maximumValue="2999" maxLength="4"/>
</HorizontalLayout>
</VerticalLayout>
</Tab>
@@ -407,7 +409,7 @@ xsi:schemaLocation="http://www.davinti.com.br/vitruvio/form/panel https://bitbuc
importClass(Packages.br.com.davinti.base.vaadin.components.layout.MessageBox);
function run() {
if (engine.isValid()) {
if (engine.getGlobalVariable('validarDuplicidade')(engine.getField('idDescricao').getValue())) {
if (engine.getGlobalVariable('validarDuplicidade')(engine.getField('idPlaca').getValue())) {
MessageBox.show(MessageBox.BoxType.INFO, 'Atenção', 'Já existe uma operação cadastrada com este nome.');
} else {
var config = engine.getGlobalVariable('config');
+4 -1
View File
@@ -228,12 +228,15 @@
<datasource>
<freeQuery connection-key="vitruvio">
<![CDATA[
Select * from subcategoria
Select * from subcategoria where codigo_categoria = ${categoria}
]]>
</freeQuery>
</datasource>
<key-field>CODIGO</key-field>
<caption-field>DESCRICAO</caption-field>
<bind>
<parameter value-type="number" defaultValue="-1" parameterName="categoria" field-ref="categoria" />
</bind>
</DBComboBox>
</HorizontalLayout>
<HorizontalLayout spacing="true" width="100%" height="100%" >