<!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="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="storeName" id="storeName" 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="saleDocumentNumber" id="saleDocumentNumber" 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="member" id="member" 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="cashier" id="cashier" 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="retailPrice" id="retailPrice" 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="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="actualSalePrice" id="actualSalePrice" 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="actualReceiptAmount" id="actualReceiptAmount" 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="estimatedCostAmount" id="estimatedCostAmount" 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="grossProfitAmount" id="grossProfitAmount" 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="cartLineNo" id="cartLineNo" 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="lineQuantity" id="lineQuantity" 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="discountType" id="discountType" 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="discountDocumentNumber" id="discountDocumentNumber" 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="discountSubDocumentNumber" id="discountSubDocumentNumber" 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="discountUnitPrice" id="discountUnitPrice" 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="discountAmount" id="discountAmount" 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="points" id="points" 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 productName = $("input[name='productName']").val();
           var storeName = $("input[name='storeName']").val();
           var saleDate = $("input[name='saleDate']").val();
           var saleDocumentNumber = $("input[name='saleDocumentNumber']").val();
           var member = $("input[name='member']").val();
           var cashier = $("input[name='cashier']").val();
           var retailPrice = $("input[name='retailPrice']").val();
           var batchNumber = $("input[name='batchNumber']").val();
           var batch = $("input[name='batch']").val();
           var actualSalePrice = $("input[name='actualSalePrice']").val();
           var actualReceiptAmount = $("input[name='actualReceiptAmount']").val();
           var estimatedCostAmount = $("input[name='estimatedCostAmount']").val();
           var grossProfitAmount = $("input[name='grossProfitAmount']").val();
           var cartLineNo = $("input[name='cartLineNo']").val();
           var lineQuantity = $("input[name='lineQuantity']").val();
           var discountType = $("input[name='discountType']").val();
           var discountDocumentNumber = $("input[name='discountDocumentNumber']").val();
           var discountSubDocumentNumber = $("input[name='discountSubDocumentNumber']").val();
           var discountUnitPrice = $("input[name='discountUnitPrice']").val();
           var discountAmount = $("input[name='discountAmount']").val();
           var points = $("input[name='points']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "xsgl/sxsglxsmxzkmxsalesdiscountinfo/sXsglXsmxZkmxSalesdiscountinfoAdd",
            data : {
                "productCode": productCode,
                "productName": productName,
                "storeName": storeName,
                "saleDate": saleDate,
                "saleDocumentNumber": saleDocumentNumber,
                "member": member,
                "cashier": cashier,
                "retailPrice": retailPrice,
                "batchNumber": batchNumber,
                "batch": batch,
                "actualSalePrice": actualSalePrice,
                "actualReceiptAmount": actualReceiptAmount,
                "estimatedCostAmount": estimatedCostAmount,
                "grossProfitAmount": grossProfitAmount,
                "cartLineNo": cartLineNo,
                "lineQuantity": lineQuantity,
                "discountType": discountType,
                "discountDocumentNumber": discountDocumentNumber,
                "discountSubDocumentNumber": discountSubDocumentNumber,
                "discountUnitPrice": discountUnitPrice,
                "discountAmount": discountAmount,
                "points": points,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
