<!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="returnDate" id="returnDate" 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="returnDocumentNumber" id="returnDocumentNumber" 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="orderSource" id="orderSource" 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="originalDocumentNumber" id="originalDocumentNumber" 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="returnType" id="returnType" 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="returnReason" id="returnReason" 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="returnQuantity" id="returnQuantity" 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="actualRefundAmount" id="actualRefundAmount" 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="refundAgent" id="refundAgent" 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="reviewer" id="reviewer" 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="remarks" id="remarks" 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 returnDate = $("input[name='returnDate']").val();
           var returnDocumentNumber = $("input[name='returnDocumentNumber']").val();
           var orderSource = $("input[name='orderSource']").val();
           var originalDocumentNumber = $("input[name='originalDocumentNumber']").val();
           var returnType = $("input[name='returnType']").val();
           var returnReason = $("input[name='returnReason']").val();
           var returnQuantity = $("input[name='returnQuantity']").val();
           var actualRefundAmount = $("input[name='actualRefundAmount']").val();
           var memberName = $("input[name='memberName']").val();
           var refundAgent = $("input[name='refundAgent']").val();
           var reviewer = $("input[name='reviewer']").val();
           var remarks = $("input[name='remarks']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "xsgl/sxsglreturninfo/sXsglReturninfoAdd",
            data : {
                "returnDate": returnDate,
                "returnDocumentNumber": returnDocumentNumber,
                "orderSource": orderSource,
                "originalDocumentNumber": originalDocumentNumber,
                "returnType": returnType,
                "returnReason": returnReason,
                "returnQuantity": returnQuantity,
                "actualRefundAmount": actualRefundAmount,
                "memberName": memberName,
                "refundAgent": refundAgent,
                "reviewer": reviewer,
                "remarks": remarks,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
