
@{
    ViewData["Title"] = "TotalIncomePay_PayDetail";
    Layout = "~/Pages/Shared/_MainLayout.cshtml";
}

<div class="row">
    <div class="col-sm-12">
        <div class="ibox-content m-b-sm border-bottom">
            <form id="toolbar">
                <div class="form-inline" style="line-height:40px;">
                    <div class="form-group">
                        <label>日期</label>
                        <input id="start" name="start" class="form-control layer-date" style="width:120px;" value="@(ViewBag.date)" placeholder="请填写开始日期" />
                        <input id="end" name="end" class="form-control layer-date" style="width:120px;" value="@(ViewBag.date)" placeholder="请填写结束日期" />
                    </div>
                    <div class="form-group">
                        <label>&nbsp;</label>
                        <button id="btnexport" type="button" class="btn btn-success" onclick="exportlist(1);">导出管理成本支出</button>
                        <button id="btnexport" type="button" class="btn btn-primary" onclick="exportlist(2);">导出利息支出</button>
                        <button id="btnexport" type="button" class="btn btn-success" onclick="exportlist(3);">导出物流费支出</button>
                        <button id="btnexport" type="button" class="btn btn-primary" onclick="exportlist(4);">导出采购成本支出</button>
                        <button id="btnexport" type="button" class="btn btn-success" onclick="exportlist(5);">导出成品采购退货收款</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

@section scripts{ 
    <script>

        $(document).ready(function () {
            laydate.render({ elem: '#start' });
            laydate.render({ elem: '#end' });
        })

        function exportlist (t)
        {
            var start = $('#start').val();
            var end = $('#end').val();

            if (start == '') {
                alert('请选择开始日期');
                return false;
            }

            if (end == '') {
                alert('请选择结束日期');
                return false;
            }

            var url = '@Url.Content("~/Reports/Finance/ExportTotalIncomePay_PayDetail?t=")' + t+'&start='+start+'&end='+end;

            window.open(url, '_blank');
        }
        
    </script>

}

