<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改库存管理')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-stock-edit" th:object="${wmsStock}">
            <input name="stockId" th:field="*{stockId}" type="hidden">
            <input name="productId" th:field="*{productId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">产品名称：</label>
                <div class="col-sm-8">
                    <div class="form-control-static" th:text="${wmsStock.product.productName}"></div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">库存数量：</label>
                <div class="col-sm-8">
                    <input name="stockNum" th:field="*{stockNum}" class="form-control" type="text" required>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "crm/stock";
        $("#form-stock-edit").validate({
        	onkeyup: false,
        	rules:{
        		stockNum:{
        			digits:true
        		}
        	},
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-stock-edit').serialize());
            }
        }
    </script>
</body>
</html>