ปรับปรุง รายงานประวัติการเลื่อนเงินเดือนรายบุคคล #1

This commit is contained in:
LAPTOP-KB8JC2K2\acer
2021-03-24 20:53:25 +07:00
parent aa9be494f7
commit 4859e4bdbd
16 changed files with 870 additions and 0 deletions

View File

@@ -2,6 +2,10 @@
//================= Search Customizaiton =========================================
function rep_eva_self_review_all_GoBack() {
window.location = appsite + "/vw_eva_performance_planView/vw_eva_performance_plan";
}
function rep_eva_self_review_all_GetSearchParameter(fileType) {
var rep_eva_self_review_allSearchObject = new Object();
rep_eva_self_review_allSearchObject.employee_id = $("#s_rep_eva_self_review_all_employee_id").val();

View File

@@ -0,0 +1,213 @@
var vw_eva_performance_plan_editMode = "CREATE";
var vw_eva_performance_plan_API = "/api/vw_eva_performance_plan/";
//================= Search Customizaiton =========================================
function vw_eva_performance_plan_GetSearchParameter() {
var vw_eva_performance_planSearchObject = new Object();
vw_eva_performance_planSearchObject.fiscal_year = $("#s_vw_eva_performance_plan_fiscal_year").val();
vw_eva_performance_planSearchObject.theTime = $("#s_vw_eva_performance_plan_theTime").val();
return vw_eva_performance_planSearchObject;
}
function vw_eva_performance_plan_FeedDataToSearchForm(data) {
$("#s_vw_eva_performance_plan_fiscal_year").val(data.fiscal_year);
$("#s_vw_eva_performance_plan_theTime").val(data.theTime);
}
//================= Form Data Customizaiton =========================================
function vw_eva_performance_plan_FeedDataToForm(data) {
$("#vw_eva_performance_plan_id").val(data.id);
$("#vw_eva_performance_plan_fiscal_year").val(data.fiscal_year);
$("#vw_eva_performance_plan_theTime").val(data.theTime);
}
function vw_eva_performance_plan_GetFromForm() {
var vw_eva_performance_planObject = new Object();
vw_eva_performance_planObject.id = $("#vw_eva_performance_plan_id").val();
vw_eva_performance_planObject.fiscal_year = $("#vw_eva_performance_plan_fiscal_year").val();
vw_eva_performance_planObject.theTime = $("#vw_eva_performance_plan_theTime").val();
return vw_eva_performance_planObject;
}
function vw_eva_performance_plan_InitialForm(s) {
var successFunc = function (result) {
vw_eva_performance_plan_FeedDataToForm(result);
vw_eva_performance_plan_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#vw_eva_performance_planModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + vw_eva_performance_plan_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function vw_eva_performance_plan_GoAll() {
window.location = appsite + "/rep_eva_self_review_allView/rep_eva_self_review_all_report";
}
function vw_eva_performance_plan_GoEdit(a) {
alert("กำลังจัดทำ");
}
function vw_eva_performance_plan_SetEditForm(a) {
var successFunc = function (result) {
vw_eva_performance_plan_editMode = "UPDATE";
vw_eva_performance_plan_FeedDataToForm(result);
$("#vw_eva_performance_planModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + vw_eva_performance_plan_API + a, successFunc, AlertDanger);
}
function vw_eva_performance_plan_SetCreateForm(s) {
vw_eva_performance_plan_editMode = "CREATE";
vw_eva_performance_plan_InitialForm(s);
}
function vw_eva_performance_plan_RefreshTable() {
// Incase model popup
vw_eva_performance_plan_DoSearch();
// Incase open new page
//window.parent.vw_eva_performance_plan_DoSearch();
}
//================= Update and Delete =========================================
var vw_eva_performance_plan_customValidation = function (group) {
return "";
};
function vw_eva_performance_plan_PutUpdate() {
if (!ValidateForm('vw_eva_performance_plan', vw_eva_performance_plan_customValidation)) {
return;
}
var data = vw_eva_performance_plan_GetFromForm();
//Update Mode
if (vw_eva_performance_plan_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#vw_eva_performance_planModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
vw_eva_performance_plan_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + vw_eva_performance_plan_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#vw_eva_performance_planModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
vw_eva_performance_plan_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + vw_eva_performance_plan_API, data, successFunc2, AlertDanger);
}
}
function vw_eva_performance_plan_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#vw_eva_performance_planModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
vw_eva_performance_plan_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + vw_eva_performance_plan_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var vw_eva_performance_planTableV;
var vw_eva_performance_plan_setupTable = function (result) {
tmp = '"';
vw_eva_performance_planTableV = $('#vw_eva_performance_planTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
//"select": {
// "style": 'multi'
//},
"columns": [
//{ "data": "" },
{ "data": "id" },
{ "data": "fiscal_year" },
{ "data": "theTime" },
],
"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_eva_performance_plan_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil-alt'></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_eva_performance_plan_InitiateDataTable() {
startLoad();
var p = $.param(vw_eva_performance_plan_GetSearchParameter());
AjaxGetRequest(apisite + "/api/vw_eva_performance_plan/GetListBySearch?" + p, vw_eva_performance_plan_setupTable, AlertDanger);
}
function vw_eva_performance_plan_DoSearch() {
var p = $.param(vw_eva_performance_plan_GetSearchParameter());
var vw_eva_performance_plan_reload = function (result) {
vw_eva_performance_planTableV.destroy();
vw_eva_performance_plan_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/vw_eva_performance_plan/GetListBySearch?" + p, vw_eva_performance_plan_reload, AlertDanger);
}
function vw_eva_performance_plan_GetSelect(f) {
var vw_eva_performance_plan_selectitem = [];
$.each(vw_eva_performance_planTableV.rows('.selected').data(), function (key, value) {
vw_eva_performance_plan_selectitem.push(value[f]);
});
alert(vw_eva_performance_plan_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================