verify.html 9.91 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">
            <div class="col-sm-12 select-info">
                <form id="inventoryMaterialSummary-form">
                    <div class="select-list">
                        <ul>
                            <li>
                                仓库:<input id="warehouseCode" type="text" name="warehouseCode"
                                          th:value="${warehouseCode}" readonly="readonly"/>
                            </li>
<!--                            <li>-->
<!--                                货主:-->
<!--                                <select id="companyCode" name="companyCode" th:with="list=${@companyService.getCode()}">-->
<!--                                    <option value="">所有</option>-->
<!--                                    <option th:each="item : ${list}" th:text="${item['name']}"-->
<!--                                            th:value="${item['code']}" th:attr=" code = ${item['code']}"></option>-->
<!--                                </select>-->
<!--                            </li>-->
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="makesearch()"><i
                                        class="fa fa-search"></i>&nbsp;搜索</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-info">
                <ul id="myTab" class="nav nav-tabs">
                    <li id="tap1" class="active"><a href="#locationStatus" data-toggle="tab">校验库位状态</a></li>
                    <li id="tap2"><a href="#locationContainer" data-toggle="tab">校验库位上的容器</a></li>
                    <li id="tap3"><a href="#task" data-toggle="tab">校验任务</a></li>
                </ul>
                <div id="myTabContent" class="tab-content">
                    <div class="tab-pane fade in active" id="locationStatus">
                        <table id="bootstrap-table1"
                               class="table table-bordered table-hover text-nowrap"></table>
                    </div>
                    <div class="tab-pane fade" id="locationContainer">
                        <table id="bootstrap-table2"
                               data-mobile-responsive="true"
                               class="table table-bordered table-hover text-nowrap"></table>
                    </div>
                    <div class="tab-pane fade" id="task">
                        <table id="bootstrap-table3"
                               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 + "tool/verify";

        //校验库位状态表
        $(function () {
            let options = {
                contentType: "application/x-www-form-urlencoded",   // 编码类型
                modalName: "校验库位状态",
                sortable: true,
                iconSize: "outline",
                showRefresh: true, //刷新
                showToggle: true, //视图切换
                showColumns: true, //列选择
                showExport: true, //导出
                exportDataType: "all",  //导出类型basic', 'all', 'selected'.当前页、所有数据、选中数据
                search: false,
                pagination: false,
                sidePagination: "server",
                responseHandler: responseHandler,
                columns: [
                    {
                        field: 'localLocation',
                        title: '本地库位编号 ',
                        visible: true
                    },
                    {
                        field: 'localContain',
                        title: '本地容器编号',
                        visible: true
                    },
                    {
                        field: 'localLocationStatus',
                        title: '本地库位状态',
                        visible: true
                    },
                    {
                        field: 'contrastLocationStatus',
                        title: '对照库位状态',
                        visible: true
                    }
                ]
            };
            $("#bootstrap-table1").bootstrapTable(options);
        });

        //校验库位上的容器表
        $("#bootstrap-table2").bootstrapTable({
            sortable: true,
            iconSize: "outline",
            showRefresh: true, //刷新
            showToggle: true, //视图切换
            showColumns: true, //列选择
            showExport: true, //导出
            exportDataType: "all",  //导出类型basic', 'all', 'selected'.当前页、所有数据、选中数据
            search: false,
            pagination: false,
            sidePagination: "server",
            modalName: "校验库位上的容器",
            contentType: "application/x-www-form-urlencoded",
            //页面渲染
            responseHandler: responseHandler,
            columns: [
                {
                    field: 'localLocation',
                    title: '本地库位编号',
                    visible: true
                },
                {
                    field: 'localContain',
                    title: '本地容器编号',
                    visible: true
                },
                {
                    field: 'contrastLocation',
                    title: '对照库位编号',
                    visible: true
                },
                {
                    field: 'contrastContain',
                    title: '对照容器编号',
                    visible: true
                }
            ]
        });

        //任务表
        $("#bootstrap-table3").bootstrapTable({
            iconSize: "outline",
            sortable: true,
            showRefresh: true, //刷新
            showToggle: true, //视图切换
            showColumns: true, //列选择
            showExport: true, //导出
            modalName: "校验任务",
            pagination: false,
            sidePagination: "server",
            contentType: "application/x-www-form-urlencoded",
            //页面渲染
            responseHandler: responseHandler,
            columns: [
                {
                    field: 'localId',
                    title: '本地任务id',
                    visible: true
                },
                {
                    field: 'localContainerCode',
                    title: '本地容器编号',
                    visible: true
                },
                {
                    field: 'localTaskStatus',
                    title: '本地任务状态',
                    visible: true
                },
                {
                    field: 'contrastId',
                    title: '对照任务id',
                    visible: true
                },
                {
                    field: 'contrastTaskStatus',
                    title: '对照任务状态',
                    visible: true
                }
            ]
        });

        function makesearch() {
            if ($("#tap1").hasClass("active")){
                var params = {}
                params.url = prefix+"/locationStatusList"
                params.method = "get"
                $("#bootstrap-table1").bootstrapTable('refresh', params);

            }else if ($("#tap2").hasClass("active")){
                var params = {}
                params.url = prefix+"/locationWithContainerList"
                params.method = "get"
                $("#bootstrap-table2").bootstrapTable('refresh', params);

            }else if ($("#tap3").hasClass("active")){
                var params = {}
                params.url = prefix+"/taskStatuslist"
                params.method = "get"
                $("#bootstrap-table3").bootstrapTable('refresh', params);

            }else {
                alert("error")
            }
        }

        /*__________*/

        function open(title, url, width, height) {
            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {
                width = 'auto';
                height = 'auto';
            }
            if (title == null) {
                title = false;
            }
            if (url == null) {
                url = "404.html";
            }
            if ($.common.isEmpty(width)) {
                width = 800;
                // width = ($(window).width() - 100);
            }
            if ($.common.isEmpty(height)) {
                height = ($(window).height() - 50);
            }
            layer.open({
                type: 2,
                area: [width + 'px', height + 'px'],
                fix: false,
                //不固定
                maxmin: true,
                shade: 0.3,
                title: title,
                content: url
                // shadeClose: true, //点击遮罩关闭层
            })
        }

        function responseHandler(res) {
            if (res.code == 200) {
                $.modal.msgSuccess(res.msg)
                return {rows: res.data, total: res.data.length, code: 0};
            } else {
                $.modal.alertWarning(res.msg);
                return {rows: [], total: 0};
            }
        }

        function queryParams(params) {
            var curParams = {
                // 传递参数查询参数
                // warehouseCode: $('#warehouseCode').val(),
            };
            return curParams;
        }

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