ปรับทศนิยม 3 ตำแหน่ง

This commit is contained in:
Nakorn Rientrakrunchai
2021-03-07 15:00:33 +07:00
parent 9bac5ef7d3
commit a40d6d79d0
10 changed files with 391 additions and 372 deletions

View File

@@ -4,31 +4,31 @@ var eva_create_evaluation_detail_summary1_API = "/api/eva_create_evaluation_deta
//================= Form Data Customizaiton =========================================
function eva_create_evaluation_detail_summary1_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_summary1_id").val(data.id);
$("#eva_create_evaluation_detail_summary1_create_evaluation_id").val(data.create_evaluation_id);
$("#eva_create_evaluation_detail_summary1_total_summary_chief").text(data.total_summary_chief);
$("#eva_create_evaluation_detail_summary1_Final_summary_chief").text(data.Final_summary_chief);
$("#eva_create_evaluation_detail_summary1_total_summary_competency_chief").text(data.total_summary_competency_chief);
$("#eva_create_evaluation_detail_summary1_Final_summary_competency_chief").text(data.Final_summary_competency_chief);
$("#eva_create_evaluation_detail_summary1_achievement_chief").text(data.achievement_chief);
$("#eva_create_evaluation_detail_summary1_competency_chief").text(data.competency_chief);
$("#eva_create_evaluation_detail_summary1_score_chief").text(data.score_chief);
$("#eva_create_evaluation_detail_summary1_level_score_chief").text(data.level_score_chief);
console.log(data);
$("#eva_create_evaluation_detail_summary1_id").val(data.id);
$("#eva_create_evaluation_detail_summary1_create_evaluation_id").val(data.create_evaluation_id);
$("#eva_create_evaluation_detail_summary1_total_summary_chief").text(data.total_summary_chief);
$("#eva_create_evaluation_detail_summary1_Final_summary_chief").text(data.Final_summary_chief);
$("#eva_create_evaluation_detail_summary1_total_summary_competency_chief").text(data.total_summary_competency_chief);
$("#eva_create_evaluation_detail_summary1_Final_summary_competency_chief").text(data.Final_summary_competency_chief);
$("#eva_create_evaluation_detail_summary1_achievement_chief").text(data.achievement_chief);
$("#eva_create_evaluation_detail_summary1_competency_chief").text(data.competency_chief);
$("#eva_create_evaluation_detail_summary1_score_chief").text(data.score_chief);
$("#eva_create_evaluation_detail_summary1_level_score_chief").text(data.level_score_chief);
//console.log(data);
}
function eva_create_evaluation_detail_summary1_GetFromForm() {
var eva_create_evaluation_detail_summary1Object = new Object();
eva_create_evaluation_detail_summary1Object.id = $("#eva_create_evaluation_detail_summary1_id").val();
eva_create_evaluation_detail_summary1Object.create_evaluation_id = $("#eva_create_evaluation_detail_summary1_create_evaluation_id").val();
eva_create_evaluation_detail_summary1Object.total_summary_chief = $("#eva_create_evaluation_detail_summary1_total_summary_chief").text();
eva_create_evaluation_detail_summary1Object.Final_summary_chief = $("#eva_create_evaluation_detail_summary1_Final_summary_chief").text();
eva_create_evaluation_detail_summary1Object.total_summary_competency_chief = $("#eva_create_evaluation_detail_summary1_total_summary_competency_chief").text();
eva_create_evaluation_detail_summary1Object.Final_summary_competency_chief = $("#eva_create_evaluation_detail_summary1_Final_summary_competency_chief").text();
eva_create_evaluation_detail_summary1Object.achievement_chief = $("#eva_create_evaluation_detail_summary1_achievement_chief").text();
eva_create_evaluation_detail_summary1Object.competency_chief = $("#eva_create_evaluation_detail_summary1_competency_chief").text();
eva_create_evaluation_detail_summary1Object.score_chief = $("#eva_create_evaluation_detail_summary1_score_chief").text();
eva_create_evaluation_detail_summary1Object.level_score_chief = $("#eva_create_evaluation_detail_summary1_level_score_chief").text();
eva_create_evaluation_detail_summary1Object.id = $("#eva_create_evaluation_detail_summary1_id").val();
eva_create_evaluation_detail_summary1Object.create_evaluation_id = $("#eva_create_evaluation_detail_summary1_create_evaluation_id").val();
eva_create_evaluation_detail_summary1Object.total_summary_chief = $("#eva_create_evaluation_detail_summary1_total_summary_chief").text();
eva_create_evaluation_detail_summary1Object.Final_summary_chief = $("#eva_create_evaluation_detail_summary1_Final_summary_chief").text();
eva_create_evaluation_detail_summary1Object.total_summary_competency_chief = $("#eva_create_evaluation_detail_summary1_total_summary_competency_chief").text();
eva_create_evaluation_detail_summary1Object.Final_summary_competency_chief = $("#eva_create_evaluation_detail_summary1_Final_summary_competency_chief").text();
eva_create_evaluation_detail_summary1Object.achievement_chief = $("#eva_create_evaluation_detail_summary1_achievement_chief").text();
eva_create_evaluation_detail_summary1Object.competency_chief = $("#eva_create_evaluation_detail_summary1_competency_chief").text();
eva_create_evaluation_detail_summary1Object.score_chief = $("#eva_create_evaluation_detail_summary1_score_chief").text();
eva_create_evaluation_detail_summary1Object.level_score_chief = $("#eva_create_evaluation_detail_summary1_level_score_chief").text();
return eva_create_evaluation_detail_summary1Object;
@@ -37,9 +37,9 @@ eva_create_evaluation_detail_summary1Object.level_score_chief = $("#eva_create_e
function eva_create_evaluation_detail_summary1_InitialForm() {
var successFunc = function (result) {
eva_create_evaluation_detail_summary1_FeedDataToForm(result);
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_summary1_API + "GetBlankItem", successFunc, AlertDanger);
}
@@ -49,15 +49,15 @@ function eva_create_evaluation_detail_summary1_SetEditForm(a) {
var successFunc = function (result) {
eva_create_evaluation_detail_summary1_editMode = "UPDATE";
eva_create_evaluation_detail_summary1_FeedDataToForm(result);
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_summary1_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_summary1_SetCreateForm() {
eva_create_evaluation_detail_summary1_editMode = "CREATE";
eva_create_evaluation_detail_summary1_InitialForm();
eva_create_evaluation_detail_summary1_InitialForm();
}
//================= Update and Delete =========================================
@@ -67,8 +67,7 @@ var eva_create_evaluation_detail_summary1_customValidation = function (group) {
};
function eva_create_evaluation_detail_summary1_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_summary1', eva_create_evaluation_detail_summary1_customValidation))
{
if (!ValidateForm('eva_create_evaluation_detail_summary1', eva_create_evaluation_detail_summary1_customValidation)) {
return;
}
var data = eva_create_evaluation_detail_summary1_GetFromForm();
@@ -77,18 +76,18 @@ function eva_create_evaluation_detail_summary1_PutUpdate() {
if (eva_create_evaluation_detail_summary1_editMode === "UPDATE") {
var successFunc1 = function (result) {
//AlertSuccess(result.message);
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_summary1_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.message);
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_summary1_API, data, successFunc2, AlertDanger);
}
}
@@ -98,9 +97,9 @@ function eva_create_evaluation_detail_summary1_GoDelete(a) {
var successFunc = function (result) {
AlertSuccess(result.message);
eva_create_evaluation_detail_summary1_RefreshTable();
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_summary1_API + a, null, successFunc, AlertDanger);
}
}