<!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-SXsglXsmxZkmxSalesdiscountinfo-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="productCode" placeholder="商品编码" th:value="${productCode}" 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="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="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="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="batch" placeholder="批次" th:value="${batch}" 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="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="cartLineNo" placeholder="购物车行号" th:value="${cartLineNo}" 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="lineQuantity" placeholder="行数量" th:value="${lineQuantity}" 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="discountType" placeholder="折扣类型" th:value="${discountType}" 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="discountDocumentNumber" placeholder="折扣单号" th:value="${discountDocumentNumber}" 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="discountSubDocumentNumber" placeholder="折扣子单号" th:value="${discountSubDocumentNumber}" 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="discountUnitPrice" placeholder="折扣单价" th:value="${discountUnitPrice}" 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="points" placeholder="积分" th:value="${points}" 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-SXsglXsmxZkmxSalesdiscountinfo-edit").serializeArray();
        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "xsgl/sxsglxsmxzkmxsalesdiscountinfo/sXsglXsmxZkmxSalesdiscountinfoEdit",
            data : data,
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }

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