<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('企业打印列表列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                       <!--     <li>
                                <p>唯一标识：</p>
                                <input type="text" name="bsid"/>
                            </li>-->
                            <li>
                                <p>法人,负责人名称：</p>
                                <input type="text" name="frname"/>
                            </li>
                            <li>
                                <p>企业名称：</p>
                                <input type="text" name="qyname"/>
                            </li>
                           <!-- <li>
                                <p>企业类别：</p>
                                <input type="text" name="qylb"/>
                            </li>-->
                           <!--
                            <li class="select-time">
                                <p>成立日期：</p>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginQyclrq]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endQyclrq]"/>
                            </li>
                            -->
                            <li class="select-time">
                                <p>创建时间：</p>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreatedate]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreatedate]"/>
                            </li>
                            <li>
                                <p>来源：</p>
                                <input type="text" name="laiyuan"/>
                            </li>
                            <!--
                            <li class="select-time">
                                <p>领取时间：</p>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginLqdate]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endLqdate]"/>
                            </li>-->
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" >
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.editTab()" shiro:hasPermission="system:pritn:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:pritn:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-primary btn-rounded btn-sm" onclick="qyprint('tabs-3','02')" >
                    <i class="fa fa-download"></i> 窗口收件代办
                 </a>
                <a class="btn btn-primary btn-rounded btn-sm" onclick="qyprint('tabs-4','02')" >
                    <i class="fa fa-download"></i> 全程电子化申请
                 </a>
                <a class="btn btn-primary btn-rounded btn-sm" onclick="qyprint('tabs-7','02')" >
                    <i class="fa fa-download"></i> 一窗通
                 </a>
                <a class="btn btn-primary btn-rounded btn-sm" onclick="qyprint('tabs-3','03')" >
                    <i class="fa fa-download"></i> 窗口收件代办(变更)
                 </a>
                <a class="btn btn-primary btn-rounded btn-sm" onclick="qyprint('tabs-4','03')" >
                    <i class="fa fa-download"></i> 全程电子化申请(变更)
                 </a> <a class="btn btn-primary btn-rounded btn-sm" onclick="qyprint('tabs-5','03')" >
                    <i class="fa fa-download"></i> 网上预申报(变更)
                 </a>
                <!--  <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:pritn:export">
                    <i class="fa fa-download"></i> 导出
                 </a>-->
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" data-mobile-responsive="true"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:pritn:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:pritn:remove')}]];
        var prefix = ctx + "system/qypritn";

        function qyprint(type,typeid){
            opList("数据下载",prefix + "/qylist?type="+type+"&typeid="+typeid);
        }

        // 弹出层全屏
        function opList (title, url, width, height) {
            //如果是移动端，就使用自适应大小弹窗
            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {
                width = 'auto';
                height = 'auto';
            }
            if ($.common.isEmpty(title)) {
                title = false;
            }
            if ($.common.isEmpty(url)) {
                url = "/404.html";
            }
            if ($.common.isEmpty(width)) {
                width = 800;
            }
            if ($.common.isEmpty(height)) {
                height = ($(window).height() - 50);
            }
            var index = layer.open({
                type: 2,
                area: [width + 'px', height + 'px'],
                fix: false,
                //不固定
                maxmin: true,
                shade: 0.3,
                title: title,
                content: url,
                btn: [],
                // 弹层外区域关闭
                shadeClose: true,
                yes: function (index, layero) {
                    var iframeWin = layero.find('iframe')[0];
                    console.log(iframeWin);
                    // console.log($("#"+$(iframeWin).attr("id")+" table").eq(1).attr("id"));
                },
                cancel: function (index) {
                    return true;
                }
            });
        }
        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "企业打印列表",
                sortName: "shenhedate",
                sortOrder: "desc",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'id',
                    title : 'ID',
                    visible: false
                },
                {
                    field : 'frname',
                    title : '法人'
                },
                {
                    field : 'xinyongcode',
                    title : '信用代码'
                },
                {
                    field : 'qyname',
                    title : '企业名称'
                },
                {
                    field : 'qylx',
                    title : '企业类型'
                },
                {
                    field : 'qyclrq',
                    title : '成立日期',
                    sortable: true,
                    sortOrder:"asc"
                },
                {
                    field : 'shenhedate',
                    title : '下载时间',
                    sortable: true,
                    sortOrder:"asc"
                },
                {
                    field : 'shenhename',
                    title : '审核人'
                },
                    {
                        field : 'isprintZ',
                        title : '正本打印',
                        formatter: function (value, row, index) {
                            return value == 0 ? '<span class="btn btn-danger btn-xs" href="javascript:;">未打印</span>': '<span class="btn btn-success btn-xs" href="javascript:;">已打印</span>';
                        }
                    },
                    {
                        field: 'isprintF',
                        title: '副本打印',
                        formatter: function (value, row, index) {
                            return value == 0 ? '<span class="btn btn-danger btn-xs" href="javascript:;">未打印</span>' : '<span class="btn btn-success btn-xs" href="javascript:;">已打印</span>';
                        }
                    },
                {
                    field : 'laiyuan',
                    title : '来源'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="getinfo(\'' + row.zhucehao + '\')"><i class="fa fa-edit"></i>详细</a> ');
                        actions.push('<a class="btn btn-danger btn-xs " href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });


    </script>
<script>
    function getinfo(id){
        console.log(prefix + "/getQyInfo?sqh=" + id);
        options = {
            url: prefix + "/getQyInfo?sqh=" + id+"&type=0&typeid=",
            title: "证照信息",
            btn: ['关闭'],
            yes: function (index, layero) {
                $.table.refresh();
                layer.close(index);
            }
        }
        $.modal.openOptions(options);
    }
</script>
</body>
</html>
