เพิ่มประวัติ การดำเนินกิจกรรมการประเมิน

This commit is contained in:
LAPTOP-KB8JC2K2\acer
2021-04-13 15:14:51 +07:00
parent 9feecad1cb
commit ddb4232254
29 changed files with 2626 additions and 47 deletions

View File

@@ -0,0 +1,209 @@
var eva_create_evaluation_detail_history_editMode = "CREATE";
var eva_create_evaluation_detail_history_API = "/api/eva_create_evaluation_detail_history/";
//================= Search Customizaiton =========================================
function eva_create_evaluation_detail_history_GetSearchParameter() {
var eva_create_evaluation_detail_historySearchObject = new Object();
eva_create_evaluation_detail_historySearchObject.evaluation_detail_id = getUrlParameter("id");
return eva_create_evaluation_detail_historySearchObject;
}
function eva_create_evaluation_detail_history_FeedDataToSearchForm(data) {
$("#s_eva_create_evaluation_detail_history_evaluation_detail_id").val(data.evaluation_detail_id);
}
//================= Form Data Customizaiton =========================================
function eva_create_evaluation_detail_history_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_history_id").val(data.id);
$("#eva_create_evaluation_detail_history_evaluation_detail_id").val(data.evaluation_detail_id);
$("#eva_create_evaluation_detail_history_action_dt").val(formatDate(data.action_dt));
$("#eva_create_evaluation_detail_history_action_detail").val(data.action_detail);
//DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_history_action_emp_id"), data, "id", "employee_type", "item_action_emp_id", data.action_emp_id);
}
function eva_create_evaluation_detail_history_GetFromForm() {
var eva_create_evaluation_detail_historyObject = new Object();
eva_create_evaluation_detail_historyObject.id = $("#eva_create_evaluation_detail_history_id").val();
eva_create_evaluation_detail_historyObject.evaluation_detail_id = getUrlParameter("id");
eva_create_evaluation_detail_historyObject.action_dt = getDate($("#eva_create_evaluation_detail_history_action_dt").val());
eva_create_evaluation_detail_historyObject.action_detail = $("#eva_create_evaluation_detail_history_action_detail").val();
eva_create_evaluation_detail_historyObject.action_emp_id = $("#eva_create_evaluation_detail_history_action_emp_id").val();
return eva_create_evaluation_detail_historyObject;
}
function eva_create_evaluation_detail_history_InitialForm(s) {
var successFunc = function (result) {
eva_create_evaluation_detail_history_FeedDataToForm(result);
eva_create_evaluation_detail_history_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_create_evaluation_detail_historyModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_history_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_create_evaluation_detail_history_GoCreate() {
// Incase model popup
eva_create_evaluation_detail_history_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_create_evaluation_detail_historyView/eva_create_evaluation_detail_history_d");
}
function eva_create_evaluation_detail_history_GoEdit(a) {
// Incase model popup
eva_create_evaluation_detail_history_SetEditForm(a);
// Incase open new page
//window_open(appsite + "/eva_create_evaluation_detail_historyView/eva_create_evaluation_detail_history_d?id=" + a);
}
function eva_create_evaluation_detail_history_SetEditForm(a) {
var successFunc = function (result) {
eva_create_evaluation_detail_history_editMode = "UPDATE";
eva_create_evaluation_detail_history_FeedDataToForm(result);
$("#eva_create_evaluation_detail_historyModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_history_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_history_SetCreateForm(s) {
eva_create_evaluation_detail_history_editMode = "CREATE";
eva_create_evaluation_detail_history_InitialForm(s);
}
function eva_create_evaluation_detail_history_RefreshTable() {
// Incase model popup
eva_create_evaluation_detail_history_DoSearch();
// Incase open new page
//window.parent.eva_create_evaluation_detail_history_DoSearch();
}
//================= Update and Delete =========================================
var eva_create_evaluation_detail_history_customValidation = function (group) {
return "";
};
function eva_create_evaluation_detail_history_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_history', eva_create_evaluation_detail_history_customValidation)) {
return;
}
var data = eva_create_evaluation_detail_history_GetFromForm();
//Update Mode
if (eva_create_evaluation_detail_history_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_create_evaluation_detail_historyModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
eva_create_evaluation_detail_history_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_history_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_create_evaluation_detail_historyModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
eva_create_evaluation_detail_history_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_history_API, data, successFunc2, AlertDanger);
}
}
function eva_create_evaluation_detail_history_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_create_evaluation_detail_historyModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
eva_create_evaluation_detail_history_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_history_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_create_evaluation_detail_historyTableV;
var eva_create_evaluation_detail_history_setupTable = function (result) {
tmp = '"';
eva_create_evaluation_detail_historyTableV = $('#eva_create_evaluation_detail_historyTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
//"select": {
// "style": 'multi'
//},
"columns": [
{ "data": "txt_action_dt" },
{ "data": "action_detail" },
{ "data": "action_emp_id_external_employee_fullname" },
],
"columnDefs": [
],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_create_evaluation_detail_history_InitiateDataTable() {
startLoad();
var p = $.param(eva_create_evaluation_detail_history_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_history/GetListBySearch?" + p, eva_create_evaluation_detail_history_setupTable, AlertDanger);
}
function eva_create_evaluation_detail_history_DoSearch() {
var p = $.param(eva_create_evaluation_detail_history_GetSearchParameter());
var eva_create_evaluation_detail_history_reload = function (result) {
eva_create_evaluation_detail_historyTableV.destroy();
eva_create_evaluation_detail_history_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_history/GetListBySearch?" + p, eva_create_evaluation_detail_history_reload, AlertDanger);
}
function eva_create_evaluation_detail_history_GetSelect(f) {
var eva_create_evaluation_detail_history_selectitem = [];
$.each(eva_create_evaluation_detail_historyTableV.rows('.selected').data(), function (key, value) {
eva_create_evaluation_detail_history_selectitem.push(value[f]);
});
alert(eva_create_evaluation_detail_history_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================