Эх сурвалжийг харах

增加打码量和充值金额统计

dos 1 сар өмнө
parent
commit
e76fc90e62

+ 26 - 0
game-business/src/main/java/com/game/business/controller/AppUserController.java

@@ -20,6 +20,7 @@ import com.game.business.util.Md5Utils;
 import com.game.business.util.im.HttpClientUtils;
 import com.game.business.util.im.TencentCloudImUtil;
 import com.game.business.vo.AppRechargeConfigVo;
+import com.game.business.vo.RechargeAmountVo;
 import com.game.common.annotation.RepeatSubmit;
 import com.game.common.constant.AppSceneType;
 import com.game.common.constant.finance.*;
@@ -452,6 +453,31 @@ public class AppUserController extends BaseController
         return success(appUserService.selectAppUserByUserid(userid));
     }
 
+    /**
+     * 获取app用户打码量
+     */
+    @PreAuthorize("@ss.hasPermi('business:user:query')")
+    @GetMapping(value = "/getRechargeAmount/{userid}")
+    @ApiOperation(value = "获取app用户详细信息", notes = "获取app用户详细信息")
+    public R<RechargeAmountVo> getRechargeAmount(@PathVariable("userid") Long userid)
+    {
+        RechargeAmountVo amountVo = finTranRecordService.selectRechargeAmount(userid,0);
+        if(null == amountVo){
+            return R.ok(new RechargeAmountVo());
+        }
+        //查询用户已下注金额
+        Date time = finTranRecordService.selectRechargeDate(userid,0);
+        String type3s = FinTranType3.CONSUM_GAME_ANCHOR_ZHUANPAN.getType() + "," + FinTranType3.CONSUM_GAME_ANCHOR_WITHDRAW.getType();
+        List<FinTranRecord> curTranList = finTranRecordService.selectUserTran(null,type3s,userid,time,new Date(),0);
+        double bettingAmount = curTranList.stream().filter(e->
+                e.getCurrencyType().intValue() == 4
+        ).mapToDouble(FinTranRecord::getDiamondCoinChange).sum() * -1;
+        amountVo.setGameAmount(bettingAmount);
+        double amount = (amountVo.getAmount() + amountVo.getGiveAmount()) * 2 - amountVo.getGameAmount();
+        amountVo.setLackAmount(amount>0?amount:0);
+        return R.ok(amountVo);
+    }
+
     /**
      * 新增app用户
      */

+ 14 - 0
game-business/src/main/java/com/game/business/controller/AppUsersChargeController.java

@@ -2,6 +2,9 @@ package com.game.business.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.game.business.vo.RechargeSumVo;
+import com.game.common.core.domain.R;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -52,6 +55,17 @@ public class AppUsersChargeController extends BaseController
         return getDataTable(list);
     }
 
+    /**
+     * 查询充值记录统计
+     */
+    @PreAuthorize("@ss.hasPermi('business:charge:list')")
+    @GetMapping("/selectRechargeSum")
+    @ApiOperation(value = "查询充值记录列表", notes = "获取充值记录列表")
+    public R<RechargeSumVo> selectRechargeSum(AppUsersCharge appUsersCharge)
+    {
+        return R.ok(appUsersChargeService.selectRechargeSum(appUsersCharge));
+    }
+
     /**
      * 导出充值记录列表
      */

+ 3 - 0
game-business/src/main/java/com/game/business/mapper/AppUsersChargeMapper.java

@@ -3,6 +3,7 @@ package com.game.business.mapper;
 import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.game.business.domain.AppUsersCharge;
+import com.game.business.vo.RechargeSumVo;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.springframework.stereotype.Service;
@@ -69,4 +70,6 @@ public interface AppUsersChargeMapper extends BaseMapper<AppUsersCharge> {
 
     @Select("select IFNULL(sum(coin),0) from app_users_charge where uid = #{userId} and status = 1 and coin_type = 1")
     public Double sumCharge(@Param("userId") Long userId);
+
+    public RechargeSumVo selectRechargeSum(AppUsersCharge appUsersCharge);
 }

+ 5 - 0
game-business/src/main/java/com/game/business/mapper/FinTranRecordMapper.java

@@ -10,6 +10,7 @@ import com.game.business.domain.FinTranRecord;
 import com.game.business.dto.FinTranDto;
 import com.game.business.dto.FinTranRecordDTO;
 import com.game.business.vo.FinTranVo;
+import com.game.business.vo.RechargeAmountVo;
 import org.apache.ibatis.annotations.Param;
 
 /**
@@ -87,4 +88,8 @@ public interface FinTranRecordMapper extends BaseMapper<FinTranRecord> {
     Double sumUserRechareTran(@Param("userId") Long userId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
 
     Map<String,Double> selectExChangeSum(FinTranRecordDTO recordDTO);
+
+    RechargeAmountVo selectRechargeAmount(@Param("userId") Long userId, @Param("withdrawFlag") Integer withdrawFlag);
+
+    Date selectRechargeDate(@Param("userId") Long userId, @Param("withdrawFlag") Integer withdrawFlag);
 }

+ 3 - 0
game-business/src/main/java/com/game/business/service/IAppUsersChargeService.java

@@ -4,6 +4,7 @@ import java.util.List;
 import com.game.business.domain.AppUsersCharge;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.game.business.vo.AppRechargeConfigVo;
+import com.game.business.vo.RechargeSumVo;
 
 /**
  * 充值记录Service接口
@@ -77,4 +78,6 @@ public interface IAppUsersChargeService extends IService<AppUsersCharge> {
     Double sumCharge(Long userId);
 
     AppRechargeConfigVo getRechargeConfig();
+
+    RechargeSumVo selectRechargeSum(AppUsersCharge appUsersCharge);
 }

+ 5 - 0
game-business/src/main/java/com/game/business/service/IFinTranRecordService.java

@@ -13,6 +13,7 @@ import com.game.business.dto.AppUserTeamTranserRecordDto;
 import com.game.business.dto.FinTranDto;
 import com.game.business.dto.FinTranRecordDTO;
 import com.game.business.vo.FinTranVo;
+import com.game.business.vo.RechargeAmountVo;
 import com.game.common.core.domain.HttpRet;
 import com.game.common.core.domain.R;
 import org.apache.ibatis.annotations.Param;
@@ -114,4 +115,8 @@ public interface IFinTranRecordService extends IService<FinTranRecord> {
     Double sumUserRechareTran(Long userId,Date beginDate,Date endDate);
 
     Map<String,Double> selectExChangeSum(FinTranRecordDTO recordDTO);
+
+    RechargeAmountVo selectRechargeAmount(Long userId, Integer withdrawFlag);
+
+    Date selectRechargeDate(Long userId,Integer withdrawFlag);
 }

+ 7 - 0
game-business/src/main/java/com/game/business/service/impl/AppUsersChargeServiceImpl.java

@@ -10,6 +10,7 @@ import java.util.Date;
 import java.util.List;
 
 import com.game.business.vo.AppRechargeConfigVo;
+import com.game.business.vo.RechargeSumVo;
 import com.game.common.annotation.DataSource;
 import com.game.common.enums.DataSourceType;
 import com.game.common.utils.DateUtils;
@@ -170,4 +171,10 @@ public class AppUsersChargeServiceImpl extends ServiceImpl<AppUsersChargeMapper,
         }
         return configVo;
     }
+
+    @Override
+    @DataSource(DataSourceType.SLAVE)
+    public RechargeSumVo selectRechargeSum(AppUsersCharge appUsersCharge) {
+        return appUsersChargeMapper.selectRechargeSum(appUsersCharge);
+    }
 }

+ 13 - 0
game-business/src/main/java/com/game/business/service/impl/FinTranRecordServiceImpl.java

@@ -21,6 +21,7 @@ import com.game.business.service.ICfgCommonService;
 import com.game.business.task.AppUserCountTask;
 import com.game.business.util.Md5Utils;
 import com.game.business.vo.FinTranVo;
+import com.game.business.vo.RechargeAmountVo;
 import com.game.common.annotation.DataSource;
 import com.game.common.constant.AppSceneType;
 import com.game.common.constant.finance.*;
@@ -450,4 +451,16 @@ public class FinTranRecordServiceImpl extends ServiceImpl<FinTranRecordMapper, F
     public Map<String, Double> selectExChangeSum(FinTranRecordDTO recordDTO) {
         return finTranRecordMapper.selectExChangeSum(recordDTO);
     }
+
+    @Override
+    @DataSource(DataSourceType.SLAVE)
+    public RechargeAmountVo selectRechargeAmount(Long userId, Integer withdrawFlag) {
+        return finTranRecordMapper.selectRechargeAmount(userId,withdrawFlag);
+    }
+
+    @Override
+    @DataSource(DataSourceType.SLAVE)
+    public Date selectRechargeDate(Long userId, Integer withdrawFlag) {
+        return finTranRecordMapper.selectRechargeDate(userId,withdrawFlag);
+    }
 }

+ 24 - 0
game-business/src/main/java/com/game/business/vo/RechargeAmountVo.java

@@ -0,0 +1,24 @@
+package com.game.business.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class RechargeAmountVo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "充值金额(包含转账)")
+    private Double amount = 0.0;
+
+    @ApiModelProperty(value = "赠送金额")
+    private Double giveAmount = 0.0;
+
+    @ApiModelProperty(value = "打码量")
+    private Double gameAmount = 0.0;
+
+    @ApiModelProperty(value = "缺少打码量")
+    private Double lackAmount = 0.0;
+}

+ 16 - 0
game-business/src/main/java/com/game/business/vo/RechargeSumVo.java

@@ -0,0 +1,16 @@
+package com.game.business.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class RechargeSumVo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Double totalCoin;
+
+    private Double totalDiamondCoin;
+
+}

+ 40 - 0
game-business/src/main/resources/mapper/business/AppUsersChargeMapper.xml

@@ -80,6 +80,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         order by addtime desc
     </select>
+
+    <select id="selectRechargeSum" parameterType="com.game.business.domain.AppUsersCharge" resultType="com.game.business.vo.RechargeSumVo">
+        select ifnull(sum(case when coin_type=0 then coin else 0 end),0) as totalCoin,
+               ifnull(sum(case when coin_type=1 then coin else 0 end),0) as totalDiamondCoin
+        from app_users_charge
+        <where>
+            <if test="addtime != null "> and addtime = #{addtime}</if>
+            <if test="updateTime != null "> and update_time = #{updateTime}</if>
+            <if test="afterCoin != null "> and after_coin = #{afterCoin}</if>
+            <if test="agentId != null "> and agent_id = #{agentId}</if>
+            <if test="ambient != null "> and ambient = #{ambient}</if>
+            <if test="coin != null "> and coin = #{coin}</if>
+            <if test="coinType != null "> and coin_type = #{coinType}</if>
+            <if test="coinGive != null "> and coin_give = #{coinGive}</if>
+            <if test="platformServiceRate != null "> and platform_service = #{platformService}</if>
+            <if test="platformService != null "> and platform_service_rate = #{platformServiceRate}</if>
+            <if test="isAgent != null "> and is_agent = #{isAgent}</if>
+            <if test="isDelete != null "> and is_delete = #{isDelete}</if>
+            <if test="isWater != null "> and is_water = #{isWater}</if>
+            <if test="money != null "> and money = #{money}</if>
+            <if test="optType != null "> and opt_type = #{optType}</if>
+            <if test="optUser != null  and optUser != ''"> and opt_user = #{optUser}</if>
+            <if test="orderno != null  and orderno != ''"> and orderno = #{orderno}</if>
+            <if test="pid != null "> and pid = #{pid}</if>
+            <if test="pidLevel1 != null "> and pid_level1 = #{pidLevel1}</if>
+            <if test="pidLevel2 != null "> and pid_level2 = #{pidLevel2}</if>
+            <if test="pidLevel3 != null "> and pid_level3 = #{pidLevel3}</if>
+            <if test="pidLevel4 != null "> and pid_level4 = #{pidLevel4}</if>
+            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="ruleId != null "> and rule_id = #{ruleId}</if>
+            <if test="status != null "> and status = #{status}</if>
+            <if test="touid != null "> and touid = #{touid}</if>
+            <if test="tradeNo != null  and tradeNo != ''"> and trade_no = #{tradeNo}</if>
+            <if test="type != null "> and type = #{type}</if>
+            <if test="uid != null "> and uid = #{uid}</if>
+            <if test="channelId != null "> and channel_id = #{channelId}</if>
+            <if test="beginTime != null  and beginTime != ''"> and addtime &gt; CONCAT(#{beginTime},' 00:00:00')</if>
+            <if test="endTime != null  and endTime != ''"> and addtime &lt; CONCAT(#{endTime},' 23:59:59')</if>
+        </where>
+    </select>
     
     <select id="selectAppUsersChargeById" parameterType="Long" resultMap="AppUsersChargeResult">
         <include refid="selectAppUsersChargeVo"/>

+ 38 - 0
game-business/src/main/resources/mapper/business/FinTranRecordMapper.xml

@@ -432,4 +432,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </if>
     </select>
 
+    <select id="selectRechargeAmount" resultType="com.game.business.vo.RechargeAmountVo">
+        SELECT
+            sum(
+                    ifnull( a.diamond_coin_change, 0 )) AS amount,
+            sum(
+                    ifnull( b.coin_give, 0 )) AS giveAmount
+        FROM
+            fin_tran_record AS a
+                LEFT JOIN app_users_charge AS b ON a.tran_group_id = b.orderno
+        WHERE
+            a.tran_type3 IN ( '1001', '1101', '1108', '1601' )
+          AND a.tran_type1 = '17'
+          <if test="withdrawFlag != null">
+                AND a.withdraw_flag = #{withdrawFlag}
+          </if>
+          AND a.uid = #{userId}
+          AND a.currency_type = 4
+        ORDER BY
+            a.create_time DESC
+    </select>
+
+    <select id="selectRechargeDate" resultType="java.util.Date">
+        SELECT
+            min(a.create_time)
+        FROM
+            fin_tran_record AS a
+        WHERE
+            a.tran_type3 IN ( '1001', '1101', '1108', '1601' )
+          AND a.tran_type1 = '17'
+          <if test="withdrawFlag != null">
+                AND a.withdraw_flag = #{withdrawFlag}
+          </if>
+          AND a.uid = #{userId}
+          AND a.currency_type = 4
+        ORDER BY
+            a.create_time DESC
+    </select>
+
 </mapper>

+ 9 - 0
game-ui/src/api/business/charge.js

@@ -9,6 +9,15 @@ export function listCharge(query) {
   })
 }
 
+// 查询充值记录统计
+export function selectRechargeSum(query) {
+  return request({
+    url: '/business/charge/selectRechargeSum',
+    method: 'get',
+    params: query
+  })
+}
+
 // 查询充值渠道列表
 export function channelList(query) {
   return request({

+ 8 - 0
game-ui/src/api/business/user.js

@@ -57,6 +57,14 @@ export function getUser(userid) {
   })
 }
 
+// 查询app用户充值打码量
+export function getRechargeAmount(userid) {
+  return request({
+    url: '/business/user/getRechargeAmount/' + userid,
+    method: 'get'
+  })
+}
+
 // 新增app用户
 export function addUser(data) {
   return request({

+ 252 - 32
game-ui/src/views/business/user/index.vue

@@ -436,7 +436,7 @@
     </el-dialog>
 
     <!-- 充值对话框 -->
-    <el-dialog :title="title" :visible.sync="chargeopen" width="700px" append-to-body>
+    <el-dialog :title="title" :visible.sync="chargeopen" width="80%" append-to-body>
       <el-form ref="chargeForm" :model="chargeForm" :rules="currentRules" :validate-on-rule-change=false label-width="150px">
         <el-form-item label="用户id" prop="userId">
           <el-input v-model="chargeForm.userId" disabled />
@@ -485,10 +485,90 @@
         </template>
 
       </el-form>
-      <div slot="footer" class="dialog-footer">
+      <div style="text-align: right">
         <el-button type="primary" @click="submitChargeForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
+      <div style="border-top: 4px solid #c2b8b8; margin-top: 22px;">
+        <h3><b>充值记录</b></h3>
+      </div>
+      <div style="    margin-bottom: 18px;">
+        <span>已充值余额:{{rechargeSum.totalDiamondCoin}}</span>
+        <span style="padding-left: 15px">已充值金币:{{rechargeSum.totalCoin}}</span>
+      </div>
+      <el-form :model="rechargeQueryParams" ref="rechargeQueryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
+        <el-form-item label="充值渠道" prop="channelId">
+          <el-select v-model="rechargeQueryParams.channelId" placeholder="请选择充值渠道">
+            <el-option
+              v-for="item in rechargeTypeList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="日期" prop="rechargeDaterange">
+          <el-date-picker
+            v-model="rechargeDaterange"
+            style="width: 240px"
+            value-format="yyyy-MM-dd"
+            type="daterange"
+            range-separator="-"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            @change="rechargeDateChage"
+          ></el-date-picker>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="el-icon-search" size="mini" @click="rechargeHandleQuery">搜索</el-button>
+          <el-button icon="el-icon-refresh" size="mini" @click="resetRechareQuery">重置</el-button>
+        </el-form-item>
+      </el-form>
+
+      <el-table v-loading="rechargeLoading" :data="chargeList">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="" align="center" prop="id" />
+        <el-table-column label="UID" align="center" prop="uid" />
+        <el-table-column label="充值类型" align="center" prop="type">
+          <template slot-scope="scope">
+            {{scope.row.type==4?"手工充值":"在线充值"}}
+          </template>
+        </el-table-column>
+        <el-table-column label="充值渠道" align="center" prop="channelId">
+          <template slot-scope="scope">
+            <span>{{ getRechargeTypeName(scope.row.channelId) }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="充值时间" align="center" prop="addtime" width="180">
+          <template slot-scope="scope">
+            <span>{{ parseTime(scope.row.addtime, '{y}-{m}-{d} {h}:{i}:{s}')}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="充值金额" align="center" prop="coin" />
+        <el-table-column label="货币类型" align="center" prop="coinType">
+          <template slot-scope="scope">
+            <dict-tag :options="dict.type.app_user_coin_type" :value="scope.row.coinType"/>
+          </template>
+        </el-table-column>
+        <el-table-column label="赠送金额" align="center" prop="coinGive"></el-table-column>
+        <el-table-column label="备注" align="center" prop="remarks" />
+        <el-table-column label="状态" align="center" prop="status">
+          <template slot-scope="scope">
+            <dict-tag :options="dict.type.app_users_charge_status" :value="scope.row.status"/>
+          </template>
+        </el-table-column>
+        <el-table-column label="平台服务费" align="center" prop="platformService" width="100"/>
+
+        <el-table-column label="订单号" align="center" prop="orderno" width="180"/>
+        <el-table-column label="四方方平台订单号" align="center" prop="tradeNo" width="180"/>
+      </el-table>
+      <pagination
+        v-show="rechargeTotal>0"
+        :total="rechargeTotal"
+        :page.sync="rechargeQueryParams.pageNum"
+        :limit.sync="rechargeQueryParams.pageSize"
+        @pagination="getRechargeList"
+      />
     </el-dialog>
 
     <!-- 补足流水对话框 -->
@@ -497,6 +577,9 @@
         <el-form-item label="用户id" prop="userId">
           <el-input v-model="resetWithdrawForm.userId" disabled />
         </el-form-item>
+        <el-form-item label="打码量剩余" prop="userId">
+          <el-input v-model="rechargeAmount.lackAmount" disabled />
+        </el-form-item>
         <el-form-item label="金额" prop="amount">
           <el-input type="text" v-model="resetWithdrawForm.amount" placeholder="请输入金额" />
         </el-form-item>
@@ -955,12 +1038,13 @@
 </template>
 
 <script>
-import { listUser, getUser, delUser, addUser, updateUser,resetUser,userCharge,channelList,withdraw,openLive,userDetail,liveCommission,getGift,updateUserAgent,updateGameCommissionAgent,restPayPwd  } from "@/api/business/user";
+import { listUser, getUser, delUser, addUser, updateUser,resetUser,userCharge,channelList,withdraw,openLive,userDetail,liveCommission,getGift,updateUserAgent,updateGameCommissionAgent,restPayPwd,getRechargeAmount  } from "@/api/business/user";
 import { listAccount} from "@/api/business/account";
 import { listOrder } from "@/api/business/order";
 import { listHistoryWeb} from "@/api/business/betting";
 import {allGameList } from "@/api/business/game_item";
 import {allList} from "@/api/business/lottery";
+import { listCharge, selectRechargeSum } from "@/api/business/charge";
 
 export default {
   name: "User",
@@ -973,6 +1057,7 @@ export default {
       activeName2:"first",
       // 遮罩层
       loading: true,
+      rechargeLoading: true,
       ipLoading: true,
       accountLoading: true,
       orderLoading: true,
@@ -989,6 +1074,7 @@ export default {
       showSearch: true,
       // 总条数
       total: 0,
+      rechargeTotal: 0,
       ipTotal: 0,
       accountTotal: 0,
       orderTotal: 0,
@@ -1015,6 +1101,7 @@ export default {
       // 是否显示弹出层
       chargeopen: false,
       channelList:[],
+      rechargeDaterange:[],
       isReadOnly:true,
       rate:null,
       channelMap:{},
@@ -1029,6 +1116,11 @@ export default {
       downUserList:[],
       typeMap:{},
       typeList:[],
+      chargeList:[],
+      rechargeSum:{},
+      rechargeTypeMap:{},
+      rechargeTypeList:[],
+      rechargeAmount:{},
       gameItemMap:{},
       gameItemList:[],
       gameItemShowList:[],
@@ -1107,6 +1199,42 @@ export default {
         diamondCoin: null,
         mobile:null,
       },
+      // 查询参数
+      rechargeQueryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        addtime: null,
+        afterCoin: null,
+        agentId: null,
+        ambient: null,
+        coin: null,
+        coinType: null,
+        coinGive: null,
+        isAgent: null,
+        isDelete: null,
+        isWater: null,
+        money: null,
+        optType: null,
+        optUser: null,
+        orderno: null,
+        pid: null,
+        pidLevel1: null,
+        pidLevel2: null,
+        pidLevel3: null,
+        pidLevel4: null,
+        remarks: null,
+        ruleId: null,
+        status: null,
+        touid: null,
+        tradeNo: null,
+        type: null,
+        uid: null,
+        platformService: null,
+        platformServiceRate: null,
+        channelId: null,
+        beginTime:null,
+        endTime:null
+      },
       // 表单参数
       form: {},
       //重置密码
@@ -1181,6 +1309,20 @@ export default {
       that.getList();
 
     });
+    channelList().then(response => {
+      if(response.data){
+        for(var i in response.data){
+          var item = response.data[i];
+          that.rechargeTypeMap[item.id.toString()] = item.name;
+          that.rechargeTypeList.push({
+            value:item.id,
+            label:item.name
+          })
+        }
+      }
+      this.getList();
+
+    })
   },
   computed: {
     currentRules:function(){
@@ -1195,6 +1337,31 @@ export default {
     },
   },
   methods: {
+    /** 搜索按钮操作 */
+    rechargeHandleQuery() {
+      this.rechargeQueryParams.pageNum = 1;
+      this.getRechargeList();
+    },
+    /** 查询充值记录列表 */
+    getRechargeList() {
+      this.rechargeLoading = true;
+      listCharge(this.rechargeQueryParams).then(response => {
+        this.chargeList = response.rows;
+        this.rechargeTotal = response.total;
+        this.rechargeLoading = false;
+      });
+      selectRechargeSum(this.rechargeQueryParams).then(response=>{
+        if(response.data != null && response.data != undefined){
+          this.rechargeSum = response.data;
+        }else{
+          this.rechargeSum = {
+            totalDiamondCoin:0,
+            totalCoin:0
+          }
+        }
+      })
+      console.log(this.chargeList)
+    },
     getBettingInfo(row){
       let detailsCountVOList = row.detailsCountVOList;
       if(!detailsCountVOList){
@@ -1281,6 +1448,15 @@ export default {
     getTypeName(id) {
       return this.typeMap[id.toString()];
     },
+    getRechargeTypeName(id) {
+      if(id == null || id == undefined){
+        return "-";
+      }
+      if(undefined == this.typeMap[id.toString()] || null == this.typeMap[id.toString()]){
+        return "-";
+      }
+      return this.typeMap[id.toString()];
+    },
     /** 查询app用户列表 */
     getList() {
       this.loading = true;
@@ -1571,6 +1747,20 @@ export default {
       this.resetForm("queryForm");
       this.handleQuery();
     },
+    /** 重置按钮操作 */
+    resetRechareQuery() {
+      this.resetForm("rechareQueryForm");
+      this.rechargeDaterange = [];
+      this.chargeList = [];
+      this.rechargeQueryParams.beginTime = null;
+      this.rechargeQueryParams.endTime = null;
+      this.rechargeQueryParams.uid = this.chargeForm.userId;
+      this.rechargeSum = {
+        totalDiamondCoin:0,
+        totalCoin:0
+      };
+      this.rechargeHandleQuery();
+    },
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.userid)
@@ -1629,8 +1819,20 @@ export default {
         userId:userid,
         password:""
       };
-      this.resetWithdrawopen = true;
-      this.title = "补足提现流水";
+      const loading = this.$loading({
+        lock: true,
+        text: '加载中',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      getRechargeAmount(userid).then(response=>{
+        this.rechargeAmount = response.data;
+        this.resetWithdrawopen = true;
+        this.resetWithdrawForm.amount = this.rechargeAmount.lackAmount;
+        this.title = "补足提现流水";
+        loading.close();
+      })
+
     },
     /** 充值按钮操作 */
     handleCharge(row) {
@@ -1654,9 +1856,11 @@ export default {
       const userid = row.userid;
       this.chargeForm = {
         userId:userid,
+        nickname:row.nickname,
         type: null,
         amount:null
       };
+      this.resetRechareQuery();
       this.chargeopen = true;
       this.title = "充值";
 
@@ -1746,7 +1950,6 @@ export default {
             spinner: 'el-icon-loading',
             background: 'rgba(0, 0, 0, 0.7)'
           });
-          setTimeout(function (){loading.close();},1000);
           withdraw(this.resetWithdrawForm).then(response => {
             this.$modal.msgSuccess("补足流水成功");
             this.resetWithdrawopen = false;
@@ -1759,33 +1962,41 @@ export default {
     /** 充值提交按钮 */
     submitChargeForm() {
       var that =this;
-      this.$refs["chargeForm"].validate(valid => {
-        if (valid) {
-          if(that.chargeForm.isRate != 1){
-            that.chargeForm.rate = null;
-          }
-          if(that.chargeForm.channelId == -1 && (undefined == that.chargeForm.rate || null == that.chargeForm.rate)){
-            this.$modal.msgError("请输入手续费比例");
-            return;
-          }
-          if(that.chargeForm.channelId == -1 &&  that.chargeForm.rate >= 1){
-            this.$modal.msgError("手续费比例超过最大值");
-            return;
+      this.$confirm('是否确认给用户'+that.chargeForm.nickname+'('+that.chargeForm.userId+')充值金额'+that.chargeForm.amount+'?', '充值提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$refs["chargeForm"].validate(valid => {
+          if (valid) {
+            if(that.chargeForm.isRate != 1){
+              that.chargeForm.rate = null;
+            }
+            if(that.chargeForm.channelId == -1 && (undefined == that.chargeForm.rate || null == that.chargeForm.rate)){
+              this.$modal.msgError("请输入手续费比例");
+              return;
+            }
+            if(that.chargeForm.channelId == -1 &&  that.chargeForm.rate >= 1){
+              this.$modal.msgError("手续费比例超过最大值");
+              return;
+            }
+            const loading = this.$loading({
+              lock: true,
+              text: '加载中',
+              spinner: 'el-icon-loading',
+              background: 'rgba(0, 0, 0, 0.7)'
+            });
+            // setTimeout(function (){loading.close();},1000);
+            userCharge(this.chargeForm).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.chargeopen = false;
+              this.getList();
+              loading.close();
+            });
           }
-          const loading = this.$loading({
-            lock: true,
-            text: '加载中',
-            spinner: 'el-icon-loading',
-            background: 'rgba(0, 0, 0, 0.7)'
-          });
-          // setTimeout(function (){loading.close();},1000);
-          userCharge(this.chargeForm).then(response => {
-            this.$modal.msgSuccess("修改成功");
-            this.chargeopen = false;
-            this.getList();
-            loading.close();
-          });
-        }
+        });
+      }).catch(() => {
+        //取消
       });
     },
     /** 开关播提交按钮 */
@@ -1985,6 +2196,15 @@ export default {
       if("eight" == tab.$options.propsData.name){
         this.getBettingList();
       }
+    },
+    rechargeDateChage(val){
+      if(undefined != val && null != val && val.length > 1){
+        this.rechargeQueryParams.beginTime = val[0];
+        this.rechargeQueryParams.endTime = val[1];
+      }else{
+        this.rechargeQueryParams.beginTime = null;
+        this.rechargeQueryParams.endTime = null;
+      }
     }
   }
 };