450 lines
15 KiB
Plaintext
450 lines
15 KiB
Plaintext
<!-- #include virtual = "include/header.asp" -->
|
|
<!-- #include virtual = "include/left.asp" -->
|
|
<%
|
|
%>
|
|
<!-- Content Wrapper. Contains page content -->
|
|
<div class="content-wrapper">
|
|
<style>
|
|
#chk_confirm_btn {
|
|
right: 11px;
|
|
margin-top: -37px;
|
|
}
|
|
.popover{
|
|
max-width:none;
|
|
}
|
|
.popover table{
|
|
table-layout:fixed;
|
|
width:auto;
|
|
}
|
|
.popover table td{
|
|
width:500px;
|
|
}
|
|
|
|
@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="#finalList">미확인</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link py-2" data-toggle="tab" data-step="2" href="#finalList">확인완료</a>
|
|
</li>
|
|
</ul>
|
|
<% If Session("teamplace") = "6" Then %>
|
|
<button type="button" class="btn btn-primary position-absolute" id="chk_confirm_btn">확인</button>
|
|
<% End If %>
|
|
<div class="tab-content">
|
|
<div class="tab-pane fade m-3" id="finalList">
|
|
<div class="col-12 px-0 d-none" id="filterDiv">
|
|
<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="searchMonth">
|
|
<% 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>
|
|
<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>
|
|
</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="table-layout:fixed;" id="rsTable">
|
|
<colgroup>
|
|
<col width="180px"/>
|
|
<col width="*"/>
|
|
<col width="220px"/>
|
|
<col width="140px"/>
|
|
<col width="200px"/>
|
|
<col width="120px"/>
|
|
<col width="60px"/>
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<td class="text-center">문서번호</td>
|
|
<td class="text-center">프로젝트명</td>
|
|
<td class="text-center">거래처</td>
|
|
<td class="text-center">부서</td>
|
|
<td class="text-center">비용항목</td>
|
|
<td class="text-center">공급가액</td>
|
|
<td class="text-center">확인</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div id="commentDialog" class="" style="display:none;">
|
|
<div class="form-group row m-1 mt-3 align-items-center">
|
|
<div class="col-md-12">
|
|
<div class="input-group">
|
|
<div class="input-group-addon">
|
|
<span class="input-group-text" style="height: 100% !important;">Comment</span>
|
|
</div>
|
|
<textarea id="commentArea" rows="6" class="form-control"></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row mt-3 m-0">
|
|
<div class="col-md-12">
|
|
<button type="button" class="btn btn-block btn-primary" id="comment_confirm">미확인 목록 메일 전송</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- /.content -->
|
|
<!-- REQUIRED SCRIPTS -->
|
|
<script>
|
|
var step = "";
|
|
var retJson = [];
|
|
var etcJson = {};
|
|
var seT = undefined;
|
|
|
|
var commentDialog = $("#commentDialog").dialog({
|
|
title: "미확인 목록에 대한 Comment",
|
|
autoOpen: false,
|
|
resizable: false,
|
|
height: 290,
|
|
width: 480,
|
|
modal: true,
|
|
close: function( event, ui ) {
|
|
$("#commentArea").val("");
|
|
}
|
|
});
|
|
$(function(){
|
|
$("a[data-toggle='tab']").on("click", function(){
|
|
$("#rsTable > tbody").html("");
|
|
step = $(this).data("step");
|
|
if(step == "1"){
|
|
$("#chk_confirm_btn").removeClass("d-none");
|
|
$("#filterDiv").addClass("d-none");
|
|
$("#sumTable").addClass("d-none");
|
|
|
|
$("#filterBtn").click();
|
|
}else if(step == "2"){
|
|
$("#chk_confirm_btn").addClass("d-none");
|
|
$("#filterDiv").removeClass("d-none");
|
|
$("#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>');
|
|
}
|
|
});
|
|
|
|
$("#filterBtn").on("click", function(){
|
|
var searchMonth = $("#searchMonth").children("option:selected").val();
|
|
if(step == "2"){
|
|
$.ajax({
|
|
url: "/approval/doc_confirm_ajax.asp",
|
|
type: "POST",
|
|
async: false,
|
|
data: {"command":"etc_cost", "smonth":searchMonth},
|
|
success: function(ret){
|
|
etcJson = JSON.parse(ret);
|
|
}
|
|
});
|
|
}
|
|
$.ajax({
|
|
url: "/approval/doc_confirm_ajax.asp",
|
|
type: "POST",
|
|
data: {"command":"finalList", "step":step, "smonth":(step == "1" ? "" : searchMonth)},
|
|
beforeSend: function(){
|
|
$("#loader").show();
|
|
},
|
|
success: function(ret){
|
|
retJson = JSON.parse(ret);
|
|
setTableData(retJson);
|
|
if(step == "2"){
|
|
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);
|
|
});
|
|
|
|
$("#chk_confirm_btn").on("click", function(){
|
|
if($(".chk_confirm:not(:checked)").length > 0){
|
|
commentDialog.dialog("open");
|
|
}else{
|
|
$("#comment_confirm").click();
|
|
}
|
|
});
|
|
|
|
$("#comment_confirm").on("click", function(){
|
|
var today = new Date().getMonth()+1 + " / " + new Date().getDate();
|
|
var checkedConfirm = [];
|
|
var uncheckedConfirm = [];
|
|
var comment = $("#commentArea").val().trim().replace(/\r?\n/g, '<br />');
|
|
$(".chk_confirm").each(function(){
|
|
if($(this).prop("checked") == true){
|
|
checkedConfirm.push($(this).data("d_no"));
|
|
}else{
|
|
uncheckedConfirm.push($(this).data("d_no"));
|
|
}
|
|
});
|
|
if(comment == "" && uncheckedConfirm.length > 0){
|
|
if(!confirm("Comment 없이 메일을 보내시겠습니까?")){
|
|
return false;
|
|
}
|
|
}
|
|
if(checkedConfirm.length > 0 || uncheckedConfirm.length > 0){
|
|
$.ajax({
|
|
url: "/approval/doc_confirm_ajax.asp",
|
|
type: "POST",
|
|
data: {"command":"checkConfirm", "checkedList":JSON.stringify(checkedConfirm), "uncheckedList":JSON.stringify(uncheckedConfirm), "comment":encodeURIComponent(comment), "today":today },
|
|
success: function(ret){
|
|
if(ret == "1"){
|
|
alert("처리가 완료되었습니다.");
|
|
$(".chk_confirm:checked").parent().parent().remove();
|
|
commentDialog.dialog("close");
|
|
}
|
|
}
|
|
});
|
|
}else{
|
|
alert("확인할 데이터가 없습니다.");
|
|
}
|
|
});
|
|
|
|
$("a[data-toggle='tab']").eq(0).click();
|
|
});
|
|
|
|
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; });
|
|
}
|
|
|
|
var tmpHTML = "";
|
|
$.each(tmpJsonList, function(idx, obj){
|
|
tmpHTML += '<tr class="cus_tooltip" id="tr_'+ obj.d_no +'" data-contents="'+ obj.contents +'" data-overcomment="'+ obj.over_comment +'">';
|
|
tmpHTML += ' <td class="text-center"><a href="javascript:openit(\''+ obj.d_no.substr(9, 1) +'\',\''+ obj.d_no +'\')">'+ obj.d_no +'</a></td>';
|
|
tmpHTML += ' <td class="text-left">'+ (obj.p_child_sn == "" ? "Multi" : "["+ obj.p_child_sn +"] "+ obj.p_subject) +'</td>';
|
|
tmpHTML += ' <td class="text-center">'+ obj.client +'</td>';
|
|
tmpHTML += ' <td class="text-center">'+ obj.depart_name +'</td>';
|
|
tmpHTML += ' <td class="text-center">'+ obj.hangmok +'-'+ obj.sebu +'</td>';
|
|
tmpHTML += ' <td class="text-center">'+ commify(obj.cost) +'</td>';
|
|
if(step == "1"){
|
|
tmpHTML += ' <td class="text-center"><input type="checkbox" class="chk_confirm" checked value="1" data-d_no="'+ obj.d_no +'"/></td>';
|
|
}else{
|
|
tmpHTML += ' <td class="text-center">완료</td>';
|
|
}
|
|
tmpHTML += '</tr>';
|
|
});
|
|
$("#rsTable > tbody").html(tmpHTML);
|
|
$.fn.popover.Constructor.Default.whiteList.table = [];
|
|
$.fn.popover.Constructor.Default.whiteList.tr = [];
|
|
$.fn.popover.Constructor.Default.whiteList.td = [];
|
|
$.fn.popover.Constructor.Default.whiteList.div = [];
|
|
$.fn.popover.Constructor.Default.whiteList.tbody = [];
|
|
$.fn.popover.Constructor.Default.whiteList.thead = [];
|
|
$(".cus_tooltip").popover({
|
|
html: true,
|
|
trigger: 'hover',
|
|
container: '.content',
|
|
placement: 'bottom',
|
|
content: function () {
|
|
if($(this).data("contents") == ""){
|
|
return "Multi 지출결의서는 문서번호를 클릭하여 확인해주세요.";
|
|
}
|
|
tmpHTML = "<div>";
|
|
tmpHTML += "<table class='table table-sm table-sm2 table-bordered table-head tr-colors'>";
|
|
tmpHTML += "<tr>";
|
|
tmpHTML += "<td>비고</td>";
|
|
if(unescape($(this).data("overcomment")) != ""){
|
|
tmpHTML += "<td>추가사유</td>";
|
|
}
|
|
tmpHTML += "</tr>";
|
|
tmpHTML += "<tr>";
|
|
tmpHTML += "<td>" + unescape($(this).data("contents")).replace(/</g, '<').replace(/>/g, '>') + "</td>";
|
|
if(unescape($(this).data("overcomment")) != ""){
|
|
tmpHTML += "<td>" + unescape($(this).data("overcomment")) + "</td>";
|
|
}
|
|
tmpHTML += "</tr>";
|
|
tmpHTML += "</table>";
|
|
tmpHTML += "</div>";
|
|
//console.log(tmpHTML);
|
|
return $(tmpHTML).html();
|
|
}
|
|
});
|
|
}
|
|
|
|
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){
|
|
var tmp_height = 960;
|
|
var tmp_width = 850;
|
|
if (z == 'i'){
|
|
var title_type = "지출";
|
|
var url = '/ess/doc_expense_print_2014.asp?rev_type=3&d_no=' + x + "&title_type=" + title_type;
|
|
}else if (z == 'A'){
|
|
var title_type = "지출";
|
|
var url = '/ess/doc_expense2_print_2014.asp?rev_type=3&d_no=' + x + "&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" -->
|