<!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">
    <input type="hidden"  id="id" th:value="${state}" class="form-control" readonly/>

     <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>
                                <select  name="laiyuan">
                                    <option></option>
                                    <optgroup  th:each="dict:${qyapply}">
                                        <option  th:tips="${dict}" th:text="${dict}"></option>
                                    </optgroup>
                                </select>
                            </li>

                            <li>
                                <p>法人代表人：</p>
                                <input type="text" name="frname"/>
                            </li>
                            <li>
                                <p>企业名称：</p>
                                <input type="text" name="qyname"/>
                            </li>
                            <li class="select-time">
                                <p>申请日期：</p>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="hangye1"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="hangye2"/>
                            </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">
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" data-mobile-responsive="true"></table>
            </div>
        </div>
    </div>
    <div th:include="include :: footer"></div>

    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:gtgsyw:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:gtgsyw:remove')}]];
        var auditFlag = [[${@permission.hasPermi('system:gtgsyw:audit')}]];
        var giveupFlag = [[${@permission.hasPermi('system:gtgsyw:giveup')}]];
        var prefix = ctx + "company/tenant";
        $(function() {
            var flg=$("#id").val();
            var options = {
                url: prefix + "/company/"+flg,
                createUrl: prefix + "/add",
                viewUrl: prefix + "/qyaudit/{id}",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                giveupUrl: prefix + "/export/{id}",
                modalName: "退回列表",
                sortName: "shenhedate",
                sortOrder: "desc",
                columns: [{
                    checkbox: true
                },

                    {
                        title: '序号',
                        formatter: function (value, row, index) {
                            return $.table.serialNumber(index);
                        }
                    },
                  /*  {
                        field : 'qyId',
                        title : '企业id'
                    },*/
                    {
                        field : 'laiyuan',
                        title : '申请来源'
                    },
                    {
                        field : 'qyname',
                        title : '企业名称'
                    },
                    {
                        field : 'qylx',
                        title : '企业类型',
                       /* formatter: function (value, row, index) {
                            return typesQyLx(row);
                        }*/
                    },
                    {
                        field : 'qyzczj',
                        title : '注册资金(万元)'
                    },
                    {
                        field : 'frname',
                        title : '法定代表人'
                    },
                    {
                        field : 'qyjycs',
                        title : '经营场所'
                    },
                    {
                        field : 'createdate',
                        title : '申请时间'
                    },
                    {
                        field : 'shenhename',
                        title : '审核人'
                    },
                    {
                        field : 'shenhedate',
                        title : '退回时间'
                    },
                    {
                        field : 'shenhenote',
                        title : '退回原因',
                        formatter: function (value, row, index) {
                            return strTools(value);
                        }

                    },

                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs" href="#"  onclick="$.operate.view(\'' + row.id + '\')"><i class="fa fa-edit"></i> 详细</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });

        //退回原因
        function strTools(value) {

            if(value!=null){
                if (value.length > 20) {
                    return value.substr(0, 12) + "...";
                }
            }
            return value;
        }

        /*企业类型*/
        function typesQyLx(row) {
            if (row.qylx == 1) {
                return '<div class="tubiao" >-</div>'
            } else if (row.qylx == 2) {
                return '<div class="tubiao" >有限责任公司(自然人独资)</div>';
            }else if (row.qylx == 3) {
                return '<div class="tubiao" >有限责任公司(自然人独资或控股)</div>';
            }
        }
    </script>



</body>
</html>
