First Initial

This commit is contained in:
Nakorn Rientrakrunchai
2020-02-20 15:02:39 +07:00
commit 8b98125e49
3048 changed files with 760804 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
var rep_leave_summary_API = "/api/rep_leave_summary/";
//================= Search Customizaiton =========================================
function rep_leave_summary_GetSearchParameter(fileType) {
var rep_leave_summarySearchObject = new Object();
rep_leave_summarySearchObject.fiscal_year = $("#s_rep_leave_summary_fiscal_year").val();
rep_leave_summarySearchObject.org_id = $("#s_rep_leave_summary_org_id").val();
rep_leave_summarySearchObject.employee_id = $("#s_rep_leave_summary_employee_id").val();
rep_leave_summarySearchObject.fileType = fileType;
console.log(rep_leave_summarySearchObject);
return rep_leave_summarySearchObject;
}
function rep_leave_summary_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_rep_leave_summary_fiscal_year"), data, "id", "external_name", "item_fiscal_year", data.fiscal_year);
DropDownClearFormAndFeedWithData($("#s_rep_leave_summary_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
DropDownClearFormAndFeedWithData($("#s_rep_leave_summary_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
}
//================= Form Data Customizaiton =========================================
function rep_leave_summary_InitialForm(s) {
var successFunc = function (result) {
rep_leave_summary_FeedDataToSearchForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + rep_leave_summary_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Data Table =========================================
var s_rep_leave_summary_customValidation = function (group) {
return "";
};
function rep_leave_summary_DoSearch(fileType) {
if (!ValidateForm('s_rep_leave_summary', s_rep_leave_summary_customValidation)) {
return;
}
var p = $.param(rep_leave_summary_GetSearchParameter(fileType));
var report_url = apisite + "/api/rep_leave_summary/rep_leave_summary_report?" + p;
if (fileType === "pdf") {
$("#report_result").attr("src", report_url);
$("#report_result").show();
//window.open(report_url);
} else {
$("#report_result").hide();
window.open(report_url);
}
}