แก้ op หลายข้อ
This commit is contained in:
@@ -5,33 +5,33 @@ var eva_performance_plan_API = "/api/eva_performance_plan/";
|
||||
|
||||
function eva_performance_plan_GetSearchParameter() {
|
||||
var eva_performance_planSearchObject = new Object();
|
||||
eva_performance_planSearchObject.fiscal_year = $("#s_eva_performance_plan_fiscal_year").val();
|
||||
eva_performance_planSearchObject.theTime = $("#s_eva_performance_plan_theTime").val();
|
||||
eva_performance_planSearchObject.fiscal_year = $("#s_eva_performance_plan_fiscal_year").val();
|
||||
eva_performance_planSearchObject.theTime = $("#s_eva_performance_plan_theTime").val();
|
||||
|
||||
return eva_performance_planSearchObject;
|
||||
}
|
||||
|
||||
function eva_performance_plan_FeedDataToSearchForm(data) {
|
||||
$("#s_eva_performance_plan_fiscal_year").val(data.fiscal_year);
|
||||
$("#s_eva_performance_plan_theTime").val(data.theTime);
|
||||
$("#s_eva_performance_plan_fiscal_year").val(data.fiscal_year);
|
||||
$("#s_eva_performance_plan_theTime").val(data.theTime);
|
||||
|
||||
}
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_performance_plan_FeedDataToForm(data) {
|
||||
$("#eva_performance_plan_id").val(data.id);
|
||||
$("#eva_performance_plan_fiscal_year").val(data.fiscal_year);
|
||||
$("#eva_performance_plan_theTime").val(data.theTime);
|
||||
|
||||
$("#eva_performance_plan_id").val(data.id);
|
||||
$("#eva_performance_plan_fiscal_year").val(data.fiscal_year);
|
||||
$("#eva_performance_plan_theTime").val(data.theTime);
|
||||
$("#eva_performance_plan_percent").val(data.percent);
|
||||
}
|
||||
|
||||
function eva_performance_plan_GetFromForm() {
|
||||
var eva_performance_planObject = new Object();
|
||||
eva_performance_planObject.id = $("#eva_performance_plan_id").val();
|
||||
eva_performance_planObject.fiscal_year = $("#eva_performance_plan_fiscal_year").val();
|
||||
eva_performance_planObject.theTime = $("#eva_performance_plan_theTime").val();
|
||||
|
||||
eva_performance_planObject.id = $("#eva_performance_plan_id").val();
|
||||
eva_performance_planObject.fiscal_year = $("#eva_performance_plan_fiscal_year").val();
|
||||
eva_performance_planObject.theTime = $("#eva_performance_plan_theTime").val();
|
||||
eva_performance_planObject.percent = $("#eva_performance_plan_percent").val();
|
||||
|
||||
return eva_performance_planObject;
|
||||
}
|
||||
@@ -39,14 +39,14 @@ eva_performance_planObject.theTime = $("#eva_performance_plan_theTime").val();
|
||||
function eva_performance_plan_InitialForm(s) {
|
||||
var successFunc = function (result) {
|
||||
eva_performance_plan_FeedDataToForm(result);
|
||||
eva_performance_plan_FeedDataToSearchForm(result);
|
||||
eva_performance_plan_FeedDataToSearchForm(result);
|
||||
if (s) {
|
||||
// Incase model popup
|
||||
$("#eva_performance_planModel").modal("show");
|
||||
}
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_performance_plan_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
@@ -73,15 +73,15 @@ function eva_performance_plan_SetEditForm(a) {
|
||||
eva_performance_plan_editMode = "UPDATE";
|
||||
eva_performance_plan_FeedDataToForm(result);
|
||||
$("#eva_performance_planModel").modal("show");
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_performance_plan_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_performance_plan_SetCreateForm(s) {
|
||||
eva_performance_plan_editMode = "CREATE";
|
||||
eva_performance_plan_InitialForm(s);
|
||||
eva_performance_plan_InitialForm(s);
|
||||
}
|
||||
|
||||
function eva_performance_plan_RefreshTable() {
|
||||
@@ -99,8 +99,7 @@ var eva_performance_plan_customValidation = function (group) {
|
||||
};
|
||||
|
||||
function eva_performance_plan_PutUpdate() {
|
||||
if (!ValidateForm('eva_performance_plan', eva_performance_plan_customValidation))
|
||||
{
|
||||
if (!ValidateForm('eva_performance_plan', eva_performance_plan_customValidation)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -112,9 +111,9 @@ function eva_performance_plan_PutUpdate() {
|
||||
$("#eva_performance_planModel").modal("hide");
|
||||
AlertSuccess(result.message);
|
||||
eva_performance_plan_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_performance_plan_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
@@ -123,9 +122,9 @@ function eva_performance_plan_PutUpdate() {
|
||||
$("#eva_performance_planModel").modal("hide");
|
||||
AlertSuccess(result.message);
|
||||
eva_performance_plan_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_performance_plan_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
@@ -136,9 +135,9 @@ function eva_performance_plan_GoDelete(a) {
|
||||
$("#eva_performance_planModel").modal("hide");
|
||||
AlertSuccess(result.message);
|
||||
eva_performance_plan_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_performance_plan_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
@@ -148,16 +147,17 @@ function eva_performance_plan_GoDelete(a) {
|
||||
var eva_performance_planTableV;
|
||||
|
||||
var eva_performance_plan_setupTable = function (result) {
|
||||
tmp = '"';
|
||||
tmp = '"';
|
||||
eva_performance_planTableV = $('#eva_performance_planTable').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
"data": result,
|
||||
"select": false,
|
||||
"select": false,
|
||||
"columns": [
|
||||
{ "data": "id" },
|
||||
{ "data": "fiscal_year" },
|
||||
{ "data": "theTime" },
|
||||
{ "data": "id" },
|
||||
{ "data": "fiscal_year" },
|
||||
{ "data": "theTime" },
|
||||
{ "data": "percent" },
|
||||
],
|
||||
"columnDefs": [
|
||||
{
|
||||
@@ -171,13 +171,13 @@ var eva_performance_plan_setupTable = function (result) {
|
||||
"url": appsite + "/DataTables-1.10.16/thai.json"
|
||||
},
|
||||
"paging": true,
|
||||
"searching": false
|
||||
"searching": false
|
||||
});
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
|
||||
function eva_performance_plan_InitiateDataTable() {
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_performance_plan/GetListBySearch", eva_performance_plan_setupTable, AlertDanger);
|
||||
}
|
||||
|
||||
@@ -186,10 +186,10 @@ function eva_performance_plan_DoSearch() {
|
||||
var eva_performance_plan_reload = function (result) {
|
||||
eva_performance_planTableV.destroy();
|
||||
eva_performance_plan_setupTable(result);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_performance_plan/GetListBySearch?"+p, eva_performance_plan_reload, AlertDanger);
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_performance_plan/GetListBySearch?" + p, eva_performance_plan_reload, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_performance_plan_GetSelect(f) {
|
||||
|
||||
@@ -4,18 +4,18 @@ var eva_performance_plan_API = "/api/eva_performance_plan/";
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_performance_plan_FeedDataToForm(data) {
|
||||
$("#eva_performance_plan_id").val(data.id);
|
||||
$("#eva_performance_plan_fiscal_year").val(data.fiscal_year);
|
||||
$("#eva_performance_plan_theTime").val(data.theTime);
|
||||
|
||||
$("#eva_performance_plan_id").val(data.id);
|
||||
$("#eva_performance_plan_fiscal_year").val(data.fiscal_year);
|
||||
$("#eva_performance_plan_theTime").val(data.theTime);
|
||||
$("#eva_performance_plan_percent").val(data.percent);
|
||||
}
|
||||
|
||||
function eva_performance_plan_GetFromForm() {
|
||||
var eva_performance_planObject = new Object();
|
||||
eva_performance_planObject.id = $("#eva_performance_plan_id").val();
|
||||
eva_performance_planObject.fiscal_year = $("#eva_performance_plan_fiscal_year").val();
|
||||
eva_performance_planObject.theTime = $("#eva_performance_plan_theTime").val();
|
||||
|
||||
eva_performance_planObject.id = $("#eva_performance_plan_id").val();
|
||||
eva_performance_planObject.fiscal_year = $("#eva_performance_plan_fiscal_year").val();
|
||||
eva_performance_planObject.theTime = $("#eva_performance_plan_theTime").val();
|
||||
eva_performance_planObject.percent = $("#eva_performance_plan_percent").val();
|
||||
|
||||
return eva_performance_planObject;
|
||||
}
|
||||
@@ -23,9 +23,9 @@ eva_performance_planObject.theTime = $("#eva_performance_plan_theTime").val();
|
||||
function eva_performance_plan_InitialForm() {
|
||||
var successFunc = function (result) {
|
||||
eva_performance_plan_FeedDataToForm(result);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_performance_plan_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
@@ -35,15 +35,15 @@ function eva_performance_plan_SetEditForm(a) {
|
||||
var successFunc = function (result) {
|
||||
eva_performance_plan_editMode = "UPDATE";
|
||||
eva_performance_plan_FeedDataToForm(result);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_performance_plan_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_performance_plan_SetCreateForm() {
|
||||
eva_performance_plan_editMode = "CREATE";
|
||||
eva_performance_plan_InitialForm();
|
||||
eva_performance_plan_InitialForm();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
@@ -53,8 +53,7 @@ var eva_performance_plan_customValidation = function (group) {
|
||||
};
|
||||
|
||||
function eva_performance_plan_PutUpdate() {
|
||||
if (!ValidateForm('eva_performance_plan', eva_performance_plan_customValidation))
|
||||
{
|
||||
if (!ValidateForm('eva_performance_plan', eva_performance_plan_customValidation)) {
|
||||
return;
|
||||
}
|
||||
var data = eva_performance_plan_GetFromForm();
|
||||
@@ -63,18 +62,18 @@ function eva_performance_plan_PutUpdate() {
|
||||
if (eva_performance_plan_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
AlertSuccess(result.message);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_performance_plan_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
AlertSuccess(result.message);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_performance_plan_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
@@ -84,9 +83,9 @@ function eva_performance_plan_GoDelete(a) {
|
||||
var successFunc = function (result) {
|
||||
AlertSuccess(result.message);
|
||||
eva_performance_plan_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_performance_plan_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user