Novo git da alteração
This commit is contained in:
@@ -1,235 +1,235 @@
|
||||
$(document).ready(function () {
|
||||
if ($("#formMode").val() == "VIEW") {
|
||||
showAndBlock(["all"]);
|
||||
$(".ratingAction").hide();
|
||||
if ($("input[name=situacaoResolvida]:checked").val() == "sim") {
|
||||
$(".ratingAction").show();
|
||||
}
|
||||
let ratingValue;
|
||||
if ($("#ratingValue").val() == "" || $("#ratingValue").val() == 0) {
|
||||
ratingValue = 0;
|
||||
} else {
|
||||
ratingValue = $("#ratingValue").val();
|
||||
}
|
||||
let html = "";
|
||||
for (let i = 0; i < 5; i++) {
|
||||
if (i < ratingValue) {
|
||||
html +=
|
||||
'<i class="flaticon flaticon-star-active icon-md" aria-hidden="true"></i>';
|
||||
} else {
|
||||
html +=
|
||||
'<i class="flaticon flaticon-star icon-md" aria-hidden="true"></i>';
|
||||
}
|
||||
}
|
||||
console.log(html);
|
||||
$(".minha-avaliacao").html(html);
|
||||
} else {
|
||||
//show the right fields
|
||||
var activity = $("#activity").val();
|
||||
var requestDate = getCurrentDate();
|
||||
var ratingStars;
|
||||
var servicoNaoValidado =
|
||||
$("input[name=situacaoResolvida]:checked").val() == "nao";
|
||||
// $(document).ready(function () {
|
||||
// if ($("#formMode").val() == "VIEW") {
|
||||
// showAndBlock(["all"]);
|
||||
// $(".ratingAction").hide();
|
||||
// if ($("input[name=situacaoResolvida]:checked").val() == "sim") {
|
||||
// $(".ratingAction").show();
|
||||
// }
|
||||
// let ratingValue;
|
||||
// if ($("#ratingValue").val() == "" || $("#ratingValue").val() == 0) {
|
||||
// ratingValue = 0;
|
||||
// } else {
|
||||
// ratingValue = $("#ratingValue").val();
|
||||
// }
|
||||
// let html = "";
|
||||
// for (let i = 0; i < 5; i++) {
|
||||
// if (i < ratingValue) {
|
||||
// html +=
|
||||
// '<i class="flaticon flaticon-star-active icon-md" aria-hidden="true"></i>';
|
||||
// } else {
|
||||
// html +=
|
||||
// '<i class="flaticon flaticon-star icon-md" aria-hidden="true"></i>';
|
||||
// }
|
||||
// }
|
||||
// console.log(html);
|
||||
// $(".minha-avaliacao").html(html);
|
||||
// } else {
|
||||
// //show the right fields
|
||||
// var activity = $("#activity").val();
|
||||
// var requestDate = getCurrentDate();
|
||||
// var ratingStars;
|
||||
// var servicoNaoValidado =
|
||||
// $("input[name=situacaoResolvida]:checked").val() == "nao";
|
||||
|
||||
$(".activity").hide();
|
||||
// $(".activity").hide();
|
||||
|
||||
$(".activity-" + activity).show();
|
||||
// $(".activity-" + activity).show();
|
||||
|
||||
if (activity == 0 || activity == 1) {
|
||||
//primeira atividade
|
||||
//$("#dataAbertura").val(requestDate[0] + " - " + requestDate[1]);
|
||||
$("#dataAbertura").val(requestDate[0]);
|
||||
add_new_row("tabelaItens");
|
||||
} else if (activity == 4) {
|
||||
showAndBlock([0]);
|
||||
$("#userValidacaoGestor").val($("#currentUserName").val());
|
||||
$("#dataValidacaoGestor").val(
|
||||
requestDate[0] + " - " + requestDate[1]
|
||||
);
|
||||
updt_line();
|
||||
} else if (activity == 6) {
|
||||
showAndBlock([0, 4]);
|
||||
$("#userValidacaoCompras").val($("#currentUserName").val());
|
||||
$("#dataValidacaoCompras").val(
|
||||
requestDate[0] + " - " + requestDate[1]
|
||||
);
|
||||
// if (activity == 0 || activity == 1) {
|
||||
// //primeira atividade
|
||||
// //$("#dataAbertura").val(requestDate[0] + " - " + requestDate[1]);
|
||||
// $("#dataAbertura").val(requestDate[0]);
|
||||
// add_new_row("tabelaItens");
|
||||
// } else if (activity == 4) {
|
||||
// showAndBlock([0]);
|
||||
// $("#userValidacaoGestor").val($("#currentUserName").val());
|
||||
// $("#dataValidacaoGestor").val(
|
||||
// requestDate[0] + " - " + requestDate[1]
|
||||
// );
|
||||
// updt_line();
|
||||
// } else if (activity == 6) {
|
||||
// showAndBlock([0, 4]);
|
||||
// $("#userValidacaoCompras").val($("#currentUserName").val());
|
||||
// $("#dataValidacaoCompras").val(
|
||||
// requestDate[0] + " - " + requestDate[1]
|
||||
// );
|
||||
|
||||
if ($("#justificativaDecisaoGestor").val() == "") {
|
||||
$(".justificativa-activity-4").hide();
|
||||
}
|
||||
updt_line();
|
||||
// if ($("#justificativaDecisaoGestor").val() == "") {
|
||||
// $(".justificativa-activity-4").hide();
|
||||
// }
|
||||
// updt_line();
|
||||
|
||||
} else if (activity == 57) {
|
||||
$("#userValidacao").val($("#currentUserName").val());
|
||||
$("#dataUserValidacao").val(
|
||||
requestDate[0] + " - " + requestDate[1]
|
||||
);
|
||||
if ($("#justificativaDecisaoGestor").val() == "") {
|
||||
$(".justificativa-activity-4").hide();
|
||||
}
|
||||
if ($("#justificativaDecisaoCompras").val() == "") {
|
||||
$(".justificativa-activity-6").hide();
|
||||
}
|
||||
showAndBlock([0, 4, 6, 31, 24, 18]);
|
||||
// } else if (activity == 57) {
|
||||
// $("#userValidacao").val($("#currentUserName").val());
|
||||
// $("#dataUserValidacao").val(
|
||||
// requestDate[0] + " - " + requestDate[1]
|
||||
// );
|
||||
// if ($("#justificativaDecisaoGestor").val() == "") {
|
||||
// $(".justificativa-activity-4").hide();
|
||||
// }
|
||||
// if ($("#justificativaDecisaoCompras").val() == "") {
|
||||
// $(".justificativa-activity-6").hide();
|
||||
// }
|
||||
// showAndBlock([0, 4, 6, 31, 24, 18]);
|
||||
|
||||
let ratingValue;
|
||||
if ($("#ratingValue").val() == "" || $("#ratingValue").val() == 0) {
|
||||
ratingValue = 0;
|
||||
} else {
|
||||
ratingValue = $("#ratingValue").val();
|
||||
}
|
||||
ratingStars = FLUIGC.stars(".minha-avaliacao", {
|
||||
stars: 5,
|
||||
value: ratingValue,
|
||||
sizeClass: "icon-md",
|
||||
});
|
||||
ratingStars.on("click", (obj) => {
|
||||
let countCurrentRating = 0;
|
||||
$(".fluigicon-star").each(() => {
|
||||
countCurrentRating++;
|
||||
});
|
||||
$("#ratingValue").val(countCurrentRating);
|
||||
});
|
||||
$("input[name=consegueResolver]").on("change", function () {
|
||||
$(".consegueResolverMotivo").hide();
|
||||
if ($(`input[name=${$(this).attr("name")}]:checked`).val() == "nao")
|
||||
$(".consegueResolverMotivo").show();
|
||||
});
|
||||
$("input[name=consegueResolver]").trigger("change");
|
||||
// let ratingValue;
|
||||
// if ($("#ratingValue").val() == "" || $("#ratingValue").val() == 0) {
|
||||
// ratingValue = 0;
|
||||
// } else {
|
||||
// ratingValue = $("#ratingValue").val();
|
||||
// }
|
||||
// ratingStars = FLUIGC.stars(".minha-avaliacao", {
|
||||
// stars: 5,
|
||||
// value: ratingValue,
|
||||
// sizeClass: "icon-md",
|
||||
// });
|
||||
// ratingStars.on("click", (obj) => {
|
||||
// let countCurrentRating = 0;
|
||||
// $(".fluigicon-star").each(() => {
|
||||
// countCurrentRating++;
|
||||
// });
|
||||
// $("#ratingValue").val(countCurrentRating);
|
||||
// });
|
||||
// $("input[name=consegueResolver]").on("change", function () {
|
||||
// $(".consegueResolverMotivo").hide();
|
||||
// if ($(`input[name=${$(this).attr("name")}]:checked`).val() == "nao")
|
||||
// $(".consegueResolverMotivo").show();
|
||||
// });
|
||||
// $("input[name=consegueResolver]").trigger("change");
|
||||
|
||||
$("input[name=situacaoResolvida]").on("change", function () {
|
||||
$(".explainAction, .ratingAction").hide();
|
||||
if ($("input[name=situacaoResolvida]:checked").val() == "nao") {
|
||||
$(".explainAction").show();
|
||||
} else if (
|
||||
$("input[name=situacaoResolvida]:checked").val() == "sim"
|
||||
) {
|
||||
$(".ratingAction").show();
|
||||
}
|
||||
});
|
||||
$("input[name=situacaoResolvida]").trigger("change");
|
||||
// $("input[name=situacaoResolvida]").on("change", function () {
|
||||
// $(".explainAction, .ratingAction").hide();
|
||||
// if ($("input[name=situacaoResolvida]:checked").val() == "nao") {
|
||||
// $(".explainAction").show();
|
||||
// } else if (
|
||||
// $("input[name=situacaoResolvida]:checked").val() == "sim"
|
||||
// ) {
|
||||
// $(".ratingAction").show();
|
||||
// }
|
||||
// });
|
||||
// $("input[name=situacaoResolvida]").trigger("change");
|
||||
|
||||
updt_line();
|
||||
// updt_line();
|
||||
|
||||
} else if (activity == 31) {
|
||||
$("#userRealizacaoCompras").val($("#currentUserName").val());
|
||||
$("#dataRealizacaoCompras").val(
|
||||
requestDate[0] + " - " + requestDate[1]
|
||||
);
|
||||
showAndBlock([0, 4, 6]);
|
||||
// } else if (activity == 31) {
|
||||
// $("#userRealizacaoCompras").val($("#currentUserName").val());
|
||||
// $("#dataRealizacaoCompras").val(
|
||||
// requestDate[0] + " - " + requestDate[1]
|
||||
// );
|
||||
// showAndBlock([0, 4, 6]);
|
||||
|
||||
if ($("#justificativaDecisaoGestor").val() == "") {
|
||||
$(".justificativa-activity-4").hide();
|
||||
}
|
||||
if ($("#justificativaDecisaoCompras").val() == "") {
|
||||
$(".justificativa-activity-6").hide();
|
||||
}
|
||||
updt_line();
|
||||
} else if (activity == 18) {
|
||||
if ($("justificativaValidaProblema") != "") {
|
||||
showAndBlock([0, 4, 6, 24, 31]);
|
||||
} else {
|
||||
showAndBlock([0, 4, 6, 31]);
|
||||
}
|
||||
$("#userValidacaofunc").val($("#currentUserName").val());
|
||||
$("#dataValidacaofunc").val(requestDate[0] + " - " + requestDate[1]);
|
||||
// if ($("#justificativaDecisaoGestor").val() == "") {
|
||||
// $(".justificativa-activity-4").hide();
|
||||
// }
|
||||
// if ($("#justificativaDecisaoCompras").val() == "") {
|
||||
// $(".justificativa-activity-6").hide();
|
||||
// }
|
||||
// updt_line();
|
||||
// } else if (activity == 18) {
|
||||
// if ($("justificativaValidaProblema") != "") {
|
||||
// showAndBlock([0, 4, 6, 24, 31]);
|
||||
// } else {
|
||||
// showAndBlock([0, 4, 6, 31]);
|
||||
// }
|
||||
// $("#userValidacaofunc").val($("#currentUserName").val());
|
||||
// $("#dataValidacaofunc").val(requestDate[0] + " - " + requestDate[1]);
|
||||
|
||||
if ($("#justificativaDecisaoGestor").val() == "") {
|
||||
$(".justificativa-activity-4").hide();
|
||||
}
|
||||
if ($("#justificativaDecisaoCompras").val() == "") {
|
||||
$(".justificativa-activity-6").hide();
|
||||
}
|
||||
if ($("#consideracoesCompras").val() == "") {
|
||||
$(".justificativa-activity-31").hide();
|
||||
}
|
||||
// if ($("#justificativaDecisaoGestor").val() == "") {
|
||||
// $(".justificativa-activity-4").hide();
|
||||
// }
|
||||
// if ($("#justificativaDecisaoCompras").val() == "") {
|
||||
// $(".justificativa-activity-6").hide();
|
||||
// }
|
||||
// if ($("#consideracoesCompras").val() == "") {
|
||||
// $(".justificativa-activity-31").hide();
|
||||
// }
|
||||
|
||||
$("input[name=validacaoFunc]").on("change", function () {
|
||||
$(".justificativaDecisaoFunc").hide();
|
||||
if (
|
||||
$("input[name=validacaoFunc]:checked").val() == "incorreto" ||
|
||||
$("input[name=validacaoFunc]:checked").val() == "naoEntregue"
|
||||
) {
|
||||
$(".justificativaDecisaoFunc").show();
|
||||
}
|
||||
});
|
||||
$("input[name=validacaoFunc]").trigger("change");
|
||||
// $("input[name=validacaoFunc]").on("change", function () {
|
||||
// $(".justificativaDecisaoFunc").hide();
|
||||
// if (
|
||||
// $("input[name=validacaoFunc]:checked").val() == "incorreto" ||
|
||||
// $("input[name=validacaoFunc]:checked").val() == "naoEntregue"
|
||||
// ) {
|
||||
// $(".justificativaDecisaoFunc").show();
|
||||
// }
|
||||
// });
|
||||
// $("input[name=validacaoFunc]").trigger("change");
|
||||
|
||||
updt_line();
|
||||
} else if (activity == 24) {
|
||||
showAndBlock([0, 4, 6, 31]);
|
||||
$("#userValidacaoItens").val($("#currentUserName").val());
|
||||
$("#dataValidacaoItens").val(requestDate[0] + " - " + requestDate[1]);
|
||||
// updt_line();
|
||||
// } else if (activity == 24) {
|
||||
// showAndBlock([0, 4, 6, 31]);
|
||||
// $("#userValidacaoItens").val($("#currentUserName").val());
|
||||
// $("#dataValidacaoItens").val(requestDate[0] + " - " + requestDate[1]);
|
||||
|
||||
if ($("#justificativaDecisaoGestor").val() == "") {
|
||||
$(".justificativa-activity-4").hide();
|
||||
}
|
||||
if ($("#justificativaDecisaoCompras").val() == "") {
|
||||
$(".justificativa-activity-6").hide();
|
||||
}
|
||||
if ($("#consideracoesCompras").val() == "") {
|
||||
$(".justificativa-activity-31").hide();
|
||||
}
|
||||
updt_line();
|
||||
} else if (activity == 114) {
|
||||
showAndBlock([0, 4, 6, 31, 24, 57, 18]);
|
||||
$("#userValidacaoCorre").val($("#currentUserName").val());
|
||||
$("#dataValidacaoCorre").val(requestDate[0] + " - " + requestDate[1]);
|
||||
// if ($("#justificativaDecisaoGestor").val() == "") {
|
||||
// $(".justificativa-activity-4").hide();
|
||||
// }
|
||||
// if ($("#justificativaDecisaoCompras").val() == "") {
|
||||
// $(".justificativa-activity-6").hide();
|
||||
// }
|
||||
// if ($("#consideracoesCompras").val() == "") {
|
||||
// $(".justificativa-activity-31").hide();
|
||||
// }
|
||||
// updt_line();
|
||||
// } else if (activity == 114) {
|
||||
// showAndBlock([0, 4, 6, 31, 24, 57, 18]);
|
||||
// $("#userValidacaoCorre").val($("#currentUserName").val());
|
||||
// $("#dataValidacaoCorre").val(requestDate[0] + " - " + requestDate[1]);
|
||||
|
||||
if ($("#justificativaDecisaoGestor").val() == "") {
|
||||
$(".justificativa-activity-4").hide();
|
||||
}
|
||||
if ($("#justificativaDecisaoCompras").val() == "") {
|
||||
$(".justificativa-activity-6").hide();
|
||||
}
|
||||
if ($("#consideracoesCompras").val() == "") {
|
||||
$(".justificativa-activity-31").hide();
|
||||
}
|
||||
// if ($("#justificativaDecisaoGestor").val() == "") {
|
||||
// $(".justificativa-activity-4").hide();
|
||||
// }
|
||||
// if ($("#justificativaDecisaoCompras").val() == "") {
|
||||
// $(".justificativa-activity-6").hide();
|
||||
// }
|
||||
// if ($("#consideracoesCompras").val() == "") {
|
||||
// $(".justificativa-activity-31").hide();
|
||||
// }
|
||||
|
||||
$("input[name=validacaoCorre]").on("change", function () {
|
||||
$(".justificativaDecisaoCorre").hide();
|
||||
if (
|
||||
$("input[name=validacaoCorre]:checked").val() == "entregue" ||
|
||||
$("input[name=validacaoCorre]:checked").val() == "naoEntregue"
|
||||
) {
|
||||
$(".justificativaDecisaoCorre").show();
|
||||
}
|
||||
});
|
||||
$("input[name=validacaoCorre]").trigger("change");
|
||||
// $("input[name=validacaoCorre]").on("change", function () {
|
||||
// $(".justificativaDecisaoCorre").hide();
|
||||
// if (
|
||||
// $("input[name=validacaoCorre]:checked").val() == "entregue" ||
|
||||
// $("input[name=validacaoCorre]:checked").val() == "naoEntregue"
|
||||
// ) {
|
||||
// $(".justificativaDecisaoCorre").show();
|
||||
// }
|
||||
// });
|
||||
// $("input[name=validacaoCorre]").trigger("change");
|
||||
|
||||
updt_line();
|
||||
}
|
||||
}
|
||||
// updt_line();
|
||||
// }
|
||||
// }
|
||||
|
||||
});
|
||||
// });
|
||||
|
||||
|
||||
|
||||
//show the activity and then block the fields
|
||||
function showAndBlock(activity) {
|
||||
for (var i = 0, l = activity.length; i < l; i++) {
|
||||
$(".activity-" + activity[i]).show();
|
||||
$(".hideButton").hide();
|
||||
$(".activity-" + activity[i] + " :input").each(function () {
|
||||
$(this).attr("readonly", "readonly");
|
||||
$(this)
|
||||
.css("background-color", "#eee")
|
||||
.children("option:not(:selected)")
|
||||
.prop("disabled", true);
|
||||
$(this).on("mousedown", function (e) {
|
||||
this.blur();
|
||||
window.focus();
|
||||
});
|
||||
if ($(this).is(":checkbox")) {
|
||||
$(this).attr("disabled", true);
|
||||
} else if ($(this).is(":radio")) {
|
||||
$(this).on("click", function () {
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// //show the activity and then block the fields
|
||||
// function showAndBlock(activity) {
|
||||
// for (var i = 0, l = activity.length; i < l; i++) {
|
||||
// $(".activity-" + activity[i]).show();
|
||||
// $(".hideButton").hide();
|
||||
// $(".activity-" + activity[i] + " :input").each(function () {
|
||||
// $(this).attr("readonly", "readonly");
|
||||
// $(this)
|
||||
// .css("background-color", "#eee")
|
||||
// .children("option:not(:selected)")
|
||||
// .prop("disabled", true);
|
||||
// $(this).on("mousedown", function (e) {
|
||||
// this.blur();
|
||||
// window.focus();
|
||||
// });
|
||||
// if ($(this).is(":checkbox")) {
|
||||
// $(this).attr("disabled", true);
|
||||
// } else if ($(this).is(":radio")) {
|
||||
// $(this).on("click", function () {
|
||||
// return false;
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
function getCurrentDate() {
|
||||
var newDate = new Date();
|
||||
@@ -348,17 +348,17 @@ function setSelectedZoomItem(selectedItem) {
|
||||
null
|
||||
).values;
|
||||
|
||||
var nomeGestorComercialBA = dtsCentroCusto[1].gestorCentroCusto;
|
||||
var emailGestorComercialBA = dtsCentroCusto[1].emailGestor;
|
||||
var idGestorComercialBA = dtsCentroCusto[1].idGestor;
|
||||
var nomeGestorComercialBA = dtsCentroCusto[0].gestorCentroCusto;
|
||||
var emailGestorComercialBA = dtsCentroCusto[0].emailGestor;
|
||||
var idGestorComercialBA = dtsCentroCusto[0].idGestor;
|
||||
|
||||
var nomeGestorComercialSE = dtsCentroCusto[2].gestorCentroCusto;
|
||||
var emailGestorComercialSE = dtsCentroCusto[2].emailGestor;
|
||||
var idGestorComercialSE = dtsCentroCusto[2].idGestor;
|
||||
var nomeGestorComercialSE = dtsCentroCusto[1].gestorCentroCusto;
|
||||
var emailGestorComercialSE = dtsCentroCusto[1].emailGestor;
|
||||
var idGestorComercialSE = dtsCentroCusto[1].idGestor;
|
||||
|
||||
var nomeGestorComercialAL = dtsCentroCusto[3].gestorCentroCusto;
|
||||
var emailGestorComercialAL = dtsCentroCusto[3].emailGestor;
|
||||
var idGestorComercialAL = dtsCentroCusto[3].idGestor;
|
||||
var nomeGestorComercialAL = dtsCentroCusto[2].gestorCentroCusto;
|
||||
var emailGestorComercialAL = dtsCentroCusto[2].emailGestor;
|
||||
var idGestorComercialAL = dtsCentroCusto[2].idGestor;
|
||||
|
||||
|
||||
if (name_item == "estabelecimento") {
|
||||
|
||||
Reference in New Issue
Block a user