<!-- 信息管理 - 会员信息 -->
<template>
  <div class="page">
    <topBar
      v-if="topList.length > 0"
      :top-list="topList"
      :moren="moren"
    />
    <div class="thetopbox">
      <el-form label-width="100px">
        <el-row>
          <el-col :span="4">
            <el-form-item :label="'会员编号'" prop="memberCode">
              <el-input
                v-model="queryParams.memberCode"
                clearable
                :placeholder="'请输入'"
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="'会员姓名'" prop="memberName">
              <el-input
                v-model="queryParams.memberName"
                clearable
                :placeholder="'请输入'"
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="'联系方式'" prop="phone">
              <el-input
                v-model="queryParams.phone"
                clearable
                :placeholder="'请输入'"
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="'变更次数'" prop="changeNumber">
              <el-input
                v-model="queryParams.changeNumber"
                clearable
                :placeholder="'请输入'"
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="'注册等级'" prop="pkRegisterGrade">
              <el-select
                v-model="queryParams.pkRegisterGrade"
                clearable
                :placeholder="'请选择'"
              >
                <el-option
                  v-for="item in gradeRangList"
                  :key="item.pkId"
                  :label="item.gradeName"
                  :value="item.pkId"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="'结算等级'" prop="pkSettleGrade">
              <el-select
                v-model="queryParams.pkSettleGrade"
                clearable
                :placeholder="'请选择'"
              >
                <el-option
                  v-for="item in gradeRangList"
                  :key="item.pkId"
                  :label="item.gradeName"
                  :value="item.pkId"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <el-form-item :label="'荣誉奖衔'" prop="pkAwards">
              <el-select
                v-model="queryParams.pkAwards"
                clearable
                :placeholder="'请选择'"
              >
                <el-option
                  v-for="item in awardsList"
                  :key="item.pkId"
                  :label="item.awardsName"
                  :value="item.pkId"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="'隶属体系'" prop="vertexId">
              <el-select
                v-model="queryParams.vertexId"
                clearable
                :placeholder="'请选择'"
              >
                <el-option
                  v-for="item in vertexList"
                  :key="item.pkId"
                  :label="item.vertexName"
                  :value="item.pkId"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="'隶属团队'" prop="teamId">
              <el-select
                v-model="queryParams.teamId"
                clearable
                :placeholder="'请选择'"
              >
                <el-option
                  v-for="item in memberteamList"
                  :key="item.pkId"
                  :label="item.teamName"
                  :value="item.pkId"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="'注册权限'" prop="registerAuthority">
              <el-select
                v-model="queryParams.registerAuthority"
                clearable
                :placeholder="'请选择'"
              >
                <el-option
                  v-for="item in registerList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                />
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="4">
            <el-form-item :label="'账户状态'" prop="accountStatus">
              <el-select
                v-model="queryParams.accountStatus"
                clearable
                :placeholder="'请选择'"
              >
                <el-option
                  v-for="item in accountStatus"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="'钱包状态'" prop="memberAccount">
              <el-select
                v-model="queryParams.memberAccount"
                clearable
                :placeholder="'请选择'"
              >
                <el-option
                  v-for="item in salletStatus"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-collapse-transition>
          <div v-show="isActive">
            <el-row>
              <el-col :span="4">
                <el-form-item :label="'收益状态'" prop="incomeStatus">
                  <el-select
                    v-model="queryParams.incomeStatus"
                    clearable
                    :placeholder="'请选择'"
                    @change="getSel"
                  >
                    <el-option
                      v-for="item in incomeStatusListd"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    />
                  </el-select>
                </el-form-item>
              </el-col>
              <!-- <el-col :span="4">
                <el-form-item :label="'代理等级'" prop="agentGrade">
                  <el-select
                    v-model="queryParams.agentGrade"
                    clearable
                    :placeholder="'请选择'"
                  >
                    <el-option
                      v-for="item in agentGradeList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    />
                  </el-select>
                </el-form-item>
              </el-col> -->
              <el-col :span="4">
                <el-form-item :label="'实名认证'" prop="isRealName">
                  <el-select
                    v-model="queryParams.isRealName"
                    clearable
                    :placeholder="'请选择'"
                  >
                    <el-option
                      v-for="item in tattestation"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    />
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="4">
                <el-form-item label="服务协议" prop="serviceAgreement">
                  <el-select
                    v-model="queryParams.serviceAgreement"
                    clearable
                    :placeholder="'请选择'"
                  >
                    <el-option
                      v-for="item in serviceList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    />
                  </el-select>
                </el-form-item>
              </el-col>

              <el-col :span="4">
                <el-form-item :label="'订单类型'" prop="orderSource">
                  <el-select
                    v-model="queryParams.orderSource"
                    clearable
                    :placeholder="'请选择'"
                  >
                    <el-option
                      v-for="item in orderStatusList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    />
                  </el-select>
                </el-form-item>
              </el-col>

              <el-col :span="4">
                <el-form-item :label="'服务中心编号'" prop="centerMemberCode">
                  <el-input
                    v-model="queryParams.centerMemberCode"
                    clearable
                    :placeholder="'请输入'"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="4">
                <el-form-item :label="'服务中心姓名'" prop="centerMemberName">
                  <el-input
                    v-model="queryParams.centerMemberName"
                    clearable
                    :placeholder="'请输入'"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="4">
                <el-form-item :label="'推荐编号'" prop="parMemberCode">
                  <el-input
                    v-model="queryParams.parMemberCode"
                    clearable
                    :placeholder="'请输入'"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="4">
                <el-form-item :label="'推荐姓名'" prop="parMemberName">
                  <el-input
                    v-model="queryParams.parMemberName"
                    clearable
                    :placeholder="'请输入'"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="4">
                <el-form-item :label="'安置编号'" prop="placeMemberCode">
                  <el-input
                    v-model="queryParams.placeMemberCode"
                    clearable
                    :placeholder="'请输入'"
                  />
                </el-form-item>
              </el-col>

              <el-col :span="4">
                <el-form-item :label="'安置姓名'" prop="placeMemberName">
                  <el-input
                    v-model="queryParams.placeMemberName"
                    clearable
                    :placeholder="'请输入'"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="4">
                <el-form-item :label="'修改直推次数'" prop="directPushNumber">
                  <el-input
                    v-model="queryParams.directPushNumber"
                    clearable
                    type="number"
                    :placeholder="'请输入'"
                  />
                </el-form-item>
              </el-col>
              <!-- <el-col :span="4">
                <el-form-item label="体验中心">
                  <el-select
                    v-model="queryParams.storeType"
                    clearable
                    :placeholder="'请选择'"
                  >
                    <el-option
                      v-for="item in tattestation"
                      :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="queryParams.expireStatus"
                    clearable
                    :placeholder="'请选择'"
                  >
                    <el-option
                      v-for="item in expireList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    />
                  </el-select>
                </el-form-item>
              </el-col>

              <el-col :span="8">
                <el-form-item :label="'创建日期'" prop="code">
                  <el-date-picker
                    v-model="queryParams.cjsj"
                    type="daterange"
                    range-separator="——"
                    :start-placeholder="'开始时间'"
                    :end-placeholder="'结束日期'"
                    value-format="yyyy-MM-dd"
                    :unlink-panels="true"
                    @change="changeTime1"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item :label="'支付日期'" prop="code">
                  <el-date-picker
                    v-model="queryParams.zfsj"
                    type="daterange"
                    range-separator="——"
                    :start-placeholder="'开始时间'"
                    :end-placeholder="'结束日期'"
                    value-format="yyyy-MM-dd"
                    :unlink-panels="true"
                    @change="changeTime2"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="有效期" prop="code">
                  <el-date-picker
                    v-model="queryParams.dqsj"
                    type="daterange"
                    range-separator="——"
                    :start-placeholder="'开始时间'"
                    :end-placeholder="'结束日期'"
                    value-format="yyyy-MM-dd"
                    :unlink-panels="true"
                    @change="changeTime3"
                  />
                </el-form-item>
              </el-col>
            </el-row>
          </div>
        </el-collapse-transition>
        <el-row style="margin-left: 20px">
          <el-col :span="4">
            <div class="searchbox">
              <el-button class="searchbtn" @click="getMemberList">
                {{ '搜索' }}</el-button>
              <el-button @click="reChongzhi"> {{ '重置' }}</el-button>
            </div>
          </el-col>
          <div class="openClose" @click="changeActive">
            <i
              :class="isActive ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
            />
            <div>{{ isActive ? '点击收起' : '点击展开' }}</div>
          </div>
        </el-row>
      </el-form>
    </div>
    <div class="maintop">
      <div class="mainbtn">
        <el-button
          v-hasButtons="['MemberExport']"
          size="small"
          class="thebtn2"
          @click="handleExport"
        >
          {{ '导出' }}</el-button>
        <el-button
          v-hasButtons="['memberDown']"
          size="small"
          style="background-color: #009b58; color: #fff; margin-left: 15px"
          class="thebtn2"
          @click="importTemplate"
        >
          {{ '下载模板' }}</el-button>
        <el-button
          v-hasButtons="['memberImport']"
          size="small"
          class="thebtn2"
          style="background-color: #ff6723; color: #fff"
          @click="handleImport"
        >
          {{ '导入' }}</el-button>
      </div>
      <div style="padding-right: 0px">
        <el-dropdown :hide-on-click="false" style="width: 120px">
          <span class="el-dropdown-link kuang">
            {{ '筛选字段'
            }}<i class="el-icon-arrow-down el-icon--right" />
          </span>
          <el-dropdown-menu slot="dropdown" style="">
            <el-dropdown-item v-for="item in menuList" :key="item.id">
              <el-checkbox
                v-model="item.checked"
                @change="getMenu($event, item.id)"
              >{{ item.text }}</el-checkbox></el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </div>
    <div class="main">
      <div class="maintable">
        <el-table
          ref="table"
          :data="tableData"
          :height="isActive ? '480px' : '630px'"
        >
          v-loading="loading" style="width: 100%" :header-cell-style="{
          background: '#EEEEEE' }" :row-class-name="tableRowClassName"
          @selection-change="handleSelectionChange" >
          <el-table-column type="selection" />
          <el-table-column
            v-if="allTxt.memberCode"
            align="center"
            prop="memberCode"
            :label="'会员编号'"
            width="180"
          />
          <el-table-column
            v-if="allTxt.memberName"
            align="center"
            prop="memberName"
            :label="'会员姓名'"
            width="180"
          />
          <el-table-column
            v-if="allTxt.phone"
            align="center"
            prop="phone"
            :label="'联系方式'"
            width="180"
          />
          <el-table-column
            v-if="menuList[1].checked == true && allTxt.parMemberCode"
            align="center"
            prop="parMemberCode"
            :label="'推荐编号'"
            width="180"
          />
          <el-table-column
            v-if="menuList[2].checked == true && allTxt.parMemberName"
            align="center"
            prop="parMemberName"
            :label="'推荐姓名'"
            width="180"
          />
          <el-table-column
            v-if="menuList[3].checked == true && allTxt.placeMemberCode"
            align="center"
            prop="placeMemberCode"
            :label="'安置编号'"
            width="180"
          />
          <el-table-column
            v-if="menuList[3].checked == true && allTxt.placeMemberCode"
            align="center"
            prop="placeDeptVal"
            label="安置部门"
            width="180"
          />
          <el-table-column
            v-if="menuList[4].checked == true && allTxt.placeMemberName"
            align="center"
            prop="placeMemberName"
            :label="'安置姓名'"
            width="180"
          />
          <el-table-column
            v-if="allTxt.pkAwardsVal"
            align="center"
            prop="pkAwardsVal"
            :label="'荣誉奖衔'"
            width="180"
          />

          <el-table-column
            v-if="allTxt.orderSourceVal"
            align="center"
            prop="orderSourceVal"
            :label="'订单类型'"
            width="180"
          />

          <el-table-column
            v-if="menuList[5].checked == true && allTxt.centerMemberCode"
            align="center"
            prop="centerMemberCode"
            :label="'服务中心编号'"
            width="180"
          />
          <el-table-column
            v-if="menuList[6].checked == true && allTxt.centerMemberName"
            align="center"
            prop="centerMemberName"
            :label="'服务中心姓名'"
            width="180"
          />

          <el-table-column
            v-if="menuList[7].checked == true && allTxt.pkRegisterGradeVal"
            align="center"
            prop="pkRegisterGradeVal"
            :label="'注册等级'"
            width="180"
          />
          <el-table-column
            v-if="menuList[8].checked == true && allTxt.pkSettleGradeVal"
            align="center"
            prop="pkSettleGradeVal"
            :label="'结算等级'"
            width="180"
          />
          <el-table-column
            v-if="menuList[9].checked == true && allTxt.consumeMoney"
            align="center"
            prop="consumeMoney"
            :label="'注册金额' + `(${isLocalSymbol()})`"
            width="180"
          >
            <template slot-scope="scope">
              {{ scope.row.consumeMoney | numberToCurrency }}
            </template>
          </el-table-column>
          <el-table-column
            v-if="menuList[10].checked == true && allTxt.consumeAchieve"
            align="center"
            :label="`${'注册业绩'}` + `(${isLocals()})`"
            prop="consumeAchieve"
            width="180"
          >
            <template slot-scope="scope">
              {{ scope.row.consumeAchieve | numberToCurrency }}
            </template>
          </el-table-column>
          <el-table-column
            v-if="menuList[11].checked == true && allTxt.vertexName"
            align="center"
            prop="vertexName"
            :label="'隶属体系'"
            width="180"
          />
          <el-table-column
            v-if="menuList[12].checked == true && allTxt.teamName"
            align="center"
            prop="teamName"
            :label="'隶属团队'"
            width="180"
          />
          <el-table-column
            v-if="menuList[13].checked == true && allTxt.registerAuthorityVal"
            align="center"
            prop="registerAuthorityVal"
            :label="'注册权限'"
            width="180"
          />
          <el-table-column
            v-if="menuList[14].checked == true && allTxt.isRealNameVal"
            align="center"
            prop="isRealNameVal"
            :label="'实名认证'"
            width="180"
          >
            <template slot-scope="scope">
              <span
                v-if="scope.row.isRealName == 0"
                style="color: #009b58"
              >已认证</span>
              <span
                v-if="scope.row.isRealName == 1"
                style="color: #c8161d"
              >未认证</span>
            </template>
          </el-table-column>
          <el-table-column
            v-if="allTxt.serviceAgreementVal"
            align="center"
            prop="serviceAgreementVal"
            label="服务协议"
            width="180"
          />
          <el-table-column
            key="purchaseStatus"
            align="center"
            prop="purchaseStatus"
            label="复购免考"
            width="180"
          >
            <template slot-scope="scope">
              <span>
                {{ scope.row.purchaseStatus === 0 ? '是' : '否' }}
              </span>
            </template>
          </el-table-column>
          <el-table-column
            v-if="menuList[17].checked == true && allTxt.accountStatusVal"
            align="center"
            prop="accountStatusVal"
            :label="'账户状态'"
            width="180"
          />
          <el-table-column
            v-if="menuList[18].checked == true && allTxt.memberAccountVal"
            align="center"
            prop="memberAccountVal"
            :label="'钱包状态'"
            width="180"
          />
          <el-table-column
            v-if="allTxt.incomeStatusVal"
            align="center"
            prop="incomeStatusVal"
            :label="'收益状态'"
            width="180"
          />
          <el-table-column
            v-if="allTxt.creationTime"
            align="center"
            prop="creationTime"
            :label="'创建日期'"
            width="180"
          />
          <el-table-column
            v-if="allTxt.payTime"
            align="center"
            prop="payTime"
            :label="'支付日期'"
            width="180"
          />
          <el-table-column
            v-if="allTxt.expireDate"
            align="center"
            prop="expireDate"
            label="有效期"
            width="180"
          />
          <el-table-column
            v-if="allTxt.stopDate"
            align="center"
            prop="stopDate"
            label="休止日期"
            width="180"
          />
          <el-table-column
            v-if="allTxt.expireStatusVal"
            align="center"
            prop="expireStatusVal"
            label="会员状态"
            width="180"
          />
          <el-table-column
            v-if="allTxt.changeNumber"
            align="center"
            prop="changeNumber"
            :label="'变更次数'"
            width="180"
          />
          <el-table-column
            v-if="allTxt.directPushNumber"
            align="center"
            prop="directPushNumber"
            :label="'修改直推次数'"
            width="180"
          />
          <el-table-column
            align="center"
            prop="categoryVal"
            :label="'会员类型'"
            width="180"
          />

          <el-table-column
            align="center"
            prop="time"
            :label="'操作'"
            fixed="right"
            width="100"
          >
            <template slot-scope="scope">
              <el-button
                v-has-buttons="['memberLogin']"
                class="button-s"
                :disabled="scope.row.category != 0"
                type="text"
                size="small"
                @click="toLogin(scope.row)"
              >
                登录
              </el-button>
            </template>
          </el-table-column>
          <!-- <el-table-column
            v-for="item in menuList"
            :key="item.id"
            align="center"
            width="130"
            :prop="item.prop"
            v-if="item.checked && item.id != 0 && item.id < 20"
            :label="item.text"
          >
          </el-table-column> -->
        </el-table>
      </div>
    </div>
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getMemberList"
    />

    <el-dialog
      :title="upload.title"
      :close-on-click-modal="false"
      :visible.sync="upload.open"
      width="600px"
      append-to-body
    >
      <el-upload
        ref="upload"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="upload.headers"
        :action="upload.url"
        :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :on-exceed="handleExceed"
        :auto-upload="false"
        drag
      >
        <i class="el-icon-upload" />
        <div class="el-upload__text">
          {{ '将文件拖到此处，或' }}
          <em>{{ '点击上传' }}</em>
        </div>
        <div slot="tip" class="el-upload__tip" style="color: red">
          {{ '提示：仅允许导入“xls”或“xlsx”格式文件！' }}
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">{{
          '确认'
        }}</el-button>
        <el-button @click="upload.open = false">{{
          '取消'
        }}</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import topBar from '@/components/topBar'
import {
  getMemberList,
  getvertexValue,
  getmemberTeamList,
  getaccountStatus,
  getsalletStatus,
  getattestation,
  getYesnouploadsList,
  getorderStatus,

  passwordFree,
  passwordFreeLen,
  incomeStatusList,
  serviceStatus,
  getExpirestatus
} from '@/api/member'
import {
  getgradeRanglist,
  getAwardsListChiose,
  getRegistration
  // lecturerList
} from '@/api/level'
import { getRoleMenu } from '@/api/notice'
import { getToken } from '@/utils/auth'

import { isLocals, isLocalSymbol } from '@/utils/numberToCurrency'
export default {
  name: 'Jcyw',
  components: {
    topBar
  },
  data() {
    return {
      loading: false,
      allTxt: {},
      menuList: [
        {
          id: 0,
          text: '全选',
          checked: false
        },
        {
          id: 1,
          text: '推荐编号',
          checked: true,
          prop: 'parMemberCode'
        },
        {
          id: 2,
          text: '推荐姓名',
          checked: true,
          prop: 'parMemberName'
        },
        {
          id: 3,
          text: '安置编号',
          checked: true,
          prop: 'placeMemberName'
        },
        {
          id: 4,
          text: '安置姓名',
          checked: true,
          prop: 'placeMemberName'
        },
        {
          id: 5,
          text: '服务中心编号',
          checked: true,
          prop: 'centerMemberCode'
        },
        {
          id: 6,
          text: '服务中心姓名',
          checked: true,
          prop: 'centerMemberName'
        },
        {
          id: 7,
          text: '注册等级',
          checked: true,
          prop: 'pkRegisterGradeVal'
        },
        {
          id: 8,
          text: '结算等级',
          checked: true,
          prop: 'pkSettleGradeVal'
        },
        {
          id: 9,
          text: '注册金额',
          checked: true,
          prop: 'consumeMoney'
        },
        {
          id: 10,
          text: '注册业绩',
          checked: true,
          prop: 'consumeAchieve'
        },
        {
          id: 11,
          text: '隶属体系',
          checked: true,
          prop: 'vertexName'
        },
        {
          id: 12,
          text: '隶属团队',
          checked: true,
          prop: 'teamName'
        },
        {
          id: 13,
          text: '修改结算国家',
          checked: true,
          prop: 'registerAuthorityVal'
        },
        {
          id: 14,
          text: '实名认证',
          checked: true,
          prop: 'isRealNameVal'
        },
        {
          id: 15,
          text: '讲师等级',
          checked: true,
          prop: ''
        },
        {
          id: 17,
          text: '超级工作室',
          checked: true,
          prop: 'superStudioVal'
        },

        {
          id: 19,
          text: '账户状态',
          checked: true,
          prop: 'accountStatusVal'
        },
        {
          id: 20,
          text: '钱包状态',
          checked: true,
          prop: 'memberAccountVal'
        }
      ],
      upload: {
        // 是否显示弹出层（物流导入）
        open: false,
        // 弹出层标题（物流导入）
        title: '',
        // 是否禁用上传
        isUploading: false,
        // 是否更新已经存在的物流数据
        updateSupport: 0,
        // 设置上传的请求头部
        headers: { Authorization: 'Bearer ' + getToken() },
        // 上传的地址
        url:
          process.env.VUE_APP_BASE_API +
          '/member/manager/member/batch-importData'
      },
      moren: 'jcyw',
      topList: [
        {
          name: '会员信息',
          path: 'jcyw'
        }
        // {
        //   name: '订单业务',
        //   path: "ddyw",
        // },
        // {
        //   name: "审核业务",
        //   path: "shyw",
        // },
        // {
        //   name: "在线签呈",
        //   path: "zxqc",
        // },
      ],
      colums: [],
      checkLabels: [],
      checkList: [],
      multipleSelection: [],
      incomeStatusListd: [],
      queryParams: {
        pageNum: 1,
        pageSize: 50,
        memberCode: '', // 会员编号
        memberName: '', // 会员姓名
        phone: '', // 联系方式
        changeNumber: '', // 变更次数
        pkRegisterGrade: '', // 注册等级
        pkSettleGrade: '', // 结算等级
        pkAwards: '', // 真实奖衔
        vertexId: '', // 隶属体系
        teamId: '', // 隶属团队
        registerAuthority: '', // 注册权限
        accountStatus: '', // 账户状态
        memberAccount: '', // 钱包状态
        isRealName: '', // 实名认证
        isBusLicense: '', // 营业执照
        orderSource: '', // 订单状态
        centerMemberCode: '', // 服务中心编号
        centerMemberName: '', // 服务中心姓名
        parMemberCode: '', // 推荐编号
        parMemberName: '', // 推荐姓名
        placeMemberCode: '', // 安置编号
        placeMemberName: '', // 安置姓名
        startDate: '', // 创建时间-开始
        endDate: '', // 创建时间-结束
        startDatePay: '', // 支付时间-开始
        endDatePay: '', // 支付时间-结束
        agentGrade: '', // 代理等级
        incomeStatus: ''
      },
      tableData: [],
      // 折叠搜索框
      isActive: false,
      total: 0,
      gradeRangList: [], // 注册等级
      awardsList: [], // 真实奖衔
      vertexList: [], // 隶属体系
      memberteamList: [], // 隶属团队
      registerList: [], // 注册权限
      accountStatus: [], // 账户状态
      salletStatus: [], // 钱包状态
      tattestation: [], // 实名认证 是否认证
      serviceList: [], // 服务协议
      lecturerLevel: [], // 讲师等级
      yesnouploadsList: [], // 营业执照 是否上传
      orderStatusList: [], // 订单状态
      agentGradeList: [], // 代理等级
      directPushNumber: '', // 修改直推次数
      expireList: []
    }
  },
  computed: {
    canDo() {
      return this.checkList.length > 0
    }
  },
  created() {
    // 查询会员信息
    this.getMemberList()
    this.getgradeRanglist()
    // this.lecturerLevels()

    this.getAwardsListChiose()
    this.getvertexValue()
    this.getmemberTeamList()
    this.getRegistration()
    this.getaccountStatus()
    this.getsalletStatus()
    this.getattestation()
    this.getYesnouploadsList()
    this.getorderStatus()
    this.incomeStatusList()
    this.serviceStatus()
    // 初始化表头
    // this.checkLabels = JSON.parse(
    //   JSON.stringify(Object.keys(this.tableData[0]))
    // )
    // this.colums = JSON.parse(JSON.stringify(Object.keys(this.tableData[0])))
  },
  mounted() {
    this.getUserRole()
  },
  methods: {
    getSel(e) {
      console.log(
        '%c [ e ]-1002',
        'font-size:13px; background:#6f02a8; color:#b346ec;',
        e
      )
      // this.$forceUpdate()
      this.$set(this.queryParams, 'incomeStatus', e)
    },
    changeTime1(val) {
      this.queryParams.startDate = val ? val[0] : ''
      this.queryParams.endDate = val ? val[1] : ''
    },
    changeTime2(val) {
      this.queryParams.startDatePay = val ? val[0] : ''
      this.queryParams.endDatePay = val ? val[1] : ''
    },
    changeTime3(val) {
      this.queryParams.startExpireDate = val ? val[0] : ''
      this.queryParams.endExpireDate = val ? val[1] : ''
    },
    getUserRole() {
      getRoleMenu('Member').then((res) => {
        const obj = {}
        res.data.forEach((item) => {
          obj[item] = 1
        })
        this.allTxt = obj
        this.$nextTick(() => {
          this.$refs.table.doLayout()
        })
      })
    },
    // 导出
    handleExport() {
      this.$confirm('是否确认导出所有数据项?', '警告', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then((_) => {
        this.download(
          '/member/manager/member/export',
          { ...this.queryParams },
          `${'会员信息'}}${new Date().getTime()}.xlsx`
        )
      })
    },
    isLocalSymbol,
    isLocals,
    toLogin(row) {
      if (row.systemType == 0) {
        passwordFree({
          memberCode: row.memberCode
        }).then((res) => {
          if (res.code == 200) {
            const href =
              process.env.VUE_APP_CLIENT_ADDRESS +
              '?token=' +
              res.data.access_token
            window.open(href, '_blank')
          }
        })
      } else if (row.systemType == 1) {
        passwordFreeLen({
          memberCode: row.memberCode
        }).then((res) => {
          if (res.code == 200) {
            const href =
              process.env.VUE_APP_ADDRESS +
              '?token=' +
              res.data.access_token
            window.open(href, '_blank')
          }
        })
      }
    },
    // lecturerLevels() {
    //   lecturerList().then((res) => {
    //     this.lecturerLevel = res.data
    //   })
    // },
    getMenu(e, id) {
      if (e && id == 0) {
        this.menuList.forEach((item) => {
          this.$set(item, 'checked', true)
        })
      } else if (!e && id == 0) {
        this.menuList.forEach((item) => {
          this.$set(item, 'checked', false)
        })
      }
    },
    // 查询会员信息
    getMemberList() {
      this.loading = true
      getMemberList(this.queryParams).then((res) => {
        this.loading = false
        this.total = res.total
        this.tableData = res.rows
      })
    },
    // 订单状态
    getorderStatus() {
      getorderStatus().then((res) => {
        this.orderStatusList = res.data
      })
    },
    // 营业执照-是否上传
    getYesnouploadsList() {
      getYesnouploadsList().then((res) => {
        this.yesnouploadsList = res.data
      })
    },
    // 认证下拉选
    getattestation() {
      getattestation().then((res) => {
        this.tattestation = res.data
      })
      getExpirestatus().then((res) => {
        this.expireList = res.data
      })
    },
    // 服务协议
    serviceStatus() {
      serviceStatus().then((res) => {
        this.serviceList = res.data
      })
    },
    // 钱包状态下拉选
    getsalletStatus() {
      getsalletStatus().then((res) => {
        this.salletStatus = res.data
      })
    },
    // 账户状态下拉选
    getaccountStatus() {
      getaccountStatus().then((res) => {
        this.accountStatus = res.data
      })
    },
    // 注册权限下拉选
    getRegistration() {
      getRegistration().then((res) => {
        this.registerList = res.data
      })
    },
    // 隶属团队下拉选
    getmemberTeamList() {
      getmemberTeamList().then((res) => {
        this.memberteamList = res.rows
      })
    },
    // 隶属体系下拉选 取pkid和name
    getvertexValue() {
      getvertexValue().then((res) => {
        this.vertexList = res.data
      })
    },
    // 真实奖衔下拉选
    getAwardsListChiose() {
      getAwardsListChiose().then((res) => {
        this.awardsList = res.rows
      })
    },
    // 注册等级下拉
    getgradeRanglist() {
      getgradeRanglist().then((res) => {
        this.gradeRangList = res.data
      })
    },
    // 收益状态
    incomeStatusList() {
      incomeStatusList().then((res) => {
        this.incomeStatusListd = res.data
      })
    },

    // 展开折叠
    changeActive() {
      this.isActive = !this.isActive
    },
    // 重置
    reChongzhi() {
      this.queryParams = {
        pageNum: 1,
        pageSize: 50
      }
      this.getMemberList()
    },
    handleSelectionChange(val) {
      this.multipleSelection = val
    },
    /** 导入按钮操作 */
    handleImport() {
      this.upload.title = '批量查询'
      this.upload.open = true
    },
    // 下载模板
    importTemplate() {
      this.download(
        '/member/manager/member/download',
        {},
        `${'会员信息'}${new Date().getTime()}.xlsx`
      )
    },
    // 文件上传中处理
    handleFileUploadProgress(event, file, fileList) {
      this.upload.isUploading = true
    },
    // 文件上传成功处理
    handleFileSuccess(response, file, fileList) {
      var fileName = response.fileName
      if (fileName != undefined && fileName != '') {
      }
      if (response.code == 200) {
        this.download(
          '/member/manager/member/export',
          { memberCodeStr: response.msg },
          `${'会员信息'}}${new Date().getTime()}.xlsx`
        )
      }
      this.upload.open = false
      this.upload.isUploading = false
      this.$refs.upload.clearFiles()
      const str = ''
      //  let data = response.msg.split(',')
      //  data.forEach((item) => {
      //        item = item + ";";
      //        str += `<div>${item}</div>`;
      //    });
      this.$alert('', '上传成功', {
        dangerouslyUseHTMLString: true
      })
      // this.getList();
    },
    // 上传文件数量超出后的动作
    handleExceed() {
      this.upload.isUploading = false
      this.msgInfo('仅可上传一个文件哦')
    },
    // 提交上传文件
    submitFileForm() {
      this.$refs.upload.submit()
    },
    tableRowClassName({ row, rowIndex }) {
      if (rowIndex % 2 == 1) {
        return 'warning-row'
      } else if (rowIndex % 2 == 0) {
        return 'success-row'
      }
      return ''
    }
  }
}
</script>

<style lang="scss" scoped>
.kuang {
  padding: 5px 20px;
  background: rgba(255, 255, 255, 0);
  border-radius: 4px;
  border: 1px solid #cccccc;
}
.heji {
  margin-top: 10px;
  .dis {
    display: flex;
    justify-content: right;
    padding: 5px 10px;
    font-size: 14px;
    color: #333333;
    :nth-child(1) {
      font-size: 14px;
      font-weight: bold;
      color: #333333;
      margin-right: 20px;
    }
  }
}

::v-deep .el-input__inner {
  height: 32px;
  line-height: 32px;
}
::v-deep .el-date-editor .el-range__close-icon {
  margin-top: -10px;
}
::v-deep .el-date-editor .el-range-separator {
  margin-top: -10px;
}
::v-deep .el-date-editor .el-range__icon {
  margin-top: -10px;
}
::v-deep .el-button {
  padding: 8px 20px;
}
::v-deep .el-form-item {
  margin-bottom: 10px;
}
::v-deep .el-table .warning-row {
  background: #f9f9f9;
}

::v-deep .el-table .success-row {
  background: #ffffff;
}
::v-deep .el-table thead {
  color: #000000;
}
.openClose {
  margin-top: 10px;
  margin-right: 10px;
  color: #666666;
  text-align: center;
}
.page {
  padding: 10px 20px 0 20px;
  background: #f9f9f9;
  font-size: 14px;
  .thetopbox {
    padding: 0px 0;
    background: #ffffff;
    border-radius: 8px;
    .searchbox {
      display: flex;
      align-items: center;
      .searchtitle {
        margin-right: 10px;
      }
      .searchbtn {
        width: 68px;
        background: #c8161d;
        color: #ffffff;
      }
    }
  }
  .maintop {
    display: flex;
    padding: 0px 0;
    justify-content: space-between;
    align-items: center;
    .mainbtn {
      display: flex;
      // justify-content: space-between;
      align-content: center;
      width: 100%;
      .thebtn1 {
        color: #ffffff;
        background: #3181e5;
      }
      .thebtn2 {
        color: #ffffff;
        background: #ffad41;
      }
    }
  }
  .main {
    // margin-top: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
    .maintable {
      overflow: auto;
    }
  }
}
::v-deep .el-date-editor.el-input,
.el-date-editor.el-input__inner {
  width: 100%;
}
</style>
