From f353f73d17f471e72564f7169c5d34f0a0363e33 Mon Sep 17 00:00:00 2001 From: Nakorn Rientrakrunchai Date: Thu, 23 Apr 2020 12:26:27 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A3=E0=B8=A7=E0=B8=A1=20code=20=E0=B9=81?= =?UTF-8?q?=E0=B8=81=E0=B9=89=E0=B8=9A=E0=B8=B1=E0=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...a_evaluation_achievement_processService.cs | 5 ++- ...eva_evaluation_behavior_process2Service.cs | 1 + ...a_evaluation_behavior_process2ViewModel.cs | 2 ++ ...reate_evaluation_detail_agreement_d.cshtml | 8 ++--- ...create_evaluation_detail_process_d2.cshtml | 33 +++++++++++-------- .../eva_create_evaluation_detail_process_d.js | 2 +- .../eva_evaluation_behavior_process_inline.js | 2 +- ...eva_evaluation_behavior_process2_inline.js | 9 ++++- 8 files changed, 40 insertions(+), 22 deletions(-) diff --git a/Models/eva_evaluation_achievement_process/eva_evaluation_achievement_processService.cs b/Models/eva_evaluation_achievement_process/eva_evaluation_achievement_processService.cs index f51a860..8050406 100644 --- a/Models/eva_evaluation_achievement_process/eva_evaluation_achievement_processService.cs +++ b/Models/eva_evaluation_achievement_process/eva_evaluation_achievement_processService.cs @@ -173,6 +173,8 @@ namespace TodoAPI2.Models existingEntity.weight = model.weight; existingEntity.score = model.score; existingEntity.sumary = model.sumary; + existingEntity.score2 = model.score; + existingEntity.sumary2 = model.sumary; existingEntity.target_score1 = model.target_score1; existingEntity.target_score2 = model.target_score2; existingEntity.target_score3 = model.target_score3; @@ -212,13 +214,14 @@ namespace TodoAPI2.Models //existingEntity.weight = i.weight; existingEntity.score = i.score; existingEntity.sumary = i.sumary; + existingEntity.score2 = i.score; + existingEntity.sumary2 = i.sumary; //existingEntity.target_score1 = i.target_score1; //existingEntity.target_score2 = i.target_score2; //existingEntity.target_score3 = i.target_score3; //existingEntity.target_score4 = i.target_score4; //existingEntity.target_score5 = i.target_score5; - _repository.UpdateWithoutCommit(i.id.Value, existingEntity); } } diff --git a/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2Service.cs b/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2Service.cs index 9840ab6..9932a9d 100644 --- a/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2Service.cs +++ b/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2Service.cs @@ -105,6 +105,7 @@ namespace TodoAPI2.Models behavior = m_eva_evaluation_behavior_process2.behavior, weight = m_eva_evaluation_behavior_process2.weight, score = m_eva_evaluation_behavior_process2.score, + sumary = m_eva_evaluation_behavior_process2.sumary, score2 = m_eva_evaluation_behavior_process2.score2, sumary2 = m_eva_evaluation_behavior_process2.sumary2, target_score1 = m_eva_evaluation_behavior_process2.target_score1, diff --git a/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2ViewModel.cs b/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2ViewModel.cs index 64de3dd..c01ec6c 100644 --- a/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2ViewModel.cs +++ b/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2ViewModel.cs @@ -22,6 +22,8 @@ namespace TodoAPI2.Models public decimal? score { get; set; } + public decimal? sumary { get; set; } + public decimal? score2 { get; set; } public decimal? sumary2 { get; set; } diff --git a/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml b/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml index f058e3b..a8a725c 100644 --- a/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml +++ b/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml @@ -188,14 +188,14 @@
- -

+ +

- -

+ +

diff --git a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml index 7b4bcc6..6ecd293 100644 --- a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml +++ b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml @@ -283,30 +283,32 @@ ลำดับ - + - - - + + + + - + - - -

+ +

+ +

@@ -468,7 +470,7 @@

- +
@@ -526,7 +528,7 @@
- +
@@ -574,7 +576,7 @@
- +
@@ -641,32 +643,35 @@ }); function Oneva_create_evaluation_detail_review02_supervisor2_resultChanged(a){ - console.log($(a).val()); if($(a).val() == "Y"){ $("#eva_create_evaluation_detail_review02_supervisor2_remark").attr("iRequire","false"); $("#eva_create_evaluation_detail_review02_supervisor2_remark").css('border-color', ''); + $("#review02x").hide(); }else{ $("#eva_create_evaluation_detail_review02_supervisor2_remark").attr("iRequire","true"); + $("#review02x").show(); } } function Oneva_create_evaluation_detail_review03_supervisor1A_resultChanged(a){ - console.log($(a).val()); if($(a).val() == "Y"){ $("#eva_create_evaluation_detail_review03_supervisor1A_remark").attr("iRequire","false"); $("#eva_create_evaluation_detail_review03_supervisor1A_remark").css('border-color', ''); + $("#review03x").hide(); }else{ $("#eva_create_evaluation_detail_review03_supervisor1A_remark").attr("iRequire","true"); + $("#review03x").show(); } } function Oneva_create_evaluation_detail_review04_supervisor2A_resultChanged(a){ - console.log($(a).val()); if($(a).val() == "Y"){ $("#eva_create_evaluation_detail_review04_supervisor2A_remark").attr("iRequire","false"); $("#eva_create_evaluation_detail_review04_supervisor2A_remark").css('border-color', ''); + $("#review04x").hide(); }else{ $("#eva_create_evaluation_detail_review04_supervisor2A_remark").attr("iRequire","true"); + $("#review04x").show(); } } diff --git a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js index 27da124..833dd8a 100644 --- a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js +++ b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js @@ -88,7 +88,7 @@ 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); - setPageByRoleAndStatus(result.role_code, result.status_self, result.status_chief, result.status_supervisor); + //setPageByRoleAndStatus(result.role_code, result.status_self, result.status_chief, result.status_supervisor); endLoad(); }; startLoad(); 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 c0f5ba7..15b64a2 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 @@ -131,7 +131,7 @@ function Oneva_evaluation_behavior_process_scoreChange(){ $("#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_score * w2 /10).toFixed(2)); + $("#eva_create_evaluation_detail_summary1_competency_chief").text(((total_behavior*20)*w2/100).toFixed(2)); calculationAllItem(); } 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 de50a6a..498e6ad 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 @@ -21,6 +21,7 @@ $("#eva_evaluation_behavior_process2_create_evaluation_detail_id_" + i).val(data $("#eva_evaluation_behavior_process2_behavior_" + i).text(data.behavior); $("#eva_evaluation_behavior_process2_weight_" + i).val(data.weight); $("#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); $("#eva_evaluation_behavior_process2_target_score1_" + i).val(data.target_score1); @@ -38,6 +39,7 @@ eva_evaluation_behavior_process2Object.create_evaluation_detail_id = obj.find("# eva_evaluation_behavior_process2Object.behavior = obj.find("#eva_evaluation_behavior_process2_behavior_" + i).text(); eva_evaluation_behavior_process2Object.weight = obj.find("#eva_evaluation_behavior_process2_weight_" + i).val(); eva_evaluation_behavior_process2Object.score = obj.find("#eva_evaluation_behavior_process2_score_" + i).text(); +eva_evaluation_behavior_process2Object.sumary = obj.find("#eva_evaluation_behavior_process2_sumary_" + i).text(); eva_evaluation_behavior_process2Object.score2 = obj.find("#eva_evaluation_behavior_process2_score2_" + i).val(); eva_evaluation_behavior_process2Object.sumary2 = obj.find("#eva_evaluation_behavior_process2_sumary2_" + i).text(); eva_evaluation_behavior_process2Object.target_score1 = obj.find("#eva_evaluation_behavior_process2_target_score1_" + i).val(); @@ -81,7 +83,7 @@ function eva_evaluation_behavior_process2_Get(a, blankItem) { $('#eva_evaluation_behavior_process2Body').empty(); var successFunc = function (response) { - //console.log(response); + console.log(response); $.each(response, function (i, data) { var tag = ''; tag += ''; @@ -94,6 +96,7 @@ function eva_evaluation_behavior_process2_Get(a, blankItem) { tag += ''; tag += ''; tag += '

'; + tag += '

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

'; @@ -126,17 +129,20 @@ function Oneva_evaluation_behavior_process2_scoreChange(){ var total_behavior_weight = 0; var total_behavior_score = 0; var total_behavior_score_old = 0; + 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_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); $("#eva_evaluation_behavior_process2_sumary2_" + i).text(total); total_behavior += parseFloat(total); total_behavior_weight += parseFloat(weight); 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(2)); $("#h_eva_evaluation_behavior_process2_score2").text(total_behavior_score.toFixed(2)); @@ -144,6 +150,7 @@ function Oneva_evaluation_behavior_process2_scoreChange(){ 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));