<!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 class="select-time">
                            <label>时间区间： </label>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="beginTime"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime"/>
                        </li>
                        <li>
                            <label>机种类型：</label>
                            <select name="productType" th:with="type=${@dict.getType('productType')}">
                                <option value="">全部</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </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>-->
                            <a class="btn btn-info btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="nanjing:Q1Product:export"><i class="fa fa-download"></i> 导出</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "nanjing/StatisticQ1Product";
    $(function() {
        var options = {
            url: prefix + "/Q1list",
            exportUrl: prefix + "/Q1export",
            modalName: "一次合格率统计",
            columns: [
                {
                    field: 'productTp',
                    title: '机种类型'
                },
                {
                    field: 'inputNum',
                    title: '投入量'
                },
                {
                    field: 'okNum',
                    title: '合格品'
                },
                {
                    field:'noNum',
                    title:'不合格品'
                },
                {
                    field:'ero',
                    title:'异常'
                },
                {
                    field: 'allRate',
                    title: '综合合格率',
                }
            ]
        };
        $.table.init(options);
    });
</script>
</body>
</html>