<!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="memberCardNo" id="memberCardNo" 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="memberName" id="memberName" 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="phoneNumber" id="phoneNumber" 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="pickupStore" id="pickupStore" 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="remainingPoints" id="remainingPoints" 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="pointsAdjustment" id="pointsAdjustment" 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="pointsAdjustmentReason" id="pointsAdjustmentReason" 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="pointsChangeTime" id="pointsChangeTime" 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 memberCardNo = $("input[name='memberCardNo']").val();
           var memberName = $("input[name='memberName']").val();
           var phoneNumber = $("input[name='phoneNumber']").val();
           var pickupStore = $("input[name='pickupStore']").val();
           var remainingPoints = $("input[name='remainingPoints']").val();
           var pointsAdjustment = $("input[name='pointsAdjustment']").val();
           var pointsAdjustmentReason = $("input[name='pointsAdjustmentReason']").val();
           var pointsChangeTime = $("input[name='pointsChangeTime']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "hygl/shygljfglmemberpointsinfo/sHyglJfglMemberpointsinfoAdd",
            data : {
                "memberCardNo": memberCardNo,
                "memberName": memberName,
                "phoneNumber": phoneNumber,
                "pickupStore": pickupStore,
                "remainingPoints": remainingPoints,
                "pointsAdjustment": pointsAdjustment,
                "pointsAdjustmentReason": pointsAdjustmentReason,
                "pointsChangeTime": pointsChangeTime,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
