<!--
 * @Descripttion:
 * @version:
 * @Author: kBank
 * @Date: 2022-10-24 15:45:01
-->
<template>
  <div class="page">
    <div class="topbox">
      <topBar v-if="topList.length > 0" :top-list="topList" :moren="moren" />
    </div>
    <div class="main">
      <!--      <div class="table_a">-->
      <!--        <div class="change_l">角色</div>-->
      <!--        &lt;!&ndash;        {{roleAllList}}&ndash;&gt;-->
      <!--        <div class="table_b">-->
      <!--          <div class="change_i">-->
      <!--            <el-checkbox-->
      <!--              v-for="(item, index) in roleAllList"-->
      <!--              :key="item.roleId"-->
      <!--              v-model="item.changed"-->
      <!--              :disabled="disabled"-->
      <!--              :value="item.roleId"-->
      <!--              :label="item.roleName"-->
      <!--              @change="checkClickC($event,index)"-->
      <!--            />-->
      <!--          </div>-->
      <!--        </div>-->
      <!--      </div>-->
      <!--      <div class="table_a">-->
      <!--        <div class="change_l">管理名称</div>-->
      <!--        <div class="table_b">-->
      <!--          <div class="change_i">-->
      <!--            <el-checkbox-->
      <!--              v-for="(item, index) in userList"-->
      <!--              :key="item.value"-->
      <!--              v-model="item.changed"-->
      <!--              :disabled="disabled"-->
      <!--              :value="item.userId"-->
      <!--              :label="item.nickName"-->
      <!--              @change="checkClickD($event,index)"-->
      <!--            >-->
      <!--            </el-checkbox>-->
      <!--          </div>-->
      <!--        </div>-->
      <!--      </div>-->

      <div class="table_a fx_s">
        <!--        <div class="change_l" style="width: 400px;height: 100%">菜单</div>-->
        <div class="table_b">
          <div
            class="change_i"
            style="
              display: block;
              padding: 0;
              border-bottom: none;
              width: 1520px;
              overflow-x: auto;
            "
          >
            <div
              v-for="(item, index) in menuAllList"
              class="flex-s"
              style="display: block"
            >
              <div
                class="table_cc"
                :style="
                  !item.children
                    ? 'height:50px;border-bottom:1px solid #ccc'
                    : ''
                "
              >
                <div class="flex-1">
                  <el-checkbox
                    :key="item.value"
                    v-model="item.changed"
                    :disabled="disabled"
                    :value="item.userId"
                    :label="item.menuName"
                    @change="checkClickA($event, index)"
                  />
                </div>
                <div>
                  <div v-for="(items, indexs) in item.children">
                    <div style="display: flex">
                      <div class="class3">
                        <el-checkbox
                          :key="items.columnList"
                          v-model="items.changed"
                          class="checks"
                          :disabled="disabled"
                          :value="items.userId"
                          :label="items.menuName"
                          @change="checkClickB($event, index, indexs)"
                        />
                      </div>
                      <div class="class2">
                        <div
                          v-for="(item_s, index_s) in items.children"
                          class="width-s"
                        >
                          <div class="width100">
                            <el-checkbox
                              :key="item_s.value"
                              v-model="item_s.changed"
                              class="bd-s"
                              :disabled="disabled"
                              :value="item_s.userId"
                              :label="item_s.menuName"
                              @change="
                                checkClickF($event, index, indexs, index_s)
                              "
                            />
                          </div>
                          <!--                          <div v-if="item_s.children" class="class1">-->
                          <!--                            <div v-for="(item1,indexs1) in item_s.children" class="borders">-->
                          <!--                              <el-checkbox-->
                          <!--                                :key="item1.value"-->
                          <!--                                v-model="item1.changed"-->
                          <!--                                class="box-s flex1"-->
                          <!--                                :disabled="disabled"-->
                          <!--                                :value="item1.userId"-->
                          <!--                                :label="item1.menuName"-->
                          <!--                                @change="checkClickG($event,index,indexs,index_s,indexs1)"-->
                          <!--                              />-->
                          <!--                            </div>-->
                          <!--                          </div>-->
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <!--            <div class="change_i" style="border-left: 1px solid #ccc;align-items: inherit">-->
            <!--              <el-checkbox-->
            <!--                v-for="(items,indexs) in item.children"-->
            <!--                :key="items.value"-->
            <!--                v-model="items.changed"-->
            <!--                :disabled="disabled"-->
            <!--                :value="items.userId"-->
            <!--                :label="items.menuName"-->
            <!--                @change="checkClickB($event,index,indexs)"-->
            <!--              />-->
            <!--            </div>-->
          </div>
        </div>
      </div>
      <!--      <div-->
      <!--        v-for="(item,index) in typeList"-->
      <!--        :key="index"-->
      <!--        class="table_a"-->
      <!--      >-->
      <!--        <div class="change_l">{{ item.label }}</div>-->
      <!--        <div class="table_b">-->
      <!--          <div-->
      <!--            v-for="(ctem,cndex) in item.enumList"-->
      <!--            :key="cndex"-->
      <!--            class="table_c"-->
      <!--          >-->
      <!--            <div class="change_i table_cc">-->
      <!--              <el-checkbox-->
      <!--                v-model="ctem.changed"-->
      <!--                @change="checkClickA($event,index,cndex)"-->
      <!--              >{{ ctem.label }}</el-checkbox>-->
      <!--            </div>-->
      <!--            <div-->
      <!--              v-for="(stem,sndex) in ctem.enumList"-->
      <!--              :key="sndex"-->
      <!--            >-->
      <!--              <div class="change_i">-->
      <!--                <el-checkbox-->
      <!--                  v-model="stem.changed"-->
      <!--                  @change="checkClickB($event,index,cndex,sndex)"-->
      <!--                >{{ stem.label }}</el-checkbox>-->
      <!--              </div>-->
      <!--            </div>-->
      <!--          </div>-->
      <!--        </div>-->
      <!--      </div>-->
    </div>
    <div class="footer">
      <el-button
        size="small"
        class="myBtn"
        @click="$router.push('/system/role')"
      >
        {{ '取消' }}</el-button>
      <el-button
        style="margin-left: 40px"
        size="small"
        class="myBtn1"
        :disabled="disabled"
        @click="submit"
      >
        {{ '确认' }}</el-button>
    </div>
  </div>
</template>

<script>
import topBar from '@/components/topBar'
import * as api from '@/api/notice.js'
import { getRoleMenu, menuAllListAll, saveRoleMenu } from '@/api/notice.js'
import { isLocals, isLocalSymbol } from '@/utils/numberToCurrency'
export default {
  name: 'Bzpz',
  components: {
    topBar
  },
  data() {
    return {
      userIds: '',
      tabActive: 0,
      disabled: false,
      roleAllList: [],
      roleAllList1: [],
      arr: [],
      userList: [],
      roleList: [],
      menuAllList: [],
      typeList: [],
      gradeList: [],
      rangList: [],
      awardList: [],
      menuList: [],
      query: {
        userList: [],
        roleAllList: [],
        menuAllList: []
      },
      moren: 'fieldRole',
      topList: [
        {
          name: '后台字段权限',
          path: 'fieldRole'
        }
      ]
    }
  },
  mounted() {
    // 获取列表
    this.getDataList()
    getRoleMenu('Member').then((res) => {
      console.error(res)
    })
  },
  methods: {
    handleLink(item) {
      this.tabActive = item.id
    },
    submit() {
      const obj = {
        // userIdList: [], // 管理员列表
        detailList: [], // 菜单列表
        roleIdList: [] // 角色列表
      }
      const objs = []
      // 角色
      // this.roleAllList.forEach((item) => {
      //   if (item.changed) {
      //     objs.push(item.roleId)
      //   }
      // })
      // // 管理员
      // this.userList.forEach((item) => {
      //   if (item.changed) {
      //     obj.userIdList.push(item.userId)
      //   }
      // })
      const geturl = window.location.href
      const getqyinfo = geturl.split('?')[1]
      const getqys = new URLSearchParams('?' + getqyinfo)
      const getId = getqys.get('id')
      obj.roleIdList = [getId]
      // 菜单
      this.menuAllList.forEach((item, index) => {
        item.children.forEach((ctem, index1) => {
          obj.detailList.push({
            menuId: ctem.menuId,
            menuColumnList: []
          })
          ctem.children.forEach((ctems, index2) => {
            obj.detailList.forEach((ctems1, index3) => {
              if (ctems1.menuId == ctem.menuId) {
                obj.detailList[index3].menuColumnList.push({
                  menuColumn: ctems.routeName,
                  showFlag: ctems.changed == true ? 0 : 1
                })
              }
            })
          })
        })
      })
      if (obj.detailList.length == 0) {
        this.$message({
          message: '请选择菜单'
        })
        return
      }
      api.saveRoleMenu(obj).then((res) => {
        this.$message({
          message: res.msg,
          type: 'success'
        })
        this.$router.push({
          name: 'role'
        })
      })
    },
    async getDataList() {
      // // 获取管理员全部
      // await api.getUserAdmin().then((res) => {
      //   res.data.forEach((item) => {
      //     item.changed = false
      //   })
      //   this.userList = res.data
      // })
      // // 获取全部角色
      // await api.roleAllList().then((res) => {
      //   res.data.forEach((item) => {
      //     item.changed = false
      //   })
      //   this.roleAllList = res.data
      //   this.roleAllList1 = res.data
      // })
      const getId1 = this.$route.query.id
      console.error(getId1)
      // 获取全部菜单
      await api.menuAllListAll(getId1).then((res) => {
        this.menuAllList = res.data
        // 初始化菜单栏选项
        this.menuAllList.forEach((item) => {
          if (item.children) {
            item.children.forEach((items) => {
              if (items.perms == 'Member') {
                items.children = [
                  {
                    menuName: '会员编号',
                    routeName: 'memberCode',
                    changed: false
                  },
                  {
                    menuName: '会员姓名',
                    routeName: 'memberName',
                    changed: false
                  },
                  {
                    menuName: '会员昵称',
                    routeName: 'nickName',
                    changed: false
                  },
                  {
                    menuName: '联系方式',
                    routeName: 'phone',
                    changed: false
                  },
                  {
                    menuName: '推荐编号',
                    routeName: 'parMemberCode',
                    changed: false
                  },
                  {
                    menuName: '推荐姓名',
                    routeName: 'parMemberName',
                    changed: false
                  },
                  {
                    menuName: '安置编号',
                    routeName: 'placeMemberCode',
                    changed: false
                  },
                  {
                    menuName: '安置姓名',
                    routeName: 'placeMemberName',
                    changed: false
                  },
                  {
                    menuName: '荣誉奖衔',
                    routeName: 'pkAwardsVal',
                    changed: false
                  },
                  {
                    menuName: '收益状态',
                    routeName: 'incomeStatusVal',
                    changed: false
                  },
                  {
                    menuName: '到期日期',
                    routeName: 'expireDate',
                    changed: false
                  },
                  {
                    menuName: '服务协议',
                    routeName: 'serviceAgreementVal',
                    changed: false
                  },
                  {
                    menuName: '代理等级',
                    routeName: 'agentGradeVal',
                    changed: false
                  },
                  // {
                  //   menuName: '历史荣誉',
                  //   routeName: 'histroyAwardsName',
                  //   changed: false
                  // },
                  {
                    menuName: '订单类型',
                    routeName: 'orderSourceVal',
                    changed: false
                  },
                  {
                    menuName: '服务中心编号',
                    routeName: 'centerMemberCode',
                    changed: false
                  },
                  {
                    menuName: '服务中心姓名',
                    routeName: 'centerMemberName',
                    changed: false
                  },
                  {
                    menuName: '注册等级',
                    routeName: 'pkRegisterGradeVal',
                    changed: false
                  },
                  {
                    menuName: '结算等级',
                    routeName: 'pkSettleGradeVal',
                    changed: false
                  },
                  {
                    menuName: '注册金额',
                    routeName: 'consumeMoney',
                    changed: false
                  },
                  {
                    menuName: '注册业绩' + `(${isLocals()})`,
                    routeName: 'consumeAchieve',
                    changed: false
                  },
                  {
                    menuName: '隶属体系',
                    routeName: 'vertexName',
                    changed: false
                  },
                  {
                    menuName: '隶属团队',
                    routeName: 'teamName',
                    changed: false
                  },
                  {
                    menuName: '注册权限',
                    routeName: 'registerAuthorityVal',
                    changed: false
                  },
                  {
                    menuName: '实名认证',
                    routeName: 'isRealNameVal',
                    changed: false
                  },

                  {
                    menuName: '账户状态',
                    routeName: 'accountStatusVal',
                    changed: false
                  },
                  {
                    menuName: '钱包状态',
                    routeName: 'memberAccountVal',
                    changed: false
                  },
                  {
                    menuName: '创建日期',
                    routeName: 'creationTime',
                    changed: false
                  },
                  {
                    menuName: '支付日期',
                    routeName: 'payTime',
                    changed: false
                  },
                  {
                    menuName: '变更次数',
                    routeName: 'changeNumber',
                    changed: false
                  },
                  {
                    menuName: '修改直推次数',
                    routeName: 'directPushNumber',
                    changed: false
                  },
                  {
                    menuName: '休止日期',
                    routeName: 'stopDate',
                    changed: false
                  },
                  {
                    menuName: '会员状态',
                    routeName: 'expireStatusVal',
                    changed: false
                  }
                  // {
                  //   menuName: '体验中心',
                  //   routeName: 'storeTypeVal',
                  //   changed: false
                  // }
                ]
              }
              if (items.perms === 'TeamInfo') {
                items.children = [
                  {
                    menuName: '会员编号',
                    routeName: 'memberCode',
                    changed: false
                  },
                  {
                    menuName: '会员姓名',
                    routeName: 'memberName',
                    changed: false
                  },
                  {
                    menuName: '荣誉奖衔',
                    routeName: 'pkAwardsStr',
                    changed: false
                  },
                  {
                    menuName: '安置层数',
                    routeName: 'resettleLevel',
                    changed: false
                  },
                  {
                    menuName: '安置位置',
                    routeName: 'placeDeptStr',
                    changed: false
                  },
                  {
                    menuName: '安置编号',
                    routeName: 'placeParentCode',
                    changed: false
                  },
                  {
                    menuName: '血缘代数',
                    routeName: 'consanguinityAlgebra',
                    changed: false
                  },
                  {
                    menuName: '左区首购业绩' + `(${isLocals()})`,
                    routeName: 'afirstPv',
                    changed: false
                  },
                  {
                    menuName: '右区首购业绩' + `(${isLocals()})`,
                    routeName: 'bfirstPv',
                    changed: false
                  },
                  {
                    menuName: '血缘首购业绩' + `(${isLocals()})`,
                    routeName: 'consanguinityFirstPv',
                    changed: false
                  },
                  {
                    menuName: '左区复购业绩' + `(${isLocals()})`,
                    routeName: 'repASumPv',
                    changed: false
                  },
                  {
                    menuName: '右区复购业绩' + `(${isLocals()})`,
                    routeName: 'repBSumPv',
                    changed: false
                  },
                  {
                    menuName: '血缘复购业绩' + `(${isLocals()})`,
                    routeName: 'consanguinityRepBSumPv',
                    changed: false
                  },
                  {
                    menuName: '左区真实业绩' + `(${isLocals()})`,
                    routeName: 'aSumRealPv',
                    changed: false
                  },
                  {
                    menuName: '右区真实业绩' + `(${isLocals()})`,
                    routeName: 'bSumRealPv',
                    changed: false
                  },
                  {
                    menuName: '血缘真实业绩' + `(${isLocals()})`,
                    routeName: 'consanguinityRealPv',
                    changed: false
                  },
                  // { menuName: '奖金收益($)', routeName: '', changed: false },
                  {
                    menuName: '奖金团队占比(%)',
                    routeName: 'bonusTeamProportion',
                    changed: false
                  },
                  {
                    menuName: '奖金大盘占比' + '(%)',
                    routeName: 'bonusLargeMarketProportion',
                    changed: false
                  },
                  {
                    menuName: '直推人数',
                    routeName: 'directPushPeopleNumber',
                    changed: false
                  },
                  {
                    menuName: '直推业绩',
                    routeName: 'directPushPeoplePv',
                    changed: false
                  },
                  {
                    menuName: '复购金额' + `(${isLocals()})`,
                    routeName: 'repurchaseAmount',
                    changed: false
                  },
                  {
                    menuName: '复购业绩' + `(${isLocals()})`,
                    routeName: 'repurchasePv',
                    changed: false
                  },
                  {
                    menuName: '复购积分',
                    routeName: 'repurchaseIntegral',
                    changed: false
                  },
                  {
                    menuName: '福利金额' + `(${isLocals()})`,
                    routeName: 'benefitAmount',
                    changed: false
                  },
                  {
                    menuName: '福利业绩' + `(${isLocals()})`,
                    routeName: 'benefitPv',
                    changed: false
                  },
                  {
                    menuName: '福利积分',
                    routeName: 'welfarePoints',
                    changed: false
                  },
                  {
                    menuName: '转账次数',
                    routeName: 'memberTransferCount',
                    changed: false
                  },
                  {
                    menuName: '转账金额' + `(${isLocals()})`,
                    routeName: 'transferAmount',
                    changed: false
                  },
                  {
                    menuName: '充值金额' + `(${isLocals()})`,
                    routeName: 'rechargeAmount',
                    changed: false
                  },
                  {
                    menuName: '提现次数',
                    routeName: 'withdrawalNumber',
                    changed: false
                  },
                  {
                    menuName: '提现金额' + `(${isLocals()})`,
                    routeName: 'withdrawalAmount',
                    changed: false
                  },
                  {
                    menuName: '最近登录',
                    routeName: 'lastLoginTime',
                    changed: false
                  },
                  {
                    menuName: '创建日期',
                    routeName: 'creationTime',
                    changed: false
                  },
                  {
                    menuName: '支付日期',
                    routeName: 'payTime',
                    changed: false
                  },
                  {
                    menuName: '修改直推次数',
                    routeName: 'directPushNumber',
                    changed: false
                  }
                ]
              }
              if (items.perms == 'RealInfo') {
                items.children = [
                  {
                    menuName: '会员编号',
                    routeName: 'memberCode',
                    changed: false
                  },
                  {
                    menuName: '会员姓名',
                    routeName: 'memberName',
                    changed: false
                  },
                  {
                    menuName: '联系方式',
                    routeName: 'phone',
                    changed: false
                  },
                  {
                    menuName: '注册等级',
                    routeName: 'registerGradeVal',
                    changed: false
                  },
                  {
                    menuName: '结算等级',
                    routeName: 'settleGradeVal',
                    changed: false
                  },
                  {
                    menuName: '荣誉奖衔',
                    routeName: 'awardsVal',
                    changed: false
                  },
                  // {
                  //   menuName: '荣誉奖衔',
                  //   routeName: 'pkMaxAwardsVal',
                  //   changed: false
                  // },
                  {
                    menuName: '性别',
                    routeName: 'sexVal',
                    changed: false
                  },
                  {
                    menuName: '出生日期',
                    routeName: 'birthDate',
                    changed: false
                  },
                  {
                    menuName: '证件类型',
                    routeName: 'cardTypeVal',
                    changed: false
                  },
                  {
                    menuName: '证件号码',
                    routeName: 'idCard',
                    changed: false
                  },
                  {
                    menuName: '证件(正面)',
                    routeName: 'idFront',
                    changed: false
                  },
                  {
                    menuName: '证件(反面)',
                    routeName: 'idBack',
                    changed: false
                  },
                  {
                    menuName: '认证时间',
                    routeName: 'certificationTime',
                    changed: false
                  },
                  {
                    menuName: '创建日期',
                    routeName: 'creationTime',
                    changed: false
                  },
                  {
                    menuName: '支付日期',
                    routeName: 'payTime',
                    changed: false
                  },
                  {
                    menuName: '修改直推次数',
                    routeName: 'directPushNumber',
                    changed: false
                  },
                  {
                    menuName: '省',
                    routeName: 'provinceName',
                    changed: false
                  },
                  {
                    menuName: '市',
                    routeName: 'cityName',
                    changed: false
                  },
                  {
                    menuName: '区/县',
                    routeName: 'countyName',
                    changed: false
                  },
                  {
                    menuName: '详细地址',
                    routeName: 'address',
                    changed: false
                  },
                  {
                    menuName: '银行名称',
                    routeName: 'bankName',
                    changed: false
                  },
                  {
                    menuName: '支行名称',
                    routeName: 'subBankName',
                    changed: false
                  },
                  {
                    menuName: '开户姓名',
                    routeName: 'accountName',
                    changed: false
                  },
                  {
                    menuName: '预留电话',
                    routeName: 'reservedPhone',
                    changed: false
                  },
                  {
                    menuName: '银行卡号',
                    routeName: 'cardNumber',
                    changed: false
                  },
                  {
                    menuName: '邮箱地址',
                    routeName: 'email',
                    changed: false
                  }
                ]
              }
              if (items.perms == 'MemberTarget') {
                items.children = [
                  {
                    menuName: '会员信息',
                    routeName: 'memberCode',
                    changed: false
                  },
                  {
                    menuName: '会员姓名',
                    routeName: 'memberName',
                    changed: false
                  },
                  {
                    menuName: '联系方式',
                    routeName: 'phone',
                    changed: false
                  },
                  {
                    menuName: '荣誉奖衔',
                    routeName: 'pkAwardsVal',
                    changed: false
                  },
                  {
                    menuName: '隶属体系',
                    routeName: 'vertexName',
                    changed: false
                  },
                  {
                    menuName: '隶属团队',
                    routeName: 'teamName',
                    changed: false
                  },
                  {
                    menuName: '考核周期',
                    routeName: 'goalTypeVal',
                    changed: false
                  },
                  {
                    menuName: '业务类型',
                    routeName: 'goalClassifyVal',
                    changed: false
                  },
                  {
                    menuName: '总业绩目标',
                    routeName: 'totalAchieve',
                    changed: false
                  },
                  {
                    menuName: '达成比率' + '(%)',
                    routeName: 'totalRatio',
                    changed: false
                  },
                  {
                    menuName: '考核日期',
                    routeName: 'month',
                    changed: false
                  }
                ]
              }
              if (items.perms == 'Business') {
                items.children = [
                  {
                    menuName: '变更会员姓名',
                    routeName: 'change_name',
                    changed: false
                  },
                  {
                    menuName: '变更联系方式',
                    routeName: 'change_phone',
                    changed: false
                  },
                  {
                    menuName: '重置会员密码',
                    routeName: 'reset_login_password',
                    changed: false
                  },
                  {
                    menuName: '修改注册等级',
                    routeName: 'change_register_grade',
                    changed: false
                  },
                  {
                    menuName: '修改荣誉奖衔',
                    routeName: 'change_awards',
                    changed: false
                  },
                  // {
                  //   menuName: '修改新制度历史最高奖衔',
                  //   routeName: 'change_max_awards',
                  //   changed: false
                  // },
                  {
                    menuName: '重置银行信息',
                    routeName: 'reset_bank',
                    changed: false
                  },
                  {
                    menuName: '修改结算等级',
                    routeName: 'change_settlement_grade',
                    changed: false
                  },
                  // {
                  //   menuName: '修改自然国家',
                  //   routeName: 'change_natural_country',
                  //   changed: false
                  // },
                  {
                    menuName: '修改登录状态',
                    routeName: 'sign_in_state',
                    changed: false
                  },
                  {
                    menuName: '修改收益状态',
                    routeName: 'profit_state',
                    changed: false
                  },
                  // {
                  //   menuName: '植树',
                  //   routeName: 'wallet_state',
                  //   changed: false
                  // },
                  // {
                  //   menuName: '种植订单',
                  //   routeName: 'free_assessment_state',
                  //   changed: false
                  // },
                  {
                    menuName: '修改注册权限',
                    routeName: 'register_power_state',
                    changed: false
                  },

                  // {
                  //   menuName: '经销商认证',
                  //   routeName: 'dealer_attest',
                  //   changed: false
                  // },
                  // {
                  //   menuName: '修改讲师认证',
                  //   routeName: 'update_lecturer_level',
                  //   changed: false
                  // },
                  {
                    menuName: '修改全球认证',
                    routeName: 'update_system_level',
                    changed: false
                  },
                  {
                    menuName: '实名认证',
                    routeName: 'real_name_authentication',
                    changed: false
                  }
                ]
              }
              // 结算中心-业绩汇总
              // `(${isLocalSymbol()})`
              if (items.perms == 'performanceTotal') {
                items.children = [
                  {
                    menuName: '结算时间',
                    routeName: 'settleDate',
                    changed: false
                  },
                  {
                    menuName: '注册金额' + `(￥)`,
                    routeName: 'registerAmount',
                    changed: false
                  },
                  {
                    menuName: '注册金额' + `($)`,
                    routeName: 'registerAmountDollar',
                    changed: false
                  },
                  {
                    menuName: '注册金额' + `(${isLocalSymbol()})`,
                    routeName: 'registerAmountLocality',
                    changed: false
                  },
                  {
                    menuName: '注册业绩' + `(￥)`,
                    routeName: 'registerPv',
                    changed: false
                  },
                  {
                    menuName: '注册业绩' + `($)`,
                    routeName: 'registerPvDollar',
                    changed: false
                  },
                  {
                    menuName: '注册业绩' + `(${isLocalSymbol()})`,
                    routeName: 'registerPvLocality',
                    changed: false
                  },
                  {
                    menuName: '升级金额' + '(¥)',
                    routeName: 'upgradeAmount',
                    changed: false
                  },

                  {
                    menuName: '升级金额' + `(${isLocalSymbol()})`,
                    routeName: 'upgradeAmountLocality',
                    changed: false
                  },
                  {
                    menuName: '升级业绩' + '(¥)',
                    routeName: 'upgradePv',
                    changed: false
                  },
                  {
                    menuName: '升级业绩' + `(${isLocalSymbol()})`,
                    routeName: 'upgradePvLocality',
                    changed: false
                  },
                  {
                    menuName: '首购金额' + '(¥)',
                    routeName: 'firstPurchaseAmount',
                    changed: false
                  },
                  {
                    menuName: '首购金额' + `(${isLocalSymbol()})`,
                    routeName: 'firstPurchaseAmountLocality',
                    changed: false
                  },
                  {
                    menuName: '首购业绩' + '(¥)',
                    routeName: 'firstPurchasePv',
                    changed: false
                  },
                  {
                    menuName: '首购业绩' + '($)',
                    routeName: 'firstPurchasePvDollar',
                    changed: false
                  },
                  {
                    menuName: '首购业绩' + `(${isLocalSymbol()})`,
                    routeName: 'firstPurchasePvLocality',
                    changed: false
                  },
                  {
                    menuName:
                      '三方' +
                      '金额' +
                      '(￥)',
                    routeName: 'tripartiteAmount',
                    changed: false
                  },
                  {
                    menuName:
                      '三方' +
                      '金额' +
                      '($)',
                    routeName: 'tripartiteAmountDollar',
                    changed: false
                  },
                  {
                    menuName:
                      '三方' +
                      '金额' +
                      `(${isLocalSymbol()})`,
                    routeName: 'tripartiteAmountLocality',
                    changed: false
                  },
                  {
                    menuName:
                      '三方' +
                      '业绩' +
                      '(￥)',
                    routeName: 'tripartitePv',
                    changed: false
                  },
                  {
                    menuName:
                      '三方' +
                      '业绩' +
                      '($)',
                    routeName: 'tripartitePvDollar',
                    changed: false
                  },
                  {
                    menuName:
                      '三方' +
                      '业绩' +
                      `(${isLocalSymbol()})`,
                    routeName: 'tripartitePvLocality',
                    changed: false
                  },

                  {
                    menuName: '海粉金额' + '(￥)',
                    routeName: 'fansAmount',
                    changed: false
                  },
                  {
                    menuName: '海粉金额' + '($)',
                    routeName: 'fansAmountDollar',
                    changed: false
                  },
                  {
                    menuName: '海粉金额' + `(${isLocalSymbol()})`,
                    routeName: 'fansAmountLocality',
                    changed: false
                  },
                  {
                    menuName: '海粉业绩' + '(￥)',
                    routeName: 'hiFunPv',
                    changed: false
                  },
                  {
                    menuName: '海粉业绩' + '($)',
                    routeName: 'hiFunPvDollar',
                    changed: false
                  },
                  {
                    menuName: '海粉业绩' + `(${isLocalSymbol()})`,
                    routeName: 'hiFunPvLocality',
                    changed: false
                  },
                  {
                    menuName: '复购金额' + '(¥)',
                    routeName: 'repurchaseAmount',
                    changed: false
                  },
                  {
                    menuName: '复购金额' + '($)',
                    routeName: 'repurchaseAmountDollar',
                    changed: false
                  },
                  {
                    menuName: '复购金额' + `(${isLocalSymbol()})`,
                    routeName: 'repurchaseAmountLocality',
                    changed: false
                  },
                  {
                    menuName: '复购业绩' + '(¥)',
                    routeName: 'repurchasePv',
                    changed: false
                  },
                  {
                    menuName: '复购业绩' + '($)',
                    routeName: 'repurchasePvDollar',
                    changed: false
                  },
                  {
                    menuName: '复购业绩' + `(${isLocalSymbol()})`,
                    routeName: 'repurchasePvLocality',
                    changed: false
                  },
                  {
                    menuName: '金额总计' + '(¥)',
                    routeName: 'amountTotal',
                    changed: false
                  },
                  {
                    menuName: '金额总计' + '($)',
                    routeName: 'amountTotalDollar',
                    changed: false
                  },
                  {
                    menuName: '金额总计' + `(${isLocalSymbol()})`,
                    routeName: 'amountTotalLocality',
                    changed: false
                  },
                  {
                    menuName: '业绩汇总' + '(¥)',
                    routeName: 'pvTotal',
                    changed: false
                  },
                  {
                    menuName: '业绩汇总' + '($)',
                    routeName: 'pvTotalDollar',
                    changed: false
                  },
                  {
                    menuName: '业绩汇总' + `(${isLocalSymbol()})`,
                    routeName: 'pvTotalLocality',
                    changed: false
                  }
                ]
              }
              // 结算中心-奖金来源
              if (items.perms == 'sourceBonus') {
                items.children = [
                  {
                    menuName: '结算期数',
                    routeName: 'period',
                    changed: false
                  },
                  {
                    menuName: '结算日期',
                    routeName: 'settleDate',
                    changed: false
                  },
                  {
                    menuName: '订单编号',
                    routeName: 'orderCode',
                    changed: false
                  },
                  {
                    menuName: '订单类型',
                    routeName: 'orderTypeVal',
                    changed: false
                  },
                  {
                    menuName: '来源国家',
                    routeName: 'sourceCountryName',
                    changed: false
                  },
                  {
                    menuName: '来源编号',
                    routeName: 'sourceMemberCode',
                    changed: false
                  },
                  {
                    menuName: '来源姓名',
                    routeName: 'sourceMemberName',
                    changed: false
                  },
                  {
                    menuName: '来源金额' + '(¥)',
                    routeName: 'orderAmount',
                    changed: false
                  },
                  {
                    menuName: '来源业绩' + '(¥)',
                    routeName: 'orderAchieveOri',
                    changed: false
                  },
                  {
                    menuName: '来源金额' + '($)',
                    routeName: 'orderAmountDollar',
                    changed: false
                  },
                  {
                    menuName: '来源业绩' + '($)',
                    routeName: 'orderAchieve',
                    changed: false
                  },
                  {
                    menuName: '结算国家',
                    routeName: 'settleCountry',
                    changed: false
                  },
                  {
                    menuName: '收益编号',
                    routeName: 'memberCode',
                    changed: false
                  },
                  {
                    menuName: '收益姓名',
                    routeName: 'memberName',
                    changed: false
                  },
                  {
                    menuName: '结算等级',
                    routeName: 'pkSettleGradeVal',
                    changed: false
                  },
                  {
                    menuName: '荣誉奖衔',
                    routeName: 'pkAwardsVal',
                    changed: false
                  },
                  {
                    menuName: '直推轮数',
                    routeName: 'round',
                    changed: false
                  },
                  {
                    menuName: '直推次数',
                    routeName: 'second',
                    changed: false
                  },
                  {
                    menuName: '当前碰次',
                    routeName: 'currentTouch',
                    changed: false
                  },
                  {
                    menuName: '拓展碰次',
                    routeName: 'expandTouch',
                    changed: false
                  },
                  {
                    menuName: '当前代数',
                    routeName: 'currentGeneration',
                    changed: false
                  },
                  {
                    menuName: '辅导代数',
                    routeName: 'coachGeneration',
                    changed: false
                  },
                  {
                    menuName: '拓展无封' + '(¥)',
                    routeName: 'expandNoCappingOri',
                    changed: false
                  },
                  {
                    menuName: '拓展封顶' + '(¥)',
                    routeName: 'expandCappingOri',
                    changed: false
                  },
                  {
                    menuName: '拓展正常减半' + '(¥)',
                    routeName: 'expandNormalHalfOri',
                    changed: false
                  },
                  {
                    menuName: '拓展实际减半' + '(¥)',
                    routeName: 'expandNormalRealOri',
                    changed: false
                  },
                  {
                    menuName: '税前收益' + '(¥)',
                    routeName: 'pretaxIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '实际收益' + '(¥)',
                    routeName: 'realIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '拓展无封' + '($)',
                    routeName: 'expandNoCapping',
                    changed: false
                  },
                  {
                    menuName: '拓展封顶' + `(${isLocals()})`,
                    routeName: 'expandCapping',
                    changed: false
                  },
                  {
                    menuName: '拓展正常减半' + '($)',
                    routeName: 'expandNormalHalf',
                    changed: false
                  },
                  {
                    menuName: '拓展实际减半' + '($)',
                    routeName: 'expandNormalReal',
                    changed: false
                  },
                  {
                    menuName: '税前收益' + '($)',
                    routeName: 'pretaxIncome',
                    changed: false
                  },
                  {
                    menuName: '实际收益' + '($)',
                    routeName: 'realIncome',
                    changed: false
                  },
                  {
                    menuName: '收益类型',
                    routeName: 'bonusName',
                    changed: false
                  },
                  {
                    menuName: '收益状态',
                    routeName: 'incomeStatusVal',
                    changed: false
                  },
                  {
                    menuName: '隶属体系',
                    routeName: 'vertexName',
                    changed: false
                  },
                  {
                    menuName: '隶属团队',
                    routeName: 'teamName',
                    changed: false
                  },
                  {
                    menuName: '奖金说明',
                    routeName: 'remark',
                    changed: false
                  },
                  {
                    menuName: '收益占比' + '(%)',
                    routeName: 'incomeRatio',
                    changed: false
                  },
                  {
                    menuName: '收益拨比' + '(%)',
                    routeName: 'incomeDialRatio',
                    changed: false
                  },
                  {
                    menuName: '订单拨比' + '(%)',
                    routeName: 'orderDialRatio',
                    changed: false
                  }
                ]
              }
              // 奖金汇总
              if (items.perms == 'totalBonus') {
                items.children = [
                  {
                    menuName: '结算期数',
                    routeName: 'period',
                    changed: false
                  },
                  {
                    menuName: '直推收益' + '(¥)',
                    routeName: 'directIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '直推收益' + '($)',
                    routeName: 'directIncome',
                    changed: false
                  },
                  {
                    menuName: '拓展收益' + '(¥)',
                    routeName: 'expandIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '拓展收益' + '($)',
                    routeName: 'expandIncome',
                    changed: false
                  },
                  {
                    menuName: '辅导收益' + '(¥)',
                    routeName: 'coachIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '辅导收益' + '($)',
                    routeName: 'coachIncome',
                    changed: false
                  },
                  {
                    menuName: '分红收益' + '(¥)',
                    routeName: 'shareIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '分红收益' + '($)',
                    routeName: 'shareIncome',
                    changed: false
                  },
                  {
                    menuName: '报单收益' + '(￥)',
                    routeName: 'serviceIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '报单收益' + '($)',
                    routeName: 'serviceIncome',
                    changed: false
                  },
                  {
                    menuName: '云代直推收益' + '(¥)',
                    routeName: 'cloudDirectIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '云代直推收益' + '($)',
                    routeName: 'cloudDirectIncome',
                    changed: false
                  },
                  {
                    menuName: '云代首购收益' + '(¥)',
                    routeName: 'cloudPurIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '云代首购收益' + '($)',
                    routeName: 'cloudPurIncome',
                    changed: false
                  },
                  {
                    menuName: '云代复购收益' + '(¥)',
                    routeName: 'cloudRepurIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '云代复购收益' + '($)',
                    routeName: 'cloudRepurIncome',
                    changed: false
                  },
                  {
                    menuName: '复购级差收益' + '(¥)',
                    routeName: 'repurRangeIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '复购级差收益' + '($)',
                    routeName: 'repurRangeIncome',
                    changed: false
                  },
                  {
                    menuName: '复购拓展收益' + '(¥)',
                    routeName: 'repurExpandIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '复购辅导收益' + '(¥)',
                    routeName: 'repurCoachIncome',
                    changed: false
                  },
                  {
                    menuName: '复购券' + '($)',
                    routeName: 'repurCoupon',
                    changed: false
                  },
                  {
                    menuName: '复购券均分',
                    routeName: 'repurCouponShareOri',
                    changed: false
                  },
                  {
                    menuName: '商城重消' + '(¥)',
                    routeName: 'backPointsOri',
                    changed: false
                  },
                  {
                    menuName: '商城重消' + '($)',
                    routeName: 'backPoints',
                    changed: false
                  },
                  {
                    menuName: '平台服务费' + '(¥)',
                    routeName: 'serviceSpendOri',
                    changed: false
                  },
                  {
                    menuName: '平台服务费' + '($)',
                    routeName: 'serviceSpend',
                    changed: false
                  },
                  {
                    menuName: '环球积分' + '($)',
                    routeName: 'globalPoints',
                    changed: false
                  },
                  {
                    menuName: '车奖积分' + '($)',
                    routeName: 'carAwardPoints',
                    changed: false
                  },
                  {
                    menuName: '店铺收益' + '($)',
                    routeName: 'storeIncome',
                    changed: false
                  },
                  {
                    menuName: '嗨粉推荐收益' + '($)',
                    routeName: 'hiFunIncome',
                    changed: false
                  },
                  {
                    menuName: '嗨粉推荐收益' + '(¥)',
                    routeName: 'hiFunIncomeOri',
                    changed: false
                  },

                  {
                    menuName: '首购实发小计' + '(¥)',
                    routeName: 'purRealSubtotalOri',
                    changed: false
                  },
                  {
                    menuName: '首购实发小计' + '($)',
                    routeName: 'purRealSubtotal',
                    changed: false
                  },
                  {
                    menuName: '云代实发小计' + '(¥)',
                    routeName: 'cloudRealSubtotalOri',
                    changed: false
                  },
                  {
                    menuName: '云代实发小计' + '($)',
                    routeName: 'cloudRealSubtotal',
                    changed: false
                  },
                  {
                    menuName: '复购实发小计' + '(¥)',
                    routeName: 'repurRealSubtotalOri',
                    changed: false
                  },
                  {
                    menuName: '复购实发小计' + '($)',
                    routeName: 'repurRealSubtotal',
                    changed: false
                  },
                  {
                    menuName: '复购券实发小计' + '(¥)',
                    routeName: 'repurCouponSubtotalOri',
                    changed: false
                  },

                  {
                    menuName: '实发收益总计' + '(¥)',
                    routeName: 'realIncomeTotalOri',
                    changed: false
                  },
                  {
                    menuName: '实发收益总计' + '($)',
                    routeName: 'realIncomeTotal',
                    changed: false
                  },
                  // { menuName: '开始时间', routeName: 'settleDate', changed: false },
                  {
                    menuName: '结算时间',
                    routeName: 'settleDate',
                    changed: false
                  },
                  {
                    menuName: '复购推荐收益',
                    routeName: 'repurPushIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '复购卷',
                    routeName: 'repurCouponOri',
                    changed: false
                  },
                  {
                    menuName: '环球积分',
                    routeName: 'globalPointsOri',
                    changed: false
                  },
                  {
                    menuName: '车奖积分',
                    routeName: 'carAwardPointsOri',
                    changed: false
                  },
                  {
                    menuName: '店铺收益',
                    routeName: 'storeIncomeOri',
                    changed: false
                  },

                  {
                    menuName: '复购推荐收益' + `($)`,
                    routeName: 'repurPushIncome',
                    changed: false
                  },
                  {
                    menuName: '复购券均分' + `($)`,
                    routeName: 'repurCouponShare',
                    changed: false
                  },

                  {
                    menuName: '复购券实发小计' + `($)`,
                    routeName: 'repurCouponSubtotal',
                    changed: false
                  }

                ]
              }
              // 结算中心-奖金明细
              if (items.perms == 'BonusDetail') {
                items.children = [
                  {
                    menuName: '会员编号',
                    routeName: 'memberCode',
                    changed: false
                  },
                  {
                    menuName: '会员姓名',
                    routeName: 'memberName',
                    changed: false
                  },
                  {
                    menuName: '隶属体系',
                    routeName: 'vertexName',
                    changed: false
                  },
                  {
                    menuName: '隶属团队',
                    routeName: 'teamName',
                    changed: false
                  },
                  {
                    menuName: '结算期数',
                    routeName: 'period',
                    changed: false
                  },
                  {
                    menuName: '结算日期',
                    routeName: 'settleDate',
                    changed: false
                  },
                  {
                    menuName: '直推收益' + '(¥)',
                    routeName: 'directIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '直推收益' + '($)',
                    routeName: 'directIncome',
                    changed: false
                  },
                  {
                    menuName: '拓展收益' + '(¥)',
                    routeName: 'expandIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '拓展收益' + '($)',
                    routeName: 'expandIncome',
                    changed: false
                  },
                  {
                    menuName: '辅导收益' + '(¥)',
                    routeName: 'coachIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '辅导收益' + '($)',
                    routeName: 'coachIncome',
                    changed: false
                  },
                  {
                    menuName: '分红收益' + '(¥)',
                    routeName: 'shareIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '分红收益' + '($)',
                    routeName: 'shareIncome',
                    changed: false
                  },
                  {
                    menuName: '报单收益' + '(¥)',
                    routeName: 'serviceIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '服务收益' + '($)',
                    routeName: 'serviceIncome',
                    changed: false
                  },
                  {
                    menuName: '云代直推收益' + '(¥)',
                    routeName: 'cloudDirectIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '云代直推收益' + '($)',
                    routeName: 'cloudDirectIncome',
                    changed: false
                  },
                  {
                    menuName: '云代首购收益' + '(¥)',
                    routeName: 'cloudPurIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '云代首购收益' + '($)',
                    routeName: 'cloudPurIncome',
                    changed: false
                  },
                  {
                    menuName: '云代复购收益' + '(¥)',
                    routeName: 'cloudRepurIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '云代复购收益' + '($)',
                    routeName: 'cloudRepurIncome',
                    changed: false
                  },
                  {
                    menuName: '复购推荐收益' + '(¥)',
                    routeName: 'repurPushIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '复购推荐收益' + '($)',
                    routeName: 'repurPushIncome',
                    changed: false
                  },
                  {
                    menuName: '复购级差收益' + '(¥)',
                    routeName: 'repurRangeIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '复购级差收益' + '($)',
                    routeName: 'repurRangeIncome',
                    changed: false
                  },
                  {
                    menuName: '复购拓展收益' + '(¥)',
                    routeName: 'repurExpandIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '复购辅导收益' + '(¥)',
                    routeName: 'repurCoachIncome',
                    changed: false
                  },
                  {
                    menuName: '复购券' + '(¥)',
                    routeName: 'repurCouponOri',
                    changed: false
                  },
                  {
                    menuName: '复购券' + '($)',
                    routeName: 'repurCoupon',
                    changed: false
                  },
                  {
                    menuName: '复购券均分',
                    routeName: 'repurCouponShareOri',
                    changed: false
                  },
                  {
                    menuName: '复购券均分' + '($)',
                    routeName: 'repurCouponShare',
                    changed: false
                  },
                  {
                    menuName: '商城重消' + '(¥)',
                    routeName: 'backPointsOri',
                    changed: false
                  },
                  {
                    menuName: '商城重消' + '($)',
                    routeName: 'backPoints',
                    changed: false
                  },
                  {
                    menuName: '平台服务费' + '(¥)',
                    routeName: 'serviceSpendOri',
                    changed: false
                  },
                  {
                    menuName: '平台服务费' + '($)',
                    routeName: 'serviceSpend',
                    changed: false
                  },
                  {
                    menuName: '环球积分',
                    routeName: 'globalPointsOri',
                    changed: false
                  },
                  {
                    menuName: '环球积分' + '($)',
                    routeName: 'globalPoints',
                    changed: false
                  },
                  {
                    menuName: '车奖积分',
                    routeName: 'carAwardPointsOri',
                    changed: false
                  },
                  {
                    menuName: '车奖积分' + '($)',
                    routeName: 'carAwardPoints',
                    changed: false
                  },
                  {
                    menuName: '店铺收益',
                    routeName: 'storeIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '店铺收益' + '($)',
                    routeName: 'storeIncome',
                    changed: false
                  },
                  {
                    menuName: '嗨粉推荐收益' + '(¥)',
                    routeName: 'hiFunIncomeOri',
                    changed: false
                  },
                  {
                    menuName: '嗨粉推荐收益' + '($)',
                    routeName: 'hiFunIncome',
                    changed: false
                  },

                  {
                    menuName: '首购实发小计' + '(¥)',
                    routeName: 'purRealSubtotalOri',
                    changed: false
                  },
                  {
                    menuName: '首购实发小计' + '($)',
                    routeName: 'purRealSubtotal',
                    changed: false
                  },
                  {
                    menuName: '云代实发小计' + '(¥)',
                    routeName: 'cloudRealSubtotalOri',
                    changed: false
                  },
                  {
                    menuName: '云代实发小计' + '($)',
                    routeName: 'cloudRealSubtotal',
                    changed: false
                  },
                  {
                    menuName: '复购实发小计' + '(¥)',
                    routeName: 'repurRealSubtotalOri',
                    changed: false
                  },
                  {
                    menuName: '复购实发小计' + '($)',
                    routeName: 'repurRealSubtotal',
                    changed: false
                  },
                  {
                    menuName: '复购券实发小计' + '(¥)',
                    routeName: 'repurCouponSubtotalOri',
                    changed: false
                  },
                  {
                    menuName: '复购券实发小计' + '($)',
                    routeName: 'repurCouponSubtotal',
                    changed: false
                  },
                  // {
                  //   menuName: '创客空间实发小计' + '(¥)',
                  //   routeName: 'makerRealSubtotalOri',
                  //   changed: false
                  // },
                  // {
                  //   menuName: '创客空间实发小计' + '($)',
                  //   routeName: 'makerRealSubtotal',
                  //   changed: false
                  // },
                  {
                    menuName: '实发收益总计' + '(¥)',
                    routeName: 'realIncomeTotalOri',
                    changed: false
                  },
                  {
                    menuName: '实发收益总计' + '($)',
                    routeName: 'realIncomeTotal',
                    changed: false
                  }
                ]
              }
              // 物流管理-  商品订单
              if (items.perms == 'Commodity') {
                items.children = [
                  {
                    menuName: '订单编号',
                    routeName: 'orderCode',
                    changed: false
                  },
                  {
                    menuName: '订单类型',
                    routeName: 'orderTypeStr',
                    changed: false
                  },
                  {
                    menuName: '会员编号',
                    routeName: 'memberCode',
                    changed: false
                  },
                  {
                    menuName: '会员姓名',
                    routeName: 'memberName',
                    changed: false
                  },
                  {
                    menuName: '联系方式',
                    routeName: 'phone',
                    changed: false
                  },
                  {
                    menuName: '收货人',
                    routeName: 'recName',
                    changed: false
                  },
                  {
                    menuName: '收货电话',
                    routeName: 'recPhone',
                    changed: false
                  },
                  {
                    menuName: '省',
                    routeName: 'recProvinceName',
                    changed: false
                  },
                  {
                    menuName: '市',
                    routeName: 'recCityName',
                    changed: false
                  },
                  {
                    menuName: '区/县',
                    routeName: 'recCountryName',
                    changed: false
                  },
                  {
                    menuName: '详细地址',
                    routeName: 'recAddress',
                    changed: false
                  },
                  {
                    menuName: '订单金额',
                    routeName: 'orderAmount',
                    changed: false
                  },
                  {
                    menuName: '订单邮费',
                    routeName: 'postage',
                    changed: false
                  },
                  {
                    menuName: '订单业绩',
                    routeName: 'orderAchieve',
                    changed: false
                  },
                  {
                    menuName: '发货方式',
                    routeName: 'deliveryWayStr',
                    changed: false
                  },
                  {
                    menuName: '支付方式',
                    routeName: 'payTypeStr',
                    changed: false
                  },
                  {
                    menuName: '备注',
                    routeName: 'remark',
                    changed: false
                  },
                  {
                    menuName: '创建日期',
                    routeName: 'creationTime',
                    changed: false
                  },
                  {
                    menuName: '支付日期',
                    routeName: 'payTime',
                    changed: false
                  },
                  {
                    menuName: '购买人' + '编号',
                    routeName: 'buyMemberCode',
                    changed: false
                  },
                  {
                    menuName: '购买人' + '姓名',
                    routeName: 'buyMemberName',
                    changed: false
                  },
                  {
                    menuName: '商品订单' + 'BV',
                    routeName: 'orderAssAchieve',
                    changed: false
                  }
                ]
              }
              if (items.perms == 'RechargeDetail') {
                items.children = [
                  {
                    menuName: '国家',
                    routeName: 'pkCountryName',
                    changed: false
                  },
                  {
                    menuName: '会员编号',
                    routeName: 'memberCode',
                    changed: false
                  },
                  {
                    menuName: '会员姓名',
                    routeName: 'memberName',
                    changed: false
                  },
                  {
                    menuName: '钱包类型',
                    routeName: 'pkAccountVal',
                    changed: false
                  },
                  {
                    menuName: '交款方式',
                    routeName: 'paymentMethodVal',
                    changed: false
                  },
                  {
                    menuName: '充前余额' + '(¥)',
                    routeName: 'paymentBeforeBalance',
                    changed: false
                  },
                  {
                    menuName: '充值金额' + '(¥)',
                    routeName: 'paymentAmount',
                    changed: false
                  },
                  {
                    menuName: '当前余额' + '(¥)',
                    routeName: 'paymentBalance',
                    changed: false
                  },
                  {
                    menuName: '充值金额' + '($)',
                    routeName: 'settlePaymentAmount',
                    changed: false
                  },
                  {
                    menuName: '汇率',
                    routeName: 'exchangeRate',
                    changed: false
                  },
                  {
                    menuName: '单据编号',
                    routeName: 'rechargeCode',
                    changed: false
                  },
                  {
                    menuName: '充值批次',
                    routeName: 'batch',
                    changed: false
                  },
                  {
                    menuName: '操作人',
                    routeName: 'creator',
                    changed: false
                  },
                  {
                    menuName: '充值日期',
                    routeName: 'creationTime',
                    changed: false
                  },
                  {
                    menuName: '操作备注',
                    routeName: 'remarks',
                    changed: false
                  },
                  {
                    menuName: '审核人',
                    routeName: 'approverName',
                    changed: false
                  },
                  {
                    menuName: '审核日期',
                    routeName: 'approveTime',
                    changed: false
                  },
                  {
                    menuName: '审核状态',
                    routeName: 'approveStateVal',
                    changed: false
                  }
                ]
              }
              if (items.perms == 'CashDetails') {
                items.children = [
                  {
                    menuName: '国家',
                    routeName: 'pkCountryName',
                    changed: false
                  },
                  {
                    menuName: '会员编号',
                    routeName: 'memberCode',
                    changed: false
                  },
                  {
                    menuName: '会员姓名',
                    routeName: 'memberName',
                    changed: false
                  },
                  {
                    menuName: '隶属体系',
                    routeName: 'vertexName',
                    changed: false
                  },
                  {
                    menuName: '钱包类型',
                    routeName: 'pkAccountVal',
                    changed: false
                  },
                  {
                    menuName: '可提金额' + `(${isLocalSymbol()})`,
                    routeName: 'availableAmount',
                    changed: false
                  },
                  {
                    menuName: '本次提现' + `(${isLocalSymbol()})`,
                    routeName: 'cashAmount',
                    changed: false
                  },
                  {
                    menuName: '可提余额' + `(${isLocalSymbol()})`,
                    routeName: 'availableBalance',
                    changed: false
                  },
                  {
                    menuName: '手续费' + `(${isLocalSymbol()})`,
                    routeName: 'serviceCharge',
                    changed: false
                  },
                  {
                    menuName: '个税' + `(${isLocalSymbol()})`,
                    routeName: 'incomeTax',
                    changed: false
                  },
                  {
                    menuName: '实发金额' + `(${isLocalSymbol()})`,
                    routeName: 'issuedAmount',
                    changed: false
                  },
                  {
                    menuName: '本次提现' + `(${isLocals()})`,
                    routeName: 'settleCashAmount',
                    changed: false
                  },
                  {
                    menuName: '手续费' + `(${isLocals()})`,
                    routeName: 'settleServiceCharge',
                    changed: false
                  },
                  {
                    menuName: '个税' + `(${isLocals()})`,
                    routeName: 'settleIncomeTax',
                    changed: false
                  },
                  {
                    menuName: '实发金额' + `(${isLocals()})`,
                    routeName: 'settleIssuedAmount',
                    changed: false
                  },
                  {
                    menuName: '汇率',
                    routeName: 'exchangeRate',
                    changed: false
                  },
                  {
                    menuName: '申请日期',
                    routeName: 'creationTime',
                    changed: false
                  },
                  {
                    menuName: '银行名称',
                    routeName: 'bankName',
                    changed: false
                  },
                  {
                    menuName: '支行名称',
                    routeName: 'subBankName',
                    changed: false
                  },
                  {
                    menuName: '银行账户',
                    routeName: 'cardNumber',
                    changed: false
                  },
                  {
                    menuName: '开户姓名',
                    routeName: 'accountName',
                    changed: false
                  },
                  {
                    menuName: '预留电话',
                    routeName: 'phone',
                    changed: false
                  },
                  {
                    menuName: '身份证号码',
                    routeName: 'idCard',
                    changed: false
                  },
                  {
                    menuName: '提现备注',
                    routeName: 'remarks',
                    changed: false
                  },
                  {
                    menuName: '审核人',
                    routeName: 'approveName',
                    changed: false
                  },
                  {
                    menuName: '审核日期',
                    routeName: 'approveTime',
                    changed: false
                  },
                  {
                    menuName: '审核备注',
                    routeName: 'approveRemarks',
                    changed: false
                  },
                  {
                    menuName: '打款人',
                    routeName: 'paymentName',
                    changed: false
                  },
                  {
                    menuName: '打款状态',
                    routeName: 'statusVal',
                    changed: false
                  },
                  {
                    menuName: '打款时间',
                    routeName: 'paymentTime',
                    changed: false
                  },
                  {
                    menuName: '打款备注',
                    routeName: 'payerRemarks',
                    changed: false
                  },
                  {
                    menuName: '审核状态',
                    routeName: 'approveStateVal',
                    changed: false
                  },
                  {
                    menuName: '单据编号',
                    routeName: 'withdrawCode',
                    changed: false
                  }
                ]
              }
              if (items.perms == 'ConsumptionDetails') {
                items.children = [
                  {
                    menuName: '国家',
                    routeName: 'pkCountryName',
                    changed: false
                  },
                  {
                    menuName: '会员编号',
                    routeName: 'memberCode',
                    changed: false
                  },
                  {
                    menuName: '会员姓名',
                    routeName: 'memberName',
                    changed: false
                  },
                  {
                    menuName: '钱包类型',
                    routeName: 'pkAccountVal',
                    changed: false
                  },
                  {
                    menuName: '交易类型',
                    routeName: 'tradeTypeVal',
                    changed: false
                  },
                  {
                    menuName: '历史余额' + '(￥)',
                    routeName: 'tradeBeforeBalance',
                    changed: false
                  },
                  {
                    menuName: '当前余额' + '(￥)',
                    routeName: 'tradeBalance',
                    changed: false
                  },
                  {
                    menuName: '交易金额' + '(￥)',
                    routeName: 'tradeAmount',
                    changed: false
                  },
                  {
                    menuName: '历史余额' + '($)',
                    routeName: 'settleTradeBeforeBalance',
                    changed: false
                  },
                  {
                    menuName: '当前余额' + '($)',
                    routeName: 'settleTradeBalance',
                    changed: false
                  },
                  {
                    menuName: '交易金额' + '($)',
                    routeName: 'settleTradeAmount',
                    changed: false
                  },
                  // { menuName: '交易类型', routeName: 'tradeTypeVal', changed: false },
                  {
                    menuName: '汇率',
                    routeName: 'exchangeRate',
                    changed: false
                  },
                  {
                    menuName: '交易日期',
                    routeName: 'creationTime',
                    changed: false
                  },
                  {
                    menuName: '单据编号',
                    routeName: 'sourceCode',
                    changed: false
                  }
                ]
              }
              if (items.perms == 'TransferDetails') {
                items.children = [
                  {
                    menuName: '国家',
                    routeName: 'pkCountryName',
                    changed: false
                  },
                  {
                    menuName: '转出编号',
                    routeName: 'memberCode',
                    changed: false
                  },
                  {
                    menuName: '转出姓名',
                    routeName: 'memberName',
                    changed: false
                  },
                  {
                    menuName: '转出钱包',
                    routeName: 'pkAccountVal',
                    changed: false
                  },
                  {
                    menuName: '转账金额' + '(￥)',
                    routeName: 'transferMoney',
                    changed: false
                  },
                  {
                    menuName: '转账金额' + '($)',
                    routeName: 'settleTransferMoney',
                    changed: false
                  },
                  {
                    menuName: '转账手续费' + '(¥)',
                    routeName: 'serviceCharge',
                    changed: false
                  },
                  {
                    menuName: '转账手续费' + '($)',
                    routeName: 'settleServiceCharge',
                    changed: false
                  },
                  {
                    menuName: '接收编号',
                    routeName: 'toMemberCode',
                    changed: false
                  },
                  {
                    menuName: '接收姓名',
                    routeName: 'toMemberName',
                    changed: false
                  },
                  {
                    menuName: '接收钱包',
                    routeName: 'pkToAccountVal',
                    changed: false
                  },
                  {
                    menuName: '接收金额' + '(¥)',
                    routeName: 'issuedAmount',
                    changed: false
                  },
                  {
                    menuName: '接收金额' + '($)',
                    routeName: 'settleIssuedAmount',
                    changed: false
                  },
                  {
                    menuName: '汇率',
                    routeName: 'exchangeRate',
                    changed: false
                  },
                  {
                    menuName: '转账日期',
                    routeName: 'creationTime',
                    changed: false
                  },
                  {
                    menuName: '交易备注',
                    routeName: 'remarks',
                    changed: false
                  },
                  {
                    menuName: '单据编号',
                    routeName: 'transferCode',
                    changed: false
                  }
                ]
              }
            })
          }
        })
        this.setNewArr()
      })
      // 获取回显
      // const geturl = window.location.href
      // const getqyinfo = geturl.split('?')[1]
      // const getqys = new URLSearchParams('?' + getqyinfo)
      const getId = this.$route.query.id
      if (getId) {
        this.getEcho(getId)
      }
      if (check) {
        this.disabled = true
      }
    },
    async setNewArr() {
      this.userList.forEach((item) => {
        item.changed = false
      })
      this.roleAllList.forEach((item) => {
        item.changed = false
      })
      this.gradeList.forEach((item) => {
        item.changed = false
      })
      this.menuAllList.forEach((item) => {
        item.changed = false
        if (item.children) {
          item.children.forEach((ctem) => {
            ctem.changed = false
            if (ctem.children) {
              ctem.children.forEach((ctems) => {
                ctems.changed = false
              })
            }
          })
        }
      })
      this.$forceUpdate()
    },
    // 获取回显的值
    getEcho(url) {
      api.menuAllListAll(url).then((res) => {
        this.menuAllList.forEach((item, index) => {
          res.data.forEach((items) => {
            if (item.children) {
              item.children.forEach((_items) => {
                if (_items.columnList.length > 0) {
                  item.changed = true
                  _items.columnList.forEach((_items1) => {
                    _items.changed = true
                    _items.children.forEach((items2) => {
                      _items.columnList.forEach((items) => {
                        if (items2.routeName == items) {
                          items2.changed = true
                        }
                      })
                    })
                  })
                }
              })
            }
          })
        })
        this.$forceUpdate()
      })
    },
    checkManage() {
      // 获取所有选中的角色
      const _roleIds = []
      this.roleAllList.forEach(function(item) {
        if (item.changed) {
          _roleIds.push(item.roleId)
        }
      })
      // 获取所有管理，和选中的角色对比，满足情况后置为选中状态
      const _userList = this.userList
      _userList.forEach(function(item) {
        let _count = 0
        const _roleLength = _roleIds.length
        item.roleIdList.forEach(function(roleItem) {
          _roleIds.forEach(function(selRoleItem) {
            if (roleItem == selRoleItem) {
              _count++
            }
          })
        })
        if (_count != 0 && _count == _roleLength) {
          item.changed = true
        } else {
          item.changed = false
        }
      })
      this.userList = _userList
    },
    checkClickC(e, index) {
      if (e) {
        this.roleAllList[index].changed = true
        this.roleAllList[index].checkArr = []
        if (this.roleAllList[index].changed) {
          this.roleAllList[index].checkArr.push(this.roleAllList[index].roleId)
        }
        this.checkManage()
      } else {
        this.roleAllList[index].changed = false
        this.roleAllList[index].checkArr = []
        this.checkManage()
      }
      this.$forceUpdate()
    },
    deppClone(obj) {
      const _obj = JSON.stringify(obj)
      const _obj1 = JSON.parse(_obj)
      return _obj1
    },
    checkClickD(e, index) {
      if (e) {
        this.userList[index].changed = true
        this.userList[index].checkArr = []
        if (this.userList[index].changed) {
          this.userList[index].checkArr.push(this.userList[index].userId)
        }
      } else {
        this.userList[index].changed = false
        this.userList[index].checkArr = []
      }
      this.$forceUpdate()
    },
    checkClickG(e, index, cndex, Dndex, FDnex) {
      if (e) {
        this.menuAllList[index].children[cndex].changed = true
        this.menuAllList[index].children[cndex].children[Dndex].changed = true
        this.menuAllList[index].children[cndex].children[Dndex].checkArr = []
        this.menuAllList[index].children[cndex].checkArr = []
        this.menuAllList[index].checkArr = []
        this.menuAllList[index].changed = true
        this.menuAllList[index].children[cndex].children.forEach((item) => {
          if (item.changed) {
            this.menuAllList[index].children[cndex].children[
              Dndex
            ].checkArr.push(item.menuId)
          }
        })

        this.menuAllList[index].children[cndex].children[Dndex].children[
          FDnex
        ].changed = true
        this.menuAllList[index].children[cndex].children[Dndex].children[
          FDnex
        ].checkArr = []
        // this.menuAllList[index].checkArr.push(this.menuAllList[index].menuId)
      } else {
        // this.menuAllList[index].children[cndex].changed = false
        this.menuAllList[index].children[cndex].children[Dndex].children[
          FDnex
        ].checkArr = []
        this.menuAllList[index].children[cndex].children[Dndex].children[
          FDnex
        ].changed = false
        // this.menuAllList[index].children.forEach((item) => {
        //   if (item.changed) {
        //     this.menuAllList[index].children[cndex].children[Dndex].checkArr.push(item.menuId)
        //   }
        // })
      }
      console.error(this.menuAllList)
      this.$forceUpdate()
    },
    checkClickF(e, index, cndex, Dndex) {
      if (e) {
        this.menuAllList[index].children[cndex].changed = true
        this.menuAllList[index].children[cndex].children[Dndex].changed = true
        this.menuAllList[index].children[cndex].children[Dndex].checkArr = []
        this.menuAllList[index].children[cndex].checkArr = []
        this.menuAllList[index].checkArr = []
        this.menuAllList[index].changed = true
        this.menuAllList[index].children[cndex].children.forEach((item) => {
          if (item.changed) {
            this.menuAllList[index].children[cndex].children[
              Dndex
            ].checkArr.push(item.menuId)
          }
        })
        // this.menuAllList[index].checkArr.push(this.menuAllList[index].menuId)
      } else {
        // this.menuAllList[index].children[cndex].changed = false
        this.menuAllList[index].children[cndex].children[Dndex].checkArr = []
        this.menuAllList[index].children[cndex].children[Dndex].changed = false
        if (this.menuAllList[index].children[cndex].children[Dndex].children) {
          this.menuAllList[index].children[cndex].children[
            Dndex
          ].children.forEach((item) => {
            item.changed = false
          })
        }
        // this.menuAllList[index].children.forEach((item) => {
        //   if (item.changed) {
        //     this.menuAllList[index].children[cndex].children[Dndex].checkArr.push(item.menuId)
        //   }
        // })
      }
      this.$forceUpdate()
    },
    checkClickA(e, index) {
      if (e) {
        this.menuAllList[index].changed = true
        this.menuAllList[index].checkArr = []
        this.menuAllList[index].checkArr.push(this.menuAllList[index].menuId)
      } else {
        this.menuAllList[index].changed = false
        this.menuAllList[index].checkArr = []
        this.menuAllList[index].children.forEach((item) => {
          item.changed = false
          item.checkArr = []
          if (item.children) {
            item.children.forEach((items) => {
              items.changed = false
              items.checkArr = []
              if (items.children) {
                items.children.forEach((item_s) => {
                  item_s.changed = false
                  item_s.checkArr = []
                })
              }
            })
          }
        })
      }
      this.$forceUpdate()
    },
    checkClickB(e, index, cndex) {
      if (e) {
        console.error('666')
        this.menuAllList[index].children[cndex].changed = true
        this.menuAllList[index].children[cndex].checkArr = []
        this.menuAllList[index].checkArr = []
        this.menuAllList[index].changed = true
        this.menuAllList[index].children.forEach((item) => {
          if (item.changed) {
            this.menuAllList[index].children[cndex].checkArr.push(item.menuId)
            if (item.children) {
              item.children.forEach((item_s) => {
                item_s.changed = true
              })
            }
          }
        })
      } else {
        this.menuAllList[index].children[cndex].changed = false
        this.menuAllList[index].children[cndex].checkArr = []
        this.menuAllList[index].checkArr = []
        if (this.menuAllList[index].children[cndex].children) {
          this.menuAllList[index].children[cndex].children.forEach((item) => {
            item.changed = false
            item.checkArr = []
            if (item.children) {
              item.children.forEach((item_s) => {
                item_s.changed = false
                item_s.checkArr = []
              })
            }
          })
        }
        this.menuAllList[index].children.forEach((item) => {
          if (item.changed) {
            this.menuAllList[index].children[cndex].checkArr.push(item.menuId)
          }
        })
      }
      this.$forceUpdate()
    }
  }
}
</script>
<style scoped lang="scss">
.class2 {
  display: flex;
  flex-wrap: wrap;
  width: 1000px;
}
.myBtn {
  width: 120px;
  height: 38px;
  border-radius: 5px;
  color: #fff;
  background-color: #cccccc;
  border-color: #ccc;
}
.myBtn1 {
  width: 120px;
  height: 38px;
  border-radius: 5px;
  color: #fff;
  background-color: #c8161d;
  border-color: #c8161d;
}
.width100 {
  //min-width: 128px;
  //border-right: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  border-top: 1px solid #ccc;
  width: 200px;
}
.class1 {
  border-right: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  border-top: 1px solid #ccc;
  //overflow-x: auto;
  display: flex;
  flex-wrap: wrap;
}
.class3 {
  border-right: 1px solid #ccc;
}
.flex-1 {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 200px;
  border-right: 1px solid #ccc;
  padding: 0 20px;
  border-bottom: 1px solid #ccc;
}
.borders {
  display: flex;
  border-left: none;
}
.line_s {
  border-bottom: 1px solid #ccc;
}
.width-s {
  //width: 1300px;
  //height: 65px;
  display: flex;
  //border-bottom: 1px solid #ccc;
  //border-right: 1px solid #ccc;
  //border: 1px solid #ccc;
  border-left: none;
  //flex-wrap: wrap;
  //overflow-x: auto;
}
.flex1 {
  padding: 20px 10px;
  //border-top: 1px solid #ccc;
}
.bd-s {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 140px;
  border-right: 1px solid #ccc;
  padding: 15px 10px;
  //min-width: inherit!important;
  height: 100%;
}
.box-s {
  //display: block;
  padding: 20px 10px;
  //border-top: 1px solid #ccc;
  //border-right: 1px solid #ccc;
  margin-right: 0;
  display: flex;
  //border: 1px solid #ccc;
  border-left: none;
  min-width: 110px;
  justify-content: center;
}
.checks {
  //display: block;
  padding: 10px 0;
  //border-bottom: 1px solid #ccc;

  margin-right: 0;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  //border-right: 1px solid #ccc;
  border-top: 1px solid #ccc;
  min-width: 200px;
  //display: block;
  text-align: center;
}
.flex-s {
  display: flex;
  //width: 1140px;
  //overflow-x: auto;
}
.page {
  background: #f9f9f9;
  padding: 20px;
}
.topbox {
  align-items: center;
  padding: 0px 0 15px 0;
  display: flex;
  //   background: skyblue;
  .levelList_i {
    margin-left: 20px;
    position: relative;
    cursor: pointer;
    padding: 0 5px;
    min-width: 88px;
    height: 34px;
    border-radius: 17px;
    border: 1px solid #cccccc;
    font-size: 14px;
    font-family: MicrosoftYaHei;
    text-align: center;
    line-height: 34px;
  }
}
.act {
  color: #ffffff;
  background: #08143f;
}
.act1 {
  border-bottom: 3px solid #1890ff !important;
}
.cha {
  font-size: 16px;
  color: #606266;
  position: absolute;
  top: 10px;
}
.li {
  width: 40px;
  margin: 0 auto;
  border-bottom: 3px solid transparent;
}
.main {
  background: #fff;
  border-top: 1px solid #ccc;
}
.fx_s {
  overflow-x: auto;
  //width: 1400px;
}
.table_a {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ccc;
  border-left: 1px solid #ccc;
  //border-right: 1px solid #ccc;
  // border-top: 1px solid #ccc;
}
.table_b {
  display: flex;
  flex-direction: column;
  // border-bottom: 1px solid #ccc;
  border-left: 1px solid #ccc;
  width: 100%;
  height: 100%;
  //overflow-x: auto;
}
.table_c {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ccc;
}
.table_c:last-child {
  border-bottom: 0;
}
.table_cc {
  border-right: 1px solid #ccc;
  //margin: 15px 0;
  display: flex;
  //border-bottom: 1px solid #ccc;
}
.change_l {
  //padding: 0 44px;
  width: 150px;
  text-align: center;
  font-size: 14px;
  color: #333;
  font-weight: 600;
}
.change_i {
  display: flex;
  //align-items: center;
  padding: 15px 0 15px 15px;
  //border-bottom: 1px solid #ccc;
  //display:table ;
  //display:table-cell ;
  //vertical-align:middle;
}
.footer {
  height: 68px;
  background: #ffffff;
  box-shadow: 0px -3px 20px 0px rgba(204, 204, 204, 0.5);
  // margin: 0 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  .thebtn1 {
    background: #3181e5;
    color: #ffffff;
    padding: 9px 45px;
  }
  .thebtn2 {
    background: #cccccc;
    color: #ffffff;
    padding: 9px 45px;
  }
}
</style>
