รวมหน้าจอ วงเงินที่ใช้ในการเลื่อนเงินเดือน

This commit is contained in:
Nakorn Rientrakrunchai
2021-03-04 22:25:37 +07:00
parent 309d1a5e16
commit 9530d1aa37
34 changed files with 3220 additions and 550 deletions

View File

@@ -5,48 +5,48 @@ var eva_limit_frame_employee_API = "/api/eva_limit_frame_employee/";
function eva_limit_frame_employee_GetSearchParameter() {
var eva_limit_frame_employeeSearchObject = new Object();
eva_limit_frame_employeeSearchObject.frame_group_guid = $("#s_eva_limit_frame_employee_frame_group_guid").val();
eva_limit_frame_employeeSearchObject.employee_id = $("#s_eva_limit_frame_employee_employee_id").val();
eva_limit_frame_employeeSearchObject.frame_group_guid = getUrlParameter("id");
eva_limit_frame_employeeSearchObject.employee_id = $("#s_eva_limit_frame_employee_employee_id").val();
return eva_limit_frame_employeeSearchObject;
}
function eva_limit_frame_employee_FeedDataToSearchForm(data) {
$("#s_eva_limit_frame_employee_frame_group_guid").val(data.frame_group_guid);
DropDownClearFormAndFeedWithData($("#s_eva_limit_frame_employee_employee_id"), data, "id", "external_name", "item_employee_id", data.employee_id);
$("#s_eva_limit_frame_employee_frame_group_guid").val(data.frame_group_guid);
DropDownClearFormAndFeedWithData($("#s_eva_limit_frame_employee_employee_id"), data, "id", "external_name", "item_employee_id", data.employee_id);
}
//================= Form Data Customizaiton =========================================
function eva_limit_frame_employee_FeedDataToForm(data) {
$("#eva_limit_frame_employee_id").val(data.id);
$("#eva_limit_frame_employee_frame_group_guid").val(data.frame_group_guid);
DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_employee_id"), data, "id", "external_name", "item_employee_id", data.employee_id);
DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#eva_limit_frame_employee_position_text").val(data.position_text);
$("#eva_limit_frame_employee_level_text").val(data.level_text);
$("#eva_limit_frame_employee_salary").val(data.salary);
$("#eva_limit_frame_employee_position_allowance").val(data.position_allowance);
$("#eva_limit_frame_employee_monthly_remuneration").val(data.monthly_remuneration);
$("#eva_limit_frame_employee_cost_of_living").val(data.cost_of_living);
$("#eva_limit_frame_employee_order_of_data").val(data.order_of_data);
$("#eva_limit_frame_employee_id").val(data.id);
$("#eva_limit_frame_employee_frame_group_guid").val(data.frame_group_guid);
DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#eva_limit_frame_employee_position_text").val(data.position_text);
$("#eva_limit_frame_employee_level_text").val(data.level_text);
$("#eva_limit_frame_employee_salary").val(data.salary);
$("#eva_limit_frame_employee_position_allowance").val(data.position_allowance);
$("#eva_limit_frame_employee_monthly_remuneration").val(data.monthly_remuneration);
$("#eva_limit_frame_employee_cost_of_living").val(data.cost_of_living);
$("#eva_limit_frame_employee_order_of_data").val(data.order_of_data);
console.log(data);
}
function eva_limit_frame_employee_GetFromForm() {
var eva_limit_frame_employeeObject = new Object();
eva_limit_frame_employeeObject.id = $("#eva_limit_frame_employee_id").val();
eva_limit_frame_employeeObject.frame_group_guid = $("#eva_limit_frame_employee_frame_group_guid").val();
eva_limit_frame_employeeObject.employee_id = $("#eva_limit_frame_employee_employee_id").val();
eva_limit_frame_employeeObject.org_id = $("#eva_limit_frame_employee_org_id").val();
eva_limit_frame_employeeObject.position_text = $("#eva_limit_frame_employee_position_text").val();
eva_limit_frame_employeeObject.level_text = $("#eva_limit_frame_employee_level_text").val();
eva_limit_frame_employeeObject.salary = $("#eva_limit_frame_employee_salary").val();
eva_limit_frame_employeeObject.position_allowance = $("#eva_limit_frame_employee_position_allowance").val();
eva_limit_frame_employeeObject.monthly_remuneration = $("#eva_limit_frame_employee_monthly_remuneration").val();
eva_limit_frame_employeeObject.cost_of_living = $("#eva_limit_frame_employee_cost_of_living").val();
eva_limit_frame_employeeObject.order_of_data = $("#eva_limit_frame_employee_order_of_data").val();
eva_limit_frame_employeeObject.id = $("#eva_limit_frame_employee_id").val();
eva_limit_frame_employeeObject.frame_group_guid = getUrlParameter("id");
eva_limit_frame_employeeObject.employee_id = $("#eva_limit_frame_employee_employee_id").val();
eva_limit_frame_employeeObject.org_id = $("#eva_limit_frame_employee_org_id").val();
eva_limit_frame_employeeObject.position_text = $("#eva_limit_frame_employee_position_text").val();
eva_limit_frame_employeeObject.level_text = $("#eva_limit_frame_employee_level_text").val();
eva_limit_frame_employeeObject.salary = $("#eva_limit_frame_employee_salary").val();
eva_limit_frame_employeeObject.position_allowance = $("#eva_limit_frame_employee_position_allowance").val();
eva_limit_frame_employeeObject.monthly_remuneration = $("#eva_limit_frame_employee_monthly_remuneration").val();
eva_limit_frame_employeeObject.cost_of_living = $("#eva_limit_frame_employee_cost_of_living").val();
eva_limit_frame_employeeObject.order_of_data = $("#eva_limit_frame_employee_order_of_data").val();
return eva_limit_frame_employeeObject;
@@ -55,14 +55,14 @@ eva_limit_frame_employeeObject.order_of_data = $("#eva_limit_frame_employee_orde
function eva_limit_frame_employee_InitialForm(s) {
var successFunc = function (result) {
eva_limit_frame_employee_FeedDataToForm(result);
eva_limit_frame_employee_FeedDataToSearchForm(result);
eva_limit_frame_employee_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_limit_frame_employeeModel").modal("show");
}
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxGetRequest(apisite + eva_limit_frame_employee_API + "GetBlankItem", successFunc, AlertDanger);
}
@@ -89,15 +89,15 @@ function eva_limit_frame_employee_SetEditForm(a) {
eva_limit_frame_employee_editMode = "UPDATE";
eva_limit_frame_employee_FeedDataToForm(result);
$("#eva_limit_frame_employeeModel").modal("show");
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxGetRequest(apisite + eva_limit_frame_employee_API + a, successFunc, AlertDanger);
}
function eva_limit_frame_employee_SetCreateForm(s) {
eva_limit_frame_employee_editMode = "CREATE";
eva_limit_frame_employee_InitialForm(s);
eva_limit_frame_employee_InitialForm(s);
}
function eva_limit_frame_employee_RefreshTable() {
@@ -115,8 +115,7 @@ var eva_limit_frame_employee_customValidation = function (group) {
};
function eva_limit_frame_employee_PutUpdate() {
if (!ValidateForm('eva_limit_frame_employee', eva_limit_frame_employee_customValidation))
{
if (!ValidateForm('eva_limit_frame_employee', eva_limit_frame_employee_customValidation)) {
return;
}
@@ -126,22 +125,22 @@ function eva_limit_frame_employee_PutUpdate() {
if (eva_limit_frame_employee_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_limit_frame_employeeModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
AlertSuccess(result.code + " " + result.message);
eva_limit_frame_employee_RefreshTable();
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxPutRequest(apisite + eva_limit_frame_employee_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_limit_frame_employeeModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
AlertSuccess(result.code + " " + result.message);
eva_limit_frame_employee_RefreshTable();
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxPostRequest(apisite + eva_limit_frame_employee_API, data, successFunc2, AlertDanger);
}
}
@@ -150,11 +149,11 @@ function eva_limit_frame_employee_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_limit_frame_employeeModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
AlertSuccess(result.code + " " + result.message);
eva_limit_frame_employee_RefreshTable();
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxDeleteRequest(apisite + eva_limit_frame_employee_API + a, null, successFunc, AlertDanger);
}
}
@@ -164,37 +163,38 @@ function eva_limit_frame_employee_GoDelete(a) {
var eva_limit_frame_employeeTableV;
var eva_limit_frame_employee_setupTable = function (result) {
tmp = '"';
tmp = '"';
var groupColumn = 3;
eva_limit_frame_employeeTableV = $('#eva_limit_frame_employeeTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
//"select": {
//"select": {
// "style": 'multi'
//},
"columns": [
//{ "data": "" },
{ "data": "id" },
{ "data": "id" },
{ "data": "frame_group_guid_eva_limit_frame_group_group_guid" },
{ "data": "employee_id_external_linkage_external_name" },
{ "data": "org_id_external_linkage_external_name" },
{ "data": "position_text" },
{ "data": "level_text" },
{ "data": "salary" },
{ "data": "position_allowance" },
{ "data": "monthly_remuneration" },
{ "data": "cost_of_living" },
{ "data": "order_of_data" },
//{ "data": "" },
{ "data": "id" },
{ "data": "order_of_data" },
{ "data": "employee_id_external_linkage_external_name" },
{ "data": "org_id_external_linkage_external_name" },
{ "data": "position_text" },
{ "data": "level_text" },
{ "data": "salary" },
{ "data": "position_allowance" },
{ "data": "monthly_remuneration" },
{ "data": "cost_of_living" },
],
"columnDefs": [
{
"targets": 0, //1,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_limit_frame_employee_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_limit_frame_employee_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_limit_frame_employee_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button style='display:none;' type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_limit_frame_employee_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
},
{ "visible": false, "targets": groupColumn }
//{
// targets: 0,
// data: "",
@@ -202,20 +202,35 @@ var eva_limit_frame_employee_setupTable = function (result) {
// orderable: false,
// className: 'select-checkbox'
//}
],
],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"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="10">' + group + '</td></tr>'
);
last = group;
}
});
}
});
endLoad();
endLoad();
};
function eva_limit_frame_employee_InitiateDataTable() {
startLoad();
var p = $.param(eva_limit_frame_employee_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_limit_frame_employee/GetListBySearch?"+p, eva_limit_frame_employee_setupTable, AlertDanger);
startLoad();
var p = $.param(eva_limit_frame_employee_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_limit_frame_employee/GetListBySearch?" + p, eva_limit_frame_employee_setupTable, AlertDanger);
}
function eva_limit_frame_employee_DoSearch() {
@@ -223,10 +238,10 @@ function eva_limit_frame_employee_DoSearch() {
var eva_limit_frame_employee_reload = function (result) {
eva_limit_frame_employeeTableV.destroy();
eva_limit_frame_employee_setupTable(result);
endLoad();
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_limit_frame_employee/GetListBySearch?"+p, eva_limit_frame_employee_reload, AlertDanger);
startLoad();
AjaxGetRequest(apisite + "/api/eva_limit_frame_employee/GetListBySearch?" + p, eva_limit_frame_employee_reload, AlertDanger);
}
function eva_limit_frame_employee_GetSelect(f) {

View File

@@ -5,42 +5,42 @@ var eva_limit_frame_group_API = "/api/eva_limit_frame_group/";
function eva_limit_frame_group_GetSearchParameter() {
var eva_limit_frame_groupSearchObject = new Object();
eva_limit_frame_groupSearchObject.frame_plan_guid = $("#s_eva_limit_frame_group_frame_plan_guid").val();
eva_limit_frame_groupSearchObject.group_guid = $("#s_eva_limit_frame_group_group_guid").val();
eva_limit_frame_groupSearchObject.frame_plan_guid = getUrlParameter("id");
eva_limit_frame_groupSearchObject.group_guid = $("#s_eva_limit_frame_group_group_guid").val();
return eva_limit_frame_groupSearchObject;
}
function eva_limit_frame_group_FeedDataToSearchForm(data) {
$("#s_eva_limit_frame_group_frame_plan_guid").val(data.frame_plan_guid);
DropDownClearFormAndFeedWithData($("#s_eva_limit_frame_group_group_guid"), data, "id", "code", "item_group_guid", data.group_guid);
$("#s_eva_limit_frame_group_frame_plan_guid").val(data.frame_plan_guid);
DropDownClearFormAndFeedWithData($("#s_eva_limit_frame_group_group_guid"), data, "id", "code", "item_group_guid", data.group_guid);
}
//================= Form Data Customizaiton =========================================
function eva_limit_frame_group_FeedDataToForm(data) {
$("#eva_limit_frame_group_id").val(data.id);
$("#eva_limit_frame_group_frame_plan_guid").val(data.frame_plan_guid);
DropDownClearFormAndFeedWithData($("#eva_limit_frame_group_group_guid"), data, "id", "code", "item_group_guid", data.group_guid);
$("#eva_limit_frame_group_limit_frame_295").val(data.limit_frame_295);
$("#eva_limit_frame_group_total_salary").val(data.total_salary);
$("#eva_limit_frame_group_total_salary_limit").val(data.total_salary_limit);
$("#eva_limit_frame_group_total_salary_limit_rounded").val(data.total_salary_limit_rounded);
$("#eva_limit_frame_group_remark").val(data.remark);
$("#eva_limit_frame_group_id").val(data.id);
$("#eva_limit_frame_group_frame_plan_guid").val(data.frame_plan_guid);
DropDownClearFormAndFeedWithData($("#eva_limit_frame_group_group_guid"), data, "id", "code", "item_group_guid", data.group_guid);
$("#eva_limit_frame_group_limit_frame_295").val(data.limit_frame_295);
$("#eva_limit_frame_group_total_salary").val(data.total_salary);
$("#eva_limit_frame_group_total_salary_limit").val(data.total_salary_limit);
$("#eva_limit_frame_group_total_salary_limit_rounded").val(data.total_salary_limit_rounded);
$("#eva_limit_frame_group_remark").val(data.remark);
}
function eva_limit_frame_group_GetFromForm() {
var eva_limit_frame_groupObject = new Object();
eva_limit_frame_groupObject.id = $("#eva_limit_frame_group_id").val();
eva_limit_frame_groupObject.frame_plan_guid = $("#eva_limit_frame_group_frame_plan_guid").val();
eva_limit_frame_groupObject.group_guid = $("#eva_limit_frame_group_group_guid").val();
eva_limit_frame_groupObject.limit_frame_295 = $("#eva_limit_frame_group_limit_frame_295").val();
eva_limit_frame_groupObject.total_salary = $("#eva_limit_frame_group_total_salary").val();
eva_limit_frame_groupObject.total_salary_limit = $("#eva_limit_frame_group_total_salary_limit").val();
eva_limit_frame_groupObject.total_salary_limit_rounded = $("#eva_limit_frame_group_total_salary_limit_rounded").val();
eva_limit_frame_groupObject.remark = $("#eva_limit_frame_group_remark").val();
eva_limit_frame_groupObject.id = $("#eva_limit_frame_group_id").val();
eva_limit_frame_groupObject.frame_plan_guid = $("#eva_limit_frame_group_frame_plan_guid").val();
eva_limit_frame_groupObject.group_guid = $("#eva_limit_frame_group_group_guid").val();
eva_limit_frame_groupObject.limit_frame_295 = $("#eva_limit_frame_group_limit_frame_295").val();
eva_limit_frame_groupObject.total_salary = $("#eva_limit_frame_group_total_salary").val();
eva_limit_frame_groupObject.total_salary_limit = $("#eva_limit_frame_group_total_salary_limit").val();
eva_limit_frame_groupObject.total_salary_limit_rounded = $("#eva_limit_frame_group_total_salary_limit_rounded").val();
eva_limit_frame_groupObject.remark = $("#eva_limit_frame_group_remark").val();
return eva_limit_frame_groupObject;
@@ -49,14 +49,14 @@ eva_limit_frame_groupObject.remark = $("#eva_limit_frame_group_remark").val();
function eva_limit_frame_group_InitialForm(s) {
var successFunc = function (result) {
eva_limit_frame_group_FeedDataToForm(result);
eva_limit_frame_group_FeedDataToSearchForm(result);
eva_limit_frame_group_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_limit_frame_groupModel").modal("show");
}
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxGetRequest(apisite + eva_limit_frame_group_API + "GetBlankItem", successFunc, AlertDanger);
}
@@ -72,10 +72,10 @@ function eva_limit_frame_group_GoCreate() {
function eva_limit_frame_group_GoEdit(a) {
// Incase model popup
eva_limit_frame_group_SetEditForm(a);
//eva_limit_frame_group_SetEditForm(a);
// Incase open new page
//window_open(appsite + "/eva_limit_frame_groupView/eva_limit_frame_group_d?id=" + a);
window_open(appsite + "/eva_limit_frame_groupView/eva_limit_frame_group_d?id=" + a);
}
function eva_limit_frame_group_SetEditForm(a) {
@@ -83,15 +83,15 @@ function eva_limit_frame_group_SetEditForm(a) {
eva_limit_frame_group_editMode = "UPDATE";
eva_limit_frame_group_FeedDataToForm(result);
$("#eva_limit_frame_groupModel").modal("show");
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxGetRequest(apisite + eva_limit_frame_group_API + a, successFunc, AlertDanger);
}
function eva_limit_frame_group_SetCreateForm(s) {
eva_limit_frame_group_editMode = "CREATE";
eva_limit_frame_group_InitialForm(s);
eva_limit_frame_group_InitialForm(s);
}
function eva_limit_frame_group_RefreshTable() {
@@ -109,8 +109,7 @@ var eva_limit_frame_group_customValidation = function (group) {
};
function eva_limit_frame_group_PutUpdate() {
if (!ValidateForm('eva_limit_frame_group', eva_limit_frame_group_customValidation))
{
if (!ValidateForm('eva_limit_frame_group', eva_limit_frame_group_customValidation)) {
return;
}
@@ -120,22 +119,22 @@ function eva_limit_frame_group_PutUpdate() {
if (eva_limit_frame_group_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_limit_frame_groupModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
AlertSuccess(result.code + " " + result.message);
eva_limit_frame_group_RefreshTable();
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxPutRequest(apisite + eva_limit_frame_group_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_limit_frame_groupModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
AlertSuccess(result.code + " " + result.message);
eva_limit_frame_group_RefreshTable();
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxPostRequest(apisite + eva_limit_frame_group_API, data, successFunc2, AlertDanger);
}
}
@@ -144,11 +143,11 @@ function eva_limit_frame_group_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_limit_frame_groupModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
AlertSuccess(result.code + " " + result.message);
eva_limit_frame_group_RefreshTable();
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxDeleteRequest(apisite + eva_limit_frame_group_API + a, null, successFunc, AlertDanger);
}
}
@@ -158,32 +157,30 @@ function eva_limit_frame_group_GoDelete(a) {
var eva_limit_frame_groupTableV;
var eva_limit_frame_group_setupTable = function (result) {
tmp = '"';
tmp = '"';
eva_limit_frame_groupTableV = $('#eva_limit_frame_groupTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
//"select": {
//"select": {
// "style": 'multi'
//},
"columns": [
//{ "data": "" },
{ "data": "id" },
{ "data": "id" },
{ "data": "frame_plan_guid_eva_limit_frame_plan_executed_date" },
{ "data": "group_guid_eva_evaluation_group_code" },
{ "data": "limit_frame_295" },
{ "data": "total_salary" },
{ "data": "total_salary_limit" },
{ "data": "total_salary_limit_rounded" },
{ "data": "remark" },
//{ "data": "" },
{ "data": "id" },
{ "data": "group_guid_eva_evaluation_group_code" },
{ "data": "limit_frame_295" },
{ "data": "total_salary" },
{ "data": "total_salary_limit" },
{ "data": "total_salary_limit_rounded" },
{ "data": "remark" },
],
"columnDefs": [
{
"targets": 0, //1,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_limit_frame_group_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_limit_frame_group_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_limit_frame_group_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button style='display:none;' type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_limit_frame_group_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
},
//{
@@ -193,20 +190,20 @@ var eva_limit_frame_group_setupTable = function (result) {
// orderable: false,
// className: 'select-checkbox'
//}
],
],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
"paging": false,
"searching": false
});
endLoad();
endLoad();
};
function eva_limit_frame_group_InitiateDataTable() {
startLoad();
var p = $.param(eva_limit_frame_group_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_limit_frame_group/GetListBySearch?"+p, eva_limit_frame_group_setupTable, AlertDanger);
startLoad();
var p = $.param(eva_limit_frame_group_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_limit_frame_group/GetListBySearch?" + p, eva_limit_frame_group_setupTable, AlertDanger);
}
function eva_limit_frame_group_DoSearch() {
@@ -214,10 +211,10 @@ function eva_limit_frame_group_DoSearch() {
var eva_limit_frame_group_reload = function (result) {
eva_limit_frame_groupTableV.destroy();
eva_limit_frame_group_setupTable(result);
endLoad();
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_limit_frame_group/GetListBySearch?"+p, eva_limit_frame_group_reload, AlertDanger);
startLoad();
AjaxGetRequest(apisite + "/api/eva_limit_frame_group/GetListBySearch?" + p, eva_limit_frame_group_reload, AlertDanger);
}
function eva_limit_frame_group_GetSelect(f) {

View File

@@ -4,27 +4,27 @@ var eva_limit_frame_group_API = "/api/eva_limit_frame_group/";
//================= Form Data Customizaiton =========================================
function eva_limit_frame_group_FeedDataToForm(data) {
$("#eva_limit_frame_group_id").val(data.id);
$("#eva_limit_frame_group_frame_plan_guid").val(data.frame_plan_guid);
DropDownClearFormAndFeedWithData($("#eva_limit_frame_group_group_guid"), data, "id", "code", "item_group_guid", data.group_guid);
$("#eva_limit_frame_group_limit_frame_295").val(data.limit_frame_295);
$("#eva_limit_frame_group_total_salary").val(data.total_salary);
$("#eva_limit_frame_group_total_salary_limit").val(data.total_salary_limit);
$("#eva_limit_frame_group_total_salary_limit_rounded").val(data.total_salary_limit_rounded);
$("#eva_limit_frame_group_remark").val(data.remark);
$("#eva_limit_frame_group_id").val(data.id);
$("#eva_limit_frame_group_frame_plan_guid").val(data.frame_plan_guid);
DropDownClearFormAndFeedWithData($("#eva_limit_frame_group_group_guid"), data, "id", "thegroup", "item_group_guid", data.group_guid);
$("#eva_limit_frame_group_limit_frame_295").val(data.limit_frame_295);
$("#eva_limit_frame_group_total_salary").val(data.total_salary);
$("#eva_limit_frame_group_total_salary_limit").val(data.total_salary_limit);
$("#eva_limit_frame_group_total_salary_limit_rounded").val(data.total_salary_limit_rounded);
$("#eva_limit_frame_group_remark").val(data.remark);
}
function eva_limit_frame_group_GetFromForm() {
var eva_limit_frame_groupObject = new Object();
eva_limit_frame_groupObject.id = $("#eva_limit_frame_group_id").val();
eva_limit_frame_groupObject.frame_plan_guid = $("#eva_limit_frame_group_frame_plan_guid").val();
eva_limit_frame_groupObject.group_guid = $("#eva_limit_frame_group_group_guid").val();
eva_limit_frame_groupObject.limit_frame_295 = $("#eva_limit_frame_group_limit_frame_295").val();
eva_limit_frame_groupObject.total_salary = $("#eva_limit_frame_group_total_salary").val();
eva_limit_frame_groupObject.total_salary_limit = $("#eva_limit_frame_group_total_salary_limit").val();
eva_limit_frame_groupObject.total_salary_limit_rounded = $("#eva_limit_frame_group_total_salary_limit_rounded").val();
eva_limit_frame_groupObject.remark = $("#eva_limit_frame_group_remark").val();
eva_limit_frame_groupObject.id = $("#eva_limit_frame_group_id").val();
eva_limit_frame_groupObject.frame_plan_guid = $("#eva_limit_frame_group_frame_plan_guid").val();
eva_limit_frame_groupObject.group_guid = $("#eva_limit_frame_group_group_guid").val();
eva_limit_frame_groupObject.limit_frame_295 = $("#eva_limit_frame_group_limit_frame_295").val();
eva_limit_frame_groupObject.total_salary = $("#eva_limit_frame_group_total_salary").val();
eva_limit_frame_groupObject.total_salary_limit = $("#eva_limit_frame_group_total_salary_limit").val();
eva_limit_frame_groupObject.total_salary_limit_rounded = $("#eva_limit_frame_group_total_salary_limit_rounded").val();
eva_limit_frame_groupObject.remark = $("#eva_limit_frame_group_remark").val();
return eva_limit_frame_groupObject;
@@ -33,9 +33,9 @@ eva_limit_frame_groupObject.remark = $("#eva_limit_frame_group_remark").val();
function eva_limit_frame_group_InitialForm() {
var successFunc = function (result) {
eva_limit_frame_group_FeedDataToForm(result);
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxGetRequest(apisite + eva_limit_frame_group_API + "GetBlankItem", successFunc, AlertDanger);
}
@@ -45,15 +45,15 @@ function eva_limit_frame_group_SetEditForm(a) {
var successFunc = function (result) {
eva_limit_frame_group_editMode = "UPDATE";
eva_limit_frame_group_FeedDataToForm(result);
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxGetRequest(apisite + eva_limit_frame_group_API + a, successFunc, AlertDanger);
}
function eva_limit_frame_group_SetCreateForm() {
eva_limit_frame_group_editMode = "CREATE";
eva_limit_frame_group_InitialForm();
eva_limit_frame_group_InitialForm();
}
//================= Update and Delete =========================================
@@ -63,8 +63,7 @@ var eva_limit_frame_group_customValidation = function (group) {
};
function eva_limit_frame_group_PutUpdate() {
if (!ValidateForm('eva_limit_frame_group', eva_limit_frame_group_customValidation))
{
if (!ValidateForm('eva_limit_frame_group', eva_limit_frame_group_customValidation)) {
return;
}
var data = eva_limit_frame_group_GetFromForm();
@@ -72,19 +71,19 @@ function eva_limit_frame_group_PutUpdate() {
//Update Mode
if (eva_limit_frame_group_editMode === "UPDATE") {
var successFunc1 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
AlertSuccess(result.code + " " + result.message);
endLoad();
};
startLoad();
startLoad();
AjaxPutRequest(apisite + eva_limit_frame_group_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
AlertSuccess(result.code + " " + result.message);
endLoad();
};
startLoad();
startLoad();
AjaxPostRequest(apisite + eva_limit_frame_group_API, data, successFunc2, AlertDanger);
}
}
@@ -92,11 +91,11 @@ function eva_limit_frame_group_PutUpdate() {
function eva_limit_frame_group_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.code+" "+result.message);
AlertSuccess(result.code + " " + result.message);
eva_limit_frame_group_RefreshTable();
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxDeleteRequest(apisite + eva_limit_frame_group_API + a, null, successFunc, AlertDanger);
}
}

View File

@@ -4,7 +4,7 @@
function rep_eva_limit_frame_plan_GetSearchParameter(fileType) {
var rep_eva_limit_frame_planSearchObject = new Object();
rep_eva_limit_frame_planSearchObject.frame_plan_guid = $("#s_rep_eva_limit_frame_plan_frame_plan_guid").val();
rep_eva_limit_frame_planSearchObject.frame_plan_guid = getUrlParameter("id");
rep_eva_limit_frame_planSearchObject.fileType = fileType;
@@ -15,7 +15,7 @@ rep_eva_limit_frame_planSearchObject.frame_plan_guid = $("#s_rep_eva_limit_frame
}
function rep_eva_limit_frame_plan_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_rep_eva_limit_frame_plan_frame_plan_guid"), data, "id", "executed_date", "item_frame_plan_guid", data.frame_plan_guid);
DropDownClearFormAndFeedWithData($("#s_rep_eva_limit_frame_plan_frame_plan_guid"), data, "id", "executed_date", "item_frame_plan_guid", data.frame_plan_guid);
}
@@ -46,10 +46,11 @@ function rep_eva_limit_frame_plan_DoSearch(fileType) {
var report_url = apisite + "/api/rep_eva_limit_frame_plan/rep_eva_limit_frame_plan_report?" + p;
if (fileType === "pdf") {
if (fileType === "pdf") {
$("#report_result").attr("src", report_url);
$("#report_result").show();
//window.open(report_url);
$("#report_xModel").modal("show");
} else {
$("#report_result").hide();
window.open(report_url);

View File

@@ -0,0 +1,234 @@
var vw_limit_frame_plan_editMode = "CREATE";
var vw_limit_frame_plan_API = "/api/vw_limit_frame_plan/";
//================= Search Customizaiton =========================================
function vw_limit_frame_plan_GetSearchParameter() {
var vw_limit_frame_planSearchObject = new Object();
//vw_limit_frame_planSearchObject.executed_date = formatDateForGetParameter(getDate($("#s_vw_limit_frame_plan_executed_date").val()));
return vw_limit_frame_planSearchObject;
}
function vw_limit_frame_plan_FeedDataToSearchForm(data) {
$("#s_vw_limit_frame_plan_executed_date").val(formatDate(data.executed_date));
}
//================= Form Data Customizaiton =========================================
function vw_limit_frame_plan_FeedDataToForm(data) {
$("#vw_limit_frame_plan_id").val(data.id);
DropDownClearFormAndFeedWithData($("#vw_limit_frame_plan_plan_guid"), data, "id", "display_text", "item_plan_guid", data.plan_guid);
$("#vw_limit_frame_plan_executed_date").val(formatDate(data.executed_date));
$("#vw_limit_frame_plan_limit_frame_005").val(data.limit_frame_005);
$("#vw_limit_frame_plan_salary_adjustment_date").val(formatDate(data.salary_adjustment_date));
$("#vw_limit_frame_plan_total_salary").val(data.total_salary);
$("#vw_limit_frame_plan_limit_frame_005_total").val(data.limit_frame_005_total);
$("#vw_limit_frame_plan_limit_frame_005_total_rounded").val(data.limit_frame_005_total_rounded);
}
function vw_limit_frame_plan_GetFromForm() {
var vw_limit_frame_planObject = new Object();
vw_limit_frame_planObject.id = $("#vw_limit_frame_plan_id").val();
vw_limit_frame_planObject.plan_guid = $("#vw_limit_frame_plan_plan_guid").val();
vw_limit_frame_planObject.executed_date = getDate($("#vw_limit_frame_plan_executed_date").val());
vw_limit_frame_planObject.limit_frame_005 = $("#vw_limit_frame_plan_limit_frame_005").val();
vw_limit_frame_planObject.salary_adjustment_date = getDate($("#vw_limit_frame_plan_salary_adjustment_date").val());
vw_limit_frame_planObject.total_salary = $("#vw_limit_frame_plan_total_salary").val();
vw_limit_frame_planObject.limit_frame_005_total = $("#vw_limit_frame_plan_limit_frame_005_total").val();
vw_limit_frame_planObject.limit_frame_005_total_rounded = $("#vw_limit_frame_plan_limit_frame_005_total_rounded").val();
return vw_limit_frame_planObject;
}
function vw_limit_frame_plan_InitialForm(s) {
var successFunc = function (result) {
vw_limit_frame_plan_FeedDataToForm(result);
vw_limit_frame_plan_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#vw_limit_frame_planModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + vw_limit_frame_plan_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function vw_limit_frame_plan_GoCreate() {
// Incase model popup
vw_limit_frame_plan_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/vw_limit_frame_planView/vw_limit_frame_plan_d");
}
function vw_limit_frame_plan_GoEdit(a) {
// Incase model popup
//vw_limit_frame_plan_SetEditForm(a);
// Incase open new page
window_open(appsite + "/vw_limit_frame_planView/vw_limit_frame_plan_d?id=" + a);
}
function vw_limit_frame_plan_SetEditForm(a) {
var successFunc = function (result) {
vw_limit_frame_plan_editMode = "UPDATE";
vw_limit_frame_plan_FeedDataToForm(result);
$("#vw_limit_frame_planModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + vw_limit_frame_plan_API + a, successFunc, AlertDanger);
}
function vw_limit_frame_plan_SetCreateForm(s) {
vw_limit_frame_plan_editMode = "CREATE";
vw_limit_frame_plan_InitialForm(s);
}
function vw_limit_frame_plan_RefreshTable() {
// Incase model popup
vw_limit_frame_plan_DoSearch();
// Incase open new page
//window.parent.vw_limit_frame_plan_DoSearch();
}
//================= Update and Delete =========================================
var vw_limit_frame_plan_customValidation = function (group) {
return "";
};
function vw_limit_frame_plan_PutUpdate() {
if (!ValidateForm('vw_limit_frame_plan', vw_limit_frame_plan_customValidation)) {
return;
}
var data = vw_limit_frame_plan_GetFromForm();
//Update Mode
if (vw_limit_frame_plan_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#vw_limit_frame_planModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
vw_limit_frame_plan_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + vw_limit_frame_plan_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#vw_limit_frame_planModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
vw_limit_frame_plan_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + vw_limit_frame_plan_API, data, successFunc2, AlertDanger);
}
}
function vw_limit_frame_plan_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#vw_limit_frame_planModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
vw_limit_frame_plan_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + vw_limit_frame_plan_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var vw_limit_frame_planTableV;
var vw_limit_frame_plan_setupTable = function (result) {
tmp = '"';
vw_limit_frame_planTableV = $('#vw_limit_frame_planTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
//"select": {
// "style": 'multi'
//},
"columns": [
//{ "data": "" },
{ "data": "id" },
{ "data": "plan_guid_eva_performance_plan_fiscal_year" },
{ "data": "txt_executed_date" },
{ "data": "limit_frame_005" },
{ "data": "txt_salary_adjustment_date" },
{ "data": "total_salary" },
{ "data": "limit_frame_005_total" },
{ "data": "limit_frame_005_total_rounded" },
],
"columnDefs": [
{
"targets": 0, //1,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:vw_limit_frame_plan_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:vw_limit_frame_plan_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
},
//{
// targets: 0,
// data: "",
// defaultContent: '',
// orderable: false,
// className: 'select-checkbox'
//}
],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function vw_limit_frame_plan_InitiateDataTable() {
startLoad();
var p = $.param(vw_limit_frame_plan_GetSearchParameter());
AjaxGetRequest(apisite + "/api/vw_limit_frame_plan/GetListBySearch?" + p, vw_limit_frame_plan_setupTable, AlertDanger);
}
function vw_limit_frame_plan_DoSearch() {
var p = $.param(vw_limit_frame_plan_GetSearchParameter());
var vw_limit_frame_plan_reload = function (result) {
vw_limit_frame_planTableV.destroy();
vw_limit_frame_plan_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/vw_limit_frame_plan/GetListBySearch?" + p, vw_limit_frame_plan_reload, AlertDanger);
}
function vw_limit_frame_plan_GetSelect(f) {
var vw_limit_frame_plan_selectitem = [];
$.each(vw_limit_frame_planTableV.rows('.selected').data(), function (key, value) {
vw_limit_frame_plan_selectitem.push(value[f]);
});
alert(vw_limit_frame_plan_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,109 @@
var vw_limit_frame_plan_editMode = "CREATE";
var vw_limit_frame_plan_API = "/api/vw_limit_frame_plan/";
//================= Form Data Customizaiton =========================================
function vw_limit_frame_plan_FeedDataToForm(data) {
$("#vw_limit_frame_plan_id").val(data.id);
DropDownClearFormAndFeedWithData($("#vw_limit_frame_plan_plan_guid"), data, "id", "display_text", "item_plan_guid", data.plan_guid);
$("#vw_limit_frame_plan_executed_date").val(formatDate(data.executed_date));
$("#vw_limit_frame_plan_limit_frame_005").val(data.limit_frame_005);
$("#vw_limit_frame_plan_salary_adjustment_date").val(formatDate(data.salary_adjustment_date));
$("#vw_limit_frame_plan_total_salary").val(data.total_salary);
$("#vw_limit_frame_plan_limit_frame_005_total").val(data.limit_frame_005_total);
$("#vw_limit_frame_plan_limit_frame_005_total_rounded").val(data.limit_frame_005_total_rounded);
}
function vw_limit_frame_plan_GetFromForm() {
var vw_limit_frame_planObject = new Object();
vw_limit_frame_planObject.id = $("#vw_limit_frame_plan_id").val();
vw_limit_frame_planObject.plan_guid = $("#vw_limit_frame_plan_plan_guid").val();
vw_limit_frame_planObject.executed_date = getDate($("#vw_limit_frame_plan_executed_date").val());
vw_limit_frame_planObject.limit_frame_005 = $("#vw_limit_frame_plan_limit_frame_005").val();
vw_limit_frame_planObject.salary_adjustment_date = getDate($("#vw_limit_frame_plan_salary_adjustment_date").val());
vw_limit_frame_planObject.total_salary = $("#vw_limit_frame_plan_total_salary").val();
vw_limit_frame_planObject.limit_frame_005_total = $("#vw_limit_frame_plan_limit_frame_005_total").val();
vw_limit_frame_planObject.limit_frame_005_total_rounded = $("#vw_limit_frame_plan_limit_frame_005_total_rounded").val();
return vw_limit_frame_planObject;
}
function vw_limit_frame_plan_InitialForm() {
var successFunc = function (result) {
vw_limit_frame_plan_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + vw_limit_frame_plan_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function vw_limit_frame_plan_SetEditForm(a) {
var successFunc = function (result) {
vw_limit_frame_plan_editMode = "UPDATE";
vw_limit_frame_plan_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + vw_limit_frame_plan_API + a, successFunc, AlertDanger);
}
function vw_limit_frame_plan_SetCreateForm() {
vw_limit_frame_plan_editMode = "CREATE";
vw_limit_frame_plan_InitialForm();
}
//================= Update and Delete =========================================
var vw_limit_frame_plan_customValidation = function (group) {
return "";
};
function vw_limit_frame_plan_PutUpdate() {
if (!ValidateForm('vw_limit_frame_plan', vw_limit_frame_plan_customValidation)) {
return;
}
var data = vw_limit_frame_plan_GetFromForm();
//Update Mode
if (vw_limit_frame_plan_editMode === "UPDATE") {
var successFunc1 = function (result) {
AlertSuccess(result.code + " " + result.message);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + vw_limit_frame_plan_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.code + " " + result.message);
endLoad();
};
startLoad();
AjaxPostRequest(apisite + vw_limit_frame_plan_API, data, successFunc2, AlertDanger);
}
}
function vw_limit_frame_plan_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.code + " " + result.message);
vw_limit_frame_plan_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + vw_limit_frame_plan_API + a, null, successFunc, AlertDanger);
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================