loadingConfirmed.html 8.66 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="containerCode" type="text" name="containerCode" />
                            </li>
                            <li>
                                库位号:<input id="locationCode" type="text" name="locationCode" />
                            </li>
                            <li>
                                <!--入库类型:<input type="text" name="sourceCode"/>-->
                                状态:<select name="state" id="state">
                                <option value="">所有</option>
                                <option  th:text="成功" th:value="200"></option>
                                <option  th:text="失败" th:value="400"></option></select>
                            </li>

                            <li>
                                wms订单号:<input id="shipmentHeaderCode" type="text" name="shipmentHeaderCode" />
                            </li>
                            <li>
                                上游单号:<input id="referCode" type="text" name="referCode" />
                            </li>
                            <li>
                                操作人:<input id="operator" type="text" name="operator" />
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            </li>
                            <li>
                                <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 hidden-xs" id="toolbar" role="group">
            </div>
            <div class="col-sm-12 select-info">
                <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
            </div>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var prefix = ctx + "inventory/loadingConfirmed";
    var zone =[[${@zone.getCode()}]];
    var company =[[${@companyService.getCode()}]];
    var unit =[[${@unit.codeConversion()}]];
    var stateType = [[${@dict.getType('stateType')}]];

    $(function () {
        let options = {
            url: prefix + "/list",
            contentType: "application/x-www-form-urlencoded",   // 编码类型
            method: 'post',                                     // 请求方式(*)
            modalName: "库存汇总",
            sortStable: true,
            sortName: "materialCode",
            sortOrder: "asc",
            search: false,
            showSearch: false,
            showRefresh: true,
            refresh:true,
            showToggle: false,
            showColumns: false,
            showExport: true,                                   //导出
            exportDataType: "all",                              //导出类型basic', 'all', 'selected'.当前页、所有数据、选中数据
            detailView: true,
            pagination: true,
            sidePagination: "client",                          //前端分页
            queryParams : queryParams,
            onExpandRow : function(index, row, $detail) {
                detailChildTable(index, row, $detail);
            },
            responseHandler: function (res) {
                return res;
            },
            columns: [
                {
                    radio: true
                },
                {
                    field: 'shipmentHeaderCode',
                    title: '出库单号'
                },
                {
                    field: 'referCode',
                    title: '上游单号'
                },
                {
                    field: 'qty',
                    title: '总数'
                }
            ]
        };
        $("#bootstrap-table").bootstrapTable(options);
    });

    //子表
    detailChildTable = function(index, row, $detail) {
        let childTable = $detail.html('<table style="table-layout:fixed"></table>').find('table');
        $(childTable).bootstrapTable({
            url: prefix + "/detailList",
            method: 'post',
            sortName: "id",
            sortOrder: "desc",
            sidePagination: "server",
            contentType: "application/x-www-form-urlencoded",
            //页面渲染
            responseHandler: responseHandler,
            queryParams : {
                //传值
                code : row.shipmentHeaderCode,
            },
            columns: [
                {
                    field: 'id',
                    title: 'ID',
                    align: 'center',
                    width: 40
                },
                {
                    field: 'containerCode',
                    title: '容器编码',
                    visible: true,
                    align: 'center',
                    width: 150
                },
                {
                    field: 'locationCode',
                    title: '库位编码',
                    visible: true,
                    align: 'center',
                    width: 150
                },
                {
                    field: 'qty',
                    title: '数量',
                    visible: true,
                    align: 'center',
                    width: 50
                },
                {
                    field: 'state',
                    title: '状态',
                    align: 'center',
                    width: 50,
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(stateType, value);
                    }
                },
                {
                    field: 'shipmentHeaderId',
                    title: '出库单头ID',
                    align: 'center',
                },
                {
                    field: 'shipmentHeaderCode',
                    align: 'center',
                    title: 'WMS订单号',
                },

                {
                    field: 'referCode',
                    title: 'K3订单号',
                    align: 'center',
                },
                {
                    field: 'operatingTime',
                    title: '操作时间',
                    align: 'center',
                },
                {
                    field: 'operator',
                    title: '操作人',
                    align: 'center',
                },
                {
                    field: 'msg',
                    title: '错误信息',
                    align: 'center',
                },
            ]
        });
    };

    /*__________*/

    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) {
            return { rows: res.data, total: res.total, code: 0};
        } else {
            $.modal.alertWarning(res.msg);
            return { rows: [], total: 0 };
        }
    }


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

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