<!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="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="returnApplicationNumber" id="returnApplicationNumber" 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="returner" id="returner" 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="warehouseArea" id="warehouseArea" 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="documentStatus" id="documentStatus" 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 returnDocumentNumber = $("input[name='returnDocumentNumber']").val();
           var returnApplicationNumber = $("input[name='returnApplicationNumber']").val();
           var returner = $("input[name='returner']").val();
           var warehouseArea = $("input[name='warehouseArea']").val();
           var documentStatus = $("input[name='documentStatus']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "kc/skccrkthreturn/sKcCrkThReturnAdd",
            data : {
                "returnDocumentNumber": returnDocumentNumber,
                "returnApplicationNumber": returnApplicationNumber,
                "returner": returner,
                "warehouseArea": warehouseArea,
                "documentStatus": documentStatus,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
