From 6f566ca6f052e79b66921887f321d924702a12e2 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 07 Mar 2023 10:59:46 +0800
Subject: [PATCH] 星级补贴

---
 src/main/resources/templates/febs/views/modules/system/profitSetting.html  |  140 ++---------------------------------
 src/main/resources/templates/febs/views/modules/system/hlmScoreSet.html    |    4 
 src/main/resources/templates/febs/views/modules/system/cashOutSetting.html |   35 ++++++--
 src/main/java/cc/mrbird/febs/mall/dto/CashOutSettingDto.java               |    4 
 src/main/resources/templates/febs/views/modules/system/hlmBasicPerk.html   |   10 +-
 5 files changed, 44 insertions(+), 149 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/mall/dto/CashOutSettingDto.java b/src/main/java/cc/mrbird/febs/mall/dto/CashOutSettingDto.java
index 49dd2d8..3323b3b 100644
--- a/src/main/java/cc/mrbird/febs/mall/dto/CashOutSettingDto.java
+++ b/src/main/java/cc/mrbird/febs/mall/dto/CashOutSettingDto.java
@@ -6,7 +6,7 @@
 /**
  *
  *
- * {"minCashOut":100,"allCashOut":5000,"serviceFee":0.3,"workingDays":1}
+ * {"minCashOut":100,"allCashOut":5000,"serviceFee":0.3,"workingDays":1,"insideFee":5}
  *
  *
  */
@@ -20,4 +20,6 @@
     private BigDecimal serviceFee;
     //提现时间 1:工作日 2:每一天
     private Integer workingDays;
+    //互转手续费率
+    private Integer insideFee;
 }
diff --git a/src/main/resources/templates/febs/views/modules/system/cashOutSetting.html b/src/main/resources/templates/febs/views/modules/system/cashOutSetting.html
index b64a1cc..d9725df 100644
--- a/src/main/resources/templates/febs/views/modules/system/cashOutSetting.html
+++ b/src/main/resources/templates/febs/views/modules/system/cashOutSetting.html
@@ -3,35 +3,45 @@
         <form class="layui-form" action="" lay-filter="cashout-setting-form">
             <div class="layui-card">
                 <div class="layui-card-body">
+                    <blockquote class="layui-elem-quote blue-border">提现</blockquote>
                     <div class="layui-form-item">
-                        <label class="layui-form-label ">每次最小提现金额:</label>
+                        <label class="layui-form-label  febs-form-item-require">每次最小提现金额:</label>
                         <div class="layui-input-block">
                             <input type="text" name="minCashOut" data-th-id="${cashout.minCashOut}"
-                                   lay-verify="required" autocomplete="off" class="layui-input" >
+                                   lay-verify="required|integer" autocomplete="off" class="layui-input" >
                         </div>
                     </div>
                     <div class="layui-form-item">
-                        <label class="layui-form-label ">每日提现上限:</label>
+                        <label class="layui-form-label  febs-form-item-require">每日提现限额:</label>
                         <div class="layui-input-block">
                             <input type="text" name="allCashOut" data-th-id="${cashout.allCashOut}"
-                                   lay-verify="number" autocomplete="off" class="layui-input" >
+                                   lay-verify="required|integer" autocomplete="off" class="layui-input" >
                         </div>
                     </div>
                     <div class="layui-form-item">
-                        <label class="layui-form-label ">提现手续费:</label>
+                        <label class="layui-form-label  febs-form-item-require">每次提现手续费:</label>
                         <div class="layui-input-block">
                             <input type="text" name="serviceFee" data-th-id="${cashout.serviceFee}"
-                                   lay-verify="text" autocomplete="off" class="layui-input" >
+                                   lay-verify="required|text" autocomplete="off" class="layui-input" >
                         </div>
-                        <div class="layui-word-aux" style="margin-left: 150px;">提现手续费:直接输入百分比,例如25%,直接输入25</div>
+                        <div class="layui-word-aux" style="margin-left: 150px;">提现手续费:例如25%,直接输入25</div>
 
                     </div>
                     <div class="layui-form-item">
-                        <label class="layui-form-label">提现时间:</label>
+                        <label class="layui-form-label febs-form-item-require">提现时间:</label>
                         <div class="layui-input-block">
                             <input type="radio" name="workingDays" value="1" title="工作日">
                             <input type="radio" name="workingDays" value="2" title="每一天">
                         </div>
+                    </div>
+                    <blockquote class="layui-elem-quote blue-border">互转</blockquote>
+                    <div class="layui-form-item">
+                        <label class="layui-form-label  febs-form-item-require">互转手续费:</label>
+                        <div class="layui-input-block">
+                            <input type="text" name="insideFee" data-th-id="${cashout.insideFee}"
+                                   lay-verify="required|text" autocomplete="off" class="layui-input" >
+                        </div>
+                        <div class="layui-word-aux" style="margin-left: 150px;">互转手续费:例如25%,直接输入25</div>
                     </div>
                 </div>
 
@@ -64,7 +74,13 @@
             validate = layui.validate,
             $view = $('#cashout-setting');
 
-        form.verify(validate);
+
+        form.verify({
+            integer: [
+                /^[1-9]\d*$/
+                , '只能输入正整数'
+            ]
+        });
 
         initCashoutValue();
 
@@ -75,6 +91,7 @@
                 "minCashOut": cashout.minCashOut,
                 "allCashOut": cashout.allCashOut,
                 "serviceFee": cashout.serviceFee,
+                "insideFee": cashout.insideFee,
                 "workingDays": cashout.workingDays
             });
         }
diff --git a/src/main/resources/templates/febs/views/modules/system/hlmBasicPerk.html b/src/main/resources/templates/febs/views/modules/system/hlmBasicPerk.html
index 9042c15..bad857b 100644
--- a/src/main/resources/templates/febs/views/modules/system/hlmBasicPerk.html
+++ b/src/main/resources/templates/febs/views/modules/system/hlmBasicPerk.html
@@ -7,35 +7,35 @@
                     <div class="layui-row layui-col-space10 layui-form-item">
                         <label class="layui-form-label febs-form-item-require">分享补贴(%):</label>
                         <div class="layui-input-block">
-                            <input type="text" name="sharePerk" lay-verify="required|integer" placeholder="请输入数字" autocomplete="off" class="layui-input" >
+                            <input type="text" name="sharePerk" lay-verify="required" placeholder="请输入数字" autocomplete="off" class="layui-input" >
                             <div class="layui-word-aux">例:15%,填写15</div>
                         </div>
                     </div>
                     <div class="layui-form-item">
                         <label class="layui-form-label febs-form-item-require">团队补贴(%):</label>
                         <div class="layui-input-block">
-                            <input type="text" name="teamPerk" lay-verify="required|integer" placeholder="请输入数字" autocomplete="off" class="layui-input" >
+                            <input type="text" name="teamPerk" lay-verify="required" placeholder="请输入数字" autocomplete="off" class="layui-input" >
                             <div class="layui-word-aux">例:15%,填写15</div>
                         </div>
                     </div>
                     <div class="layui-form-item">
                         <label class="layui-form-label febs-form-item-require">平级奖励(%):</label>
                         <div class="layui-input-block">
-                            <input type="text" name="teamEqualsPerk" lay-verify="required|integer" placeholder="请输入数字" autocomplete="off" class="layui-input" >
+                            <input type="text" name="teamEqualsPerk" lay-verify="required" placeholder="请输入数字" autocomplete="off" class="layui-input" >
                             <div class="layui-word-aux">例:15%,填写15</div>
                         </div>
                     </div>
                     <div class="layui-form-item">
                         <label class="layui-form-label febs-form-item-require">线下服务中心(%):</label>
                         <div class="layui-input-block">
-                            <input type="text" name="offLinePerk" lay-verify="required|integer" placeholder="请输入数字" autocomplete="off" class="layui-input" >
+                            <input type="text" name="offLinePerk" lay-verify="required" placeholder="请输入数字" autocomplete="off" class="layui-input" >
                             <div class="layui-word-aux">例:15%,填写15</div>
                         </div>
                     </div>
                     <div class="layui-form-item">
                         <label class="layui-form-label febs-form-item-require">代理商(%):</label>
                         <div class="layui-input-block">
-                            <input type="text" name="agentPerk" lay-verify="required|integer" placeholder="请输入数字" autocomplete="off" class="layui-input" >
+                            <input type="text" name="agentPerk" lay-verify="required" placeholder="请输入数字" autocomplete="off" class="layui-input" >
                             <div class="layui-word-aux">例:15%,填写15</div>
                         </div>
                     </div>
diff --git a/src/main/resources/templates/febs/views/modules/system/hlmScoreSet.html b/src/main/resources/templates/febs/views/modules/system/hlmScoreSet.html
index 0eda6c3..ac57b1d 100644
--- a/src/main/resources/templates/febs/views/modules/system/hlmScoreSet.html
+++ b/src/main/resources/templates/febs/views/modules/system/hlmScoreSet.html
@@ -15,14 +15,14 @@
                     <div class="layui-form-item">
                         <label class="layui-form-label febs-form-item-require">抵扣现金(%):</label>
                         <div class="layui-input-block">
-                            <input type="text" name="scorePercent" lay-verify="required|integer" placeholder="请输入数字" autocomplete="off" class="layui-input" >
+                            <input type="text" name="scorePercent" lay-verify="required" placeholder="请输入数字" autocomplete="off" class="layui-input" >
                             <div class="layui-word-aux">设置50,即商品价格1000,积分可抵扣的最大金额为1000*50%=500,填写整数,如【50】</div>
                         </div>
                     </div>
                     <div class="layui-form-item">
                         <label class="layui-form-label febs-form-item-require">积分兑换现金:</label>
                         <div class="layui-input-block">
-                            <input type="text" name="scoreChange" lay-verify="required|integer" placeholder="请输入数字" autocomplete="off" class="layui-input" >
+                            <input type="text" name="scoreChange" lay-verify="required" placeholder="请输入数字" autocomplete="off" class="layui-input" >
                             <div class="layui-word-aux">设置1,则1积分等于1元,设置2,则2积分等于1元,填写整数,如【1】</div>
                         </div>
 
diff --git a/src/main/resources/templates/febs/views/modules/system/profitSetting.html b/src/main/resources/templates/febs/views/modules/system/profitSetting.html
index 34c54c2..2f6d2a4 100644
--- a/src/main/resources/templates/febs/views/modules/system/profitSetting.html
+++ b/src/main/resources/templates/febs/views/modules/system/profitSetting.html
@@ -1,42 +1,18 @@
-<div class="layui-fluid layui-anim febs-anim" id="profit-setting" lay-title="收益设置">
+<div class="layui-fluid layui-anim febs-anim" id="profit-setting" lay-title="星级补贴设置">
     <div class="layui-row layui-col-space8 febs-container">
         <form class="layui-form" action="" lay-filter="profit-setting-form">
             <div class="layui-card">
                 <div class="layui-card-body">
-                    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
-                        <ul class="layui-tab-title">
-                            <li class="layui-this">分红设置</li>
-                            <li>代理分红</li>
-                            <li>排名分红</li>
-                            <li>间推分红</li>
-                        </ul>
-                        <div class="layui-tab-content">
-                            <div class="layui-tab-item layui-show" id="bonus-global-setting">
-                            </div>
-                            <div class="layui-tab-item">
-                                <table id="agentBonus" lay-filter="agentBonus"></table>
-                            </div>
-                            <div class="layui-tab-item">
-                                <table id="rankBonus" lay-filter="rankBonus"></table>
-                            </div>
-                            <div class="layui-tab-item">
-                                <table id="indirectDistrib" lay-filter="indirectDistrib"></table>
-                                <div class="layui-word-aux">间推分红即为隔代收益,将直推奖励按照对应比例依次向上级返利,直至结算到一元为止</div>
-                            </div>
-                        </div>
+                    <blockquote class="layui-elem-quote blue-border">星级补贴</blockquote>
+                    <div class="layui-tab-item layui-show">
+                        <table id="agentBonus" lay-filter="agentBonus"></table>
                     </div>
                 </div>
-
                 <div class="layui-card-footer">
                     <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="profit-setting-form-submit" id="submit">保存</button>
                 </div>
             </div>
         </form>
-
-<!--        <div class="layui-form-item febs-hide">-->
-<!--            <button class="layui-btn" lay-submit="" lay-filter="profit-setting-form-submit" id="submit-form"></button>-->
-<!--            <button type="reset" class="layui-btn" id="reset"></button>-->
-<!--        </div>-->
     </div>
 </div>
 <style>
@@ -52,23 +28,6 @@
         margin-bottom: 20px !important;
     }
 </style>
-<script type="text/html" id="bonusSystem">
-    {{#  layui.each(d, function(index, item){ }}
-    <div class="layui-form-item">
-        <label class="layui-form-label">{{item.description}}:</label>
-        <div class="layui-input-block">
-            <input type="text" name="{{item.code}}" lay-verify="number" value="{{item.value}}" autocomplete="off" class="layui-input">
-        </div>
-        {{# if(item.code == 'INDRECT_BONUS') { }}
-        <div class="layui-word-aux" style="margin-left: 150px;">间推分红即为隔代收益,将直推奖励按照对应比例依次向上级返利,直至结算到一元为止</div>
-        {{# }}}
-
-        {{# if(item.code == 'THANKFUL_BONUS') { }}
-        <div class="layui-word-aux" style="margin-left: 150px;">将推荐人的收益(代理,直推,排名)的对应比例加权平分给下面直推</div>
-        {{# }}}
-    </div>
-    {{# }) }}
-</script>
 <script data-th-inline="javascript" type="text/javascript">
     layui.use(['dropdown', 'jquery', 'validate', 'febs', 'form', 'eleTree', 'laytpl', 'table'], function () {
         var $ = layui.jquery,
@@ -77,12 +36,8 @@
             table = layui.table,
             validate = layui.validate,
             $view = $('#profit-setting')
-            , templateHtml = bonusSystem.innerHTML
-            , $bonusSystem = $("#bonus-global-setting")
             , laytpl = layui.laytpl
-            , agentBonusArr
-            , rankBonusArr
-            , indirectBonusArr;
+            , agentBonusArr;
 
         form.verify(validate);
         form.render();
@@ -90,9 +45,9 @@
         table.render({
             elem: '#agentBonus'
             ,cols: [[ //表头
-                {field: 'description', title: '代理', edit:'text'}
-                ,{field: 'prop', title: '返利比例(%)', edit:'text'}
-                ,{field: 'achieve', title: '团队业绩(万元)', edit:'text'}
+                {field: 'description', title: '名称'}
+                ,{field: 'prop', title: '补贴比例(%)', edit:'text'}
+                ,{field: 'achieve', title: '团队贡献值', edit:'text'}
                 ,{field: 'direct', title: '直推(个)', edit:'text'}
                 ,{field: 'lastAgentCnt', title: '上一级代理(个)', edit:'text'}
                 ,{field: 'type', title: '比例', edit:'text', hide:'true'}
@@ -117,70 +72,11 @@
             }
         });
 
-        table.render({
-            elem: '#rankBonus'
-            ,cols: [[ //表头
-                {field: 'description', title: '排名'}
-                ,{field: 'value', title: '返利比例(%)', edit:'text'}
-                ,{field: 'type', title: '比例', edit:'text', hide:'true'}
-                ,{field: 'code', title: '比例', edit:'text', hide:'true'}
-            ]]
-            ,data: []
-        });
-
-        table.on('edit(rankBonus)', function(obj){
-            var value = obj.value //得到修改后的值
-                ,data = obj.data //得到所在行所有键值
-                ,field = obj.field; //得到字段
-
-            for (let i = 0; i < rankBonusArr.length; i++) {
-                if (rankBonusArr[i].code === data.code) {
-                    rankBonusArr[i].value = value;
-                }
-            }
-        });
-
-        table.render({
-            elem: '#indirectDistrib'
-            ,cols: [[ //表头
-                {field: 'pushCnt', title: '直推人数', edit:'text'}
-                ,{field: 'prop', title: '返利比例(%)', edit:'text'}
-                ,{field: 'type', title: '比例', edit:'text', hide:'true'}
-                ,{field: 'code', title: '比例', edit:'text', hide:'true'}
-            ]]
-            ,data: []
-        });
-
-        table.on('edit(indirectDistrib)', function(obj){
-            var value = obj.value //得到修改后的值
-                ,data = obj.data //得到所在行所有键值
-                ,field = obj.field; //得到字段
-
-            for (let i = 0; i < indirectBonusArr.length; i++) {
-                if (indirectBonusArr[i].code === data.code) {
-                    var valueData = {};
-                    valueData.pushCnt = data.pushCnt;
-                    valueData.prop = data.prop;
-                    indirectBonusArr[i].value = JSON.stringify(valueData);
-                }
-            }
-        });
-
-        dicDataReq("BONUS_TYPE");
         dicDataReq("AGENT_LEVEL_REQUIRE");
-        dicDataReq("RANK_AWARD");
-        dicDataReq("INDIRECT_BONUS_SETTING");
         function dicDataReq(type) {
-            $bonusSystem.empty();
             $.get(ctx + 'admin/common/findDicByType/' + type, function (r) {
                 if (r.code === 200) {
                     var data = r.data;
-                    if ("BONUS_TYPE" == type) {
-                        laytpl(templateHtml).render(data, function(html) {
-                            $bonusSystem.append(html);
-                        })
-                    }
-
                     if ("AGENT_LEVEL_REQUIRE" == type) {
                         for (let i = 0; i < data.length; i++) {
                             data[i].prop = JSON.parse(data[i].value).profitProp;
@@ -193,32 +89,12 @@
                             data : data
                         });
                     }
-
-                    if ("RANK_AWARD" == type) {
-                        rankBonusArr = data;
-                        table.reload('rankBonus', {
-                            data : data
-                        });
-                    }
-
-                    if ("INDIRECT_BONUS_SETTING" == type) {
-                        for (let i = 0; i < data.length; i++) {
-                            data[i].prop = JSON.parse(data[i].value).prop;
-                            data[i].pushCnt = JSON.parse(data[i].value).pushCnt;
-                        }
-                        indirectBonusArr = data;
-                        table.reload('indirectDistrib', {
-                            data : data
-                        });
-                    }
                 }
             });
         }
 
         form.on('submit(profit-setting-form-submit)', function (data) {
             data.field.agentBonus = agentBonusArr;
-            data.field.rankBonus = rankBonusArr;
-            data.field.indrectDistrib = indirectBonusArr;
             $.ajax({
                 'url':ctx + 'admin/system/bonusSystemSetting',
                 'type':'post',

--
Gitblit v1.9.1