<!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="beginTime" placeholder="开始时间" name="beginTime" required="required"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime" required="required"/>
                            </li>
                            <li>
                                <label>	工位代码：</label>
                                <select name="substation.TableName" id="tableName" required>
                                    <option th:each="ls : ${list}" th:text="${ls.StationCode}" th:value="${ls.TableName}"></option>
                                </select>
                            </li>
                            <li>
                                托盘RFID码：
                                <input type="text" name="rfidNO" id="rfidno"/>
                            </li>
                            <li>
                                <label>	部件码：</label>
                                <input type="text" class="text-input" id="productBarcode" name="productBarcode"/>
                            </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:WorkTrayHistoryInfo:export"><i class="fa fa-download"></i> 导出</a>-->
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
<!--            <div class="btn-group-sm" id="toolbar" role="group">-->
<!--                <li>-->
<!--                    <label>总数量：</label>-->
<!--                    <input type="text" name="count" th:value="${count}" readonly/>-->
<!--                </li>-->
<!--                <li>-->
<!--                    <label>合格数量：</label>-->
<!--&lt;!&ndash;                    <input type="text" name="okNum" th:field="*{okNum}" readonly/>&ndash;&gt;-->
<!--                </li>-->
<!--                <li>-->
<!--                    <label>合格率：</label>-->
<!--&lt;!&ndash;                    <input type="text" name="okRate" th:field="*{okRate}" readonly/>&ndash;&gt;-->
<!--                </li>-->
<!--            </div>-->
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
     <th:block th:include="include :: bootstrap-table-export-js" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('nanjing:WorkTrayHistoryInfo:edit')}]];
        var removeFlag = [[${@permission.hasPermi('nanjing:WorkTrayHistoryInfo:remove')}]];
        var datas = [[${@dict.getType('proState')}]];
        var prefix = ctx + "nanjing/WorkTrayHistoryInfo";
        $(function() {
            var options = {
                url: prefix + "/searchPara",
                exportUrl: prefix + "/export",
                showExport: true,//工具栏上显示导出按钮
                modalName: "工位历史生产信息",
                // datas:formData,
                showExport: true,//工具栏上显示导出按钮
                exportOptions: {
                    ignoreColumn: false  //忽略第一列和最后一列
                },
                columns: [
                    {
                        field: 'substation.stationCode',
                        title: '工位码'
                    },
                    {
                        field: 'stationpara.rfidNO',
                        title: '托盘条码'
                    },
                    {
                        field: 'stationpara.barcode',
                        title: '系统条码'
                    },
                    {
                        field: 'barcoderelationship.productBarcode',
                        title: '部件码'
                    },
                    {
                        field: 'stationpara.state',
                        title: '状态',
                        formatter: function(value, row, index) {
                            return $.table.selectDictLabel(datas, value);
                        }
                    },
                    // {
                    //     field : 'count',
                    //     title : '合格率',
                    //     footerFormatter:function (value) {
                    //         var count = 0;
                    //         var okNUm = 0;
                    //         for (var i in value) {
                    //             console.log(i.toString());
                    //             count +=1;
                    //             // sumBalance += parseFloat(value[i].userBalance);
                    //         }
                    //         return "总数量：" + count;
                    //     }
                    // },
                    {
                        field: 'stationpara.insertTime',
                        title: '记录时间'
                    },
                    ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>