|
|
|
|
@@ -4,27 +4,27 @@ var eva_create_evaluation_API = "/api/eva_create_evaluation/";
|
|
|
|
|
//================= 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;
|
|
|
|
|
}
|
|
|
|
|
@@ -32,9 +32,9 @@ eva_create_evaluationObject.supervisor2_id = $("#eva_create_evaluation_superviso
|
|
|
|
|
function eva_create_evaluation_InitialForm() {
|
|
|
|
|
var successFunc = function (result) {
|
|
|
|
|
eva_create_evaluation_FeedDataToForm(result);
|
|
|
|
|
endLoad();
|
|
|
|
|
endLoad();
|
|
|
|
|
};
|
|
|
|
|
startLoad();
|
|
|
|
|
startLoad();
|
|
|
|
|
AjaxGetRequest(apisite + eva_create_evaluation_API + "GetBlankItem", successFunc, AlertDanger);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -44,15 +44,15 @@ function eva_create_evaluation_SetEditForm(a) {
|
|
|
|
|
var successFunc = function (result) {
|
|
|
|
|
eva_create_evaluation_editMode = "UPDATE";
|
|
|
|
|
eva_create_evaluation_FeedDataToForm(result);
|
|
|
|
|
endLoad();
|
|
|
|
|
endLoad();
|
|
|
|
|
};
|
|
|
|
|
startLoad();
|
|
|
|
|
startLoad();
|
|
|
|
|
AjaxGetRequest(apisite + eva_create_evaluation_API + a, successFunc, AlertDanger);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function eva_create_evaluation_SetCreateForm() {
|
|
|
|
|
eva_create_evaluation_editMode = "CREATE";
|
|
|
|
|
eva_create_evaluation_InitialForm();
|
|
|
|
|
eva_create_evaluation_InitialForm();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//================= Update and Delete =========================================
|
|
|
|
|
@@ -62,8 +62,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;
|
|
|
|
|
}
|
|
|
|
|
var data = eva_create_evaluation_GetFromForm();
|
|
|
|
|
@@ -72,18 +71,18 @@ function eva_create_evaluation_PutUpdate() {
|
|
|
|
|
if (eva_create_evaluation_editMode === "UPDATE") {
|
|
|
|
|
var successFunc1 = function (result) {
|
|
|
|
|
AlertSuccess(result.message);
|
|
|
|
|
endLoad();
|
|
|
|
|
endLoad();
|
|
|
|
|
};
|
|
|
|
|
startLoad();
|
|
|
|
|
startLoad();
|
|
|
|
|
AjaxPutRequest(apisite + eva_create_evaluation_API + data.id, data, successFunc1, AlertDanger);
|
|
|
|
|
}
|
|
|
|
|
// Create mode
|
|
|
|
|
else {
|
|
|
|
|
var successFunc2 = function (result) {
|
|
|
|
|
AlertSuccess(result.message);
|
|
|
|
|
endLoad();
|
|
|
|
|
endLoad();
|
|
|
|
|
};
|
|
|
|
|
startLoad();
|
|
|
|
|
startLoad();
|
|
|
|
|
AjaxPostRequest(apisite + eva_create_evaluation_API, data, successFunc2, AlertDanger);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -93,9 +92,9 @@ function eva_create_evaluation_GoDelete(a) {
|
|
|
|
|
var successFunc = function (result) {
|
|
|
|
|
AlertSuccess(result.message);
|
|
|
|
|
eva_create_evaluation_RefreshTable();
|
|
|
|
|
endLoad();
|
|
|
|
|
endLoad();
|
|
|
|
|
};
|
|
|
|
|
startLoad();
|
|
|
|
|
startLoad();
|
|
|
|
|
AjaxDeleteRequest(apisite + eva_create_evaluation_API + a, null, successFunc, AlertDanger);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -106,15 +105,13 @@ function eva_create_evaluation_GoDelete(a) {
|
|
|
|
|
|
|
|
|
|
//================= 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);
|
|
|
|
|
|