รวม code จากทุกคน ที่แก้ไข op ล่าสุด
This commit is contained in:
@@ -10,7 +10,7 @@ $("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val("");
|
||||
$("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val("");
|
||||
$("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text("");
|
||||
$("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text("");
|
||||
$("#eva_adjust_postponement_detail_normal_02_remark_" + i).val("");
|
||||
$("#eva_adjust_postponement_detail_normal_02_remark_" + i).text("");
|
||||
$("#eva_adjust_postponement_detail_normal_02_emp_code_" + i).text("");
|
||||
$("#eva_adjust_postponement_detail_normal_02_emp_fullname_" + i).text("");
|
||||
$("#eva_adjust_postponement_detail_normal_02_emp_position_" + i).text("");
|
||||
@@ -31,7 +31,7 @@ $("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(data
|
||||
$("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val(data.total_promote);
|
||||
$("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text(data.new_sarary);
|
||||
$("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text(data.new_cost_living);
|
||||
$("#eva_adjust_postponement_detail_normal_02_remark_" + i).val(data.remark);
|
||||
$("#eva_adjust_postponement_detail_normal_02_remark_" + i).text(data.remark);
|
||||
$("#eva_adjust_postponement_detail_normal_02_emp_code_" + i).text(data.emp_code);
|
||||
$("#eva_adjust_postponement_detail_normal_02_emp_fullname_" + i).text(data.emp_fullname);
|
||||
$("#eva_adjust_postponement_detail_normal_02_emp_position_" + i).text(data.emp_position);
|
||||
@@ -53,7 +53,7 @@ eva_adjust_postponement_detail_normal_02Object.promoted_percentage = obj.find("#
|
||||
eva_adjust_postponement_detail_normal_02Object.total_promote = obj.find("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val();
|
||||
eva_adjust_postponement_detail_normal_02Object.new_sarary = obj.find("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text();
|
||||
eva_adjust_postponement_detail_normal_02Object.new_cost_living = obj.find("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text();
|
||||
eva_adjust_postponement_detail_normal_02Object.remark = obj.find("#eva_adjust_postponement_detail_normal_02_remark_" + i).val();
|
||||
eva_adjust_postponement_detail_normal_02Object.remark = obj.find("#eva_adjust_postponement_detail_normal_02_remark_" + i).text();
|
||||
eva_adjust_postponement_detail_normal_02Object.emp_code = obj.find("#eva_adjust_postponement_detail_normal_02_emp_code_" + i).text();
|
||||
eva_adjust_postponement_detail_normal_02Object.emp_fullname = obj.find("#eva_adjust_postponement_detail_normal_02_emp_fullname_" + i).text();
|
||||
eva_adjust_postponement_detail_normal_02Object.emp_position = obj.find("#eva_adjust_postponement_detail_normal_02_emp_position_" + i).text();
|
||||
@@ -103,19 +103,17 @@ function eva_adjust_postponement_detail_normal_02_Get(a, blankItem) {
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_sarary_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_cost_living_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_middle_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><input disabled class="form-control" type="number" id="eva_adjust_postponement_detail_normal_02_promoted_percentage_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><input class="form-control" onchange="Oneva_adjust_postponement_detail_normal_02_promoted_percentageChanged()" type="number" id="eva_adjust_postponement_detail_normal_02_promoted_percentage_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><input disabled class="form-control" type="number" id="eva_adjust_postponement_detail_normal_02_total_promote_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_new_sarary_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_new_cost_living_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><input class="form-control" type="text" id="eva_adjust_postponement_detail_normal_02_remark_' + (i + 1)+'" /></td>';
|
||||
|
||||
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_remark_' + (i + 1)+'" /></td>';
|
||||
|
||||
tag += '</tr>';
|
||||
$('#eva_adjust_postponement_detail_normal_02Body').append($(tag));
|
||||
eva_adjust_postponement_detail_normal_02_FeedDataToForm(data, (i + 1), blankItem);
|
||||
});
|
||||
eva_adjust_postponement_detail_normal_02_Summary();
|
||||
//eva_adjust_postponement_detail_normal_02_Summary();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
@@ -124,70 +122,15 @@ function eva_adjust_postponement_detail_normal_02_Get(a, blankItem) {
|
||||
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_detail_normal_02_Add() {
|
||||
var successFunc = function (result) {
|
||||
var i = $("#eva_adjust_postponement_detail_normal_02Body tr").length;
|
||||
var tag = '<tr>';
|
||||
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_adjust_postponement_detail_normal_02" value="1" /></td>';
|
||||
tag += '<td><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_normal_02_id_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_normal_02_adjust_postponement_id_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_normal_02_employee_id_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_sarary_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_cost_living_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_middle_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_detail_normal_02_promoted_percentage_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_detail_normal_02_total_promote_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_new_sarary_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_new_cost_living_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><input class="form-control" type="text" id="eva_adjust_postponement_detail_normal_02_remark_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_emp_code_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_emp_fullname_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_emp_position_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_emp_level_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_total_score_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_eva_result_' + (i + 1)+'" /></td>';
|
||||
|
||||
tag += '<td><a href="javascript:;" class="btn btn-danger btn-sm" onclick="javascript:eva_adjust_postponement_detail_normal_02_Removeeva_adjust_postponement_detail_normal_02(this)" id="removeBtn"><i class="fa fa-trash-o" style="color:white;"></i></a><a href="javascript:;" class="btn btn-primary btn-sm" onclick="javascript:eva_adjust_postponement_detail_normal_02_Restoreeva_adjust_postponement_detail_normal_02(this)" style="display: none;" id="restoreBtn"><i class="fa fa-upload" style="color:white;"></i></a></td>';
|
||||
tag += '</tr>';
|
||||
|
||||
$('#eva_adjust_postponement_detail_normal_02Body').append($(tag));
|
||||
eva_adjust_postponement_detail_normal_02_ClearForm(i + 1, result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_detail_normal_02/" + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_detail_normal_02_Removeeva_adjust_postponement_detail_normal_02(e) {
|
||||
if (confirm('กรุณากดตกลง เพื่อยืนยันการลบ?')) {
|
||||
$(e).closest('tr').find("input,select,textarea").attr('disabled', true);
|
||||
$(e).closest('tr').find("input,select,textarea").css({ opacity: '0.5' });
|
||||
$(e).hide();
|
||||
$(e).closest('tr').find("#restoreBtn").show();
|
||||
$(e).closest('tr').find("input").first().val("0");
|
||||
console.log($(e).closest('tr').find("input").first().val());
|
||||
eva_adjust_postponement_detail_normal_02_Summary();
|
||||
}
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_detail_normal_02_Restoreeva_adjust_postponement_detail_normal_02(e) {
|
||||
if (confirm('กรุณากดตกลง เพื่อยืนยันการกู้คืน?')) {
|
||||
$(e).closest('tr').find("input,select,textarea").attr('disabled', false);
|
||||
$(e).closest('tr').find("input,select,textarea").css({ opacity: '1' });
|
||||
$(e).hide();
|
||||
$(e).closest('tr').find("#removeBtn").show();
|
||||
$(e).closest('tr').find("input").first().val("1");
|
||||
console.log($(e).closest('tr').find("input").first().val());
|
||||
eva_adjust_postponement_detail_normal_02_Summary();
|
||||
}
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_detail_normal_02_Summary() {
|
||||
var sum = 0;
|
||||
$(".input_score").each(function () {
|
||||
sum += +$(this).val();
|
||||
});
|
||||
$("#score_label").text("ผลรวม: " + sum);
|
||||
console.log("eva_adjust_postponement_detail_normal_02_Summary()");
|
||||
//var sum = 0;
|
||||
//$(".input_score").each(function () {
|
||||
// sum += +$(this).val();
|
||||
//});
|
||||
//$("#score_label").text("ผลรวม: " + sum);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_detail_normal_02_InitialForm(id) {
|
||||
|
||||
@@ -10,7 +10,7 @@ $("#eva_adjust_postponement_detail_quota_02_promoted_percentage_" + i).text("");
|
||||
$("#eva_adjust_postponement_detail_quota_02_total_promote_" + i).text("");
|
||||
$("#eva_adjust_postponement_detail_quota_02_new_sarary_" + i).text("");
|
||||
$("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text("");
|
||||
$("#eva_adjust_postponement_detail_quota_02_remark_" + i).val("");
|
||||
$("#eva_adjust_postponement_detail_quota_02_remark_" + i).text("");
|
||||
$("#eva_adjust_postponement_detail_quota_02_receive_quota_" + i).val("");
|
||||
$("#eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_" + i).text("");
|
||||
$("#eva_adjust_postponement_detail_quota_02_emp_code_" + i).text("");
|
||||
@@ -33,7 +33,7 @@ $("#eva_adjust_postponement_detail_quota_02_promoted_percentage_" + i).text(data
|
||||
$("#eva_adjust_postponement_detail_quota_02_total_promote_" + i).text(data.total_promote);
|
||||
$("#eva_adjust_postponement_detail_quota_02_new_sarary_" + i).text(data.new_sarary);
|
||||
$("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text(data.new_cost_living);
|
||||
$("#eva_adjust_postponement_detail_quota_02_remark_" + i).val(data.remark);
|
||||
$("#eva_adjust_postponement_detail_quota_02_remark_" + i).text(data.remark);
|
||||
$("#eva_adjust_postponement_detail_quota_02_receive_quota_" + i).val(data.receive_quota);
|
||||
$("#eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_" + i).text(data.new_sarary_with_quota);
|
||||
$("#eva_adjust_postponement_detail_quota_02_emp_code_" + i).text(data.emp_code);
|
||||
@@ -57,7 +57,7 @@ eva_adjust_postponement_detail_quota_02Object.promoted_percentage = obj.find("#e
|
||||
eva_adjust_postponement_detail_quota_02Object.total_promote = obj.find("#eva_adjust_postponement_detail_quota_02_total_promote_" + i).text();
|
||||
eva_adjust_postponement_detail_quota_02Object.new_sarary = obj.find("#eva_adjust_postponement_detail_quota_02_new_sarary_" + i).text();
|
||||
eva_adjust_postponement_detail_quota_02Object.new_cost_living = obj.find("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text();
|
||||
eva_adjust_postponement_detail_quota_02Object.remark = obj.find("#eva_adjust_postponement_detail_quota_02_remark_" + i).val();
|
||||
eva_adjust_postponement_detail_quota_02Object.remark = obj.find("#eva_adjust_postponement_detail_quota_02_remark_" + i).text();
|
||||
eva_adjust_postponement_detail_quota_02Object.receive_quota = obj.find("#eva_adjust_postponement_detail_quota_02_receive_quota_" + i).val();
|
||||
eva_adjust_postponement_detail_quota_02Object.new_sarary_with_quota = obj.find("#eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_" + i).text();
|
||||
eva_adjust_postponement_detail_quota_02Object.emp_code = obj.find("#eva_adjust_postponement_detail_quota_02_emp_code_" + i).text();
|
||||
@@ -101,19 +101,21 @@ function eva_adjust_postponement_detail_quota_02_Get(a, blankItem) {
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_emp_fullname_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_emp_position_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_emp_level_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_total_score_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_eva_result_' + (i + 1)+'" /></td>';
|
||||
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_sarary_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_cost_living_' + (i + 1)+'" /></td>';
|
||||
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_total_score_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_eva_result_' + (i + 1)+'" /></td>';
|
||||
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_middle_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_promoted_percentage_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_total_promote_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_new_sarary_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_new_cost_living_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_total_promote_' + (i + 1)+'" /><p style="display:none;" id="eva_adjust_postponement_detail_quota_02_new_sarary_' + (i + 1)+'" /></td>';
|
||||
|
||||
tag += '<td><input onchange="CalculateRemainQuota();" class="form-control" type="number" id="eva_adjust_postponement_detail_quota_02_receive_quota_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><input class="form-control" type="text" id="eva_adjust_postponement_detail_quota_02_remark_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_new_cost_living_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_remark_' + (i + 1)+'" /></td>';
|
||||
|
||||
|
||||
tag += '</tr>';
|
||||
|
||||
@@ -117,23 +117,29 @@ function eva_adjust_postponement_normal_GoDelete(a) {
|
||||
}
|
||||
}
|
||||
|
||||
//================= File Upload =========================================
|
||||
|
||||
|
||||
|
||||
//================= Multi-Selection Function =========================================
|
||||
|
||||
|
||||
//================= Control Function =========================================
|
||||
|
||||
function Oneva_adjust_postponement_normal_limit_frameChange(){
|
||||
var limit = $("#eva_adjust_postponement_normal_limit").val();
|
||||
var limit_frame = $("#eva_adjust_postponement_normal_limit_frame").val();
|
||||
$("#eva_adjust_postponement_normal_limit_quota").val(limit*limit_frame/100);
|
||||
limit_frame = Math.round(limit_frame*100)/100;
|
||||
$("#eva_adjust_postponement_normal_limit_frame").val(limit_frame);
|
||||
$("#eva_adjust_postponement_normal_limit_quota").val(Math.round((limit*limit_frame/100)*100)/100);
|
||||
}
|
||||
|
||||
function Oneva_adjust_postponement_normal_percentageChange(){
|
||||
var percentage = $("#eva_adjust_postponement_normal_percentage").val();
|
||||
percentage = Math.round(percentage*100)/100;
|
||||
$("#eva_adjust_postponement_normal_percentage").val(percentage)
|
||||
|
||||
$('#eva_adjust_postponement_detail_normal_02Body tr').each(function () {
|
||||
var i = $(this).find("#rowCount").text();
|
||||
$("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(percentage);
|
||||
});
|
||||
Oneva_adjust_postponement_detail_normal_02_promoted_percentageChanged();
|
||||
}
|
||||
|
||||
function Oneva_adjust_postponement_detail_normal_02_promoted_percentageChanged(){
|
||||
var current_quota = $("#eva_adjust_postponement_normal_limit_quota").val();
|
||||
|
||||
var sum_postpone = 0;
|
||||
@@ -141,18 +147,27 @@ function Oneva_adjust_postponement_normal_percentageChange(){
|
||||
$('#eva_adjust_postponement_detail_normal_02Body tr').each(function () {
|
||||
var i = $(this).find("#rowCount").text();
|
||||
|
||||
var percentage = $("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val();
|
||||
percentage = Math.round(percentage*100)/100;
|
||||
$("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(percentage);
|
||||
|
||||
var middle = parseFloat($(this).find("#eva_adjust_postponement_detail_normal_02_middle_" + i).text());
|
||||
var old_salary = parseFloat($(this).find("#eva_adjust_postponement_detail_normal_02_sarary_" + i).text());
|
||||
var new_salary = parseFloat(old_salary + (percentage * middle));
|
||||
|
||||
$("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(percentage);
|
||||
$("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val(percentage * middle);
|
||||
var new_added = Math.ceil(((percentage * middle)/100)/10)*10;
|
||||
var new_salary = parseFloat(old_salary + new_added);
|
||||
|
||||
$("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val(new_added);
|
||||
$("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text(new_salary);
|
||||
|
||||
sum_postpone += percentage * middle;
|
||||
if(new_salary < 13285){
|
||||
$("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text(1000);
|
||||
}else{
|
||||
$("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text(0);
|
||||
}
|
||||
|
||||
sum_postpone += new_added;
|
||||
});
|
||||
|
||||
$("#remain_cost").val(current_quota - sum_postpone);
|
||||
$("#remain_cost").val(Math.round((current_quota - sum_postpone)*100)/100);
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,14 @@ function eva_adjust_postponement_quota_GoDelete(a) {
|
||||
function Oneva_adjust_postponement_quota_limit_frame_quotaChange()
|
||||
{
|
||||
var limit_frame_quota = parseFloat($("#eva_adjust_postponement_quota_limit_frame_quota").val());
|
||||
limit_frame_quota = Math.round(limit_frame_quota * 100) / 100;
|
||||
if(limit_frame_quota < 0) limit_frame_quota = 0;
|
||||
$("#eva_adjust_postponement_quota_limit_frame_quota").val(limit_frame_quota);
|
||||
|
||||
var limit = parseFloat($("#eva_adjust_postponement_quota_limit").val());
|
||||
limit = Math.round(limit * 100)/100;
|
||||
$("#eva_adjust_postponement_quota_limit").val(limit);
|
||||
|
||||
limit_quota = limit_frame_quota * limit / 100;
|
||||
$("#eva_adjust_postponement_quota_limit_quota").val(limit_quota);
|
||||
CalculateRemainQuota();
|
||||
@@ -136,8 +143,20 @@ function CalculateRemainQuota(){
|
||||
var i = $(this).find("#rowCount").text();
|
||||
var new_sarary = parseFloat($("#eva_adjust_postponement_detail_quota_02_new_sarary_" + i).text());
|
||||
var receive_quota = parseFloat($("#eva_adjust_postponement_detail_quota_02_receive_quota_" + i).val());
|
||||
|
||||
receive_quota = Math.round(receive_quota*100)/100;
|
||||
if(receive_quota < 0) receive_quota = 0;
|
||||
$("#eva_adjust_postponement_detail_quota_02_receive_quota_" + i).val(receive_quota);
|
||||
|
||||
var new_sarary_with_quota = new_sarary + receive_quota;
|
||||
$("#eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_" + i).text(new_sarary_with_quota);
|
||||
|
||||
if(new_sarary_with_quota < 13285){
|
||||
$("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text(1000);
|
||||
}else{
|
||||
$("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text(0);
|
||||
}
|
||||
|
||||
sum_receive_quota += receive_quota;
|
||||
});
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ var eva_create_evaluation_setupTable = function (result) {
|
||||
"columns": [
|
||||
{ "data": "id" },
|
||||
{ "data": "performance_plan_id_eva_performance_plan_fiscal_year" },
|
||||
{ "data": "evaluation_group_id_eva_evaluation_group_code" },
|
||||
{ "data": "evaluation_group_id_eva_evaluation_group_name" },
|
||||
{ "data": "employee_id_external_linkage_external_name" },
|
||||
{ "data": "score1" },
|
||||
{ "data": "score2" },
|
||||
|
||||
@@ -160,7 +160,10 @@ var eva_create_evaluation_detail_setupTable = function (result) {
|
||||
"columns": [
|
||||
{ "data": "id" },
|
||||
{ "data": "employee_id_external_linkage_external_name" },
|
||||
{ "data": "chief_external_linkage_external_name" },
|
||||
{ "data": "position_type_text" },
|
||||
{ "data": "position_level_text" },
|
||||
{ "data": "chief_external_linkage_external_name" },
|
||||
|
||||
],
|
||||
"columnDefs": [
|
||||
{
|
||||
|
||||
@@ -163,6 +163,12 @@ var eva_evaluation_achievementTableV;
|
||||
|
||||
var eva_evaluation_achievement_setupTable = function (result) {
|
||||
tmp = '"';
|
||||
var sum_a = 0;
|
||||
$.each(result, function( k, v ) {
|
||||
sum_a += v.weight;
|
||||
});
|
||||
$("#sum_a").text(sum_a);
|
||||
|
||||
eva_evaluation_achievementTableV = $('#eva_evaluation_achievementTable').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
|
||||
@@ -6,11 +6,11 @@ $("#eva_evaluation_achievement_process_achievement_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process_weight_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process_score_" + i).val("");
|
||||
$("#eva_evaluation_achievement_process_sumary_" + i).text("");
|
||||
//$("#eva_evaluation_achievement_process_target_score1_" + i).text("");
|
||||
//$("#eva_evaluation_achievement_process_target_score2_" + i).text("");
|
||||
//$("#eva_evaluation_achievement_process_target_score3_" + i).text("");
|
||||
//$("#eva_evaluation_achievement_process_target_score4_" + i).text("");
|
||||
//$("#eva_evaluation_achievement_process_target_score5_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process_target_score1_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process_target_score2_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process_target_score3_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process_target_score4_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process_target_score5_" + i).text("");
|
||||
|
||||
}
|
||||
|
||||
@@ -22,11 +22,11 @@ $("#eva_evaluation_achievement_process_achievement_" + i).text(data.achievement)
|
||||
$("#eva_evaluation_achievement_process_weight_" + i).text(data.weight);
|
||||
$("#eva_evaluation_achievement_process_score_" + i).val(data.score);
|
||||
$("#eva_evaluation_achievement_process_sumary_" + i).text(data.sumary);
|
||||
//$("#eva_evaluation_achievement_process_target_score1_" + i).text(data.target_score1);
|
||||
//$("#eva_evaluation_achievement_process_target_score2_" + i).text(data.target_score2);
|
||||
//$("#eva_evaluation_achievement_process_target_score3_" + i).text(data.target_score3);
|
||||
//$("#eva_evaluation_achievement_process_target_score4_" + i).text(data.target_score4);
|
||||
//$("#eva_evaluation_achievement_process_target_score5_" + i).text(data.target_score5);
|
||||
$("#eva_evaluation_achievement_process_target_score1_" + i).text(data.target_score1);
|
||||
$("#eva_evaluation_achievement_process_target_score2_" + i).text(data.target_score2);
|
||||
$("#eva_evaluation_achievement_process_target_score3_" + i).text(data.target_score3);
|
||||
$("#eva_evaluation_achievement_process_target_score4_" + i).text(data.target_score4);
|
||||
$("#eva_evaluation_achievement_process_target_score5_" + i).text(data.target_score5);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@ $("#eva_evaluation_achievement_process2_weight_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process2_score_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process2_score2_" + i).val("");
|
||||
$("#eva_evaluation_achievement_process2_sumary2_" + i).text("");
|
||||
//$("#eva_evaluation_achievement_process2_target_score1_" + i).text("");
|
||||
//$("#eva_evaluation_achievement_process2_target_score2_" + i).text("");
|
||||
//$("#eva_evaluation_achievement_process2_target_score3_" + i).text("");
|
||||
//$("#eva_evaluation_achievement_process2_target_score4_" + i).text("");
|
||||
//$("#eva_evaluation_achievement_process2_target_score5_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process2_target_score1_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process2_target_score2_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process2_target_score3_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process2_target_score4_" + i).text("");
|
||||
$("#eva_evaluation_achievement_process2_target_score5_" + i).text("");
|
||||
|
||||
}
|
||||
|
||||
@@ -26,11 +26,11 @@ $("#eva_evaluation_achievement_process2_weight_" + i).text(data.weight);
|
||||
$("#eva_evaluation_achievement_process2_score_" + i).text(data.score);
|
||||
$("#eva_evaluation_achievement_process2_score2_" + i).val(data.score2);
|
||||
$("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary2);
|
||||
//$("#eva_evaluation_achievement_process2_target_score1_" + i).text(data.target_score1);
|
||||
//$("#eva_evaluation_achievement_process2_target_score2_" + i).text(data.target_score2);
|
||||
//$("#eva_evaluation_achievement_process2_target_score3_" + i).text(data.target_score3);
|
||||
//$("#eva_evaluation_achievement_process2_target_score4_" + i).text(data.target_score4);
|
||||
//$("#eva_evaluation_achievement_process2_target_score5_" + i).text(data.target_score5);
|
||||
$("#eva_evaluation_achievement_process2_target_score1_" + i).text(data.target_score1);
|
||||
$("#eva_evaluation_achievement_process2_target_score2_" + i).text(data.target_score2);
|
||||
$("#eva_evaluation_achievement_process2_target_score3_" + i).text(data.target_score3);
|
||||
$("#eva_evaluation_achievement_process2_target_score4_" + i).text(data.target_score4);
|
||||
$("#eva_evaluation_achievement_process2_target_score5_" + i).text(data.target_score5);
|
||||
|
||||
}
|
||||
|
||||
@@ -120,8 +120,10 @@ function Oneva_evaluation_achievement_process2_scoreChange(){
|
||||
var total_achievement = 0;
|
||||
var total_achievement_weight = 0;
|
||||
var total_achievement_score = 0;
|
||||
var total_achievement_score_old = 0;
|
||||
$('#eva_evaluation_achievement_process2Body tr').each(function () {
|
||||
var i = $(this).find("#rowCount").text();
|
||||
var score_old = $("#eva_evaluation_achievement_process2_score_" + i).text();
|
||||
var score = $("#eva_evaluation_achievement_process2_score2_" + i).val();
|
||||
var weight = $("#eva_evaluation_achievement_process2_weight_" + i).text();
|
||||
var total = (score * weight / 100).toFixed(2);
|
||||
@@ -129,9 +131,12 @@ function Oneva_evaluation_achievement_process2_scoreChange(){
|
||||
total_achievement += parseFloat(total);
|
||||
total_achievement_weight += parseFloat(weight);
|
||||
total_achievement_score += parseFloat(score);
|
||||
total_achievement_score_old += parseFloat(score_old);
|
||||
console.log(score_old);
|
||||
});
|
||||
$("#h_eva_evaluation_achievement_process2_weight").text(total_achievement_weight.toFixed(2));
|
||||
$("#h_eva_evaluation_achievement_process2_score2").text(total_achievement_score.toFixed(2));
|
||||
$("#h_eva_evaluation_achievement_process2_score").text(total_achievement_score_old.toFixed(2));
|
||||
|
||||
var w1 = parseFloat($("#w1").text());
|
||||
|
||||
|
||||
@@ -149,6 +149,12 @@ var eva_evaluation_behaviorTableV;
|
||||
|
||||
var eva_evaluation_behavior_setupTable = function (result) {
|
||||
tmp = '"';
|
||||
var sum_b = 0;
|
||||
$.each(result, function( k, v ) {
|
||||
sum_b += v.weight;
|
||||
});
|
||||
$("#sum_b").text(sum_b);
|
||||
|
||||
eva_evaluation_behaviorTableV = $('#eva_evaluation_behaviorTable').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
|
||||
@@ -116,19 +116,23 @@ function Oneva_evaluation_behavior_process2_scoreChange(){
|
||||
var total_behavior = 0;
|
||||
var total_behavior_weight = 0;
|
||||
var total_behavior_score = 0;
|
||||
var total_behavior_score_old = 0;
|
||||
$('#eva_evaluation_behavior_process2Body tr').each(function () {
|
||||
var i = $(this).find("#rowCount").text();
|
||||
var score = $("#eva_evaluation_behavior_process2_score2_" + i).val();
|
||||
var score_old = $("#eva_evaluation_behavior_process2_score_" + i).text();
|
||||
var weight = $("#eva_evaluation_behavior_process2_weight_" + i).text();
|
||||
var total = (score * weight / 100).toFixed(2);
|
||||
$("#eva_evaluation_behavior_process2_sumary2_" + i).text(total);
|
||||
total_behavior += parseFloat(total);
|
||||
total_behavior_weight += parseFloat(weight);
|
||||
total_behavior_score += parseFloat(score);
|
||||
total_behavior_score_old += parseFloat(score_old);
|
||||
});
|
||||
$("#h_eva_evaluation_behavior_process2_weight").text(total_behavior_weight.toFixed(2));
|
||||
$("#h_eva_evaluation_behavior_process2_score2").text(total_behavior_score.toFixed(2));
|
||||
|
||||
$("#h_eva_evaluation_behavior_process2_score").text(total_behavior_score_old.toFixed(2));
|
||||
|
||||
var w2 = parseFloat($("#w2").text());
|
||||
|
||||
$("#eva_create_evaluation_detail_summary2_total_summary_competency_supervisor").text((total_behavior*20).toFixed(2));
|
||||
|
||||
217
wwwroot/js/eva_idp_plan/eva_idp_plan.js
Normal file
217
wwwroot/js/eva_idp_plan/eva_idp_plan.js
Normal file
@@ -0,0 +1,217 @@
|
||||
var eva_idp_plan_editMode = "CREATE";
|
||||
var eva_idp_plan_API = "/api/eva_idp_plan/";
|
||||
|
||||
//================= Search Customizaiton =========================================
|
||||
|
||||
function eva_idp_plan_GetSearchParameter() {
|
||||
var eva_idp_planSearchObject = new Object();
|
||||
eva_idp_planSearchObject.create_evaluation_detail_id = getUrlParameter("id");
|
||||
|
||||
return eva_idp_planSearchObject;
|
||||
}
|
||||
|
||||
function eva_idp_plan_FeedDataToSearchForm(data) {
|
||||
$("#s_eva_idp_plan_create_evaluation_detail_id").val(data.create_evaluation_detail_id);
|
||||
|
||||
}
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_idp_plan_FeedDataToForm(data) {
|
||||
$("#eva_idp_plan_id").val(data.id);
|
||||
$("#eva_idp_plan_create_evaluation_detail_id").val(data.create_evaluation_detail_id);
|
||||
$("#eva_idp_plan_develop").val(data.develop);
|
||||
$("#eva_idp_plan_development_method").val(data.development_method);
|
||||
$("#eva_idp_plan_start_date").val(formatDate(data.start_date));
|
||||
$("#eva_idp_plan_end_date").val(formatDate(data.end_date));
|
||||
|
||||
}
|
||||
|
||||
function eva_idp_plan_GetFromForm() {
|
||||
var eva_idp_planObject = new Object();
|
||||
eva_idp_planObject.id = $("#eva_idp_plan_id").val();
|
||||
eva_idp_planObject.create_evaluation_detail_id = getUrlParameter("id");
|
||||
eva_idp_planObject.develop = $("#eva_idp_plan_develop").val();
|
||||
eva_idp_planObject.development_method = $("#eva_idp_plan_development_method").val();
|
||||
eva_idp_planObject.start_date = getDate($("#eva_idp_plan_start_date").val());
|
||||
eva_idp_planObject.end_date = getDate($("#eva_idp_plan_end_date").val());
|
||||
|
||||
|
||||
return eva_idp_planObject;
|
||||
}
|
||||
|
||||
function eva_idp_plan_InitialForm(s) {
|
||||
var successFunc = function (result) {
|
||||
eva_idp_plan_FeedDataToForm(result);
|
||||
eva_idp_plan_FeedDataToSearchForm(result);
|
||||
if (s) {
|
||||
// Incase model popup
|
||||
$("#eva_idp_planModel").modal("show");
|
||||
}
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_idp_plan_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
//================= Form Mode Setup and Flow =========================================
|
||||
|
||||
function eva_idp_plan_GoCreate() {
|
||||
// Incase model popup
|
||||
eva_idp_plan_SetCreateForm(true);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/eva_idp_planView/eva_idp_plan_d");
|
||||
}
|
||||
|
||||
function eva_idp_plan_GoEdit(a) {
|
||||
// Incase model popup
|
||||
eva_idp_plan_SetEditForm(a);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/eva_idp_planView/eva_idp_plan_d?id=" + a);
|
||||
}
|
||||
|
||||
function eva_idp_plan_SetEditForm(a) {
|
||||
var successFunc = function (result) {
|
||||
eva_idp_plan_editMode = "UPDATE";
|
||||
eva_idp_plan_FeedDataToForm(result);
|
||||
$("#eva_idp_planModel").modal("show");
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_idp_plan_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_idp_plan_SetCreateForm(s) {
|
||||
eva_idp_plan_editMode = "CREATE";
|
||||
eva_idp_plan_InitialForm(s);
|
||||
}
|
||||
|
||||
function eva_idp_plan_RefreshTable() {
|
||||
// Incase model popup
|
||||
eva_idp_plan_DoSearch();
|
||||
|
||||
// Incase open new page
|
||||
//window.parent.eva_idp_plan_DoSearch();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
|
||||
var eva_idp_plan_customValidation = function (group) {
|
||||
return "";
|
||||
};
|
||||
|
||||
function eva_idp_plan_PutUpdate() {
|
||||
if (!ValidateForm('eva_idp_plan', eva_idp_plan_customValidation))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var data = eva_idp_plan_GetFromForm();
|
||||
|
||||
//Update Mode
|
||||
if (eva_idp_plan_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
$("#eva_idp_planModel").modal("hide");
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
eva_idp_plan_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_idp_plan_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
$("#eva_idp_planModel").modal("hide");
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
eva_idp_plan_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_idp_plan_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
function eva_idp_plan_GoDelete(a) {
|
||||
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
|
||||
var successFunc = function (result) {
|
||||
$("#eva_idp_planModel").modal("hide");
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
eva_idp_plan_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_idp_plan_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
//================= Data Table =========================================
|
||||
|
||||
var eva_idp_planTableV;
|
||||
|
||||
var eva_idp_plan_setupTable = function (result) {
|
||||
tmp = '"';
|
||||
eva_idp_planTableV = $('#eva_idp_planTable').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
"data": result,
|
||||
"select": false,
|
||||
"columns": [
|
||||
{ "data": "id" },
|
||||
{ "data": "develop" },
|
||||
{ "data": "development_method" },
|
||||
{ "data": "txt_start_date" },
|
||||
{ "data": "txt_end_date" },
|
||||
],
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0,
|
||||
"data": "id",
|
||||
"render": function (data, type, row, meta) {
|
||||
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_idp_plan_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_idp_plan_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
|
||||
});
|
||||
endLoad();
|
||||
};
|
||||
|
||||
function eva_idp_plan_InitiateDataTable() {
|
||||
startLoad();
|
||||
var p = $.param(eva_idp_plan_GetSearchParameter());
|
||||
AjaxGetRequest(apisite + "/api/eva_idp_plan/GetListBySearch?"+p, eva_idp_plan_setupTable, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_idp_plan_DoSearch() {
|
||||
var p = $.param(eva_idp_plan_GetSearchParameter());
|
||||
var eva_idp_plan_reload = function (result) {
|
||||
eva_idp_planTableV.destroy();
|
||||
eva_idp_plan_setupTable(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_idp_plan/GetListBySearch?"+p, eva_idp_plan_reload, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_idp_plan_GetSelect(f) {
|
||||
var eva_idp_plan_selectitem = [];
|
||||
$.each(eva_idp_planTableV.rows('.selected').data(), function (key, value) {
|
||||
eva_idp_plan_selectitem.push(value[f]);
|
||||
});
|
||||
alert(eva_idp_plan_selectitem);
|
||||
}
|
||||
|
||||
//================= File Upload =========================================
|
||||
|
||||
|
||||
|
||||
//================= Multi-Selection Function =========================================
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user