แยกเมนู แบบข้อตกลงการปฏิบัติงานเพื่อประกอบการพิจารณาประเมินผลสัมฤทธิ์ของงาน งด.2/2 ออกมา
This commit is contained in:
@@ -0,0 +1,251 @@
|
||||
var eva_create_evaluation_detail_firstdoc_editMode = "CREATE";
|
||||
var eva_create_evaluation_detail_firstdoc_API = "/api/eva_create_evaluation_detail_firstdoc/";
|
||||
|
||||
//================= Search Customizaiton =========================================
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_GetSearchParameter() {
|
||||
var eva_create_evaluation_detail_firstdocSearchObject = new Object();
|
||||
eva_create_evaluation_detail_firstdocSearchObject.create_evaluation_id = $("#s_eva_create_evaluation_detail_firstdoc_create_evaluation_id").val();
|
||||
eva_create_evaluation_detail_firstdocSearchObject.org_id = $("#s_eva_create_evaluation_detail_firstdoc_org_id").val();
|
||||
eva_create_evaluation_detail_firstdocSearchObject.search_employee_code = $("#s_eva_create_evaluation_detail_firstdoc_search_employee_code").val();
|
||||
eva_create_evaluation_detail_firstdocSearchObject.search_employee_fullname = $("#s_eva_create_evaluation_detail_firstdoc_search_employee_fullname").val();
|
||||
|
||||
return eva_create_evaluation_detail_firstdocSearchObject;
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_FeedDataToSearchForm(data) {
|
||||
$("#s_eva_create_evaluation_detail_firstdoc_create_evaluation_id").val(data.create_evaluation_id);
|
||||
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_firstdoc_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
|
||||
$("#s_eva_create_evaluation_detail_firstdoc_search_employee_code").val(data.search_employee_code);
|
||||
$("#s_eva_create_evaluation_detail_firstdoc_search_employee_fullname").val(data.search_employee_fullname);
|
||||
|
||||
}
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_FeedDataToForm(data) {
|
||||
$("#eva_create_evaluation_detail_firstdoc_id").val(data.id);
|
||||
$("#eva_create_evaluation_detail_firstdoc_evaluation_round").text(data.evaluation_round);
|
||||
$("#eva_create_evaluation_detail_firstdoc_employee_code").text(data.employee_code);
|
||||
$("#eva_create_evaluation_detail_firstdoc_employee_fullname").text(data.employee_fullname);
|
||||
$("#eva_create_evaluation_detail_firstdoc_employee_position").text(data.employee_position);
|
||||
$("#eva_create_evaluation_detail_firstdoc_employee_position_type").text(data.employee_position_type);
|
||||
$("#eva_create_evaluation_detail_firstdoc_employee_position_level").text(data.employee_position_level);
|
||||
$("#eva_create_evaluation_detail_firstdoc_employee_org").text(data.employee_org);
|
||||
$("#eva_create_evaluation_detail_firstdoc_chief_fullname").text(data.chief_fullname);
|
||||
$("#eva_create_evaluation_detail_firstdoc_chief_position").text(data.chief_position);
|
||||
$("#eva_create_evaluation_detail_firstdoc_create_evaluation_id").val(data.create_evaluation_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_firstdoc_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
|
||||
$("#eva_create_evaluation_detail_firstdoc_search_employee_code").val(data.search_employee_code);
|
||||
$("#eva_create_evaluation_detail_firstdoc_search_employee_fullname").val(data.search_employee_fullname);
|
||||
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_GetFromForm() {
|
||||
var eva_create_evaluation_detail_firstdocObject = new Object();
|
||||
eva_create_evaluation_detail_firstdocObject.id = $("#eva_create_evaluation_detail_firstdoc_id").val();
|
||||
eva_create_evaluation_detail_firstdocObject.evaluation_round = $("#eva_create_evaluation_detail_firstdoc_evaluation_round").text();
|
||||
eva_create_evaluation_detail_firstdocObject.employee_code = $("#eva_create_evaluation_detail_firstdoc_employee_code").text();
|
||||
eva_create_evaluation_detail_firstdocObject.employee_fullname = $("#eva_create_evaluation_detail_firstdoc_employee_fullname").text();
|
||||
eva_create_evaluation_detail_firstdocObject.employee_position = $("#eva_create_evaluation_detail_firstdoc_employee_position").text();
|
||||
eva_create_evaluation_detail_firstdocObject.employee_position_type = $("#eva_create_evaluation_detail_firstdoc_employee_position_type").text();
|
||||
eva_create_evaluation_detail_firstdocObject.employee_position_level = $("#eva_create_evaluation_detail_firstdoc_employee_position_level").text();
|
||||
eva_create_evaluation_detail_firstdocObject.employee_org = $("#eva_create_evaluation_detail_firstdoc_employee_org").text();
|
||||
eva_create_evaluation_detail_firstdocObject.chief_fullname = $("#eva_create_evaluation_detail_firstdoc_chief_fullname").text();
|
||||
eva_create_evaluation_detail_firstdocObject.chief_position = $("#eva_create_evaluation_detail_firstdoc_chief_position").text();
|
||||
eva_create_evaluation_detail_firstdocObject.create_evaluation_id = $("#eva_create_evaluation_detail_firstdoc_create_evaluation_id").val();
|
||||
eva_create_evaluation_detail_firstdocObject.org_id = $("#eva_create_evaluation_detail_firstdoc_org_id").val();
|
||||
eva_create_evaluation_detail_firstdocObject.search_employee_code = $("#eva_create_evaluation_detail_firstdoc_search_employee_code").val();
|
||||
eva_create_evaluation_detail_firstdocObject.search_employee_fullname = $("#eva_create_evaluation_detail_firstdoc_search_employee_fullname").val();
|
||||
|
||||
|
||||
return eva_create_evaluation_detail_firstdocObject;
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_InitialForm(s) {
|
||||
var successFunc = function (result) {
|
||||
eva_create_evaluation_detail_firstdoc_FeedDataToForm(result);
|
||||
eva_create_evaluation_detail_firstdoc_FeedDataToSearchForm(result);
|
||||
if (s) {
|
||||
// Incase model popup
|
||||
$("#eva_create_evaluation_detail_firstdocModel").modal("show");
|
||||
}
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_firstdoc_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
//================= Form Mode Setup and Flow =========================================
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_GoCreate() {
|
||||
// Incase model popup
|
||||
eva_create_evaluation_detail_firstdoc_SetCreateForm(true);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc_d");
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_GoEdit(a) {
|
||||
// Incase model popup
|
||||
//eva_create_evaluation_detail_firstdoc_SetEditForm(a);
|
||||
|
||||
// Incase open new page
|
||||
window_open(appsite + "/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc_d?id=" + a);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_GoSelfReview(a) {
|
||||
window_open(appsite + "/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d?id=" + a);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_SetEditForm(a) {
|
||||
var successFunc = function (result) {
|
||||
eva_create_evaluation_detail_firstdoc_editMode = "UPDATE";
|
||||
eva_create_evaluation_detail_firstdoc_FeedDataToForm(result);
|
||||
$("#eva_create_evaluation_detail_firstdocModel").modal("show");
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_firstdoc_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_SetCreateForm(s) {
|
||||
eva_create_evaluation_detail_firstdoc_editMode = "CREATE";
|
||||
eva_create_evaluation_detail_firstdoc_InitialForm(s);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_RefreshTable() {
|
||||
// Incase model popup
|
||||
eva_create_evaluation_detail_firstdoc_DoSearch();
|
||||
|
||||
// Incase open new page
|
||||
//window.parent.eva_create_evaluation_detail_firstdoc_DoSearch();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
|
||||
var eva_create_evaluation_detail_firstdoc_customValidation = function (group) {
|
||||
return "";
|
||||
};
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_PutUpdate() {
|
||||
if (!ValidateForm('eva_create_evaluation_detail_firstdoc', eva_create_evaluation_detail_firstdoc_customValidation)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var data = eva_create_evaluation_detail_firstdoc_GetFromForm();
|
||||
|
||||
//Update Mode
|
||||
if (eva_create_evaluation_detail_firstdoc_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
$("#eva_create_evaluation_detail_firstdocModel").modal("hide");
|
||||
AlertSuccess(result.message);
|
||||
eva_create_evaluation_detail_firstdoc_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_create_evaluation_detail_firstdoc_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
$("#eva_create_evaluation_detail_firstdocModel").modal("hide");
|
||||
AlertSuccess(result.message);
|
||||
eva_create_evaluation_detail_firstdoc_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_create_evaluation_detail_firstdoc_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_GoDelete(a) {
|
||||
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
|
||||
var successFunc = function (result) {
|
||||
$("#eva_create_evaluation_detail_firstdocModel").modal("hide");
|
||||
AlertSuccess(result.message);
|
||||
eva_create_evaluation_detail_firstdoc_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_firstdoc_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
//================= Data Table =========================================
|
||||
|
||||
var eva_create_evaluation_detail_firstdocTableV;
|
||||
|
||||
var eva_create_evaluation_detail_firstdoc_setupTable = function (result) {
|
||||
console.log(result);
|
||||
|
||||
tmp = '"';
|
||||
eva_create_evaluation_detail_firstdocTableV = $('#eva_create_evaluation_detail_firstdocTable').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
"data": result,
|
||||
"select": false,
|
||||
"columns": [
|
||||
{ "data": "id" },
|
||||
|
||||
{ "data": "plan_round_year" },
|
||||
{ "data": "employee_code" },
|
||||
{ "data": "employee_fullname" },
|
||||
{ "data": "employee_position" },
|
||||
{ "data": "employee_position_level" },
|
||||
{ "data": "org_id_external_linkage_external_name" },
|
||||
{ "data": "txt_status_self" },
|
||||
{ "data": "txt_status_chief" },
|
||||
|
||||
],
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0,
|
||||
"data": "id",
|
||||
"render": function (data, type, row, meta) {
|
||||
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_create_evaluation_detail_firstdoc_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> ";
|
||||
}
|
||||
}
|
||||
],
|
||||
"language": {
|
||||
"url": appsite + "/DataTables-1.10.16/thai.json"
|
||||
},
|
||||
"paging": true,
|
||||
"searching": false
|
||||
});
|
||||
endLoad();
|
||||
};
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_InitiateDataTable() {
|
||||
startLoad();
|
||||
var p = $.param(eva_create_evaluation_detail_firstdoc_GetSearchParameter());
|
||||
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_firstdoc/GetListBySearch?" + p, eva_create_evaluation_detail_firstdoc_setupTable, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_DoSearch() {
|
||||
var p = $.param(eva_create_evaluation_detail_firstdoc_GetSearchParameter());
|
||||
var eva_create_evaluation_detail_firstdoc_reload = function (result) {
|
||||
eva_create_evaluation_detail_firstdocTableV.destroy();
|
||||
eva_create_evaluation_detail_firstdoc_setupTable(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_firstdoc/GetListBySearch?" + p, eva_create_evaluation_detail_firstdoc_reload, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_GetSelect(f) {
|
||||
var eva_create_evaluation_detail_firstdoc_selectitem = [];
|
||||
$.each(eva_create_evaluation_detail_firstdocTableV.rows('.selected').data(), function (key, value) {
|
||||
eva_create_evaluation_detail_firstdoc_selectitem.push(value[f]);
|
||||
});
|
||||
alert(eva_create_evaluation_detail_firstdoc_selectitem);
|
||||
}
|
||||
|
||||
//================= File Upload =========================================
|
||||
|
||||
|
||||
|
||||
//================= Multi-Selection Function =========================================
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
var eva_create_evaluation_detail_firstdoc_editMode = "CREATE";
|
||||
var eva_create_evaluation_detail_firstdoc_API = "/api/eva_create_evaluation_detail_firstdoc/";
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_FeedDataToForm(data) {
|
||||
$("#eva_create_evaluation_detail_firstdoc_id").val(data.id);
|
||||
$("#eva_create_evaluation_detail_firstdoc_evaluation_round").text(data.evaluation_round);
|
||||
$("#eva_create_evaluation_detail_firstdoc_employee_code").text(data.employee_code);
|
||||
$("#eva_create_evaluation_detail_firstdoc_employee_fullname").text(data.employee_fullname);
|
||||
$("#eva_create_evaluation_detail_firstdoc_employee_position").text(data.employee_position);
|
||||
$("#eva_create_evaluation_detail_firstdoc_employee_position_type").text(data.employee_position_type);
|
||||
$("#eva_create_evaluation_detail_firstdoc_employee_position_level").text(data.employee_position_level);
|
||||
$("#eva_create_evaluation_detail_firstdoc_employee_org").text(data.employee_org);
|
||||
$("#eva_create_evaluation_detail_firstdoc_chief_fullname").text(data.chief_fullname);
|
||||
$("#eva_create_evaluation_detail_firstdoc_chief_position").text(data.chief_position);
|
||||
$("#eva_create_evaluation_detail_firstdoc_create_evaluation_id").val(data.create_evaluation_id);
|
||||
|
||||
$("#eva_create_evaluation_detail_firstdoc_score1").text(data.score1);
|
||||
$("#eva_create_evaluation_detail_firstdoc_score2").text(data.score2);
|
||||
|
||||
$("#remark_hrm_work_record").text(data.remark_hrm_work_record);
|
||||
|
||||
status_self = data.status_self;
|
||||
CheckPermission();
|
||||
console.log(data);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_GetFromForm() {
|
||||
var eva_create_evaluation_detail_firstdocObject = new Object();
|
||||
eva_create_evaluation_detail_firstdocObject.id = $("#eva_create_evaluation_detail_firstdoc_id").val();
|
||||
eva_create_evaluation_detail_firstdocObject.evaluation_round = $("#eva_create_evaluation_detail_firstdoc_evaluation_round").text();
|
||||
eva_create_evaluation_detail_firstdocObject.employee_code = $("#eva_create_evaluation_detail_firstdoc_employee_code").text();
|
||||
eva_create_evaluation_detail_firstdocObject.employee_fullname = $("#eva_create_evaluation_detail_firstdoc_employee_fullname").text();
|
||||
eva_create_evaluation_detail_firstdocObject.employee_position = $("#eva_create_evaluation_detail_firstdoc_employee_position").text();
|
||||
eva_create_evaluation_detail_firstdocObject.employee_position_type = $("#eva_create_evaluation_detail_firstdoc_employee_position_type").text();
|
||||
eva_create_evaluation_detail_firstdocObject.employee_position_level = $("#eva_create_evaluation_detail_firstdoc_employee_position_level").text();
|
||||
eva_create_evaluation_detail_firstdocObject.employee_org = $("#eva_create_evaluation_detail_firstdoc_employee_org").text();
|
||||
eva_create_evaluation_detail_firstdocObject.chief_fullname = $("#eva_create_evaluation_detail_firstdoc_chief_fullname").text();
|
||||
eva_create_evaluation_detail_firstdocObject.chief_position = $("#eva_create_evaluation_detail_firstdoc_chief_position").text();
|
||||
eva_create_evaluation_detail_firstdocObject.create_evaluation_id = $("#eva_create_evaluation_detail_firstdoc_create_evaluation_id").val();
|
||||
eva_create_evaluation_detail_firstdocObject.org_id = $("#eva_create_evaluation_detail_firstdoc_org_id").val();
|
||||
eva_create_evaluation_detail_firstdocObject.search_employee_code = $("#eva_create_evaluation_detail_firstdoc_search_employee_code").val();
|
||||
eva_create_evaluation_detail_firstdocObject.search_employee_fullname = $("#eva_create_evaluation_detail_firstdoc_search_employee_fullname").val();
|
||||
|
||||
|
||||
return eva_create_evaluation_detail_firstdocObject;
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_InitialForm() {
|
||||
var successFunc = function (result) {
|
||||
eva_create_evaluation_detail_firstdoc_FeedDataToForm(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_firstdoc_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
//================= Form Mode Setup and Flow =========================================
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_SetEditForm(a) {
|
||||
var successFunc = function (result) {
|
||||
console.log(result)
|
||||
eva_create_evaluation_detail_firstdoc_editMode = "UPDATE";
|
||||
eva_create_evaluation_detail_firstdoc_FeedDataToForm(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_firstdoc_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_SetCreateForm() {
|
||||
eva_create_evaluation_detail_firstdoc_editMode = "CREATE";
|
||||
eva_create_evaluation_detail_firstdoc_InitialForm();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
|
||||
var eva_create_evaluation_detail_firstdoc_customValidation = function (group) {
|
||||
return "";
|
||||
};
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_PutUpdate() {
|
||||
if (!ValidateForm('eva_create_evaluation_detail_firstdoc', eva_create_evaluation_detail_firstdoc_customValidation)) {
|
||||
return;
|
||||
}
|
||||
var data = eva_create_evaluation_detail_firstdoc_GetFromForm();
|
||||
|
||||
//Update Mode
|
||||
if (eva_create_evaluation_detail_firstdoc_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
AlertSuccess(result.message);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_create_evaluation_detail_firstdoc_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
AlertSuccess(result.message);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_create_evaluation_detail_firstdoc_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_GoDelete(a) {
|
||||
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
|
||||
var successFunc = function (result) {
|
||||
AlertSuccess(result.message);
|
||||
eva_create_evaluation_detail_firstdoc_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_firstdoc_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
//================= File Upload =========================================
|
||||
|
||||
|
||||
|
||||
//================= Multi-Selection Function =========================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user