<!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="productId" id="productId" 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="orderStatus" id="orderStatus" 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="marketingCategory" id="marketingCategory" 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="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="dosageForm" id="dosageForm" 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="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="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="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="quantity" id="quantity" 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="discountRate" id="discountRate" 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="receivableAmount" id="receivableAmount" 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="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="authorizer" id="authorizer" 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="saleAttribute" id="saleAttribute" 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="isGift" id="isGift" 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="isDispensed" id="isDispensed" 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="promotionDocumentNumber" id="promotionDocumentNumber" 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="couponCode" id="couponCode" 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="couponAllocationAmount" id="couponAllocationAmount" 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="costRecoveryType" id="costRecoveryType" 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="rebateUnitPrice" id="rebateUnitPrice" 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="rebateAgreementNumber" id="rebateAgreementNumber" 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="rebateSupplier" id="rebateSupplier" 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="estimatedCostUnitPrice" id="estimatedCostUnitPrice" 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="grossProfitUnitPrice" id="grossProfitUnitPrice" 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="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="singleProductDiscountRemark" id="singleProductDiscountRemark" 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="actualPriceRemark" id="actualPriceRemark" 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="entireOrderDiscountRemark" id="entireOrderDiscountRemark" 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="orderRemark" id="orderRemark" 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 productId = $("input[name='productId']").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 orderStatus = $("input[name='orderStatus']").val();
           var specification = $("input[name='specification']").val();
           var marketingCategory = $("input[name='marketingCategory']").val();
           var manufacturer = $("input[name='manufacturer']").val();
           var unit = $("input[name='unit']").val();
           var dosageForm = $("input[name='dosageForm']").val();
           var productionBatchNumber = $("input[name='productionBatchNumber']").val();
           var batchNumber = $("input[name='batchNumber']").val();
           var retailPrice = $("input[name='retailPrice']").val();
           var actualSalePrice = $("input[name='actualSalePrice']").val();
           var quantity = $("input[name='quantity']").val();
           var discountRate = $("input[name='discountRate']").val();
           var receivableAmount = $("input[name='receivableAmount']").val();
           var salesperson = $("input[name='salesperson']").val();
           var cashier = $("input[name='cashier']").val();
           var authorizer = $("input[name='authorizer']").val();
           var saleAttribute = $("input[name='saleAttribute']").val();
           var isGift = $("input[name='isGift']").val();
           var isDispensed = $("input[name='isDispensed']").val();
           var promotionDocumentNumber = $("input[name='promotionDocumentNumber']").val();
           var couponCode = $("input[name='couponCode']").val();
           var couponAllocationAmount = $("input[name='couponAllocationAmount']").val();
           var costRecoveryType = $("input[name='costRecoveryType']").val();
           var rebateUnitPrice = $("input[name='rebateUnitPrice']").val();
           var rebateAgreementNumber = $("input[name='rebateAgreementNumber']").val();
           var rebateSupplier = $("input[name='rebateSupplier']").val();
           var estimatedCostUnitPrice = $("input[name='estimatedCostUnitPrice']").val();
           var grossProfitUnitPrice = $("input[name='grossProfitUnitPrice']").val();
           var discountAmount = $("input[name='discountAmount']").val();
           var actualReceiptAmount = $("input[name='actualReceiptAmount']").val();
           var estimatedCostAmount = $("input[name='estimatedCostAmount']").val();
           var grossProfitAmount = $("input[name='grossProfitAmount']").val();
           var singleProductDiscountRemark = $("input[name='singleProductDiscountRemark']").val();
           var actualPriceRemark = $("input[name='actualPriceRemark']").val();
           var entireOrderDiscountRemark = $("input[name='entireOrderDiscountRemark']").val();
           var orderRemark = $("input[name='orderRemark']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "xsgl/sxsglxsmxspmxsalesdetailinfo/sXsglXsmxSpmxSalesdetailinfoAdd",
            data : {
                "productId": productId,
                "productName": productName,
                "storeName": storeName,
                "saleDate": saleDate,
                "saleDocumentNumber": saleDocumentNumber,
                "member": member,
                "orderStatus": orderStatus,
                "specification": specification,
                "marketingCategory": marketingCategory,
                "manufacturer": manufacturer,
                "unit": unit,
                "dosageForm": dosageForm,
                "productionBatchNumber": productionBatchNumber,
                "batchNumber": batchNumber,
                "retailPrice": retailPrice,
                "actualSalePrice": actualSalePrice,
                "quantity": quantity,
                "discountRate": discountRate,
                "receivableAmount": receivableAmount,
                "salesperson": salesperson,
                "cashier": cashier,
                "authorizer": authorizer,
                "saleAttribute": saleAttribute,
                "isGift": isGift,
                "isDispensed": isDispensed,
                "promotionDocumentNumber": promotionDocumentNumber,
                "couponCode": couponCode,
                "couponAllocationAmount": couponAllocationAmount,
                "costRecoveryType": costRecoveryType,
                "rebateUnitPrice": rebateUnitPrice,
                "rebateAgreementNumber": rebateAgreementNumber,
                "rebateSupplier": rebateSupplier,
                "estimatedCostUnitPrice": estimatedCostUnitPrice,
                "grossProfitUnitPrice": grossProfitUnitPrice,
                "discountAmount": discountAmount,
                "actualReceiptAmount": actualReceiptAmount,
                "estimatedCostAmount": estimatedCostAmount,
                "grossProfitAmount": grossProfitAmount,
                "singleProductDiscountRemark": singleProductDiscountRemark,
                "actualPriceRemark": actualPriceRemark,
                "entireOrderDiscountRemark": entireOrderDiscountRemark,
                "orderRemark": orderRemark,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
