Novo git da alteração
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
application.type=widget
|
||||
application.code=widget_solicitacoes
|
||||
application.title=widget-solicitacoes
|
||||
application.description=widget-solicitacoes
|
||||
application.fluig.version=null
|
||||
application.category=Suprimentos
|
||||
application.renderer=freemarker
|
||||
developer.code=G-ALES1NT-TEC06
|
||||
developer.name=andrey.cunha
|
||||
developer.url=http://www.fluig.com
|
||||
application.uiwidget=true
|
||||
application.mobileapp=false
|
||||
application.version=${build.version}-${build.revision}
|
||||
view.file=view.ftl
|
||||
edit.file=edit.ftl
|
||||
locale.file.base.name=widget_solicitacoes
|
||||
application.resource.js.1=/resources/js/widget_solicitacoes.js
|
||||
application.resource.css.2=/resources/css/widget_solicitacoes.css
|
||||
hash=4a16315e9e66fa7d797b3f6b1fb365b69f9a4ce2
|
||||
@@ -0,0 +1,4 @@
|
||||
<div id="MyWidget_${instanceId}" class="super-widget wcm-widget-class fluig-style-guide" data-params="MyWidget.instance()">
|
||||
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<div id="MyWidget_${instanceId}"
|
||||
class="super-widget wcm-widget-class fluig-style-guide"
|
||||
data-params="MyWidget.instance()">
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><strong>Consultar Solicitações</strong></div>
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<label>Número SC</label>
|
||||
<input type="text" id="filtroNumero_${instanceId}" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Solicitante</label>
|
||||
<input type="text" id="filtroSolicitante_${instanceId}" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Status</label>
|
||||
<select id="filtroStatus_${instanceId}" class="form-control">
|
||||
<option value="">Todos</option>
|
||||
<option value="Aguardando Aprovação">Aguardando Aprovação</option>
|
||||
<option value="Em Cotação">Em Cotação</option>
|
||||
<option value="Convertida em Pedido">Convertida em Pedido</option>
|
||||
<option value="Encerrada">Encerrada</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label> </label><br>
|
||||
<button class="btn btn-primary" data-pesquisar>Pesquisar</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div id="listaSolicitacoes_${instanceId}"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<jboss-web>
|
||||
<context-root>/widget_solicitacoes</context-root>
|
||||
<disable-cross-context>false</disable-cross-context>
|
||||
</jboss-web>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
|
||||
version="3.0">
|
||||
<session-config>
|
||||
<session-timeout>
|
||||
30
|
||||
</session-timeout>
|
||||
</session-config>
|
||||
</web-app>
|
||||
+1
@@ -0,0 +1 @@
|
||||
/* Coloque aqui seu codigo CSS */
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 7.7 KiB |
+55
@@ -0,0 +1,55 @@
|
||||
var MyWidget = SuperWidget.extend({
|
||||
|
||||
// Variáveis do widget (se precisar salvar estado entre chamadas)
|
||||
instanceId: null,
|
||||
|
||||
// Método iniciado quando o widget é carregado
|
||||
init: function() {
|
||||
this.instanceId = this.instanceId || new Date().getTime();
|
||||
console.log("Widget Solicitações carregado, instância:", this.instanceId);
|
||||
},
|
||||
|
||||
// BIND de eventos
|
||||
bindings: {
|
||||
local: {
|
||||
'pesquisar': ['click_consultarSolicitacoes']
|
||||
},
|
||||
global: {}
|
||||
},
|
||||
|
||||
// Função chamada ao clicar em "Pesquisar"
|
||||
consultarSolicitacoes: function(htmlElement, event) {
|
||||
var numero = $("#filtroNumero_" + this.instanceId).val();
|
||||
var solicitante = $("#filtroSolicitante_" + this.instanceId).val();
|
||||
var status = $("#filtroStatus_" + this.instanceId).val();
|
||||
|
||||
var constraints = [];
|
||||
if (numero) constraints.push(DatasetFactory.createConstraint("C1_NUM", numero, numero, ConstraintType.MUST));
|
||||
if (solicitante) constraints.push(DatasetFactory.createConstraint("C1_SOLICIT", solicitante, solicitante, ConstraintType.MUST));
|
||||
if (status) constraints.push(DatasetFactory.createConstraint("STATUS", status, status, ConstraintType.MUST));
|
||||
|
||||
var ds = DatasetFactory.getDataset("dsSolicitacoesCompra", null, constraints, null);
|
||||
|
||||
let html = `<table class="table table-striped">
|
||||
<thead><tr>
|
||||
<th>Número</th><th>Solicitante</th><th>Data</th><th>Status</th><th>Pedido</th>
|
||||
</tr></thead><tbody>`;
|
||||
|
||||
if (ds && ds.values.length) {
|
||||
ds.values.forEach(sc => {
|
||||
html += `<tr>
|
||||
<td>${sc.C1_NUM}</td>
|
||||
<td>${sc.C1_SOLICIT}</td>
|
||||
<td>${sc.C1_EMISSAO}</td>
|
||||
<td>${sc.STATUS}</td>
|
||||
<td>${sc.C1_PEDIDO || '-'}</td>
|
||||
</tr>`;
|
||||
});
|
||||
} else {
|
||||
html += `<tr><td colspan="5" class="text-center">Nenhuma solicitação encontrada</td></tr>`;
|
||||
}
|
||||
|
||||
html += `</tbody></table>`;
|
||||
$("#listaSolicitacoes_" + this.instanceId).html(html);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user