From c2de2c63fbb78f19835ad57ea4752d2d2b54f552 Mon Sep 17 00:00:00 2001 From: Pairat Sangprasert Date: Wed, 14 Jul 2021 00:01:21 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A2=E0=B9=89=E0=B8=B2=E0=B8=A2=E0=B8=8A?= =?UTF-8?q?=E0=B9=88=E0=B8=AD=E0=B8=87=20input=20=E0=B9=81=E0=B8=A5?= =?UTF-8?q?=E0=B8=B0=E0=B8=97=E0=B8=B3=20sum=20=E0=B8=A3=E0=B8=A7=E0=B8=A1?= =?UTF-8?q?=E0=B8=84=E0=B9=88=E0=B8=B2=E0=B8=88=E0=B8=B2=E0=B8=81=20table?= =?UTF-8?q?=20=E0=B8=A7=E0=B8=87=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99?= =?UTF-8?q?=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B9=83=E0=B8=8A=E0=B9=89=E0=B9=83?= =?UTF-8?q?=E0=B8=99=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B9=80=E0=B8=A5=E0=B8=B7?= =?UTF-8?q?=E0=B9=88=E0=B8=AD=E0=B8=99=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99?= =?UTF-8?q?=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99=E0=B8=82=E0=B8=AD?= =?UTF-8?q?=E0=B8=87=E0=B9=81=E0=B8=95=E0=B9=88=E0=B8=A5=E0=B8=B0=E0=B8=81?= =?UTF-8?q?=E0=B8=AD=E0=B8=87/=E0=B8=AA=E0=B9=88=E0=B8=A7=E0=B8=99?= =?UTF-8?q?=E0=B8=87=E0=B8=B2=E0=B8=99=20=E0=B8=97=E0=B8=B3=E0=B8=A7?= =?UTF-8?q?=E0=B8=B1=E0=B8=99=20=E0=B8=AD=E0=B8=B1=E0=B8=87=E0=B8=84?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=20=E0=B8=97=E0=B8=B5=E0=B9=88=2013/07/2564?= =?UTF-8?q?=20=E0=B9=80=E0=B8=A7=E0=B8=A5=E0=B8=B2=2020.00=20-=2000.00=20?= =?UTF-8?q?=E0=B8=99.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vw_limit_frame_plan_d.cshtml | 92 +++++++++++-------- .../eva_limit_frame_group.js | 28 +++++- .../vw_limit_frame_plan_d.js | 15 +++ 3 files changed, 93 insertions(+), 42 deletions(-) diff --git a/Views/vw_limit_frame_planView/vw_limit_frame_plan_d.cshtml b/Views/vw_limit_frame_planView/vw_limit_frame_plan_d.cshtml index c8eea4e..0a4cf40 100644 --- a/Views/vw_limit_frame_planView/vw_limit_frame_plan_d.cshtml +++ b/Views/vw_limit_frame_planView/vw_limit_frame_plan_d.cshtml @@ -55,61 +55,30 @@ -
-
+
-
- - -
- -
+
-
-
+ +
+
- -
- -
- - +
-
-
- - -
- -
- - -
-
-
-
-
- - - -
-
-
@@ -120,18 +89,63 @@ - + - + + + + + + + + + + + + + + + + + + + + + + +
เครื่องมือ
+ + +
+ + + + + +
+ + + +
+ +
+
+ + + +
+
+ @section FooterPlaceHolder{ diff --git a/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group.js b/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group.js index 094f27c..77c2c6f 100644 --- a/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group.js +++ b/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group.js @@ -158,11 +158,19 @@ function eva_limit_frame_group_GoDelete(a) { var eva_limit_frame_groupTableV; var eva_limit_frame_group_setupTable = function (result) { - + let num_row = 1; + let sum_total_salary = 0; + let sum_total_salary_limit = 0; + let sum_total_salary_limit_rounded = 0; + let sum_emp_qty = 0; $.each(result, function (index_result, obj_result) { /*console.log("index_result", index_result); console.log("obj_result", obj_result);*/ + sum_total_salary += Number(obj_result.total_salary); + sum_total_salary_limit += Number(obj_result.total_salary_limit); + sum_total_salary_limit_rounded += Number(obj_result.total_salary_limit_rounded); + var currency_total_salary = coreFormatPrice(obj_result.total_salary, limit_frame_group_digits); var currency_total_salary_limit = coreFormatPrice(obj_result.total_salary_limit, limit_frame_group_digits); var currency_total_salary_limit_rounded = coreFormatPrice(obj_result.total_salary_limit_rounded, limit_frame_group_digits); @@ -170,9 +178,22 @@ var eva_limit_frame_group_setupTable = function (result) { obj_result.total_salary = currency_total_salary; obj_result.total_salary_limit = currency_total_salary_limit; obj_result.total_salary_limit_rounded = currency_total_salary_limit_rounded; + obj_result.num_row = num_row; + obj_result.emp_qty = 0; + sum_emp_qty += obj_result.emp_qty; + num_row++; }); + /*console.log("sum_total_salary", sum_total_salary); + console.log("sum_total_salary_limit", sum_total_salary_limit); + console.log("sum_total_salary_limit_rounded", sum_total_salary_limit_rounded); + console.log("sum_emp_qty", sum_emp_qty);*/ + $("#sum_total_salary").text(coreFormatPrice(sum_total_salary, limit_frame_group_digits)); + $("#sum_total_salary_limit").text(coreFormatPrice(sum_total_salary_limit, limit_frame_group_digits)); + $("#sum_total_salary_limit_rounded").text(coreFormatPrice(sum_total_salary_limit_rounded, limit_frame_group_digits)); + $("#sum_emp_qty").text(sum_emp_qty); + tmp = '"'; eva_limit_frame_groupTableV = $('#eva_limit_frame_groupTable').DataTable({ "processing": true, @@ -182,13 +203,14 @@ var eva_limit_frame_group_setupTable = function (result) { // "style": 'multi' //}, "columns": [ - //{ "data": "" }, { "data": "id" }, + { "data": "num_row" }, { "data": "group_guid_eva_evaluation_group_code" }, - { "data": "limit_frame_295" }, { "data": "total_salary" }, + { "data": "limit_frame_295" }, { "data": "total_salary_limit" }, { "data": "total_salary_limit_rounded" }, + { "data": "emp_qty" }, { "data": "remark_formatted" }, ], "columnDefs": [ diff --git a/wwwroot/js/vw_limit_frame_plan/vw_limit_frame_plan_d.js b/wwwroot/js/vw_limit_frame_plan/vw_limit_frame_plan_d.js index 29e0ff6..9bcdba4 100644 --- a/wwwroot/js/vw_limit_frame_plan/vw_limit_frame_plan_d.js +++ b/wwwroot/js/vw_limit_frame_plan/vw_limit_frame_plan_d.js @@ -14,6 +14,8 @@ function vw_limit_frame_plan_FeedDataToForm(data) { $("#vw_limit_frame_plan_limit_frame_005_total").val(coreFormatPrice(data.limit_frame_005_total, limit_frame_digits)); $("#vw_limit_frame_plan_limit_frame_005_total_rounded").val(coreFormatPrice(data.limit_frame_005_total_rounded, limit_frame_digits)); + // สำหรับ แสดง กันวงเงินร้อยละ ใช้จริง + changeForRealLimitFrame(); } function vw_limit_frame_plan_GetFromForm() { @@ -138,4 +140,17 @@ function funcCalculateCeilTotalRoundedLimitFramePlan(params) { } var set_salary_limit_rounded = cal_ceil + after_cal; $("#vw_limit_frame_plan_limit_frame_005_total_rounded").val(coreFormatPrice(set_salary_limit_rounded, limit_frame_digits)); +} + + +function changeForRealLimitFrame() { + let val_input_limit_frame = $("#vw_limit_frame_plan_limit_frame_005").val(); + let real_limit_frame = 0; + if (val_input_limit_frame) { + real_limit_frame = Number(val_input_limit_frame); + } + real_limit_frame = real_limit_frame.toFixed(2); + /*console.log(real_limit_frame);*/ + $("#text_real_limit_frame").text("กันวงเงินร้อยละ " + real_limit_frame + " ใช้จริง"); + return real_limit_frame; } \ No newline at end of file