att
This commit is contained in:
-13
@@ -15,19 +15,6 @@ function validateForm(form) {
|
||||
message += getMessage("Justificativa da decisão", 1, form);
|
||||
hasErros = true;
|
||||
}
|
||||
} else if (atividade == 4) {
|
||||
var tipoEntregaAprovacao = String(form.getValue("tipoEntregaAprovacao") || "").trim();
|
||||
var loginAtribuicao = String(form.getValue("loginEntregaAprovacao") || "").trim();
|
||||
if (tipoEntregaAprovacao == "") {
|
||||
message += getMessage("Quem vai fazer a entrega", 2, form);
|
||||
hasErros = true;
|
||||
} else if (tipoEntregaAprovacao == "eu" && loginAtribuicao == "") {
|
||||
message += getMessage("Login para atribuição da entrega", 1, form);
|
||||
hasErros = true;
|
||||
} else if (tipoEntregaAprovacao == "eu" && loginAtribuicao.length > 30) {
|
||||
message += "Campo \"Login para atribuição da entrega\" permite no maximo 30 caracteres.<br>";
|
||||
hasErros = true;
|
||||
}
|
||||
}
|
||||
|
||||
switch (atividade) {
|
||||
|
||||
@@ -72,10 +72,6 @@ $(document).ready(function () {
|
||||
applyMotoristaEntregaMode($(this).val(), false);
|
||||
});
|
||||
|
||||
$(document).on("change", "input[name='tipoEntregaAprovacao']", function () {
|
||||
applyTipoEntregaAprovacao($(this).val(), true);
|
||||
});
|
||||
|
||||
$(document).on("change", "#motoristaEntregaSelecionado", function () {
|
||||
applySelectedMotoristaEntregaOption();
|
||||
});
|
||||
@@ -154,7 +150,6 @@ $(document).ready(function () {
|
||||
$("#dataValidacaoGestor").val(
|
||||
requestDate[0] + " - " + requestDate[1]
|
||||
);
|
||||
initTipoEntregaAprovacao(true);
|
||||
updt_line();
|
||||
} else if (activity == 6) {
|
||||
showAndBlock([0, 4]);
|
||||
@@ -270,7 +265,6 @@ $(document).ready(function () {
|
||||
updateConferenciaNfeVisibility(activity);
|
||||
}
|
||||
|
||||
initTipoEntregaAprovacao(String(activity) === "4");
|
||||
syncQuantidadeAprovadaAllRows();
|
||||
toggleQuantidadeAprovadaGestorByActivity(activity);
|
||||
agendarRefreshTabelaAprovacao(activity);
|
||||
@@ -734,78 +728,6 @@ function validarQuantidadeAprovadaGestor() {
|
||||
}
|
||||
}
|
||||
|
||||
function normalizeLoginAtribuicao(value) {
|
||||
return String(value == null ? "" : value).trim();
|
||||
}
|
||||
|
||||
function initTipoEntregaAprovacao(useCurrentUserForEu) {
|
||||
var escolha = String($("input[name='tipoEntregaAprovacao']:checked").val() || "").trim();
|
||||
var loginSalvo = String($("#loginEntregaAprovacao").val() || "").trim();
|
||||
|
||||
if (!escolha) {
|
||||
escolha = loginSalvo ? "eu" : "motorista";
|
||||
$("input[name='tipoEntregaAprovacao'][value='" + escolha + "']").prop("checked", true);
|
||||
}
|
||||
|
||||
applyTipoEntregaAprovacao(escolha, useCurrentUserForEu === true);
|
||||
}
|
||||
|
||||
function applyTipoEntregaAprovacao(mode, useCurrentUserForEu) {
|
||||
var escolha = String(mode || "").trim();
|
||||
var usarUsuarioAtual = useCurrentUserForEu === true;
|
||||
|
||||
if (escolha === "eu") {
|
||||
var login = usarUsuarioAtual
|
||||
? String($("#currentUserId").val() || "").trim()
|
||||
: String($("#loginEntregaAprovacao").val() || "").trim();
|
||||
var nome = usarUsuarioAtual
|
||||
? String($("#currentUserName").val() || "").trim()
|
||||
: String($("#nomeAtribuicaoEntregaAprovacao").val() || "").trim();
|
||||
|
||||
if (!login) {
|
||||
login = String($("#loginEntregaAprovacao").val() || "").trim();
|
||||
}
|
||||
if (!nome) {
|
||||
nome = String($("#nomeAtribuicaoEntregaAprovacao").val() || "").trim();
|
||||
}
|
||||
|
||||
login = normalizeLoginAtribuicao(login);
|
||||
$("#loginEntregaAprovacao").val(login);
|
||||
$("#loginEntregaAprovacaoView").val(login);
|
||||
$("#nomeAtribuicaoEntregaAprovacao").val(nome);
|
||||
return;
|
||||
}
|
||||
|
||||
$("#loginEntregaAprovacao").val("");
|
||||
$("#loginEntregaAprovacaoView").val("");
|
||||
$("#nomeAtribuicaoEntregaAprovacao").val("");
|
||||
}
|
||||
|
||||
function validarEscolhaEntregaAprovacao(nextState) {
|
||||
if (String(nextState) === "39") return;
|
||||
|
||||
var escolha = String($("input[name='tipoEntregaAprovacao']:checked").val() || "").trim();
|
||||
if (!escolha) {
|
||||
$("#blocoTipoEntregaAprovacao").addClass("errorValidate");
|
||||
throw "Informe quem vai fazer a entrega na aprovação (Eu ou Motorista).";
|
||||
}
|
||||
|
||||
applyTipoEntregaAprovacao(escolha, true);
|
||||
if (escolha === "eu") {
|
||||
var loginAtribuicao = normalizeLoginAtribuicao($("#loginEntregaAprovacao").val());
|
||||
$("#loginEntregaAprovacao").val(loginAtribuicao);
|
||||
$("#loginEntregaAprovacaoView").val(loginAtribuicao);
|
||||
if (!loginAtribuicao) {
|
||||
$("#blocoLoginEntregaAprovacao").addClass("errorValidate");
|
||||
throw "Nao foi possivel definir o login para atribuicao da entrega.";
|
||||
}
|
||||
if (loginAtribuicao.length > 30) {
|
||||
$("#blocoLoginEntregaAprovacao").addClass("errorValidate");
|
||||
throw "O campo 'loginEntregaAprovacao' permite no maximo 30 caracteres.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function initMotoristaEntregaEscolha() {
|
||||
var escolha = String($("input[name='tipoMotoristaEntrega']:checked").val() || "");
|
||||
if (!escolha) {
|
||||
@@ -1702,7 +1624,6 @@ var beforeSendValidate = function (numState, nextState) {
|
||||
throw "'Justificativa da decisão' é obrigatória para reprovar.";
|
||||
}
|
||||
} else {
|
||||
validarEscolhaEntregaAprovacao(nextState);
|
||||
validarQuantidadeAprovadaGestor();
|
||||
}
|
||||
} else if (numState == 6) {
|
||||
|
||||
+15
-26
@@ -320,6 +320,21 @@
|
||||
<input type="text" class="form-control transfer-input" name="analistasup" id="analistasup" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top:10px;">
|
||||
<div class="col-md-12 col-sm-12" id="blocoTipoEntregaAprovacao" style="margin-bottom:10px;">
|
||||
<label class="transfer-label">Quem vai fazer a entrega?</label>
|
||||
<div>
|
||||
<label class="radio-inline" style="margin-right:15px;">
|
||||
<input type="radio" name="tipoEntregaAprovacao" id="tipoEntregaAprovacaoEu" value="eu" />
|
||||
Gestor
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="tipoEntregaAprovacao" id="tipoEntregaAprovacaoMotorista" value="motorista" />
|
||||
Motorista
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="transfer-card activity activity-0 activity-1 activity-4 activity-6 activity-18 activity-24 activity-31 activity-57">
|
||||
@@ -435,31 +450,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12" id="blocoTipoEntregaAprovacao" style="margin-bottom:10px;">
|
||||
<label class="transfer-label">Quem vai fazer a entrega?</label>
|
||||
<div>
|
||||
<label class="radio-inline" style="margin-right:15px;">
|
||||
<input type="radio" name="tipoEntregaAprovacao" id="tipoEntregaAprovacaoEu" value="eu" />
|
||||
Eu
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="tipoEntregaAprovacao" id="tipoEntregaAprovacaoMotorista" value="motorista" />
|
||||
Motorista
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-sm-12" id="blocoLoginEntregaAprovacao">
|
||||
<label class="transfer-label" for="loginEntregaAprovacaoView">Login para atribuição da entrega</label>
|
||||
<input type="text" class="form-control transfer-input" name="loginEntregaAprovacaoView" id="loginEntregaAprovacaoView" readonly maxlength="30" placeholder="Preenchido automaticamente ao selecionar 'Eu'" />
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<label class="transfer-label" for="nomeAtribuicaoEntregaAprovacao">Nome para atribuição da entrega</label>
|
||||
<input type="text" class="form-control transfer-input" name="nomeAtribuicaoEntregaAprovacao" id="nomeAtribuicaoEntregaAprovacao" readonly />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<label class="transfer-label" for="userValidacaoGestor">Nome aprovação filial emitente</label>
|
||||
@@ -706,7 +696,6 @@
|
||||
<input type="hidden" name="qtdDivergenciasGestor" id="qtdDivergenciasGestor" value="0" />
|
||||
<input type="hidden" name="motoristaColetaLogin" id="motoristaColetaLogin" value="" />
|
||||
<input type="hidden" name="motoristaEntregaLogin" id="motoristaEntregaLogin" value="" />
|
||||
<input type="hidden" name="loginEntregaAprovacao" id="loginEntregaAprovacao" value="" maxlength="30" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user