<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('销售商品明细表修改')" />
</head>
<style>

</style>
<script>

</script>
<body>
<div class="ui-layout-center">
    <form class="form-horizontal" id="form-SXsglXsmxSpmxSalesdetailinfo-edit" th:object="${user}">
        <h4 class="form-header h4">基本信息</h4>
        <input type="hidden" id="id" name="id" th:value="${id}">
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <!--is-required 增加星号 显示为必填-->
                    <label class="col-sm-1 control-label">商品编码:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="productId" placeholder="商品编码" th:value="${productId}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">商品名称:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="productName" placeholder="商品名称" th:value="${productName}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">门店名称:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="storeName" placeholder="门店名称" th:value="${storeName}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">销售日期:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="saleDate" placeholder="销售日期" th:value="${saleDate}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">销售单号:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="saleDocumentNumber" placeholder="销售单号" th:value="${saleDocumentNumber}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">会员:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="member" placeholder="会员" th:value="${member}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">订单状态:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="orderStatus" placeholder="订单状态" th:value="${orderStatus}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">规格:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="specification" placeholder="规格" th:value="${specification}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">营销分类:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="marketingCategory" placeholder="营销分类" th:value="${marketingCategory}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">生产厂家:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="manufacturer" placeholder="生产厂家" th:value="${manufacturer}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">单位:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="unit" placeholder="单位" th:value="${unit}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">剂型:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="dosageForm" placeholder="剂型" th:value="${dosageForm}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">生产批号:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="productionBatchNumber" placeholder="生产批号" th:value="${productionBatchNumber}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">批次号:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="batchNumber" placeholder="批次号" th:value="${batchNumber}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">零售价/元:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="retailPrice" placeholder="零售价/元" th:value="${retailPrice}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">实际售价/元:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="actualSalePrice" placeholder="实际售价/元" th:value="${actualSalePrice}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">数量:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="quantity" placeholder="数量" th:value="${quantity}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">折扣率%:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="discountRate" placeholder="折扣率%" th:value="${discountRate}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">应收金额/元:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="receivableAmount" placeholder="应收金额/元" th:value="${receivableAmount}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">营业员:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="salesperson" placeholder="营业员" th:value="${salesperson}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">收银员:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="cashier" placeholder="收银员" th:value="${cashier}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">授权人:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="authorizer" placeholder="授权人" th:value="${authorizer}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">销售属性:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="saleAttribute" placeholder="销售属性" th:value="${saleAttribute}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">是否赠品:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="isGift" placeholder="是否赠品" th:value="${isGift}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">是否拆零:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="isDispensed" placeholder="是否拆零" th:value="${isDispensed}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">促销单号-档位:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="promotionDocumentNumber" placeholder="促销单号-档位" th:value="${promotionDocumentNumber}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">优惠券码-满额:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="couponCode" placeholder="优惠券码-满额" th:value="${couponCode}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">优惠券分摊金额:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="couponAllocationAmount" placeholder="优惠券分摊金额" th:value="${couponAllocationAmount}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">成本还原类型:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="costRecoveryType" placeholder="成本还原类型" th:value="${costRecoveryType}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">返利单价:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="rebateUnitPrice" placeholder="返利单价" th:value="${rebateUnitPrice}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">返利协议号:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="rebateAgreementNumber" placeholder="返利协议号" th:value="${rebateAgreementNumber}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">返利供应商:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="rebateSupplier" placeholder="返利供应商" th:value="${rebateSupplier}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">预估成本单价:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="estimatedCostUnitPrice" placeholder="预估成本单价" th:value="${estimatedCostUnitPrice}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">毛利单价:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="grossProfitUnitPrice" placeholder="毛利单价" th:value="${grossProfitUnitPrice}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">折扣金额/元:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="discountAmount" placeholder="折扣金额/元" th:value="${discountAmount}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">实收金额/元:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="actualReceiptAmount" placeholder="实收金额/元" th:value="${actualReceiptAmount}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">预估成本金额:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="estimatedCostAmount" placeholder="预估成本金额" th:value="${estimatedCostAmount}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">毛利金额:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="grossProfitAmount" placeholder="毛利金额" th:value="${grossProfitAmount}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">单品折扣备注:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="singleProductDiscountRemark" placeholder="单品折扣备注" th:value="${singleProductDiscountRemark}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">实价备注:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="actualPriceRemark" placeholder="实价备注" th:value="${actualPriceRemark}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">整单折扣备注:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="entireOrderDiscountRemark" placeholder="整单折扣备注" th:value="${entireOrderDiscountRemark}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">订单备注:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="orderRemark" placeholder="订单备注" th:value="${orderRemark}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </form>
</div>
<div class="main-content">
    <div class="col-sm-offset-5 col-sm-10">
        <!--<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>
        <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>-->
    </div>
</div>
<th:block th:include="include :: footer" />
</body>
</html>

<script>
    function edit() {
        var data = $("#form-SXsglXsmxSpmxSalesdetailinfo-edit").serializeArray();
        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "xsgl/sxsglxsmxspmxsalesdetailinfo/sXsglXsmxSpmxSalesdetailinfoEdit",
            data : data,
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }

    function submitHandler() {
        if ($.validate.form()) {
            edit();
        }
    }
</script>
