ปรับปรุงตามที่ได้รับแจ้ง

This commit is contained in:
LAPTOP-KB8JC2K2\acer
2021-09-16 11:52:23 +07:00
parent 3016221910
commit dacfe151cf
16 changed files with 100 additions and 9 deletions

View File

@@ -32,6 +32,10 @@ namespace TodoAPI2.Models
public decimal? limit { get; set; }
public int? fiscal_year_search { get; set; }
public int? theRound_search { get; set; }
public string active_mode { get; set; }
public List<eva_adjust_postponement_detail_quota_02InputModel> adjust_postponement_detail_quota_02_model;

View File

@@ -20,6 +20,9 @@ namespace TodoAPI2.Models
public int? theRound { get; set; }
public int? fiscal_year_search { get; set; }
public int? theRound_search { get; set; }
}
}

View File

@@ -77,6 +77,13 @@ namespace TodoAPI2.Models
var all_emp = emp.GetListByemployee_type(null, null);
i.item_managed_by = all_emp.ToList();
i.item_fiscal_year_search = (from x in _repository.Context.eva_adjust_postponement
select new external_linkageViewModel { external_id = x.fiscal_year, external_name = x.fiscal_year.ToString() }
).Distinct().OrderByDescending(x => x.external_id).ToList();
i.item_theRound_search = (from x in _repository.Context.eva_adjust_postponement
select new external_linkageViewModel { external_id = x.theRound, external_name = x.theRound.ToString() }
).Distinct().OrderByDescending(x => x.external_id).ToList();
return i;
}
public eva_adjust_postponement_quotaWithSelectionViewModel GetBlankItem()
@@ -85,6 +92,13 @@ namespace TodoAPI2.Models
var all_emp = emp.GetListByemployee_type(null, null);
i.item_managed_by = all_emp.ToList();
i.item_fiscal_year_search = (from x in _repository.Context.eva_adjust_postponement
select new external_linkageViewModel { external_id = x.fiscal_year, external_name = x.fiscal_year.ToString() }
).Distinct().OrderByDescending(x => x.external_id).ToList();
i.item_theRound_search = (from x in _repository.Context.eva_adjust_postponement
select new external_linkageViewModel { external_id = x.theRound, external_name = x.theRound.ToString() }
).Distinct().OrderByDescending(x => x.external_id).ToList();
return i;
}
@@ -112,6 +126,9 @@ namespace TodoAPI2.Models
&& (m_eva_adjust_postponement_quota.theRound == model.theRound || !model.theRound.HasValue)
&& !m_eva_adjust_postponement_quota.create_evaluation_id.HasValue
&& (!model.fiscal_year_search.HasValue || m_eva_adjust_postponement_quota.fiscal_year == model.fiscal_year_search)
&& (!model.theRound_search.HasValue || m_eva_adjust_postponement_quota.theRound == model.theRound_search)
orderby m_eva_adjust_postponement_quota.created descending
select new eva_adjust_postponement_quotaViewModel()
{

View File

@@ -8,6 +8,7 @@ namespace TodoAPI2.Models
public class eva_adjust_postponement_quotaWithSelectionViewModel: eva_adjust_postponement_quotaViewModel
{
public List<external_employeeViewModel> item_managed_by { get; set; }
public List<external_linkageViewModel> item_fiscal_year_search { get; set; }
public List<external_linkageViewModel> item_theRound_search { get; set; }
}
}

View File

@@ -42,6 +42,8 @@ namespace TodoAPI2.Models
public string search_employee_fullname { get; set; }
public string evaluation_round_search { get; set; }
public string active_mode { get; set; }
}
}

View File

@@ -22,6 +22,8 @@ namespace TodoAPI2.Models
public string search_employee_fullname { get; set; }
public string evaluation_round_search { get; set; }
}
}

View File

@@ -145,8 +145,22 @@ namespace TodoAPI2.Models
{
var item = Get(id);
var i = item;
var option_1 = new external_linkageViewModel();
option_1.id_guid = Guid.Empty;
option_1.external_name = "ทั้งหมด";
var option_all = new List<external_linkageViewModel>();
option_all.Add(option_1);
i.item_org_id = ext.GetDepartmentData();
var allround = (from y in _repository.Context.eva_create_evaluation
select y.performance_plan_id).ToList();
i.item_evaluation_round_search = option_all.Union((from x in _repository.Context.eva_performance_plan
where allround.Contains(x.id)
orderby x.fiscal_year descending, x.theTime descending
select new external_linkageViewModel { id_guid = x.id, external_name = checkNull(x.theTime) + "/" + checkNull(x.fiscal_year) }
)).ToList();
return i;
}
@@ -155,6 +169,19 @@ namespace TodoAPI2.Models
var i = new eva_create_evaluation_detail_agreementWithSelectionViewModel();
i.item_org_id = ext.GetDepartmentData();
var option_1 = new external_linkageViewModel();
option_1.id_guid = Guid.Empty;
option_1.external_name = "ทั้งหมด";
var option_all = new List<external_linkageViewModel>();
option_all.Add(option_1);
var allround = (from y in _repository.Context.eva_create_evaluation
select y.performance_plan_id).ToList();
i.item_evaluation_round_search = option_all.Union((from x in _repository.Context.eva_performance_plan
where allround.Contains(x.id)
orderby x.fiscal_year descending, x.theTime descending
select new external_linkageViewModel { id_guid = x.id, external_name = checkNull(x.theTime) + "/" + checkNull(x.fiscal_year) }
)).ToList();
return i;
}
@@ -168,6 +195,17 @@ namespace TodoAPI2.Models
public List<eva_create_evaluation_detail_agreementViewModel> GetListBySearch(eva_create_evaluation_detail_agreementSearchModel model, int? emp_id)
{
if (string.IsNullOrEmpty(model.evaluation_round_search))
{
model.evaluation_round_search = (from x in _repository.Context.eva_performance_plan
orderby x.fiscal_year descending, x.theTime descending
select new external_linkageViewModel { id_guid = x.id, external_name = checkNull(x.theTime) + "/" + checkNull(x.fiscal_year) }
).FirstOrDefault().id_guid.ToString();
}
else if (Guid.Parse(model.evaluation_round_search) == Guid.Empty)
{
model.evaluation_round_search = null;
}
var allemp = emp.GetListByemployee_type(null, null);
@@ -196,6 +234,7 @@ namespace TodoAPI2.Models
&& (fk_external_employee.employee_no == model.search_employee_code || string.IsNullOrEmpty(model.search_employee_code))
&& (fk_external_employee.fullname.Contains(model.search_employee_fullname) || string.IsNullOrEmpty(model.search_employee_fullname))
&& m_eva_create_evaluation_detail_agreement.employee_id == emp_id
&& (string.IsNullOrEmpty(model.evaluation_round_search) || fk_planResult.id == Guid.Parse(model.evaluation_round_search))
orderby m_eva_create_evaluation_detail_agreement.created descending
select new eva_create_evaluation_detail_agreementViewModel()

View File

@@ -89,6 +89,8 @@ namespace TodoAPI2.Models
return "";
}
public string evaluation_round_search { get; set; }
}
}

View File

@@ -8,6 +8,6 @@ namespace TodoAPI2.Models
public class eva_create_evaluation_detail_agreementWithSelectionViewModel: eva_create_evaluation_detail_agreementViewModel
{
public List<external_linkageViewModel> item_org_id { get; set; }
public List<external_linkageViewModel> item_evaluation_round_search { get; set; }
}
}

View File

@@ -94,7 +94,7 @@
<input class="form-control" type="number" id="s_eva_adjust_postponement_normal_theRound" iLabel="ครั้งที่เลื่อน" iRequire="true" iGroup="s_eva_adjust_postponement_normal" title='ครั้งที่เลื่อน' placeholder='ครั้งที่เลื่อน' />
</div>
<div class="form-group col-md-3">
<div class="form-group col-md-3" style="display:none;">
<label id='lab_s_eva_adjust_postponement_normal_org_id' for='s_eva_adjust_postponement_normal_org_id'>หน่วยงาน</label>
<select class="form-control" id="s_eva_adjust_postponement_normal_org_id" iLabel="หน่วยงาน" iRequire="true" iGroup="s_eva_adjust_postponement_normal" title='หน่วยงาน' placeholder='หน่วยงาน'></select>
</div>

View File

@@ -82,16 +82,26 @@
<div class="tools">
<div class="row">
<div class="form-group col-md-3">
<div class="form-group col-md-3" style="display:none;">
<label id='lab_s_eva_adjust_postponement_quota_fiscal_year' for='s_eva_adjust_postponement_quota_fiscal_year'>ปีงบประมาณ </label>
<input class="form-control" type="number" id="s_eva_adjust_postponement_quota_fiscal_year" iLabel="ปีงบประมาณ " iRequire="true" iGroup="s_eva_adjust_postponement_quota" title='ปีงบประมาณ ' placeholder='ปีงบประมาณ ' />
</div>
<div class="form-group col-md-3">
<div class="form-group col-md-3" style="display:none;">
<label id='lab_s_eva_adjust_postponement_quota_theRound' for='s_eva_adjust_postponement_quota_theRound'>ครั้งที่เลื่อน</label>
<input class="form-control" type="number" id="s_eva_adjust_postponement_quota_theRound" iLabel="ครั้งที่เลื่อน" iRequire="true" iGroup="s_eva_adjust_postponement_quota" title='ครั้งที่เลื่อน' placeholder='ครั้งที่เลื่อน' />
</div>
<div class="form-group col-md-3">
<label id='lab_s_eva_adjust_postponement_quota_fiscal_year_search' for='s_eva_adjust_postponement_quota_fiscal_year_search'>ปีงบประมาณ </label>
<select class="form-control" id="s_eva_adjust_postponement_quota_fiscal_year_search" iLabel="ปีงบประมาณ " iRequire="false" iGroup="s_eva_adjust_postponement_quota" title='ปีงบประมาณ ' placeholder='ปีงบประมาณ '></select>
</div>
<div class="form-group col-md-3">
<label id='lab_s_eva_adjust_postponement_quota_theRound_search' for='s_eva_adjust_postponement_quota_theRound_search'>ครั้งที่เลื่อน</label>
<select class="form-control" id="s_eva_adjust_postponement_quota_theRound_search" iLabel="ครั้งที่เลื่อน" iRequire="false" iGroup="s_eva_adjust_postponement_quota" title='ครั้งที่เลื่อน' placeholder='ครั้งที่เลื่อน'></select>
</div>
<div class="col-md-3">
<br />
<button class="btn btn-info" onclick="javascript:eva_adjust_postponement_quota_DoSearch();"><i class="fa fa-search" style="font-size: 14px;"></i> ค้นหา</button>

View File

@@ -28,19 +28,22 @@
<div class="tools">
<div class="row">
<input class="form-control" type="hidden" id="s_eva_create_evaluation_detail_agreement_create_evaluation_id" />
<div class="form-group col-md-3">
<label id='lab_s_eva_create_evaluation_detail_agreement_evaluation_round_search' for='s_eva_create_evaluation_detail_agreement_evaluation_round_search'>รอบการประเมิน</label>
<select class="form-control" id="s_eva_create_evaluation_detail_agreement_evaluation_round_search" iLabel="รอบการประเมิน" iRequire="false" iGroup="s_eva_create_evaluation_detail_agreement" title='รอบการประเมิน' placeholder='รอบการประเมิน'></select>
</div>
<div class="form-group col-md-3" style="display:none;">
<label id='lab_s_eva_create_evaluation_detail_agreement_org_id' for='s_eva_create_evaluation_detail_agreement_org_id'>หน่วยงาน</label>
<select class="form-control" id="s_eva_create_evaluation_detail_agreement_org_id" iLabel="หน่วยงาน" iRequire="true" iGroup="s_eva_create_evaluation_detail_agreement" title='หน่วยงาน' placeholder='หน่วยงาน'></select>
</div>
<div class="form-group col-md-3">
<div class="form-group col-md-3" style="display:none;">
<label id='lab_s_eva_create_evaluation_detail_agreement_search_employee_code' for='s_eva_create_evaluation_detail_agreement_search_employee_code'>รหัสพนักงาน</label>
<input class="form-control" type="text" id="s_eva_create_evaluation_detail_agreement_search_employee_code" iLabel="รหัสพนักงาน" iRequire="true" iGroup="s_eva_create_evaluation_detail_agreement" title='รหัสพนักงาน' placeholder='รหัสพนักงาน' />
</div>
<div class="form-group col-md-3">
<div class="form-group col-md-3" style="display:none;">
<label id='lab_s_eva_create_evaluation_detail_agreement_search_employee_fullname' for='s_eva_create_evaluation_detail_agreement_search_employee_fullname'>ชื่อ-สกุล</label>
<input class="form-control" type="text" id="s_eva_create_evaluation_detail_agreement_search_employee_fullname" iLabel="ชื่อ-สกุล" iRequire="true" iGroup="s_eva_create_evaluation_detail_agreement" title='ชื่อ-สกุล' placeholder='ชื่อ-สกุล' />
</div>

View File

@@ -7,6 +7,8 @@ function eva_adjust_postponement_quota_GetSearchParameter() {
var eva_adjust_postponement_quotaSearchObject = new Object();
eva_adjust_postponement_quotaSearchObject.fiscal_year = $("#s_eva_adjust_postponement_quota_fiscal_year").val();
eva_adjust_postponement_quotaSearchObject.theRound = $("#s_eva_adjust_postponement_quota_theRound").val();
eva_adjust_postponement_quotaSearchObject.fiscal_year_search = $("#s_eva_adjust_postponement_quota_fiscal_year_search").val();
eva_adjust_postponement_quotaSearchObject.theRound_search = $("#s_eva_adjust_postponement_quota_theRound_search").val();
return eva_adjust_postponement_quotaSearchObject;
}
@@ -15,6 +17,9 @@ function eva_adjust_postponement_quota_FeedDataToSearchForm(data) {
$("#s_eva_adjust_postponement_quota_fiscal_year").val(data.fiscal_year);
$("#s_eva_adjust_postponement_quota_theRound").val(data.theRound);
DropDownClearFormAndFeedWithData($("#s_eva_adjust_postponement_quota_fiscal_year_search"), data, "external_id", "external_name", "item_fiscal_year_search", data.fiscal_year_search);
DropDownClearFormAndFeedWithData($("#s_eva_adjust_postponement_quota_theRound_search"), data, "external_id", "external_name", "item_theRound_search", data.theRound_search);
}
//================= Form Data Customizaiton =========================================

View File

@@ -9,6 +9,8 @@ function eva_create_evaluation_detail_agreement_GetSearchParameter() {
eva_create_evaluation_detail_agreementSearchObject.org_id = $("#s_eva_create_evaluation_detail_agreement_org_id").val();
eva_create_evaluation_detail_agreementSearchObject.search_employee_code = $("#s_eva_create_evaluation_detail_agreement_search_employee_code").val();
eva_create_evaluation_detail_agreementSearchObject.search_employee_fullname = $("#s_eva_create_evaluation_detail_agreement_search_employee_fullname").val();
eva_create_evaluation_detail_agreementSearchObject.evaluation_round_search = $("#s_eva_create_evaluation_detail_agreement_evaluation_round_search").val();
return eva_create_evaluation_detail_agreementSearchObject;
}
@@ -18,6 +20,7 @@ function eva_create_evaluation_detail_agreement_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_agreement_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#s_eva_create_evaluation_detail_agreement_search_employee_code").val(data.search_employee_code);
$("#s_eva_create_evaluation_detail_agreement_search_employee_fullname").val(data.search_employee_fullname);
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_agreement_evaluation_round_search"), data, "id_guid", "external_name", "item_evaluation_round_search", data.evaluation_round_search);
}