365 lines
14 KiB
Plaintext
365 lines
14 KiB
Plaintext
<!-- #include virtual = "include/header.asp" -->
|
|
<!-- #include virtual = "include/left.asp" -->
|
|
<%
|
|
Dim yyyy : yyyy = LEFT(date, 4)
|
|
Dim mm : mm = MID(date, 6,2)
|
|
%>
|
|
<!-- Content Wrapper. Contains page content -->
|
|
<div class="content-wrapper">
|
|
<style>
|
|
@keyframes ldio-suc7j3meaz {
|
|
0% { opacity: 1 }
|
|
50% { opacity: .5 }
|
|
100% { opacity: 1 }
|
|
}
|
|
.ldio-suc7j3meaz div {
|
|
margin: 10px;
|
|
display: flex;
|
|
border-radius:30px;
|
|
flex: auto;
|
|
animation: ldio-suc7j3meaz 1s cubic-bezier(0.5,0,0.5,1) infinite;
|
|
}.ldio-suc7j3meaz div:nth-child(1) {
|
|
background: #172f59;
|
|
animation-delay: -0.6s;
|
|
}.ldio-suc7j3meaz div:nth-child(2) {
|
|
background: #ffc000;
|
|
animation-delay: -0.4s;
|
|
}.ldio-suc7j3meaz div:nth-child(3) {
|
|
background: #172f59;
|
|
animation-delay: -0.2s;
|
|
}.ldio-suc7j3meaz div:nth-child(4) {
|
|
background: #ffc000;
|
|
animation-delay: -1s;
|
|
}
|
|
.loadingio-spinner-bars-10euvebw46w {
|
|
z-index: 9999;
|
|
position: fixed;
|
|
left: 0;
|
|
top: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
display: flex;
|
|
background-color:#ffffff80;
|
|
}
|
|
.ldio-suc7j3meaz {
|
|
width: 300px;
|
|
height: 76px;
|
|
margin: auto;
|
|
display: flex;
|
|
}
|
|
</style>
|
|
<!-- Content Header (Page header) -->
|
|
<div class="content-header">
|
|
<h1>지출결의서/자금집행서 확인 (참조함)</h1>
|
|
</div>
|
|
<!-- /.content-header -->
|
|
<div id="loader" class="loadingio-spinner-bars-10euvebw46w" style="display:none;">
|
|
<div class="ldio-suc7j3meaz">
|
|
<div></div>
|
|
<div></div>
|
|
<div></div>
|
|
<div></div>
|
|
</div>
|
|
</div>
|
|
<!-- Main content -->
|
|
<div class="content-body">
|
|
<div class="content">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<ul class="nav nav-tabs">
|
|
<li class="nav-item">
|
|
<a class="nav-link py-2" data-toggle="tab" data-step="1" href="#approvalList">미진행</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link py-2" data-toggle="tab" data-step="2" href="#approvalList">진행</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link py-2" data-toggle="tab" data-step="3" href="#approvalList">완료</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link py-2" data-toggle="tab" data-step="4" href="#approvalList">대표님완료</a>
|
|
</li>
|
|
</ul>
|
|
<div class="tab-content">
|
|
<div class="tab-pane fade m-3" id="approvalList">
|
|
<div class="col-12 px-0">
|
|
<div class="input-group mb-1">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text bg-lightblue justify-content-center">증빙월</span>
|
|
</div>
|
|
<select class="form-control" id="startMonth">
|
|
|
|
<% For i = 0 To -7 Step -1 %>
|
|
<option value="<%=LEFT(DateAdd("m", i, date), 7) %>" <%If yyyy & "-" & mm = LEFT(DateAdd("m", i, date), 7) Then %> selected <%End If %>><%=LEFT(DateAdd("m", i, date), 7) %></option>
|
|
<% Next %>
|
|
</select>
|
|
<select class="form-control" id="endMonth">
|
|
<% For i = 0 To -7 Step -1 %>
|
|
<option value="<%=LEFT(DateAdd("m", i, date), 7) %>" <%If yyyy & "-" & mm = LEFT(DateAdd("m", i, date), 7) Then %> selected <%ELSE%> style="display:none" <%End If %>><%=LEFT(DateAdd("m", i, date), 7) %></option>
|
|
<% Next %>
|
|
</select>
|
|
<div class="input-group-addon ml-1">
|
|
<button class="btn btn-sm btn-success h-100 px-2" type="button" id="filterBtn"><i class="fas fa-search"></i></button>
|
|
</div>
|
|
<div class="input-group-prepend ml-1">
|
|
<span class="input-group-text bg-olive justify-content-center">증빙종류</span>
|
|
</div>
|
|
<select class="form-control" id="f-costtype">
|
|
<option value="">전체</option>
|
|
<option value="카드/현금">카드/현금</option>
|
|
<option value="세금계산서">세금계산서</option>
|
|
<option value="인보이스">인보이스</option>
|
|
<option value="인건비">인건비</option>
|
|
</select>
|
|
<div class="input-group-prepend ml-1">
|
|
<span class="input-group-text bg-olive justify-content-center">부서</span>
|
|
</div>
|
|
<select class="form-control" id="f-depart">
|
|
<option value="">전체</option>
|
|
</select>
|
|
<div class="input-group-prepend ml-1">
|
|
<span class="input-group-text bg-olive justify-content-center">키워드(프로젝트명, 거래처, 비용항목, 작성자)</span>
|
|
</div>
|
|
<input type="text" class="form-control border" id="f-keyword" value="">
|
|
<div class="input-group-addon ml-1">
|
|
<button type="button" class="btn btn-sm btn-success h-100 px-2" id="excel_btn">Excel Download</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<table class="table table-sm table-sm2 table-bordered table-head tr-colors d-none" style="font-size:12px;table-layout:fixed;" id="sumTable">
|
|
<thead>
|
|
<tr>
|
|
<th class="text-center">총계</th>
|
|
<th class="text-center">카드/현금<br>지출결의서</th>
|
|
<th class="text-center">세금계산서<br>지출결의서</th>
|
|
<th class="text-center">인건비<br>지출결의서</th>
|
|
<th class="text-center">해외외주비<br>지출결의서</th>
|
|
<th class="text-center">그룹운영비</th>
|
|
<th class="text-center">업무일지</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td class="text-center">0</td>
|
|
<td class="text-center">0</td>
|
|
<td class="text-center">0</td>
|
|
<td class="text-center">0</td>
|
|
<td class="text-center">0</td>
|
|
<td class="text-center">0</td>
|
|
<td class="text-center">0</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-sm2 table-bordered table-head tr-colors" style="font-size:12px;table-layout:fixed;" id="rsTable">
|
|
<colgroup>
|
|
<col width="130px" />
|
|
<col width="*" />
|
|
<col width="180px" />
|
|
<col width="180px" />
|
|
<col width="80px" />
|
|
<col width="60px" />
|
|
<col width="60px" />
|
|
<col width="100px" />
|
|
<col width="100px" />
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<th class="text-center">문서번호</th>
|
|
<th class="text-center">프로젝트명</th>
|
|
<th class="text-center">거래처</th>
|
|
<th class="text-center">비용항목</th>
|
|
<th class="text-center">공급가액</th>
|
|
<th class="text-center">부서</th>
|
|
<th class="text-center">작성자</th>
|
|
<th class="text-center">증빙일자</th>
|
|
<th class="text-center">지급일자</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- /.content -->
|
|
<!-- REQUIRED SCRIPTS -->
|
|
<script>
|
|
var step = "";
|
|
var retJson = [];
|
|
var etcJson = {};
|
|
var seT = undefined;
|
|
$(function(){
|
|
$("a[data-toggle='tab']").on("click", function(){
|
|
$("#rsTable > tbody").html("");
|
|
step = $(this).data("step");
|
|
if(step == "4"){
|
|
$("#sumTable").removeClass("d-none");
|
|
$("#sumTable > tbody").html(
|
|
'<tr>'+
|
|
'<td class="text-center">0</td>'+
|
|
'<td class="text-center">0</td>'+
|
|
'<td class="text-center">0</td>'+
|
|
'<td class="text-center">0</td>'+
|
|
'<td class="text-center">0</td>'+
|
|
'<td class="text-center">0</td>'+
|
|
'<td class="text-center">0</td>'+
|
|
'</tr>');
|
|
}else{
|
|
$("#sumTable").addClass("d-none");
|
|
}
|
|
});
|
|
$("a[data-toggle='tab']").eq(0).click();
|
|
|
|
$("#startMonth").on("change",function(){
|
|
var startMonth = $("#startMonth").children("option:selected").val();
|
|
for(var i = 0; i < $("#endMonth").children("option").length; i++){
|
|
if(i <= $("#startMonth").prop('selectedIndex')){
|
|
$("#endMonth").children("option:eq("+i+")").show();
|
|
}
|
|
else{
|
|
$("#endMonth").children("option:eq("+i+")").hide();
|
|
}
|
|
}
|
|
$("#endMonth").children("option:eq("+$("#startMonth").prop('selectedIndex')+")").attr("selected",true);
|
|
});
|
|
|
|
$("#filterBtn").on("click", function(){
|
|
var startMonth = $("#startMonth").children("option:selected").val();
|
|
var endMonth = $("#endMonth").children("option:selected").val();
|
|
if(step == "4"){
|
|
$.ajax({
|
|
url: "/approval/doc_confirm_ajax.asp",
|
|
type: "POST",
|
|
async: false,
|
|
data: {"command":"etc_cost", "smonth":startMonth, "emonth":endMonth},
|
|
success: function(ret){
|
|
etcJson = JSON.parse(ret);
|
|
}
|
|
});
|
|
}
|
|
|
|
$.ajax({
|
|
url: "/approval/doc_confirm_ajax.asp",
|
|
type: "POST",
|
|
data: {"command":"approvalList", "step":step, "smonth":startMonth, "emonth":endMonth},
|
|
beforeSend: function(){
|
|
$("#loader").show();
|
|
},
|
|
success: function(ret){
|
|
retJson = JSON.parse(ret);
|
|
setTableData(retJson);
|
|
if(step == "4"){
|
|
setSumTable(retJson, etcJson);
|
|
}
|
|
$("#f-costtype").val("");
|
|
$("#f-keyword").val("");
|
|
$("#f-depart").html("");
|
|
$("#f-depart").append("<option value=''>전체</option>");
|
|
$.each($.unique($.map(retJson, function(obj){ return obj.depart_name.replace("데이터이노베이션", "DIN").replace("비즈니스프로모터", "BP").replace("AI빅데이터센터", "AI"); }).sort()), function(idx, obj){
|
|
$("#f-depart").append("<option value='"+ obj +"'>"+ obj +"</option>");
|
|
});
|
|
|
|
$("#loader").hide();
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#f-costtype, #f-depart").on("change", function(){
|
|
setTableData(retJson);
|
|
});
|
|
|
|
$("#f-keyword").on("keyup", function(){
|
|
if(seT != undefined){
|
|
clearTimeout(seT);
|
|
}
|
|
seT = setTimeout(function(){
|
|
setTableData(retJson);
|
|
}, 500);
|
|
});
|
|
|
|
$("#excel_btn").on("click", function(){
|
|
var dt = new Date().format("yyyyMMdd");
|
|
$("#rsTable").table2excel({
|
|
name: "참조함_" + $(".nav-link[data-toggle=tab].active").text() + "_" + dt,
|
|
filename: "참조함_" + $(".nav-link[data-toggle=tab].active").text() + "_" + dt,
|
|
fileext: ".xls"
|
|
});
|
|
});
|
|
});
|
|
|
|
function setTableData(jsonList){
|
|
var costType = $("#f-costtype").children("option:selected").val() || "";
|
|
var depart = $("#f-depart").children("option:selected").val() || "";
|
|
var keyword = $("#f-keyword").val() || "";
|
|
|
|
var tmpJsonList = [];
|
|
if(costType == "" && depart == "" && keyword == ""){
|
|
tmpJsonList = jsonList;
|
|
}else{
|
|
if(costType != "") tmpJsonList = $.grep(jsonList, function(obj){ return obj.cost_type == costType; });
|
|
if(depart != "") tmpJsonList = $.grep(jsonList, function(obj){ return obj.depart_name.replace("데이터이노베이션", "DIN").replace("비즈니스프로모터", "BP").replace("AI빅데이터센터", "AI") == depart; });
|
|
if(keyword != "") tmpJsonList = $.grep(jsonList, function(obj){ return obj.p_subject.indexOf(keyword) > -1 || obj.client.indexOf(keyword) > -1 || (obj.hangmok +'-'+ obj.sebu).indexOf(keyword) > -1 || obj.d_write_name.indexOf(keyword) > -1; });
|
|
}
|
|
|
|
var tmpHTML = "";
|
|
$.each(tmpJsonList, function(idx, obj){
|
|
tmpHTML += '<tr id="tr_'+ obj.d_no +'">';
|
|
tmpHTML += ' <td class="text-center"><a href="javascript:openit(\''+ obj.d_no.substr(9, 1) +'\',\''+ obj.d_no +'\', \'' + step + '\')">'+ obj.d_no +'</a></td>';
|
|
// tmpHTML += ' <td class="text-left">'+ (obj.p_child_sn == "" ? "지출결의서" : "["+ obj.p_child_sn +"] "+ obj.p_subject) +'</td>';
|
|
tmpHTML += ' <td class="text-left">' + (obj.p_child_sn == "" ? (obj.p_subject == "자급집행서" ? "자급집행서" : "지출결의서") : "[" + obj.p_child_sn + "] " + obj.p_subject) + '</td>';
|
|
tmpHTML += ' <td class="text-center">'+ obj.client +'</td>';
|
|
tmpHTML += ' <td class="text-center">'+ obj.hangmok +'-'+ obj.sebu +'</td>';
|
|
tmpHTML += ' <td class="text-center">'+ commify(obj.cost) +'</td>';
|
|
tmpHTML += ' <td class="text-center">'+ obj.depart_name.replace("데이터이노베이션", "DIN").replace("비즈니스프로모터", "BP").replace("AI빅데이터센터", "AI") +'</td>';
|
|
tmpHTML += ' <td class="text-center">'+ obj.d_write_name +'</td>';
|
|
tmpHTML += ' <td class="text-center">'+ obj.cost_date +'</td>';
|
|
tmpHTML += ' <td class="text-center">'+ obj.payment_date +'</td>';
|
|
tmpHTML += '</tr>';
|
|
});
|
|
|
|
$("#rsTable > tbody").html(tmpHTML);
|
|
}
|
|
|
|
function setSumTable(docJson, etcJson){
|
|
var gSum = groupBySum(docJson, ["cost_type"], ["cost"]);
|
|
gSum.push({cost_type:"그룹운영비", cost:+etcJson.GROUP_COST});
|
|
gSum.push({cost_type:"업무일지", cost:+etcJson.BUSI_COST});
|
|
var idxArr = {
|
|
"카드/현금":1,
|
|
"세금계산서":2,
|
|
"인건비":3,
|
|
"인보이스":4,
|
|
"그룹운영비":5,
|
|
"업무일지":6
|
|
}
|
|
$("#sumTable > tbody > tr > td:eq(0)").html(commify(groupBySum(gSum, [], ["cost"])[0].cost));
|
|
$.each(gSum, function(idx, obj){
|
|
$("#sumTable > tbody > tr > td:eq("+ idxArr[obj.cost_type] +")").html(commify(obj.cost));
|
|
});
|
|
}
|
|
|
|
function openit(z, x, y){
|
|
var tmp_height = 960;
|
|
var tmp_width = 850;
|
|
if (z == 'i'){
|
|
var title_type = "지출";
|
|
var url = '/ess/doc_expense_print_2014.asp?rev_type=' + y + '&d_no=' + x + "&title_type=" + title_type;
|
|
}else if (z == 'A'){
|
|
var title_type = "지출";
|
|
var url = '/ess/doc_expense2_print_2014.asp?rev_type=' + y + '&d_no=' + x + "&title_type=" + title_type;
|
|
}else if (z == 'r'){
|
|
var title_type = "자금";
|
|
var url = '/ess/doc_expense2_print.asp?rev_type=' + y + '&d_no=' + x + '&view_chk=1&x=1&title_type=' + title_type;
|
|
}
|
|
window.open(url, '', 'left=0,top=0,width=' + tmp_width + ',height=' + tmp_height + ',scrollbars=yes,resizable=yes')
|
|
}
|
|
</script>
|
|
</div>
|
|
<!-- /.content-wrapper -->
|
|
<!-- #include virtual = "include/footer.asp" -->
|