clickup #7a09pc ตามที่เพลงอธิบายไว้ใน video
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
function eva_evaluation_behavior_process2_ClearForm(i, blankItem) {
|
||||
var data = blankItem;
|
||||
var data = blankItem;
|
||||
$("#eva_evaluation_behavior_process2_id_" + i).val("");
|
||||
$("#eva_evaluation_behavior_process2_create_evaluation_detail_id_" + i).val("");
|
||||
$("#eva_evaluation_behavior_process2_behavior_" + i).text("");
|
||||
@@ -20,23 +20,35 @@ function eva_evaluation_behavior_process2_FeedDataToForm(data, i, blankItem, rol
|
||||
$("#eva_evaluation_behavior_process2_behavior_" + i).text(data.behavior);
|
||||
$("#eva_evaluation_behavior_process2_weight_" + i).val(data.weight);
|
||||
|
||||
if(role_code === "2"){
|
||||
$("#eva_evaluation_behavior_process2_score_" + i).text(data.score.toFixed(3));
|
||||
$("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary.toFixed(3));
|
||||
$("#eva_evaluation_behavior_process2_score2_" + i).val(data.score2.toFixed(3));
|
||||
$("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary2.toFixed(3));
|
||||
}
|
||||
else if(role_code === "3"){
|
||||
$("#eva_evaluation_behavior_process2_score_" + i).text(data.score2.toFixed(3));
|
||||
$("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary2.toFixed(3));
|
||||
$("#eva_evaluation_behavior_process2_score2_" + i).val(data.score3.toFixed(3));
|
||||
$("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary3.toFixed(3));
|
||||
}
|
||||
else if(role_code === "4"){
|
||||
$("#eva_evaluation_behavior_process2_score_" + i).text(data.score3.toFixed(3));
|
||||
$("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary3.toFixed(3));
|
||||
$("#eva_evaluation_behavior_process2_score2_" + i).val(data.score4.toFixed(3));
|
||||
$("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary4.toFixed(3));
|
||||
data.score = Number(data.score).toFixed(3);
|
||||
data.sumary = Number(data.sumary).toFixed(3);
|
||||
|
||||
data.score2 = Number(data.score2).toFixed(3);
|
||||
data.sumary2 = Number(data.sumary2).toFixed(3);
|
||||
|
||||
data.score3 = Number(data.score3).toFixed(3);
|
||||
data.sumary3 = Number(data.sumary3).toFixed(3);
|
||||
|
||||
data.score4 = Number(data.score4).toFixed(3);
|
||||
data.sumary4 = Number(data.sumary4).toFixed(3);
|
||||
|
||||
// console.log("data", data);
|
||||
|
||||
if (role_code === "2") {
|
||||
$("#eva_evaluation_behavior_process2_score_" + i).text(data.score);
|
||||
$("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary);
|
||||
$("#eva_evaluation_behavior_process2_score2_" + i).val(data.score2);
|
||||
$("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary2);
|
||||
} else if (role_code === "3") {
|
||||
$("#eva_evaluation_behavior_process2_score_" + i).text(data.score2);
|
||||
$("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary2);
|
||||
$("#eva_evaluation_behavior_process2_score2_" + i).val(data.score3);
|
||||
$("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary3);
|
||||
} else if (role_code === "4") {
|
||||
$("#eva_evaluation_behavior_process2_score_" + i).text(data.score3);
|
||||
$("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary3);
|
||||
$("#eva_evaluation_behavior_process2_score2_" + i).val(data.score4);
|
||||
$("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary4);
|
||||
}
|
||||
|
||||
//$("#eva_evaluation_behavior_process2_target_score1_" + i).val(data.target_score1);
|
||||
@@ -72,70 +84,70 @@ function eva_evaluation_behavior_process2_GetFromForm(obj, i) {
|
||||
|
||||
function eva_evaluation_behavior_process2_Save(id) {
|
||||
|
||||
if(parseInt($("#h_eva_evaluation_behavior_process2_weight").text())>100){
|
||||
if (parseInt($("#h_eva_evaluation_behavior_process2_weight").text()) > 100) {
|
||||
alert('กรุณาระบุค่าน้ำหนัก ไม่เกิน 100');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//Insert eva_evaluation_behavior_process2 List
|
||||
var eva_evaluation_behavior_process2 = [];
|
||||
//Insert eva_evaluation_behavior_process2 List
|
||||
var eva_evaluation_behavior_process2 = [];
|
||||
$('#eva_evaluation_behavior_process2Body tr').each(function () {
|
||||
var i = $(this).find("#rowCount").text();
|
||||
var eacheva_evaluation_behavior_process2 = eva_evaluation_behavior_process2_GetFromForm($(this), i);
|
||||
eva_evaluation_behavior_process2.push(eacheva_evaluation_behavior_process2);
|
||||
});
|
||||
var eacheva_evaluation_behavior_process2 = eva_evaluation_behavior_process2_GetFromForm($(this), i);
|
||||
eva_evaluation_behavior_process2.push(eacheva_evaluation_behavior_process2);
|
||||
});
|
||||
|
||||
var successFunc = function (result) {
|
||||
//AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว");
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + '/api/eva_evaluation_behavior_process2/UpdateMultiple', eva_evaluation_behavior_process2, successFunc, AlertDanger);
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + '/api/eva_evaluation_behavior_process2/UpdateMultiple', eva_evaluation_behavior_process2, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_evaluation_behavior_process2_Get(a, blankItem, role_code) {
|
||||
|
||||
$('#eva_evaluation_behavior_process2Body').empty();
|
||||
$('#eva_evaluation_behavior_process2Body').empty();
|
||||
|
||||
var successFunc = function (response) {
|
||||
//console.log(response);
|
||||
$.each(response, function (i, data) {
|
||||
var tag = '<tr>';
|
||||
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_evaluation_behavior_process2" value="1" /><input class="form-control" type="hidden" id="eva_evaluation_behavior_process2_id_' + (i + 1)+'" /><input class="form-control" type="hidden" id="eva_evaluation_behavior_process2_create_evaluation_detail_id_' + (i + 1)+'" /></td>';
|
||||
|
||||
tag += '<td><p id="eva_evaluation_behavior_process2_behavior_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><input disabled class="form-control" type="number" onchange="Oneva_evaluation_behavior_process2_scoreChange()" id="eva_evaluation_behavior_process2_weight_' + (i + 1)+'" /></td>';
|
||||
//tag += '<td><input type="text" class="form-control" id="eva_evaluation_behavior_process2_target_score1_' + (i + 1)+'" /></td>';
|
||||
//tag += '<td><input type="text" class="form-control" id="eva_evaluation_behavior_process2_target_score2_' + (i + 1)+'" /></td>';
|
||||
// tag += '<td><input type="text" class="form-control" id="eva_evaluation_behavior_process2_target_score3_' + (i + 1)+'" /></td>';
|
||||
// tag += '<td><input type="text" class="form-control" id="eva_evaluation_behavior_process2_target_score4_' + (i + 1)+'" /></td>';
|
||||
//tag += '<td><input type="text" class="form-control" id="eva_evaluation_behavior_process2_target_score5_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process2_score_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process2_sumary_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><input min="0" max="5" step=".1" onchange="Oneva_evaluation_behavior_process2_scoreChange()" class="form-control myeditor the3digit" type="number" id="eva_evaluation_behavior_process2_score2_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process2_sumary2_' + (i + 1)+'" /></td>';
|
||||
var successFunc = function (response) {
|
||||
//console.log(response);
|
||||
$.each(response, function (i, data) {
|
||||
var tag = '<tr>';
|
||||
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_evaluation_behavior_process2" value="1" /><input class="form-control" type="hidden" id="eva_evaluation_behavior_process2_id_' + (i + 1) + '" /><input class="form-control" type="hidden" id="eva_evaluation_behavior_process2_create_evaluation_detail_id_' + (i + 1) + '" /></td>';
|
||||
|
||||
tag += '</tr>';
|
||||
$('#eva_evaluation_behavior_process2Body').append($(tag));
|
||||
eva_evaluation_behavior_process2_FeedDataToForm(data, (i + 1), blankItem, role_code);
|
||||
});
|
||||
tag += '<td><p id="eva_evaluation_behavior_process2_behavior_' + (i + 1) + '" /></td>';
|
||||
tag += '<td><input disabled class="form-control" type="number" onchange="Oneva_evaluation_behavior_process2_scoreChange()" id="eva_evaluation_behavior_process2_weight_' + (i + 1) + '" /></td>';
|
||||
//tag += '<td><input type="text" class="form-control" id="eva_evaluation_behavior_process2_target_score1_' + (i + 1)+'" /></td>';
|
||||
//tag += '<td><input type="text" class="form-control" id="eva_evaluation_behavior_process2_target_score2_' + (i + 1)+'" /></td>';
|
||||
// tag += '<td><input type="text" class="form-control" id="eva_evaluation_behavior_process2_target_score3_' + (i + 1)+'" /></td>';
|
||||
// tag += '<td><input type="text" class="form-control" id="eva_evaluation_behavior_process2_target_score4_' + (i + 1)+'" /></td>';
|
||||
//tag += '<td><input type="text" class="form-control" id="eva_evaluation_behavior_process2_target_score5_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process2_score_' + (i + 1) + '" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process2_sumary_' + (i + 1) + '" /></td>';
|
||||
tag += '<td><input min="0" max="5" step=".1" onchange="Oneva_evaluation_behavior_process2_scoreChange()" class="form-control myeditor the3digit" type="number" id="eva_evaluation_behavior_process2_score2_' + (i + 1) + '" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process2_sumary2_' + (i + 1) + '" /></td>';
|
||||
|
||||
tag += '</tr>';
|
||||
$('#eva_evaluation_behavior_process2Body').append($(tag));
|
||||
eva_evaluation_behavior_process2_FeedDataToForm(data, (i + 1), blankItem, role_code);
|
||||
});
|
||||
eva_evaluation_behavior_process2_Summary();
|
||||
Oneva_evaluation_behavior_process2_scoreChange();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
//AjaxGetRequest(apisite + "/api/eva_evaluation_behavior_process2", successFunc, AlertDanger);
|
||||
AjaxGetRequest(apisite + '/api/eva_evaluation_behavior_process2?create_evaluation_detail_id=' + a, successFunc, AlertDanger);
|
||||
Oneva_evaluation_behavior_process2_scoreChange();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
//AjaxGetRequest(apisite + "/api/eva_evaluation_behavior_process2", successFunc, AlertDanger);
|
||||
AjaxGetRequest(apisite + '/api/eva_evaluation_behavior_process2?create_evaluation_detail_id=' + a, successFunc, AlertDanger);
|
||||
|
||||
}
|
||||
|
||||
function CheckValidValuebehavior(){
|
||||
function CheckValidValuebehavior() {
|
||||
$('#eva_evaluation_behavior_process2Body tr').each(function () {
|
||||
var i = $(this).find("#rowCount").text();
|
||||
var score = $("#eva_evaluation_behavior_process2_score2_" + i).val();
|
||||
if(score > 5) $("#eva_evaluation_behavior_process2_score2_" + i).val("");
|
||||
if(score < 1) $("#eva_evaluation_behavior_process2_score2_" + i).val("");
|
||||
});
|
||||
if (score > 5) $("#eva_evaluation_behavior_process2_score2_" + i).val("");
|
||||
if (score < 1) $("#eva_evaluation_behavior_process2_score2_" + i).val("");
|
||||
});
|
||||
}
|
||||
|
||||
function Oneva_evaluation_behavior_process2_scoreChange() {
|
||||
@@ -148,7 +160,7 @@ function Oneva_evaluation_behavior_process2_scoreChange() {
|
||||
var total_behavior_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 = $("#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).val();
|
||||
var total = (score * weight / 100).toFixed(3);
|
||||
@@ -159,19 +171,19 @@ function Oneva_evaluation_behavior_process2_scoreChange() {
|
||||
total_behavior_score += parseFloat(score);
|
||||
total_behavior_score_old += parseFloat(score_old);
|
||||
total_behavior_old += parseFloat(total_old);
|
||||
});
|
||||
});
|
||||
$("#h_eva_evaluation_behavior_process2_weight").text(total_behavior_weight.toFixed(3));
|
||||
$("#h_eva_evaluation_behavior_process2_score2").text(total_behavior.toFixed(3));
|
||||
$("#h_eva_evaluation_behavior_process2_score").text(total_behavior_old.toFixed(3));
|
||||
|
||||
|
||||
var w2 = parseFloat($("#w2").text());
|
||||
|
||||
$("#x2").text((total_behavior_old*20).toFixed(3));
|
||||
$("#eva_create_evaluation_detail_summary2_total_summary_competency_supervisor").text((total_behavior*20).toFixed(3));
|
||||
$("#eva_create_evaluation_detail_summary2_Final_summary_competency_supervisor").text((total_behavior*20).toFixed(3));
|
||||
$("#eva_create_evaluation_detail_summary2_competency_supervisor").text(((total_behavior*20)*w2/100).toFixed(3));
|
||||
$("#x2").text((total_behavior_old * 20).toFixed(3));
|
||||
$("#eva_create_evaluation_detail_summary2_total_summary_competency_supervisor").text((total_behavior * 20).toFixed(3));
|
||||
$("#eva_create_evaluation_detail_summary2_Final_summary_competency_supervisor").text((total_behavior * 20).toFixed(3));
|
||||
$("#eva_create_evaluation_detail_summary2_competency_supervisor").text(((total_behavior * 20) * w2 / 100).toFixed(3));
|
||||
|
||||
calculationAllItem();
|
||||
calculationAllItem();
|
||||
}
|
||||
|
||||
function eva_evaluation_behavior_process2_Summary() {
|
||||
@@ -189,4 +201,4 @@ function eva_evaluation_behavior_process2_InitialForm(id, role_code) {
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_evaluation_behavior_process2/" + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user