overStation.html 3.99 KB
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head>
    <th:block th:include="include :: header"/>
    <th:block th:include="include :: select2-css"/>
    <script src="/wms/js/jquery.min.js"></script>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-task-overStation">
        <div class="col-sm-12">
            <ul class="select-list">
                <li>
                    <label>载具编码:</label>
                    <input id="containerCode" name="containerCode" placeholder="请扫描或输入载具编码" class="form-control">
                </li>
                <li>
                    <label>盛具编码:</label>
                    <input id="vehicleCode" name="vehicleCode" placeholder="请扫描或输入盛具编码" class="form-control">
                </li>
                <!--            <ul class="select-list">-->
                <li>
                    <label>上料口:</label>
                    <select name="fromPort" id="fromPort" class="form-control">
                    </select>
                </li>
                <!--            </ul>-->
                <!--            <ul class="select-list">-->
                <li>
                    <label>工位站点:</label>
                    <select name="toPort" id="toPort" class="form-control">
                    </select>
                </li>
                <!--            </ul>-->
            </ul>
        </div>
        <div class="form-group">
            <div class=" col-sm-offset-9" style="margin-left:62%; margin-top: 20%">
                <button type="submit" class="btn btn-primary">提交</button>
                <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<script type="text/javascript">
    var prefix = ctx + "inventory/inventoryHeader"
    $("#form-task-overStation").validate({
        rules: {
            // containerCode: {
            //     required: true
            // },
            // vehicleCode: {
            //     required: true
            // },
            // fromPort: {
            //     required: true,
            // },
            // toPort: {
            //     required: true,
            // }
        },
        submitHandler: function () {
            if ($('#fromPort').val() == null || $('#fromPort').val() == undefined || $('#fromPort').val() == ""){
                $.modal.msgWarning("请选择上料口");
            }
            if ($('#toPort').val() == null || $('#toPort').val() == undefined || $('#toPort').val() == ""){
                $.modal.msgWarning("请选择目标工位");
            }
            $.operate.save(prefix + "/overStation", $('#form-task-overStation').serialize());
        }
    });

    $(function () {
        $('#fromPort').select2({
            width: '180',
            placeholder:'请选择',
            allowClear: true,
            cache: true,
            ajax: {
                url: ctx + 'config/station/getDataByType',
                dataType: 'json',
                type: 'post',
                data: function (params) {
                    return {
                        type: "1",
                        port: params.term
                    };
                }
            }
        });

        $('#toPort').select2({
            width: '180',
            placeholder:'请选择',
            allowClear: true,
            cache: true,
            ajax: {
                url: ctx + 'config/station/getDataByType',
                dataType: 'json',
                type: 'post',
                data: function (params) {
                    return {
                        type: "3",
                        port: params.term
                    };
                }
            }
        });
    });
</script>
</body>
</html>