<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('机构库存表新增')" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-role-add">
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <!--is-required 增加星号 显示为必填-->
                            <label class="col-sm-3 control-label">机构ID:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="organizationId" id="organizationId" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">商品ID:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="productId" id="productId" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">商品名称:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="productName" id="productName" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">商品编码:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="productCode" id="productCode" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">商品类别:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="category" id="category" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">供应商:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="supplier" id="supplier" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">库存数量:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="stockQuantity" id="stockQuantity" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">再订货水平:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="reorderLevel" id="reorderLevel" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">最后库存检查时间:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="lastStockCheckTime" id="lastStockCheckTime" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">最后编辑人:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="lastEditor" id="lastEditor" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">最后编辑时间:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="lastEditTime" id="lastEditTime" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                </div>
            </div>

        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script type="text/javascript">

    function submitHandler() {
        if ($.validate.form()) {
            add();
        }
    }

    function add() {
           var organizationId = $("input[name='organizationId']").val();
           var productId = $("input[name='productId']").val();
           var productName = $("input[name='productName']").val();
           var productCode = $("input[name='productCode']").val();
           var category = $("input[name='category']").val();
           var supplier = $("input[name='supplier']").val();
           var stockQuantity = $("input[name='stockQuantity']").val();
           var reorderLevel = $("input[name='reorderLevel']").val();
           var lastStockCheckTime = $("input[name='lastStockCheckTime']").val();
           var lastEditor = $("input[name='lastEditor']").val();
           var lastEditTime = $("input[name='lastEditTime']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "bbfx/sbbfxkcbbjgkcmx/sBbfxKcbbJgkcmxAdd",
            data : {
                "organizationId": organizationId,
                "productId": productId,
                "productName": productName,
                "productCode": productCode,
                "category": category,
                "supplier": supplier,
                "stockQuantity": stockQuantity,
                "reorderLevel": reorderLevel,
                "lastStockCheckTime": lastStockCheckTime,
                "lastEditor": lastEditor,
                "lastEditTime": lastEditTime,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
