From d065ad6238e678fe6f301a3c37f638359d4059f4 Mon Sep 17 00:00:00 2001 From: Pairat Sangprasert Date: Tue, 20 Apr 2021 22:04:40 +0700 Subject: [PATCH] =?UTF-8?q?clickup=20#6vvpqz=20=E0=B9=81=E0=B8=A5=E0=B8=B0?= =?UTF-8?q?=E0=B8=97=E0=B8=B3=20function=20=E0=B8=81=E0=B8=A5=E0=B8=B2?= =?UTF-8?q?=E0=B8=87=20=E0=B9=83=E0=B8=AB=E0=B9=89=E0=B8=81=E0=B8=A3?= =?UTF-8?q?=E0=B8=AD=E0=B8=81=E0=B9=81=E0=B8=95=E0=B9=88=E0=B8=88=E0=B8=B3?= =?UTF-8?q?=E0=B8=99=E0=B8=A7=E0=B8=99=E0=B9=80=E0=B8=95=E0=B9=87=E0=B8=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._create_evaluation_detail_process_d.cshtml | 4 +-- wwwroot/js/coregen.js | 10 +++++++ ...a_evaluation_achievement_process_inline.js | 28 +++++++++++-------- .../eva_evaluation_behavior_process_inline.js | 28 +++++++++++-------- 4 files changed, 45 insertions(+), 25 deletions(-) diff --git a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml index e44a197..3dde642 100644 --- a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml +++ b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml @@ -224,7 +224,7 @@ ลำดับ - + @@ -278,7 +278,7 @@ ลำดับ - + diff --git a/wwwroot/js/coregen.js b/wwwroot/js/coregen.js index f0942e0..4c8a420 100644 --- a/wwwroot/js/coregen.js +++ b/wwwroot/js/coregen.js @@ -678,3 +678,13 @@ function coreCurrencyToDecimal(currency) { } return number; } + +function coreIsNumber(event) { + var charCode = (event.which) ? event.which : event.keyCode; + console.log("charCode",charCode); + if (charCode > 31 && (charCode < 48 || charCode > 57)){ + event.preventDefault(); + }else{ + return true; + } +} 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 4a8243b..bee5759 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 @@ -3,7 +3,7 @@ $("#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_weight_" + i).val(""); $("#eva_evaluation_achievement_process_score_" + i).val(""); $("#eva_evaluation_achievement_process_sumary_" + i).text(""); //$("#eva_evaluation_achievement_process_target_score1_" + i).val(""); @@ -22,7 +22,7 @@ function eva_evaluation_achievement_process_FeedDataToForm(data, i, blankItem) { $("#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_weight_" + i).val(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); @@ -38,7 +38,7 @@ function eva_evaluation_achievement_process_GetFromForm(obj, i) { 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.weight = obj.find("#eva_evaluation_achievement_process_weight_" + i).val(); 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(); @@ -77,12 +77,7 @@ function eva_evaluation_achievement_process_Get(a, blankItem) { var tag = ''; tag += ''; tag += '

'; - tag += '

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

'; @@ -116,8 +111,19 @@ function Oneva_evaluation_achievement_process_scoreChange() { 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 weight = $("#eva_evaluation_achievement_process_weight_" + i).text(); + var score = 0; + var weight = 0; + var val_achievment_score = $("#eva_evaluation_achievement_process_score_" + i).val(); + var val_achievment_weight = $("#eva_evaluation_achievement_process_weight_" + i).val(); + + if (val_achievment_score) { + score = val_achievment_score; + } + + if (val_achievment_weight) { + weight = val_achievment_weight; + } + var total = (score * weight / 100).toFixed(3); $("#eva_evaluation_achievement_process_sumary_" + i).text(total); total_achievement += parseFloat(total); 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 5fecbf8..8851b03 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 @@ -3,7 +3,7 @@ $("#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_weight_" + i).val(""); $("#eva_evaluation_behavior_process_score_" + i).val(""); $("#eva_evaluation_behavior_process_sumary_" + i).text(""); //$("#eva_evaluation_behavior_process_target_score1_" + i).val(""); @@ -22,7 +22,7 @@ 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_weight_" + i).val(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); @@ -38,7 +38,7 @@ function eva_evaluation_behavior_process_GetFromForm(obj, i) { 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.weight = obj.find("#eva_evaluation_behavior_process_weight_" + i).val(); 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(); @@ -73,18 +73,12 @@ function eva_evaluation_behavior_process_Get(a, blankItem) { $('#eva_evaluation_behavior_processBody').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 += '

'; @@ -120,8 +114,18 @@ function Oneva_evaluation_behavior_process_scoreChange() { 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 weight = $("#eva_evaluation_behavior_process_weight_" + i).text(); + var score = 0; + var weight = 0; + var val_score = $("#eva_evaluation_behavior_process_score_" + i).val(); + var val_weight = $("#eva_evaluation_behavior_process_weight_" + i).val(); + + if (val_score) { + score = val_score; + } + + if (val_weight) { + weight = val_weight; + } var total = (score * weight / 100).toFixed(3); $("#eva_evaluation_behavior_process_sumary_" + i).text(total); total_behavior += parseFloat(total);