<!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="transactionTime" id="transactionTime" 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="transactionStore" id="transactionStore" 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="cardNumber" id="cardNumber" 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="orderNumber" id="orderNumber" 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="paymentAmount" id="paymentAmount" 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="rechargeAmount" id="rechargeAmount" 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="cashier" id="cashier" 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 transactionTime = $("input[name='transactionTime']").val();
           var transactionStore = $("input[name='transactionStore']").val();
           var cardNumber = $("input[name='cardNumber']").val();
           var orderNumber = $("input[name='orderNumber']").val();
           var paymentAmount = $("input[name='paymentAmount']").val();
           var rechargeAmount = $("input[name='rechargeAmount']").val();
           var cashier = $("input[name='cashier']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "yxgl/syxglczkczkxftransactionrecord/sYxglCzkCzkxfTransactionrecordAdd",
            data : {
                "transactionTime": transactionTime,
                "transactionStore": transactionStore,
                "cardNumber": cardNumber,
                "orderNumber": orderNumber,
                "paymentAmount": paymentAmount,
                "rechargeAmount": rechargeAmount,
                "cashier": cashier,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
