checkHeader.html 10 KB
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">

<div class="container-div">
    <div class="row">
        <div class="col-sm-12 select-info">
            <ul id="myTab" class="nav nav-tabs">
                <li class="active"><a href="#tabHeader" data-toggle="tab">主表</a></li>
                <li><a href="#tabDetail" data-toggle="tab">明细</a></li>
                <li><a href="#registration" data-toggle="tab" onclick="createTableRegistration()">质检登记</a></li>
            </ul>
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane fade in active" id="tabHeader">
                    <div class="col-sm-12 select-info">
                        <form id="receiptHeader-form">
                            <div class="select-list">
                                <ul>
                                    <li>
                                        编码:<input type="text" name="code"/>
                                    </li>
                                    <li>
                                        入库单编码:<input type="text" name="referCode">
                                    </li>
                                    <li>状态:
                                       <select name="lastStatus">
                                            <option value="">所有</option>
                                            <option value="0">新建</option>
                                       </select>
                                    </li>
                                    <li class="time">
                                        <label>创建时间: </label>
                                        <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[createdBegin]"/>
                                        <span>-</span>
                                        <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[createdEnd]"/>
                                    </li>
                                    <li>
                                        <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                    </li>
                                </ul>
                            </div>
                        </form>
                    </div>
                    <div class="btn-group hidden-xs" id="toolbar" role="group">
                        <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()"
                           shiro:hasPermission="receipt:receiptHeader:add">
                            <i class="fa fa-plus"></i> 新增
                        </a>
                        <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()"
                           shiro:hasPermission="receipt:receiptHeader:remove">
                            <i class="fa fa-trash-o"></i> 删除
                        </a>
                    </div>
                    <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
                </div>

                <div class="tab-pane fade" id="tabDetail">
                    <table id="bootstrap-table1" data-mobile-responsive="true"
                           class="table table-bordered table-hover"></table>
                </div>

                <div class="tab-pane fade" id="registration">
                    <table id="bootstrap-table2" data-mobile-responsive="true"
                           class="table table-bordered table-hover"></table>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var prefix = ctx + "check/checkHeader";
    var prefix1 = ctx + "check/checkDetail";
    var prefix2 = ctx + "check/checkingRegister";
    var editFlag = [[${@permission.hasPermi('check:checkHeader:edit')}]];
    var removeFlag = [[${@permission.hasPermi('check:checkHeader:remove')}]];
    var receiptTypes = [[${@receiptTypeService.getType()}]];
    var checkHeaderStatus = [[${@dict.getType('checkHeaderStatus')}]];
    var printFlag = [[${@permission.hasPermi('check:checkHeader:report')}]];
    var addFlag= [[${@permission.hasPermi('check:checkHeader:add')}]];
    var datas = [[${@dict.getType('sys_normal_disable')}]];
    var type = [[${@dict.getType('checkType')}]];
    var checkId = 0;
    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            queryParams: queryParams,
            modalName: "流程",
            search: false,
            sortName: "id",
            sortOrder: "desc",
            columns: [{
                checkbox: true
            },
                {
                    field : 'id',
                    title : '入库单id'
                },
                {
                    field : 'code',
                    title : '编码'
                },
                {
                    field : 'type',
                    title : '质检类型',
                    align: 'center',
                    formatter: function(value, row, index) {
                            var actions = [];
                            $.each(type, function(index, dict) {
                                if (dict.remark == value) {
                                    actions.push("<span class='badge badge-" + dict.listClass + "'>" + dict.dictLabel + "</span>");
                                    return false;
                                }
                            });
                            return actions.join('');
                    }
                },
                {
                    field : 'referCode',
                    title : '关联单号'
                },
                {
                    field : 'referPlatform',
                    title : '关联平台'
                },
                {
                    field : 'enable',
                    title : '是否有效',
                    align: 'center',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(datas, value);
                    }
                },
                {
                    field : 'status',
                    title : '状态',
                    align: 'center',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(checkHeaderStatus, value);
                    }
                },
                {
                    field : 'closedBy',
                    title : '关闭人'
                },
                {
                    field : 'closedAt',
                    title : '关闭日期'
                },
                {
                    field : 'created',
                    title : '创建时间',
                    sortable:true,
                    visible:false
                },
                {
                    field : 'createdBy',
                    title : '创建用户',
                    visible:false
                },
                {
                    field : 'lastUpdated',
                    title : '最后修改时间',
                    sortable:true,
                    visible:false
                },
                {
                    field : 'lastUpdatedBy',
                    title : '更新用户',
                    visible:false
                },
                {
                    field : 'userDef1',
                    title : '自定义字段1',
                    visible: false
                },
                {
                    field : 'userDef2',
                    title : '自定义字段2',
                    visible: false
                },
                {
                    field : 'userDef3',
                    title : '自定义字段3' ,
                    visible: false
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });

    function detail(id, code) {
        checkId = id;
        var url = prefix1+"/" + id;
        createtable(url);
    }

    function createtable(url) {
        $("#tabDetail").children().remove();
        $("#myTab li").removeClass("active");
        var height = $(document).height()-100 + 'px';
        var str = '<iframe class="huaheng_iframe" name="iframe" width="100%" height="' + height + '" src="' + url + '" frameborder="0" data-id="' + url + '" seamless></iframe>';
        $("#tabDetail").append(str);
        $(".tab-pane").removeClass("in active");
        $("#myTab li:eq(1)").addClass("active");
        $("#tabDetail").addClass("in active");
    }

    function createTableRegistration() {
        url = prefix2+"/"+checkId;
        $("#registration").children().remove();
        $("#myTab li").removeClass("active");
        var height = $(document).height()-100 + 'px';
        var str = '<iframe class="huaheng_iframe" name="iframe" width="100%" height="' + height + '" src="' + url + '" frameborder="0" data-id="' + url + '" seamless></iframe>';
        $("#registration").append(str);
        $(".tab-pane").removeClass("in active");
        $("#myTab li:eq(1)").addClass("active");
        $("#registration").addClass("in active");
    }

    function queryParams(params) {
        return {
            type:[[${type}]]
        };
    };



</script>
</body>
</html>