ปรับทศนิยม 3 ตำแหน่ง
This commit is contained in:
@@ -452,10 +452,10 @@
|
||||
});
|
||||
|
||||
function CheckPermission() {
|
||||
//if (status_self === "Y") {
|
||||
// $(".status_self").hide();
|
||||
// $("#status").text("คุณส่งแบบประเมินไปแล้ว");
|
||||
//}
|
||||
if (status_self === "Y") {
|
||||
$(".status_self").hide();
|
||||
$("#status").text("คุณส่งแบบประเมินไปแล้ว");
|
||||
}
|
||||
}
|
||||
|
||||
function OnWeightChanged(c) {
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
<tr>
|
||||
<th>ลำดับ</th>
|
||||
|
||||
<th width="30%"><label>ผลสัมฤทธิ์ตัวชี้วัดผลงาน</label></th>
|
||||
<th width="60%"><label>ผลสัมฤทธิ์ตัวชี้วัดผลงาน</label></th>
|
||||
<th><label>น้ำหนัก (%)</label></th>
|
||||
|
||||
|
||||
@@ -397,8 +397,9 @@
|
||||
eva_create_evaluation_detail_review01_SetEditForm(id);
|
||||
eva_create_evaluation_detail_status_SetEditForm(id);
|
||||
|
||||
setTimeout(Oneva_evaluation_achievement_process_scoreChange, 1000);
|
||||
setTimeout(Oneva_evaluation_behavior_process_scoreChange, 1000);
|
||||
setTimeout(Oneva_evaluation_achievement_process_scoreChange, 3000);
|
||||
setTimeout(Oneva_evaluation_behavior_process_scoreChange, 3000);
|
||||
//setTimeout(calculationAllItem, 10*1000);
|
||||
} else {
|
||||
eva_create_evaluation_detail_process_SetCreateForm();
|
||||
}
|
||||
@@ -406,6 +407,12 @@
|
||||
SetupValidationRemark("eva_create_evaluation_detail_review01");
|
||||
});
|
||||
|
||||
function change3digit() {
|
||||
$(".the3digit").each(function (index) {
|
||||
$(this).val(parseFloat($(this).val()).toFixed(3));
|
||||
});
|
||||
}
|
||||
|
||||
function searchVacation_GetFromForm() {
|
||||
var searchVacationObject = new Object();
|
||||
searchVacationObject.start_date = formatDateForGetParameter(getDate($("#date_from").val()));
|
||||
|
||||
@@ -628,8 +628,8 @@
|
||||
eva_idp_plan_InitiateDataTable(id);
|
||||
eva_idp_plan_InitialForm();
|
||||
|
||||
setTimeout(Oneva_evaluation_achievement_process2_scoreChange, 1000);
|
||||
setTimeout(Oneva_evaluation_behavior_process2_scoreChange, 1000);
|
||||
setTimeout(Oneva_evaluation_achievement_process2_scoreChange, 4000);
|
||||
setTimeout(Oneva_evaluation_behavior_process2_scoreChange, 4000);
|
||||
|
||||
} else {
|
||||
eva_create_evaluation_detail_process_SetCreateForm();
|
||||
@@ -641,6 +641,12 @@
|
||||
SetupValidationRemark("eva_idp_plan");
|
||||
});
|
||||
|
||||
function change3digit() {
|
||||
$(".the3digit").each(function (index) {
|
||||
$(this).val(parseFloat($(this).val()).toFixed(3));
|
||||
});
|
||||
}
|
||||
|
||||
function Oneva_create_evaluation_detail_review02_supervisor2_resultChanged(a) {
|
||||
if ($(a).val() == "Y") {
|
||||
$("#eva_create_evaluation_detail_review02_supervisor2_remark").attr("iRequire", "false");
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,31 +4,31 @@ var eva_create_evaluation_detail_summary1_API = "/api/eva_create_evaluation_deta
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_create_evaluation_detail_summary1_FeedDataToForm(data) {
|
||||
$("#eva_create_evaluation_detail_summary1_id").val(data.id);
|
||||
$("#eva_create_evaluation_detail_summary1_create_evaluation_id").val(data.create_evaluation_id);
|
||||
$("#eva_create_evaluation_detail_summary1_total_summary_chief").text(data.total_summary_chief);
|
||||
$("#eva_create_evaluation_detail_summary1_Final_summary_chief").text(data.Final_summary_chief);
|
||||
$("#eva_create_evaluation_detail_summary1_total_summary_competency_chief").text(data.total_summary_competency_chief);
|
||||
$("#eva_create_evaluation_detail_summary1_Final_summary_competency_chief").text(data.Final_summary_competency_chief);
|
||||
$("#eva_create_evaluation_detail_summary1_achievement_chief").text(data.achievement_chief);
|
||||
$("#eva_create_evaluation_detail_summary1_competency_chief").text(data.competency_chief);
|
||||
$("#eva_create_evaluation_detail_summary1_score_chief").text(data.score_chief);
|
||||
$("#eva_create_evaluation_detail_summary1_level_score_chief").text(data.level_score_chief);
|
||||
console.log(data);
|
||||
$("#eva_create_evaluation_detail_summary1_id").val(data.id);
|
||||
$("#eva_create_evaluation_detail_summary1_create_evaluation_id").val(data.create_evaluation_id);
|
||||
$("#eva_create_evaluation_detail_summary1_total_summary_chief").text(data.total_summary_chief);
|
||||
$("#eva_create_evaluation_detail_summary1_Final_summary_chief").text(data.Final_summary_chief);
|
||||
$("#eva_create_evaluation_detail_summary1_total_summary_competency_chief").text(data.total_summary_competency_chief);
|
||||
$("#eva_create_evaluation_detail_summary1_Final_summary_competency_chief").text(data.Final_summary_competency_chief);
|
||||
$("#eva_create_evaluation_detail_summary1_achievement_chief").text(data.achievement_chief);
|
||||
$("#eva_create_evaluation_detail_summary1_competency_chief").text(data.competency_chief);
|
||||
$("#eva_create_evaluation_detail_summary1_score_chief").text(data.score_chief);
|
||||
$("#eva_create_evaluation_detail_summary1_level_score_chief").text(data.level_score_chief);
|
||||
//console.log(data);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_summary1_GetFromForm() {
|
||||
var eva_create_evaluation_detail_summary1Object = new Object();
|
||||
eva_create_evaluation_detail_summary1Object.id = $("#eva_create_evaluation_detail_summary1_id").val();
|
||||
eva_create_evaluation_detail_summary1Object.create_evaluation_id = $("#eva_create_evaluation_detail_summary1_create_evaluation_id").val();
|
||||
eva_create_evaluation_detail_summary1Object.total_summary_chief = $("#eva_create_evaluation_detail_summary1_total_summary_chief").text();
|
||||
eva_create_evaluation_detail_summary1Object.Final_summary_chief = $("#eva_create_evaluation_detail_summary1_Final_summary_chief").text();
|
||||
eva_create_evaluation_detail_summary1Object.total_summary_competency_chief = $("#eva_create_evaluation_detail_summary1_total_summary_competency_chief").text();
|
||||
eva_create_evaluation_detail_summary1Object.Final_summary_competency_chief = $("#eva_create_evaluation_detail_summary1_Final_summary_competency_chief").text();
|
||||
eva_create_evaluation_detail_summary1Object.achievement_chief = $("#eva_create_evaluation_detail_summary1_achievement_chief").text();
|
||||
eva_create_evaluation_detail_summary1Object.competency_chief = $("#eva_create_evaluation_detail_summary1_competency_chief").text();
|
||||
eva_create_evaluation_detail_summary1Object.score_chief = $("#eva_create_evaluation_detail_summary1_score_chief").text();
|
||||
eva_create_evaluation_detail_summary1Object.level_score_chief = $("#eva_create_evaluation_detail_summary1_level_score_chief").text();
|
||||
eva_create_evaluation_detail_summary1Object.id = $("#eva_create_evaluation_detail_summary1_id").val();
|
||||
eva_create_evaluation_detail_summary1Object.create_evaluation_id = $("#eva_create_evaluation_detail_summary1_create_evaluation_id").val();
|
||||
eva_create_evaluation_detail_summary1Object.total_summary_chief = $("#eva_create_evaluation_detail_summary1_total_summary_chief").text();
|
||||
eva_create_evaluation_detail_summary1Object.Final_summary_chief = $("#eva_create_evaluation_detail_summary1_Final_summary_chief").text();
|
||||
eva_create_evaluation_detail_summary1Object.total_summary_competency_chief = $("#eva_create_evaluation_detail_summary1_total_summary_competency_chief").text();
|
||||
eva_create_evaluation_detail_summary1Object.Final_summary_competency_chief = $("#eva_create_evaluation_detail_summary1_Final_summary_competency_chief").text();
|
||||
eva_create_evaluation_detail_summary1Object.achievement_chief = $("#eva_create_evaluation_detail_summary1_achievement_chief").text();
|
||||
eva_create_evaluation_detail_summary1Object.competency_chief = $("#eva_create_evaluation_detail_summary1_competency_chief").text();
|
||||
eva_create_evaluation_detail_summary1Object.score_chief = $("#eva_create_evaluation_detail_summary1_score_chief").text();
|
||||
eva_create_evaluation_detail_summary1Object.level_score_chief = $("#eva_create_evaluation_detail_summary1_level_score_chief").text();
|
||||
|
||||
|
||||
return eva_create_evaluation_detail_summary1Object;
|
||||
@@ -37,9 +37,9 @@ eva_create_evaluation_detail_summary1Object.level_score_chief = $("#eva_create_e
|
||||
function eva_create_evaluation_detail_summary1_InitialForm() {
|
||||
var successFunc = function (result) {
|
||||
eva_create_evaluation_detail_summary1_FeedDataToForm(result);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_summary1_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
@@ -49,15 +49,15 @@ function eva_create_evaluation_detail_summary1_SetEditForm(a) {
|
||||
var successFunc = function (result) {
|
||||
eva_create_evaluation_detail_summary1_editMode = "UPDATE";
|
||||
eva_create_evaluation_detail_summary1_FeedDataToForm(result);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_summary1_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_summary1_SetCreateForm() {
|
||||
eva_create_evaluation_detail_summary1_editMode = "CREATE";
|
||||
eva_create_evaluation_detail_summary1_InitialForm();
|
||||
eva_create_evaluation_detail_summary1_InitialForm();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
@@ -67,8 +67,7 @@ var eva_create_evaluation_detail_summary1_customValidation = function (group) {
|
||||
};
|
||||
|
||||
function eva_create_evaluation_detail_summary1_PutUpdate() {
|
||||
if (!ValidateForm('eva_create_evaluation_detail_summary1', eva_create_evaluation_detail_summary1_customValidation))
|
||||
{
|
||||
if (!ValidateForm('eva_create_evaluation_detail_summary1', eva_create_evaluation_detail_summary1_customValidation)) {
|
||||
return;
|
||||
}
|
||||
var data = eva_create_evaluation_detail_summary1_GetFromForm();
|
||||
@@ -77,18 +76,18 @@ function eva_create_evaluation_detail_summary1_PutUpdate() {
|
||||
if (eva_create_evaluation_detail_summary1_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
//AlertSuccess(result.message);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_create_evaluation_detail_summary1_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_summary1_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
@@ -98,9 +97,9 @@ function eva_create_evaluation_detail_summary1_GoDelete(a) {
|
||||
var successFunc = function (result) {
|
||||
AlertSuccess(result.message);
|
||||
eva_create_evaluation_detail_summary1_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_summary1_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,134 +1,135 @@
|
||||
function eva_evaluation_achievement_process_ClearForm(i, blankItem) {
|
||||
var data = blankItem;
|
||||
$("#eva_evaluation_achievement_process_id_" + i).val("");
|
||||
$("#eva_evaluation_achievement_process_create_evaluation_detail_id_" + i).val("");
|
||||
$("#eva_evaluation_achievement_process_achievement_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process_weight_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process_score_" + i).val("");
|
||||
$("#eva_evaluation_achievement_process_sumary_" + i).text("");
|
||||
//$("#eva_evaluation_achievement_process_target_score1_" + i).val("");
|
||||
//$("#eva_evaluation_achievement_process_target_score2_" + i).val("");
|
||||
//$("#eva_evaluation_achievement_process_target_score3_" + i).val("");
|
||||
//$("#eva_evaluation_achievement_process_target_score4_" + i).val("");
|
||||
//$("#eva_evaluation_achievement_process_target_score5_" + i).val("");
|
||||
var data = blankItem;
|
||||
$("#eva_evaluation_achievement_process_id_" + i).val("");
|
||||
$("#eva_evaluation_achievement_process_create_evaluation_detail_id_" + i).val("");
|
||||
$("#eva_evaluation_achievement_process_achievement_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process_weight_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process_score_" + i).val("");
|
||||
$("#eva_evaluation_achievement_process_sumary_" + i).text("");
|
||||
//$("#eva_evaluation_achievement_process_target_score1_" + i).val("");
|
||||
//$("#eva_evaluation_achievement_process_target_score2_" + i).val("");
|
||||
//$("#eva_evaluation_achievement_process_target_score3_" + i).val("");
|
||||
//$("#eva_evaluation_achievement_process_target_score4_" + i).val("");
|
||||
//$("#eva_evaluation_achievement_process_target_score5_" + i).val("");
|
||||
|
||||
}
|
||||
|
||||
function eva_evaluation_achievement_process_FeedDataToForm(data, i, blankItem) {
|
||||
//console.log(data);
|
||||
$("#eva_evaluation_achievement_process_id_" + i).val(data.id);
|
||||
$("#eva_evaluation_achievement_process_create_evaluation_detail_id_" + i).val(data.create_evaluation_detail_id);
|
||||
$("#eva_evaluation_achievement_process_achievement_" + i).text(data.achievement);
|
||||
$("#eva_evaluation_achievement_process_weight_" + i).text(data.weight);
|
||||
$("#eva_evaluation_achievement_process_score_" + i).val(data.score);
|
||||
$("#eva_evaluation_achievement_process_sumary_" + i).text(data.sumary);
|
||||
//$("#eva_evaluation_achievement_process_target_score1_" + i).val(data.target_score1);
|
||||
//$("#eva_evaluation_achievement_process_target_score2_" + i).val(data.target_score2);
|
||||
//$("#eva_evaluation_achievement_process_target_score3_" + i).val(data.target_score3);
|
||||
//$("#eva_evaluation_achievement_process_target_score4_" + i).val(data.target_score4);
|
||||
//$("#eva_evaluation_achievement_process_target_score5_" + i).val(data.target_score5);
|
||||
//console.log(data);
|
||||
$("#eva_evaluation_achievement_process_id_" + i).val(data.id);
|
||||
$("#eva_evaluation_achievement_process_create_evaluation_detail_id_" + i).val(data.create_evaluation_detail_id);
|
||||
$("#eva_evaluation_achievement_process_achievement_" + i).text(data.achievement);
|
||||
$("#eva_evaluation_achievement_process_weight_" + i).text(data.weight);
|
||||
$("#eva_evaluation_achievement_process_score_" + i).val(data.score);
|
||||
$("#eva_evaluation_achievement_process_sumary_" + i).text(data.sumary);
|
||||
//$("#eva_evaluation_achievement_process_target_score1_" + i).val(data.target_score1);
|
||||
//$("#eva_evaluation_achievement_process_target_score2_" + i).val(data.target_score2);
|
||||
//$("#eva_evaluation_achievement_process_target_score3_" + i).val(data.target_score3);
|
||||
//$("#eva_evaluation_achievement_process_target_score4_" + i).val(data.target_score4);
|
||||
//$("#eva_evaluation_achievement_process_target_score5_" + i).val(data.target_score5);
|
||||
|
||||
}
|
||||
|
||||
function eva_evaluation_achievement_process_GetFromForm(obj, i) {
|
||||
var eva_evaluation_achievement_processObject = new Object();
|
||||
eva_evaluation_achievement_processObject.id = obj.find("#eva_evaluation_achievement_process_id_" + i).val();
|
||||
eva_evaluation_achievement_processObject.create_evaluation_detail_id = obj.find("#eva_evaluation_achievement_process_create_evaluation_detail_id_" + i).val();
|
||||
eva_evaluation_achievement_processObject.achievement = obj.find("#eva_evaluation_achievement_process_achievement_" + i).text();
|
||||
eva_evaluation_achievement_processObject.weight = obj.find("#eva_evaluation_achievement_process_weight_" + i).text();
|
||||
eva_evaluation_achievement_processObject.score = obj.find("#eva_evaluation_achievement_process_score_" + i).val();
|
||||
eva_evaluation_achievement_processObject.sumary = obj.find("#eva_evaluation_achievement_process_sumary_" + i).text();
|
||||
//eva_evaluation_achievement_processObject.target_score1 = obj.find("#eva_evaluation_achievement_process_target_score1_" + i).val();
|
||||
//eva_evaluation_achievement_processObject.target_score2 = obj.find("#eva_evaluation_achievement_process_target_score2_" + i).val();
|
||||
//eva_evaluation_achievement_processObject.target_score3 = obj.find("#eva_evaluation_achievement_process_target_score3_" + i).val();
|
||||
//eva_evaluation_achievement_processObject.target_score4 = obj.find("#eva_evaluation_achievement_process_target_score4_" + i).val();
|
||||
//eva_evaluation_achievement_processObject.target_score5 = obj.find("#eva_evaluation_achievement_process_target_score5_" + i).val();
|
||||
eva_evaluation_achievement_processObject.id = obj.find("#eva_evaluation_achievement_process_id_" + i).val();
|
||||
eva_evaluation_achievement_processObject.create_evaluation_detail_id = obj.find("#eva_evaluation_achievement_process_create_evaluation_detail_id_" + i).val();
|
||||
eva_evaluation_achievement_processObject.achievement = obj.find("#eva_evaluation_achievement_process_achievement_" + i).text();
|
||||
eva_evaluation_achievement_processObject.weight = obj.find("#eva_evaluation_achievement_process_weight_" + i).text();
|
||||
eva_evaluation_achievement_processObject.score = obj.find("#eva_evaluation_achievement_process_score_" + i).val();
|
||||
eva_evaluation_achievement_processObject.sumary = obj.find("#eva_evaluation_achievement_process_sumary_" + i).text();
|
||||
//eva_evaluation_achievement_processObject.target_score1 = obj.find("#eva_evaluation_achievement_process_target_score1_" + i).val();
|
||||
//eva_evaluation_achievement_processObject.target_score2 = obj.find("#eva_evaluation_achievement_process_target_score2_" + i).val();
|
||||
//eva_evaluation_achievement_processObject.target_score3 = obj.find("#eva_evaluation_achievement_process_target_score3_" + i).val();
|
||||
//eva_evaluation_achievement_processObject.target_score4 = obj.find("#eva_evaluation_achievement_process_target_score4_" + i).val();
|
||||
//eva_evaluation_achievement_processObject.target_score5 = obj.find("#eva_evaluation_achievement_process_target_score5_" + i).val();
|
||||
|
||||
eva_evaluation_achievement_processObject.active_mode = obj.find("#isActive_" + i + "_eva_evaluation_achievement_process").val();
|
||||
return eva_evaluation_achievement_processObject;
|
||||
}
|
||||
|
||||
function eva_evaluation_achievement_process_Save(id) {
|
||||
//Insert eva_evaluation_achievement_process List
|
||||
var eva_evaluation_achievement_process = [];
|
||||
//Insert eva_evaluation_achievement_process List
|
||||
var eva_evaluation_achievement_process = [];
|
||||
$('#eva_evaluation_achievement_processBody tr').each(function () {
|
||||
var i = $(this).find("#rowCount").text();
|
||||
var eacheva_evaluation_achievement_process = eva_evaluation_achievement_process_GetFromForm($(this), i);
|
||||
eva_evaluation_achievement_process.push(eacheva_evaluation_achievement_process);
|
||||
});
|
||||
var eacheva_evaluation_achievement_process = eva_evaluation_achievement_process_GetFromForm($(this), i);
|
||||
eva_evaluation_achievement_process.push(eacheva_evaluation_achievement_process);
|
||||
});
|
||||
|
||||
var successFunc = function (result) {
|
||||
//AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว");
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + '/api/eva_evaluation_achievement_process/UpdateMultiple', eva_evaluation_achievement_process, successFunc, AlertDanger);
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + '/api/eva_evaluation_achievement_process/UpdateMultiple', eva_evaluation_achievement_process, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_evaluation_achievement_process_Get(a, blankItem) {
|
||||
|
||||
$('#eva_evaluation_achievement_processBody').empty();
|
||||
$('#eva_evaluation_achievement_processBody').empty();
|
||||
|
||||
var successFunc = function (response) {
|
||||
$.each(response, function (i, data) {
|
||||
var tag = '<tr>';
|
||||
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_evaluation_achievement_process" value="1" /><input class="form-control" type="hidden" id="eva_evaluation_achievement_process_id_' + (i + 1)+'" /><input class="form-control" type="hidden" id="eva_evaluation_achievement_process_create_evaluation_detail_id_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_achievement_process_achievement_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_achievement_process_weight_' + (i + 1)+'" /></td>';
|
||||
//tag += '<td><input class="form-control" id="eva_evaluation_achievement_process_target_score1_' + (i + 1)+'"/></td>';
|
||||
//tag += '<td><input class="form-control" id="eva_evaluation_achievement_process_target_score2_' + (i + 1)+'"/></td>';
|
||||
//tag += '<td><input class="form-control" id="eva_evaluation_achievement_process_target_score3_' + (i + 1)+'"/></td>';
|
||||
//tag += '<td><input class="form-control" id="eva_evaluation_achievement_process_target_score4_' + (i + 1)+'"/></td>';
|
||||
//tag += '<td><input class="form-control" id="eva_evaluation_achievement_process_target_score5_' + (i + 1)+'"/></td>';
|
||||
tag += '<td><input class="form-control mycontrol02" type="number" min="0" max="5" step=".01" onchange="javascript:Oneva_evaluation_achievement_process_scoreChange();" id="eva_evaluation_achievement_process_score_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_achievement_process_sumary_' + (i + 1)+'" /></td>';
|
||||
var successFunc = function (response) {
|
||||
$.each(response, function (i, data) {
|
||||
var tag = '<tr>';
|
||||
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_evaluation_achievement_process" value="1" /><input class="form-control" type="hidden" id="eva_evaluation_achievement_process_id_' + (i + 1) + '" /><input class="form-control" type="hidden" id="eva_evaluation_achievement_process_create_evaluation_detail_id_' + (i + 1) + '" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_achievement_process_achievement_' + (i + 1) + '" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_achievement_process_weight_' + (i + 1) + '" /></td>';
|
||||
//tag += '<td><input class="form-control" id="eva_evaluation_achievement_process_target_score1_' + (i + 1)+'"/></td>';
|
||||
//tag += '<td><input class="form-control" id="eva_evaluation_achievement_process_target_score2_' + (i + 1)+'"/></td>';
|
||||
//tag += '<td><input class="form-control" id="eva_evaluation_achievement_process_target_score3_' + (i + 1)+'"/></td>';
|
||||
//tag += '<td><input class="form-control" id="eva_evaluation_achievement_process_target_score4_' + (i + 1)+'"/></td>';
|
||||
//tag += '<td><input class="form-control" id="eva_evaluation_achievement_process_target_score5_' + (i + 1)+'"/></td>';
|
||||
tag += '<td><input class="form-control mycontrol02 the3digit" type="number" min="0" max="5" step=".1" onchange="javascript:Oneva_evaluation_achievement_process_scoreChange();" id="eva_evaluation_achievement_process_score_' + (i + 1) + '" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_achievement_process_sumary_' + (i + 1) + '" /></td>';
|
||||
|
||||
tag += '</tr>';
|
||||
$('#eva_evaluation_achievement_processBody').append($(tag));
|
||||
eva_evaluation_achievement_process_FeedDataToForm(data, (i + 1), blankItem);
|
||||
});
|
||||
tag += '</tr>';
|
||||
$('#eva_evaluation_achievement_processBody').append($(tag));
|
||||
eva_evaluation_achievement_process_FeedDataToForm(data, (i + 1), blankItem);
|
||||
});
|
||||
eva_evaluation_achievement_process_Summary();
|
||||
Oneva_evaluation_achievement_process_scoreChange();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_evaluation_achievement_process?create_evaluation_detail_id="+a, successFunc, AlertDanger);
|
||||
//AjaxGetRequest(apisite + '/api/eva_evaluation_achievement_process/GetListBycreate_evaluation_detail_id/' + a, successFunc, AlertDanger);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_evaluation_achievement_process?create_evaluation_detail_id=" + a, successFunc, AlertDanger);
|
||||
//AjaxGetRequest(apisite + '/api/eva_evaluation_achievement_process/GetListBycreate_evaluation_detail_id/' + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function CheckValidValueachievement(){
|
||||
function CheckValidValueachievement() {
|
||||
$('#eva_evaluation_achievement_processBody tr').each(function () {
|
||||
var i = $(this).find("#rowCount").text();
|
||||
var score = $("#eva_evaluation_achievement_process_score_" + i).val();
|
||||
if(score > 5) $("#eva_evaluation_achievement_process_score_" + i).val("");
|
||||
if(score < 1) $("#eva_evaluation_achievement_process_score_" + i).val("");
|
||||
});
|
||||
if (score > 5) $("#eva_evaluation_achievement_process_score_" + i).val("");
|
||||
if (score < 1) $("#eva_evaluation_achievement_process_score_" + i).val("");
|
||||
});
|
||||
}
|
||||
|
||||
function Oneva_evaluation_achievement_process_scoreChange(){
|
||||
function Oneva_evaluation_achievement_process_scoreChange() {
|
||||
change3digit();
|
||||
CheckValidValueachievement();
|
||||
var total_achievement = 0;
|
||||
var total_achievement_weight = 0;
|
||||
var total_achievement_score = 0;
|
||||
$('#eva_evaluation_achievement_processBody tr').each(function () {
|
||||
var i = $(this).find("#rowCount").text();
|
||||
var score = $("#eva_evaluation_achievement_process_score_" + i).val();
|
||||
var score = $("#eva_evaluation_achievement_process_score_" + i).val();
|
||||
var weight = $("#eva_evaluation_achievement_process_weight_" + i).text();
|
||||
var total = (score * weight / 100).toFixed(2);
|
||||
var total = (score * weight / 100).toFixed(3);
|
||||
$("#eva_evaluation_achievement_process_sumary_" + i).text(total);
|
||||
total_achievement += parseFloat(total);
|
||||
total_achievement_weight += parseFloat(weight);
|
||||
total_achievement_score += parseFloat(score);
|
||||
});
|
||||
});
|
||||
|
||||
$("#h_eva_evaluation_achievement_process_weight").text(total_achievement_weight.toFixed(2));
|
||||
$("#h_eva_evaluation_achievement_process_score").text(total_achievement.toFixed(2));
|
||||
$("#h_eva_evaluation_achievement_process_weight").text(total_achievement_weight.toFixed(3));
|
||||
$("#h_eva_evaluation_achievement_process_score").text(total_achievement.toFixed(3));
|
||||
|
||||
var w1 = parseFloat($("#w1").text());
|
||||
|
||||
$("#eva_create_evaluation_detail_summary1_total_summary_chief").text((total_achievement * 20).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary1_Final_summary_chief").text((total_achievement * 20).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary1_achievement_chief").text(((total_achievement * 20) * w1/100).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary1_total_summary_chief").text((total_achievement * 20).toFixed(3));
|
||||
$("#eva_create_evaluation_detail_summary1_Final_summary_chief").text((total_achievement * 20).toFixed(3));
|
||||
$("#eva_create_evaluation_detail_summary1_achievement_chief").text(((total_achievement * 20) * w1 / 100).toFixed(3));
|
||||
|
||||
calculationAllItem();
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ function eva_evaluation_achievement_process2_Get(a, blankItem, role_code) {
|
||||
//tag += '<td><input class="form-control" id="eva_evaluation_achievement_process2_target_score5_' + (i + 1)+'"/></td>';
|
||||
tag += '<td><p id="eva_evaluation_achievement_process2_score_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_achievement_process2_sumary_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><input class="myeditor form-control" type="number" min="0" max="5" step=".01" onchange="javascript:Oneva_evaluation_achievement_process2_scoreChange();" id="eva_evaluation_achievement_process2_score2_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><input class="myeditor form-control the3digit" type="number" min="0" max="5" step=".1" onchange="javascript:Oneva_evaluation_achievement_process2_scoreChange();" id="eva_evaluation_achievement_process2_score2_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_achievement_process2_sumary2_' + (i + 1)+'" /></td>';
|
||||
tag += '</tr>';
|
||||
$('#eva_evaluation_achievement_process2Body').append($(tag));
|
||||
@@ -135,7 +135,8 @@ function CheckValidValueachievement(){
|
||||
});
|
||||
}
|
||||
|
||||
function Oneva_evaluation_achievement_process2_scoreChange(){
|
||||
function Oneva_evaluation_achievement_process2_scoreChange() {
|
||||
change3digit();
|
||||
CheckValidValueachievement();
|
||||
var total_achievement = 0;
|
||||
var total_achievement_weight = 0;
|
||||
@@ -147,9 +148,9 @@ function Oneva_evaluation_achievement_process2_scoreChange(){
|
||||
var score_old = $("#eva_evaluation_achievement_process2_score_" + i).text();
|
||||
var score = $("#eva_evaluation_achievement_process2_score2_" + i).val();
|
||||
var weight = $("#eva_evaluation_achievement_process2_weight_" + i).text();
|
||||
var total = (score * weight / 100).toFixed(2);
|
||||
var total = (score * weight / 100).toFixed(3);
|
||||
$("#eva_evaluation_achievement_process2_sumary2_" + i).text(total);
|
||||
var total_old = (score_old * weight / 100).toFixed(2);
|
||||
var total_old = (score_old * weight / 100).toFixed(3);
|
||||
$("#eva_evaluation_achievement_process2_sumary_" + i).text(total_old);
|
||||
total_achievement += parseFloat(total);
|
||||
total_achievement_weight += parseFloat(weight);
|
||||
@@ -158,16 +159,16 @@ function Oneva_evaluation_achievement_process2_scoreChange(){
|
||||
total_achievement_old += parseFloat(total_old);
|
||||
//console.log(score_old);
|
||||
});
|
||||
$("#h_eva_evaluation_achievement_process2_weight").text(total_achievement_weight.toFixed(2));
|
||||
$("#h_eva_evaluation_achievement_process2_score2").text(total_achievement.toFixed(2));
|
||||
$("#h_eva_evaluation_achievement_process2_score").text(total_achievement_old.toFixed(2));
|
||||
$("#h_eva_evaluation_achievement_process2_weight").text(total_achievement_weight.toFixed(3));
|
||||
$("#h_eva_evaluation_achievement_process2_score2").text(total_achievement.toFixed(3));
|
||||
$("#h_eva_evaluation_achievement_process2_score").text(total_achievement_old.toFixed(3));
|
||||
|
||||
var w1 = parseFloat($("#w1").text());
|
||||
|
||||
$("#x1").text((total_achievement_old*20).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary2_total_summary_supervisor").text((total_achievement*20).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary2_Final_summary_supervisor").text((total_achievement*20).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary2_achievement_supervisor").text(((total_achievement*20)*w1/100).toFixed(2));
|
||||
$("#x1").text((total_achievement_old*20).toFixed(3));
|
||||
$("#eva_create_evaluation_detail_summary2_total_summary_supervisor").text((total_achievement*20).toFixed(3));
|
||||
$("#eva_create_evaluation_detail_summary2_Final_summary_supervisor").text((total_achievement*20).toFixed(3));
|
||||
$("#eva_create_evaluation_detail_summary2_achievement_supervisor").text(((total_achievement*20)*w1/100).toFixed(3));
|
||||
|
||||
calculationAllItem();
|
||||
}
|
||||
|
||||
@@ -1,140 +1,141 @@
|
||||
function eva_evaluation_behavior_process_ClearForm(i, blankItem) {
|
||||
var data = blankItem;
|
||||
$("#eva_evaluation_behavior_process_id_" + i).val("");
|
||||
$("#eva_evaluation_behavior_process_create_evaluation_detail_id_" + i).val("");
|
||||
$("#eva_evaluation_behavior_process_behavior_" + i).text("");
|
||||
$("#eva_evaluation_behavior_process_weight_" + i).text("");
|
||||
$("#eva_evaluation_behavior_process_score_" + i).val("");
|
||||
$("#eva_evaluation_behavior_process_sumary_" + i).text("");
|
||||
//$("#eva_evaluation_behavior_process_target_score1_" + i).val("");
|
||||
//$("#eva_evaluation_behavior_process_target_score2_" + i).val("");
|
||||
//$("#eva_evaluation_behavior_process_target_score3_" + i).val("");
|
||||
//$("#eva_evaluation_behavior_process_target_score4_" + i).val("");
|
||||
//$("#eva_evaluation_behavior_process_target_score5_" + i).val("");
|
||||
var data = blankItem;
|
||||
$("#eva_evaluation_behavior_process_id_" + i).val("");
|
||||
$("#eva_evaluation_behavior_process_create_evaluation_detail_id_" + i).val("");
|
||||
$("#eva_evaluation_behavior_process_behavior_" + i).text("");
|
||||
$("#eva_evaluation_behavior_process_weight_" + i).text("");
|
||||
$("#eva_evaluation_behavior_process_score_" + i).val("");
|
||||
$("#eva_evaluation_behavior_process_sumary_" + i).text("");
|
||||
//$("#eva_evaluation_behavior_process_target_score1_" + i).val("");
|
||||
//$("#eva_evaluation_behavior_process_target_score2_" + i).val("");
|
||||
//$("#eva_evaluation_behavior_process_target_score3_" + i).val("");
|
||||
//$("#eva_evaluation_behavior_process_target_score4_" + i).val("");
|
||||
//$("#eva_evaluation_behavior_process_target_score5_" + i).val("");
|
||||
|
||||
}
|
||||
|
||||
function eva_evaluation_behavior_process_FeedDataToForm(data, i, blankItem) {
|
||||
$("#eva_evaluation_behavior_process_id_" + i).val(data.id);
|
||||
$("#eva_evaluation_behavior_process_create_evaluation_detail_id_" + i).val(data.create_evaluation_detail_id);
|
||||
$("#eva_evaluation_behavior_process_behavior_" + i).text(data.behavior);
|
||||
$("#eva_evaluation_behavior_process_weight_" + i).text(data.weight);
|
||||
$("#eva_evaluation_behavior_process_score_" + i).val(data.score);
|
||||
$("#eva_evaluation_behavior_process_sumary_" + i).text(data.sumary);
|
||||
//$("#eva_evaluation_behavior_process_target_score1_" + i).val(data.target_score1);
|
||||
//$("#eva_evaluation_behavior_process_target_score2_" + i).val(data.target_score2);
|
||||
//$("#eva_evaluation_behavior_process_target_score3_" + i).val(data.target_score3);
|
||||
//$("#eva_evaluation_behavior_process_target_score4_" + i).val(data.target_score4);
|
||||
//$("#eva_evaluation_behavior_process_target_score5_" + i).val(data.target_score5);
|
||||
$("#eva_evaluation_behavior_process_id_" + i).val(data.id);
|
||||
$("#eva_evaluation_behavior_process_create_evaluation_detail_id_" + i).val(data.create_evaluation_detail_id);
|
||||
$("#eva_evaluation_behavior_process_behavior_" + i).text(data.behavior);
|
||||
$("#eva_evaluation_behavior_process_weight_" + i).text(data.weight);
|
||||
$("#eva_evaluation_behavior_process_score_" + i).val(data.score);
|
||||
$("#eva_evaluation_behavior_process_sumary_" + i).text(data.sumary);
|
||||
//$("#eva_evaluation_behavior_process_target_score1_" + i).val(data.target_score1);
|
||||
//$("#eva_evaluation_behavior_process_target_score2_" + i).val(data.target_score2);
|
||||
//$("#eva_evaluation_behavior_process_target_score3_" + i).val(data.target_score3);
|
||||
//$("#eva_evaluation_behavior_process_target_score4_" + i).val(data.target_score4);
|
||||
//$("#eva_evaluation_behavior_process_target_score5_" + i).val(data.target_score5);
|
||||
|
||||
}
|
||||
|
||||
function eva_evaluation_behavior_process_GetFromForm(obj, i) {
|
||||
var eva_evaluation_behavior_processObject = new Object();
|
||||
eva_evaluation_behavior_processObject.id = obj.find("#eva_evaluation_behavior_process_id_" + i).val();
|
||||
eva_evaluation_behavior_processObject.create_evaluation_detail_id = obj.find("#eva_evaluation_behavior_process_create_evaluation_detail_id_" + i).val();
|
||||
eva_evaluation_behavior_processObject.behavior = obj.find("#eva_evaluation_behavior_process_behavior_" + i).text();
|
||||
eva_evaluation_behavior_processObject.weight = obj.find("#eva_evaluation_behavior_process_weight_" + i).text();
|
||||
eva_evaluation_behavior_processObject.score = obj.find("#eva_evaluation_behavior_process_score_" + i).val();
|
||||
eva_evaluation_behavior_processObject.sumary = obj.find("#eva_evaluation_behavior_process_sumary_" + i).text();
|
||||
//eva_evaluation_behavior_processObject.target_score1 = obj.find("#eva_evaluation_behavior_process_target_score1_" + i).val();
|
||||
//eva_evaluation_behavior_processObject.target_score2 = obj.find("#eva_evaluation_behavior_process_target_score2_" + i).val();
|
||||
//eva_evaluation_behavior_processObject.target_score3 = obj.find("#eva_evaluation_behavior_process_target_score3_" + i).val();
|
||||
//eva_evaluation_behavior_processObject.target_score4 = obj.find("#eva_evaluation_behavior_process_target_score4_" + i).val();
|
||||
//eva_evaluation_behavior_processObject.target_score5 = obj.find("#eva_evaluation_behavior_process_target_score5_" + i).val();
|
||||
eva_evaluation_behavior_processObject.id = obj.find("#eva_evaluation_behavior_process_id_" + i).val();
|
||||
eva_evaluation_behavior_processObject.create_evaluation_detail_id = obj.find("#eva_evaluation_behavior_process_create_evaluation_detail_id_" + i).val();
|
||||
eva_evaluation_behavior_processObject.behavior = obj.find("#eva_evaluation_behavior_process_behavior_" + i).text();
|
||||
eva_evaluation_behavior_processObject.weight = obj.find("#eva_evaluation_behavior_process_weight_" + i).text();
|
||||
eva_evaluation_behavior_processObject.score = obj.find("#eva_evaluation_behavior_process_score_" + i).val();
|
||||
eva_evaluation_behavior_processObject.sumary = obj.find("#eva_evaluation_behavior_process_sumary_" + i).text();
|
||||
//eva_evaluation_behavior_processObject.target_score1 = obj.find("#eva_evaluation_behavior_process_target_score1_" + i).val();
|
||||
//eva_evaluation_behavior_processObject.target_score2 = obj.find("#eva_evaluation_behavior_process_target_score2_" + i).val();
|
||||
//eva_evaluation_behavior_processObject.target_score3 = obj.find("#eva_evaluation_behavior_process_target_score3_" + i).val();
|
||||
//eva_evaluation_behavior_processObject.target_score4 = obj.find("#eva_evaluation_behavior_process_target_score4_" + i).val();
|
||||
//eva_evaluation_behavior_processObject.target_score5 = obj.find("#eva_evaluation_behavior_process_target_score5_" + i).val();
|
||||
|
||||
eva_evaluation_behavior_processObject.active_mode = obj.find("#isActive_" + i + "_eva_evaluation_behavior_process").val();
|
||||
return eva_evaluation_behavior_processObject;
|
||||
}
|
||||
|
||||
function eva_evaluation_behavior_process_Save(id) {
|
||||
//Insert eva_evaluation_behavior_process List
|
||||
var eva_evaluation_behavior_process = [];
|
||||
//Insert eva_evaluation_behavior_process List
|
||||
var eva_evaluation_behavior_process = [];
|
||||
$('#eva_evaluation_behavior_processBody tr').each(function () {
|
||||
var i = $(this).find("#rowCount").text();
|
||||
var eacheva_evaluation_behavior_process = eva_evaluation_behavior_process_GetFromForm($(this), i);
|
||||
eva_evaluation_behavior_process.push(eacheva_evaluation_behavior_process);
|
||||
});
|
||||
var eacheva_evaluation_behavior_process = eva_evaluation_behavior_process_GetFromForm($(this), i);
|
||||
eva_evaluation_behavior_process.push(eacheva_evaluation_behavior_process);
|
||||
});
|
||||
|
||||
var successFunc = function (result) {
|
||||
//AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว");
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + '/api/eva_evaluation_behavior_process/UpdateMultiple', eva_evaluation_behavior_process, successFunc, AlertDanger);
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + '/api/eva_evaluation_behavior_process/UpdateMultiple', eva_evaluation_behavior_process, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_evaluation_behavior_process_Get(a, blankItem) {
|
||||
|
||||
$('#eva_evaluation_behavior_processBody').empty();
|
||||
$('#eva_evaluation_behavior_processBody').empty();
|
||||
|
||||
var successFunc = function (response) {
|
||||
//console.log(response);
|
||||
$.each(response, function (i, data) {
|
||||
var tag = '<tr>';
|
||||
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_evaluation_behavior_process" value="1" /><input class="form-control" type="hidden" id="eva_evaluation_behavior_process_id_' + (i + 1)+'" /><input class="form-control" type="hidden" id="eva_evaluation_behavior_process_create_evaluation_detail_id_' + (i + 1)+'" /></td>';
|
||||
var successFunc = function (response) {
|
||||
//console.log(response);
|
||||
$.each(response, function (i, data) {
|
||||
var tag = '<tr>';
|
||||
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_evaluation_behavior_process" value="1" /><input class="form-control" type="hidden" id="eva_evaluation_behavior_process_id_' + (i + 1) + '" /><input class="form-control" type="hidden" id="eva_evaluation_behavior_process_create_evaluation_detail_id_' + (i + 1) + '" /></td>';
|
||||
|
||||
tag += '<td><p id="eva_evaluation_behavior_process_behavior_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process_weight_' + (i + 1)+'" /></td>';
|
||||
//tag += '<td><input class="form-control" type="text" id="eva_evaluation_behavior_process_target_score1_' + (i + 1)+'"></p></td>';
|
||||
//tag += '<td><input class="form-control" type="text" id="eva_evaluation_behavior_process_target_score2_' + (i + 1)+'"></p></td>';
|
||||
// tag += '<td><input class="form-control" type="text" id="eva_evaluation_behavior_process_target_score3_' + (i + 1)+'"></p></td>';
|
||||
//tag += '<td><input class="form-control" type="text" id="eva_evaluation_behavior_process_target_score4_' + (i + 1)+'"></p></td>';
|
||||
// tag += '<td><input class="form-control" type="text" id="eva_evaluation_behavior_process_target_score5_' + (i + 1)+'"></p></td>';
|
||||
tag += '<td><input min="0" max="5" step=".01" onchange="Oneva_evaluation_behavior_process_scoreChange()" class="form-control mycontrol02" type="number" id="eva_evaluation_behavior_process_score_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process_sumary_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process_behavior_' + (i + 1) + '" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process_weight_' + (i + 1) + '" /></td>';
|
||||
//tag += '<td><input class="form-control" type="text" id="eva_evaluation_behavior_process_target_score1_' + (i + 1)+'"></p></td>';
|
||||
//tag += '<td><input class="form-control" type="text" id="eva_evaluation_behavior_process_target_score2_' + (i + 1)+'"></p></td>';
|
||||
// tag += '<td><input class="form-control" type="text" id="eva_evaluation_behavior_process_target_score3_' + (i + 1)+'"></p></td>';
|
||||
//tag += '<td><input class="form-control" type="text" id="eva_evaluation_behavior_process_target_score4_' + (i + 1)+'"></p></td>';
|
||||
// tag += '<td><input class="form-control" type="text" id="eva_evaluation_behavior_process_target_score5_' + (i + 1)+'"></p></td>';
|
||||
tag += '<td><input min="0" max="5" step=".1" onchange="Oneva_evaluation_behavior_process_scoreChange()" class="form-control mycontrol02 the3digit" type="number" id="eva_evaluation_behavior_process_score_' + (i + 1) + '" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process_sumary_' + (i + 1) + '" /></td>';
|
||||
|
||||
tag += '</tr>';
|
||||
$('#eva_evaluation_behavior_processBody').append($(tag));
|
||||
eva_evaluation_behavior_process_FeedDataToForm(data, (i + 1), blankItem);
|
||||
});
|
||||
tag += '</tr>';
|
||||
$('#eva_evaluation_behavior_processBody').append($(tag));
|
||||
eva_evaluation_behavior_process_FeedDataToForm(data, (i + 1), blankItem);
|
||||
});
|
||||
eva_evaluation_behavior_process_Summary();
|
||||
Oneva_evaluation_behavior_process_scoreChange();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_evaluation_behavior_process?create_evaluation_detail_id="+a, successFunc, AlertDanger);
|
||||
//AjaxGetRequest(apisite + '/api/eva_evaluation_behavior_process/GetListBycreate_evaluation_detail_id/' + a, successFunc, AlertDanger);
|
||||
//AjaxGetRequest(apisite + '/api/eva_evaluation_behavior_process/GetListByscore/' + a, successFunc, AlertDanger);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_evaluation_behavior_process?create_evaluation_detail_id=" + a, successFunc, AlertDanger);
|
||||
//AjaxGetRequest(apisite + '/api/eva_evaluation_behavior_process/GetListBycreate_evaluation_detail_id/' + a, successFunc, AlertDanger);
|
||||
//AjaxGetRequest(apisite + '/api/eva_evaluation_behavior_process/GetListByscore/' + a, successFunc, AlertDanger);
|
||||
|
||||
}
|
||||
|
||||
function CheckValidValuebehavior(){
|
||||
function CheckValidValuebehavior() {
|
||||
$('#eva_evaluation_behavior_processBody tr').each(function () {
|
||||
var i = $(this).find("#rowCount").text();
|
||||
var score = $("#eva_evaluation_behavior_process_score_" + i).val();
|
||||
if(score > 5) $("#eva_evaluation_behavior_process_score_" + i).val("");
|
||||
if(score < 1) $("#eva_evaluation_behavior_process_score_" + i).val("");
|
||||
});
|
||||
if (score > 5) $("#eva_evaluation_behavior_process_score_" + i).val("");
|
||||
if (score < 1) $("#eva_evaluation_behavior_process_score_" + i).val("");
|
||||
});
|
||||
}
|
||||
|
||||
function Oneva_evaluation_behavior_process_scoreChange(){
|
||||
function Oneva_evaluation_behavior_process_scoreChange() {
|
||||
change3digit();
|
||||
CheckValidValuebehavior();
|
||||
var total_behavior = 0;
|
||||
var total_behavior_weight = 0;
|
||||
var total_behavior_score = 0;
|
||||
$('#eva_evaluation_behavior_processBody tr').each(function () {
|
||||
var i = $(this).find("#rowCount").text();
|
||||
var score = $("#eva_evaluation_behavior_process_score_" + i).val();
|
||||
var score = $("#eva_evaluation_behavior_process_score_" + i).val();
|
||||
var weight = $("#eva_evaluation_behavior_process_weight_" + i).text();
|
||||
var total = (score * weight / 100).toFixed(2);
|
||||
var total = (score * weight / 100).toFixed(3);
|
||||
$("#eva_evaluation_behavior_process_sumary_" + i).text(total);
|
||||
total_behavior += parseFloat(total);
|
||||
total_behavior_weight += parseFloat(weight);
|
||||
total_behavior_score += parseFloat(score);
|
||||
console.log(score);
|
||||
});
|
||||
|
||||
$("#h_eva_evaluation_behavior_process_weight").text(total_behavior_weight.toFixed(2));
|
||||
$("#h_eva_evaluation_behavior_process_score").text(total_behavior.toFixed(2));
|
||||
//console.log(score);
|
||||
});
|
||||
|
||||
$("#h_eva_evaluation_behavior_process_weight").text(total_behavior_weight.toFixed(3));
|
||||
$("#h_eva_evaluation_behavior_process_score").text(total_behavior.toFixed(3));
|
||||
|
||||
var w2 = parseFloat($("#w2").text());
|
||||
|
||||
$("#eva_create_evaluation_detail_summary1_total_summary_competency_chief").text((total_behavior * 20).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary1_Final_summary_competency_chief").text((total_behavior * 20).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary1_competency_chief").text(((total_behavior*20)*w2/100).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary1_total_summary_competency_chief").text((total_behavior * 20).toFixed(3));
|
||||
$("#eva_create_evaluation_detail_summary1_Final_summary_competency_chief").text((total_behavior * 20).toFixed(3));
|
||||
$("#eva_create_evaluation_detail_summary1_competency_chief").text(((total_behavior * 20) * w2 / 100).toFixed(3));
|
||||
|
||||
calculationAllItem();
|
||||
calculationAllItem();
|
||||
}
|
||||
|
||||
function eva_evaluation_behavior_process_Summary() {
|
||||
|
||||
@@ -112,7 +112,7 @@ function eva_evaluation_behavior_process2_Get(a, blankItem, role_code) {
|
||||
//tag += '<td><input type="text" class="form-control" id="eva_evaluation_behavior_process2_target_score5_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process2_score_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process2_sumary_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><input min="0" max="5" step=".01" onchange="Oneva_evaluation_behavior_process2_scoreChange()" class="form-control myeditor" type="number" id="eva_evaluation_behavior_process2_score2_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><input min="0" max="5" step=".1" onchange="Oneva_evaluation_behavior_process2_scoreChange()" class="form-control myeditor the3digit" type="number" id="eva_evaluation_behavior_process2_score2_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process2_sumary2_' + (i + 1)+'" /></td>';
|
||||
|
||||
tag += '</tr>';
|
||||
@@ -138,7 +138,8 @@ function CheckValidValuebehavior(){
|
||||
});
|
||||
}
|
||||
|
||||
function Oneva_evaluation_behavior_process2_scoreChange(){
|
||||
function Oneva_evaluation_behavior_process2_scoreChange() {
|
||||
change3digit();
|
||||
CheckValidValuebehavior();
|
||||
var total_behavior = 0;
|
||||
var total_behavior_weight = 0;
|
||||
@@ -150,8 +151,8 @@ function Oneva_evaluation_behavior_process2_scoreChange(){
|
||||
var score = $("#eva_evaluation_behavior_process2_score2_" + i).val();
|
||||
var score_old = $("#eva_evaluation_behavior_process2_score_" + i).text();
|
||||
var weight = $("#eva_evaluation_behavior_process2_weight_" + i).val();
|
||||
var total = (score * weight / 100).toFixed(2);
|
||||
var total_old = (score_old * weight / 100).toFixed(2);
|
||||
var total = (score * weight / 100).toFixed(3);
|
||||
var total_old = (score_old * weight / 100).toFixed(3);
|
||||
$("#eva_evaluation_behavior_process2_sumary2_" + i).text(total);
|
||||
total_behavior += parseFloat(total);
|
||||
total_behavior_weight += parseFloat(weight);
|
||||
@@ -159,16 +160,16 @@ function Oneva_evaluation_behavior_process2_scoreChange(){
|
||||
total_behavior_score_old += parseFloat(score_old);
|
||||
total_behavior_old += parseFloat(total_old);
|
||||
});
|
||||
$("#h_eva_evaluation_behavior_process2_weight").text(total_behavior_weight.toFixed(2));
|
||||
$("#h_eva_evaluation_behavior_process2_score2").text(total_behavior.toFixed(2));
|
||||
$("#h_eva_evaluation_behavior_process2_score").text(total_behavior_old.toFixed(2));
|
||||
$("#h_eva_evaluation_behavior_process2_weight").text(total_behavior_weight.toFixed(3));
|
||||
$("#h_eva_evaluation_behavior_process2_score2").text(total_behavior.toFixed(3));
|
||||
$("#h_eva_evaluation_behavior_process2_score").text(total_behavior_old.toFixed(3));
|
||||
|
||||
var w2 = parseFloat($("#w2").text());
|
||||
|
||||
$("#x2").text((total_behavior_old*20).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary2_total_summary_competency_supervisor").text((total_behavior*20).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary2_Final_summary_competency_supervisor").text((total_behavior*20).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary2_competency_supervisor").text(((total_behavior*20)*w2/100).toFixed(2));
|
||||
$("#x2").text((total_behavior_old*20).toFixed(3));
|
||||
$("#eva_create_evaluation_detail_summary2_total_summary_competency_supervisor").text((total_behavior*20).toFixed(3));
|
||||
$("#eva_create_evaluation_detail_summary2_Final_summary_competency_supervisor").text((total_behavior*20).toFixed(3));
|
||||
$("#eva_create_evaluation_detail_summary2_competency_supervisor").text(((total_behavior*20)*w2/100).toFixed(3));
|
||||
|
||||
calculationAllItem();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user