<!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="storeShortName" id="storeShortName" 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="saleDate" id="saleDate" 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="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="retailDocumentNumber" id="retailDocumentNumber" 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="saleQuantity" id="saleQuantity" 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="price" id="price" 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="batchNumber" id="batchNumber" 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="productionDate" id="productionDate" 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="saleAmount" id="saleAmount" 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="approvalNumber" id="approvalNumber" 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="expirationDate" id="expirationDate" 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 storeShortName = $("input[name='storeShortName']").val();
           var saleDate = $("input[name='saleDate']").val();
           var productName = $("input[name='productName']").val();
           var retailDocumentNumber = $("input[name='retailDocumentNumber']").val();
           var manufacturer = $("input[name='manufacturer']").val();
           var saleQuantity = $("input[name='saleQuantity']").val();
           var price = $("input[name='price']").val();
           var batchNumber = $("input[name='batchNumber']").val();
           var productionDate = $("input[name='productionDate']").val();
           var saleAmount = $("input[name='saleAmount']").val();
           var specification = $("input[name='specification']").val();
           var approvalNumber = $("input[name='approvalNumber']").val();
           var expirationDate = $("input[name='expirationDate']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "kc/skcbbretailsales/sKcBbRetailsalesAdd",
            data : {
                "productCode": productCode,
                "storeShortName": storeShortName,
                "saleDate": saleDate,
                "productName": productName,
                "retailDocumentNumber": retailDocumentNumber,
                "manufacturer": manufacturer,
                "saleQuantity": saleQuantity,
                "price": price,
                "batchNumber": batchNumber,
                "productionDate": productionDate,
                "saleAmount": saleAmount,
                "specification": specification,
                "approvalNumber": approvalNumber,
                "expirationDate": expirationDate,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
