ปรับทศนิยม 3 ตำแหน่ง
This commit is contained in:
@@ -1,22 +1,24 @@
|
||||
var eva_create_evaluation_detail_process_editMode = "CREATE";
|
||||
var eva_create_evaluation_detail_process_API = "/api/eva_create_evaluation_detail_process/";
|
||||
|
||||
function calculationAllItem(){
|
||||
function calculationAllItem() {
|
||||
var total = parseFloat($("#eva_create_evaluation_detail_summary1_achievement_chief").text()) +
|
||||
parseFloat($("#eva_create_evaluation_detail_summary1_competency_chief").text())
|
||||
|
||||
var total = parseFloat($("#eva_create_evaluation_detail_summary1_achievement_chief").text())+
|
||||
parseFloat($("#eva_create_evaluation_detail_summary1_competency_chief").text())
|
||||
|
||||
$("#eva_create_evaluation_detail_summary1_score_chief").text(total.toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary1_score_chief").text(total.toFixed(3));
|
||||
cal_level();
|
||||
console.log("calculationAllItem");
|
||||
console.log($("#eva_create_evaluation_detail_summary1_achievement_chief").text());
|
||||
console.log($("#eva_create_evaluation_detail_summary1_competency_chief").text());
|
||||
}
|
||||
|
||||
function cal_level(){
|
||||
function cal_level() {
|
||||
var total = parseFloat($("#eva_create_evaluation_detail_summary1_score_chief").text());
|
||||
|
||||
$.each(item_level_score, function( i, val ) {
|
||||
$.each(item_level_score, function (i, val) {
|
||||
//console.log(val.min_score);
|
||||
//console.log(total);
|
||||
if(total >= val.min_score){
|
||||
if (total >= val.min_score) {
|
||||
$("#eva_create_evaluation_detail_summary1_level_score_chief").text(val.detail);
|
||||
}
|
||||
});
|
||||
@@ -28,38 +30,38 @@ var item_level_score;
|
||||
|
||||
function eva_create_evaluation_detail_process_FeedDataToForm(data) {
|
||||
|
||||
//console.log(data);
|
||||
//console.log(data);
|
||||
|
||||
$("#date_from").val(formatDate(data.start_date));
|
||||
$("#date_to").val(formatDate(data.end_date));
|
||||
$("#date_from").val(formatDate(data.start_date));
|
||||
$("#date_to").val(formatDate(data.end_date));
|
||||
|
||||
|
||||
$("#eva_create_evaluation_detail_process_id").val(data.id);
|
||||
$("#eva_create_evaluation_detail_process_employee_id").val(data.employee_id);
|
||||
$("#eva_create_evaluation_detail_process_evaluation_round").text(data.evaluation_round);
|
||||
$("#eva_create_evaluation_detail_process_employee_code").text(data.employee_code);
|
||||
$("#eva_create_evaluation_detail_process_employee_fullname").text(data.employee_fullname);
|
||||
$("#eva_create_evaluation_detail_process_employee_position").text(data.employee_position);
|
||||
$("#eva_create_evaluation_detail_process_employee_position_type").text(data.employee_position_type);
|
||||
$("#eva_create_evaluation_detail_process_employee_position_level").text(data.employee_position_level);
|
||||
$("#eva_create_evaluation_detail_process_employee_org").text(data.employee_org);
|
||||
$("#eva_create_evaluation_detail_process_chief_fullname").text(data.chief_fullname);
|
||||
$("#eva_create_evaluation_detail_process_chief_position").text(data.chief_position);
|
||||
$("#eva_create_evaluation_detail_process_create_evaluation_id").val(data.create_evaluation_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_process_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
|
||||
$("#eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code);
|
||||
$("#eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname);
|
||||
$("#eva_create_evaluation_detail_process_id").val(data.id);
|
||||
$("#eva_create_evaluation_detail_process_employee_id").val(data.employee_id);
|
||||
$("#eva_create_evaluation_detail_process_evaluation_round").text(data.evaluation_round);
|
||||
$("#eva_create_evaluation_detail_process_employee_code").text(data.employee_code);
|
||||
$("#eva_create_evaluation_detail_process_employee_fullname").text(data.employee_fullname);
|
||||
$("#eva_create_evaluation_detail_process_employee_position").text(data.employee_position);
|
||||
$("#eva_create_evaluation_detail_process_employee_position_type").text(data.employee_position_type);
|
||||
$("#eva_create_evaluation_detail_process_employee_position_level").text(data.employee_position_level);
|
||||
$("#eva_create_evaluation_detail_process_employee_org").text(data.employee_org);
|
||||
$("#eva_create_evaluation_detail_process_chief_fullname").text(data.chief_fullname);
|
||||
$("#eva_create_evaluation_detail_process_chief_position").text(data.chief_position);
|
||||
$("#eva_create_evaluation_detail_process_create_evaluation_id").val(data.create_evaluation_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_process_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
|
||||
$("#eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code);
|
||||
$("#eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname);
|
||||
|
||||
$("#remark_hrm_work_record").text(data.remark_hrm_work_record);
|
||||
$("#remark_hrm_work_record").text(data.remark_hrm_work_record);
|
||||
|
||||
searchVacation();
|
||||
searchVacation();
|
||||
|
||||
//console.log(data);
|
||||
item_level_score = data.item_level_score;
|
||||
//console.log(data);
|
||||
item_level_score = data.item_level_score;
|
||||
|
||||
$("#w1").text(data.create_evaluation_score1.toFixed(2));
|
||||
$("#w2").text(data.create_evaluation_score2.toFixed(2));
|
||||
$("#w3").text((data.create_evaluation_score1+data.create_evaluation_score2).toFixed(2));
|
||||
$("#w1").text(data.create_evaluation_score1.toFixed(3));
|
||||
$("#w2").text(data.create_evaluation_score2.toFixed(3));
|
||||
$("#w3").text((data.create_evaluation_score1 + data.create_evaluation_score2).toFixed(3));
|
||||
|
||||
$("#eva_create_evaluation_detail_process_score1").text(data.create_evaluation_score1);
|
||||
$("#eva_create_evaluation_detail_process_score2").text(data.create_evaluation_score2);
|
||||
@@ -68,20 +70,20 @@ $("#w3").text((data.create_evaluation_score1+data.create_evaluation_score2).toFi
|
||||
|
||||
function eva_create_evaluation_detail_process_GetFromForm() {
|
||||
var eva_create_evaluation_detail_processObject = new Object();
|
||||
eva_create_evaluation_detail_processObject.id = $("#eva_create_evaluation_detail_process_id").val();
|
||||
eva_create_evaluation_detail_processObject.evaluation_round = $("#eva_create_evaluation_detail_process_evaluation_round").text();
|
||||
eva_create_evaluation_detail_processObject.employee_code = $("#eva_create_evaluation_detail_process_employee_code").text();
|
||||
eva_create_evaluation_detail_processObject.employee_fullname = $("#eva_create_evaluation_detail_process_employee_fullname").text();
|
||||
eva_create_evaluation_detail_processObject.employee_position = $("#eva_create_evaluation_detail_process_employee_position").text();
|
||||
eva_create_evaluation_detail_processObject.employee_position_type = $("#eva_create_evaluation_detail_process_employee_position_type").text();
|
||||
eva_create_evaluation_detail_processObject.employee_position_level = $("#eva_create_evaluation_detail_process_employee_position_level").text();
|
||||
eva_create_evaluation_detail_processObject.employee_org = $("#eva_create_evaluation_detail_process_employee_org").text();
|
||||
eva_create_evaluation_detail_processObject.chief_fullname = $("#eva_create_evaluation_detail_process_chief_fullname").text();
|
||||
eva_create_evaluation_detail_processObject.chief_position = $("#eva_create_evaluation_detail_process_chief_position").text();
|
||||
eva_create_evaluation_detail_processObject.create_evaluation_id = $("#eva_create_evaluation_detail_process_create_evaluation_id").val();
|
||||
eva_create_evaluation_detail_processObject.org_id = $("#eva_create_evaluation_detail_process_org_id").val();
|
||||
eva_create_evaluation_detail_processObject.search_employee_code = $("#eva_create_evaluation_detail_process_search_employee_code").val();
|
||||
eva_create_evaluation_detail_processObject.search_employee_fullname = $("#eva_create_evaluation_detail_process_search_employee_fullname").val();
|
||||
eva_create_evaluation_detail_processObject.id = $("#eva_create_evaluation_detail_process_id").val();
|
||||
eva_create_evaluation_detail_processObject.evaluation_round = $("#eva_create_evaluation_detail_process_evaluation_round").text();
|
||||
eva_create_evaluation_detail_processObject.employee_code = $("#eva_create_evaluation_detail_process_employee_code").text();
|
||||
eva_create_evaluation_detail_processObject.employee_fullname = $("#eva_create_evaluation_detail_process_employee_fullname").text();
|
||||
eva_create_evaluation_detail_processObject.employee_position = $("#eva_create_evaluation_detail_process_employee_position").text();
|
||||
eva_create_evaluation_detail_processObject.employee_position_type = $("#eva_create_evaluation_detail_process_employee_position_type").text();
|
||||
eva_create_evaluation_detail_processObject.employee_position_level = $("#eva_create_evaluation_detail_process_employee_position_level").text();
|
||||
eva_create_evaluation_detail_processObject.employee_org = $("#eva_create_evaluation_detail_process_employee_org").text();
|
||||
eva_create_evaluation_detail_processObject.chief_fullname = $("#eva_create_evaluation_detail_process_chief_fullname").text();
|
||||
eva_create_evaluation_detail_processObject.chief_position = $("#eva_create_evaluation_detail_process_chief_position").text();
|
||||
eva_create_evaluation_detail_processObject.create_evaluation_id = $("#eva_create_evaluation_detail_process_create_evaluation_id").val();
|
||||
eva_create_evaluation_detail_processObject.org_id = $("#eva_create_evaluation_detail_process_org_id").val();
|
||||
eva_create_evaluation_detail_processObject.search_employee_code = $("#eva_create_evaluation_detail_process_search_employee_code").val();
|
||||
eva_create_evaluation_detail_processObject.search_employee_fullname = $("#eva_create_evaluation_detail_process_search_employee_fullname").val();
|
||||
|
||||
|
||||
return eva_create_evaluation_detail_processObject;
|
||||
@@ -91,9 +93,9 @@ function eva_create_evaluation_detail_process_InitialForm() {
|
||||
var successFunc = function (result) {
|
||||
eva_create_evaluation_detail_process_FeedDataToForm(result);
|
||||
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
@@ -102,17 +104,17 @@ function eva_create_evaluation_detail_process_InitialForm() {
|
||||
function eva_create_evaluation_detail_process_SetEditForm(a) {
|
||||
var successFunc = function (result) {
|
||||
eva_create_evaluation_detail_process_editMode = "UPDATE";
|
||||
eva_create_evaluation_detail_process_FeedDataToForm(result);
|
||||
eva_create_evaluation_detail_process_FeedDataToForm(result);
|
||||
setPageByRoleAndStatus(result.role_code, result.status_self, result.status_chief, result.status_supervisor);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + a+"/d", successFunc, AlertDanger);
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + a + "/d", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_process_SetCreateForm() {
|
||||
eva_create_evaluation_detail_process_editMode = "CREATE";
|
||||
eva_create_evaluation_detail_process_InitialForm();
|
||||
eva_create_evaluation_detail_process_InitialForm();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
@@ -122,8 +124,7 @@ var eva_create_evaluation_detail_process_customValidation = function (group) {
|
||||
};
|
||||
|
||||
function eva_create_evaluation_detail_process_PutUpdate() {
|
||||
if (!ValidateForm('eva_create_evaluation_detail_process', eva_create_evaluation_detail_process_customValidation))
|
||||
{
|
||||
if (!ValidateForm('eva_create_evaluation_detail_process', eva_create_evaluation_detail_process_customValidation)) {
|
||||
return;
|
||||
}
|
||||
var data = eva_create_evaluation_detail_process_GetFromForm();
|
||||
@@ -132,18 +133,18 @@ function eva_create_evaluation_detail_process_PutUpdate() {
|
||||
if (eva_create_evaluation_detail_process_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
AlertSuccess(result.message);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_create_evaluation_detail_process_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
AlertSuccess(result.message);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_create_evaluation_detail_process_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
@@ -153,9 +154,9 @@ function eva_create_evaluation_detail_process_GoDelete(a) {
|
||||
var successFunc = function (result) {
|
||||
AlertSuccess(result.message);
|
||||
eva_create_evaluation_detail_process_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_process_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
@@ -166,27 +167,27 @@ function eva_create_evaluation_detail_process_GoDelete(a) {
|
||||
|
||||
//================= Control Function =========================================
|
||||
|
||||
function setPageByRoleAndStatus(role_code, status_self, status_chief, status_supervisor){
|
||||
function setPageByRoleAndStatus(role_code, status_self, status_chief, status_supervisor) {
|
||||
$(".mycontrol01").hide();
|
||||
$(".mycontrol02").attr("disabled", true);
|
||||
$("#eva_create_evaluation_detail_review01_supervisor1_remark").attr("disabled", true);
|
||||
|
||||
if(role_code === "1"){ // ผู้ประเมิน
|
||||
if(status_self === "Y"){
|
||||
if (role_code === "1") { // ผู้ประเมิน
|
||||
if (status_self === "Y") {
|
||||
$(".mycontrol01").show();
|
||||
$("#eva_create_evaluation_detail_review01_supervisor1_remark").attr("disabled", false);
|
||||
$(".mycontrol02").attr("disabled", false);
|
||||
}else{
|
||||
} else {
|
||||
$("#thestatus").text("(ผู้รับการประเมิน ยังไม่ส่งแบบประเมิน คุณจึงไม่สามารถให้ความเห็นได้)");
|
||||
}
|
||||
}
|
||||
|
||||
if(status_chief === "Y"){
|
||||
if (status_chief === "Y") {
|
||||
$("#thestatus").text("(ผู้ประเมิน ส่งแบบประเมินแล้ว)");
|
||||
$(".mycontrol01").hide();
|
||||
$(".mycontrol02").attr("disabled", true);
|
||||
$("#eva_create_evaluation_detail_review01_supervisor1_remark").attr("disabled", true);
|
||||
}
|
||||
}else{
|
||||
}
|
||||
} else {
|
||||
console.log(role_code);
|
||||
//alert('คุณไม่มีสิทธิเข้าถึงหน้าจอนี้!');
|
||||
//window_close();
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
var eva_create_evaluation_detail_process_editMode = "CREATE";
|
||||
var eva_create_evaluation_detail_process_API = "/api/eva_create_evaluation_detail_process/";
|
||||
|
||||
function calculationAllItem(){
|
||||
function calculationAllItem() {
|
||||
|
||||
var total = parseFloat($("#eva_create_evaluation_detail_summary2_achievement_supervisor").text())+
|
||||
parseFloat($("#eva_create_evaluation_detail_summary2_competency_supervisor").text())
|
||||
var total = parseFloat($("#eva_create_evaluation_detail_summary2_achievement_supervisor").text()) +
|
||||
parseFloat($("#eva_create_evaluation_detail_summary2_competency_supervisor").text())
|
||||
|
||||
$("#eva_create_evaluation_detail_summary2_score_supervisor").text(total.toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary2_score_supervisor").text(total.toFixed(3));
|
||||
cal_level();
|
||||
}
|
||||
|
||||
function cal_level(){
|
||||
function cal_level() {
|
||||
var total = parseFloat($("#eva_create_evaluation_detail_summary2_score_supervisor").text());
|
||||
|
||||
$.each(item_level_score, function( i, val ) {
|
||||
$.each(item_level_score, function (i, val) {
|
||||
//console.log(val.min_score);
|
||||
//console.log(total);
|
||||
if(total >= val.min_score){
|
||||
if (total >= val.min_score) {
|
||||
$("#eva_create_evaluation_detail_summary2_level_score_supervisor").text(val.detail);
|
||||
}
|
||||
});
|
||||
@@ -28,36 +28,36 @@ var item_level_score;
|
||||
|
||||
function eva_create_evaluation_detail_process_FeedDataToForm(data) {
|
||||
|
||||
//console.log(data);
|
||||
//console.log(data);
|
||||
|
||||
$("#date_from").val(formatDate(data.start_date));
|
||||
$("#date_to").val(formatDate(data.end_date));
|
||||
$("#date_from").val(formatDate(data.start_date));
|
||||
$("#date_to").val(formatDate(data.end_date));
|
||||
|
||||
$("#eva_create_evaluation_detail_process_id").val(data.id);
|
||||
$("#eva_create_evaluation_detail_process_employee_id").val(data.employee_id);
|
||||
$("#eva_create_evaluation_detail_process_evaluation_round").text(data.evaluation_round);
|
||||
$("#eva_create_evaluation_detail_process_employee_code").text(data.employee_code);
|
||||
$("#eva_create_evaluation_detail_process_employee_fullname").text(data.employee_fullname);
|
||||
$("#eva_create_evaluation_detail_process_employee_position").text(data.employee_position);
|
||||
$("#eva_create_evaluation_detail_process_employee_position_type").text(data.employee_position_type);
|
||||
$("#eva_create_evaluation_detail_process_employee_position_level").text(data.employee_position_level);
|
||||
$("#eva_create_evaluation_detail_process_employee_org").text(data.employee_org);
|
||||
$("#eva_create_evaluation_detail_process_chief_fullname").text(data.chief_fullname);
|
||||
$("#eva_create_evaluation_detail_process_chief_position").text(data.chief_position);
|
||||
$("#eva_create_evaluation_detail_process_create_evaluation_id").val(data.create_evaluation_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_process_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
|
||||
$("#eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code);
|
||||
$("#eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname);
|
||||
$("#eva_create_evaluation_detail_process_id").val(data.id);
|
||||
$("#eva_create_evaluation_detail_process_employee_id").val(data.employee_id);
|
||||
$("#eva_create_evaluation_detail_process_evaluation_round").text(data.evaluation_round);
|
||||
$("#eva_create_evaluation_detail_process_employee_code").text(data.employee_code);
|
||||
$("#eva_create_evaluation_detail_process_employee_fullname").text(data.employee_fullname);
|
||||
$("#eva_create_evaluation_detail_process_employee_position").text(data.employee_position);
|
||||
$("#eva_create_evaluation_detail_process_employee_position_type").text(data.employee_position_type);
|
||||
$("#eva_create_evaluation_detail_process_employee_position_level").text(data.employee_position_level);
|
||||
$("#eva_create_evaluation_detail_process_employee_org").text(data.employee_org);
|
||||
$("#eva_create_evaluation_detail_process_chief_fullname").text(data.chief_fullname);
|
||||
$("#eva_create_evaluation_detail_process_chief_position").text(data.chief_position);
|
||||
$("#eva_create_evaluation_detail_process_create_evaluation_id").val(data.create_evaluation_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_process_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
|
||||
$("#eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code);
|
||||
$("#eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname);
|
||||
|
||||
$("#remark_hrm_work_record").text(data.remark_hrm_work_record);
|
||||
$("#remark_hrm_work_record").text(data.remark_hrm_work_record);
|
||||
|
||||
searchVacation();
|
||||
searchVacation();
|
||||
|
||||
item_level_score = data.item_level_score;
|
||||
item_level_score = data.item_level_score;
|
||||
|
||||
$("#w1").text(data.create_evaluation_score1.toFixed(2));
|
||||
$("#w2").text(data.create_evaluation_score2.toFixed(2));
|
||||
$("#w3").text((data.create_evaluation_score1+data.create_evaluation_score2).toFixed(2));
|
||||
$("#w1").text(data.create_evaluation_score1.toFixed(3));
|
||||
$("#w2").text(data.create_evaluation_score2.toFixed(3));
|
||||
$("#w3").text((data.create_evaluation_score1 + data.create_evaluation_score2).toFixed(3));
|
||||
|
||||
$("#eva_create_evaluation_detail_process_score1").text(data.create_evaluation_score1);
|
||||
$("#eva_create_evaluation_detail_process_score2").text(data.create_evaluation_score2);
|
||||
@@ -88,9 +88,9 @@ function eva_create_evaluation_detail_process_GetFromForm() {
|
||||
function eva_create_evaluation_detail_process_InitialForm() {
|
||||
var successFunc = function (result) {
|
||||
eva_create_evaluation_detail_process_FeedDataToForm(result);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
@@ -99,25 +99,25 @@ function eva_create_evaluation_detail_process_InitialForm() {
|
||||
function eva_create_evaluation_detail_process_SetEditForm(a) {
|
||||
var successFunc = function (result) {
|
||||
eva_create_evaluation_detail_process_editMode = "UPDATE";
|
||||
eva_create_evaluation_detail_process_FeedDataToForm(result);
|
||||
|
||||
eva_create_evaluation_detail_process_FeedDataToForm(result);
|
||||
|
||||
//startLoad();
|
||||
eva_evaluation_achievement_process2_InitialForm(a, result.role_code);
|
||||
eva_evaluation_behavior_process2_InitialForm(a, result.role_code);
|
||||
eva_create_evaluation_detail_summary2_SetEditForm(a, result.role_code);
|
||||
|
||||
setTimeout(function(){
|
||||
setPageByRoleAndStatus(result.role_code, result.status_self, result.status_chief, result.status_supervisor, result.status_supervisor1A, result.status_supervisor2A);
|
||||
},1000);
|
||||
};
|
||||
startLoad();
|
||||
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + a+"/d2", successFunc, AlertDanger);
|
||||
setTimeout(function () {
|
||||
setPageByRoleAndStatus(result.role_code, result.status_self, result.status_chief, result.status_supervisor, result.status_supervisor1A, result.status_supervisor2A);
|
||||
}, 1000);
|
||||
};
|
||||
startLoad();
|
||||
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + a + "/d2", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_process_SetCreateForm() {
|
||||
eva_create_evaluation_detail_process_editMode = "CREATE";
|
||||
eva_create_evaluation_detail_process_InitialForm();
|
||||
eva_create_evaluation_detail_process_InitialForm();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
@@ -127,8 +127,7 @@ var eva_create_evaluation_detail_process_customValidation = function (group) {
|
||||
};
|
||||
|
||||
function eva_create_evaluation_detail_process_PutUpdate() {
|
||||
if (!ValidateForm('eva_create_evaluation_detail_process', eva_create_evaluation_detail_process_customValidation))
|
||||
{
|
||||
if (!ValidateForm('eva_create_evaluation_detail_process', eva_create_evaluation_detail_process_customValidation)) {
|
||||
return;
|
||||
}
|
||||
var data = eva_create_evaluation_detail_process_GetFromForm();
|
||||
@@ -137,18 +136,18 @@ function eva_create_evaluation_detail_process_PutUpdate() {
|
||||
if (eva_create_evaluation_detail_process_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
AlertSuccess(result.message);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_create_evaluation_detail_process_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
AlertSuccess(result.message);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_create_evaluation_detail_process_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
@@ -158,9 +157,9 @@ function eva_create_evaluation_detail_process_GoDelete(a) {
|
||||
var successFunc = function (result) {
|
||||
AlertSuccess(result.message);
|
||||
eva_create_evaluation_detail_process_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_process_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
@@ -171,26 +170,29 @@ function eva_create_evaluation_detail_process_GoDelete(a) {
|
||||
|
||||
//================= Control Function =========================================
|
||||
|
||||
function setViewOfComment(status_supervisor, status_supervisor1A, status_supervisor2A){
|
||||
function setViewOfComment(status_supervisor, status_supervisor1A, status_supervisor2A) {
|
||||
$("#eva_create_evaluation_detail_review02_supervisor2_result").hide();
|
||||
$("#eva_create_evaluation_detail_review03_supervisor1A_result").hide();
|
||||
$("#eva_create_evaluation_detail_review04_supervisor2A_result").hide();
|
||||
|
||||
if(status_supervisor === "Y"){
|
||||
if (status_supervisor === "Y") {
|
||||
$("#eva_create_evaluation_detail_review02_supervisor2_result").show();
|
||||
}
|
||||
if(status_supervisor === "Y"){
|
||||
if (status_supervisor === "Y") {
|
||||
$("#eva_create_evaluation_detail_review03_supervisor1A_result").show();
|
||||
}
|
||||
if(status_supervisor === "Y"){
|
||||
if (status_supervisor === "Y") {
|
||||
$("#eva_create_evaluation_detail_review04_supervisor2A_result").show();
|
||||
}
|
||||
}
|
||||
|
||||
var the_role_code = "";
|
||||
|
||||
function setPageByRoleAndStatus(role_code, status_self, status_chief, status_supervisor, status_supervisor1A, status_supervisor2A){
|
||||
function setPageByRoleAndStatus(role_code, status_self, status_chief, status_supervisor, status_supervisor1A, status_supervisor2A) {
|
||||
endLoad();
|
||||
|
||||
//return;
|
||||
|
||||
the_role_code = role_code;
|
||||
|
||||
$(".myeditor").attr("disabled", true);
|
||||
@@ -217,11 +219,11 @@ function setPageByRoleAndStatus(role_code, status_self, status_chief, status_sup
|
||||
|
||||
setViewOfComment(status_supervisor, status_supervisor1A, status_supervisor2A);
|
||||
|
||||
if(role_code === "2"){ // ความเห็น ความเห็นผู้ประเมินสูงสุด
|
||||
if (role_code === "2") { // ความเห็น ความเห็นผู้ประเมินสูงสุด
|
||||
|
||||
$("#eva_create_evaluation_detail_review02_supervisor2_result").show();
|
||||
|
||||
if(status_chief === "Y" && status_self === "Y"){
|
||||
if (status_chief === "Y" && status_self === "Y") {
|
||||
$("#btnb01").show();
|
||||
$("#btnb02").show();
|
||||
//$("#btnb03").show();
|
||||
@@ -229,11 +231,11 @@ function setPageByRoleAndStatus(role_code, status_self, status_chief, status_sup
|
||||
//$("#eva_create_evaluation_detail_review02_supervisor2_date").attr("disabled", false);
|
||||
$("#eva_create_evaluation_detail_review02_supervisor2_remark").attr("disabled", false);
|
||||
$(".myeditor").attr("disabled", false);
|
||||
}else{
|
||||
} else {
|
||||
$("#thestatus").text("(ผู้รับการประเมิน หรือ ผู้ประเมิน ยังไม่ส่งแบบประเมิน คุณจึงไม่สามารถให้ความเห็นได้)");
|
||||
}
|
||||
}
|
||||
|
||||
if(status_supervisor === "Y"){
|
||||
if (status_supervisor === "Y") {
|
||||
$("#btnb01").hide();
|
||||
$("#btnb02").hide();
|
||||
$("#btnb03").hide();
|
||||
@@ -242,13 +244,13 @@ function setPageByRoleAndStatus(role_code, status_self, status_chief, status_sup
|
||||
//$("#eva_create_evaluation_detail_review02_supervisor2_date").attr("disabled", true);
|
||||
$("#eva_create_evaluation_detail_review02_supervisor2_remark").attr("disabled", true);
|
||||
$(".myeditor").attr("disabled", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if(role_code === "3"){ // ความเห็น ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง
|
||||
else if (role_code === "3") { // ความเห็น ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง
|
||||
$("#eva_create_evaluation_detail_review03_supervisor1A_result").show();
|
||||
|
||||
if(status_supervisor === "Y" && status_chief === "Y" && status_self === "Y"){
|
||||
if (status_supervisor === "Y" && status_chief === "Y" && status_self === "Y") {
|
||||
$("#eva_create_evaluation_detail_review03_supervisor1A_result").attr("disabled", false);
|
||||
//$("#eva_create_evaluation_detail_review03_supervisor1A_date").attr("disabled", false);
|
||||
$("#eva_create_evaluation_detail_review03_supervisor1A_remark").attr("disabled", false);
|
||||
@@ -256,11 +258,11 @@ function setPageByRoleAndStatus(role_code, status_self, status_chief, status_sup
|
||||
$("#btnc02").show();
|
||||
//$("#btnc03").show();
|
||||
$(".myeditor").attr("disabled", false);
|
||||
}else{
|
||||
} else {
|
||||
$("#thestatus1A").text("(ผู้รับการประเมิน หรือ ผู้ประเมิน หรือ ผู้ประเมินสูงสุด ยังไม่ส่งแบบประเมิน คุณจึงไม่สามารถให้ความเห็นได้)");
|
||||
}
|
||||
}
|
||||
|
||||
if(status_supervisor1A === "Y"){
|
||||
if (status_supervisor1A === "Y") {
|
||||
$("#eva_create_evaluation_detail_review03_supervisor1A_result").attr("disabled", true);
|
||||
//$("#eva_create_evaluation_detail_review03_supervisor1A_date").attr("disabled", true);
|
||||
$("#eva_create_evaluation_detail_review03_supervisor1A_remark").attr("disabled", true);
|
||||
@@ -269,14 +271,14 @@ function setPageByRoleAndStatus(role_code, status_self, status_chief, status_sup
|
||||
$("#btnc03").hide();
|
||||
$("#thestatus1A").text("(ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง ส่งแบบประเมินแล้ว)");
|
||||
$(".myeditor").attr("disabled", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if(role_code === "4"){ // ความเห็น ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง (สูงสุด)
|
||||
else if (role_code === "4") { // ความเห็น ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง (สูงสุด)
|
||||
|
||||
$("#eva_create_evaluation_detail_review04_supervisor2A_result").show();
|
||||
|
||||
if(status_supervisor1A === "Y" && status_supervisor === "Y" && status_chief === "Y" && status_self === "Y"){
|
||||
if (status_supervisor1A === "Y" && status_supervisor === "Y" && status_chief === "Y" && status_self === "Y") {
|
||||
$("#eva_create_evaluation_detail_review04_supervisor2A_result").attr("disabled", false);
|
||||
//$("#eva_create_evaluation_detail_review04_supervisor2A_date").attr("disabled", false);
|
||||
$("#eva_create_evaluation_detail_review04_supervisor2A_remark").attr("disabled", false);
|
||||
@@ -284,10 +286,10 @@ function setPageByRoleAndStatus(role_code, status_self, status_chief, status_sup
|
||||
$("#btnd02").show();
|
||||
//$("#btnd03").show();
|
||||
$(".myeditor").attr("disabled", false);
|
||||
}else{
|
||||
} else {
|
||||
$("#thestatus2A").text("(ผู้รับการประเมิน หรือ ผู้ประเมิน หรือ ผู้ประเมินสูงสุด หรือ ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง ยังไม่ส่งแบบประเมิน คุณจึงไม่สามารถให้ความเห็นได้)");
|
||||
}
|
||||
if(status_supervisor2A === "Y"){
|
||||
}
|
||||
if (status_supervisor2A === "Y") {
|
||||
$("#eva_create_evaluation_detail_review04_supervisor2A_result").attr("disabled", true);
|
||||
//$("#eva_create_evaluation_detail_review04_supervisor2A_date").attr("disabled", true);
|
||||
$("#eva_create_evaluation_detail_review04_supervisor2A_remark").attr("disabled", true);
|
||||
@@ -296,12 +298,12 @@ function setPageByRoleAndStatus(role_code, status_self, status_chief, status_sup
|
||||
$("#btnd03").hide();
|
||||
$("#thestatus2A").text("(ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง (สูงสุด) ส่งแบบประเมินแล้ว)");
|
||||
$(".myeditor").attr("disabled", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert('คุณไม่มีสิทธิเข้าถึงหน้าจอนี้!');
|
||||
window_close();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user