<!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="productName" id="productName" 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="productCode" id="productCode" 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="returnOrderNumber" id="returnOrderNumber" 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="specification" id="specification" 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="productionBatchNumber" id="productionBatchNumber" 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="batch" id="batch" 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="unit" id="unit" 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="manufacturer" id="manufacturer" 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="costAmount" id="costAmount" 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="creationDate" id="creationDate" 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="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="returner" id="returner" 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 productName = $("input[name='productName']").val();
           var productCode = $("input[name='productCode']").val();
           var returnOrderNumber = $("input[name='returnOrderNumber']").val();
           var specification = $("input[name='specification']").val();
           var productionBatchNumber = $("input[name='productionBatchNumber']").val();
           var batch = $("input[name='batch']").val();
           var returnQuantity = $("input[name='returnQuantity']").val();
           var unit = $("input[name='unit']").val();
           var manufacturer = $("input[name='manufacturer']").val();
           var costAmount = $("input[name='costAmount']").val();
           var creationDate = $("input[name='creationDate']").val();
           var returnDate = $("input[name='returnDate']").val();
           var returner = $("input[name='returner']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "kc/skcbbreturnorderitems/sKcBbReturnorderitemsAdd",
            data : {
                "productName": productName,
                "productCode": productCode,
                "returnOrderNumber": returnOrderNumber,
                "specification": specification,
                "productionBatchNumber": productionBatchNumber,
                "batch": batch,
                "returnQuantity": returnQuantity,
                "unit": unit,
                "manufacturer": manufacturer,
                "costAmount": costAmount,
                "creationDate": creationDate,
                "returnDate": returnDate,
                "returner": returner,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
