ปรับปรุงให้แสดงผลรวม ของจำนวนพนักงาน และปรับ layout

This commit is contained in:
LAPTOP-KB8JC2K2\acer
2021-07-19 14:54:44 +07:00
parent 99389df14d
commit dce57d2ca1
4 changed files with 19 additions and 14 deletions

View File

@@ -102,6 +102,12 @@ namespace TodoAPI2.Models
public List<eva_limit_frame_groupViewModel> GetListBySearch(eva_limit_frame_groupSearchModel model)
{
var group_count = (from i in _repository.Context.eva_limit_frame_employee
join j in _repository.Context.eva_limit_frame_group on i.frame_group_guid equals j.id
where j.frame_plan_guid == model.frame_plan_guid
group i.id by j.id into g
select new { gid = g.Key, emp = g.Count() }).ToList();
var data = (
from m_eva_limit_frame_group in _repository.Context.eva_limit_frame_group
@@ -114,13 +120,13 @@ namespace TodoAPI2.Models
from fk_eva_evaluation_groupResult2 in eva_evaluation_groupResult2.DefaultIfEmpty()
where
1 == 1
where
1 == 1
&& (!model.frame_plan_guid.HasValue || m_eva_limit_frame_group.frame_plan_guid == model.frame_plan_guid)
&& (!model.group_guid.HasValue || m_eva_limit_frame_group.group_guid == model.group_guid)
orderby fk_eva_evaluation_groupResult2.code
orderby fk_eva_evaluation_groupResult2.code
select new eva_limit_frame_groupViewModel()
{
id = m_eva_limit_frame_group.id,
@@ -135,6 +141,8 @@ namespace TodoAPI2.Models
frame_plan_guid_eva_limit_frame_plan_executed_date = fk_eva_limit_frame_planResult1.executed_date,
group_guid_eva_evaluation_group_code = fk_eva_evaluation_groupResult2.thegroup,
emp_qty = (from x in group_count where x.gid == m_eva_limit_frame_group.id select x.emp).FirstOrDefault(),
isActive = m_eva_limit_frame_group.isActive,
Created = m_eva_limit_frame_group.created,
Updated = m_eva_limit_frame_group.updated

View File

@@ -31,6 +31,8 @@ namespace TodoAPI2.Models
public DateTime? frame_plan_guid_eva_limit_frame_plan_executed_date { get; set; }
public string group_guid_eva_evaluation_group_code { get; set; }
public int? emp_qty { get; set; }
public string remark_formatted {
get
{

View File

@@ -44,12 +44,13 @@
</div>
</div>
<br/>
<section class="wrapper">
<div class="title col-md-12"><div class="line"></div>บันทึกข้อมูล วงเงินที่ใช้ในการเลื่อนเงินเดือน</div>
<div class="title"><div class="line"></div>วงเงินที่ใช้ในการเลื่อนเงินเดือนของพนักงานเนติบัณฑิตยสภา ของแต่ละกอง/ส่วนงาน</div>
<section class="card no-border">
<div class="card-body" style="">
<div class="row">
<div class="col-md-12">
@@ -57,7 +58,7 @@
<div class='row'>
<div class="form-group col-md-6">
<label id="lab_vw_limit_frame_plan_plan_guid" for="vw_limit_frame_plan_plan_guid">แผนการประเมิน</label>
<label id="lab_vw_limit_frame_plan_plan_guid" for="vw_limit_frame_plan_plan_guid">รอบที่ / ปีงบประมาณ</label>
<select disabled class="form-control" id="vw_limit_frame_plan_plan_guid" iLabel="แผนการประเมิน" iRequire="false" iGroup="vw_limit_frame_plan"></select>
</div>
@@ -76,16 +77,10 @@
</div>
</div>
</div>
</section>
</section>
<br/>
<section class="wrapper">
<div class="title"><div class="line"></div>วงเงินที่ใช้ในการเลื่อนเงินเดือนของแต่ละกอง/ส่วนงาน</div>
<table id="eva_limit_frame_groupTable" class="display table table-bordered table-striped">
<thead>
<tr>

View File

@@ -158,6 +158,7 @@ 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;
@@ -179,7 +180,6 @@ var eva_limit_frame_group_setupTable = function (result) {
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++;