<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal">
        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
    <h4 class="modal-title">备注</h4>
</div>
<form id="form" class="form-horizontal">
    <input type="hidden" name="id" value="<?= $withdraw['id'] ?>">
    <div class="modal-body">
        <div class="input-group">
            <span class="input-group-addon">备注</span>
            <input id="memo" name="memo" type="text" class="form-control" placeholder="备注" value="<?= $withdraw['memo'] ?>">
        </div>
        <div class="hr-line-dashed"></div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
        <button id="submit" type="button" class="btn btn-primary">提交</button>
    </div>
</form>
<script type="text/javascript">
    $("#submit").on("click", function () {
        $.ajax({
            type: "POST",
            url: "<?= \yii\helpers\Url::to(['memo-update']) ?>",
            data: $('#form').serialize(),
            dataType: "json",
            beforeSend: function () {
            },
            success: function (data) {
                if (data.isSuccess) {
                    $("#modal").modal("hide");
                    table.ajax.reload();
                } else {
                    toastr.error(data.msg, "提示");
                }
            },
            complete: function (XMLHttpRequest, textStatus) {
            },
            error: function () {
            }
        });
    });
</script>
