<!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="sequenceNumber" id="sequenceNumber" 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="period" id="period" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">门店ID:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="storeId" id="storeId" 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="initialStockCost" id="initialStockCost" 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="deliveryCost" id="deliveryCost" 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="returnWarehouseCost" id="returnWarehouseCost" 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="salesCost" id="salesCost" 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="salesReturnAmount" id="salesReturnAmount" 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="lossCost" id="lossCost" 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="gainCost" id="gainCost" 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="finalStockCost" id="finalStockCost" 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 sequenceNumber = $("input[name='sequenceNumber']").val();
           var period = $("input[name='period']").val();
           var storeId = $("input[name='storeId']").val();
           var storeName = $("input[name='storeName']").val();
           var initialStockCost = $("input[name='initialStockCost']").val();
           var deliveryCost = $("input[name='deliveryCost']").val();
           var returnWarehouseCost = $("input[name='returnWarehouseCost']").val();
           var salesCost = $("input[name='salesCost']").val();
           var salesReturnAmount = $("input[name='salesReturnAmount']").val();
           var lossCost = $("input[name='lossCost']").val();
           var gainCost = $("input[name='gainCost']").val();
           var finalStockCost = $("input[name='finalStockCost']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "kc/skcbbstoreinventorycost/sKcBbStoreinventorycostAdd",
            data : {
                "sequenceNumber": sequenceNumber,
                "period": period,
                "storeId": storeId,
                "storeName": storeName,
                "initialStockCost": initialStockCost,
                "deliveryCost": deliveryCost,
                "returnWarehouseCost": returnWarehouseCost,
                "salesCost": salesCost,
                "salesReturnAmount": salesReturnAmount,
                "lossCost": lossCost,
                "gainCost": gainCost,
                "finalStockCost": finalStockCost,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
