<!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="openCardPhone" id="openCardPhone" 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="cardType" id="cardType" 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="balance" id="balance" 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="lastTransactionTime" id="lastTransactionTime" 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="validUntil" id="validUntil" 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 openCardPhone = $("input[name='openCardPhone']").val();
           var cardType = $("input[name='cardType']").val();
           var status = $("input[name='status']").val();
           var balance = $("input[name='balance']").val();
           var lastTransactionTime = $("input[name='lastTransactionTime']").val();
           var validUntil = $("input[name='validUntil']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "yxgl/syxglczkczkglvalueaddedcard/sYxglCzkCzkglValueaddedcardAdd",
            data : {
                "openCardPhone": openCardPhone,
                "cardType": cardType,
                "status": status,
                "balance": balance,
                "lastTransactionTime": lastTransactionTime,
                "validUntil": validUntil,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
