<!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="storeCode" id="storeCode" 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="specialDay" id="specialDay" 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="budgetValue" id="budgetValue" 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="weightCoefficient" id="weightCoefficient" 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="actualSales" id="actualSales" 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="budgetAchievementRate" id="budgetAchievementRate" 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="planValue" id="planValue" 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="planAchievementRate" id="planAchievementRate" 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="budgetCycle" id="budgetCycle" 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="storeRange" id="storeRange" 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="channelName" id="channelName" 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 storeCode = $("input[name='storeCode']").val();
           var specialDay = $("input[name='specialDay']").val();
           var budgetValue = $("input[name='budgetValue']").val();
           var weightCoefficient = $("input[name='weightCoefficient']").val();
           var actualSales = $("input[name='actualSales']").val();
           var budgetAchievementRate = $("input[name='budgetAchievementRate']").val();
           var planValue = $("input[name='planValue']").val();
           var planAchievementRate = $("input[name='planAchievementRate']").val();
           var budgetCycle = $("input[name='budgetCycle']").val();
           var storeRange = $("input[name='storeRange']").val();
           var channelName = $("input[name='channelName']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "mdyygl/smdyyglmdysjqstoreweightinfo/sMdyyglMdysjqStoreweightinfoAdd",
            data : {
                "storeCode": storeCode,
                "specialDay": specialDay,
                "budgetValue": budgetValue,
                "weightCoefficient": weightCoefficient,
                "actualSales": actualSales,
                "budgetAchievementRate": budgetAchievementRate,
                "planValue": planValue,
                "planAchievementRate": planAchievementRate,
                "budgetCycle": budgetCycle,
                "storeRange": storeRange,
                "channelName": channelName,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
