<!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">商品名称:</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">商品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">MDM商品编码:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="mdmProductCode" id="mdmProductCode" 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="price" id="price" 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="productType" id="productType" 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="stock" id="stock" 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="productCategory" id="productCategory" 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="auditStatus" id="auditStatus" 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="status" id="status" 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="creationTime" id="creationTime" 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 productName = $("input[name='productName']").val();
           var productId = $("input[name='productId']").val();
           var mdmProductCode = $("input[name='mdmProductCode']").val();
           var price = $("input[name='price']").val();
           var productType = $("input[name='productType']").val();
           var stock = $("input[name='stock']").val();
           var productCategory = $("input[name='productCategory']").val();
           var auditStatus = $("input[name='auditStatus']").val();
           var status = $("input[name='status']").val();
           var creationTime = $("input[name='creationTime']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "fwgl/sfwglserverinfo/sFwglServerinfoAdd",
            data : {
                "productName": productName,
                "productId": productId,
                "mdmProductCode": mdmProductCode,
                "price": price,
                "productType": productType,
                "stock": stock,
                "productCategory": productCategory,
                "auditStatus": auditStatus,
                "status": status,
                "creationTime": creationTime,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
