ปรับปรุงหลายข้อ

This commit is contained in:
LAPTOP-KB8JC2K2\acer
2021-07-19 16:47:05 +07:00
parent dce57d2ca1
commit 38a2e1fe88
7 changed files with 120 additions and 97 deletions

View File

@@ -5,62 +5,62 @@ var eva_create_evaluation_detail_process_API = "/api/eva_create_evaluation_detai
function eva_create_evaluation_detail_process_GetSearchParameter() {
var eva_create_evaluation_detail_processSearchObject = new Object();
eva_create_evaluation_detail_processSearchObject.create_evaluation_id = $("#s_eva_create_evaluation_detail_process_create_evaluation_id").val();
eva_create_evaluation_detail_processSearchObject.org_id = $("#s_eva_create_evaluation_detail_process_org_id").val();
eva_create_evaluation_detail_processSearchObject.search_employee_code = $("#s_eva_create_evaluation_detail_process_search_employee_code").val();
eva_create_evaluation_detail_processSearchObject.search_employee_fullname = $("#s_eva_create_evaluation_detail_process_search_employee_fullname").val();
eva_create_evaluation_detail_processSearchObject.employee_id = $("#s_eva_create_evaluation_detail_process_employee_id").val();
eva_create_evaluation_detail_processSearchObject.create_evaluation_id = $("#s_eva_create_evaluation_detail_process_create_evaluation_id").val();
eva_create_evaluation_detail_processSearchObject.org_id = $("#s_eva_create_evaluation_detail_process_org_id").val();
eva_create_evaluation_detail_processSearchObject.search_employee_code = $("#s_eva_create_evaluation_detail_process_search_employee_code").val();
eva_create_evaluation_detail_processSearchObject.search_employee_fullname = $("#s_eva_create_evaluation_detail_process_search_employee_fullname").val();
eva_create_evaluation_detail_processSearchObject.employee_id = $("#s_eva_create_evaluation_detail_process_employee_id").val();
eva_create_evaluation_detail_processSearchObject.path = "d";
eva_create_evaluation_detail_processSearchObject.path = "d";
return eva_create_evaluation_detail_processSearchObject;
}
function eva_create_evaluation_detail_process_FeedDataToSearchForm(data) {
$("#s_eva_create_evaluation_detail_process_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_process_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#s_eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code);
$("#s_eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname);
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_process_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
console.log(data.item_employee_id);
$("#s_eva_create_evaluation_detail_process_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_process_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#s_eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code);
$("#s_eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname);
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_process_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
console.log(data.item_employee_id);
}
//================= Form Data Customizaiton =========================================
function eva_create_evaluation_detail_process_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_process_id").val(data.id);
$("#eva_create_evaluation_detail_process_evaluation_round").text(data.evaluation_round);
$("#eva_create_evaluation_detail_process_employee_code").text(data.employee_code);
$("#eva_create_evaluation_detail_process_employee_fullname").text(data.employee_fullname);
$("#eva_create_evaluation_detail_process_employee_position").text(data.employee_position);
$("#eva_create_evaluation_detail_process_employee_position_type").text(data.employee_position_type);
$("#eva_create_evaluation_detail_process_employee_position_level").text(data.employee_position_level);
$("#eva_create_evaluation_detail_process_employee_org").text(data.employee_org);
$("#eva_create_evaluation_detail_process_chief_fullname").text(data.chief_fullname);
$("#eva_create_evaluation_detail_process_chief_position").text(data.chief_position);
$("#eva_create_evaluation_detail_process_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_process_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code);
$("#eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname);
$("#eva_create_evaluation_detail_process_id").val(data.id);
$("#eva_create_evaluation_detail_process_evaluation_round").text(data.evaluation_round);
$("#eva_create_evaluation_detail_process_employee_code").text(data.employee_code);
$("#eva_create_evaluation_detail_process_employee_fullname").text(data.employee_fullname);
$("#eva_create_evaluation_detail_process_employee_position").text(data.employee_position);
$("#eva_create_evaluation_detail_process_employee_position_type").text(data.employee_position_type);
$("#eva_create_evaluation_detail_process_employee_position_level").text(data.employee_position_level);
$("#eva_create_evaluation_detail_process_employee_org").text(data.employee_org);
$("#eva_create_evaluation_detail_process_chief_fullname").text(data.chief_fullname);
$("#eva_create_evaluation_detail_process_chief_position").text(data.chief_position);
$("#eva_create_evaluation_detail_process_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_process_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code);
$("#eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname);
}
function eva_create_evaluation_detail_process_GetFromForm() {
var eva_create_evaluation_detail_processObject = new Object();
eva_create_evaluation_detail_processObject.id = $("#eva_create_evaluation_detail_process_id").val();
eva_create_evaluation_detail_processObject.evaluation_round = $("#eva_create_evaluation_detail_process_evaluation_round").text();
eva_create_evaluation_detail_processObject.employee_code = $("#eva_create_evaluation_detail_process_employee_code").text();
eva_create_evaluation_detail_processObject.employee_fullname = $("#eva_create_evaluation_detail_process_employee_fullname").text();
eva_create_evaluation_detail_processObject.employee_position = $("#eva_create_evaluation_detail_process_employee_position").text();
eva_create_evaluation_detail_processObject.employee_position_type = $("#eva_create_evaluation_detail_process_employee_position_type").text();
eva_create_evaluation_detail_processObject.employee_position_level = $("#eva_create_evaluation_detail_process_employee_position_level").text();
eva_create_evaluation_detail_processObject.employee_org = $("#eva_create_evaluation_detail_process_employee_org").text();
eva_create_evaluation_detail_processObject.chief_fullname = $("#eva_create_evaluation_detail_process_chief_fullname").text();
eva_create_evaluation_detail_processObject.chief_position = $("#eva_create_evaluation_detail_process_chief_position").text();
eva_create_evaluation_detail_processObject.create_evaluation_id = $("#eva_create_evaluation_detail_process_create_evaluation_id").val();
eva_create_evaluation_detail_processObject.org_id = $("#eva_create_evaluation_detail_process_org_id").val();
eva_create_evaluation_detail_processObject.search_employee_code = $("#eva_create_evaluation_detail_process_search_employee_code").val();
eva_create_evaluation_detail_processObject.search_employee_fullname = $("#eva_create_evaluation_detail_process_search_employee_fullname").val();
eva_create_evaluation_detail_processObject.id = $("#eva_create_evaluation_detail_process_id").val();
eva_create_evaluation_detail_processObject.evaluation_round = $("#eva_create_evaluation_detail_process_evaluation_round").text();
eva_create_evaluation_detail_processObject.employee_code = $("#eva_create_evaluation_detail_process_employee_code").text();
eva_create_evaluation_detail_processObject.employee_fullname = $("#eva_create_evaluation_detail_process_employee_fullname").text();
eva_create_evaluation_detail_processObject.employee_position = $("#eva_create_evaluation_detail_process_employee_position").text();
eva_create_evaluation_detail_processObject.employee_position_type = $("#eva_create_evaluation_detail_process_employee_position_type").text();
eva_create_evaluation_detail_processObject.employee_position_level = $("#eva_create_evaluation_detail_process_employee_position_level").text();
eva_create_evaluation_detail_processObject.employee_org = $("#eva_create_evaluation_detail_process_employee_org").text();
eva_create_evaluation_detail_processObject.chief_fullname = $("#eva_create_evaluation_detail_process_chief_fullname").text();
eva_create_evaluation_detail_processObject.chief_position = $("#eva_create_evaluation_detail_process_chief_position").text();
eva_create_evaluation_detail_processObject.create_evaluation_id = $("#eva_create_evaluation_detail_process_create_evaluation_id").val();
eva_create_evaluation_detail_processObject.org_id = $("#eva_create_evaluation_detail_process_org_id").val();
eva_create_evaluation_detail_processObject.search_employee_code = $("#eva_create_evaluation_detail_process_search_employee_code").val();
eva_create_evaluation_detail_processObject.search_employee_fullname = $("#eva_create_evaluation_detail_process_search_employee_fullname").val();
return eva_create_evaluation_detail_processObject;
@@ -69,14 +69,14 @@ eva_create_evaluation_detail_processObject.search_employee_fullname = $("#eva_cr
function eva_create_evaluation_detail_process_InitialForm(s) {
var successFunc = function (result) {
eva_create_evaluation_detail_process_FeedDataToForm(result);
eva_create_evaluation_detail_process_FeedDataToSearchForm(result);
eva_create_evaluation_detail_process_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_create_evaluation_detail_processModel").modal("show");
}
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + "GetBlankItem", successFunc, AlertDanger);
}
@@ -91,13 +91,12 @@ function eva_create_evaluation_detail_process_GoCreate() {
}
function eva_create_evaluation_detail_process_GoEdit(a, role_code) {
if(role_code=="1"){
if (role_code == "1") {
window_open(appsite + "/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d?id=" + a);
}
else
{
else {
window_open(appsite + "/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2?id=" + a);
}
}
}
function eva_create_evaluation_detail_process_SetEditForm(a) {
@@ -105,15 +104,15 @@ function eva_create_evaluation_detail_process_SetEditForm(a) {
eva_create_evaluation_detail_process_editMode = "UPDATE";
eva_create_evaluation_detail_process_FeedDataToForm(result);
$("#eva_create_evaluation_detail_processModel").modal("show");
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_process_SetCreateForm(s) {
eva_create_evaluation_detail_process_editMode = "CREATE";
eva_create_evaluation_detail_process_InitialForm(s);
eva_create_evaluation_detail_process_InitialForm(s);
}
function eva_create_evaluation_detail_process_RefreshTable() {
@@ -131,8 +130,7 @@ var eva_create_evaluation_detail_process_customValidation = function (group) {
};
function eva_create_evaluation_detail_process_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_process', eva_create_evaluation_detail_process_customValidation))
{
if (!ValidateForm('eva_create_evaluation_detail_process', eva_create_evaluation_detail_process_customValidation)) {
return;
}
@@ -144,9 +142,9 @@ function eva_create_evaluation_detail_process_PutUpdate() {
$("#eva_create_evaluation_detail_processModel").modal("hide");
AlertSuccess(result.message);
eva_create_evaluation_detail_process_RefreshTable();
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_process_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
@@ -155,9 +153,9 @@ function eva_create_evaluation_detail_process_PutUpdate() {
$("#eva_create_evaluation_detail_processModel").modal("hide");
AlertSuccess(result.message);
eva_create_evaluation_detail_process_RefreshTable();
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_process_API, data, successFunc2, AlertDanger);
}
}
@@ -168,9 +166,9 @@ function eva_create_evaluation_detail_process_GoDelete(a) {
$("#eva_create_evaluation_detail_processModel").modal("hide");
AlertSuccess(result.message);
eva_create_evaluation_detail_process_RefreshTable();
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_process_API + a, null, successFunc, AlertDanger);
}
}
@@ -182,27 +180,27 @@ var eva_create_evaluation_detail_processTableV;
var eva_create_evaluation_detail_process_setupTable = function (result) {
var groupColumn = 6;
tmp = '"';
tmp = '"';
eva_create_evaluation_detail_processTableV = $('#eva_create_evaluation_detail_processTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "id" },
{ "data": "plan_round_year" },
{ "data": "employee_code" },
{ "data": "employee_fullname" },
{ "data": "employee_position" },
{ "data": "employee_position_level" },
{ "data": "org_id_external_linkage_external_name" },
{ "data": "role_desc" },
{ "data": "txt_status_self" },
{ "data": "txt_status_chief" },
{ "data": "txt_status_supervisor" },
{ "data": "txt_status_supervisor1A" },
{ "data": "txt_status_supervisor2A" }
{ "data": "plan_round_year" },
{ "data": "employee_code" },
{ "data": "employee_fullname" },
{ "data": "employee_position" },
{ "data": "employee_position_level" },
{ "data": "org_id_external_linkage_external_name" },
{ "data": "role_desc" },
{ "data": "txt_status_self" },
{ "data": "txt_status_chief" },
{ "data": "txt_status_supervisor" },
{ "data": "txt_status_supervisor1A" },
{ "data": "txt_status_supervisor2A" }
],
"columnDefs": [
{
@@ -217,42 +215,42 @@ var eva_create_evaluation_detail_process_setupTable = function (result) {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false,
"drawCallback": function ( settings ) {
"searching": false,
"drawCallback": function (settings) {
var api = this.api();
var rows = api.rows( {page:'current'} ).nodes();
var last=null;
api.column(groupColumn, {page:'current'} ).data().each( function ( group, i ) {
if ( last !== group ) {
$(rows).eq( i ).before(
'<tr class="group"><td colspan="12">'+group+'</td></tr>'
var rows = api.rows({ page: 'current' }).nodes();
var last = null;
api.column(groupColumn, { page: 'current' }).data().each(function (group, i) {
if (last !== group) {
$(rows).eq(i).before(
'<tr class="group"><td colspan="12">' + group + '</td></tr>'
);
last = group;
}
} );
});
}
});
endLoad();
endLoad();
};
function eva_create_evaluation_detail_process_InitiateDataTable() {
startLoad();
startLoad();
var p = $.param(eva_create_evaluation_detail_process_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_process/GetListBySearch?"+p, eva_create_evaluation_detail_process_setupTable, AlertDanger);
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_process/GetListBySearch?" + p, eva_create_evaluation_detail_process_setupTable, AlertDanger);
}
function eva_create_evaluation_detail_process_DoSearch() {
var p = $.param(eva_create_evaluation_detail_process_GetSearchParameter());
console.log(p);
//console.log(p);
var eva_create_evaluation_detail_process_reload = function (result) {
eva_create_evaluation_detail_processTableV.destroy();
eva_create_evaluation_detail_process_setupTable(result);
endLoad();
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_process/GetListBySearch?"+p, eva_create_evaluation_detail_process_reload, AlertDanger);
startLoad();
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_process/GetListBySearch?" + p, eva_create_evaluation_detail_process_reload, AlertDanger);
}
function eva_create_evaluation_detail_process_GetSelect(f) {

View File

@@ -158,7 +158,7 @@ function eva_salary_cylinder_GoDelete(a) {
var eva_salary_cylinderTableV;
var eva_salary_cylinder_setupTable = function (result) {
console.log(result);
var groupColumn = 1;
tmp = '"';
eva_salary_cylinderTableV = $('#eva_salary_cylinderTable').DataTable({
"processing": true,
@@ -237,7 +237,22 @@ var eva_salary_cylinder_setupTable = function (result) {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
"searching": false,
"drawCallback": function (settings) {
var api = this.api();
var rows = api.rows({ page: 'current' }).nodes();
var last = null;
api.column(groupColumn, { page: 'current' }).data().each(function (group, i) {
if (last !== group) {
$(rows).eq(i).before(
'<tr class="group"><td colspan="12">' + group + '</td></tr>'
);
last = group;
}
});
}
});
endLoad();
};