รายงาน กพ7

This commit is contained in:
Nakorn Rientrakrunchai
2020-09-07 17:39:34 +07:00
parent 717af2bf38
commit 8762bcaead
14 changed files with 526 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
var rep_kp7_API = "/api/rep_kp7/";
//================= Search Customizaiton =========================================
function rep_kp7_GetSearchParameter(fileType) {
var rep_kp7SearchObject = new Object();
rep_kp7SearchObject.employee_id = $("#s_rep_kp7_employee_id").val();
rep_kp7SearchObject.fileType = fileType;
console.log(rep_kp7SearchObject);
return rep_kp7SearchObject;
}
function rep_kp7_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_rep_kp7_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
}
//================= Form Data Customizaiton =========================================
function rep_kp7_InitialForm(s) {
var successFunc = function (result) {
rep_kp7_FeedDataToSearchForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + rep_kp7_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Data Table =========================================
var s_rep_kp7_customValidation = function (group) {
return "";
};
function rep_kp7_DoSearch(fileType) {
if (!ValidateForm('s_rep_kp7', s_rep_kp7_customValidation)) {
return;
}
var p = $.param(rep_kp7_GetSearchParameter(fileType));
var report_url = apisite + "/api/rep_kp7/rep_kp7_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);
}
}