stationWX.html 3.8 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"/>


</head>
<link href="/ajax/libs/iCheck/custom.css" th:href="@{/ajax/libs/iCheck/custom.css}" rel="stylesheet"/>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-task-emptyIn">
        <div class="form-group">
            <input type="hidden" value="pickPutway" name="TaskTypes">
            <label class="col-sm-3 control-label"><span style="color:red;">*</span>起点:</label>
            <div class="col-sm-8">
                <select id="fromPos" name="fromPos" class="form-control"
                        th:with="list=${@stationService.getStationWX(2)}">
                    <option value="">所有</option>
                    <option th:each="item : ${list}" th:text="${item['name']}"
                            th:value="${item['code']}" th:attr=" code = ${item['code']}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">终点:</label>
            <div class="col-sm-8">
                <select id="toPos" name="toPos" class="form-control"
                        th:with="list=${@stationService.getStationWX(2)}">
                    <option value="">所有</option>
                    <option th:each="item : ${list}" th:text="${item['name']}"
                            th:value="${item['code']}" th:attr=" code = ${item['code']}"></option>
                </select>

            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">暂停点:</label>
            <div class="col-sm-8">
                <label class="checkbox-inline i-checks" th:each="stop:${@stationService.getStationWX(3)}">
                    <input name="stopPoint" type="checkbox" th:value="${stop.code}" th:text="${stop.code}">
                </label>

            </div>
        </div>

        <div class="form-group">
            <div class="form-control-static col-sm-offset-9">
                <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"/>
<script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
<th:block th:include="include :: select2-js"/>
<script type="text/javascript">


    var prefix = ctx + "api/zarapi"
    $("#form-task-emptyIn").validate({
        rules: {
            containerCode: {
                required: true,
            },
            destinationLocation: {},
        },
        submitHandler: function (form) {
            // $.operate.save(prefix + "/createWXAgvTask", $('#form-task-emptyIn').serialize());
            var stopPoint = $.form.selectCheckeds("stopPoint");
            console.log(stopPoint)
            var param = {
                "fromPos": $("#fromPos").val(),
                "toPos": $("#toPos").val(),
                "stopPoint": stopPoint,

            }
            $.ajax({
                cache: true,
                type: "POST",
                url: prefix + "/createWXAgvTask",
                contentType: "application/json;charset=UTF-8",   // 编码类型
                data: JSON.stringify(param),
                async: false,
                error: function (request) {
                    $.modal.alertError("请求失败!");
                },
                success: function (data) {
                    $.operate.saveSuccess(data);
                }
            });
        }
    });
    $(document).ready(function () {
    })


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