<%@ page import="com.jeeplus.modules.sys.utils.UserUtils" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
    <title>报销统计</title>
    <meta name="decorator" content="default"/>


    <style>
        .widthClass{
            display: inline-block;
        }
        .shows .input-group{
            width: 48%!important;
        }
    </style>
    <style>
        body{
            background-color:transparent;
            filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
            color:#ffffff;
            background-color:rgba(255,255,255,0);
            height:100%;
        }
    </style>
</head>
<body>
<div class="wrapper wrapper-content">
    <sys:message content="${message}"/>
    <div class="layui-row">
        <div class="full-width fl">
            <div class="contentShadow layui-row" id="queryDiv">
                <form:form id="searchForm" modelAttribute="workInvoiceInfo" action="${ctx}/workreimbursementcount/workInvoiceCount/infolist" method="post" class="form-inline">
                    <form:hidden path="officeId"/>
                    <%--以下三行照抄--%>
                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                    <table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
                    <div class="commonQuery">
                        <%--<div class="layui-item layui-col-sm6">
                            <label class="layui-form-label">展示方式：</label>
                            <div class="layui-input-block">
                                <input type="radio" class="i-checks" name="" checked id="ext" value="0">
                                <label for="ext">按部门</label>
                                <input type="radio" class="i-checks" name="" id="ext1" value="1">
                                <label for="ext1">按月份</label>
                            </div>
                        </div>--%>

                        <div class="layui-item query athird">
                            <label class="layui-form-label">开票时间：</label>
                            <div class="layui-input-block">
                                <input id="date" name="date" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon" value="${workInvoiceInfo.date}"/>
                                </input>
                            </div>
                        </div>
                            <div class="layui-item query athird">
                                <label class="layui-form-label"></label>
                                <div class="layui-input-block with-icon">
                                </div>
                            </div>
                        <div class="layui-item athird">
                            <div class="input-group">
                                <a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
                                <button id="searchReset" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>
                                <button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
                            </div>
                        </div>
                        <div style="    clear:both;"></div>
                    </div>
                    <div id="moresees" style="clear:both;display:none;">

                        <div style="clear:both;"></div>
                    </div>
                </form:form>
            </div>
        </div>

        <div class="full-width fl">
            <div class="contentShadow layui-form contentDetails">
                <div class="nav-btns">

                    <shiro:hasPermission name="workreimbursement:workInvoiceCount:export">
                        <table:exportExcel url="${ctx}/workreimbursementcount/workInvoiceCount/exportInfo"></table:exportExcel>
                    </shiro:hasPermission><!-- 导出按钮 -->
                   <%-- <a class="nav-btn nav-btn-refresh" <c:if test="${empty companyId}">style="display: none"</c:if> data-toggle="tooltip" data-placement="left" href="${ctx}/workreimbursementcount/workInvoiceCount/officelist?companyId=${companyId}" title="返回"><i class="glyphicon glyphicon-repeat"></i>&nbsp;返回</a>--%>
                    <c:choose>
                        <c:when test="${not empty backState}">
                            <a class="nav-btn nav-btn-refresh" onClick="javascript :history.back(-1);"  data-toggle="tooltip" data-placement="left" title="返回"><i class="glyphicon glyphicon-repeat"></i>&nbsp;返回</a>
                        </c:when>
                    </c:choose>
                    <div style="clear: both;"></div>
                </div>
                <table class="oa-table layui-table" id="contentTable"></table>

                <!-- 分页代码 -->
                <table:page page="${page}"></table:page>
                <div style="clear: both;"></div>
            </div>
        </div>
    </div>
    <div id="changewidth"></div>
</div>
<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
<script>
    layui.use('table', function(){
        layui.table.render({
             limit:${ page.pageSize }
            ,elem: '#contentTable'
            ,page: false
            ,cols: [[
                {field:'invoiceCode',align:'center', minWidth:150, title: '发票代码', templet:function(d){
                        return "<span title='"+ d.invoiceCode +"'>" + d.invoiceCode + "</span>";
                    }},
                {field:'number',align:'center', title: '发票编号',templet:function(d){
                        return "<span title='"+ d.number +"'>" + d.number + "</span>";
                    }}
                ,
                {field:'totalMoney',align:'center', title: '价税合计',templet:function(d){
                        return "<span title='"+ d.totalMoney +"'>" + d.totalMoney + "</span>";
                    }}
                ,
                {field:'incomeMoney',align:'center', title: '累计登记金额',templet:function(d){
                        return "<span title='"+ d.incomeMoney +"'>" + d.incomeMoney + "</span>";
                    }}
                ,
                {field:'date',align:'center', title: '开票日期',templet:function(d){
                        return "<span title='"+ d.date +"'>" + d.date + "</span>";
                    }}
                ,
                {field:'clientName',align:'center', title: '实际开票单位',templet:function(d){
                        return "<span title='"+ d.clientName +"'>" + d.clientName + "</span>";
                    }}
                ,{field:'state',align:'center', title: '发票状态',templet:function(d){
                        return "<span title='"+ d.state +"'>" + d.state + "</span>";
                    }}
                ,{field:'backSign', align:'center',title: '被退标记', templet:function(d){
                        return "<span title='"+ d.backSign +"'>" + d.backSign + "</span>";
                    }}
                ,{field:'contractNum',align:'center', title: '合同编号', templet:function(d){
                        return "<span title='"+ d.contractNum +"'>" + d.contractNum + "</span>";
                    }}
                ,{field:'contractName',align:'center', title: '合同名称', templet:function(d){
                        return "<span title='"+ d.contractName +"'>" + d.contractName + "</span>";
                    }}
            ]]
            ,data: [
                <c:if test="${ not empty page.list}">
                <c:forEach items="${page.list}" var="workInvoiceInfo" varStatus="index">
                <c:if test="${index.index != 0}">,</c:if>
                {
                    "id":"${workInvoiceInfo.id}"
                    ,"invoiceCode":"${workInvoiceInfo.invoiceCode}"
                    ,"number":"${workInvoiceInfo.number}"
                    ,"totalMoney":"<fmt:formatNumber value="${workInvoiceInfo.totalMoney}" pattern="#,#00.00"/>"
                    ,"incomeMoney":"<fmt:formatNumber value="${workInvoiceInfo.incomeMoney}" pattern="#,#00.00"/>"
                    ,"date":"${workInvoiceInfo.date}"
                    ,"clientName":"${workInvoiceInfo.clientName}"
                    ,"state":"${workInvoiceInfo.state}"
                    ,"backSign":"${workInvoiceInfo.backSign}"
                    ,"contractNum":"${workInvoiceInfo.contractNum}"
                    ,"contractName":"${workInvoiceInfo.contractName}"
                }
                </c:forEach>
                </c:if>
            ]
        });

    })

    resizeListTable();
</script>
<script>
    resizeListWindow1();
    $(window).resize(function(){
        resizeListWindow1();
    });
</script>
<script type="text/javascript">
    $(document).ready(function() {
        $("#cus_name").show();
        $("#cus_name").siblings().hide();
        //搜索框收放
        $('#moresee').click(function(){
            if($('#moresees').is(':visible'))
            {
                $('#moresees').slideUp(0,resizeListWindow1);
                $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
            }else{
                $('#moresees').slideDown(0,resizeListWindow1);
                $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
            }
        });

        laydate.render({
            elem: '#date', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
            event: 'focus', //响应事件。如果没有传入event，则按照默认的click
            type : 'year'
        });
    });
    function switchInput(obj){
        $("#"+obj).show();
        $("#"+obj).siblings().hide();
    }


</script>
</body>
</html>
