att
This commit is contained in:
@@ -157,23 +157,20 @@
|
||||
<span class="required text-danger"><strong> * </strong></span>
|
||||
<input type="zoom" class="form-control requiredInput" name="estabelecimento" id="estabelecimento"
|
||||
data-zoom="{
|
||||
'displayKey':'estabelecimento',
|
||||
'displayKey':'LOJA',
|
||||
'datasetId':'dsFiliais',
|
||||
'placeholder': 'Pesquisar nome do estabelecimento ou filial.',
|
||||
'fields':[
|
||||
{
|
||||
'field':'estabelecimento',
|
||||
'label':'Filial',
|
||||
'standard':'true',
|
||||
'search':'true'
|
||||
},
|
||||
{
|
||||
'field':'codigo',
|
||||
'label':'Protheus',
|
||||
'search':'true'
|
||||
}
|
||||
]
|
||||
}" />
|
||||
{'field':'LOJA','label':'Filial','standard':'true','search':'true'},
|
||||
{'field':'REGIONAL','label':'REGIONAL','standard':'true'},
|
||||
{'field':'UF','label':'UF','standard':'true'},
|
||||
{'field':'RESPONSAVEL_LOJA','label':'RESPONSAVEL_LOJA','visible':'false'},
|
||||
{'field':'PDV','label':'PDV','visible':'false'},
|
||||
{'field':'PROTHEUS','label':'PROTHEUS','visible':'false'},
|
||||
{'field':'COLLEAGUE_ID','label':'COLLEAGUE_ID','visible':'false'},
|
||||
{'field':'LOGIN_LOJA','label':'LOGIN_LOJA','visible':'false'}
|
||||
]
|
||||
}">
|
||||
<p class="text-danger text-error">
|
||||
Preenchimento obrigatório.
|
||||
</p>
|
||||
@@ -327,6 +324,45 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-8 col-xs-12">
|
||||
<label>Qual equipamento vai ser utilizado?</label>
|
||||
<span class="text-danger"><strong>*</strong></span><br>
|
||||
<div>
|
||||
<label>
|
||||
<input name="itensinicio" id="itensback" value="backoffice" type="radio">
|
||||
<span class="change-weight">Kit Backoffice (Notebook, mouse, teclado e headset).</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input name="itensinicio" id="itensamg" value="amg" type="radio">
|
||||
<span class="change-weight">Kit AMG (Notebook, Kit mouse e teclado, headset e telefone
|
||||
coporativo).</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input name="itensinicio" id="itenscomercial" value="comercial" type="radio">
|
||||
<span class="change-weight">Kit Comercial (Mobshop e Mobpin).</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4 col-xs-12">
|
||||
<label>Vai precisar de fardamento?</label>
|
||||
<span class="text-danger"><strong>*</strong></span><br>
|
||||
<div>
|
||||
<label>
|
||||
<input name="fardamentoPronto" id="fardamentoprontosim" value="pronto" type="radio">
|
||||
<span class="change-weight">Sim</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input name="fardamentoPronto" id="fardamentoprontonao" value="faltando" type="radio">
|
||||
<span class="change-weight">Não</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -465,103 +501,22 @@
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-12 col-xs-12">
|
||||
<label for="numCotacoes">Clique no botão para adicionar participantes</label>
|
||||
<button id="gerarTabela" class="btn btn-primary btn-sm"
|
||||
onclick="gerarTabelaCotacaoComNumeracao('tabelarecrutamento')">Adicionar</button>
|
||||
<div class="form-group col-md-4 col-xs-12">
|
||||
<label for="nomedocandidato">Nome do candidato selecionado</label>
|
||||
<input type="text" class="form-control" id="nomedocandidato" name="nomedocandidato">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="col-md-12">
|
||||
<table class="table" tablename="tabelarecrutamento" id="tabelarecrutamento" noaddbutton="true"
|
||||
nodeletebutton="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 20%;">Nome do candidato</th>
|
||||
<th style="width: 20%;">Telefone</th>
|
||||
<th style="width: 25%;">Email</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="fs-v-align-top fs-text-center">
|
||||
<input type="text" class="form-control" name="nomedocandidato">
|
||||
</td>
|
||||
<td class="fs-v-align-top fs-text-center">
|
||||
<input type="text" class="form-control" name="telefone" style="width: 150px;">
|
||||
</td>
|
||||
<td class="fs-v-align-top fs-text-center">
|
||||
<input type="email" class="form-control" name="email" style="width: 150px;">
|
||||
</td>
|
||||
<td class="fs-v-align-top fs-text-center">
|
||||
<button type="button" class="btn btn-danger btn-sm remover-linha"
|
||||
onclick="removeLinhaComAnexo(this)">Remover</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="form-group col-md-4 col-xs-12">
|
||||
<label for="telefone">Telefone</label>
|
||||
<input type="text" class="form-control" id="telefone" name="telefone">
|
||||
</div>
|
||||
<div class="row">
|
||||
<br />
|
||||
<h6>
|
||||
Checklist de Início.
|
||||
</h6>
|
||||
<br />
|
||||
<div class="form-group col-md-4 col-xs-12">
|
||||
<label for="email">Email</label>
|
||||
<input type="email" class="form-control" id="email" name="email">
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-2 col-xs-6">
|
||||
<div class="form-group col-md-2 col-xs-6">
|
||||
<label for="datainiciotrabalho"> Data de início</label>
|
||||
<input type="date" name="datainiciotrabalho" id="datainiciotrabalho" class="form-control">
|
||||
</div>
|
||||
<div class="form-group col-md-10 col-xs-6">
|
||||
<label>Qual o Kit vai ser utilizado?</label>
|
||||
<span class="text-danger"><strong>*</strong></span><br>
|
||||
<div>
|
||||
<label>
|
||||
<input name="itensinicio" id="itensback" value="backoffice" type="radio">
|
||||
<span class="change-weight">Kit Backoffice (Notebook, mouse, teclado e headset).</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input name="itensinicio" id="itensamg" value="amg" type="radio">
|
||||
<span class="change-weight">Kit AMG (Notebook, Kit mouse e teclado, headset e telefone
|
||||
coporativo).</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input name="itensinicio" id="itenscomercial" value="comercial" type="radio">
|
||||
<span class="change-weight">Kit Comercial (Mobshop e Mobpin).</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-10 col-xs-6">
|
||||
<label>Fardamento pronto para ser entregue?</label>
|
||||
<span class="text-danger"><strong>*</strong></span><br>
|
||||
<div>
|
||||
<label>
|
||||
<input name="fardamentoPronto" id="fardamentoprontosim" value="pronto" type="radio">
|
||||
<span class="change-weight">Sim</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input name="fardamentoPronto" id="fardamentoprontonao" value="faltando" type="radio">
|
||||
<span class="change-weight">Não</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row justificativa-activity-6">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
@@ -876,4 +831,4 @@
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -331,8 +331,8 @@ var beforeSendValidate = function (numState, nextState) {
|
||||
};
|
||||
|
||||
function setSelectedZoomItem(selectedItem) {
|
||||
console.log("Campo selecionado:", name_item);
|
||||
var name_item = selectedItem.inputId;
|
||||
console.log("Campo selecionado:", name_item);
|
||||
var ehItem = name_item.indexOf("___") >= 0;
|
||||
var indice = "";
|
||||
if (ehItem){
|
||||
@@ -341,51 +341,60 @@ function setSelectedZoomItem(selectedItem) {
|
||||
indice = valores[1];
|
||||
}
|
||||
|
||||
var dtsCentroCusto = DatasetFactory.getDataset(
|
||||
"ds_Liderdireto",
|
||||
null,
|
||||
null,
|
||||
null
|
||||
).values;
|
||||
|
||||
var nomeGestorComercialBA = dtsCentroCusto[0].gestorCentroCusto;
|
||||
var emailGestorComercialBA = dtsCentroCusto[0].emailGestor;
|
||||
var idGestorComercialBA = dtsCentroCusto[0].idGestor;
|
||||
|
||||
var nomeGestorComercialSE = dtsCentroCusto[1].gestorCentroCusto;
|
||||
var emailGestorComercialSE = dtsCentroCusto[1].emailGestor;
|
||||
var idGestorComercialSE = dtsCentroCusto[1].idGestor;
|
||||
|
||||
var nomeGestorComercialAL = dtsCentroCusto[2].gestorCentroCusto;
|
||||
var emailGestorComercialAL = dtsCentroCusto[2].emailGestor;
|
||||
var idGestorComercialAL = dtsCentroCusto[2].idGestor;
|
||||
var dtsCentroCusto = [];
|
||||
try {
|
||||
var dsCentroCusto = DatasetFactory.getDataset("ds_Liderdireto", null, null, null);
|
||||
dtsCentroCusto = dsCentroCusto && dsCentroCusto.values ? dsCentroCusto.values : [];
|
||||
} catch (e) {
|
||||
console.error("Falha ao carregar ds_Liderdireto:", e);
|
||||
}
|
||||
|
||||
function getGestorByCentroCusto(nomeCentroCusto) {
|
||||
for (var i = 0; i < dtsCentroCusto.length; i++) {
|
||||
if (dtsCentroCusto[i].centroCusto === nomeCentroCusto) {
|
||||
return dtsCentroCusto[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
if (name_item == "estabelecimento") {
|
||||
let estabelecimento = selectedItem["estabelecimento"];
|
||||
let estado = selectedItem["estado"];
|
||||
var estabelecimento =
|
||||
selectedItem["estabelecimento"] ||
|
||||
selectedItem["LOJA"] ||
|
||||
selectedItem["filial"] ||
|
||||
"";
|
||||
|
||||
var estado = selectedItem["estado"] || selectedItem["UF"] || "";
|
||||
var estadoNormalizado = (estado + "").toUpperCase();
|
||||
$("#estado").val(estado);
|
||||
|
||||
if (estabelecimento && window["estabelecimento"] && typeof window["estabelecimento"].setValue === "function") {
|
||||
window["estabelecimento"].setValue(estabelecimento);
|
||||
}
|
||||
|
||||
// Só executa a lógica do centro de custo se não for "Escritório"
|
||||
if (estabelecimento !== "ESCRITÓRIO MATRIZ") {
|
||||
// Executa manualmente a lógica do estado aqui
|
||||
if (estado.includes("AL")) {
|
||||
window["centroCusto"].setValue("Comercial AL");
|
||||
$("#gestorNome").val(nomeGestorComercialAL);
|
||||
$("#gestorEmail").val(emailGestorComercialAL);
|
||||
$("#gestor_cc").val(idGestorComercialAL);
|
||||
} else if (estado.includes("SE")) {
|
||||
window["centroCusto"].setValue("Comercial SE");
|
||||
$("#gestorNome").val(nomeGestorComercialSE);
|
||||
$("#gestorEmail").val(emailGestorComercialSE);
|
||||
$("#gestor_cc").val(idGestorComercialSE);
|
||||
} else if (estado.includes("BA")) {
|
||||
window["centroCusto"].setValue("Comercial BA");
|
||||
$("#gestorNome").val(nomeGestorComercialBA);
|
||||
$("#gestorEmail").val(emailGestorComercialBA);
|
||||
$("#gestor_cc").val(idGestorComercialBA);
|
||||
if (estabelecimento !== "ESCRITÓRIO MATRIZ" && estadoNormalizado) {
|
||||
var centroAlvo = "";
|
||||
if (estadoNormalizado.indexOf("AL") >= 0) {
|
||||
centroAlvo = "Comercial AL";
|
||||
} else if (estadoNormalizado.indexOf("SE") >= 0) {
|
||||
centroAlvo = "Comercial SE";
|
||||
} else if (estadoNormalizado.indexOf("BA") >= 0) {
|
||||
centroAlvo = "Comercial BA";
|
||||
}
|
||||
}
|
||||
|
||||
if (centroAlvo) {
|
||||
var dadosGestor = getGestorByCentroCusto(centroAlvo);
|
||||
window["centroCusto"].setValue(centroAlvo);
|
||||
|
||||
if (dadosGestor) {
|
||||
$("#gestorNome").val(dadosGestor.gestorCentroCusto || "");
|
||||
$("#gestorEmail").val(dadosGestor.emailGestor || "");
|
||||
$("#gestor_cc").val(dadosGestor.idGestor || "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (name_item == "centroCusto") {
|
||||
$("#gestorNome").val(selectedItem["gestorCentroCusto"]);
|
||||
@@ -442,13 +451,3 @@ function remove_row(element) {
|
||||
}
|
||||
|
||||
|
||||
function gerarTabelaCotacaoComNumeracao(tabelarecrutamento) {
|
||||
wdkAddChild(tabelarecrutamento);
|
||||
}
|
||||
|
||||
|
||||
function removeLinhaComAnexo(event) {
|
||||
fnWdkRemoveChild(event);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user