diff --git a/wwwroot/js/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02_inline.js b/wwwroot/js/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02_inline.js index 23acccb..f19d41c 100644 --- a/wwwroot/js/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02_inline.js +++ b/wwwroot/js/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02_inline.js @@ -25,6 +25,11 @@ } function eva_adjust_postponement_detail_normal_02_FeedDataToForm(data, i, blankItem) { + var digits_position = 3; + data.achievement = Number(data.achievement).toFixed(digits_position); + data.competency = Number(data.competency).toFixed(digits_position); + data.total_score = Number(data.total_score).toFixed(digits_position); + $("#eva_adjust_postponement_detail_normal_02_id_" + i).val(data.id); $("#eva_adjust_postponement_detail_normal_02_adjust_postponement_id_" + i).val(data.adjust_postponement_id); $("#eva_adjust_postponement_detail_normal_02_employee_id_" + i).val(data.employee_id); @@ -54,12 +59,12 @@ function eva_adjust_postponement_detail_normal_02_GetFromForm(obj, i) { eva_adjust_postponement_detail_normal_02Object.id = obj.find("#eva_adjust_postponement_detail_normal_02_id_" + i).val(); eva_adjust_postponement_detail_normal_02Object.adjust_postponement_id = obj.find("#eva_adjust_postponement_detail_normal_02_adjust_postponement_id_" + i).val(); eva_adjust_postponement_detail_normal_02Object.employee_id = obj.find("#eva_adjust_postponement_detail_normal_02_employee_id_" + i).val(); - eva_adjust_postponement_detail_normal_02Object.sarary = obj.find("#eva_adjust_postponement_detail_normal_02_sarary_" + i).text().replace(/[,-]/g,''); - eva_adjust_postponement_detail_normal_02Object.cost_living = obj.find("#eva_adjust_postponement_detail_normal_02_cost_living_" + i).text().replace(/[,-]/g,''); - eva_adjust_postponement_detail_normal_02Object.middle = obj.find("#eva_adjust_postponement_detail_normal_02_middle_" + i).text().replace(/[,-]/g,''); + eva_adjust_postponement_detail_normal_02Object.sarary = obj.find("#eva_adjust_postponement_detail_normal_02_sarary_" + i).text().replace(/[,-]/g, ''); + eva_adjust_postponement_detail_normal_02Object.cost_living = obj.find("#eva_adjust_postponement_detail_normal_02_cost_living_" + i).text().replace(/[,-]/g, ''); + eva_adjust_postponement_detail_normal_02Object.middle = obj.find("#eva_adjust_postponement_detail_normal_02_middle_" + i).text().replace(/[,-]/g, ''); eva_adjust_postponement_detail_normal_02Object.promoted_percentage = obj.find("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(); eva_adjust_postponement_detail_normal_02Object.total_promote = obj.find("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val(); - eva_adjust_postponement_detail_normal_02Object.new_sarary = obj.find("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text().replace(/[,-]/g,''); + eva_adjust_postponement_detail_normal_02Object.new_sarary = obj.find("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text().replace(/[,-]/g, ''); eva_adjust_postponement_detail_normal_02Object.new_cost_living = obj.find("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text(); eva_adjust_postponement_detail_normal_02Object.remark = obj.find("#eva_adjust_postponement_detail_normal_02_remark_" + i).text(); eva_adjust_postponement_detail_normal_02Object.emp_code = obj.find("#eva_adjust_postponement_detail_normal_02_emp_code_" + i).text(); @@ -131,7 +136,7 @@ function eva_adjust_postponement_detail_normal_02_Get(a, blankItem) { tag += '

'; tag += ''; - if(data.position_allowance > 0){ + if (data.position_allowance > 0) { tag += ''; tag += ''; tag += ''; @@ -140,18 +145,18 @@ function eva_adjust_postponement_detail_normal_02_Get(a, blankItem) { tag += ''; tag += ''; tag += ''; - tag += ''+formatNumber(data.position_allowance)+''; + tag += '' + formatNumber(data.position_allowance) + ''; tag += ''; tag += ''; tag += ''; tag += ''; - tag += ''+formatNumber(data.position_allowance)+''; + tag += '' + formatNumber(data.position_allowance) + ''; tag += ''; tag += ''; tag += ''; } - if(data.other_money > 0){ + if (data.other_money > 0) { tag += ''; tag += ''; tag += ''; @@ -160,12 +165,12 @@ function eva_adjust_postponement_detail_normal_02_Get(a, blankItem) { tag += ''; tag += ''; tag += ''; - tag += ''+formatNumber(data.other_money)+''; + tag += '' + formatNumber(data.other_money) + ''; tag += ''; tag += ''; tag += ''; tag += ''; - tag += ''+formatNumber(data.other_money)+''; + tag += '' + formatNumber(data.other_money) + ''; tag += ''; tag += ''; tag += ''; @@ -202,4 +207,4 @@ function eva_adjust_postponement_detail_normal_02_InitialForm(id) { }; startLoad(); AjaxGetRequest(apisite + "/api/eva_adjust_postponement_detail_normal_02/" + "GetBlankItem", successFunc, AlertDanger); -} +} \ No newline at end of file diff --git a/wwwroot/js/eva_evaluation_achievement_process/eva_evaluation_achievement_process_inline.js b/wwwroot/js/eva_evaluation_achievement_process/eva_evaluation_achievement_process_inline.js index 9712ad3..4a8243b 100644 --- a/wwwroot/js/eva_evaluation_achievement_process/eva_evaluation_achievement_process_inline.js +++ b/wwwroot/js/eva_evaluation_achievement_process/eva_evaluation_achievement_process_inline.js @@ -15,13 +15,16 @@ } function eva_evaluation_achievement_process_FeedDataToForm(data, i, blankItem) { - //console.log(data); + // console.log(data); + data.score = Number(data.score).toFixed(3); + data.sumary = Number(data.sumary).toFixed(3); + $("#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.toFixed(3)); - $("#eva_evaluation_achievement_process_sumary_" + i).text(data.sumary.toFixed(3)); + $("#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); @@ -151,4 +154,4 @@ function eva_evaluation_achievement_process_InitialForm(id) { }; startLoad(); AjaxGetRequest(apisite + "/api/eva_evaluation_achievement_process/" + "GetBlankItem", successFunc, AlertDanger); -} +} \ No newline at end of file diff --git a/wwwroot/js/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2_inline.js b/wwwroot/js/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2_inline.js index 5093eb7..a462451 100644 --- a/wwwroot/js/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2_inline.js +++ b/wwwroot/js/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2_inline.js @@ -22,23 +22,35 @@ function eva_evaluation_achievement_process2_FeedDataToForm(data, i, blankItem, $("#eva_evaluation_achievement_process2_achievement_" + i).text(data.achievement); $("#eva_evaluation_achievement_process2_weight_" + i).text(data.weight); - //console.log(data); + data.score = Number(data.score).toFixed(3); + data.sumary = Number(data.sumary).toFixed(3); + + data.score2 = Number(data.score2).toFixed(3); + data.sumary2 = Number(data.sumary2).toFixed(3); + + data.score3 = Number(data.score3).toFixed(3); + data.sumary3 = Number(data.sumary3).toFixed(3); + + data.score4 = Number(data.score4).toFixed(3); + data.sumary4 = Number(data.sumary4).toFixed(3); + + // console.log(data); if (role_code === "2") { - $("#eva_evaluation_achievement_process2_score_" + i).text(data.score.toFixed(3)); - $("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary.toFixed(3)); - $("#eva_evaluation_achievement_process2_score2_" + i).val(data.score2.toFixed(3)); - $("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary2.toFixed(3)); + $("#eva_evaluation_achievement_process2_score_" + i).text(data.score); + $("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary); + $("#eva_evaluation_achievement_process2_score2_" + i).val(data.score2); + $("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary2); } else if (role_code === "3") { - $("#eva_evaluation_achievement_process2_score_" + i).text(data.score2.toFixed(3)); - $("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary2.toFixed(3)); - $("#eva_evaluation_achievement_process2_score2_" + i).val(data.score3.toFixed(3)); - $("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary3.toFixed(3)); + $("#eva_evaluation_achievement_process2_score_" + i).text(data.score2); + $("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary2); + $("#eva_evaluation_achievement_process2_score2_" + i).val(data.score3); + $("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary3); } else if (role_code === "4") { - $("#eva_evaluation_achievement_process2_score_" + i).text(data.score3.toFixed(3)); - $("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary3.toFixed(3)); - $("#eva_evaluation_achievement_process2_score2_" + i).val(data.score4.toFixed(3)); - $("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary4.toFixed(3)); + $("#eva_evaluation_achievement_process2_score_" + i).text(data.score3); + $("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary3); + $("#eva_evaluation_achievement_process2_score2_" + i).val(data.score4); + $("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary4); } //$("#eva_evaluation_achievement_process2_target_score1_" + i).val(data.target_score1); diff --git a/wwwroot/js/eva_evaluation_behavior_process/eva_evaluation_behavior_process_inline.js b/wwwroot/js/eva_evaluation_behavior_process/eva_evaluation_behavior_process_inline.js index bf7026b..5fecbf8 100644 --- a/wwwroot/js/eva_evaluation_behavior_process/eva_evaluation_behavior_process_inline.js +++ b/wwwroot/js/eva_evaluation_behavior_process/eva_evaluation_behavior_process_inline.js @@ -15,12 +15,16 @@ } function eva_evaluation_behavior_process_FeedDataToForm(data, i, blankItem) { + // console.log(data); + data.score = Number(data.score).toFixed(3); + data.sumary = Number(data.sumary).toFixed(3); + $("#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.toFixed(3)); - $("#eva_evaluation_behavior_process_sumary_" + i).text(data.sumary.toFixed(3)); + $("#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); @@ -153,4 +157,4 @@ function eva_evaluation_behavior_process_InitialForm(id) { }; startLoad(); AjaxGetRequest(apisite + "/api/eva_evaluation_behavior_process/" + "GetBlankItem", successFunc, AlertDanger); -} +} \ No newline at end of file diff --git a/wwwroot/js/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2_inline.js b/wwwroot/js/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2_inline.js index 5edbda6..8d7ece3 100644 --- a/wwwroot/js/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2_inline.js +++ b/wwwroot/js/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2_inline.js @@ -1,5 +1,5 @@ function eva_evaluation_behavior_process2_ClearForm(i, blankItem) { - var data = blankItem; + var data = blankItem; $("#eva_evaluation_behavior_process2_id_" + i).val(""); $("#eva_evaluation_behavior_process2_create_evaluation_detail_id_" + i).val(""); $("#eva_evaluation_behavior_process2_behavior_" + i).text(""); @@ -20,23 +20,35 @@ function eva_evaluation_behavior_process2_FeedDataToForm(data, i, blankItem, rol $("#eva_evaluation_behavior_process2_behavior_" + i).text(data.behavior); $("#eva_evaluation_behavior_process2_weight_" + i).val(data.weight); - if(role_code === "2"){ - $("#eva_evaluation_behavior_process2_score_" + i).text(data.score.toFixed(3)); - $("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary.toFixed(3)); - $("#eva_evaluation_behavior_process2_score2_" + i).val(data.score2.toFixed(3)); - $("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary2.toFixed(3)); - } - else if(role_code === "3"){ - $("#eva_evaluation_behavior_process2_score_" + i).text(data.score2.toFixed(3)); - $("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary2.toFixed(3)); - $("#eva_evaluation_behavior_process2_score2_" + i).val(data.score3.toFixed(3)); - $("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary3.toFixed(3)); - } - else if(role_code === "4"){ - $("#eva_evaluation_behavior_process2_score_" + i).text(data.score3.toFixed(3)); - $("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary3.toFixed(3)); - $("#eva_evaluation_behavior_process2_score2_" + i).val(data.score4.toFixed(3)); - $("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary4.toFixed(3)); + data.score = Number(data.score).toFixed(3); + data.sumary = Number(data.sumary).toFixed(3); + + data.score2 = Number(data.score2).toFixed(3); + data.sumary2 = Number(data.sumary2).toFixed(3); + + data.score3 = Number(data.score3).toFixed(3); + data.sumary3 = Number(data.sumary3).toFixed(3); + + data.score4 = Number(data.score4).toFixed(3); + data.sumary4 = Number(data.sumary4).toFixed(3); + + // console.log("data", data); + + if (role_code === "2") { + $("#eva_evaluation_behavior_process2_score_" + i).text(data.score); + $("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary); + $("#eva_evaluation_behavior_process2_score2_" + i).val(data.score2); + $("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary2); + } else if (role_code === "3") { + $("#eva_evaluation_behavior_process2_score_" + i).text(data.score2); + $("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary2); + $("#eva_evaluation_behavior_process2_score2_" + i).val(data.score3); + $("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary3); + } else if (role_code === "4") { + $("#eva_evaluation_behavior_process2_score_" + i).text(data.score3); + $("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary3); + $("#eva_evaluation_behavior_process2_score2_" + i).val(data.score4); + $("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary4); } //$("#eva_evaluation_behavior_process2_target_score1_" + i).val(data.target_score1); @@ -72,70 +84,70 @@ function eva_evaluation_behavior_process2_GetFromForm(obj, i) { function eva_evaluation_behavior_process2_Save(id) { - if(parseInt($("#h_eva_evaluation_behavior_process2_weight").text())>100){ + if (parseInt($("#h_eva_evaluation_behavior_process2_weight").text()) > 100) { alert('กรุณาระบุค่าน้ำหนัก ไม่เกิน 100'); return false; - } + } - //Insert eva_evaluation_behavior_process2 List - var eva_evaluation_behavior_process2 = []; + //Insert eva_evaluation_behavior_process2 List + var eva_evaluation_behavior_process2 = []; $('#eva_evaluation_behavior_process2Body tr').each(function () { var i = $(this).find("#rowCount").text(); - var eacheva_evaluation_behavior_process2 = eva_evaluation_behavior_process2_GetFromForm($(this), i); - eva_evaluation_behavior_process2.push(eacheva_evaluation_behavior_process2); - }); + var eacheva_evaluation_behavior_process2 = eva_evaluation_behavior_process2_GetFromForm($(this), i); + eva_evaluation_behavior_process2.push(eacheva_evaluation_behavior_process2); + }); var successFunc = function (result) { //AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว"); - endLoad(); + endLoad(); }; - startLoad(); - AjaxPutRequest(apisite + '/api/eva_evaluation_behavior_process2/UpdateMultiple', eva_evaluation_behavior_process2, successFunc, AlertDanger); + startLoad(); + AjaxPutRequest(apisite + '/api/eva_evaluation_behavior_process2/UpdateMultiple', eva_evaluation_behavior_process2, successFunc, AlertDanger); } function eva_evaluation_behavior_process2_Get(a, blankItem, role_code) { - $('#eva_evaluation_behavior_process2Body').empty(); + $('#eva_evaluation_behavior_process2Body').empty(); - var successFunc = function (response) { - //console.log(response); - $.each(response, function (i, data) { - var tag = ''; - tag += ''; - - tag += '

'; - tag += ''; - //tag += ''; - //tag += ''; -// tag += ''; -// tag += ''; - //tag += ''; - tag += '

'; - tag += '

'; -tag += ''; - tag += '

'; + var successFunc = function (response) { + //console.log(response); + $.each(response, function (i, data) { + var tag = ''; + tag += ''; - tag += ''; - $('#eva_evaluation_behavior_process2Body').append($(tag)); - eva_evaluation_behavior_process2_FeedDataToForm(data, (i + 1), blankItem, role_code); - }); + tag += '

'; + tag += ''; + //tag += ''; + //tag += ''; + // tag += ''; + // tag += ''; + //tag += ''; + tag += '

'; + tag += '

'; + tag += ''; + tag += '

'; + + tag += ''; + $('#eva_evaluation_behavior_process2Body').append($(tag)); + eva_evaluation_behavior_process2_FeedDataToForm(data, (i + 1), blankItem, role_code); + }); eva_evaluation_behavior_process2_Summary(); -Oneva_evaluation_behavior_process2_scoreChange(); - endLoad(); - }; - startLoad(); - //AjaxGetRequest(apisite + "/api/eva_evaluation_behavior_process2", successFunc, AlertDanger); - AjaxGetRequest(apisite + '/api/eva_evaluation_behavior_process2?create_evaluation_detail_id=' + a, successFunc, AlertDanger); + Oneva_evaluation_behavior_process2_scoreChange(); + endLoad(); + }; + startLoad(); + //AjaxGetRequest(apisite + "/api/eva_evaluation_behavior_process2", successFunc, AlertDanger); + AjaxGetRequest(apisite + '/api/eva_evaluation_behavior_process2?create_evaluation_detail_id=' + a, successFunc, AlertDanger); } -function CheckValidValuebehavior(){ +function CheckValidValuebehavior() { $('#eva_evaluation_behavior_process2Body tr').each(function () { var i = $(this).find("#rowCount").text(); var score = $("#eva_evaluation_behavior_process2_score2_" + i).val(); - if(score > 5) $("#eva_evaluation_behavior_process2_score2_" + i).val(""); - if(score < 1) $("#eva_evaluation_behavior_process2_score2_" + i).val(""); - }); + if (score > 5) $("#eva_evaluation_behavior_process2_score2_" + i).val(""); + if (score < 1) $("#eva_evaluation_behavior_process2_score2_" + i).val(""); + }); } function Oneva_evaluation_behavior_process2_scoreChange() { @@ -148,7 +160,7 @@ function Oneva_evaluation_behavior_process2_scoreChange() { var total_behavior_old = 0; $('#eva_evaluation_behavior_process2Body tr').each(function () { var i = $(this).find("#rowCount").text(); - var score = $("#eva_evaluation_behavior_process2_score2_" + i).val(); + 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(3); @@ -159,19 +171,19 @@ function Oneva_evaluation_behavior_process2_scoreChange() { total_behavior_score += parseFloat(score); total_behavior_score_old += parseFloat(score_old); total_behavior_old += parseFloat(total_old); - }); + }); $("#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(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)); + $("#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(); + calculationAllItem(); } function eva_evaluation_behavior_process2_Summary() { @@ -189,4 +201,4 @@ function eva_evaluation_behavior_process2_InitialForm(id, role_code) { }; startLoad(); AjaxGetRequest(apisite + "/api/eva_evaluation_behavior_process2/" + "GetBlankItem", successFunc, AlertDanger); -} +} \ No newline at end of file