verify.html 11.8 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>
                                查询状态:
                                <select id="sendBack">
                                <option value="0">匹配所有</option>
                                <option value="1">只显示异常</option>
                                </select>
                            </li>

                            <div class="form-group">
                                <label class="col-sm-3 control-label">区域:</label>
                                <div class="col-sm-8">
                                    <select id="alarmType" name="alarmType" class="form-control" th:with="list=${@zone.getZoneCodeList()}">
                                        <option th:each="item : ${list}" th:text="${item['name']}" th:value="${item['code']}"></option>
                                    </select>
                                </div>
                            </div>

                            <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">校验WCS库位和容器</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: 'contrastContain',
                        title: '容器编号',
                        visible: true
                    },
                    {
                        field: 'contrastLocation',
                        title: '容器上的库位',
                        visible: true
                    },
                    {
                        field: 'contrastStatus',
                        title: '容器状态',
                        visible: true
                    },

                    {
                        field: 'localContain',
                        title: '库位上的容器编号',
                        visible: true
                    },
                    {
                        field: 'localLocation',
                        title: '库位编号',
                        visible: true
                    },
                    {
                        field: 'localLocationStatus',
                        title: '库位状态',
                        visible: true
                    } ,
                    {
                        field: 'reason',
                        title: '异常原因',
                        visible: true
                    },
                    {
                        field: 'task',
                        title: '任务',
                        visible: true
                    }
                    ,
                    {
                        field: 'stock',
                        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: 'locationCode',
                    title: '本地库位',
                    visible: true
                },
                {
                    field: 'containerCode',
                    title: '本地容器',
                    visible: true
                },
                {
                    field: 'wcsLocationCode',
                    title: 'WCS库位',
                    visible: true
                },
                {
                    field: 'wcsContainerCode',
                    title: 'WCS容器',
                    visible: true
                },
                {
                    field: 'reason',
                    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: 'id',
                    title: '主表ID',
                    visible: true
                },
                {
                    field: 'locationCode',
                    title: '主表货位',
                    visible: true
                },
                {
                    field: 'containerCode',
                    title: '主表容器',
                    visible: true
                },
                {
                    field: 'containerStatus',
                    title: '主表容器状态',
                    visible: true
                },
                {
                    field: 'totalQty',
                    title: '总数量',
                    visible: true
                },
                {
                    field: 'localContain',
                    title: '子库位',
                    visible: true
                },
                {
                    field: 'zQty',
                    title: '子在库数量',
                    visible: true
                },
                {
                    field: 'taskQty',
                    title: '子在执行数量',
                    visible: true
                },
                {
                    field: 'reason',
                    title: '异常原因',
                    visible: true
                },
                {
                    field: 'task',
                    title: '有没有没完成的任务',
                    visible: true
                }
            ]
        });

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

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

            }else if ($("#tap3").hasClass("active")){
                var params = {}
                params.url = prefix+"/taskStatuslist?id="+$("#sendBack").val()
                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>