ปรับปรุงหน้าจก eva detail
This commit is contained in:
@@ -5,42 +5,42 @@ var eva_create_evaluation_API = "/api/eva_create_evaluation/";
|
||||
|
||||
function eva_create_evaluation_GetSearchParameter() {
|
||||
var eva_create_evaluationSearchObject = new Object();
|
||||
eva_create_evaluationSearchObject.performance_plan_id = $("#s_eva_create_evaluation_performance_plan_id").val();
|
||||
eva_create_evaluationSearchObject.evaluation_group_id = $("#s_eva_create_evaluation_evaluation_group_id").val();
|
||||
eva_create_evaluationSearchObject.performance_plan_id = $("#s_eva_create_evaluation_performance_plan_id").val();
|
||||
eva_create_evaluationSearchObject.evaluation_group_id = $("#s_eva_create_evaluation_evaluation_group_id").val();
|
||||
|
||||
return eva_create_evaluationSearchObject;
|
||||
}
|
||||
|
||||
function eva_create_evaluation_FeedDataToSearchForm(data) {
|
||||
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_performance_plan_id"), data, "id", "display_text", "item_performance_plan_id", data.performance_plan_id);
|
||||
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_evaluation_group_id"), data, "id", "thegroup", "item_evaluation_group_id", data.evaluation_group_id);
|
||||
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_performance_plan_id"), data, "id", "display_text", "item_performance_plan_id", data.performance_plan_id);
|
||||
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_evaluation_group_id"), data, "id", "thegroup", "item_evaluation_group_id", data.evaluation_group_id);
|
||||
|
||||
}
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_create_evaluation_FeedDataToForm(data) {
|
||||
$("#eva_create_evaluation_id").val(data.id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_performance_plan_id"), data, "id", "display_text", "item_performance_plan_id", data.performance_plan_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
|
||||
$("#eva_create_evaluation_score1").val(data.score1);
|
||||
$("#eva_create_evaluation_score2").val(data.score2);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_evaluation_group_id"), data, "id", "thegroup", "item_evaluation_group_id", data.evaluation_group_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_supervisor1_id"), data, "id", "fullname", "item_supervisor1_id", data.supervisor1_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_supervisor2_id"), data, "id", "fullname", "item_supervisor2_id", data.supervisor2_id);
|
||||
$("#eva_create_evaluation_id").val(data.id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_performance_plan_id"), data, "id", "display_text", "item_performance_plan_id", data.performance_plan_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
|
||||
$("#eva_create_evaluation_score1").val(data.score1);
|
||||
$("#eva_create_evaluation_score2").val(data.score2);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_evaluation_group_id"), data, "id", "thegroup", "item_evaluation_group_id", data.evaluation_group_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_supervisor1_id"), data, "id", "fullname", "item_supervisor1_id", data.supervisor1_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_supervisor2_id"), data, "id", "fullname", "item_supervisor2_id", data.supervisor2_id);
|
||||
|
||||
}
|
||||
|
||||
function eva_create_evaluation_GetFromForm() {
|
||||
var eva_create_evaluationObject = new Object();
|
||||
eva_create_evaluationObject.id = $("#eva_create_evaluation_id").val();
|
||||
eva_create_evaluationObject.performance_plan_id = $("#eva_create_evaluation_performance_plan_id").val();
|
||||
eva_create_evaluationObject.employee_id = $("#eva_create_evaluation_employee_id").val();
|
||||
eva_create_evaluationObject.score1 = $("#eva_create_evaluation_score1").val();
|
||||
eva_create_evaluationObject.score2 = $("#eva_create_evaluation_score2").val();
|
||||
eva_create_evaluationObject.evaluation_group_id = $("#eva_create_evaluation_evaluation_group_id").val();
|
||||
eva_create_evaluationObject.supervisor1_id = $("#eva_create_evaluation_supervisor1_id").val();
|
||||
eva_create_evaluationObject.supervisor2_id = $("#eva_create_evaluation_supervisor2_id").val();
|
||||
eva_create_evaluationObject.id = $("#eva_create_evaluation_id").val();
|
||||
eva_create_evaluationObject.performance_plan_id = $("#eva_create_evaluation_performance_plan_id").val();
|
||||
eva_create_evaluationObject.employee_id = $("#eva_create_evaluation_employee_id").val();
|
||||
eva_create_evaluationObject.score1 = $("#eva_create_evaluation_score1").val();
|
||||
eva_create_evaluationObject.score2 = $("#eva_create_evaluation_score2").val();
|
||||
eva_create_evaluationObject.evaluation_group_id = $("#eva_create_evaluation_evaluation_group_id").val();
|
||||
eva_create_evaluationObject.supervisor1_id = $("#eva_create_evaluation_supervisor1_id").val();
|
||||
eva_create_evaluationObject.supervisor2_id = $("#eva_create_evaluation_supervisor2_id").val();
|
||||
|
||||
return eva_create_evaluationObject;
|
||||
}
|
||||
@@ -48,14 +48,14 @@ eva_create_evaluationObject.supervisor2_id = $("#eva_create_evaluation_superviso
|
||||
function eva_create_evaluation_InitialForm(s) {
|
||||
var successFunc = function (result) {
|
||||
eva_create_evaluation_FeedDataToForm(result);
|
||||
eva_create_evaluation_FeedDataToSearchForm(result);
|
||||
eva_create_evaluation_FeedDataToSearchForm(result);
|
||||
if (s) {
|
||||
// Incase model popup
|
||||
$("#eva_create_evaluationModel").modal("show");
|
||||
}
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
@@ -82,15 +82,15 @@ function eva_create_evaluation_SetEditForm(a) {
|
||||
eva_create_evaluation_editMode = "UPDATE";
|
||||
eva_create_evaluation_FeedDataToForm(result);
|
||||
$("#eva_create_evaluationModel").modal("show");
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_SetCreateForm(s) {
|
||||
eva_create_evaluation_editMode = "CREATE";
|
||||
eva_create_evaluation_InitialForm(s);
|
||||
eva_create_evaluation_InitialForm(s);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_RefreshTable() {
|
||||
@@ -108,8 +108,7 @@ var eva_create_evaluation_customValidation = function (group) {
|
||||
};
|
||||
|
||||
function eva_create_evaluation_PutUpdate() {
|
||||
if (!ValidateForm('eva_create_evaluation', eva_create_evaluation_customValidation))
|
||||
{
|
||||
if (!ValidateForm('eva_create_evaluation', eva_create_evaluation_customValidation)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -121,9 +120,9 @@ function eva_create_evaluation_PutUpdate() {
|
||||
$("#eva_create_evaluationModel").modal("hide");
|
||||
AlertSuccess(result.message);
|
||||
eva_create_evaluation_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_create_evaluation_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
@@ -132,9 +131,9 @@ function eva_create_evaluation_PutUpdate() {
|
||||
$("#eva_create_evaluationModel").modal("hide");
|
||||
AlertSuccess(result.message);
|
||||
eva_create_evaluation_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_create_evaluation_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
@@ -145,9 +144,9 @@ function eva_create_evaluation_GoDelete(a) {
|
||||
$("#eva_create_evaluationModel").modal("hide");
|
||||
AlertSuccess(result.message);
|
||||
eva_create_evaluation_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_create_evaluation_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
@@ -157,40 +156,40 @@ function eva_create_evaluation_GoDelete(a) {
|
||||
var eva_create_evaluationTableV;
|
||||
|
||||
var eva_create_evaluation_setupTable = function (result) {
|
||||
tmp = '"';
|
||||
tmp = '"';
|
||||
eva_create_evaluationTableV = $('#eva_create_evaluationTable').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
"data": result,
|
||||
"select": false,
|
||||
"select": false,
|
||||
"columns": [
|
||||
{ "data": "id" },
|
||||
{ "data": "performance_plan_id_eva_performance_plan_fiscal_year" },
|
||||
{ "data": "evaluation_group_id_eva_evaluation_group_name" },
|
||||
{ "data": "employee_id_external_linkage_external_name" },
|
||||
{ "data": "score1" },
|
||||
{ "data": "score2" },
|
||||
|
||||
{ "data": "id" },
|
||||
{ "data": "performance_plan_id_eva_performance_plan_fiscal_year" },
|
||||
{ "data": "evaluation_group_id_eva_evaluation_group_name" },
|
||||
{ "data": "employee_id_external_linkage_external_name" },
|
||||
{ "data": "score1" },
|
||||
{ "data": "score2" },
|
||||
|
||||
],
|
||||
"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_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' style='display:none;' class='btn btn-danger btn-sm' onclick='javascript:eva_create_evaluation_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_create_evaluation_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_create_evaluation_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
|
||||
}
|
||||
}],
|
||||
"language": {
|
||||
"url": appsite + "/DataTables-1.10.16/thai.json"
|
||||
},
|
||||
"paging": true,
|
||||
"searching": false
|
||||
"searching": false
|
||||
});
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
|
||||
function eva_create_evaluation_InitiateDataTable() {
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_create_evaluation/GetListBySearch", eva_create_evaluation_setupTable, AlertDanger);
|
||||
}
|
||||
|
||||
@@ -199,10 +198,10 @@ function eva_create_evaluation_DoSearch() {
|
||||
var eva_create_evaluation_reload = function (result) {
|
||||
eva_create_evaluationTableV.destroy();
|
||||
eva_create_evaluation_setupTable(result);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_create_evaluation/GetListBySearch?"+p, eva_create_evaluation_reload, AlertDanger);
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_create_evaluation/GetListBySearch?" + p, eva_create_evaluation_reload, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_GetSelect(f) {
|
||||
@@ -219,15 +218,13 @@ function eva_create_evaluation_GetSelect(f) {
|
||||
|
||||
//================= Control Function =========================================
|
||||
|
||||
function Oneva_create_evaluation_score1Change()
|
||||
{
|
||||
function Oneva_create_evaluation_score1Change() {
|
||||
var s1 = $("#eva_create_evaluation_score1").val();
|
||||
var s2 = $("#eva_create_evaluation_score2").val();
|
||||
$("#eva_create_evaluation_score2").val(100 - s1);
|
||||
}
|
||||
|
||||
function Oneva_create_evaluation_score2Change()
|
||||
{
|
||||
function Oneva_create_evaluation_score2Change() {
|
||||
var s1 = $("#eva_create_evaluation_score1").val();
|
||||
var s2 = $("#eva_create_evaluation_score2").val();
|
||||
$("#eva_create_evaluation_score1").val(100 - s2);
|
||||
|
||||
Reference in New Issue
Block a user