fix op 2733
This commit is contained in:
@@ -157,6 +157,10 @@
|
||||
<script src="~/BackendScript/js/jquery.sparkline.js" type="text/javascript"></script>
|
||||
<script src="~/BackendScript/js/respond.min.js"></script>
|
||||
|
||||
<script src="~/BackendScript/js/jQuery-Mask-Plugin-master/dist/jquery.mask.min.js"></script>
|
||||
<script src="~/BackendScript/js/jquery-maskmoney-master/dist/jquery.maskMoney.min.js"></script>
|
||||
<script src="~/BackendScript/js/jsrsasign-all-min.js"></script>
|
||||
|
||||
<script src="~/DataTables-1.10.16/js/jquery.dataTables.js" type="text/javascript"></script>
|
||||
<script src="~/DataTables-1.10.16/js/dataTables.bootstrap4.min.js" type="text/javascript"></script>
|
||||
<script src="~/DataTables-1.10.16/js/dataTables.select.min.js" type="text/javascript"></script>
|
||||
@@ -173,9 +177,6 @@
|
||||
<script src="~/BackendScript/js/bootstrap-datepicker-th/bootstrap-datepicker.th.js"></script>
|
||||
<script src="~/BackendScript/assets/bootstrap-daterangepicker/moment.min.js"></script>
|
||||
|
||||
<script src="https://hrm.stin.ac.th/plugins/jQuery-Mask-Plugin-master/dist/jquery.mask.min.js"></script>
|
||||
<script src="https://hrm.stin.ac.th/plugins/jquery-maskmoney-master/dist/jquery.maskMoney.min.js"></script>
|
||||
|
||||
<!--Select2-->
|
||||
<script src='~/select2/js/select2.min.js' type='text/javascript'></script>
|
||||
|
||||
@@ -208,11 +209,14 @@
|
||||
$("#username").text(getCookie("emp_name"));
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$(document).ready(function(){
|
||||
|
||||
$( document ).on( 'focus', ':input', function(){
|
||||
$( this ).attr( 'autocomplete', 'off' );
|
||||
});
|
||||
|
||||
$('.money').maskMoney();
|
||||
|
||||
$(document).on('change', 'input.money', function() {
|
||||
var value = parseFloat(parseFloat($(this).val()).toFixed(2));
|
||||
$(this).maskMoney();
|
||||
@@ -220,14 +224,12 @@
|
||||
$(this).unbind("blur.maskMoney");
|
||||
$(this).maskMoney('mask', value);
|
||||
});
|
||||
|
||||
$(document).on('focus', 'input.money:not([readonly], :disabled)', function() {
|
||||
$(this).maskMoney('destroy');
|
||||
var val = $(this).maskMoney('unmasked')[0];
|
||||
val = val === 0 ? '' : val;
|
||||
$(this).val(val);
|
||||
});
|
||||
|
||||
$(document).on('blur', 'input.money', function() {
|
||||
preventDefault(event);
|
||||
var value = $(this).val();
|
||||
@@ -236,7 +238,6 @@
|
||||
$(this).change();
|
||||
}
|
||||
});
|
||||
|
||||
$('input.money').keypress(function(e){
|
||||
e = e || window.event;
|
||||
var key = e.which || e.charCode || e.keyCode,
|
||||
@@ -259,7 +260,7 @@
|
||||
e.returnValue = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -32,29 +32,29 @@
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_salary_cylinder_temporary_min" for="eva_salary_cylinder_temporary_min">ขั้นต่ำชั่วคราว</label>
|
||||
<input class="form-control" type="number" id="eva_salary_cylinder_temporary_min" iLabel="ขั้นต่ำชั่วคราว" iRequire="true" iGroup="eva_salary_cylinder" />
|
||||
<input placeholder="0.00" class="form-control money mask_plugin" type="text" id="eva_salary_cylinder_temporary_min" iLabel="ขั้นต่ำชั่วคราว" iRequire="true" iGroup="eva_salary_cylinder" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_salary_cylinder_themin" for="eva_salary_cylinder_themin">ขั้นต่ำ</label>
|
||||
<input class="form-control" type="number" id="eva_salary_cylinder_themin" iLabel="ขั้นต่ำ" iRequire="true" iGroup="eva_salary_cylinder" />
|
||||
<input placeholder="0.00" class="form-control money mask_plugin" type="text" id="eva_salary_cylinder_themin" iLabel="ขั้นต่ำ" iRequire="true" iGroup="eva_salary_cylinder" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_salary_cylinder_themax" for="eva_salary_cylinder_themax">ขั้นสูง</label>
|
||||
<input class="form-control" type="number" id="eva_salary_cylinder_themax" iLabel="ขั้นสูง" iRequire="true" iGroup="eva_salary_cylinder" />
|
||||
<input placeholder="0.00" class="form-control money mask_plugin" type="text" id="eva_salary_cylinder_themax" iLabel="ขั้นสูง" iRequire="true" iGroup="eva_salary_cylinder" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_salary_cylinder_middle" for="eva_salary_cylinder_middle">ค่ากลาง</label>
|
||||
<input class="form-control" type="number" id="eva_salary_cylinder_middle" iLabel="ค่ากลาง" iRequire="true" iGroup="eva_salary_cylinder" />
|
||||
<input placeholder="0.00" class="form-control money mask_plugin" type="text" id="eva_salary_cylinder_middle" iLabel="ค่ากลาง" iRequire="true" iGroup="eva_salary_cylinder" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_salary_cylinder_cost_living " for="eva_salary_cylinder_cost_living ">ค่าครองชีพ</label>
|
||||
<input class="form-control" type="number" id="eva_salary_cylinder_cost_living " iLabel="ค่าครองชีพ" iRequire="true" iGroup="eva_salary_cylinder" />
|
||||
<input placeholder="0.00" class="form-control money mask_plugin" type="text" id="eva_salary_cylinder_cost_living " iLabel="ค่าครองชีพ" iRequire="true" iGroup="eva_salary_cylinder" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -5,40 +5,45 @@ var eva_salary_cylinder_API = "/api/eva_salary_cylinder/";
|
||||
|
||||
function eva_salary_cylinder_GetSearchParameter() {
|
||||
var eva_salary_cylinderSearchObject = new Object();
|
||||
eva_salary_cylinderSearchObject.position_type = $("#s_eva_salary_cylinder_position_type").val();
|
||||
eva_salary_cylinderSearchObject.position_type = $("#s_eva_salary_cylinder_position_type").val();
|
||||
|
||||
return eva_salary_cylinderSearchObject;
|
||||
}
|
||||
|
||||
function eva_salary_cylinder_FeedDataToSearchForm(data) {
|
||||
DropDownClearFormAndFeedWithData($("#s_eva_salary_cylinder_position_type"), data, "id", "external_name", "item_position_type", data.position_type);
|
||||
DropDownClearFormAndFeedWithData($("#s_eva_salary_cylinder_position_type"), data, "id", "external_name", "item_position_type", data.position_type);
|
||||
|
||||
}
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_salary_cylinder_FeedDataToForm(data) {
|
||||
$("#eva_salary_cylinder_id").val(data.id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_salary_cylinder_position_type"), data, "id", "external_name", "item_position_type", data.position_type);
|
||||
DropDownClearFormAndFeedWithData($("#eva_salary_cylinder_position_level"), data, "id", "external_name", "item_position_level", data.position_level);
|
||||
$("#eva_salary_cylinder_temporary_min").val(data.temporary_min);
|
||||
$("#eva_salary_cylinder_themin").val(data.themin);
|
||||
$("#eva_salary_cylinder_themax").val(data.themax);
|
||||
$("#eva_salary_cylinder_middle").val(data.middle);
|
||||
$("#eva_salary_cylinder_cost_living").val(data.cost_living );
|
||||
$("#eva_salary_cylinder_id").val(data.id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_salary_cylinder_position_type"), data, "id", "external_name", "item_position_type", data.position_type);
|
||||
DropDownClearFormAndFeedWithData($("#eva_salary_cylinder_position_level"), data, "id", "external_name", "item_position_level", data.position_level);
|
||||
// $("#eva_salary_cylinder_temporary_min").val(data.temporary_min);
|
||||
// $("#eva_salary_cylinder_themin").val(data.themin);
|
||||
// $("#eva_salary_cylinder_themax").val(data.themax);
|
||||
// $("#eva_salary_cylinder_middle").val(data.middle);
|
||||
// $("#eva_salary_cylinder_cost_living").val(data.cost_living);
|
||||
$("#eva_salary_cylinder_temporary_min").maskMoney('mask',data.temporary_min);
|
||||
$("#eva_salary_cylinder_themin").maskMoney('mask',data.themin);
|
||||
$("#eva_salary_cylinder_themax").maskMoney('mask',data.themax);
|
||||
$("#eva_salary_cylinder_middle").maskMoney('mask',data.middle);
|
||||
$("#eva_salary_cylinder_cost_living").maskMoney('mask',data.cost_living);
|
||||
|
||||
}
|
||||
|
||||
function eva_salary_cylinder_GetFromForm() {
|
||||
var eva_salary_cylinderObject = new Object();
|
||||
eva_salary_cylinderObject.id = $("#eva_salary_cylinder_id").val();
|
||||
eva_salary_cylinderObject.position_type = $("#eva_salary_cylinder_position_type").val();
|
||||
eva_salary_cylinderObject.position_level = $("#eva_salary_cylinder_position_level").val();
|
||||
eva_salary_cylinderObject.temporary_min = $("#eva_salary_cylinder_temporary_min").val();
|
||||
eva_salary_cylinderObject.themin = $("#eva_salary_cylinder_themin").val();
|
||||
eva_salary_cylinderObject.themax = $("#eva_salary_cylinder_themax").val();
|
||||
eva_salary_cylinderObject.middle = $("#eva_salary_cylinder_middle").val();
|
||||
eva_salary_cylinderObject.cost_living = $("#eva_salary_cylinder_cost_living").val();
|
||||
eva_salary_cylinderObject.id = $("#eva_salary_cylinder_id").val();
|
||||
eva_salary_cylinderObject.position_type = $("#eva_salary_cylinder_position_type").val();
|
||||
eva_salary_cylinderObject.position_level = $("#eva_salary_cylinder_position_level").val();
|
||||
eva_salary_cylinderObject.temporary_min = $("#eva_salary_cylinder_temporary_min").val().replace(/[,-]/g,'');
|
||||
eva_salary_cylinderObject.themin = $("#eva_salary_cylinder_themin").val().replace(/[,-]/g,'');
|
||||
eva_salary_cylinderObject.themax = $("#eva_salary_cylinder_themax").val().replace(/[,-]/g,'');
|
||||
eva_salary_cylinderObject.middle = $("#eva_salary_cylinder_middle").val().replace(/[,-]/g,'');
|
||||
eva_salary_cylinderObject.cost_living = $("#eva_salary_cylinder_cost_living").val().replace(/[,-]/g,'');
|
||||
|
||||
|
||||
return eva_salary_cylinderObject;
|
||||
@@ -47,14 +52,14 @@ eva_salary_cylinderObject.cost_living = $("#eva_salary_cylinder_cost_living").v
|
||||
function eva_salary_cylinder_InitialForm(s) {
|
||||
var successFunc = function (result) {
|
||||
eva_salary_cylinder_FeedDataToForm(result);
|
||||
eva_salary_cylinder_FeedDataToSearchForm(result);
|
||||
eva_salary_cylinder_FeedDataToSearchForm(result);
|
||||
if (s) {
|
||||
// Incase model popup
|
||||
$("#eva_salary_cylinderModel").modal("show");
|
||||
}
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_salary_cylinder_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
@@ -81,15 +86,15 @@ function eva_salary_cylinder_SetEditForm(a) {
|
||||
eva_salary_cylinder_editMode = "UPDATE";
|
||||
eva_salary_cylinder_FeedDataToForm(result);
|
||||
$("#eva_salary_cylinderModel").modal("show");
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_salary_cylinder_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_salary_cylinder_SetCreateForm(s) {
|
||||
eva_salary_cylinder_editMode = "CREATE";
|
||||
eva_salary_cylinder_InitialForm(s);
|
||||
eva_salary_cylinder_InitialForm(s);
|
||||
}
|
||||
|
||||
function eva_salary_cylinder_RefreshTable() {
|
||||
@@ -107,8 +112,7 @@ var eva_salary_cylinder_customValidation = function (group) {
|
||||
};
|
||||
|
||||
function eva_salary_cylinder_PutUpdate() {
|
||||
if (!ValidateForm('eva_salary_cylinder', eva_salary_cylinder_customValidation))
|
||||
{
|
||||
if (!ValidateForm('eva_salary_cylinder', eva_salary_cylinder_customValidation)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -118,22 +122,22 @@ function eva_salary_cylinder_PutUpdate() {
|
||||
if (eva_salary_cylinder_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
$("#eva_salary_cylinderModel").modal("hide");
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_salary_cylinder_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_salary_cylinder_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
$("#eva_salary_cylinderModel").modal("hide");
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_salary_cylinder_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_salary_cylinder_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
@@ -142,11 +146,11 @@ function eva_salary_cylinder_GoDelete(a) {
|
||||
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
|
||||
var successFunc = function (result) {
|
||||
$("#eva_salary_cylinderModel").modal("hide");
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_salary_cylinder_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_salary_cylinder_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
@@ -156,22 +160,22 @@ function eva_salary_cylinder_GoDelete(a) {
|
||||
var eva_salary_cylinderTableV;
|
||||
|
||||
var eva_salary_cylinder_setupTable = function (result) {
|
||||
console.log(result);
|
||||
tmp = '"';
|
||||
console.log(result);
|
||||
tmp = '"';
|
||||
eva_salary_cylinderTableV = $('#eva_salary_cylinderTable').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
"data": result,
|
||||
"select": false,
|
||||
"select": false,
|
||||
"columns": [
|
||||
{ "data": "id" },
|
||||
{ "data": "position_type_external_linkage_external_name" },
|
||||
{ "data": "position_level_external_linkage_external_name" },
|
||||
{ "data": "temporary_min" },
|
||||
{ "data": "themin" },
|
||||
{ "data": "themax" },
|
||||
{ "data": "middle" },
|
||||
{ "data": "cost_living" },
|
||||
{ "data": "id" },
|
||||
{ "data": "position_type_external_linkage_external_name" },
|
||||
{ "data": "position_level_external_linkage_external_name" },
|
||||
{ "data": "temporary_min" },
|
||||
{ "data": "themin" },
|
||||
{ "data": "themax" },
|
||||
{ "data": "middle" },
|
||||
{ "data": "cost_living" },
|
||||
],
|
||||
"columnDefs": [
|
||||
{
|
||||
@@ -220,13 +224,13 @@ console.log(result);
|
||||
"url": appsite + "/DataTables-1.10.16/thai.json"
|
||||
},
|
||||
"paging": true,
|
||||
"searching": false
|
||||
"searching": false
|
||||
});
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
|
||||
function eva_salary_cylinder_InitiateDataTable() {
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_salary_cylinder/GetListBySearch", eva_salary_cylinder_setupTable, AlertDanger);
|
||||
}
|
||||
|
||||
@@ -235,10 +239,10 @@ function eva_salary_cylinder_DoSearch() {
|
||||
var eva_salary_cylinder_reload = function (result) {
|
||||
eva_salary_cylinderTableV.destroy();
|
||||
eva_salary_cylinder_setupTable(result);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_salary_cylinder/GetListBySearch?"+p, eva_salary_cylinder_reload, AlertDanger);
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_salary_cylinder/GetListBySearch?" + p, eva_salary_cylinder_reload, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_salary_cylinder_GetSelect(f) {
|
||||
|
||||
Reference in New Issue
Block a user