From ff6b4ca2a45e57df38f5d6e5f55456854f7d455c Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 02 Dec 2022 14:09:43 +0800
Subject: [PATCH] 20221130

---
 src/main/resources/templates/febs/views/dapp/money-change-flow.html |  164 +++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 119 insertions(+), 45 deletions(-)

diff --git a/src/main/resources/templates/febs/views/dapp/money-change-flow.html b/src/main/resources/templates/febs/views/dapp/money-change-flow.html
index de7ecbb..f4484c4 100644
--- a/src/main/resources/templates/febs/views/dapp/money-change-flow.html
+++ b/src/main/resources/templates/febs/views/dapp/money-change-flow.html
@@ -9,41 +9,55 @@
                                 <div class="layui-form-item">
                                     <div class="layui-inline">
                                         <div class="layui-input-inline">
-                                            <input type="text" name="address" autocomplete="off" placeholder="输入地址或邀请码" class="layui-input">
+                                            <input type="text" name="systemProfitId" autocomplete="off" placeholder="输入动能编号" class="layui-input">
+                                        </div>
+                                    </div>
+                                    <div class="layui-inline">
+                                        <div class="layui-input-inline">
+                                            <input type="text" name="address" autocomplete="off" placeholder="输入地址" class="layui-input">
+                                        </div>
+                                    </div>
+                                    <div class="layui-inline">
+                                        <div class="layui-input-inline">
+                                            <input type="text" name="fromHash" autocomplete="off" placeholder="输入FromHash" class="layui-input">
                                         </div>
                                     </div>
                                     <div class="layui-inline">
                                         <label class="layui-form-label layui-form-label-sm">类型</label>
                                         <div class="layui-input-inline">
                                             <select name="type">
+<!--                                                1-加入动能 2-技术方收益 3-直推收益 4-层级收益 5-剩余层级收益给系统 6-复投动能 7-动能收益-->
                                                 <option value=""></option>
-                                                <option value="1">兑换</option>
-                                                <option value="2">提现</option>
-                                                <option value="3">采矿</option>
-                                                <option value="4">代理返利</option>
+                                                <option value="1">加入动能</option>
+                                                <option value="2">技术方收益</option>
+                                                <option value="3">直推收益</option>
+                                                <option value="4">层级收益</option>
+                                                <option value="5">剩余层级收益</option>
+                                                <option value="6">复投动能</option>
+                                                <option value="7">动能收益</option>
                                             </select>
                                         </div>
                                     </div>
-                                    <div class="layui-inline">
-                                        <label class="layui-form-label layui-form-label-sm">可兑换</label>
-                                        <div class="layui-input-inline">
-                                            <select name="changeAble">
-                                                <option value=""></option>
-                                                <option value="2">否</option>
-                                                <option value="1">是</option>
-                                            </select>
-                                        </div>
-                                    </div>
-                                    <div class="layui-inline">
-                                        <label class="layui-form-label layui-form-label-sm">可提现</label>
-                                        <div class="layui-input-inline">
-                                            <select name="withdrawAble">
-                                                <option value=""></option>
-                                                <option value="2">否</option>
-                                                <option value="1">是</option>
-                                            </select>
-                                        </div>
-                                    </div>
+<!--                                    <div class="layui-inline">-->
+<!--                                        <label class="layui-form-label layui-form-label-sm">可兑换</label>-->
+<!--                                        <div class="layui-input-inline">-->
+<!--                                            <select name="changeAble">-->
+<!--                                                <option value=""></option>-->
+<!--                                                <option value="2">否</option>-->
+<!--                                                <option value="1">是</option>-->
+<!--                                            </select>-->
+<!--                                        </div>-->
+<!--                                    </div>-->
+<!--                                    <div class="layui-inline">-->
+<!--                                        <label class="layui-form-label layui-form-label-sm">可提现</label>-->
+<!--                                        <div class="layui-input-inline">-->
+<!--                                            <select name="withdrawAble">-->
+<!--                                                <option value=""></option>-->
+<!--                                                <option value="2">否</option>-->
+<!--                                                <option value="1">是</option>-->
+<!--                                            </select>-->
+<!--                                        </div>-->
+<!--                                    </div>-->
                                 </div>
                             </div>
                             <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area">
@@ -67,16 +81,39 @@
         height: auto !important;
     }
 </style>
-<script type="text/html" id="type-format">
+<script type="text/html" id="flow-status">
+    {{#
+    var status = {
+    2: {title: '成功'},
+    1: {title: '进行中'},
+    3: {title: '取消'}
+    }[d.status];
+    }}
+    <span>{{ status.title }}</span>
+</script>
+<script type="text/html" id="flow-type">
     {{#
     var type = {
-    1: {title: '兑换'},
-    2: {title: '提现'},
-    3: {title: '采矿'},
-    4: {title: '代理返利'}
+    1: {title: '加入动能'},
+    2: {title: '技术方收益'},
+    3: {title: '直推收益'},
+    4: {title: '层级收益'},
+    5: {title: '剩余层级收益'},
+    6: {title: '复投动能'},
+    7: {title: '动能收益'},
     }[d.type];
     }}
     <span>{{ type.title }}</span>
+</script>
+<script type="text/html" id="status-able">
+    {{#
+    var status = {
+    1: {title: '进行中', color: 'blue'},
+    2: {title: '成功', color: 'green'},
+    3: {title: '失败', color: 'red'}
+    }[d.status];
+    }}
+    <span class="layui-badge febs-bg-{{status.color}}">{{ status.title }}</span>
 </script>
 <script data-th-inline="none" type="text/javascript">
     layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () {
@@ -100,7 +137,24 @@
         table.on('tool(moneyChangeTable)', function (obj) {
             var data = obj.data,
                 layEvent = obj.event;
+            if (layEvent === 'transferManual') {
+                febs.modal.confirm('人工操作', '是否人工转账?', function () {
+                    transferManual("flow/withdrawAgree/" + data.id);
+                });
+            }
+            if (layEvent === 'transferManual') {
+                febs.modal.confirm('人工操作', '是否人工转账?', function () {
+                    transferManual(data.id);
+                });
+            }
         });
+
+        function transferManual(id) {
+            febs.get(ctx + 'flow/transferManual/' + id, null, function () {
+                febs.alert.success('操作成功');
+                $reset.click();
+            });
+        }
 
         table.on('sort(moneyChangeTable)', function (obj) {
             sortObject = obj;
@@ -127,27 +181,47 @@
             tableIns = febs.table.init({
                 elem: $view.find('table'),
                 id: 'moneyChangeTable',
-                url: ctx + 'flow/accountMoneyChangeFlow',
+                url: ctx + 'flow/fundFlow',
                 cols: [[
-                    {field: 'address', title: '地址', minWidth: 150},
-                    {field: 'preAmount', title: '变化前金额', minWidth: 100},
-                    {field: 'amount', title: '变化金额', minWidth: 100},
-                    {field: 'afterAmount', title: '变化后金额', minWidth: 100},
-                    {field: 'content', title: '描述', minWidth: 130},
-                    {title: '类型', templet: '#type-format'},
-                    {field: 'createTime', title: '创建时间', minWidth: 180}
+                    {field: 'address', title: '地址', minWidth: 400},
+                    {field: 'systemProfitId', title: '动能编号', minWidth: 100},
+                    {title: '类型', minWidth: 100,templet: '#flow-type',align:'center'},
+                    {field: 'amount', title: '金额',
+                        templet: function (d) {
+                            if (d.amount > 0) {
+                                return '<span style="color:green;">'+d.amount+'</span>'
+                            } else if (d.amount < 0) {
+                                return '<span style="color:red;">'+d.amount+'</span>'
+                            }else{
+                                return d.amount
+                            }
+                        }, minWidth: 80,align:'center'},
+                    // {field: 'fee', title: '手续费', minWidth: 80},
+                    {field: 'createTime', title: '创建时间', minWidth: 150},
+                    {title: '状态', templet: '#status-able', minWidth: 80},
+                    {field: 'fromHash', title: 'FromHash', minWidth: 150},
+                    {title: '操作',
+                        templet: function (d) {
+                            if(d.status == 3){
+                                return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="transferManual" shiro:hasPermission="transferManual:update">手动转账</button>'
+                            }else{
+                                return ''
+                            }
+                        },minWidth: 100,align:'center'}
                 ]]
             });
         }
 
         function getQueryParams() {
-            // return {
-            //     inviteId: $searchForm.find('input[name="inviteId"]').val().trim(),
-            //     changeAble: $searchForm.find("select[name='changeAble']").val(),
-            //     accountStatus: $searchForm.find("select[name='accountStatus']").val(),
-            //     withdrawAble: $searchForm.find("input[name='withdrawAble']").val(),
-            //     invalidate_ie_cache: new Date()
-            // };
+            return {
+                systemProfitId: $searchForm.find('input[name="systemProfitId"]').val().trim(),
+                address: $searchForm.find('input[name="address"]').val().trim(),
+                fromHash: $searchForm.find('input[name="fromHash"]').val().trim(),
+                type: $searchForm.find("select[name='type']").val(),
+                // accountStatus: $searchForm.find("select[name='accountStatus']").val(),
+                // withdrawAble: $searchForm.find("input[name='withdrawAble']").val(),
+                // invalidate_ie_cache: new Date()
+            };
         }
 
         function changeStatus(url) {

--
Gitblit v1.9.1