<%--
  Created by IntelliJ IDEA.
  User: DJH
  Date: 2022/5/11
  Time: 10:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>拒绝退款</title>

    <jsp:include page="../../../common.jsp"/>
</head>
<body>
<form class="layui-form" id="form2" style="margin-top: 1rem; width: 80%;" lay-filter="demo1">
    <input name="id" id="id" value="${entity.id}" hidden>
    <div class="layui-form-item" style="width: 350px;">
        <label class="layui-form-label">退款原因</label>
        <div class="layui-input-block">
            <textarea placeholder="退款原因" name="refundReason" id="refundReason" autocomplete="off"
                      class="layui-textarea">${entity.refundReason}</textarea>
        </div>
    </div>
    <div class="layui-form-item refund-status refund-status-2" style="width: 350px;">
        <label class="layui-form-label">驳回原因</label>
        <div class="layui-input-block">
                <textarea placeholder="请输入驳回原因" name="rejectRemark" id="rejectRemark" autocomplete="off"
                          class="layui-textarea"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">确认驳回</button>
        </div>
    </div>
</form>

<script>
    layui.use(['layer', 'form'], function () {
        var form = layui.form;

        form.on('submit(demo1)', function (data) {

            var url = ctx + "/mercOrderDetail/refundReject";

            $.ajax({
                url: ctx + "/mercOrderDetail/refundReject",
                type: 'post',
                data: data.field,
                success: (res) => {
                    parent.layer.msg(res.message)
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);//关闭当前页
                }
            })
            return false;
        });
    })
</script>
</body>
</html>
