<!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="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="genericName" id="genericName" 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="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="salesperson" id="salesperson" 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="refundAmount" id="refundAmount" 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="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="origin" id="origin" 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 productCode = $("input[name='productCode']").val();
           var genericName = $("input[name='genericName']").val();
           var specification = $("input[name='specification']").val();
           var unit = $("input[name='unit']").val();
           var salesperson = $("input[name='salesperson']").val();
           var returnQuantity = $("input[name='returnQuantity']").val();
           var refundAmount = $("input[name='refundAmount']").val();
           var productionBatchNumber = $("input[name='productionBatchNumber']").val();
           var manufacturer = $("input[name='manufacturer']").val();
           var origin = $("input[name='origin']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "xsgl/sxsglreturnproductinfo/sXsglReturnproductinfoAdd",
            data : {
                "productCode": productCode,
                "genericName": genericName,
                "specification": specification,
                "unit": unit,
                "salesperson": salesperson,
                "returnQuantity": returnQuantity,
                "refundAmount": refundAmount,
                "productionBatchNumber": productionBatchNumber,
                "manufacturer": manufacturer,
                "origin": origin,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
