add.html 2.45 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 :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-detail-add" th:object="${vehicleHeader}">
        <input th:field="*{id}" type="hidden" >
        <div class="form-group">
            <label class="col-sm-3 control-label">物料编码
</label>
            <div class="col-sm-8">
                <input name="code" class="form-control" type="text">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">数量
</label>
            <div class="col-sm-8">
                <input name="qty" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">物料类型:</label>
            <div class="col-sm-8">
                <input name="type" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">出库口
</label>
            <div class="col-sm-8">
                <select name="port" class="form-control m-b"  th:with="list=${@Material.getSpec2()}">
                    <option th:each="item : ${list}" th:text="${item['code']}" th:value="${item['code']}" th:attr = " code = ${item['code']}"></option>
                </select>
            </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"/>
<th:block th:include="include :: datetimepicker-js"/>
<script type="text/javascript">

    var prefix = ctx + "system/modelDetail";
    $("#form-detail-add").validate({
        rules:{
            id:{
                required:true
            }
        },
        submitHandler: function(form) {
            let tableValue = $("#form-detail-add").serialize();
            $.operate.save(prefix + "/add", tableValue);
        }
    });

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