<!--
 * @Descripttion:
 * @version:
 * @Author: kBank
 * @Date: 2022-10-24 15:45:01
-->
<template>
  <div class="page">
    <topBar v-if="topList.length > 0" :top-list="topList" :moren="moren" />
    <div v-if="topList[0].changed == true">
      <div class="thetopbox">
        <el-form
          ref="select"
          :model="select"
          style="background-color: #fff"
          label-width="100px"
        >
          <el-row>
            <!-- 一层 -->
            <el-col :span="4">
              <el-form-item :label="'会员编号'">
                <el-input v-model="select.memberCode" clearable />
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'会员姓名'">
                <el-input v-model="select.memberName" clearable />
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'打款状态'">
                <el-select
                  v-model="select.status"
                  clearable
                  :placeholder="'请选择'"
                >
                  <el-option
                    v-for="item in statusList"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'钱包类型'">
                <el-select
                  v-model="select.pkAccount"
                  clearable
                  :placeholder="'请选择'"
                >
                  <el-option
                    v-for="item in accountList"
                    :key="item.pkId"
                    :label="item.accountName"
                    :value="item.pkId"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'审核状态'">
                <el-select
                  v-model="select.approveState"
                  clearable
                  :placeholder="'请选择'"
                >
                  <el-option
                    v-for="item in shStateList"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'银行名称'">
                <el-input v-model="select.bankName" clearable />
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'本次提现'">
                <el-input v-model="select.cashAmount" clearable />
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'支行名称'">
                <el-input v-model="select.subBankName" clearable />
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'银行账户'">
                <el-input v-model="select.cardNumber" clearable />
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'开户姓名'">
                <el-input v-model="select.accountName" clearable />
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'预留电话'">
                <el-input v-model="select.phone" clearable />
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'提现备注'">
                <el-input v-model="select.remarks" clearable />
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'实发金额'">
                <el-input v-model="select.issuedAmount" clearable />
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'隶属体系'">
                <el-select
                  v-model="select.vertexId"
                  clearable
                >
                  <el-option
                    v-for="item in vertexList"
                    :key="item.pkId"
                    :label="item.vertexName"
                    :value="item.pkId"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-collapse-transition>
              <div v-show="isActive">
                <el-col :span="4">
                  <el-form-item :label="'打款人'">
                    <el-input v-model="select.paymentName" clearable />
                  </el-form-item>
                </el-col>
                <el-col :span="4">
                  <el-form-item :label="'打款备注'">
                    <el-input v-model="select.payerRemarks" clearable />
                  </el-form-item>
                </el-col>
                <el-col :span="4">
                  <el-form-item :label="'单据编号'">
                    <el-input v-model="select.withdrawCode" clearable />
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item :label="'申请日期'">
                    <el-date-picker
                      v-model="creationTime"
                      value-format="yyyy-MM-dd"
                      type="daterange"
                      :range-separator="'至'"
                      :start-placeholder="'开始日期'"
                      :end-placeholder="'结束日期'"
                      @change="changeTime"
                    />
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item :label="'审核日期'">
                    <el-date-picker
                      v-model="creationTime1"
                      value-format="yyyy-MM-dd"
                      type="daterange"
                      :range-separator="'至'"
                      :start-placeholder="'开始日期'"
                      :end-placeholder="'结束日期'"
                      @change="changeTime1"
                    />
                  </el-form-item>
                </el-col>
              </div>
            </el-collapse-transition>
            <el-col :span="4">
              <el-button
                v-has-buttons="['CashSearch']"
                class="my_search"
                style="margin-left: 30px"
                @click="getDataList"
              >
                {{ '搜索' }}</el-button>
              <el-button class="my_reset" @click="reset">
                {{ '重置' }}</el-button>
            </el-col>
          </el-row>
          <div class="openClose" @click="isActive = !isActive">
            <i :class="isActive ? 'el-icon-arrow-up' : 'el-icon-arrow-down'" />
            <div>{{ isActive ? '点击收起' : '点击展开' }}</div>
          </div>
        </el-form>
      </div>
      <div class="main">

        <div class="maintop">
          <div class="mainbtn">
            <el-button
              v-has-buttons="['CashDetailsPay']"
              size="small"
              :disabled="this.checkArr.length == 0"
              class="thebtn2"
              @click="openDig(0)"
            >{{ '打款' }}</el-button>
            <el-button
              v-has-buttons="['CashDetailsRecharge']"
              size="small"
              :disabled="this.checkArr.length == 0"
              class="thebtn3"
              @click="openDig(1)"
            >{{ '充正' }}</el-button>
            <el-button
              v-has-buttons="['CashDetailsApprove']"
              size="small"
              :disabled="this.checkArr.length == 0"
              class="thebtn1"
              @click="toQc"
            >{{ '发起审核' }}</el-button>
            <el-button
              v-has-buttons="['CashDetailsExport']"
              size="small"
              class="thebtn4"
              @click="handleExport"
            >
              导出
            </el-button>
            <el-button
              v-has-buttons="['CashDetailsReject']"
              style="padding: 8px"
              size="small"
              class="thebtn2"
              @click="batchRejectHandle"
            >
              驳回
            </el-button>
          </div>

        </div>

        <div style="overflow:auto;">
          <el-table
            ref="mainTable"
            v-loading="loading"
            :data="tableData"
            height="600"
            :header-cell-style="{ background: '#EEEEEE' }"
            :summary-method="getSummaries"
            show-summary
            :row-class-name="tableRowClassName"
            @selection-change="handleSelectionChange"
          >
            <el-table-column type="selection" width="55" />
            <!-- <el-table-column
            v-if="showData.pkCountryName"
            align="center"
            prop="jxmc"
            :label="'国家'"
          >
            <template slot-scope="scope">
              <div class="tem">
                <img :src="scope.row.nationalFlag2" alt="" />
              </div>
            </template>
          </el-table-column> -->
            <el-table-column
              v-if="showData.memberCode"
              align="center"
              prop="memberCode"
              width="130"
              :label="'会员编号'"
            />
            <el-table-column
              v-if="showData.memberName"
              align="center"
              prop="memberName"
              :label="'会员姓名'"
            />
            <el-table-column
              v-if="showData.vertexName"
              align="center"
              prop="vertexName"
              :label="'隶属体系'"
              min-width="120"
            />
            <el-table-column
              v-if="showData.pkAccountVal"
              align="center"
              prop="pkAccountVal"
              :label="'钱包类型'"
            />
            <el-table-column
              v-if="showData.availableAmount"
              align="center"
              prop="availableAmount"
              :label="'可提金额' + `(${isLocalSymbol()})`"
              width="100"
            >
              <template slot-scope="scope">
                {{ scope.row.availableAmount | numberToCurrency }}
              </template>
            </el-table-column>
            <el-table-column
              v-if="showData.cashAmount"
              align="center"
              prop="cashAmount"
              :label="'本次提现' + `(${isLocalSymbol()})`"
              width="100"
            >
              <template slot-scope="scope">
                {{ scope.row.cashAmount | numberToCurrency }}
              </template>
            </el-table-column>
            <el-table-column
              v-if="showData.availableBalance"
              align="center"
              prop="availableBalance"
              :label="'可提余额' + `(${isLocalSymbol()})`"
              width="100"
            >
              <template slot-scope="scope">
                {{ scope.row.availableBalance | numberToCurrency }}
              </template>
            </el-table-column>
            <el-table-column
              v-if="showData.serviceCharge"
              align="center"
              prop="serviceCharge"
              :label="'手续费' + `(${isLocalSymbol()})`"
              width="100"
            >
              <template slot-scope="scope">
                {{ scope.row.serviceCharge | numberToCurrency }}
              </template>
            </el-table-column>
            <el-table-column
              v-if="showData.incomeTax"
              align="center"
              prop="incomeTax"
              :label="'个税' + `(${isLocalSymbol()})`"
              width="100"
            >
              <template slot-scope="scope">
                {{ scope.row.incomeTax | numberToCurrency }}
              </template>
            </el-table-column>
            <el-table-column
              v-if="showData.issuedAmount"
              align="center"
              prop="issuedAmount"
              :label="'实发金额' + `(${isLocalSymbol()})`"
              width="100"
            >
              <template slot-scope="scope">
                {{ scope.row.issuedAmount | numberToCurrency }}
              </template>
            </el-table-column>
            <el-table-column
              v-if="showData.settleCashAmount"
              align="center"
              prop="settleCashAmount"
              :label="'本次提现' + `(${isLocals()})`"
              width="100"
            >
              <template slot-scope="scope">
                {{ scope.row.settleCashAmount | numberToCurrency }}
              </template>
            </el-table-column>
            <!-- lll -->
            <el-table-column
              v-if="showData.settleServiceCharge"
              align="center"
              prop="settleServiceCharge"
              :label="'手续费' + `(${isLocals()})`"
              width="100"
            >
              <template slot-scope="scope">
                {{ scope.row.settleServiceCharge | numberToCurrency }}
              </template>
            </el-table-column>

            <el-table-column
              v-if="showData.settleIncomeTax"
              align="center"
              prop="settleIncomeTax"
              :label="'个税' + `(${isLocals()})`"
              width="100"
            >
              <template slot-scope="scope">
                {{ scope.row.settleIncomeTax | numberToCurrency }}
              </template>
            </el-table-column>
            <el-table-column
              v-if="showData.settleIssuedAmount"
              align="center"
              prop="settleIssuedAmount"
              :label="'实发金额' + `(${isLocals()})`"
              width="100"
            >
              <template slot-scope="scope">
                {{ scope.row.settleIssuedAmount | numberToCurrency }}
              </template>
            </el-table-column>
            <el-table-column
              v-if="showData.exchangeRate"
              align="center"
              prop="exchangeRate"
              :label="'汇率'"
            />

            <!-- lll -->
            <el-table-column
              v-if="showData.creationTime"
              align="center"
              prop="creationTime"
              width="200"
              :label="'申请日期'"
            />
            <el-table-column
              v-if="showData.bankName"
              align="center"
              prop="bankName"
              :label="'银行名称'"
            />
            <el-table-column
              v-if="showData.subBankName"
              align="center"
              prop="subBankName"
              :label="'支行名称'"
              min-width="140"
              show-overflow-tooltip
            />
            <el-table-column
              v-if="showData.cardNumber"
              align="center"
              prop="cardNumber"
              :label="'银行账户'"
              min-width="170"
              show-overflow-tooltip
            />
            <el-table-column
              v-if="showData.accountName"
              align="center"
              prop="accountName"
              :label="'开户姓名'"
            />
            <el-table-column
              v-if="showData.phone"
              align="center"
              prop="phone"
              :label="'预留电话'"
              min-width="120"
            />
            <el-table-column
              v-if="showData.idCard"
              align="center"
              prop="idCard"
              :label="'身份证号码'"
              width="170"
            />
            <el-table-column
              v-if="showData.remarks"
              align="center"
              prop="remarks"
              :label="'提现备注'"
            />
            <el-table-column
              v-if="showData.approveName"
              align="center"
              prop="approveName"
              :label="'审核人'"
            />
            <el-table-column
              v-if="showData.approveTime"
              align="center"
              prop="approveTime"
              :label="'审核日期'"
            />
            <el-table-column
              v-if="showData.approveRemarks"
              align="center"
              prop="approveRemarks"
              :label="'审核备注'"
            />
            <el-table-column
              v-if="showData.paymentName"
              align="center"
              prop="paymentName"
              :label="'打款人'"
            />
            <el-table-column
              v-if="showData.statusVal"
              align="center"
              prop="statusVal"
              :label="'打款状态'"
            />
            <el-table-column
              v-if="showData.paymentTime"
              align="center"
              prop="paymentTime"
              :label="'打款时间'"
            />
            <el-table-column
              v-if="showData.payerRemarks"
              align="center"
              prop="payerRemarks"
              :label="'打款备注'"
            />

            <el-table-column
              v-if="showData.withdrawCode"
              align="center"
              prop="withdrawCode"
              width="200"
              :label="'单据编号'"
            />
            <el-table-column
              v-if="showData.approveStateVal"
              align="center"
              prop="approveStateVal"
              :label="'审核状态'"
              fixed="right"
            />
            <el-table-column
              align="center"
              prop="time"
              :label="'操作'"
              width="160"
              fixed="right"
            >
              <template slot-scope="scope">
                <div style="display: flex">
                  <el-button
                    v-if="
                      scope.row.approveState == 5 &&
                        scope.row.status != 1 &&
                        scope.row.status != 2
                    "
                    type="text"
                    style="padding: 8px"
                    size="small"
                    @click="openDig(1, scope.row.pkId)"
                  >
                    {{ '充正' }}
                  </el-button>
                  <el-button
                    v-if="
                      scope.row.approveState == 5 &&
                        scope.row.status != 1 &&
                        scope.row.status != 2
                    "
                    style="padding: 8px; color: #ed1d25"
                    type="text"
                    size="small"
                    @click="openDig(0, scope.row.pkId)"
                  >
                    {{ '打款' }}
                  </el-button>
                  <el-button
                    style="padding: 8px; color: #ed1d25"
                    type="text"
                    size="small"
                    @click="toFixed(scope.row.pkId)"
                  >
                    {{ '导出' }}
                  </el-button>

                </div>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
      <pagination
        v-show="total > 0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getDataList"
      />
    </div>
    <el-dialog
      :title="'提示'"
      :visible.sync="centerDialogVisible"
      width="30%"
      :close-on-click-modal="false"
      center
    >
      <div class="gth">
        <img src="@/assets/images/gth.png" alt="">
        <div>{{ '确定' }}要{{ isCz == 1 ? "充正" : "打款" }}吗</div>
      </div>
      <el-form ref="form" :model="form" label-width="auto">
        <el-form-item :label="'备注'">
          <el-input v-model="form.payerRemarks" type="textarea" />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="centerDialogVisible = false">{{
          '取消'
        }}</el-button>
        <el-button type="primary" @click="saveForm">{{
          '确认'
        }}</el-button>
      </span>
    </el-dialog>
    <el-dialog
      title="驳回原因"
      :visible.sync="rejectDialogVisible"
      width="30%"
      :close-on-click-modal="false"
      center
    >
      <el-form ref="rejectForm" :model="rejectForm" label-width="auto">
        <el-form-item required label="驳回原因">
          <el-input
            v-model="rejectForm.rejectRemark"
            :maxlength="80"
            show-word-limit
            type="textarea"
          />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="rejectDialogVisible = false">取消</el-button>
        <el-button type="primary" @click="saveRejectForm">确认</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import topBar from '@/components/topBarRole'
import { getVartexList } from '@/api/affiliatedteam'

import * as api from '@/api/financialCase.js'
import { isLocals, isLocalSymbol, stateFormat } from '@/utils/numberToCurrency'
import { getRouters } from '@/api/settle'
import { mapGetters } from 'vuex'
import { numberToCurrencyNo } from '@/utils/numberToCurrency'
import { getRoleMenu } from '@/api/notice'
export default {
  name: 'Bzpz',
  components: {
    topBar
  },
  filters: {
    isAgree(val) {
      if (!val) {
        return '允许'
      } else {
        return '禁止'
      }
    }
  },
  data() {
    return {
      // 折叠搜索框
      isActive: false,
      moren: 'cashDetails',
      topList: [
        {
          name: '提现明细',
          path: 'cashDetails',
          url: 'CashDetails',
          changed: false
        },
        {
          name: '京东代付',
          path: 'jdToPay',
          url: 'jdToPay',
          changed: false
        }
      ],
      centerDialogVisible: false,
      creationTime: [],
      creationTime1: [],
      shStateList: [],
      select: {
        approveState: 1
      },
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 50
      },
      total: 0,
      dialogVisible: false,
      loading: false,
      tableData: [],
      accountList: [],
      tradeTypeList: [],
      checkArr: [],
      postArr: [],
      form: {
        payerRemarks: ''
      },
      rejectForm: {
        payerRemarks: ''
      },
      isCz: 0,
      rejectDialogVisible: false,
      checkArrAll: [],
      statusList: [],
      vertexList: [],
      lastData: '',
      dataList: [
        {
          name: 'pkCountryName',
          key: ''
        },
        {
          name: 'memberCode',
          key: ''
        },
        {
          name: 'memberName',
          key: ''
        },
        {
          name: 'pkAccountVal',
          key: ''
        },
        {
          name: 'availableAmount',
          key: ''
        },
        {
          name: 'cashAmount',
          key: ''
        },
        {
          name: 'availableBalance',
          key: ''
        },
        {
          name: 'serviceCharge',
          key: ''
        },
        {
          name: 'incomeTax',
          key: ''
        },
        {
          name: 'issuedAmount',
          key: ''
        },
        {
          name: 'settleCashAmount',
          key: ''
        },
        {
          name: 'settleServiceCharge',
          key: ''
        },
        {
          name: 'settleIncomeTax',
          key: ''
        },
        {
          name: 'settleIssuedAmount',
          key: ''
        },
        {
          name: 'exchangeRate',
          key: ''
        },
        {
          name: 'creationTime',
          key: ''
        },
        {
          name: 'bankName',
          key: ''
        },
        {
          name: 'subBankName',
          key: ''
        },
        {
          name: 'cardNumber',
          key: ''
        },
        {
          name: 'accountName',
          key: ''
        },
        {
          name: 'phone',
          key: ''
        },
        {
          name: 'remarks',
          key: ''
        },
        {
          name: 'approveName',
          key: ''
        },
        {
          name: 'approveTime',
          key: ''
        },
        {
          name: 'approveRemarks',
          key: ''
        },
        {
          name: 'paymentName',
          key: ''
        },
        {
          name: 'statusVal',
          key: ''
        },
        {
          name: 'paymentTime',
          key: ''
        },
        {
          name: 'payerRemarks',
          key: ''
        },
        {
          name: 'approveStateVal',
          key: ''
        },
        {
          name: 'withdrawCode',
          key: ''
        }
      ],
      showData: {}
    }
  },
  computed: {
    ...mapGetters(['getUser'])
  },
  mounted() {
    // 获取下拉
    this.getData()
    // 获取列表
    this.getDataList()
    // //审核状态
    this.getApproveStatus()
    this.getPaymentStatus()
    this.getUserRoute()
    this.getUserRole()
  },
  methods: {
    isLocals,
    isLocalSymbol,
    saveRejectForm() {
      const data = {
        idList: this.checkArr,
        rejectRemark: this.rejectForm.rejectRemark
      }
      api.batchReject(data).then((res) => {
        if (res.code == 200) {
          this.$message({
            message: res.msg,
            type: 'success'
          })
          this.rejectDialogVisible = false
          this.getDataList()
        }
      })
    },
    batchRejectHandle() {
      const canReject = this.checkArrAll.every((item) => item.approveState == 1)
      if (!canReject) {
        this.$message({
          message: '存在已审核单据，请重新选择',
          type: 'warning'
        })
        return false
      }
      this.rejectDialogVisible = true
    },
    getUserRole() {
      getRoleMenu('CashDetails').then((res) => {
        const obj = {}
        res.data.forEach((ele) => {
          obj[ele] = true
        })
        this.showData = obj
        // this.dataList.forEach((item) => {
        //   res.data.forEach((items) => {
        //     if (item.name == items) {
        //       item.key = items
        //     }
        //     // this.flag = true
        //   })
        // })
      })
    },
    getPaymentStatus() {
      api.paymentStatus().then((res) => {
        this.statusList = res.data
      })
    },
    stateFormat,
    // 审核状态
    getApproveStatus() {
      api.getApproveStatuss().then((res) => {
        this.shStateList = res.data
      })
    },
    getUserRoute() {
      getRouters().then((res) => {
        res.data.forEach((item) => {
          this.topList.forEach((items) => {
            if (item.routeName == items.url) {
              items.changed = true
            }
          })
        })
      })
    },
    saveForm() {
      let url
      if (this.isCz == 1) {
        url = api.positive
      } else {
        url = api.payment
      }
      url(Object.assign(this.form, { pkIds: this.postArr })).then((res) => {
        if (res.code == 200) {
          this.$message({
            message: res.msg,
            type: 'success'
          })
          // 获取列表
          this.getDataList()
          this.centerDialogVisible = false
        }
      })
    },
    openDig(index, id) {
      // if (index == 0) {
      let dk = false
      this.checkArrAll.forEach((item) => {
        // item.approveState== 5&&item.status != 1&&item.status != 2
        if (item.approveState != 5 || item.status == 1 || item.status == 2) {
          dk = true
        }
      })
      if (dk) {
        this.$message({
          message: '存在已打款或未审核单据',
          type: 'warning'
        })
        return false
      }
      // }
      this.isCz = index
      if (id) {
        this.postArr = [id]
      } else {
        this.postArr = this.checkArr
      }
      this.centerDialogVisible = true
    },
    toQc() {
      api.showWithdraw(this.checkArr).then((res) => {
        if (res.code == 200) {
          this.$router.push({
            path: 'txzxqc',
            query: {
              data: JSON.stringify(res.data)
            }
          })
        }
      })
    },
    reset() {
      this.select = {}
      this.creationTime = []
      this.creationTime1 = []
      this.getDataList()
    },
    getData() {
      api.pkBdAccountList().then((res) => {
        this.accountList = res.rows
      })
      api.getTradeType().then((res) => {
        this.tradeTypeList = res.data
      })
      getVartexList().then((res) => {
        this.vertexList = res.data
      })
    },
    changeTime(val) {
      if (!val) {
        val = ['', '']
      }
      this.select.startDate = val[0] || ''
      this.select.endDate = val[1] || ''
    },
    changeTime1(val) {
      if (!val) {
        val = ['', '']
      }
      this.select.startPaymentTime = val[0] || ''
      this.select.endPaymentTime = val[1] || ''
    },
    // 点击修改
    toFixed(id) {},
    getDataList() {
      this.loading = true
      api
        .withdrawList(Object.assign({}, this.queryParams, this.select))
        .then((res) => {
          res.rows.forEach((item) => {
            item.nationalFlag2 = this.getUser.country.nationalFlag2
          })
          this.lastData = res.rows[res.rows.length - 1]
          let arr = JSON.parse(JSON.stringify(res.rows))
          arr = arr.filter(function(v, i, ar) {
            return i !== ar.length - 1
          })
          this.tableData = arr
          this.total = res.total
          this.loading = false
          this.$nextTick(() => {
            this.$refs.mainTable.doLayout()
          })
        })
    },
    getSummaries(param) {
      // this.$nextTick(() => {
      if (this.lastData) {
        const obj = this.lastData

        return [
          '',
          '合计',
          '',
          '',
          '',
          '',
          numberToCurrencyNo(obj.cashAmount),
          '',
          numberToCurrencyNo(obj.serviceCharge),
          numberToCurrencyNo(obj.incomeTax),
          numberToCurrencyNo(obj.issuedAmount),
          numberToCurrencyNo(obj.settleCashAmount),
          numberToCurrencyNo(obj.settleServiceCharge),
          numberToCurrencyNo(obj.settleIncomeTax),
          numberToCurrencyNo(obj.settleIssuedAmount),
          '',
          '',
          '',
          '',
          '',
          '',
          '',
          '',
          '',
          '',
          '',
          '',
          '',
          '',
          '',
          '',
          '',
          ''
        ]
      } else {
        return []
      }

      // })
    },
    //       obj.availableAmount
    // obj.cashAmount
    // obj.availableBalance
    // obj.serviceCharge
    // obj.incomeTax
    // obj.issuedAmount
    // obj.settleCashAmount
    // obj.settleServiceCharge
    // obj.settleIncomeTax
    // obj.settleIssuedAmount
    // getSummaries(param){
    //   // setTimeout(()=>{
    //     return [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
    //   // },5000)

    // },
    handleSelectionChange(val) {
      this.checkArrAll = val
      this.checkArr = val.map((item) => {
        return item.pkId
      })
    },
    /** 导出按钮操作 */
    handleExport() {
      this.$confirm('是否确认导出所有数据项?', '警告', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then((_) => {
        this.download(
          '/member/manager/withdraw/export',
          Object.assign({}, this.queryParams, this.select),
          `提现明细-${new Date().getTime()}.xlsx`
        )
      })
    },
    tableRowClassName({ row, rowIndex }) {
      if (rowIndex % 2 == 1) {
        return 'warning-row'
      } else if (rowIndex % 2 == 0) {
        return 'success-row'
      }
      return ''
    }
  }
}
</script>
<style scoped lang="scss">
::v-deep .el-table .warning-row {
  background: #f9f9f9;
}

::v-deep .el-table .success-row {
  background: #ffffff;
}
::v-deep .el-table thead {
  color: #000000;
}
::v-deep .el-select {
  width: 100%;
}
.page {
  padding: 0px;
  background: #f9f9f9;
  font-size: 14px;
  overflow: auto;
  .main {
    .maintop {
      display: flex;
      padding: 0px 0;
      justify-content: space-between;
      align-items: center;
      .mainbtn {
        .thebtn1 {
          background: #3181e5;
          color: #ffffff;
          //width: 68px;
          height: 32px;
        }
        .thebtn4 {
          background: #ffad41;
          color: #ffffff;
          width: 68px;
          height: 32px;
        }
        .thebtn2 {
          background: #c73030;
          color: #ffffff;
          width: 68px;
          height: 32px;
        }
        .thebtn3 {
          background: #6962f6;
          color: #ffffff;
          width: 68px;
          height: 32px;
        }
      }
      .maintitle {
        font-size: 10px;
        font-family: MicrosoftYaHei;
        color: #999999;
      }
    }
  }
  .tem {
    display: flex;
    align-items: center;
    justify-content: center;
    img {
      width: 28px;
      height: 20px;
      margin-right: 3px;
    }
  }
  .isRed {
    color: #ed1d25;
  }
  .isGreen {
    color: #1ab62b;
  }
  .bgImg {
    width: 48px;
    height: 48px;
  }
}

.gth {
  text-align: center;
  margin-bottom: 30px;
  img {
    width: 87px;
    height: 78px;
    margin-bottom: 10px;
  }
}
.openClose {
  margin-right: 10px;
  color: #666666;
  text-align: center;
}

</style>
