ปรับ layout รายงาน
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-9">
|
||||||
<label id='lab_s_rep_eva01_org_id' for='s_rep_eva01_org_id'>หน่วยงาน</label>
|
<label id='lab_s_rep_eva01_org_id' for='s_rep_eva01_org_id'>หน่วยงาน</label>
|
||||||
<select multiple="multiple" class="form-control" id="s_rep_eva01_org_id" iLabel="หน่วยงาน" iRequire="true" iGroup="s_rep_eva01" title='หน่วยงาน' placeholder='หน่วยงาน'></select>
|
<select multiple="multiple" class="form-control" id="s_rep_eva01_org_id" iLabel="หน่วยงาน" iRequire="true" iGroup="s_rep_eva01" title='หน่วยงาน' placeholder='หน่วยงาน'></select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-9">
|
||||||
<label id='lab_s_rep_eva02_org_id' for='s_rep_eva02_org_id'>หน่วยงาน</label>
|
<label id='lab_s_rep_eva02_org_id' for='s_rep_eva02_org_id'>หน่วยงาน</label>
|
||||||
<select multiple="multiple" class="form-control" id="s_rep_eva02_org_id" iLabel="หน่วยงาน" iRequire="true" iGroup="s_rep_eva02" title='หน่วยงาน' placeholder='หน่วยงาน'></select>
|
<select multiple="multiple" class="form-control" id="s_rep_eva02_org_id" iLabel="หน่วยงาน" iRequire="true" iGroup="s_rep_eva02" title='หน่วยงาน' placeholder='หน่วยงาน'></select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,216 +0,0 @@
|
|||||||
var rep_eva03_editMode = "CREATE";
|
|
||||||
var rep_eva03_API = "/api/rep_eva03/";
|
|
||||||
|
|
||||||
//================= Search Customizaiton =========================================
|
|
||||||
|
|
||||||
function rep_eva03_GetSearchParameter() {
|
|
||||||
var rep_eva03SearchObject = new Object();
|
|
||||||
rep_eva03SearchObject.position_type_id = $("#s_rep_eva03_position_type_id").val();
|
|
||||||
|
|
||||||
return rep_eva03SearchObject;
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_FeedDataToSearchForm(data) {
|
|
||||||
DropDownClearFormAndFeedWithData($("#s_rep_eva03_position_type_id"), data, "id", "external_name", "item_position_type_id", data.position_type_id);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//================= Form Data Customizaiton =========================================
|
|
||||||
|
|
||||||
function rep_eva03_FeedDataToForm(data) {
|
|
||||||
$("#rep_eva03_id").val(data.id);
|
|
||||||
DropDownClearFormAndFeedWithData($("#rep_eva03_position_type_id"), data, "id", "external_name", "item_position_type_id", data.position_type_id);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_GetFromForm() {
|
|
||||||
var rep_eva03Object = new Object();
|
|
||||||
rep_eva03Object.id = $("#rep_eva03_id").val();
|
|
||||||
rep_eva03Object.position_type_id = $("#rep_eva03_position_type_id").val();
|
|
||||||
|
|
||||||
|
|
||||||
return rep_eva03Object;
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_InitialForm(s) {
|
|
||||||
var successFunc = function (result) {
|
|
||||||
rep_eva03_FeedDataToForm(result);
|
|
||||||
rep_eva03_FeedDataToSearchForm(result);
|
|
||||||
if (s) {
|
|
||||||
// Incase model popup
|
|
||||||
$("#rep_eva03Model").modal("show");
|
|
||||||
}
|
|
||||||
endLoad();
|
|
||||||
};
|
|
||||||
startLoad();
|
|
||||||
AjaxGetRequest(apisite + rep_eva03_API + "GetBlankItem", successFunc, AlertDanger);
|
|
||||||
}
|
|
||||||
|
|
||||||
//================= Form Mode Setup and Flow =========================================
|
|
||||||
|
|
||||||
function rep_eva03_GoCreate() {
|
|
||||||
// Incase model popup
|
|
||||||
rep_eva03_SetCreateForm(true);
|
|
||||||
|
|
||||||
// Incase open new page
|
|
||||||
//window_open(appsite + "/rep_eva03View/rep_eva03_d");
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_GoEdit(a) {
|
|
||||||
// Incase model popup
|
|
||||||
rep_eva03_SetEditForm(a);
|
|
||||||
|
|
||||||
// Incase open new page
|
|
||||||
//window_open(appsite + "/rep_eva03View/rep_eva03_d?id=" + a);
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_SetEditForm(a) {
|
|
||||||
var successFunc = function (result) {
|
|
||||||
rep_eva03_editMode = "UPDATE";
|
|
||||||
rep_eva03_FeedDataToForm(result);
|
|
||||||
$("#rep_eva03Model").modal("show");
|
|
||||||
endLoad();
|
|
||||||
};
|
|
||||||
startLoad();
|
|
||||||
AjaxGetRequest(apisite + rep_eva03_API + a, successFunc, AlertDanger);
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_SetCreateForm(s) {
|
|
||||||
rep_eva03_editMode = "CREATE";
|
|
||||||
rep_eva03_InitialForm(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_RefreshTable() {
|
|
||||||
// Incase model popup
|
|
||||||
rep_eva03_DoSearch();
|
|
||||||
|
|
||||||
// Incase open new page
|
|
||||||
//window.parent.rep_eva03_DoSearch();
|
|
||||||
}
|
|
||||||
|
|
||||||
//================= Update and Delete =========================================
|
|
||||||
|
|
||||||
var rep_eva03_customValidation = function (group) {
|
|
||||||
return "";
|
|
||||||
};
|
|
||||||
|
|
||||||
function rep_eva03_PutUpdate() {
|
|
||||||
if (!ValidateForm('rep_eva03', rep_eva03_customValidation))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var data = rep_eva03_GetFromForm();
|
|
||||||
|
|
||||||
//Update Mode
|
|
||||||
if (rep_eva03_editMode === "UPDATE") {
|
|
||||||
var successFunc1 = function (result) {
|
|
||||||
$("#rep_eva03Model").modal("hide");
|
|
||||||
AlertSuccess(result.code+" "+result.message);
|
|
||||||
rep_eva03_RefreshTable();
|
|
||||||
endLoad();
|
|
||||||
};
|
|
||||||
startLoad();
|
|
||||||
AjaxPutRequest(apisite + rep_eva03_API + data.id, data, successFunc1, AlertDanger);
|
|
||||||
}
|
|
||||||
// Create mode
|
|
||||||
else {
|
|
||||||
var successFunc2 = function (result) {
|
|
||||||
$("#rep_eva03Model").modal("hide");
|
|
||||||
AlertSuccess(result.code+" "+result.message);
|
|
||||||
rep_eva03_RefreshTable();
|
|
||||||
endLoad();
|
|
||||||
};
|
|
||||||
startLoad();
|
|
||||||
AjaxPostRequest(apisite + rep_eva03_API, data, successFunc2, AlertDanger);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_GoDelete(a) {
|
|
||||||
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
|
|
||||||
var successFunc = function (result) {
|
|
||||||
$("#rep_eva03Model").modal("hide");
|
|
||||||
AlertSuccess(result.code+" "+result.message);
|
|
||||||
rep_eva03_RefreshTable();
|
|
||||||
endLoad();
|
|
||||||
};
|
|
||||||
startLoad();
|
|
||||||
AjaxDeleteRequest(apisite + rep_eva03_API + a, null, successFunc, AlertDanger);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//================= Data Table =========================================
|
|
||||||
|
|
||||||
var rep_eva03TableV;
|
|
||||||
|
|
||||||
var rep_eva03_setupTable = function (result) {
|
|
||||||
tmp = '"';
|
|
||||||
rep_eva03TableV = $('#rep_eva03Table').DataTable({
|
|
||||||
"processing": true,
|
|
||||||
"serverSide": false,
|
|
||||||
"data": result,
|
|
||||||
"select": {
|
|
||||||
"style": 'multi'
|
|
||||||
},
|
|
||||||
"columns": [
|
|
||||||
{ "data": "" },
|
|
||||||
{ "data": "id" },
|
|
||||||
{ "data": "id" },
|
|
||||||
{ "data": "position_type_id_external_linkage_external_name" },
|
|
||||||
],
|
|
||||||
"columnDefs": [
|
|
||||||
{
|
|
||||||
"targets": 1,
|
|
||||||
"data": "id",
|
|
||||||
"render": function (data, type, row, meta) {
|
|
||||||
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:rep_eva03_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:rep_eva03_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
targets: 0,
|
|
||||||
data: "",
|
|
||||||
defaultContent: '',
|
|
||||||
orderable: false,
|
|
||||||
className: 'select-checkbox'
|
|
||||||
}],
|
|
||||||
"language": {
|
|
||||||
"url": appsite + "/DataTables-1.10.16/thai.json"
|
|
||||||
},
|
|
||||||
"paging": true,
|
|
||||||
"searching": false
|
|
||||||
});
|
|
||||||
endLoad();
|
|
||||||
};
|
|
||||||
|
|
||||||
function rep_eva03_InitiateDataTable() {
|
|
||||||
startLoad();
|
|
||||||
AjaxGetRequest(apisite + "/api/rep_eva03/GetListBySearch", rep_eva03_setupTable, AlertDanger);
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_DoSearch() {
|
|
||||||
var p = $.param(rep_eva03_GetSearchParameter());
|
|
||||||
var rep_eva03_reload = function (result) {
|
|
||||||
rep_eva03TableV.destroy();
|
|
||||||
rep_eva03_setupTable(result);
|
|
||||||
endLoad();
|
|
||||||
};
|
|
||||||
startLoad();
|
|
||||||
AjaxGetRequest(apisite + "/api/rep_eva03/GetListBySearch?"+p, rep_eva03_reload, AlertDanger);
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_GetSelect(f) {
|
|
||||||
var rep_eva03_selectitem = [];
|
|
||||||
$.each(rep_eva03TableV.rows('.selected').data(), function (key, value) {
|
|
||||||
rep_eva03_selectitem.push(value[f]);
|
|
||||||
});
|
|
||||||
alert(rep_eva03_selectitem);
|
|
||||||
}
|
|
||||||
|
|
||||||
//================= File Upload =========================================
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//================= Multi-Selection Function =========================================
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
var rep_eva03_editMode = "CREATE";
|
|
||||||
var rep_eva03_API = "/api/rep_eva03/";
|
|
||||||
|
|
||||||
//================= Form Data Customizaiton =========================================
|
|
||||||
|
|
||||||
function rep_eva03_FeedDataToForm(data) {
|
|
||||||
$("#rep_eva03_id").val(data.id);
|
|
||||||
DropDownClearFormAndFeedWithData($("#rep_eva03_position_type_id"), data, "id", "external_name", "item_position_type_id", data.position_type_id);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_GetFromForm() {
|
|
||||||
var rep_eva03Object = new Object();
|
|
||||||
rep_eva03Object.id = $("#rep_eva03_id").val();
|
|
||||||
rep_eva03Object.position_type_id = $("#rep_eva03_position_type_id").val();
|
|
||||||
|
|
||||||
|
|
||||||
return rep_eva03Object;
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_InitialForm() {
|
|
||||||
var successFunc = function (result) {
|
|
||||||
rep_eva03_FeedDataToForm(result);
|
|
||||||
endLoad();
|
|
||||||
};
|
|
||||||
startLoad();
|
|
||||||
AjaxGetRequest(apisite + rep_eva03_API + "GetBlankItem", successFunc, AlertDanger);
|
|
||||||
}
|
|
||||||
|
|
||||||
//================= Form Mode Setup and Flow =========================================
|
|
||||||
|
|
||||||
function rep_eva03_SetEditForm(a) {
|
|
||||||
var successFunc = function (result) {
|
|
||||||
rep_eva03_editMode = "UPDATE";
|
|
||||||
rep_eva03_FeedDataToForm(result);
|
|
||||||
endLoad();
|
|
||||||
};
|
|
||||||
startLoad();
|
|
||||||
AjaxGetRequest(apisite + rep_eva03_API + a, successFunc, AlertDanger);
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_SetCreateForm() {
|
|
||||||
rep_eva03_editMode = "CREATE";
|
|
||||||
rep_eva03_InitialForm();
|
|
||||||
}
|
|
||||||
|
|
||||||
//================= Update and Delete =========================================
|
|
||||||
|
|
||||||
var rep_eva03_customValidation = function (group) {
|
|
||||||
return "";
|
|
||||||
};
|
|
||||||
|
|
||||||
function rep_eva03_PutUpdate() {
|
|
||||||
if (!ValidateForm('rep_eva03', rep_eva03_customValidation))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var data = rep_eva03_GetFromForm();
|
|
||||||
|
|
||||||
//Update Mode
|
|
||||||
if (rep_eva03_editMode === "UPDATE") {
|
|
||||||
var successFunc1 = function (result) {
|
|
||||||
AlertSuccess(result.code+" "+result.message);
|
|
||||||
endLoad();
|
|
||||||
};
|
|
||||||
startLoad();
|
|
||||||
AjaxPutRequest(apisite + rep_eva03_API + data.id, data, successFunc1, AlertDanger);
|
|
||||||
}
|
|
||||||
// Create mode
|
|
||||||
else {
|
|
||||||
var successFunc2 = function (result) {
|
|
||||||
AlertSuccess(result.code+" "+result.message);
|
|
||||||
endLoad();
|
|
||||||
};
|
|
||||||
startLoad();
|
|
||||||
AjaxPostRequest(apisite + rep_eva03_API, data, successFunc2, AlertDanger);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_GoDelete(a) {
|
|
||||||
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
|
|
||||||
var successFunc = function (result) {
|
|
||||||
AlertSuccess(result.code+" "+result.message);
|
|
||||||
rep_eva03_RefreshTable();
|
|
||||||
endLoad();
|
|
||||||
};
|
|
||||||
startLoad();
|
|
||||||
AjaxDeleteRequest(apisite + rep_eva03_API + a, null, successFunc, AlertDanger);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//================= File Upload =========================================
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//================= Multi-Selection Function =========================================
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,124 +0,0 @@
|
|||||||
function rep_eva03_ClearForm(i, blankItem) {
|
|
||||||
var data = blankItem;
|
|
||||||
$("#rep_eva03_id_" + i).val("");
|
|
||||||
DropDownClearFormAndFeedWithData($("#rep_eva03_position_type_id_" + i), blankItem, "id", "external_name", "item_position_type_id", data.position_type_id);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_FeedDataToForm(data, i, blankItem) {
|
|
||||||
$("#rep_eva03_id_" + i).val(data.id);
|
|
||||||
DropDownClearFormAndFeedWithData($("#rep_eva03_position_type_id_" + i), blankItem, "id", "external_name", "item_position_type_id", data.position_type_id);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_GetFromForm(obj, i) {
|
|
||||||
var rep_eva03Object = new Object();
|
|
||||||
rep_eva03Object.id = obj.find("#rep_eva03_id_" + i).val();
|
|
||||||
rep_eva03Object.position_type_id = obj.find("#rep_eva03_position_type_id_" + i).val();
|
|
||||||
|
|
||||||
rep_eva03Object.active_mode = obj.find("#isActive_" + i + "_rep_eva03").val();
|
|
||||||
return rep_eva03Object;
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_Save(id) {
|
|
||||||
//Insert rep_eva03 List
|
|
||||||
var rep_eva03 = [];
|
|
||||||
$('#rep_eva03Body tr').each(function () {
|
|
||||||
var i = $(this).find("#rowCount").text();
|
|
||||||
var eachrep_eva03 = rep_eva03_GetFromForm($(this), i);
|
|
||||||
rep_eva03.push(eachrep_eva03);
|
|
||||||
});
|
|
||||||
|
|
||||||
var successFunc = function (result) {
|
|
||||||
AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว");
|
|
||||||
endLoad();
|
|
||||||
};
|
|
||||||
startLoad();
|
|
||||||
AjaxPutRequest(apisite + '/api/rep_eva03/UpdateMultiple', rep_eva03, successFunc, AlertDanger);
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_Get(a, blankItem) {
|
|
||||||
|
|
||||||
$('#rep_eva03Body').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) + '_rep_eva03" value="1" /></td>';
|
|
||||||
tag += '<td><input class="form-control" type="hidden" id="rep_eva03_id_' + (i + 1)+'" /></td>';
|
|
||||||
tag += '<td><select class="form-control" id="rep_eva03_position_type_id_' + (i + 1) +'"></select></td>';
|
|
||||||
|
|
||||||
tag += '<td><a href="javascript:;" class="btn btn-danger btn-sm" onclick="javascript:rep_eva03_Removerep_eva03(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:rep_eva03_Restorerep_eva03(this)" style="display: none;" id="restoreBtn"><i class="fa fa-upload" style="color:white;"></i></a></td>';
|
|
||||||
tag += '</tr>';
|
|
||||||
$('#rep_eva03Body').append($(tag));
|
|
||||||
rep_eva03_FeedDataToForm(data, (i + 1), blankItem);
|
|
||||||
});
|
|
||||||
rep_eva03_Summary();
|
|
||||||
endLoad();
|
|
||||||
};
|
|
||||||
startLoad();
|
|
||||||
AjaxGetRequest(apisite + "/api/rep_eva03", successFunc, AlertDanger);
|
|
||||||
//AjaxGetRequest(apisite + '/api/rep_eva03/GetListByposition_type_id/' + a, successFunc, AlertDanger);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_Add() {
|
|
||||||
var successFunc = function (result) {
|
|
||||||
var i = $("#rep_eva03Body tr").length;
|
|
||||||
var tag = '<tr>';
|
|
||||||
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_rep_eva03" value="1" /></td>';
|
|
||||||
tag += '<td><input class="form-control" type="hidden" id="rep_eva03_id_' + (i + 1)+'" /></td>';
|
|
||||||
tag += '<td><select class="form-control" id="rep_eva03_position_type_id_' + (i + 1) +'"></select></td>';
|
|
||||||
|
|
||||||
tag += '<td><a href="javascript:;" class="btn btn-danger btn-sm" onclick="javascript:rep_eva03_Removerep_eva03(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:rep_eva03_Restorerep_eva03(this)" style="display: none;" id="restoreBtn"><i class="fa fa-upload" style="color:white;"></i></a></td>';
|
|
||||||
tag += '</tr>';
|
|
||||||
|
|
||||||
$('#rep_eva03Body').append($(tag));
|
|
||||||
rep_eva03_ClearForm(i + 1, result);
|
|
||||||
endLoad();
|
|
||||||
};
|
|
||||||
startLoad();
|
|
||||||
AjaxGetRequest(apisite + "/api/rep_eva03/" + "GetBlankItem", successFunc, AlertDanger);
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_Removerep_eva03(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());
|
|
||||||
rep_eva03_Summary();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_Restorerep_eva03(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());
|
|
||||||
rep_eva03_Summary();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_Summary() {
|
|
||||||
var sum = 0;
|
|
||||||
$(".input_score").each(function () {
|
|
||||||
sum += +$(this).val();
|
|
||||||
});
|
|
||||||
$("#score_label").text("ผลรวม: " + sum);
|
|
||||||
}
|
|
||||||
|
|
||||||
function rep_eva03_InitialForm(id) {
|
|
||||||
var successFunc = function (result) {
|
|
||||||
rep_eva03_Get('', result);
|
|
||||||
endLoad();
|
|
||||||
};
|
|
||||||
startLoad();
|
|
||||||
AjaxGetRequest(apisite + "/api/rep_eva03/" + "GetBlankItem", successFunc, AlertDanger);
|
|
||||||
}
|
|
||||||
@@ -15,10 +15,34 @@ rep_eva03SearchObject.position_type_id = $("#s_rep_eva03_position_type_id").val(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function rep_eva03_FeedDataToSearchForm(data) {
|
function rep_eva03_FeedDataToSearchForm(data) {
|
||||||
DropDownClearFormAndFeedWithData($("#s_rep_eva03_position_type_id"), data, "id", "external_name", "item_position_type_id", data.position_type_id);
|
DropDownClearFormAndFeedWithDataAll($("#s_rep_eva03_position_type_id"), data, "id", "external_name", "item_position_type_id", data.position_type_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function DropDownClearFormAndFeedWithDataAll(d, result, x, y, z, i) {
|
||||||
|
$(d).html('');
|
||||||
|
$(d).append($("<option></option>")
|
||||||
|
.attr("value", "")
|
||||||
|
.text("กรุณาเลือก"));
|
||||||
|
$(d).append($("<option></option>")
|
||||||
|
.attr("value", "-1")
|
||||||
|
.text("ทั้งหมด"));
|
||||||
|
if (z !== "") {
|
||||||
|
$.each(result[z], function (key, value) {
|
||||||
|
$(d).append($("<option></option>")
|
||||||
|
.attr("value", value[x])
|
||||||
|
.text(value[y]));
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$.each(result, function (key, value) {
|
||||||
|
$(d).append($("<option></option>")
|
||||||
|
.attr("value", value[x])
|
||||||
|
.text(value[y]));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$(d).val(i);
|
||||||
|
}
|
||||||
|
|
||||||
//================= Form Data Customizaiton =========================================
|
//================= Form Data Customizaiton =========================================
|
||||||
|
|
||||||
function rep_eva03_InitialForm(s) {
|
function rep_eva03_InitialForm(s) {
|
||||||
|
|||||||
Reference in New Issue
Block a user