fix op 2733
This commit is contained in:
@@ -5,40 +5,45 @@ var eva_salary_cylinder_API = "/api/eva_salary_cylinder/";
|
||||
|
||||
function eva_salary_cylinder_GetSearchParameter() {
|
||||
var eva_salary_cylinderSearchObject = new Object();
|
||||
eva_salary_cylinderSearchObject.position_type = $("#s_eva_salary_cylinder_position_type").val();
|
||||
eva_salary_cylinderSearchObject.position_type = $("#s_eva_salary_cylinder_position_type").val();
|
||||
|
||||
return eva_salary_cylinderSearchObject;
|
||||
}
|
||||
|
||||
function eva_salary_cylinder_FeedDataToSearchForm(data) {
|
||||
DropDownClearFormAndFeedWithData($("#s_eva_salary_cylinder_position_type"), data, "id", "external_name", "item_position_type", data.position_type);
|
||||
DropDownClearFormAndFeedWithData($("#s_eva_salary_cylinder_position_type"), data, "id", "external_name", "item_position_type", data.position_type);
|
||||
|
||||
}
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_salary_cylinder_FeedDataToForm(data) {
|
||||
$("#eva_salary_cylinder_id").val(data.id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_salary_cylinder_position_type"), data, "id", "external_name", "item_position_type", data.position_type);
|
||||
DropDownClearFormAndFeedWithData($("#eva_salary_cylinder_position_level"), data, "id", "external_name", "item_position_level", data.position_level);
|
||||
$("#eva_salary_cylinder_temporary_min").val(data.temporary_min);
|
||||
$("#eva_salary_cylinder_themin").val(data.themin);
|
||||
$("#eva_salary_cylinder_themax").val(data.themax);
|
||||
$("#eva_salary_cylinder_middle").val(data.middle);
|
||||
$("#eva_salary_cylinder_cost_living").val(data.cost_living );
|
||||
$("#eva_salary_cylinder_id").val(data.id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_salary_cylinder_position_type"), data, "id", "external_name", "item_position_type", data.position_type);
|
||||
DropDownClearFormAndFeedWithData($("#eva_salary_cylinder_position_level"), data, "id", "external_name", "item_position_level", data.position_level);
|
||||
// $("#eva_salary_cylinder_temporary_min").val(data.temporary_min);
|
||||
// $("#eva_salary_cylinder_themin").val(data.themin);
|
||||
// $("#eva_salary_cylinder_themax").val(data.themax);
|
||||
// $("#eva_salary_cylinder_middle").val(data.middle);
|
||||
// $("#eva_salary_cylinder_cost_living").val(data.cost_living);
|
||||
$("#eva_salary_cylinder_temporary_min").maskMoney('mask',data.temporary_min);
|
||||
$("#eva_salary_cylinder_themin").maskMoney('mask',data.themin);
|
||||
$("#eva_salary_cylinder_themax").maskMoney('mask',data.themax);
|
||||
$("#eva_salary_cylinder_middle").maskMoney('mask',data.middle);
|
||||
$("#eva_salary_cylinder_cost_living").maskMoney('mask',data.cost_living);
|
||||
|
||||
}
|
||||
|
||||
function eva_salary_cylinder_GetFromForm() {
|
||||
var eva_salary_cylinderObject = new Object();
|
||||
eva_salary_cylinderObject.id = $("#eva_salary_cylinder_id").val();
|
||||
eva_salary_cylinderObject.position_type = $("#eva_salary_cylinder_position_type").val();
|
||||
eva_salary_cylinderObject.position_level = $("#eva_salary_cylinder_position_level").val();
|
||||
eva_salary_cylinderObject.temporary_min = $("#eva_salary_cylinder_temporary_min").val();
|
||||
eva_salary_cylinderObject.themin = $("#eva_salary_cylinder_themin").val();
|
||||
eva_salary_cylinderObject.themax = $("#eva_salary_cylinder_themax").val();
|
||||
eva_salary_cylinderObject.middle = $("#eva_salary_cylinder_middle").val();
|
||||
eva_salary_cylinderObject.cost_living = $("#eva_salary_cylinder_cost_living").val();
|
||||
eva_salary_cylinderObject.id = $("#eva_salary_cylinder_id").val();
|
||||
eva_salary_cylinderObject.position_type = $("#eva_salary_cylinder_position_type").val();
|
||||
eva_salary_cylinderObject.position_level = $("#eva_salary_cylinder_position_level").val();
|
||||
eva_salary_cylinderObject.temporary_min = $("#eva_salary_cylinder_temporary_min").val().replace(/[,-]/g,'');
|
||||
eva_salary_cylinderObject.themin = $("#eva_salary_cylinder_themin").val().replace(/[,-]/g,'');
|
||||
eva_salary_cylinderObject.themax = $("#eva_salary_cylinder_themax").val().replace(/[,-]/g,'');
|
||||
eva_salary_cylinderObject.middle = $("#eva_salary_cylinder_middle").val().replace(/[,-]/g,'');
|
||||
eva_salary_cylinderObject.cost_living = $("#eva_salary_cylinder_cost_living").val().replace(/[,-]/g,'');
|
||||
|
||||
|
||||
return eva_salary_cylinderObject;
|
||||
@@ -47,14 +52,14 @@ eva_salary_cylinderObject.cost_living = $("#eva_salary_cylinder_cost_living").v
|
||||
function eva_salary_cylinder_InitialForm(s) {
|
||||
var successFunc = function (result) {
|
||||
eva_salary_cylinder_FeedDataToForm(result);
|
||||
eva_salary_cylinder_FeedDataToSearchForm(result);
|
||||
eva_salary_cylinder_FeedDataToSearchForm(result);
|
||||
if (s) {
|
||||
// Incase model popup
|
||||
$("#eva_salary_cylinderModel").modal("show");
|
||||
}
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_salary_cylinder_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
@@ -81,15 +86,15 @@ function eva_salary_cylinder_SetEditForm(a) {
|
||||
eva_salary_cylinder_editMode = "UPDATE";
|
||||
eva_salary_cylinder_FeedDataToForm(result);
|
||||
$("#eva_salary_cylinderModel").modal("show");
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_salary_cylinder_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_salary_cylinder_SetCreateForm(s) {
|
||||
eva_salary_cylinder_editMode = "CREATE";
|
||||
eva_salary_cylinder_InitialForm(s);
|
||||
eva_salary_cylinder_InitialForm(s);
|
||||
}
|
||||
|
||||
function eva_salary_cylinder_RefreshTable() {
|
||||
@@ -107,8 +112,7 @@ var eva_salary_cylinder_customValidation = function (group) {
|
||||
};
|
||||
|
||||
function eva_salary_cylinder_PutUpdate() {
|
||||
if (!ValidateForm('eva_salary_cylinder', eva_salary_cylinder_customValidation))
|
||||
{
|
||||
if (!ValidateForm('eva_salary_cylinder', eva_salary_cylinder_customValidation)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -118,22 +122,22 @@ function eva_salary_cylinder_PutUpdate() {
|
||||
if (eva_salary_cylinder_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
$("#eva_salary_cylinderModel").modal("hide");
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_salary_cylinder_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_salary_cylinder_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
$("#eva_salary_cylinderModel").modal("hide");
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_salary_cylinder_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_salary_cylinder_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
@@ -142,11 +146,11 @@ function eva_salary_cylinder_GoDelete(a) {
|
||||
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
|
||||
var successFunc = function (result) {
|
||||
$("#eva_salary_cylinderModel").modal("hide");
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_salary_cylinder_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_salary_cylinder_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
@@ -156,22 +160,22 @@ function eva_salary_cylinder_GoDelete(a) {
|
||||
var eva_salary_cylinderTableV;
|
||||
|
||||
var eva_salary_cylinder_setupTable = function (result) {
|
||||
console.log(result);
|
||||
tmp = '"';
|
||||
console.log(result);
|
||||
tmp = '"';
|
||||
eva_salary_cylinderTableV = $('#eva_salary_cylinderTable').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
"data": result,
|
||||
"select": false,
|
||||
"select": false,
|
||||
"columns": [
|
||||
{ "data": "id" },
|
||||
{ "data": "position_type_external_linkage_external_name" },
|
||||
{ "data": "position_level_external_linkage_external_name" },
|
||||
{ "data": "temporary_min" },
|
||||
{ "data": "themin" },
|
||||
{ "data": "themax" },
|
||||
{ "data": "middle" },
|
||||
{ "data": "cost_living" },
|
||||
{ "data": "id" },
|
||||
{ "data": "position_type_external_linkage_external_name" },
|
||||
{ "data": "position_level_external_linkage_external_name" },
|
||||
{ "data": "temporary_min" },
|
||||
{ "data": "themin" },
|
||||
{ "data": "themax" },
|
||||
{ "data": "middle" },
|
||||
{ "data": "cost_living" },
|
||||
],
|
||||
"columnDefs": [
|
||||
{
|
||||
@@ -220,13 +224,13 @@ console.log(result);
|
||||
"url": appsite + "/DataTables-1.10.16/thai.json"
|
||||
},
|
||||
"paging": true,
|
||||
"searching": false
|
||||
"searching": false
|
||||
});
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
|
||||
function eva_salary_cylinder_InitiateDataTable() {
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_salary_cylinder/GetListBySearch", eva_salary_cylinder_setupTable, AlertDanger);
|
||||
}
|
||||
|
||||
@@ -235,10 +239,10 @@ function eva_salary_cylinder_DoSearch() {
|
||||
var eva_salary_cylinder_reload = function (result) {
|
||||
eva_salary_cylinderTableV.destroy();
|
||||
eva_salary_cylinder_setupTable(result);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_salary_cylinder/GetListBySearch?"+p, eva_salary_cylinder_reload, AlertDanger);
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_salary_cylinder/GetListBySearch?" + p, eva_salary_cylinder_reload, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_salary_cylinder_GetSelect(f) {
|
||||
|
||||
Reference in New Issue
Block a user