Merge branch 'feature/20210719_enhancement_01' into develop

This commit is contained in:
Pairat Sangprasert
2021-07-19 17:00:41 +07:00
12 changed files with 150 additions and 127 deletions

View File

@@ -101,6 +101,9 @@ namespace TodoAPI2.Controllers
string reportsite = MyHelper.GetConfig(Configuration, "JasperReportServer:reportsite"); string reportsite = MyHelper.GetConfig(Configuration, "JasperReportServer:reportsite");
string username = MyHelper.GetConfig(Configuration, "JasperReportServer:username"); string username = MyHelper.GetConfig(Configuration, "JasperReportServer:username");
string password = MyHelper.GetConfig(Configuration, "JasperReportServer:password"); string password = MyHelper.GetConfig(Configuration, "JasperReportServer:password");
_repository.SetEvaDate(model);
string url = $"{mainurl}{reportsite}/rep_eva02.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}"; string url = $"{mainurl}{reportsite}/rep_eva02.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
var data = httpclient.DownloadData(url); var data = httpclient.DownloadData(url);

View File

@@ -519,11 +519,11 @@ namespace TodoAPI2.Models
model.decimal_limit_quota = Convert.ToDecimal(model.limit_quota); model.decimal_limit_quota = Convert.ToDecimal(model.limit_quota);
var postponement_data = (from postponement in _repository.Context.eva_adjust_postponement var postponement_data = (from postponement in _repository.Context.eva_adjust_postponement
join create_evaluation in _repository.Context.eva_create_evaluation on postponement.create_evaluation_id equals create_evaluation.id //join create_evaluation in _repository.Context.eva_create_evaluation on postponement.create_evaluation_id equals create_evaluation.id
where postponement.id == model.quota_id where postponement.id == model.quota_id
select new select new
{ {
create_evaluation.performance_plan_id, //create_evaluation.performance_plan_id,
postponement.fiscal_year, postponement.fiscal_year,
postponement.theDate, postponement.theDate,
postponement.limit_frame, postponement.limit_frame,
@@ -532,34 +532,29 @@ namespace TodoAPI2.Models
if(postponement_data != null) if(postponement_data != null)
{ {
var plan_id = postponement_data.performance_plan_id; var plan_id = (from plan_in_db in _repository.Context.eva_performance_plan
if(plan_id == null)
{
plan_id = (from plan_in_db in _repository.Context.eva_performance_plan
where plan_in_db.fiscal_year == postponement_data.fiscal_year where plan_in_db.fiscal_year == postponement_data.fiscal_year
&& plan_in_db.theTime == plan_in_db.theTime && plan_in_db.theTime == plan_in_db.theTime
select plan_in_db.id).FirstOrDefault(); select plan_in_db.id).FirstOrDefault();
}
if (plan_id.HasValue) var plan = (from eva_p_p in _repository.Context.eva_performance_plan
where eva_p_p.id == plan_id
select eva_p_p).FirstOrDefault();
if(plan != null)
{ {
var plan = (from eva_p_p in _repository.Context.eva_performance_plan
where eva_p_p.id == plan_id
select eva_p_p).FirstOrDefault();
var start_plan = (from s in _repository.Context.eva_performance_plan_detail var start_plan = (from s in _repository.Context.eva_performance_plan_detail
where s.performance_plan_id == postponement_data.performance_plan_id where s.performance_plan_id == plan_id
select s.start_date).Min(); select s.start_date).Min();
var end_plan = (from s in _repository.Context.eva_performance_plan_detail var end_plan = (from s in _repository.Context.eva_performance_plan_detail
where s.performance_plan_id == postponement_data.performance_plan_id where s.performance_plan_id == plan_id
select s.end_date).Max(); select s.end_date).Max();
model.theTime = plan.theTime; model.theTime = plan.theTime;
model.min_plan_start_date = MyHelper.GetDateStringForReport(start_plan); model.min_plan_start_date = MyHelper.GetDateStringForReport(start_plan);
model.max_plan_end_date = MyHelper.GetDateStringForReport(end_plan); model.max_plan_end_date = MyHelper.GetDateStringForReport(end_plan);
} }
} }
return model; return model;

View File

@@ -102,6 +102,12 @@ namespace TodoAPI2.Models
public List<eva_limit_frame_groupViewModel> GetListBySearch(eva_limit_frame_groupSearchModel model) 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 = ( var data = (
from m_eva_limit_frame_group in _repository.Context.eva_limit_frame_group 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() from fk_eva_evaluation_groupResult2 in eva_evaluation_groupResult2.DefaultIfEmpty()
where where
1 == 1 1 == 1
&& (!model.frame_plan_guid.HasValue || m_eva_limit_frame_group.frame_plan_guid == model.frame_plan_guid) && (!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) && (!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() select new eva_limit_frame_groupViewModel()
{ {
id = m_eva_limit_frame_group.id, 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, 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, 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, isActive = m_eva_limit_frame_group.isActive,
Created = m_eva_limit_frame_group.created, Created = m_eva_limit_frame_group.created,
Updated = m_eva_limit_frame_group.updated 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 DateTime? frame_plan_guid_eva_limit_frame_plan_executed_date { get; set; }
public string group_guid_eva_evaluation_group_code { get; set; } public string group_guid_eva_evaluation_group_code { get; set; }
public int? emp_qty { get; set; }
public string remark_formatted { public string remark_formatted {
get get
{ {

View File

@@ -95,7 +95,7 @@ namespace TodoAPI2.Models
where m_eva_salary_cylinder.position_type == position_type || !position_type.HasValue where m_eva_salary_cylinder.position_type == position_type || !position_type.HasValue
orderby m_eva_salary_cylinder.created descending orderby fk_external_linkageResult1.external_code, fk_external_linkageResult2.external_code
select new eva_salary_cylinderViewModel() select new eva_salary_cylinderViewModel()
{ {
id = m_eva_salary_cylinder.id, id = m_eva_salary_cylinder.id,
@@ -139,7 +139,7 @@ namespace TodoAPI2.Models
&& (m_eva_salary_cylinder.position_type == model.position_type || !model.position_type.HasValue) && (m_eva_salary_cylinder.position_type == model.position_type || !model.position_type.HasValue)
orderby m_eva_salary_cylinder.created descending orderby fk_external_linkageResult1.external_code, fk_external_linkageResult2.external_code
select new eva_salary_cylinderViewModel() select new eva_salary_cylinderViewModel()
{ {
id = m_eva_salary_cylinder.id, id = m_eva_salary_cylinder.id,

View File

@@ -16,7 +16,7 @@ namespace TodoAPI2.Models
rep_eva02WithSelectionViewModel GetWithSelection(Guid id); rep_eva02WithSelectionViewModel GetWithSelection(Guid id);
rep_eva02WithSelectionViewModel GetBlankItem(); rep_eva02WithSelectionViewModel GetBlankItem();
void SetEvaDate(rep_eva02ReportRequestModel model);
} }
} }

View File

@@ -18,7 +18,7 @@ namespace TodoAPI2.Models
public int? round_id { get; set; } public int? round_id { get; set; }
public string round_text { get; set; } public string round_text { get; set; }
public string eva_date { get; set; }
} }
} }

View File

@@ -73,6 +73,13 @@ namespace TodoAPI2.Models
return i; return i;
} }
public void SetEvaDate(rep_eva02ReportRequestModel model)
{
model.eva_date = (from i in _repository.Context.eva_adjust_postponement
where i.id == model.round_id
select MyHelper.GetDateStringForReport(i.theDate)).FirstOrDefault();
}
#endregion #endregion
#endregion #endregion

View File

@@ -44,12 +44,13 @@
</div> </div>
</div> </div>
<br/>
<section class="wrapper"> <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"> <section class="card no-border">
<div class="card-body" style=""> <div class="card-body" style="">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
@@ -57,7 +58,7 @@
<div class='row'> <div class='row'>
<div class="form-group col-md-6"> <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> <select disabled class="form-control" id="vw_limit_frame_plan_plan_guid" iLabel="แผนการประเมิน" iRequire="false" iGroup="vw_limit_frame_plan"></select>
</div> </div>
@@ -76,16 +77,10 @@
</div> </div>
</div> </div>
</div> </div>
</section> </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"> <table id="eva_limit_frame_groupTable" class="display table table-bordered table-striped">
<thead> <thead>
<tr> <tr>

View File

@@ -5,62 +5,62 @@ var eva_create_evaluation_detail_process_API = "/api/eva_create_evaluation_detai
function eva_create_evaluation_detail_process_GetSearchParameter() { function eva_create_evaluation_detail_process_GetSearchParameter() {
var eva_create_evaluation_detail_processSearchObject = new Object(); var eva_create_evaluation_detail_processSearchObject = new Object();
eva_create_evaluation_detail_processSearchObject.create_evaluation_id = $("#s_eva_create_evaluation_detail_process_create_evaluation_id").val(); eva_create_evaluation_detail_processSearchObject.create_evaluation_id = $("#s_eva_create_evaluation_detail_process_create_evaluation_id").val();
eva_create_evaluation_detail_processSearchObject.org_id = $("#s_eva_create_evaluation_detail_process_org_id").val(); eva_create_evaluation_detail_processSearchObject.org_id = $("#s_eva_create_evaluation_detail_process_org_id").val();
eva_create_evaluation_detail_processSearchObject.search_employee_code = $("#s_eva_create_evaluation_detail_process_search_employee_code").val(); eva_create_evaluation_detail_processSearchObject.search_employee_code = $("#s_eva_create_evaluation_detail_process_search_employee_code").val();
eva_create_evaluation_detail_processSearchObject.search_employee_fullname = $("#s_eva_create_evaluation_detail_process_search_employee_fullname").val(); eva_create_evaluation_detail_processSearchObject.search_employee_fullname = $("#s_eva_create_evaluation_detail_process_search_employee_fullname").val();
eva_create_evaluation_detail_processSearchObject.employee_id = $("#s_eva_create_evaluation_detail_process_employee_id").val(); eva_create_evaluation_detail_processSearchObject.employee_id = $("#s_eva_create_evaluation_detail_process_employee_id").val();
eva_create_evaluation_detail_processSearchObject.path = "d"; eva_create_evaluation_detail_processSearchObject.path = "d";
return eva_create_evaluation_detail_processSearchObject; return eva_create_evaluation_detail_processSearchObject;
} }
function eva_create_evaluation_detail_process_FeedDataToSearchForm(data) { function eva_create_evaluation_detail_process_FeedDataToSearchForm(data) {
$("#s_eva_create_evaluation_detail_process_create_evaluation_id").val(data.create_evaluation_id); $("#s_eva_create_evaluation_detail_process_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_process_org_id"), data, "id", "external_name", "item_org_id", data.org_id); DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_process_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#s_eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code); $("#s_eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code);
$("#s_eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname); $("#s_eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname);
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_process_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id); DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_process_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
console.log(data.item_employee_id); console.log(data.item_employee_id);
} }
//================= Form Data Customizaiton ========================================= //================= Form Data Customizaiton =========================================
function eva_create_evaluation_detail_process_FeedDataToForm(data) { function eva_create_evaluation_detail_process_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_process_id").val(data.id); $("#eva_create_evaluation_detail_process_id").val(data.id);
$("#eva_create_evaluation_detail_process_evaluation_round").text(data.evaluation_round); $("#eva_create_evaluation_detail_process_evaluation_round").text(data.evaluation_round);
$("#eva_create_evaluation_detail_process_employee_code").text(data.employee_code); $("#eva_create_evaluation_detail_process_employee_code").text(data.employee_code);
$("#eva_create_evaluation_detail_process_employee_fullname").text(data.employee_fullname); $("#eva_create_evaluation_detail_process_employee_fullname").text(data.employee_fullname);
$("#eva_create_evaluation_detail_process_employee_position").text(data.employee_position); $("#eva_create_evaluation_detail_process_employee_position").text(data.employee_position);
$("#eva_create_evaluation_detail_process_employee_position_type").text(data.employee_position_type); $("#eva_create_evaluation_detail_process_employee_position_type").text(data.employee_position_type);
$("#eva_create_evaluation_detail_process_employee_position_level").text(data.employee_position_level); $("#eva_create_evaluation_detail_process_employee_position_level").text(data.employee_position_level);
$("#eva_create_evaluation_detail_process_employee_org").text(data.employee_org); $("#eva_create_evaluation_detail_process_employee_org").text(data.employee_org);
$("#eva_create_evaluation_detail_process_chief_fullname").text(data.chief_fullname); $("#eva_create_evaluation_detail_process_chief_fullname").text(data.chief_fullname);
$("#eva_create_evaluation_detail_process_chief_position").text(data.chief_position); $("#eva_create_evaluation_detail_process_chief_position").text(data.chief_position);
$("#eva_create_evaluation_detail_process_create_evaluation_id").val(data.create_evaluation_id); $("#eva_create_evaluation_detail_process_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_process_org_id"), data, "id", "external_name", "item_org_id", data.org_id); DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_process_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code); $("#eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code);
$("#eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname); $("#eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname);
} }
function eva_create_evaluation_detail_process_GetFromForm() { function eva_create_evaluation_detail_process_GetFromForm() {
var eva_create_evaluation_detail_processObject = new Object(); var eva_create_evaluation_detail_processObject = new Object();
eva_create_evaluation_detail_processObject.id = $("#eva_create_evaluation_detail_process_id").val(); eva_create_evaluation_detail_processObject.id = $("#eva_create_evaluation_detail_process_id").val();
eva_create_evaluation_detail_processObject.evaluation_round = $("#eva_create_evaluation_detail_process_evaluation_round").text(); eva_create_evaluation_detail_processObject.evaluation_round = $("#eva_create_evaluation_detail_process_evaluation_round").text();
eva_create_evaluation_detail_processObject.employee_code = $("#eva_create_evaluation_detail_process_employee_code").text(); eva_create_evaluation_detail_processObject.employee_code = $("#eva_create_evaluation_detail_process_employee_code").text();
eva_create_evaluation_detail_processObject.employee_fullname = $("#eva_create_evaluation_detail_process_employee_fullname").text(); eva_create_evaluation_detail_processObject.employee_fullname = $("#eva_create_evaluation_detail_process_employee_fullname").text();
eva_create_evaluation_detail_processObject.employee_position = $("#eva_create_evaluation_detail_process_employee_position").text(); eva_create_evaluation_detail_processObject.employee_position = $("#eva_create_evaluation_detail_process_employee_position").text();
eva_create_evaluation_detail_processObject.employee_position_type = $("#eva_create_evaluation_detail_process_employee_position_type").text(); eva_create_evaluation_detail_processObject.employee_position_type = $("#eva_create_evaluation_detail_process_employee_position_type").text();
eva_create_evaluation_detail_processObject.employee_position_level = $("#eva_create_evaluation_detail_process_employee_position_level").text(); eva_create_evaluation_detail_processObject.employee_position_level = $("#eva_create_evaluation_detail_process_employee_position_level").text();
eva_create_evaluation_detail_processObject.employee_org = $("#eva_create_evaluation_detail_process_employee_org").text(); eva_create_evaluation_detail_processObject.employee_org = $("#eva_create_evaluation_detail_process_employee_org").text();
eva_create_evaluation_detail_processObject.chief_fullname = $("#eva_create_evaluation_detail_process_chief_fullname").text(); eva_create_evaluation_detail_processObject.chief_fullname = $("#eva_create_evaluation_detail_process_chief_fullname").text();
eva_create_evaluation_detail_processObject.chief_position = $("#eva_create_evaluation_detail_process_chief_position").text(); eva_create_evaluation_detail_processObject.chief_position = $("#eva_create_evaluation_detail_process_chief_position").text();
eva_create_evaluation_detail_processObject.create_evaluation_id = $("#eva_create_evaluation_detail_process_create_evaluation_id").val(); eva_create_evaluation_detail_processObject.create_evaluation_id = $("#eva_create_evaluation_detail_process_create_evaluation_id").val();
eva_create_evaluation_detail_processObject.org_id = $("#eva_create_evaluation_detail_process_org_id").val(); eva_create_evaluation_detail_processObject.org_id = $("#eva_create_evaluation_detail_process_org_id").val();
eva_create_evaluation_detail_processObject.search_employee_code = $("#eva_create_evaluation_detail_process_search_employee_code").val(); eva_create_evaluation_detail_processObject.search_employee_code = $("#eva_create_evaluation_detail_process_search_employee_code").val();
eva_create_evaluation_detail_processObject.search_employee_fullname = $("#eva_create_evaluation_detail_process_search_employee_fullname").val(); eva_create_evaluation_detail_processObject.search_employee_fullname = $("#eva_create_evaluation_detail_process_search_employee_fullname").val();
return eva_create_evaluation_detail_processObject; return eva_create_evaluation_detail_processObject;
@@ -69,14 +69,14 @@ eva_create_evaluation_detail_processObject.search_employee_fullname = $("#eva_cr
function eva_create_evaluation_detail_process_InitialForm(s) { function eva_create_evaluation_detail_process_InitialForm(s) {
var successFunc = function (result) { var successFunc = function (result) {
eva_create_evaluation_detail_process_FeedDataToForm(result); eva_create_evaluation_detail_process_FeedDataToForm(result);
eva_create_evaluation_detail_process_FeedDataToSearchForm(result); eva_create_evaluation_detail_process_FeedDataToSearchForm(result);
if (s) { if (s) {
// Incase model popup // Incase model popup
$("#eva_create_evaluation_detail_processModel").modal("show"); $("#eva_create_evaluation_detail_processModel").modal("show");
} }
endLoad(); endLoad();
}; };
startLoad(); startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + "GetBlankItem", successFunc, AlertDanger); AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + "GetBlankItem", successFunc, AlertDanger);
} }
@@ -91,13 +91,12 @@ function eva_create_evaluation_detail_process_GoCreate() {
} }
function eva_create_evaluation_detail_process_GoEdit(a, role_code) { function eva_create_evaluation_detail_process_GoEdit(a, role_code) {
if(role_code=="1"){ if (role_code == "1") {
window_open(appsite + "/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d?id=" + a); window_open(appsite + "/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d?id=" + a);
} }
else else {
{
window_open(appsite + "/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2?id=" + a); window_open(appsite + "/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2?id=" + a);
} }
} }
function eva_create_evaluation_detail_process_SetEditForm(a) { function eva_create_evaluation_detail_process_SetEditForm(a) {
@@ -105,15 +104,15 @@ function eva_create_evaluation_detail_process_SetEditForm(a) {
eva_create_evaluation_detail_process_editMode = "UPDATE"; eva_create_evaluation_detail_process_editMode = "UPDATE";
eva_create_evaluation_detail_process_FeedDataToForm(result); eva_create_evaluation_detail_process_FeedDataToForm(result);
$("#eva_create_evaluation_detail_processModel").modal("show"); $("#eva_create_evaluation_detail_processModel").modal("show");
endLoad(); endLoad();
}; };
startLoad(); startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + a, successFunc, AlertDanger); AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + a, successFunc, AlertDanger);
} }
function eva_create_evaluation_detail_process_SetCreateForm(s) { function eva_create_evaluation_detail_process_SetCreateForm(s) {
eva_create_evaluation_detail_process_editMode = "CREATE"; eva_create_evaluation_detail_process_editMode = "CREATE";
eva_create_evaluation_detail_process_InitialForm(s); eva_create_evaluation_detail_process_InitialForm(s);
} }
function eva_create_evaluation_detail_process_RefreshTable() { function eva_create_evaluation_detail_process_RefreshTable() {
@@ -131,8 +130,7 @@ var eva_create_evaluation_detail_process_customValidation = function (group) {
}; };
function eva_create_evaluation_detail_process_PutUpdate() { function eva_create_evaluation_detail_process_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_process', eva_create_evaluation_detail_process_customValidation)) if (!ValidateForm('eva_create_evaluation_detail_process', eva_create_evaluation_detail_process_customValidation)) {
{
return; return;
} }
@@ -144,9 +142,9 @@ function eva_create_evaluation_detail_process_PutUpdate() {
$("#eva_create_evaluation_detail_processModel").modal("hide"); $("#eva_create_evaluation_detail_processModel").modal("hide");
AlertSuccess(result.message); AlertSuccess(result.message);
eva_create_evaluation_detail_process_RefreshTable(); eva_create_evaluation_detail_process_RefreshTable();
endLoad(); endLoad();
}; };
startLoad(); startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_process_API + data.id, data, successFunc1, AlertDanger); AjaxPutRequest(apisite + eva_create_evaluation_detail_process_API + data.id, data, successFunc1, AlertDanger);
} }
// Create mode // Create mode
@@ -155,9 +153,9 @@ function eva_create_evaluation_detail_process_PutUpdate() {
$("#eva_create_evaluation_detail_processModel").modal("hide"); $("#eva_create_evaluation_detail_processModel").modal("hide");
AlertSuccess(result.message); AlertSuccess(result.message);
eva_create_evaluation_detail_process_RefreshTable(); eva_create_evaluation_detail_process_RefreshTable();
endLoad(); endLoad();
}; };
startLoad(); startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_process_API, data, successFunc2, AlertDanger); AjaxPostRequest(apisite + eva_create_evaluation_detail_process_API, data, successFunc2, AlertDanger);
} }
} }
@@ -168,9 +166,9 @@ function eva_create_evaluation_detail_process_GoDelete(a) {
$("#eva_create_evaluation_detail_processModel").modal("hide"); $("#eva_create_evaluation_detail_processModel").modal("hide");
AlertSuccess(result.message); AlertSuccess(result.message);
eva_create_evaluation_detail_process_RefreshTable(); eva_create_evaluation_detail_process_RefreshTable();
endLoad(); endLoad();
}; };
startLoad(); startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_process_API + a, null, successFunc, AlertDanger); AjaxDeleteRequest(apisite + eva_create_evaluation_detail_process_API + a, null, successFunc, AlertDanger);
} }
} }
@@ -182,27 +180,27 @@ var eva_create_evaluation_detail_processTableV;
var eva_create_evaluation_detail_process_setupTable = function (result) { var eva_create_evaluation_detail_process_setupTable = function (result) {
var groupColumn = 6; var groupColumn = 6;
tmp = '"'; tmp = '"';
eva_create_evaluation_detail_processTableV = $('#eva_create_evaluation_detail_processTable').DataTable({ eva_create_evaluation_detail_processTableV = $('#eva_create_evaluation_detail_processTable').DataTable({
"processing": true, "processing": true,
"serverSide": false, "serverSide": false,
"data": result, "data": result,
"select": false, "select": false,
"columns": [ "columns": [
{ "data": "id" }, { "data": "id" },
{ "data": "plan_round_year" }, { "data": "plan_round_year" },
{ "data": "employee_code" }, { "data": "employee_code" },
{ "data": "employee_fullname" }, { "data": "employee_fullname" },
{ "data": "employee_position" }, { "data": "employee_position" },
{ "data": "employee_position_level" }, { "data": "employee_position_level" },
{ "data": "org_id_external_linkage_external_name" }, { "data": "org_id_external_linkage_external_name" },
{ "data": "role_desc" }, { "data": "role_desc" },
{ "data": "txt_status_self" }, { "data": "txt_status_self" },
{ "data": "txt_status_chief" }, { "data": "txt_status_chief" },
{ "data": "txt_status_supervisor" }, { "data": "txt_status_supervisor" },
{ "data": "txt_status_supervisor1A" }, { "data": "txt_status_supervisor1A" },
{ "data": "txt_status_supervisor2A" } { "data": "txt_status_supervisor2A" }
], ],
"columnDefs": [ "columnDefs": [
{ {
@@ -217,42 +215,42 @@ var eva_create_evaluation_detail_process_setupTable = function (result) {
"url": appsite + "/DataTables-1.10.16/thai.json" "url": appsite + "/DataTables-1.10.16/thai.json"
}, },
"paging": true, "paging": true,
"searching": false, "searching": false,
"drawCallback": function ( settings ) { "drawCallback": function (settings) {
var api = this.api(); var api = this.api();
var rows = api.rows( {page:'current'} ).nodes(); var rows = api.rows({ page: 'current' }).nodes();
var last=null; var last = null;
api.column(groupColumn, {page:'current'} ).data().each( function ( group, i ) { api.column(groupColumn, { page: 'current' }).data().each(function (group, i) {
if ( last !== group ) { if (last !== group) {
$(rows).eq( i ).before( $(rows).eq(i).before(
'<tr class="group"><td colspan="12">'+group+'</td></tr>' '<tr class="group"><td colspan="12">' + group + '</td></tr>'
); );
last = group; last = group;
} }
} ); });
} }
}); });
endLoad(); endLoad();
}; };
function eva_create_evaluation_detail_process_InitiateDataTable() { function eva_create_evaluation_detail_process_InitiateDataTable() {
startLoad(); startLoad();
var p = $.param(eva_create_evaluation_detail_process_GetSearchParameter()); var p = $.param(eva_create_evaluation_detail_process_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_process/GetListBySearch?"+p, eva_create_evaluation_detail_process_setupTable, AlertDanger); AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_process/GetListBySearch?" + p, eva_create_evaluation_detail_process_setupTable, AlertDanger);
} }
function eva_create_evaluation_detail_process_DoSearch() { function eva_create_evaluation_detail_process_DoSearch() {
var p = $.param(eva_create_evaluation_detail_process_GetSearchParameter()); var p = $.param(eva_create_evaluation_detail_process_GetSearchParameter());
console.log(p); //console.log(p);
var eva_create_evaluation_detail_process_reload = function (result) { var eva_create_evaluation_detail_process_reload = function (result) {
eva_create_evaluation_detail_processTableV.destroy(); eva_create_evaluation_detail_processTableV.destroy();
eva_create_evaluation_detail_process_setupTable(result); eva_create_evaluation_detail_process_setupTable(result);
endLoad(); endLoad();
}; };
startLoad(); startLoad();
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_process/GetListBySearch?"+p, eva_create_evaluation_detail_process_reload, AlertDanger); AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_process/GetListBySearch?" + p, eva_create_evaluation_detail_process_reload, AlertDanger);
} }
function eva_create_evaluation_detail_process_GetSelect(f) { function eva_create_evaluation_detail_process_GetSelect(f) {

View File

@@ -158,6 +158,7 @@ function eva_limit_frame_group_GoDelete(a) {
var eva_limit_frame_groupTableV; var eva_limit_frame_groupTableV;
var eva_limit_frame_group_setupTable = function (result) { var eva_limit_frame_group_setupTable = function (result) {
let num_row = 1; let num_row = 1;
let sum_total_salary = 0; let sum_total_salary = 0;
let sum_total_salary_limit = 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 = currency_total_salary_limit;
obj_result.total_salary_limit_rounded = currency_total_salary_limit_rounded; obj_result.total_salary_limit_rounded = currency_total_salary_limit_rounded;
obj_result.num_row = num_row; obj_result.num_row = num_row;
obj_result.emp_qty = 0;
sum_emp_qty += obj_result.emp_qty; sum_emp_qty += obj_result.emp_qty;
num_row++; num_row++;

View File

@@ -158,7 +158,7 @@ function eva_salary_cylinder_GoDelete(a) {
var eva_salary_cylinderTableV; var eva_salary_cylinderTableV;
var eva_salary_cylinder_setupTable = function (result) { var eva_salary_cylinder_setupTable = function (result) {
console.log(result); var groupColumn = 1;
tmp = '"'; tmp = '"';
eva_salary_cylinderTableV = $('#eva_salary_cylinderTable').DataTable({ eva_salary_cylinderTableV = $('#eva_salary_cylinderTable').DataTable({
"processing": true, "processing": true,
@@ -237,7 +237,22 @@ var eva_salary_cylinder_setupTable = function (result) {
"url": appsite + "/DataTables-1.10.16/thai.json" "url": appsite + "/DataTables-1.10.16/thai.json"
}, },
"paging": true, "paging": true,
"searching": false "searching": false,
"drawCallback": function (settings) {
var api = this.api();
var rows = api.rows({ page: 'current' }).nodes();
var last = null;
api.column(groupColumn, { page: 'current' }).data().each(function (group, i) {
if (last !== group) {
$(rows).eq(i).before(
'<tr class="group"><td colspan="12">' + group + '</td></tr>'
);
last = group;
}
});
}
}); });
endLoad(); endLoad();
}; };