แยกเมนู แบบข้อตกลงการปฏิบัติงานเพื่อประกอบการพิจารณาประเมินผลสัมฤทธิ์ของงาน งด.2/2 ออกมา

This commit is contained in:
Nakorn Rientrakrunchai
2021-02-10 15:54:45 +07:00
parent fe4e051f62
commit 682dc2e5ae
21 changed files with 1639 additions and 194 deletions

View File

@@ -5,58 +5,58 @@ var eva_create_evaluation_detail_agreement_API = "/api/eva_create_evaluation_det
function eva_create_evaluation_detail_agreement_GetSearchParameter() {
var eva_create_evaluation_detail_agreementSearchObject = new Object();
eva_create_evaluation_detail_agreementSearchObject.create_evaluation_id = $("#s_eva_create_evaluation_detail_agreement_create_evaluation_id").val();
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.create_evaluation_id = $("#s_eva_create_evaluation_detail_agreement_create_evaluation_id").val();
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();
return eva_create_evaluation_detail_agreementSearchObject;
}
function eva_create_evaluation_detail_agreement_FeedDataToSearchForm(data) {
$("#s_eva_create_evaluation_detail_agreement_create_evaluation_id").val(data.create_evaluation_id);
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);
$("#s_eva_create_evaluation_detail_agreement_create_evaluation_id").val(data.create_evaluation_id);
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);
}
//================= Form Data Customizaiton =========================================
function eva_create_evaluation_detail_agreement_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_agreement_id").val(data.id);
$("#eva_create_evaluation_detail_agreement_evaluation_round").text(data.evaluation_round);
$("#eva_create_evaluation_detail_agreement_employee_code").text(data.employee_code);
$("#eva_create_evaluation_detail_agreement_employee_fullname").text(data.employee_fullname);
$("#eva_create_evaluation_detail_agreement_employee_position").text(data.employee_position);
$("#eva_create_evaluation_detail_agreement_employee_position_type").text(data.employee_position_type);
$("#eva_create_evaluation_detail_agreement_employee_position_level").text(data.employee_position_level);
$("#eva_create_evaluation_detail_agreement_employee_org").text(data.employee_org);
$("#eva_create_evaluation_detail_agreement_chief_fullname").text(data.chief_fullname);
$("#eva_create_evaluation_detail_agreement_chief_position").text(data.chief_position);
$("#eva_create_evaluation_detail_agreement_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_agreement_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#eva_create_evaluation_detail_agreement_search_employee_code").val(data.search_employee_code);
$("#eva_create_evaluation_detail_agreement_search_employee_fullname").val(data.search_employee_fullname);
$("#eva_create_evaluation_detail_agreement_id").val(data.id);
$("#eva_create_evaluation_detail_agreement_evaluation_round").text(data.evaluation_round);
$("#eva_create_evaluation_detail_agreement_employee_code").text(data.employee_code);
$("#eva_create_evaluation_detail_agreement_employee_fullname").text(data.employee_fullname);
$("#eva_create_evaluation_detail_agreement_employee_position").text(data.employee_position);
$("#eva_create_evaluation_detail_agreement_employee_position_type").text(data.employee_position_type);
$("#eva_create_evaluation_detail_agreement_employee_position_level").text(data.employee_position_level);
$("#eva_create_evaluation_detail_agreement_employee_org").text(data.employee_org);
$("#eva_create_evaluation_detail_agreement_chief_fullname").text(data.chief_fullname);
$("#eva_create_evaluation_detail_agreement_chief_position").text(data.chief_position);
$("#eva_create_evaluation_detail_agreement_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_agreement_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#eva_create_evaluation_detail_agreement_search_employee_code").val(data.search_employee_code);
$("#eva_create_evaluation_detail_agreement_search_employee_fullname").val(data.search_employee_fullname);
}
function eva_create_evaluation_detail_agreement_GetFromForm() {
var eva_create_evaluation_detail_agreementObject = new Object();
eva_create_evaluation_detail_agreementObject.id = $("#eva_create_evaluation_detail_agreement_id").val();
eva_create_evaluation_detail_agreementObject.evaluation_round = $("#eva_create_evaluation_detail_agreement_evaluation_round").text();
eva_create_evaluation_detail_agreementObject.employee_code = $("#eva_create_evaluation_detail_agreement_employee_code").text();
eva_create_evaluation_detail_agreementObject.employee_fullname = $("#eva_create_evaluation_detail_agreement_employee_fullname").text();
eva_create_evaluation_detail_agreementObject.employee_position = $("#eva_create_evaluation_detail_agreement_employee_position").text();
eva_create_evaluation_detail_agreementObject.employee_position_type = $("#eva_create_evaluation_detail_agreement_employee_position_type").text();
eva_create_evaluation_detail_agreementObject.employee_position_level = $("#eva_create_evaluation_detail_agreement_employee_position_level").text();
eva_create_evaluation_detail_agreementObject.employee_org = $("#eva_create_evaluation_detail_agreement_employee_org").text();
eva_create_evaluation_detail_agreementObject.chief_fullname = $("#eva_create_evaluation_detail_agreement_chief_fullname").text();
eva_create_evaluation_detail_agreementObject.chief_position = $("#eva_create_evaluation_detail_agreement_chief_position").text();
eva_create_evaluation_detail_agreementObject.create_evaluation_id = $("#eva_create_evaluation_detail_agreement_create_evaluation_id").val();
eva_create_evaluation_detail_agreementObject.org_id = $("#eva_create_evaluation_detail_agreement_org_id").val();
eva_create_evaluation_detail_agreementObject.search_employee_code = $("#eva_create_evaluation_detail_agreement_search_employee_code").val();
eva_create_evaluation_detail_agreementObject.search_employee_fullname = $("#eva_create_evaluation_detail_agreement_search_employee_fullname").val();
eva_create_evaluation_detail_agreementObject.id = $("#eva_create_evaluation_detail_agreement_id").val();
eva_create_evaluation_detail_agreementObject.evaluation_round = $("#eva_create_evaluation_detail_agreement_evaluation_round").text();
eva_create_evaluation_detail_agreementObject.employee_code = $("#eva_create_evaluation_detail_agreement_employee_code").text();
eva_create_evaluation_detail_agreementObject.employee_fullname = $("#eva_create_evaluation_detail_agreement_employee_fullname").text();
eva_create_evaluation_detail_agreementObject.employee_position = $("#eva_create_evaluation_detail_agreement_employee_position").text();
eva_create_evaluation_detail_agreementObject.employee_position_type = $("#eva_create_evaluation_detail_agreement_employee_position_type").text();
eva_create_evaluation_detail_agreementObject.employee_position_level = $("#eva_create_evaluation_detail_agreement_employee_position_level").text();
eva_create_evaluation_detail_agreementObject.employee_org = $("#eva_create_evaluation_detail_agreement_employee_org").text();
eva_create_evaluation_detail_agreementObject.chief_fullname = $("#eva_create_evaluation_detail_agreement_chief_fullname").text();
eva_create_evaluation_detail_agreementObject.chief_position = $("#eva_create_evaluation_detail_agreement_chief_position").text();
eva_create_evaluation_detail_agreementObject.create_evaluation_id = $("#eva_create_evaluation_detail_agreement_create_evaluation_id").val();
eva_create_evaluation_detail_agreementObject.org_id = $("#eva_create_evaluation_detail_agreement_org_id").val();
eva_create_evaluation_detail_agreementObject.search_employee_code = $("#eva_create_evaluation_detail_agreement_search_employee_code").val();
eva_create_evaluation_detail_agreementObject.search_employee_fullname = $("#eva_create_evaluation_detail_agreement_search_employee_fullname").val();
return eva_create_evaluation_detail_agreementObject;
@@ -65,14 +65,14 @@ eva_create_evaluation_detail_agreementObject.search_employee_fullname = $("#eva_
function eva_create_evaluation_detail_agreement_InitialForm(s) {
var successFunc = function (result) {
eva_create_evaluation_detail_agreement_FeedDataToForm(result);
eva_create_evaluation_detail_agreement_FeedDataToSearchForm(result);
eva_create_evaluation_detail_agreement_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_create_evaluation_detail_agreementModel").modal("show");
}
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_agreement_API + "GetBlankItem", successFunc, AlertDanger);
}
@@ -103,15 +103,15 @@ function eva_create_evaluation_detail_agreement_SetEditForm(a) {
eva_create_evaluation_detail_agreement_editMode = "UPDATE";
eva_create_evaluation_detail_agreement_FeedDataToForm(result);
$("#eva_create_evaluation_detail_agreementModel").modal("show");
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_agreement_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_agreement_SetCreateForm(s) {
eva_create_evaluation_detail_agreement_editMode = "CREATE";
eva_create_evaluation_detail_agreement_InitialForm(s);
eva_create_evaluation_detail_agreement_InitialForm(s);
}
function eva_create_evaluation_detail_agreement_RefreshTable() {
@@ -129,8 +129,7 @@ var eva_create_evaluation_detail_agreement_customValidation = function (group) {
};
function eva_create_evaluation_detail_agreement_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_agreement', eva_create_evaluation_detail_agreement_customValidation))
{
if (!ValidateForm('eva_create_evaluation_detail_agreement', eva_create_evaluation_detail_agreement_customValidation)) {
return;
}
@@ -142,9 +141,9 @@ function eva_create_evaluation_detail_agreement_PutUpdate() {
$("#eva_create_evaluation_detail_agreementModel").modal("hide");
AlertSuccess(result.message);
eva_create_evaluation_detail_agreement_RefreshTable();
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_agreement_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
@@ -153,9 +152,9 @@ function eva_create_evaluation_detail_agreement_PutUpdate() {
$("#eva_create_evaluation_detail_agreementModel").modal("hide");
AlertSuccess(result.message);
eva_create_evaluation_detail_agreement_RefreshTable();
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_agreement_API, data, successFunc2, AlertDanger);
}
}
@@ -166,9 +165,9 @@ function eva_create_evaluation_detail_agreement_GoDelete(a) {
$("#eva_create_evaluation_detail_agreementModel").modal("hide");
AlertSuccess(result.message);
eva_create_evaluation_detail_agreement_RefreshTable();
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_agreement_API + a, null, successFunc, AlertDanger);
}
}
@@ -178,28 +177,28 @@ function eva_create_evaluation_detail_agreement_GoDelete(a) {
var eva_create_evaluation_detail_agreementTableV;
var eva_create_evaluation_detail_agreement_setupTable = function (result) {
console.log(result);
console.log(result);
tmp = '"';
tmp = '"';
eva_create_evaluation_detail_agreementTableV = $('#eva_create_evaluation_detail_agreementTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"select": false,
"columns": [
{ "data": "id" },
{ "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" },
{ "data": "txt_status_supervisor" },
{ "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" },
{ "data": "txt_status_supervisor" },
{ "data": "id" }
],
"columnDefs": [
{
@@ -213,28 +212,28 @@ console.log(result);
"targets": -1,
"data": "id",
"render": function (data, type, row, meta) {
if(row.status_chief === "Y"){
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_create_evaluation_detail_agreement_GoSelfReview(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> ";
}else{
return "";
}
if (row.status_chief === "Y") {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_create_evaluation_detail_agreement_GoSelfReview(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> ";
} else {
return "";
}
}
}
],
],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
"searching": false
});
endLoad();
endLoad();
};
function eva_create_evaluation_detail_agreement_InitiateDataTable() {
startLoad();
var p = $.param(eva_create_evaluation_detail_agreement_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_agreement/GetListBySearch?"+p, eva_create_evaluation_detail_agreement_setupTable, AlertDanger);
startLoad();
var p = $.param(eva_create_evaluation_detail_agreement_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_agreement/GetListBySearch?" + p, eva_create_evaluation_detail_agreement_setupTable, AlertDanger);
}
function eva_create_evaluation_detail_agreement_DoSearch() {
@@ -242,10 +241,10 @@ function eva_create_evaluation_detail_agreement_DoSearch() {
var eva_create_evaluation_detail_agreement_reload = function (result) {
eva_create_evaluation_detail_agreementTableV.destroy();
eva_create_evaluation_detail_agreement_setupTable(result);
endLoad();
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_agreement/GetListBySearch?"+p, eva_create_evaluation_detail_agreement_reload, AlertDanger);
startLoad();
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_agreement/GetListBySearch?" + p, eva_create_evaluation_detail_agreement_reload, AlertDanger);
}
function eva_create_evaluation_detail_agreement_GetSelect(f) {

View File

@@ -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 =========================================

View File

@@ -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 =========================================