<!-- 信息管理 - 会员信息 -->
<template>
  <div class="page">
    <topBar
      v-if="topList.length > 0"
      :topList="topList"
      :moren="moren"
    ></topBar>
    <div class="thetopbox">
      <el-form label-width="100px">
        <el-row>
          <el-col :span="4">
            <el-form-item :label="$t('MN_T_1')" prop="memberCode">
              <el-input
                clearable
                v-model="queryParams.memberCode"
                :placeholder="$t('S_C_70')"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="$t('CK_KS_14')" prop="memberName">
              <el-input
                clearable
                v-model="queryParams.memberName"
                :placeholder="$t('S_C_70')"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="$t('w_0052')" prop="phone">
              <el-input
                clearable
                v-model="queryParams.phone"
                :placeholder="$t('S_C_70')"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="$t('MN_F_T_833')" prop="changeNumber">
              <el-input
                clearable
                v-model="queryParams.changeNumber"
                :placeholder="$t('S_C_70')"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="$t('PER_DA_5')" prop="pkRegisterGrade">
              <el-select
                clearable
                :placeholder="$t('CK_KS_38')"
                v-model="queryParams.pkRegisterGrade"
              >
                <el-option
                  v-for="item in gradeRangList"
                  :key="item.pkId"
                  :label="item.gradeName"
                  :value="item.pkId"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="$t('CK_KS_15')" prop="pkSettleGrade">
              <el-select
                clearable
                :placeholder="$t('CK_KS_38')"
                v-model="queryParams.pkSettleGrade"
              >
                <el-option
                  v-for="item in gradeRangList"
                  :key="item.pkId"
                  :label="item.gradeName"
                  :value="item.pkId"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <el-form-item :label="$t('级差奖衔')" prop="pkAwards">
              <el-select
                clearable
                :placeholder="$t('CK_KS_38')"
                v-model="queryParams.pkAwards"
              >
                <el-option
                  v-for="item in awardsList"
                  :key="item.pkId"
                  :label="item.awardsName"
                  :value="item.pkId"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="$t('荣誉奖衔')" prop="pkRangeAwards">
              <el-select
                clearable
                :placeholder="$t('CK_KS_38')"
                v-model="queryParams.pkRangeAwards"
              >
                <el-option
                  v-for="item in awardsList"
                  :key="item.pkId"
                  :label="item.awardsName"
                  :value="item.pkId"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="$t('MN_F_T_829')" prop="vertexId">
              <el-select
                clearable
                :placeholder="$t('CK_KS_38')"
                v-model="queryParams.vertexId"
              >
                <el-option
                  v-for="item in vertexList"
                  :key="item.pkId"
                  :label="item.vertexName"
                  :value="item.pkId"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="$t('MN_F_T_122')" prop="teamId">
              <el-select
                clearable
                :placeholder="$t('CK_KS_38')"
                v-model="queryParams.teamId"
              >
                <el-option
                  v-for="item in memberteamList"
                  :key="item.pkId"
                  :label="item.teamName"
                  :value="item.pkId"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="$t('MN_F_T_882')" prop="incomeStatus">
              <el-select
                clearable
                :placeholder="$t('CK_KS_38')"
                @change="getSel"
                v-model="queryParams.incomeStatus"
              >
                <el-option
                  v-for="item in incomeStatusListd"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <!-- <el-col :span="4">
            <el-form-item :label="$t('MN_F_T_122')" prop="teamId">
              <el-select
                clearable
                :placeholder="$t('CK_KS_38')"
                v-model="queryParams.teamId"
              >
                <el-option
                  v-for="item in memberteamList"
                  :key="item.pkId"
                  :label="item.teamName"
                  :value="item.pkId"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col> -->
          <!-- <el-col :span="4">
            <el-form-item :label="$t('MN_F_T_830')" prop="registerAuthority">
              <el-select
                clearable
                :placeholder="$t('CK_KS_38')"
                v-model="queryParams.registerAuthority"
              >
                <el-option
                  v-for="item in registerList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col> -->

          <el-col :span="4">
            <el-form-item :label="$t('MN_F_T_831')" prop="accountStatus">
              <el-select
                clearable
                :placeholder="$t('CK_KS_38')"
                v-model="queryParams.accountStatus"
              >
                <el-option
                  v-for="item in accountStatus"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="$t('MN_F_T_832')" prop="memberAccount">
              <el-select
                clearable
                :placeholder="$t('CK_KS_38')"
                v-model="queryParams.memberAccount"
              >
                <el-option
                  v-for="item in salletStatus"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="$t('MY_WAL_32')" prop="isRealName">
              <el-select
                clearable
                :placeholder="$t('CK_KS_38')"
                v-model="queryParams.isRealName"
              >
                <el-option
                  v-for="item in tattestation"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="$t('MY_ORD_2')" prop="orderSource">
              <el-select
                clearable
                :placeholder="$t('CK_KS_38')"
                v-model="queryParams.orderSource"
              >
                <el-option
                  v-for="item in orderStatusList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="$t('N_I_164')" prop="parMemberCode">
              <el-input
                clearable
                v-model="queryParams.parMemberCode"
                :placeholder="$t('S_C_70')"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="$t('N_I_165')" prop="parMemberName">
              <el-input
                clearable
                v-model="queryParams.parMemberName"
                :placeholder="$t('S_C_70')"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item :label="$t('MN_F_T_834')" prop="directPushNumber">
              <el-input
                clearable
                v-model="queryParams.directPushNumber"
                type="number"
                :placeholder="$t('S_C_70')"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-collapse-transition>
          <div v-show="isActive">
            <el-row>
              <el-col :span="4">
                <el-form-item :label="$t('是否激活')" prop="isActivate">
                  <el-select
                    clearable
                    :placeholder="$t('CK_KS_38')"
                    v-model="queryParams.isActivate"
                  >
                    <el-option
                      v-for="item in ActivateList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <!-- <el-col :span="4">
                <el-form-item :label="$t('PER_DA_7')" prop="agentGrade">
                  <el-select
                    clearable
                    :placeholder="$t('CK_KS_38')"
                    v-model="queryParams.agentGrade"
                  >
                    <el-option
                      v-for="item in agentGradeList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col> -->

              <!-- <el-col :span="4">
                <el-form-item label="服务协议" prop="serviceAgreement">
                  <el-select
                    clearable
                    :placeholder="$t('CK_KS_38')"
                    v-model="queryParams.serviceAgreement"
                  >
                    <el-option
                      v-for="item in serviceList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col> -->

              <!--              <el-col :span="4">-->
              <!--                <el-form-item label="营业执照" prop="isBusLicense">-->
              <!--                  <el-select-->
              <!--                    clearable-->
              <!--                    :placeholder="$t('CK_KS_38')"-->
              <!--                    v-model="queryParams.isBusLicense"-->
              <!--                  >-->
              <!--                    <el-option-->
              <!--                      v-for="item in yesnouploadsList"-->
              <!--                      :key="item.value"-->
              <!--                      :label="item.label"-->
              <!--                      :value="item.value"-->
              <!--                    ></el-option>-->
              <!--                  </el-select>-->
              <!--                </el-form-item>-->
              <!--              </el-col>-->
              <!-- <el-col :span="4">
                <el-form-item :label="$t('MN_F_T_827')" prop="isMakerSpace">
                  <el-select
                    clearable
                    :placeholder="$t('CK_KS_38')"
                    v-model="queryParams.lecturerLevel"
                  >
                    <el-option
                      v-for="item in lecturerLevel"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col> -->

              <!-- <el-col :span="4">
                <el-form-item label="经销商" prop="isDealer">
                  <el-select
                    clearable
                    :placeholder="$t('CK_KS_38')"
                    v-model="queryParams.isDealer"
                  >
                    <el-option
                      v-for="item in tattestation"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col> -->
              <!-- <el-col :span="4">
                <el-form-item :label="$t('ENU_MENU_703')" prop="superStudio ">
                  <el-select
                    clearable
                    :placeholder="$t('CK_KS_38')"
                    v-model="queryParams.superStudio"
                  >
                    <el-option
                      v-for="item in tattestation"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col> -->

              <!-- <el-col :span="4">
                <el-form-item :label="$t('ENU_MENU_70')" prop="isMakerSpace">
                  <el-select
                    clearable
                    :placeholder="$t('CK_KS_38')"
                    v-model="queryParams.isMakerSpace"
                  >
                    <el-option
                      v-for="item in tattestation"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col> -->
              <!-- <el-col :span="4">
                <el-form-item :label="$t('MN_F_T_825')" prop="centerMemberCode">
                  <el-input
                    clearable
                    v-model="queryParams.centerMemberCode"
                    :placeholder="$t('S_C_70')"
                  ></el-input>
                </el-form-item>
              </el-col> -->
              <!-- <el-col :span="4">
                <el-form-item :label="$t('MN_F_T_826')" prop="centerMemberName">
                  <el-input
                    clearable
                    v-model="queryParams.centerMemberName"
                    :placeholder="$t('S_C_70')"
                  ></el-input>
                </el-form-item>
              </el-col> -->

              <!-- <el-col :span="4">
                <el-form-item :label="$t('N_I_167')" prop="placeMemberCode">
                  <el-input
                    clearable
                    v-model="queryParams.placeMemberCode"
                    :placeholder="$t('S_C_70')"
                  ></el-input>
                </el-form-item>
              </el-col> -->

              <!-- <el-col :span="4">
                <el-form-item :label="$t('N_I_166')" prop="placeMemberName">
                  <el-input
                    clearable
                    v-model="queryParams.placeMemberName"
                    :placeholder="$t('S_C_70')"
                  ></el-input>
                </el-form-item>
              </el-col> -->

              <el-col :span="8">
                <el-form-item :label="$t('收益地址')" prop="accountStatus">
                  <el-cascader
                    @change="flChange"
                    v-model="address"
                    class="area"
                    :options="areaData"
                    :placeholder="$t('S_C_30')"
                    :props="regionParams"
                  />
                </el-form-item>
              </el-col>
              <!-- <el-col :span="4">
                <el-form-item label="体验中心">
                  <el-select
                    clearable
                    :placeholder="$t('CK_KS_38')"
                    v-model="queryParams.storeType"
                  >
                    <el-option
                      v-for="item in tattestation"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col> -->
              <!-- <el-col :span="4">
                <el-form-item label="会员状态">
                  <el-select
                    clearable
                    :placeholder="$t('CK_KS_38')"
                    v-model="queryParams.expireStatus"
                  >
                    <el-option
                      v-for="item in expireList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col> -->
              <!-- <el-col :span="4">
                <el-form-item label="创客合伙人">
                  <el-select
                    clearable
                    :placeholder="$t('CK_KS_38')"
                    v-model="queryParams.isMakerGift"
                  >
                    <el-option
                      v-for="item in this.dealerList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col> -->
              <!-- <el-col :span="4">
                <el-form-item :label="$t('系统类型')">
                  <el-select clearable v-model="queryParams.systemType">
                    <el-option
                      v-for="item in systemTypes"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col> -->
              <el-col :span="8">
                <el-form-item :label="$t('PER_DA_9')" prop="code">
                  <el-date-picker
                    v-model="queryParams.cjsj"
                    type="daterange"
                    @change="changeTime1"
                    range-separator="——"
                    :start-placeholder="$t('CK_KS_3')"
                    :end-placeholder="$t('CK_KS_5')"
                    value-format="yyyy-MM-dd"
                    :unlink-panels="true"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item :label="$t('MN_F_T_914')" prop="code">
                  <el-date-picker
                    v-model="queryParams.zfsj"
                    type="daterange"
                    @change="changeTime2"
                    range-separator="——"
                    :start-placeholder="$t('CK_KS_3')"
                    :end-placeholder="$t('CK_KS_5')"
                    value-format="yyyy-MM-dd"
                    :unlink-panels="true"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <!-- <el-col :span="8">
                <el-form-item label="有效期" prop="code">
                  <el-date-picker
                    v-model="queryParams.dqsj"
                    type="daterange"
                    @change="changeTime3"
                    range-separator="——"
                    :start-placeholder="$t('CK_KS_3')"
                    :end-placeholder="$t('CK_KS_5')"
                    value-format="yyyy-MM-dd"
                    :unlink-panels="true"
                  >
                  </el-date-picker>
                </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">
                {{ $t("MN_T_2") }}</el-button
              >
              <el-button @click="reChongzhi"> {{ $t("MN_T_3") }}</el-button>
            </div>
          </el-col>
          <div class="openClose" @click="changeActive">
            <i
              :class="isActive ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
            ></i>
            <div>{{ isActive ? $t("MN_F_T_545") : $t("MN_F_T_546") }}</div>
          </div>
        </el-row>
      </el-form>
    </div>
    <div class="maintop">
      <div class="mainbtn">
        <el-button
          size="small"
          v-hasButtons="['MemberExport']"
          class="thebtn2"
          @click="handleExport"
        >
          {{ $t("MN_T_8") }}</el-button
        >
        <el-button
          size="small"
          v-hasButtons="['memberDown']"
          @click="importTemplate"
          style="background-color: #009b58; color: #fff; margin-left: 15px"
          class="thebtn2"
        >
          {{ $t("MN_T_10") }}</el-button
        >
        <el-button
          size="small"
          class="thebtn2"
          v-hasButtons="['memberImport']"
          style="background-color: #ff6723; color: #fff"
          @click="handleImport"
        >
          {{ $t("MN_T_9") }}</el-button
        >
      </div>
      <div style="padding-right: 0px">
        <el-dropdown :hide-on-click="false" style="width: 120px">
          <span class="el-dropdown-link kuang">
            {{ $t("MN_F_T_939")
            }}<i class="el-icon-arrow-down el-icon--right"></i>
          </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
          :data="tableData"
          ref="table"
          :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>
          <el-table-column
            align="center"
            prop="memberCode"
            :label="$t('MN_T_1')"
            v-if="allTxt.memberCode"
            width="180"
          >
          </el-table-column>
          <el-table-column
            align="center"
            prop="memberName"
            :label="$t('CK_KS_14')"
            v-if="allTxt.memberName"
            width="180"
          ></el-table-column>
          <el-table-column
            align="center"
            prop="nickName"
            label="会员昵称"
            v-if="allTxt.nickName"
          ></el-table-column>
          <el-table-column
            align="center"
            prop="phone"
            :label="$t('w_0052')"
            v-if="allTxt.phone"
            width="180"
          ></el-table-column>
          <el-table-column
            v-if="menuList[1].checked == true && allTxt.parMemberCode"
            align="center"
            prop="parMemberCode"
            :label="$t('N_I_164')"
            width="180"
          ></el-table-column>
          <el-table-column
            v-if="menuList[2].checked == true && allTxt.parMemberName"
            align="center"
            prop="parMemberName"
            :label="$t('N_I_165')"
            width="180"
          ></el-table-column>
          <el-table-column
            align="center"
            v-if="allTxt.pkAwardsVal"
            prop="pkAwardsVal"
            :label="$t('级差奖衔')"
            width="180"
          ></el-table-column>
          <el-table-column
            align="center"
            prop="pkRangeAwardsVal"
            :label="$t('荣誉奖衔')"
            width="180"
          ></el-table-column>
          <el-table-column
            align="center"
            v-if="allTxt.orderSourceVal"
            prop="orderSourceVal"
            :label="$t('MY_ORD_2')"
            width="180"
          ></el-table-column>
          <el-table-column
            v-if="menuList[3].checked == true && allTxt.pkRegisterGradeVal"
            align="center"
            prop="pkRegisterGradeVal"
            :label="$t('PER_DA_5')"
            width="180"
          ></el-table-column>
          <el-table-column
            v-if="menuList[4].checked == true && allTxt.pkSettleGradeVal"
            align="center"
            prop="pkSettleGradeVal"
            :label="$t('CK_KS_15')"
            width="180"
          ></el-table-column>
          <el-table-column
            v-if="menuList[5].checked == true && allTxt.consumeMoney"
            align="center"
            prop="consumeMoney"
            :label="$t('N_I_169') + `(${isLocalSymbol()})`"
            width="180"
          >
            <template slot-scope="scope">
              {{ scope.row.consumeMoney | numberToCurrency }}
            </template>
          </el-table-column>
          <el-table-column
            v-if="menuList[6].checked == true && allTxt.consumeAchieve"
            align="center"
            :label="`${$t('PER_DA_10')}` + `(${isLocals()})`"
            prop="consumeAchieve"
            width="180"
          >
            <template slot-scope="scope">
              {{ scope.row.consumeAchieve | numberToCurrency }}
            </template>
          </el-table-column>
          <el-table-column
            v-if="menuList[7].checked == true && allTxt.vertexName"
            align="center"
            prop="vertexName"
            :label="$t('MN_F_T_829')"
            width="180"
          ></el-table-column>
          <!-- <el-table-column
            v-if="menuList[8].checked == true && allTxt.registerAuthorityVal"
            align="center"
            prop="registerAuthorityVal"
            :label="$t('MN_F_T_830')"
            width="180"
          ></el-table-column> -->
          <el-table-column
            v-if="menuList[11].checked == true && allTxt.teamName"
            align="center"
            prop="teamName"
            label="隶属团队"
            width="180"
          ></el-table-column>
          <el-table-column
            v-if="menuList[8].checked == true && allTxt.isRealNameVal"
            align="center"
            prop="isRealNameVal"
            :label="$t('MY_WAL_32')"
            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="menuList[9].checked == true && allTxt.accountStatusVal"
            align="center"
            prop="accountStatusVal"
            :label="$t('MN_F_T_831')"
            width="180"
          ></el-table-column>
          <el-table-column
            v-if="menuList[10].checked == true && allTxt.memberAccountVal"
            align="center"
            prop="memberAccountVal"
            :label="$t('MN_F_T_832')"
            width="180"
          ></el-table-column>
          <el-table-column
            align="center"
            prop="giftProvince"
            :label="$t('收益区省')"
            width="180"
          ></el-table-column>
          <el-table-column
            align="center"
            prop="giftCity"
            :label="$t('收益区市')"
            width="180"
          ></el-table-column>
          <el-table-column
            align="center"
            prop="giftCounty"
            :label="$t('收益区县（区）')"
            width="180"
          ></el-table-column>

          <el-table-column
            align="center"
            v-if="allTxt.incomeStatusVal"
            prop="incomeStatusVal"
            :label="$t('MN_F_T_882')"
            width="180"
          ></el-table-column>
          <el-table-column
            align="center"
            v-if="allTxt.creationTime"
            prop="creationTime"
            :label="$t('PER_DA_9')"
            width="180"
          ></el-table-column>
          <el-table-column
            align="center"
            v-if="allTxt.payTime"
            prop="payTime"
            :label="$t('MN_F_T_914')"
            width="180"
          ></el-table-column>
          <el-table-column
            align="center"
            v-if="allTxt.changeNumber"
            prop="changeNumber"
            :label="$t('MN_F_T_833')"
            width="180"
          ></el-table-column>
          <el-table-column
            align="center"
            v-if="allTxt.directPushNumber"
            prop="directPushNumber"
            :label="$t('MN_F_T_834')"
            width="180"
          ></el-table-column>
          <el-table-column
            align="center"
            prop="categoryVal"
            :label="$t('MN_F_Y_5')"
            width="180"
          ></el-table-column>
          <el-table-column
            align="center"
            prop="isActivateVal"
            :label="$t('是否激活')"
          ></el-table-column>
          <el-table-column
            align="center"
            prop="time"
            :label="$t('MY_ORD_14')"
            width="130"
            fixed="right"
          >
            <template slot-scope="scope">
              <div style="white-space: nowrap">
                <el-button
                  :disabled="scope.row.category != 0"
                  type="text"
                  size="small"
                  style="padding: 8px 0px"
                  v-has-buttons="['memberLogin']"
                  @click="toLogin(scope.row)"
                >
                  {{ $t("w_0044") }}
                </el-button>
                <el-button
                  type="text"
                  size="small"
                  style="padding: 8px 0px"
                  v-has-buttons="['tmpMemberLogin']"
                  @click="toLogin1(scope.row)"
                >
                  {{ $t("临时登录") }}
                </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="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"></i>
        <div class="el-upload__text">
          {{ $t("MN_F_T_229") }}
          <em>{{ $t("MN_F_T_230") }}</em>
        </div>
        <div class="el-upload__tip" style="color: red" slot="tip">
          {{ $t("MN_F_T_231") }}
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">{{
          $t("ENU_P_TYPE4")
        }}</el-button>
        <el-button @click="upload.open = false">{{
          $t("ENU_P_TYPE0")
        }}</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import topBar from "@/components/topBar";
import {
  getMemberList,
  getvertexValue,
  getmemberTeamList,
  getaccountStatus,
  getsalletStatus,
  getattestation,
  getYesnouploadsList,
  getorderStatus,
  getDealerYesno,
  passwordFree,
  passwordFreeLen,
  incomeStatusList,
  serviceStatus,
  getExpirestatus,
  copyPwd,
} from "@/api/member";
import {
  getgradeRanglist,
  getAwardsListChiose,
  getRegistration,
} from "@/api/level";
import { teamList } from "@/api/business";
import { getRoleMenu } from "@/api/notice";
import { getToken } from "@/utils/auth";
import { areaList } from "@/api/site";
import { isLocals, isLocalSymbol } from "@/utils/numberToCurrency";
export default {
  name: "Jcyw",
  components: {
    topBar,
  },
  data() {
    return {
      loading: false,
      allTxt: {},
      ActivateList: [
        {
          value: 0,
          label: "是",
        },
        {
          value: 1,
          label: "否",
        },
      ],
      regionParams: {
        label: "name",
        value: "id",
        children: "children",
        expandTrigger: "hover",
      },
      menuList: [
        {
          id: 0,
          text: this.$t("MN_F_T_948"),
          checked: false,
        },
        {
          id: 1,
          text: this.$t("N_I_164"),
          checked: true,
          prop: "parMemberCode",
        },
        {
          id: 2,
          text: this.$t("N_I_165"),
          checked: true,
          prop: "parMemberName",
        },
        {
          id: 3,
          text: this.$t("PER_DA_5"),
          checked: true,
          prop: "pkRegisterGradeVal",
        },
        {
          id: 4,
          text: this.$t("CK_KS_15"),
          checked: true,
          prop: "pkSettleGradeVal",
        },
        {
          id: 5,
          text: this.$t("N_I_169"),
          checked: true,
          prop: "consumeMoney",
        },
        {
          id: 6,
          text: this.$t("PER_DA_10"),
          checked: true,
          prop: "consumeAchieve",
        },
        {
          id: 7,
          text: this.$t("MN_F_T_829"),
          checked: true,
          prop: "vertexName",
        },
        {
          id: 11,
          text: "隶属团队",
          checked: true,
          prop: "teamName",
        },
        {
          id: 8,
          text: this.$t("MY_WAL_32"),
          checked: true,
          prop: "isRealNameVal",
        },
        {
          id: 9,
          text: this.$t("MN_F_T_831"),
          checked: true,
          prop: "accountStatusVal",
        },
        {
          id: 10,
          text: this.$t("MN_F_T_832"),
          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: this.$t("MN_F_T_8"),
          path: "jcyw",
        },
        // {
        //   name: this.$t('MN_F_T_12'),
        //   path: "ddyw",
        // },
        // {
        //   name: "审核业务",
        //   path: "shyw",
        // },
        // {
        //   name: "在线签呈",
        //   path: "zxqc",
        // },
      ],
      colums: [],
      checkLabels: [],
      checkList: [],
      multipleSelection: [],
      incomeStatusListd: [],
      address: "",
      queryParams: {
        pageNum: 1,
        pageSize: 50,
        memberCode: "", //会员编号
        memberName: "", //会员姓名
        phone: "", //联系方式
        changeNumber: "", //变更次数
        pkRegisterGrade: "", //注册等级
        pkSettleGrade: "", //结算等级
        pkAwards: "", //真实奖衔
        vertexId: "", //隶属体系
        teamId: "", //隶属团队
        isDealer: "", //是否经销商
        registerAuthority: "", //注册权限
        accountStatus: "", //账户状态
        memberAccount: "", //钱包状态
        isRealName: "", //实名认证
        isBusLicense: "", //营业执照
        orderSource: "", //订单状态
        isMakerSpace: "", //创客空间
        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: [], //服务协议
      yesnouploadsList: [], //营业执照 是否上传
      orderStatusList: [], //订单状态
      dealerList: [], //是否是经销商
      directPushNumber: "", //修改直推次数
      expireList: [],
    };
  },
  computed: {
    canDo() {
      return this.checkList.length > 0;
    },
  },
  created() {
    //查询会员信息
    this.getMemberList();
    this.getgradeRanglist();

    this.getAwardsListChiose();
    this.getvertexValue();
    this.getmemberTeamList();
    this.getRegistration();
    this.getaccountStatus();
    this.getsalletStatus();
    this.getattestation();
    this.getYesnouploadsList();
    this.getorderStatus();
    this.getDealerYesno();
    this.incomeStatusList();
    this.serviceStatus();
    this.getAllArea();
    //初始化表头
    // 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: {
    getAllArea() {
      areaList().then((res) => {
        this.areaData = res.data;
      });
    },
    flChange(value) {
      this.queryParams.county = "";
      this.queryParams.province = "";
      this.queryParams.city = "";

      this.queryParams.province = value[0];
      this.queryParams.city = value[1];
      this.queryParams.county = value[2];
    },
    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) => {
        let obj = {};
        res.data.forEach((item) => {
          obj[item] = 1;
        });
        this.allTxt = obj;
        this.$nextTick(() => {
          this.$refs.table.doLayout();
        });
      });
    },
    //导出
    handleExport() {
      this.$confirm(this.$t("MN_F_T_407"), this.$t("MN_F_T_304"), {
        confirmButtonText: this.$t("w_0035"),
        cancelButtonText: this.$t("ENU_P_TYPE0"),
        type: "warning",
      }).then((_) => {
        this.download(
          "/member/manager/member/export",
          { ...this.queryParams },
          `${this.$t("MN_F_T_8")}}${new Date().getTime()}.xlsx`
        );
      });
    },
    isLocalSymbol,
    isLocals,
    toLogin(row) {
      if (row.systemType == 0) {
        passwordFree({
          memberCode: row.memberCode,
        }).then((res) => {
          if (res.code == 200) {
            let href =
              process.env.VUE_APP_ADDRESS1 +
              "freeLogin?token=" +
              res.data.access_token;
            window.open(href, "_blank");
          }
        });
      } else if (row.systemType == 1) {
        passwordFreeLen({
          memberCode: row.memberCode,
        }).then((res) => {
          if (res.code == 200) {
            let href =
              process.env.VUE_APP_ADDRESS +
              "freeLogin?token=" +
              res.data.access_token;
            window.open(href, "_blank");
          }
        });
      }
    },
    toLogin1(row) {
      copyPwd({
        pkId: row.pkId,
      }).then((res) => {
        if (res.code === 200) {
          const msg = res.data;
          this.$confirm(this.$t("MN_F_T_303"), this.$t("提示"), {
            confirmButtonText: this.$t("w_0035"),
            cancelButtonText: this.$t("ENU_P_TYPE0"),
            message: msg,
            dangerouslyUseHTMLString: true,
            type: "info",
          }).then(() => {});
        }
      });
    },
    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);
        });
      }
    },
    //经销商
    getDealerYesno() {
      getDealerYesno().then((res) => {
        this.dealerList = res.data;
      });
    },
    //查询会员信息
    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() {
      teamList().then((res) => {
        this.memberteamList = res.data;
      });
    },
    //隶属体系下拉选 取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.address = "";
      this.getMemberList();
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    /** 导入按钮操作 */
    handleImport() {
      this.upload.title = "批量查询";
      this.upload.open = true;
    },
    //下载模板
    importTemplate() {
      this.download(
        "/member/manager/member/download",
        {},
        `${this.$t("MN_F_T_8")}${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 },
          `${this.$t("MN_F_T_8")}}${new Date().getTime()}.xlsx`
        );
      }
      this.upload.open = false;
      this.upload.isUploading = false;
      this.$refs.upload.clearFiles();
      let str = "";
      //  let data = response.msg.split(',')
      //  data.forEach((item) => {
      //        item = item + ";";
      //        str += `<div>${item}</div>`;
      //    });
      this.$alert("", this.$t("MN_F_T_223"), {
        dangerouslyUseHTMLString: true,
      });
      // this.getList();
    },
    // 上传文件数量超出后的动作
    handleExceed() {
      this.upload.isUploading = false;
      this.msgInfo(this.$t("MN_F_T_234"));
    },
    // 提交上传文件
    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>
