<!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>
                                <label>资源号：</label>
                                <input type="text" name="resource"/>
                            </li>
                            <li>
                                <label>SFC：</label>
                                <input type="text" name="sfcStr"/>
                            </li>
                            <li>
                                <label>MES返回Code：</label>
                                <input type="text" name="isSuccess"/>
                            </li>
                            <li>
                                <label>记录时间：</label>
                                <input type="text" name="recordTime"/>
                            </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()" shiro:hasPermission="traceability:mqupload:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="traceability:mqupload:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="traceability:mqupload:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="traceability:mqupload:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </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 editFlag = [[${@permission.hasPermi('traceability:mqupload:edit')}]];
        var removeFlag = [[${@permission.hasPermi('traceability:mqupload:remove')}]];
        var prefix = ctx + "traceability/mqupload";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                dataUploadUrl: prefix + "/dataUpload",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "模切数据上传",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '主键标识',
                    visible: false
                },
                {
                    field: 'resource',
                    title: '资源号'
                },
                {
                    field: 'sfcStr',
                    title: 'SFC'
                },
                {
                    field: 'operation',
                    title: '工序'
                },
                {
                    field: 'clientId',
                    title: '客户端标识'
                },
                {
                    field: 'dcGroup',
                    title: '数据组'
                },
                {
                    field: 'upDirection',
                    title: '放卷方向'
                },
                {
                    field: 'downDirection',
                    title: '收卷方向'
                },
                {
                    field: 'downPosition',
                    title: '收卷轴'
                },
                {
                    field: 'firstArticle',
                    title: '是否首卷'
                },
                {
                    field: 'mqMaterialFace',
                    title: '物理面向'
                },
                {
                    field: 'jrDirection',
                    title: '卷绕理论方向'
                },
                {
                    field: 'scw',
                    title: 'S面数据'
                },
                {
                    field: 'bcw',
                    title: 'B面数据'
                },
                {
                    field: 'isSuccess',
                    title: 'MES返回Code'
                },
                {
                    field: 'mesReturnInfo',
                    title: 'MES返回信息'
                },
                {
                    field: 'recordTime',
                    title: '记录时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        //dataUpload
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.dataUpload(\'' + row.id + '\')"><i class="fa fa-edit"></i>上传</a> ');
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>