<template>
  <el-tabs v-model="activeName" @tab-click="handleClick">
    <el-tab-pane label="提现管理" name="first">
      <div style="margin:5px;display: inline-block;">
        <div style="position: relative;display: inline-block;">
          <span>支付宝账号：</span>
          <el-input
            style="width: 200px;"
            @keydown.enter.native="phoneSelect"
            placeholder="请输入支付宝账号"
            v-model="zhifubao"
          ></el-input
          >&nbsp;&nbsp;&nbsp;
          <span
            @click="phoneSelect"
            style="position: absolute;right: 18px;top:8px;"
          >
            <icon-svg name="shousuo" class="site-sidebar__menu-icon"></icon-svg>
          </span>
        </div>
        <div style="position: relative;display: inline-block;">
          <span>支付宝名称：</span>
          <el-input
            style="width: 200px;"
            @keydown.enter.native="phoneSelect"
            placeholder="请输入支付宝名称"
            v-model="zhifubaoName"
          ></el-input
          >&nbsp;&nbsp;&nbsp;
          <span
            @click="phoneSelect"
            style="position: absolute;right: 18px;top:8px;"
          >
            <icon-svg name="shousuo" class="site-sidebar__menu-icon"></icon-svg>
          </span>
        </div>
        <div style="position: relative;display: inline-block;">
          <span>骑手手机号：</span>
          <el-input
            style="width: 200px;"
            @keydown.enter.native="phoneSelect"
            placeholder="请输入骑手手机号"
            v-model="riderPhone"
          ></el-input
          >&nbsp;&nbsp;&nbsp;
          <span
            @click="phoneSelect"
            style="position: absolute;right: 18px;top:8px;"
          >
            <icon-svg name="shousuo" class="site-sidebar__menu-icon"></icon-svg>
          </span>
        </div>
        <div style="position: relative;display: inline-block;">
          <span>骑手名称：</span>
          <el-input
            style="width: 200px;"
            @keydown.enter.native="phoneSelect"
            placeholder="请输入骑手名称"
            v-model="riderName"
          ></el-input
          >&nbsp;&nbsp;&nbsp;
          <span
            @click="phoneSelect"
            style="position: absolute;right: 18px;top:8px;"
          >
            <icon-svg name="shousuo" class="site-sidebar__menu-icon"></icon-svg>
          </span>
        </div>
        <!-- <div style="margin:2% 0;display: inline-block;">
					<span>手机号:</span>
					<el-input style="width: 150px;" @keydown.enter.native="phoneSelect" clearable placeholder="请输入手机号"
						v-model="phone"></el-input>
				</div>&emsp;&emsp; -->
        <div style="position: relative;display: inline-block;">
          <span>状态：</span>
          <el-select
            v-model="indentState"
            style="width:150px;margin-left: 10px;"
            @change="phoneSelect(indentState)"
          >
            <el-option
              v-for="item in statesnum"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option> </el-select
          >&nbsp;&nbsp;&nbsp;
        </div>
        <div style="margin:5px;display: inline-block;">
          <span>申请开始时间：</span>
          <el-date-picker
            style="width: 200px;margin-left: 10px;"
            v-model="startTime"
            align="right"
            type="datetime"
            format="yyyy-MM-dd HH:mm:ss"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="选择开始时间"
          >
          </el-date-picker
          >&nbsp;&nbsp;&nbsp;
        </div>
        <div style="margin:5px;display: inline-block;">
          <span>申请截止时间：</span>
          <el-date-picker
            style="width: 200px;margin-left: 10px;"
            v-model="endTime"
            align="right"
            type="datetime"
            format="yyyy-MM-dd HH:mm:ss"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="选择截止时间"
          >
          </el-date-picker
          >&nbsp;&nbsp;&nbsp;
        </div>
        <div style="position: relative;display: inline-block;">
          <span>骑手所在站点：</span>
          <el-select
            @change="phoneSelect"
            :clearable="true"
            v-model="stationName"
            placeholder="请选择骑手所在站点"
          >
            <el-option
              :label="i.stationName"
              :value="i.id"
              :key="i.id"
              v-for="i in stationData"
            ></el-option> </el-select
          >&nbsp;&nbsp;&nbsp;
        </div>
        <div style="margin:5px;display: inline-block;">
          <span>操作开始时间：</span>
          <el-date-picker
            style="width: 160px;margin-left: 10px;"
            v-model="outstartTime"
            align="right"
            type="datetime"
            format="yyyy-MM-dd"
            value-format="yyyy-MM-dd"
            placeholder="选择开始时间"
          >
          </el-date-picker
          >&nbsp;&nbsp;&nbsp;
        </div>
        <div style="margin:5px;display: inline-block;">
          <span>操作截止时间：</span>
          <el-date-picker
            style="width: 160px;margin-left: 10px;"
            v-model="outendTime"
            align="right"
            type="datetime"
            format="yyyy-MM-dd"
            value-format="yyyy-MM-dd"
            placeholder="选择截止时间"
          >
          </el-date-picker
          >&nbsp;&nbsp;&nbsp;
        </div>

        <div style="position: relative;display: inline-block;margin:5px;">
          <span>提现总金额：{{ totalMoney }}</span>
        </div>
      </div>
      <div style="display: inline-block;">
        <el-button
          style="margin:10px;"
          size="mini"
          type="primary"
          icon="document"
          @click="phoneSelect"
          >查询
        </el-button>
        <el-button
          style="margin:10px;"
          size="mini"
          type="primary"
          icon="document"
          @click="cleans2"
          >重置
        </el-button>
        <!-- <el-button style='margin:0 0 20px 20px;' size="mini" type="primary" icon="document"
					@click="transferClcik()" :disabled="checkBoxData.length <= 0 || !isAuth('financeListRun:transfer')">
					批量转账
				</el-button> -->
        <el-button
          style="margin-left:15px;"
          size="mini"
          type="warning"
          icon="document"
          @click="exportBtn"
          >导出Excel
        </el-button>
      </div>
      <div style="color: orange;" v-if="enable">
        * 转账提示：已使用最新商户号的自动提现方式
      </div>
      <div style="color: orange;" v-else>
        * 转账提示：使用原来微信商户号提现方式
      </div>
      <div style="color: orange;">
        *
        导出提示：导出数据前请进行时间或者状态等筛选，否则导出数据量过多易出现卡顿或系统崩溃
      </div>
      <el-table
        @selection-change="changeFun"
        v-loading="tableDataLoading"
        :data="tableData"
      >
        <el-table-column type="selection"> </el-table-column>
        <el-table-column fixed prop="id" label="编号" width="80">
        </el-table-column>
        <el-table-column prop="userName" label="骑手名称" width="150">
        </el-table-column>
        <el-table-column prop="phoneNumber" label="骑手手机号" width="150">
        </el-table-column>
        <el-table-column prop="bankCardNo" label="银行卡号" width="150">
        </el-table-column>
        <el-table-column prop="openBank" label="开户银行" width="150">
        </el-table-column>
        <el-table-column prop="bankRealName" label="开户人姓名" width="150">
        </el-table-column>

        <el-table-column prop="zhifubao" label="支付宝账号" width="150">
          <template slot-scope="scope">
            <span
              style="color: #4f9dec;cursor: pointer;"
              @click="updates(scope.row)"
              v-if="scope.row.zhifubao"
              >{{
                scope.row.zhifubao != "null" ? scope.row.zhifubao : "未绑定"
              }}</span
            >
            <span v-else>未绑定</span>
          </template>
        </el-table-column>
        <el-table-column prop="zhifubaoName" label="支付宝名称" width="100">
          <template slot-scope="scope">
            <span v-if="scope.row.zhifubaoName">{{
              scope.row.zhifubaoName != "null"
                ? scope.row.zhifubaoName
                : "未绑定"
            }}</span>
            <span v-else>未绑定</span>
          </template>
        </el-table-column>
        <el-table-column prop="cardFront" label="收款二维码" width="150">
          <template slot-scope="scope">
            <div
              v-if="scope.row.cashQrCode == null || scope.row.cashQrCode == ''"
            >
              暂无图片
            </div>
            <div
              v-if="scope.row.cashQrCode"
              style="display:flex;flex-wrap: wrap;"
            >
              <el-popover placement="top-start" title="" trigger="hover">
                <img
                  style="width: 50px; height: 50px"
                  :src="scope.row.cashQrCode"
                  alt=""
                  slot="reference"
                />
                <img
                  style="width: 200px; height: 200px"
                  :src="scope.row.cashQrCode"
                  alt=""
                />
              </el-popover>
            </div>
          </template>
        </el-table-column>
        <!-- <el-table-column prop="phone" label="手机号" width="150">
				</el-table-column> -->

        <el-table-column prop="state" label="提现方式" width="100">
          <template slot-scope="scope">
            <span v-if="scope.row.classify == 1">支付宝</span>
            <span v-if="scope.row.classify == 2">微信小程序</span>
          </template>
        </el-table-column>
        <el-table-column prop="money" label="提现金额" width="100">
        </el-table-column>
        <el-table-column prop="state" label="状态" width="100">
          <template slot-scope="scope">
            <span
              style="color: #4f9dec;cursor: pointer;"
              v-if="scope.row.state == 0"
              >待转账</span
            >
            <span v-if="scope.row.state == 1">已转账</span>
            <span v-if="scope.row.state == -1">已拒绝</span>
          </template>
        </el-table-column>
        <el-table-column prop="rate" label="手续费" width="150">
        </el-table-column>
        <el-table-column prop="currentBalance" label="当前余额" width="150">
        </el-table-column>
        <el-table-column prop="refund" label="拒绝原因" width="220">
        </el-table-column>
        <el-table-column prop="createAt" label="申请时间" width="170">
        </el-table-column>
        <el-table-column prop="outAt" label="转账/拒绝时间" width="180">
        </el-table-column>
        <el-table-column prop="orderNumber" label="转账订单号" width="150">
        </el-table-column>
        <el-table-column prop="stationName" label="骑手所在站点" width="150">
        </el-table-column>

        <el-table-column fixed="right" label="操作" width="180">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="primary"
              :disabled="
                isAuth('financeListRun:transfer') && scope.row.state != 0
              "
              @click="batch(scope.row)"
              >转账
            </el-button>
            <el-button
              size="mini"
              type="primary"
              :disabled="
                isAuth('financeListRun:refund') && scope.row.state != 0
              "
              @click="refund(scope.row)"
              >拒绝
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <div style="text-align: center;margin-top: 10px;">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :page-sizes="[10, 20, 30, 40]"
          :page-size="limit"
          :current-page="page"
          layout="total,sizes, prev, pager, next,jumper"
          :total="totalnum"
        >
        </el-pagination>
      </div>
      <!-- 拒绝弹框 -->
      <!-- <el-dialog title="拒绝" :visible.sync="dialogFormVisible" center>
				<el-form :model="form">
					<el-form-item label="拒绝原因：" :label-width="formLabelWidth">
						<el-input v-model="form.content" type="textarea" rows="4" placeholder="请输入拒绝原因"
							style="width:65%;"></el-input>
					</el-form-item>
				</el-form>
				<div slot="footer" class="dialog-footer">
					<el-button @click="dialogFormVisible = false">取 消</el-button>
					<el-button type="primary" @click="refundNoticeTo()">确 定</el-button>
				</div>
			</el-dialog> -->
    </el-tab-pane>
    <el-tab-pane label="收入统计" name="second">
      <div>
        <span>时间类型：</span>
        <el-select
          v-model="flag"
          style="width:150px;margin-left: 10px;"
          @change="animeDat"
        >
          <el-option
            v-for="item in flags"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option> </el-select
        >&nbsp;&nbsp;&nbsp;
        <el-date-picker
          style="width: 300px;margin-left: 10px;"
          v-model="info1.stockDate1"
          align="right"
          type="date"
          format="yyyy-MM-dd"
          value-format="yyyy-MM-dd"
          placeholder="选择开始时间"
          @change="animeSelect"
        >
        </el-date-picker>
      </div>
      <el-row v-loading="tableDataLoading1">
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">发布任务支出金额</div>
              <div class="text_color">
                <span>{{
                  MoneyData.indentMoney ? MoneyData.indentMoney : 0
                }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">用户收益</div>
              <div class="text_color">
                <span>{{
                  MoneyData.riderMoney ? MoneyData.riderMoney : 0
                }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">平台任务收益</div>
              <div class="text_color">
                <span>{{
                  MoneyData.platformMoney ? MoneyData.platformMoney : 0
                }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
    </el-tab-pane>
    <el-tab-pane label="提现统计" name="third">
      <div>
        <span>时间类型：</span>
        <el-select
          v-model="flag"
          style="width:150px;margin-left: 10px;"
          @change="animeDat2"
        >
          <el-option
            v-for="item in flags"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option> </el-select
        >&nbsp;&nbsp;&nbsp;
        <el-date-picker
          style="width: 300px;margin-left: 10px;"
          v-model="info1.stockDate1"
          align="right"
          type="date"
          format="yyyy-MM-dd"
          value-format="yyyy-MM-dd"
          placeholder="选择开始时间"
          @change="animeSelect2"
        >
        </el-date-picker>
      </div>
      <el-row v-loading="tableDataLoading2">
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">累计提现金额</div>
              <div class="text_color">
                <span>{{ withdrawData.sumMoney }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">提现次数</div>
              <div class="text_color">
                <span>{{ withdrawData.countMoney }}</span
                >笔
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">待转账次数</div>
              <div class="text_color">
                <span>{{ withdrawData.stayMoney }}</span
                >笔
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">申请提现金额</div>
              <div class="text_color">
                <span>{{ withdrawData.applyMoneySum }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>

        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">累计提现金额(提现成功)</div>
              <div class="text_color">
                <span>{{ withdrawData.sumMoneySucceed }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">提现笔数(提现成功)</div>
              <div class="text_color">
                <span>{{ withdrawData.countMoneySucceed }}</span
                >笔
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">待转账金额</div>
              <div class="text_color">
                <span>{{ withdrawData.sumMoneyAwait }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">已转账金额</div>
              <div class="text_color">
                <span>{{ withdrawData.accomplishMoneySum }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">已拒绝金额</div>
              <div class="text_color">
                <span>{{ withdrawData.refuseMoneySum }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">支付宝提现金额</div>
              <div class="text_color">
                <span>{{ withdrawData.zhifubaoMoneySum }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">微信提现金额</div>
              <div class="text_color">
                <span>{{ withdrawData.weixinMoneySum }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">保证金退款统计金额</div>
              <div class="text_color">
                <span>{{ withdrawData.cashDepositMoneySum }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
    </el-tab-pane>

    <el-tab-pane label="充值统计" name="sixth">
      <div>
        <span>时间类型：</span>
        <el-select
          v-model="flag"
          style="width:150px;margin-left: 10px;"
          @change="animeDat3"
        >
          <el-option
            v-for="item in flags"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option> </el-select
        >&nbsp;&nbsp;&nbsp;
        <el-date-picker
          style="width: 300px;margin-left: 10px;"
          v-model="info1.stockDate1"
          align="right"
          type="date"
          format="yyyy-MM-dd"
          value-format="yyyy-MM-dd"
          placeholder="选择开始时间"
          @change="animeSelect3"
        >
        </el-date-picker>
      </div>
      <el-row v-loading="tableDataLoading3">
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">充值总金额</div>
              <div class="text_color">
                <span>{{ rechgeData.sumMoney ? rechgeData.sumMoney : 0 }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">微信公众号充值金额</div>
              <div class="text_color">
                <span>{{
                  rechgeData.weiXinGZHMoney ? rechgeData.weiXinGZHMoney : 0
                }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">微信小程序充值金额</div>
              <div class="text_color">
                <span>{{
                  rechgeData.weiXinXCXMoney ? rechgeData.weiXinXCXMoney : 0
                }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
    </el-tab-pane>
    <el-tab-pane label="充值记录" name="fourth">
      <!-- <div style="margin:2% 0;display: inline-block;">
				<span>状态：</span>
				<el-select v-model="state" placeholder="请选择状态" style="width:150px;" @change="selectTrigger(state)">
					<el-option v-for="item in states" :key="item.value" :label="item.label" :value="item.value">
					</el-option>
				</el-select>
			</div> -->
      <div style="display: inline-block;">
        <span>开始时间：</span>
        <el-date-picker
          style="width: 160px;margin-left: 10px;"
          v-model="startTime"
          align="right"
          type="datetime"
          format="yyyy-MM-dd"
          value-format="yyyy-MM-dd"
          placeholder="选择开始时间"
        >
        </el-date-picker
        >&nbsp;&nbsp;&nbsp;
        <span>截止时间：</span>
        <el-date-picker
          style="width: 160px;margin-left: 10px;"
          v-model="endTime"
          align="right"
          type="datetime"
          format="yyyy-MM-dd"
          value-format="yyyy-MM-dd"
          placeholder="选择截止时间"
        >
        </el-date-picker>
        <el-button
          style="margin-left:15px;"
          size="mini"
          type="primary"
          icon="document"
          @click="timeDate"
          >查询
        </el-button>
      </div>
      <el-table v-loading="tableDataLoading" :data="rechargeData.list">
        <el-table-column fixed prop="id" label="编号" width="80">
        </el-table-column>
        <el-table-column prop="nickName" label="用户名称">
          <template slot-scope="scope">
            <span
              style="color: #4f9dec;cursor: pointer;"
              @click="updates(scope.row)"
              >{{ scope.row.nickName ? scope.row.nickName : "未绑定" }}</span
            >
          </template>
        </el-table-column>
        <el-table-column
          prop="orderId"
          label="充值订单号"
          width="200"
        ></el-table-column>
        <el-table-column prop="money" label="充值金额"></el-table-column>
        <el-table-column prop="userId" label="会员编号"></el-table-column>
        <el-table-column label="分类">
          <template slot-scope="scope">
            <span
              style="color: #4f9dec;cursor: pointer;"
              v-if="scope.row.classify == 1"
              >微信</span
            >
            <span
              style="color: #4f9dec;cursor: pointer;"
              v-if="scope.row.classify == 2"
              >支付宝</span
            >
          </template>
        </el-table-column>
        <el-table-column label="状态">
          <template slot-scope="scope">
            <span
              style="color: #4f9dec;cursor: pointer;"
              v-if="scope.row.state == 0"
              >待支付</span
            >
            <span
              style="color: #4f9dec;cursor: pointer;"
              v-if="scope.row.state == 1"
              >支付成功</span
            >
            <span
              style="color: #4f9dec;cursor: pointer;"
              v-if="scope.row.state == 2"
              >支付失败</span
            >
          </template>
        </el-table-column>
        <el-table-column prop="createTime" label="创建时间" width="170">
        </el-table-column>
        <el-table-column prop="payTime" label="支付时间" width="170">
        </el-table-column>
      </el-table>
      <div style="text-align: center;margin-top: 10px;">
        <el-pagination
          @size-change="handleSizeChange1"
          @current-change="handleCurrentChange1"
          :page-sizes="[10, 20, 30, 40]"
          :page-size="limit"
          :current-page="page"
          layout="total,sizes, prev, pager, next,jumper"
          :total="rechargeData.totalCount"
        >
        </el-pagination>
      </div>
    </el-tab-pane>
    <el-tab-pane label="保证金管理" name="baozhengjin">
      <!-- <div style="margin:2% 0;display: inline-block;">
				<div style="position: relative;display: inline-block;">
					<el-input style="width: 200px;" @keydown.enter.native="phoneSelect" placeholder="请输入支付宝号查询"
						v-model="zhifubao"></el-input>&nbsp;&nbsp;
					<span @click="phoneSelect" style="position: absolute;right: 18px;top:8px;">
						<icon-svg name="shousuo" class="site-sidebar__menu-icon"></icon-svg>
					</span>
				</div>
				<div style="position: relative;display: inline-block;">
					<el-input style="width: 200px;" @keydown.enter.native="phoneSelect" placeholder="请输入支付宝号名称"
						v-model="zhifubaoName"></el-input>&nbsp;&nbsp;
					<span @click="phoneSelect" style="position: absolute;right: 18px;top:8px;">
						<icon-svg name="shousuo" class="site-sidebar__menu-icon"></icon-svg>
					</span>
				</div>
			</div> -->
      <div style="margin:2% 0;display: inline-block;">
        <span>手机号:</span>
        <el-input
          style="width: 150px;"
          @keydown.enter.native="phoneSelect1"
          clearable
          placeholder="请输入手机号"
          v-model="phone"
        ></el-input>
      </div>
      &emsp;&emsp;
      <div style="position: relative;display: inline-block;">
        <span>状态：</span>
        <el-select
          v-model="type"
          style="width:150px;margin-left: 10px;"
          @change="phoneSelect1(type)"
        >
          <el-option
            v-for="item in statesnum1"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option> </el-select
        >&nbsp;&nbsp;
      </div>
      <div style="display: inline-block;">
        <el-button
          style="margin:10px;"
          size="mini"
          type="primary"
          icon="document"
          @click="phoneSelect1"
          >查询
        </el-button>
        <el-button
          style="margin:10px;"
          size="mini"
          type="primary"
          icon="document"
          @click="cleans1"
          >重置
        </el-button>
      </div>
      <el-table
        @selection-change="changeFun"
        v-loading="tableDataLoading"
        :data="tableData"
      >
        <el-table-column type="selection"> </el-table-column>
        <el-table-column fixed prop="id" label="编号" width="80">
        </el-table-column>
        <!-- <el-table-column prop="zhifubao" label="支付宝账号" width="150">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;"
							@click="updates(scope.row)">{{scope.row.zhifubao ? scope.row.zhifubao : '未绑定'}}</span>
					</template>
				</el-table-column>
				<el-table-column prop="zhifubaoName" label="支付宝名称" width="100">
					<template slot-scope="scope">
						<span>{{scope.row.zhifubaoName ? scope.row.zhifubaoName : '未绑定'}}</span>
					</template>
				</el-table-column> -->
        <el-table-column prop="nickName" label="用户昵称" width="120">
          <template slot-scope="scope">
            <div
              style="color: #4f9dec;cursor: pointer;"
              @click="updates(scope.row)"
            >
              {{ scope.row.nickName ? scope.row.nickName : "未绑定" }}
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="money" label="保证金" width="100">
        </el-table-column>
        <el-table-column prop="phone" label="手机号" width="150">
          <template slot-scope="scope">
            <span>{{ scope.row.phone ? scope.row.phone : "暂无" }}</span>
          </template>
        </el-table-column>

        <el-table-column prop="title" label="标题"> </el-table-column>
        <el-table-column prop="content" label="内容"> </el-table-column>
        <!-- <el-table-column prop="outAt" label="转账/拒绝时间" width="180">
				</el-table-column> -->
        <el-table-column prop="createTime" label="创建时间" width="150">
        </el-table-column>
        <el-table-column prop="type" label="状态" width="100" fixed="right">
          <template slot-scope="scope">
            <span v-if="scope.row.type == 1">已交保证金</span>
            <span v-if="scope.row.type == 2">已退保证金</span>
          </template>
        </el-table-column>
        <!-- <el-table-column fixed="right" label="操作" width="180">
					<template slot-scope="scope">
						<el-button size="mini" type="primary" :disabled="isAuth('financeListRun:transfer')&&scope.row.state != 0"
							@click="batch(scope.row)">转账
						</el-button>
						<el-button size="mini" type="primary" :disabled="isAuth('financeListRun:refund')&&scope.row.state != 0"
							@click="refund(scope.row)">拒绝
						</el-button>
					</template>
				</el-table-column> -->
      </el-table>
      <div style="text-align: center;margin-top: 10px;">
        <el-pagination
          @size-change="handleSizeChange2"
          @current-change="handleCurrentChange2"
          :page-sizes="[10, 20, 30, 40]"
          :page-size="limit"
          :current-page="page"
          layout="total,sizes, prev, pager, next,jumper"
          :total="totalnum"
        >
        </el-pagination>
      </div>
    </el-tab-pane>
    <el-tab-pane label="平台收入统计" name="pingtai">
      <div>
        <span>时间类型：</span>
        <el-select
          v-model="flag"
          style="width:150px;margin-left: 10px;"
          @change="animeDat2"
        >
          <el-option
            v-for="item in flags"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option> </el-select
        >&nbsp;&nbsp;&nbsp;
        <el-date-picker
          style="width: 300px;margin-left: 10px;"
          v-model="info1.stockDate1"
          align="right"
          type="date"
          format="yyyy-MM-dd"
          value-format="yyyy-MM-dd"
          placeholder="选择开始时间"
          @change="animeSelect2"
        >
        </el-date-picker>
      </div>
      <el-row v-loading="tableDataLoading4">
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">总收入</div>
              <div class="text_color">
                <span>{{ platformData.allMoneySum }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">服务费收入</div>
              <div class="text_color">
                <span>{{ platformData.serviceMoneySum }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">保价费收入</div>
              <div class="text_color">
                <span>{{ platformData.cargoInsurance }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">扣除骑手保证金收入</div>
              <div class="text_color">
                <span>{{ platformData.deductMoneySum }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">同城服务收入</div>
              <div class="text_color">
                <span>{{ platformData.fourthMoneySum }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">帮我送收入</div>
              <div class="text_color">
                <span>{{ platformData.firstMoneySum }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">帮我取收入</div>
              <div class="text_color">
                <span>{{ platformData.secondMoneySum }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">同城帮买收入</div>
              <div class="text_color">
                <span>{{ platformData.thirdMoneySum }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="6" class="cards">
          <div class="box">
            <div class="box_num">
              <div class="box_color">骑手保证金收入</div>
              <div class="text_color">
                <span>{{ platformData.cashDepositMoney }}</span
                >元
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
    </el-tab-pane>

    <!-- 拒绝弹框 -->
    <el-dialog title="拒绝" :visible.sync="dialogFormVisible" center>
      <el-form :model="form">
        <el-form-item label="拒绝原因：" :label-width="formLabelWidth">
          <el-input
            v-model="form.content"
            type="textarea"
            rows="4"
            placeholder="请输入拒绝原因"
            style="width:65%;"
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="refundNoticeTo()">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 导出限制 -->
    <el-dialog
      custom-class="export"
      :visible.sync="exportVisible"
      center
      :title="exportTitle"
      :close-on-click-modal="false"
    >
      <div class="con" v-show="exportFlag == 1">
        <img src="../../assets/img/error.png" alt="" />
        <span
          style="font-size:20px;color: #000;font-weight: 800;margin: 18px 0 5px;"
          >当前导出条数超过50000条，暂不支持导出</span
        >
        <span style="font-size:14px;color: #808080;"
          >（注：数据中的图片、附件只能以链接的形式导出）</span
        >
      </div>
      <div class="con" v-show="exportFlag == 2">
        <img class="gundong" src="../../assets/img/loading.png" alt="" />
        <span
          style="font-size:20px;color: #000;font-weight: 800;margin: 18px 0 5px;"
          >导出中...</span
        >
        <span style="font-size:14px;color: #808080;"
          >（注：请到个人导出记录查看并下载）</span
        >
      </div>
      <div class="con" v-show="exportFlag == 3">
        <img src="../../assets/img/success.png" alt="" />
        <span
          style="font-size:20px;color: #000;font-weight: 800;margin: 18px 0 5px;"
          >导出成功</span
        >
        <span style="font-size:14px;color: #808080;"
          >（注：请到个人导出记录查看并下载）</span
        >
      </div>
      <div class="con" v-show="exportFlag == 4">
        <img class="gundong" src="../../assets/img/loading.png" alt="" />
        <span
          style="font-size:20px;color: #000;font-weight: 800;margin: 18px 0 5px;"
          >版本迭代中，导出暂时无法使用</span
        >
      </div>
      <div class="btn">
        <el-button type="primary" @click="exportAffirm">确定</el-button>
      </div>
    </el-dialog>
  </el-tabs>
</template>

<script>
export default {
  data() {
    return {
      totalMoney: "", // 提现总金额
      stationData: [], // 骑手站点数据
      stationName: "",
      page: 1,
      limit: 10,
      balance: -1,
      zhifubao: "",
      tkstatus: -1,
      state: 1,
      states: [
        {
          label: "全部",
          value: ""
        },
        {
          label: "待充值",
          value: 0
        },
        {
          label: "充值成功",
          value: 1
        },
        {
          label: "充值失败",
          value: 2
        }
      ],
      zhifubaoName: "",
      riderPhone: "",
      riderName: "",
      content: "",
      startTime: "",
      endTime: "",
      outstartTime:"",
      outendTime:"",
      cashId: "",
      type: 1,
      totalnum: 0,
      totalnum2: 0,
      sqxTotal: "",
      userTotal: "",
      taunTotal: "",
      relationId: "",
      sumMoneyByTime: "",
      money: "",
      activeName: "first",
      formLabelWidth: "200px",
      dialogFormVisible: false,
      dialogFormVisible1: false,
      dialogFormVisible2: false,
      tableDataLoading: false,
      tableDataLoading1: false,
      tableDataLoading2: false,
      tableDataLoading3: false,
      tableDataLoading4: false,
      tableData: [],
      rechargeData: {},
      platformData: {},
      rechgeData: {},
      withdrawData: {},
      depositData: [],
      MoneyData: {},
      checkBoxData: [], //多选框选择的值
      flag: "",
      flag1: "",
      form: {
        cashId: "",
        content: ""
      },
      form2: {
        id: "",
        money: "",
        createTime: ""
      },
      info: {
        stockDate: this.getNowTime() //日期
      },
      info1: {
        stockDate1: this.getNowTime1() //日期
      },
      info2: {
        stockDate2: this.getNowTime2() //日期
      },
      dateType: "day",
      flags: [
        {
          value: "day",
          label: "按天查询"
        },
        {
          value: "month",
          label: "按月查询"
        },
        {
          value: "year",
          label: "按年查询"
        }
      ],
      indentState: "",
      statesnum: [
        {
          value: "",
          label: "全部"
        },
        {
          value: 0,
          label: "待转账"
        },
        {
          value: 1,
          label: "已转账"
        },
        {
          value: -1,
          label: "已拒绝"
        }
      ],
      statesnum1: [
        {
          value: "",
          label: "全部"
        },
        {
          value: 1,
          label: "已交保证金"
        },
        {
          value: 2,
          label: "已退保证金"
        }
      ],
      phone: "",

      // 导出限制
      exportTitle: "导出错误",
      exportVisible: false,
      exportFlag: 1, //1 超出限制  2导出中

      enable: false // 判断是否为新支付
    };
  },
  methods: {
    // 站点下拉框
    stationList() {
      this.$http({
        url: this.$http.adornUrl("admin/riderStation/stationList"),
        method: "get",
        params: this.$http.adornParams({})
      }).then(({ data }) => {
        console.log(data, "站点下拉框");
        this.stationData = data.data;
      });
    },
    // 会员详情跳转
    updates(row) {
      this.$router.push({
        path: "/userDetail",
        query: {
          userId: row.userId
        }
      });
    },
    // 批量转账
    transferClcik(id) {
      var ids = id
        ? [id]
        : this.checkBoxData.map(item => {
            return item.id;
          });
      for (var i in ids) {
        this.$http({
          url: this.$http.adornUrl(`cash/alipay/${ids[i]}`),
          method: "post",
          data: this.$http.adornData({})
        }).then(({ data }) => {
          if (data.code == 0) {
            this.$notify({
              title: "提示",
              duration: 1800,
              message: data.msg,
              type: "warning"
            });
            return;
          }
          if (data.code == 9999) {
            this.$notify({
              title: "提示",
              duration: 1800,
              message: data.msg,
              type: "error"
            });
            return;
          }
        });
      }
    },
    // 多选
    changeFun(val) {
      this.checkBoxData = val;
    },
    // 转账弹窗
    transferClick() {
      this.$http({
        url: this.$http.adornUrl("app/new-pay/enable-new-pay"),
        method: "get"
      }).then(({ data }) => {
        console.log(data.enable, "是否启用新支付");
        this.enable = data.enable;
      });
    },
    //转账
    batch(row) {
      if (row.state == 1) {
        this.$message({
          message: "已转账，请勿重复操作！",
          type: "error",
          duration: 1500
        });
        return;
      }
      this.$confirm(`确定转账?`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          this.$http({
            url: this.$http.adornUrl("app/new-pay/enable-new-pay"),
            method: "get"
          }).then(({ data }) => {
            console.log(data.enable, "是否启用新支付");
            this.enable = data.enable;
            if (this.enable) {
              console.log("rht转账");
              this.$http({
                url: this.$http.adornUrl(`cash/confirm-cash/${row.id}`),
                method: "post"
              }).then(({ data }) => {
                console.log(data, "rht转账");
                if (data.code == 0) {
                  this.$message({
                    message: data.msg,
                    type: "success",
                    duration: 1500,
                    onClose: () => {
                      this.dataSelect();
                    }
                  });
                } else {
                  this.$message({
                    message: data.msg,
                    type: "warning",
                    duration: 1500,
                    onClose: () => {}
                  });
                }
              });
            } else {
              console.log("银行卡转账");
              this.$http({
                url: this.$http.adornUrl(`cash/alipay/${row.id}`),
                method: "post",
                data: this.$http.adornData({})
              }).then(({ data }) => {
                if (data.code == 0) {
                  this.$message({
                    message: data.msg,
                    type: "success",
                    duration: 1500,
                    onClose: () => {
                      this.dataSelect();
                    }
                  });
                  return;
                }
                if (data.code == 9999) {
                  this.$message({
                    message: data.msg,
                    type: "error",
                    duration: 1500,
                    onClose: () => {
                      this.dataSelect();
                    }
                  });
                  return;
                }
                if (data.code == 500) {
                  this.$message({
                    message: data.msg,
                    type: "error",
                    duration: 1500,
                    onClose: () => {
                      this.dataSelect();
                    }
                  });
                  return;
                }
              });
            }
          });
          // this.$http({
          //   url: this.$http.adornUrl(`cash/alipay/${row.id}`),
          //   method: "post",
          //   data: this.$http.adornData({})
          // }).then(({ data }) => {
          //   if (data.code == 0) {
          //     this.$message({
          //       message: data.msg,
          //       type: "success",
          //       duration: 1500,
          //       onClose: () => {
          //         this.dataSelect();
          //       }
          //     });
          //     return;
          //   }
          //   if (data.code == 9999) {
          //     this.$message({
          //       message: data.msg,
          //       type: "error",
          //       duration: 1500,
          //       onClose: () => {
          //         this.dataSelect();
          //       }
          //     });
          //     return;
          //   }
          //   if (data.code == 500) {
          //     this.$message({
          //       message: data.msg,
          //       type: "error",
          //       duration: 1500,
          //       onClose: () => {
          //         this.dataSelect();
          //       }
          //     });
          //     return;
          //   }
          // });
        })
        .catch(() => {
          console.log("cencel");
        });
    },
    // 拒绝
    refund(row) {
      console.log("row", row);
      if (row.state == -1) {
        this.$message({
          message: "已拒绝，请勿重复操作！",
          type: "error",
          duration: 1500
        });
      } else {
        this.dialogFormVisible = true;
        this.form.cashId = row.id;
      }
    },
    // 拒绝操作
    refundNoticeTo() {
      if (this.form.content == "") {
        this.$message({
          message: "请输入拒绝原因",
          type: "error",
          duration: 1500
        });
        return;
      }
      if (this.form.content.length > 100) {
        this.$message({
          message: "拒绝原因不得超过100字",
          type: "error",
          duration: 1500
        });
        return;
      }
      this.$http({
        url: this.$http.adornUrl(`cash/refund`),
        method: "post",
        params: this.$http.adornParams({
          cashId: this.form.cashId,
          content: this.form.content
        })
      }).then(({ data }) => {
        if (data.code == 0) {
          this.dialogFormVisible = false;
          this.$message({
            message: "操作成功",
            type: "success",
            duration: 1500,
            onClose: () => {
              this.form.content = "";
              this.dataSelect();
            }
          });
          return;
        }
        if (data.code == 500) {
          this.dialogFormVisible = false;
          this.$message({
            message: data.msg,
            type: "error",
            duration: 1500,
            onClose: () => {
              this.form.content = "";
              this.dataSelect();
            }
          });
          return;
        }
        if (data.code == -100) {
          this.dialogFormVisible = false;
          this.$message({
            message: data.msg,
            type: "error",
            duration: 1500,
            onClose: () => {
              this.form.content = "";
              this.dataSelect();
            }
          });
          return;
        }
      });
    },
    timeDate() {
      this.rechargeSelect();
    },
    // 日期选择
    animeDat(value) {
      let vanumber = value;
      if (vanumber === "day") {
        this.flag = "day";
        this.dateType = "day";
        this.incomeSelect();
      }
      if (vanumber === "month") {
        this.flag = "month";
        this.dateType = "month";
        this.incomeSelect();
      }
      if (vanumber === "year") {
        this.flag = "year";
        this.dateType = "year";
        this.incomeSelect();
      }
    },
    // 日期选择2
    animeDat2(value) {
      let vanumber = value;
      if (vanumber === "day") {
        this.flag = "day";
        this.withdrawSelect();
        this.platformSelect();
      }
      if (vanumber === "month") {
        this.flag = "month";
        this.withdrawSelect();
        this.platformSelect();
      }
      if (vanumber === "year") {
        this.flag = "year";
        this.withdrawSelect();
        this.platformSelect();
      }
    },
    // 日期选择3
    animeDat3(value) {
      let vanumber = value;
      if (vanumber === "day") {
        this.flag = "day";
        this.flag1 = 1;
        this.rechSelect();
      }
      if (vanumber === "month") {
        this.flag = "month";
        this.flag1 = 2;
        this.rechSelect();
      }
      if (vanumber === "year") {
        this.flag = "year";
        this.flag1 = 3;
        this.rechSelect();
      }
    },
    animeSelect() {
      this.incomeSelect();
    },
    animeSelect2() {
      this.withdrawSelect();
      this.platformSelect();
    },
    animeSelect3() {
      this.rechSelect();
    },
    //处理默认选中当前日期
    getNowTime1() {
      var now = new Date();
      var year = now.getFullYear(); //得到年份
      var month = now.getMonth(); //得到月份
      var date = now.getDate(); //得到日期
      var hh = now.getHours() < 10 ? "0" + now.getHours() : now.getHours();
      var mm =
        now.getMinutes() < 10 ? "0" + now.getMinutes() : now.getMinutes();
      var ss =
        now.getSeconds() < 10 ? "0" + now.getSeconds() : now.getSeconds();
      month = month + 1;
      month = month.toString().padStart(2, "0");
      date = date.toString().padStart(2, "0");
      var defaultDate = `${year}-${month}-${date} ${hh}:${mm}:${ss}`;
      return defaultDate;
      this.$set(this.info, "stockDate", defaultDate);
    },
    getNowTime2() {
      var now = new Date();
      var year = now.getFullYear(); //得到年份
      var month = now.getMonth(); //得到月份
      var date = now.getDate(); //得到日期
      month = month + 1;
      month = month.toString().padStart(2, "0");
      date = date.toString().padStart(2, "0");
      var defaultDate = `${year}-${month}-${date}`;
      return defaultDate;
      this.$set(this.info, "stockDate", defaultDate);
    },
    //处理默认选中当前日期
    getNowTime() {
      var now = new Date();
      var year = now.getFullYear(); //得到年份
      var month = now.getMonth() - now.getMonth(); //得到月份
      var date = now.getDate() - now.getDate() + 1; //得到日期
      month = month + 1;
      month = month.toString().padStart(2, "0");
      date = date.toString().padStart(2, "0");
      var defaultDate = `${year}-${month}-${date}`;
      return defaultDate;
      this.$set(this.info, "stockDate", defaultDate);
    },
    handleSizeChange(val) {
      this.limit = val;
      this.dataSelect();
    },
    handleCurrentChange(val) {
      this.page = val;
      this.dataSelect();
    },
    handleSizeChange1(val) {
      this.limit = val;
      this.rechargeSelect();
    },
    handleCurrentChange1(val) {
      this.page = val;
      this.rechargeSelect();
    },
    handleSizeChange2(val) {
      this.limit = val;
      this.dataSelect1();
    },
    handleCurrentChange2(val) {
      this.page = val;
      this.dataSelect1();
    },
    handleClick(tab, event) {
      if (tab._props.label == "提现管理") {
        this.page = 1;
        this.limit = 10;
        this.type = 1;
        this.indentState = "";
        this.phone = "";
        this.dataSelect();
      }
      if (tab._props.label == "收入统计") {
        this.flag = "";
        this.info1.stockDate1 = this.getNowTime1();
        this.incomeSelect();
      }
      if (tab._props.label == "充值统计") {
        this.flag = "";
        this.flag1 = "";
        this.info1.stockDate1 = this.getNowTime1();
        this.rechSelect();
      }
      if (tab._props.label == "提现统计") {
        this.flag = "";

        this.info1.stockDate1 = this.getNowTime1();
        this.withdrawSelect();
      }
      if (tab._props.label == "充值记录") {
        this.page = 1;
        this.limit = 10;
        this.rechargeSelect();
      }
      if (tab._props.label == "保证金管理") {
        this.page = 1;
        this.limit = 10;
        this.type = "";
        this.indentState = "";
        this.phone = "";
        this.dataSelect1();
      }
      if (tab._props.label == "平台收入统计") {
        this.flag = "";
        this.info1.stockDate1 = this.getNowTime1();
        this.platformSelect();
      }
    },
    // 查询
    phoneSelect() {
      this.page = 1;
      this.dataSelect();
    },
    // 重置
    cleans2() {
      this.zhifubao = "";
      this.zhifubaoName = "";
      this.riderPhone = "";
      this.riderName = "";
      this.page = 1;
      this.indentState = "";
      this.phone = "";
      this.startTime = "";
      this.endTime = "";
      this.outstartTime = "";
      this.outendTime = "";
      this.dataSelect();
    },
    phoneSelect1() {
      this.page = 1;
      this.dataSelect1();
    },
    // 重置
    cleans1() {
      this.zhifubao = "";
      this.zhifubaoName = "";
      this.page = 1;
      this.indentState = "";
      this.phone = "";
      this.dataSelect1();
    },
    // 支付宝账号查询
    zfbselect() {
      if (this.zhifubao == "") {
        this.$notify({
          title: "提示",
          duration: 1800,
          message: "请输入支付宝账号",
          type: "error"
        });
        return;
      }
      this.page = 1;
      this.tableDataLoading = true;
      this.$http({
        url: this.$http.adornUrl("user/selectPayDetails"),
        method: "get",
        params: this.$http.adornParams({
          page: this.page,
          limit: this.limit,
          zhifubao: this.zhifubao
        })
      }).then(({ data }) => {
        this.tableDataLoading = false;
        let returnData = data.data;
        this.tableData = returnData.list;
        this.totalnum = returnData.totalCount;
      });
    },
    // 支付宝名称
    // qdselect() {
    //   if (this.zhifubaoName == "") {
    //     this.$notify({
    //       title: "提示",
    //       duration: 1800,
    //       message: "请输入渠道账号",
    //       type: "error"
    //     });
    //     return;
    //   }
    //   this.tableDataLoading = true;
    //   this.$http({
    //     url: this.$http.adornUrl("user/selectPayDetails"),
    //     method: "get",
    //     params: this.$http.adornParams({
    //       page: this.page,
    //       limit: this.limit,
    //       zhifubaoName: this.zhifubaoName
    //     })
    //   }).then(({ data }) => {
    //     this.tableDataLoading = false;
    //     let returnData = data.data;
    //     this.tableData = returnData.list;
    //     this.totalnum = returnData.totalCount;
    //   });
    // },
    // 获取数据列表
    dataSelect() {
      this.tableDataLoading = true;
      this.$http({
        url: this.$http.adornUrl("cash/selectPayDetails"),
        method: "get",
        params: this.$http.adornParams({
          page: this.page,
          limit: this.limit,
          zhifubaoName: this.zhifubaoName,
          phone:this.riderPhone,
          userName:this.riderName,
          zhifubao: this.zhifubao,
          type: this.type,
          state: this.indentState,
          phone: this.phone,
          outstartTime: this.outstartTime,
          outendTime: this.outendTime,
          startTime: this.startTime,
          endTime: this.endTime,
          riderStationId: this.stationName
        })
      }).then(({ data }) => {
        console.log(data, "跑腿财务中心");

        this.tableDataLoading = false;
        let returnData = data.data;
        this.tableData = returnData.list;
        this.totalnum = returnData.totalCount;
      });

      //提现总金额
      this.$http({
        url: this.$http.adornUrl("cash/selectPayTotal"),
        method: "get",
        params: this.$http.adornParams({
          zhifubaoName: this.zhifubaoName,
          phone:this.riderPhone,
          userName:this.riderName,
          zhifubao: this.zhifubao,
          type: this.type,
          state: this.indentState,
          phone: this.phone,
          startTime: this.startTime,
          endTime: this.endTime,
          outstartTime: this.outstartTime,
          outendTime: this.outendTime,
          riderStationId: this.stationName
        })
      }).then(({ data }) => {
        console.log(data, "提现总金额");
        this.totalMoney = data.data;
      });
    },
    // 获取数据列表
    dataSelect1() {
      this.tableDataLoading = true;
      this.$http({
        url: this.$http.adornUrl("admin/dataCentre/selectCashDeposit"),
        method: "get",
        params: this.$http.adornParams({
          page: this.page,
          limit: this.limit,
          type: this.type,
          phone: this.phone
        })
      }).then(({ data }) => {
        this.tableDataLoading = false;
        let returnData = data.data;
        this.tableData = returnData.list;
        this.totalnum = returnData.totalCount;
      });
    },
    // 收入统计
    incomeSelect() {
      this.tableDataLoading1 = true;
      this.$http({
        url: this.$http.adornUrl("admin/dataCentre/findplatformMoney"),
        method: "get",
        params: this.$http.adornParams({
          date: this.info1.stockDate1,
          dateType: this.dateType
        })
      }).then(({ data }) => {
        if (data.code == 0) {
          let returnData = data.data;
          this.MoneyData = returnData;
          this.MoneyData.indentMoney = this.MoneyData.indentMoney.toFixed(2);
          this.MoneyData.platformMoney = this.MoneyData.platformMoney.toFixed(
            2
          );
          this.MoneyData.riderMoney = this.MoneyData.riderMoney.toFixed(2);
        }
        this.tableDataLoading1 = false;
      });
    },
    // 充值统计
    rechSelect() {
      this.tableDataLoading3 = true;
      this.$http({
        url: this.$http.adornUrl("cash/payMember"),
        method: "get",
        params: this.$http.adornParams({
          time: this.info1.stockDate1,
          flag: this.flag1
        })
      }).then(({ data }) => {
        if (data.code == 0) {
          let returnData = data.data;
          this.rechgeData = returnData;
          this.rechgeData.sumMoney = this.rechgeData.sumMoney.toFixed(2);
          this.rechgeData.weiXinGZHMoney = this.rechgeData.weiXinGZHMoney.toFixed(
            2
          );
          this.rechgeData.weiXinXCXMoney = this.rechgeData.weiXinXCXMoney.toFixed(
            2
          );
        }
        this.tableDataLoading3 = false;
      });
    },
    // 提现统计
    withdrawSelect() {
      this.tableDataLoading2 = true;
      this.$http({
        url: this.$http.adornUrl("cash/statisticsMoney"),
        method: "get",
        params: this.$http.adornParams({
          date: this.info1.stockDate1,
          dateType: this.flag,
          type: 1
        })
      }).then(({ data }) => {
        let returnData = data.data;
        this.withdrawData = returnData;
        this.withdrawData.sumMoney = this.withdrawData.sumMoney.toFixed(2);
        this.withdrawData.applyMoneySum = this.withdrawData.applyMoneySum.toFixed(
          2
        );
        this.withdrawData.accomplishMoneySum = this.withdrawData.accomplishMoneySum.toFixed(
          2
        );
        this.withdrawData.refuseMoneySum = this.withdrawData.refuseMoneySum.toFixed(
          2
        );
        this.withdrawData.zhifubaoMoneySum = this.withdrawData.zhifubaoMoneySum.toFixed(
          2
        );
        this.withdrawData.weixinMoneySum = this.withdrawData.weixinMoneySum.toFixed(
          2
        );
        this.withdrawData.cashDepositMoneySum = this.withdrawData.cashDepositMoneySum.toFixed(
          2
        );
        this.withdrawData.sumMoneySucceed = this.withdrawData.sumMoneySucceed.toFixed(
          2
        );
        this.withdrawData.sumMoneyAwait = this.withdrawData.sumMoneyAwait.toFixed(
          2
        );

        this.tableDataLoading2 = false;
      });
    },
    selectTrigger() {
      this.rechargeSelect();
    },
    // 获取充值记录
    rechargeSelect() {
      if (this.endTime == "") {
        this.endTime = this.info2.stockDate2;
      }
      if (this.startTime == "") {
        this.startTime = this.info.stockDate;
      }
      this.tableDataLoading = true;
      this.$http({
        url: this.$http.adornUrl("admin/dataCentre/findTopUpMoney"),
        method: "get",
        params: this.$http.adornParams({
          page: this.page,
          limit: this.limit,
          // 'state': this.state,
          startTime: this.startTime,
          endTime: this.endTime
        })
      }).then(({ data }) => {
        this.tableDataLoading = false;
        let returnData = data.data;
        this.rechargeData = returnData;
        // this.totalnum2 = returnData.totalCount
      });
    },
    // 平台收入统计
    platformSelect() {
      if (this.endTime == "") {
        this.endTime = this.info2.stockDate2;
      }
      if (this.startTime == "") {
        this.startTime = this.info.stockDate;
      }
      this.tableDataLoading4 = true;
      this.$http({
        url: this.$http.adornUrl("cash/incomeStatistics"),
        method: "get",
        params: this.$http.adornParams({
          date: this.info1.stockDate1,
          dateType: this.flag
        })
      }).then(({ data }) => {
        this.tableDataLoading4 = false;
        let returnData = data.data;
        this.platformData = returnData;
        // this.totalnum2 = returnData.totalCount
      });
    },
    // 导出
    // exportBtn() {
    // 	this.$http({
    // 		url: this.$http.adornUrl('cash/excelPayDetails'),
    // 		method: 'get',
    // 		responseType: 'blob',
    // 		params: this.$http.adornParams({
    // 			// 'page': page,
    // 			// 'size': this.size,
    // 			'zhifubaoName': this.zhifubaoName,
    // 			'zhifubao': this.zhifubao,
    // 			'type':this.type,
    // 			'state':this.indentState,
    // 			'phone':this.phone,
    // 			'startTime': this.startTime,
    // 			'endTime': this.endTime,
    //       // riderStationId:this.stationName // 骑手站点
    // 		})
    // 	}).then(({
    // 		data
    // 	}) => {
    // 		let blob = new Blob([data], {
    // 			type: 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
    // 		})
    // 		if (window.navigator.msSaveOrOpenBlob) {
    // 			navigator.msSaveBlob(blob)
    // 		} else {
    // 			let url = window.URL.createObjectURL(blob)
    // 			let elink = document.createElement('a')
    // 			elink.download = '财务列表.xlsx'
    // 			elink.style.display = 'none'
    // 			elink.href = url
    // 			document.body.appendChild(elink)
    // 			elink.click()
    // 			document.body.removeChild(elink)
    // 		}
    // 	})
    // },
    exportBtn() {
      console.log(this.totalnum, "导出条数");
      this.exportTitle = "导出";
      // this.exportFlag = 4;
      this.exportVisible = true;
      if (this.totalnum >= 50000) {
        this.exportTitle = "导出错误";
        this.exportFlag = 1;
      } else {
        this.exportTitle = "导出";
        this.exportFlag = 2;
        this.exportVisible = true;
        var userId = this.$cookie.get("userId");
        this.$http({
          url: this.$http.adornUrl("admin/export/excelPayouts"),
          method: "get",
          // responseType: "blob",
          params: this.$http.adornParams({
            userId: userId,
            zhifubaoName: this.zhifubaoName,
            phone:this.riderPhone,
            userName:this.riderName,
            zhifubao: this.zhifubao,
            type: this.type,
            state: this.indentState,
            phone: this.phone,
            startTime: this.startTime,
            endTime: this.endTime,
            outstartTime: this.outstartTime,
            outendTime: this.outendTime,
            riderStationId: this.stationName // 骑手站点
          })
        }).then(({ data }) => {
          console.log(data, "导出");
          if (data.code == 0) {
            this.exportTitle = "导出成功";
            this.exportFlag = 3;
          }
          // let blob = new Blob([data], {
          //   type:
          //     "application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
          // });
          // if (window.navigator.msSaveOrOpenBlob) {
          //   navigator.msSaveBlob(blob);
          // } else {
          //   let url = window.URL.createObjectURL(blob);
          //   let elink = document.createElement("a");
          //   elink.download = "订单列表.xlsx";
          //   elink.style.display = "none";
          //   elink.href = url;
          //   document.body.appendChild(elink);
          //   elink.click();
          //   document.body.removeChild(elink);
          // }
        });
      }
    },
    exportAffirm() {
      this.exportVisible = false;
    },
    getPath() {
      // this.$router.push({ name: 'mission', params: { refund: '' } });
      if (this.$route.params.type=='platform') {
        console.log(this.$route.params,'平台-钩子中获取参数');
        this.indentState = this.$route.params.refund;
        this.startTime = this.$route.params.dayId+' '+"00:00:00";
        this.endTime = this.$route.params.dayId+' '+"23:59:59";
        this.dataSelect()
      }else if (this.$route.params.type=='rider') {
        console.log(this.$route.params,'骑手-钩子中获取参数');
        this.indentState = this.$route.params.refund;
        this.riderPhone=this.$route.params.phone;
        this.riderName=this.$route.params.userName;
        this.startTime = this.$route.params.dayId+' '+"00:00:00";
        this.endTime = this.$route.params.dayId+' '+"23:59:59";
        this.dataSelect()
      }
      else {
        this.riderPhone=''
        this.riderName=''
        this.indentState = "";
        this.startTime = "";
        this.endTime =""
        this.dataSelect()
      }
    }
  },
  watch: {
    $route: "getPath"
  },
  mounted() {
    // this.dataSelect();
    this.stationList();
    this.transferClick();
    this.$nextTick(() => {
      if (this.$route.params.type=='platform') {
        console.log(this.$route.params,'平台-钩子中获取参数');
        this.indentState = this.$route.params.refund;
        this.startTime = this.$route.params.dayId+' '+"00:00:00";
        this.endTime = this.$route.params.dayId+' '+"23:59:59";
        this.dataSelect()
      }else if (this.$route.params.type=='rider') {
        console.log(this.$route.params,'骑手-钩子中获取参数');
        this.indentState = this.$route.params.refund;
        this.riderPhone=this.$route.params.phone;
        this.riderName=this.$route.params.userName;
        this.startTime = this.$route.params.dayId+' '+"00:00:00";
        this.endTime = this.$route.params.dayId+' '+"23:59:59";
        this.dataSelect()
      }
      else {
        this.riderPhone=''
        this.riderName=''
        this.indentState = "";
        this.startTime = "";
        this.endTime =""
        this.dataSelect()
      }
    });
  }
};
</script>

<style scoped="scoped">
.box {
  padding: 44px;
  border: 1px solid #eee;
  margin: 15px 10px;
}

.box_num {
  font-size: 14px;
  color: #66b1ff;
}

.box_num .box_color {
  color: #333;
  font-size: 14px;
  margin-bottom: 15px;
}

.box_num div span {
  font-size: 20px;
  margin-left: 5px;
}

.text_color {
  color: #4f9dec;
}

.text_color span {
  margin-right: 5px;
}

/* 导出限制 */
.el-tabs >>> .export {
  width: 500px;
}
.el-tabs >>> .export .con {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}
.el-tabs >>> .export .con .gundong {
  animation: gundong 3s linear infinite;
}
@keyframes gundong {
  /* from表示动画的开始位置，也可以使用0%来表示。 */
  from {
    transform: rotate(0deg);
  }
  /* to表示动画的结束位置，也可以使用100%来表示。 */
  to {
    transform: rotate(360deg);
  }
}
.el-tabs >>> .export img {
  width: 70px;
}
.el-tabs >>> .export .btn {
  display: flex;
  flex-direction: row-reverse;
}
</style>
