<!--
 * @Descripttion:
 * @version:
 * @Author: kBank
 * @Date: 2022-10-24 15:45:01
-->
<template>
  <div class="page">
    <topBar
      v-if="topList.length > 0"
      :top-list="topList"
      :moren="moren"
    />
        <div v-if="topList[0].changed==true">
<!--    <div>-->
      <div class="main">
        <el-form
          ref="select"
          :model="select"
          style="padding:0px;background: #fff"
          label-width="100px"
        >
          <el-row>
            <!-- 一层 -->
            <el-col :span="4">
              <el-form-item :label="'会员编号'">
                <el-input v-model="select.memberCode" clearable />
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'会员姓名'">
                <el-input v-model="select.memberName" clearable />
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'真实奖衔'">
                <el-select
                  v-model="select.pkAwards"
                  clearable
                  placeholder=""
                >
                  <el-option
                    v-for="item in awardsList"
                    :key="item.value"
                    :label="item.awardsName"
                    :value="item.awardsValue"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'结算国家'">
                <el-select
                  v-model="select.pkSettleCountry"
                  clearable
                  placeholder=""
                >
                  <el-option
                    v-for="item in countryAllList"
                    :key="item.pkId"
                    :label="item.shortName"
                    :value="item.pkId"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'隶属体系'">
                <el-select
                  v-model="select.pkVertex"
                  clearable
                  placeholder=""
                >
                  <el-option
                    v-for="item in vertexList"
                    :key="item.value"
                    :value="item.pkId"
                    :label="item.vertexName"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item :label="'隶属团队'">
                <el-select
                  v-model="select.pkMemberTeam"
                  clearable
                  placeholder=""
                >
                  <el-option
                    v-for="item in memberteamList"
                    :key="item.pkId"
                    :label="item.teamName"
                    :value="item.pkId"
                  />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row >
            <el-col :span="8">
              <el-form-item :label="'结算日期'">
                <el-date-picker
                  v-model="creationTime"
                  value-format="yyyy-MM-dd"
                  type="datetimerange"
                  format="yyyy-MM-dd"
                  :range-separator="'至'"
                  :start-placeholder="'开始日期'"
                  :end-placeholder="'结束日期'"
                  @change="changeTime"
                />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col>
              <el-form-item :label="'数据类型'">
                <el-checkbox-group v-model="select.dataTypes">
                  <el-checkbox
                    v-for="(item,index) in DataTypeList"
                    :key="index"
                    :label="item.value"
                    :value="item.value"
                  >
                    {{ item.label }}
                  </el-checkbox>
                </el-checkbox-group>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row style="margin-left:30px">
            <el-col :span="4" style="margin-top: -10px">
              <el-button
                type="primary"
                class="my_search"
                @click="getDataList"
              > {{ '搜索' }}</el-button>
              <el-button
                class="my_reset"
                @click="reset"
              > {{ '重置' }}</el-button>
            </el-col>
          </el-row>
        </el-form>
        <div class="maintop">
          <div class="mainbtn">
            <el-button
              v-has-buttons="['placementDataImport']"
              size="small"
              style="background: #FF6723"
              class="thebtn2"
            > {{ '导入' }}</el-button>
            <!-- <el-button
              v-has-buttons="['placementDataExportImg']"
              size="small"
              class="thebtn2"
            > {{ '导出' }} {{'图片'}}</el-button> -->
            <!-- <el-button
              v-has-buttons="['placementDataExportTable']"
              size="small"
              class="thebtn2"
              @click="handleExport"
            > {{ '导出' }} {{'表格'}}</el-button> -->
          </div>
          <div>
            <el-dropdown :hide-on-click="false">
              <span class="el-dropdown-link kuang">
                {{'筛选字段'}}<i class="el-icon-arrow-down el-icon--right" />
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item
                  v-for="item in menuList"
                  :key="item.id"
                >
                  <el-checkbox
                    v-model="item.checked"
                    @change="getMenu($event,item.id)"
                  >{{ item.text }}</el-checkbox></el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </div>
        </div>
        <div class="maintable">
          <div class="itemTrading">
            <el-table
              :data="tableData.censusSummaryList"
              v-loading="loading"
              height="660px"
              style="width: 100%"
              :header-cell-style="{ background: '#EEEEEE' }"
            >
              <el-table-column
                class="style-s"
                type="selection"
                width="100"
              />
              <el-table-column
                align="center"
                prop="memberCode"
                width="130"
                :label="'会员编号'"
              />
              <el-table-column
                align="center"
                prop="memberName"
                width="130"
                :label="'会员姓名'"
              />
              <el-table-column
                align="center"
                prop="pkAwardsVal"
                width="130"
                :label="'真实奖衔'"
              />
              <el-table-column
                align="center"
                prop="settleCountry"
                width="130"
                :label="'结算国家'"
              />
              <el-table-column
                align="center"
                prop="teamName"
                width="130"
                :label="'隶属团队'"
              />
              <el-table-column
                align="center"
                prop="vertexName"
                width="130"
                :label="'隶属体系'"
              />
              <el-table-column
                align="center"
                prop="settleDate"
                width="130"
                :label="'数据类型'"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.detailVOList[0]" class="border-s">{{ '真实' }}</div>
                  <div v-if="scope.row.detailVOList[1]" class="border-s">{{ '首购' }}</div>
                  <div v-if="scope.row.detailVOList[2]" class="border-s">{{ '复购' }}</div>
                </template>
              </el-table-column>
              <el-table-column
                class="style"
                align="center"
                prop="settleDate"
                width="130"
                :label="'左区新增'+`(${isLocalSymbol()})`"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.detailVOList[0]" class="border-s color-s">{{ scope.row.detailVOList[0].leftNewAchieve }}</div>
                  <div v-if="scope.row.detailVOList[1]" class="border-s color-s">{{ scope.row.detailVOList[1].leftNewAchieve }}</div>
                  <div v-if="scope.row.detailVOList[2]" class="border-s color-s">{{ scope.row.detailVOList[2].leftNewAchieve }}</div>
                </template>
              </el-table-column>
              <el-table-column
                v-if="menuList[1].checked==true"
                align="center"
                prop="settleDate"
                width="130"
                :label="'左区新增'+'($)'"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.detailVOList[0]" class="border-s color-s">{{ scope.row.detailVOList[0].settleLeftNewAchieve }}</div>
                  <div v-if="scope.row.detailVOList[1]" class="border-s color-s">{{ scope.row.detailVOList[1].settleLeftNewAchieve }}</div>
                  <div v-if="scope.row.detailVOList[2]" class="border-s color-s">{{ scope.row.detailVOList[2].settleLeftNewAchieve }}</div>
                </template>
              </el-table-column>

              <el-table-column
                align="center"
                prop="settleDate"
                width="130"
                :label="'右区新增'+`(${isLocalSymbol()})`"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.detailVOList[0]" class="border-s color-s">{{ scope.row.detailVOList[0].rightNewAchieve }}</div>
                  <div v-if="scope.row.detailVOList[1]" class="border-s color-s">{{ scope.row.detailVOList[1].rightNewAchieve }}</div>
                  <div v-if="scope.row.detailVOList[2]" class="border-s color-s">{{ scope.row.detailVOList[2].rightNewAchieve }}</div>
                </template>
              </el-table-column>
              <el-table-column
                v-if="menuList[2].checked==true"
                align="center"
                prop="settleDate"
                width="130"
                :label="'右区新增'+'($)'"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.detailVOList[0]" class="border-s color-s">{{ scope.row.detailVOList[0].settleRightNewAchieve }}</div>
                  <div v-if="scope.row.detailVOList[1]" class="border-s color-s">{{ scope.row.detailVOList[1].settleRightNewAchieve }}</div>
                  <div v-if="scope.row.detailVOList[2]" class="border-s color-s">{{ scope.row.detailVOList[2].settleRightNewAchieve }}</div>
                </template>
              </el-table-column>
              <el-table-column
                align="center"
                prop="settleDate"
                width="130"
                :label="'左区金额'+`(${isLocalSymbol()})`"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.detailVOList[0]" class="border-s color-s">{{ scope.row.detailVOList[0].leftNewAmount }}</div>
                  <div v-if="scope.row.detailVOList[1]" class="border-s color-s">{{ scope.row.detailVOList[1].leftNewAmount }}</div>
                  <div v-if="scope.row.detailVOList[2]" class="border-s color-s">{{ scope.row.detailVOList[2].leftNewAmount }}</div>
                </template>
              </el-table-column>
              <el-table-column
                v-if="menuList[3].checked==true"
                align="center"
                prop="settleDate"
                width="130"
                :label="'左区金额'+'($)'"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.detailVOList[0]" class="border-s color-s">{{ scope.row.detailVOList[0].settleLeftNewAmount }}</div>
                  <div v-if="scope.row.detailVOList[1]" class="border-s color-s">{{ scope.row.detailVOList[1].settleLeftNewAmount }}</div>
                  <div v-if="scope.row.detailVOList[2]" class="border-s color-s">{{ scope.row.detailVOList[2].settleLeftNewAmount }}</div>
                </template>
              </el-table-column>
              <el-table-column
                align="center"
                prop="settleDate"
                width="130"
                :label="'右区金额'+`(${isLocalSymbol()})`"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.detailVOList[0]" class="border-s color-s">{{ scope.row.detailVOList[0].rightNewAmount }}</div>
                  <div v-if="scope.row.detailVOList[1]" class="border-s color-s">{{ scope.row.detailVOList[1].rightNewAmount }}</div>
                  <div v-if="scope.row.detailVOList[2]" class="border-s color-s">{{ scope.row.detailVOList[2].rightNewAmount }}</div>
                </template>
              </el-table-column>
              <el-table-column
                v-if="menuList[4].checked==true"
                align="center"
                prop="settleDate"
                width="130"
                :label="'右区金额'+'($)'"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.detailVOList[0]" class="border-s color-s">{{ scope.row.detailVOList[0].settleRightNewAmount }}</div>
                  <div v-if="scope.row.detailVOList[1]" class="border-s color-s">{{ scope.row.detailVOList[1].settleRightNewAmount }}</div>
                  <div v-if="scope.row.detailVOList[2]" class="border-s color-s">{{ scope.row.detailVOList[2].settleRightNewAmount }}</div>
                </template>
              </el-table-column>
              <el-table-column
                align="center"
                prop="settleDate"
                width="130"
                :label="'左区业绩'+`(${isLocalSymbol()})`"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.detailVOList[0]" class="border-s color-s">{{ scope.row.detailVOList[0].leftSumAchieve }}</div>
                  <div v-if="scope.row.detailVOList[1]" class="border-s color-s">{{ scope.row.detailVOList[1].leftSumAchieve }}</div>
                  <div v-if="scope.row.detailVOList[2]" class="border-s color-s">{{ scope.row.detailVOList[2].leftSumAchieve }}</div>
                </template>
              </el-table-column>
              <el-table-column
                v-if="menuList[5].checked==true"
                align="center"
                prop="settleDate"
                width="130"
                :label="'左区业绩'+'($)'"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.detailVOList[0]" class="border-s color-s">{{ scope.row.detailVOList[0].settleLeftSumAchieve }}</div>
                  <div v-if="scope.row.detailVOList[1]" class="border-s color-s">{{ scope.row.detailVOList[1].settleLeftSumAchieve }}</div>
                  <div v-if="scope.row.detailVOList[2]" class="border-s color-s">{{ scope.row.detailVOList[2].settleLeftSumAchieve }}</div>
                </template>
              </el-table-column>
              <el-table-column
                align="center"
                prop="settleDate"
                width="130"
                :label="'右区业绩'+`(${isLocalSymbol()})`"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.detailVOList[0]" class="border-s color-s">{{ scope.row.detailVOList[0].rightSumAchieve }}</div>
                  <div v-if="scope.row.detailVOList[1]" class="border-s color-s">{{ scope.row.detailVOList[1].rightSumAchieve }}</div>
                  <div v-if="scope.row.detailVOList[2]" class="border-s color-s">{{ scope.row.detailVOList[2].rightSumAchieve }}</div>
                </template>
              </el-table-column>
              <el-table-column
                v-if="menuList[6].checked==true"
                align="center"
                prop="settleDate"
                width="130"
                :label="'右区业绩'+'($)'"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.detailVOList[0]" class="border-s color-s">{{ scope.row.detailVOList[0].settleRightSumAchieve }}</div>
                  <div v-if="scope.row.detailVOList[1]" class="border-s color-s">{{ scope.row.detailVOList[1].settleRightSumAchieve }}</div>
                  <div v-if="scope.row.detailVOList[2]" class="border-s color-s">{{ scope.row.detailVOList[2].settleRightSumAchieve }}</div>
                </template>
              </el-table-column>
              <el-table-column
                v-if="menuList[7].checked==true"
                align="center"
                prop="settleDate"
                width="130"
                :label="'左区结余'+`(${isLocalSymbol()})`"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.detailVOList[0]" class="border-s color-s">{{ scope.row.detailVOList[0].leftBalance }}</div>
                  <div v-if="scope.row.detailVOList[1]" class="border-s color-s">{{ scope.row.detailVOList[1].leftBalance }}</div>
                  <div v-if="scope.row.detailVOList[2]" class="border-s color-s">{{ scope.row.detailVOList[2].leftBalance }}</div>
                </template>
              </el-table-column>
              <el-table-column
                v-if="menuList[7].checked==true"
                align="center"
                prop="settleDate"
                width="130"
                :label="'左区结余'+'($)'"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.detailVOList[0]" class="border-s color-s">{{ scope.row.detailVOList[0].settleLeftBalance }}</div>
                  <div v-if="scope.row.detailVOList[1]" class="border-s color-s">{{ scope.row.detailVOList[1].settleLeftBalance }}</div>
                  <div v-if="scope.row.detailVOList[2]" class="border-s color-s">{{ scope.row.detailVOList[2].settleLeftBalance }}</div>
                </template>
              </el-table-column>
              <el-table-column
                align="center"
                prop="settleDate"
                width="130"
                :label="'右区结余'+`(${isLocalSymbol()})`"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.detailVOList[0]" class="border-s color-s">{{ scope.row.detailVOList[0].rightBalance }}</div>
                  <div v-if="scope.row.detailVOList[1]" class="border-s color-s">{{ scope.row.detailVOList[1].rightBalance }}</div>
                  <div v-if="scope.row.detailVOList[2]" class="border-s color-s">{{ scope.row.detailVOList[2].rightBalance }}</div>
                </template>
              </el-table-column>
              <el-table-column
                v-if="menuList[8].checked==true"
                align="center"
                prop="settleDate"
                width="130"
                :label="'右区结余'+'($)'"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.detailVOList[0]" class="border-s color-s">{{ scope.row.detailVOList[0].settleRightBalance }}</div>
                  <div v-if="scope.row.detailVOList[1]" class="border-s color-s">{{ scope.row.detailVOList[1].settleRightBalance }}</div>
                  <div v-if="scope.row.detailVOList[2]" class="border-s color-s">{{ scope.row.detailVOList[0].settleRightBalance }}</div>
                </template>
              </el-table-column>
              <el-table-column
                align="center"
                prop=""
                width="100"
                :label="'操作'"
              >
                <template slot-scope="scope">
                  <div>
                    <el-button
                      v-if="scope.row.detailVOList[0]"
                      v-has-buttons="['placementDataCopyZs']"
                      style="color: #53B11E;margin-left: 3px"
                      class="thebtn2 buttonStyleS"
                      @click="handleCopy(scope.$index, scope.row,0)"
                    >{{ '复制真实' }}</el-button>
                  </div>
                  <div>
                    <el-button
                      v-if="scope.row.detailVOList[1]"
                      v-has-buttons="['placementDataCopyZg']"
                      style="color: #C73030;margin-left: 3px"
                      class="thebtn2 buttonStyleS"
                      @click="handleCopy(scope.$index, scope.row,1)"
                    >{{ '复制首购' }}</el-button>
                  </div>
                  <div>
                    <el-button
                      v-if="scope.row.detailVOList[2]"
                      v-has-buttons="['placementDataCopyFg']"
                      style="color: #108EE9"
                      class="thebtn2 buttonStyleS"
                      @click="handleCopy(scope.$index, scope.row,2)"
                    >{{ '复制复购' }}</el-button>
                  </div>
                  <div>
                    <el-button
                      v-has-buttons="['placementDataCopyAll']"
                      size="small"
                      style="color: #FFAD41;"
                      class="thebtn2 buttonStyleS"
                      @click="handleCopy1(scope.$index, scope.row)"
                    >{{ '复制全部' }}</el-button>
                  </div>
                </template>
              </el-table-column>
            </el-table>
          </div>

          <!--        <div class="heji">-->
          <!--          <div class="dis"-->
          <!--               v-for="item in menuList"-->
          <!--               :key="item.id"-->
          <!--               v-if="item.checked&&item.id != 0&&item.id > 13">-->
          <!--            <div>{{ item.text }}</div>-->
          <!--            <div>{{ tableData[item.prop] }}</div>-->
          <!--          </div>-->
          <!--        </div>-->
        </div>
      </div>
      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getDataList"
      />
    </div>

  </div>
</template>

<script>
import topBar from '@/components/topBarRole'
import * as api from '@/api/settle.js'
import { classifyUpdate, classifySave } from '@/api/product'
import {isLocalSymbol, stateFormat} from '@/utils/numberToCurrency'
import { getAwardsListChiose } from '@/api/level'
import { getCountryFindAll } from '@/api/specialBusiness'
import { getDataType, getmemberTeamList, getvertexValue } from '@/api/member'
import { getRouters, getShowPlace } from '@/api/settle.js'
export default {
  name: 'Bzpz',
  components: {
    topBar
  },
  filters: {
 isAgree(val) {
      if (!val) {
        return '允许';
      } else {
        return '禁止';
      }
    }
  },
  data() {
    return {
      typeList: [
        {
          value: 0,
          label: '前台'
        },
        {
          value: 1,
          label: '后台'
        }
      ],
      digList: [
        {
          value: 0,
          label: '允许',
        },
        {
          value: 1,
          label: '禁止',
        },
      ],
      menuList: [
        {
          id: 0,
          text: '全选',
          checked: false
        },
        {
          id: 1,
          text: '左区新增' + '($)',
          checked: true,
          prop: 'firstBuyAmountDollar',
          formatter: stateFormat
        },
        {
          id: 2,
          text: '右区新增' + '($)',
          checked: true,
          prop: 'upgradeAmountDollar',
          formatter: stateFormat
        },
        {
          id: 3,
          text: '左区金额' + '($)',
          checked: true,
          prop: 'repurchaseAmountDollar',
          formatter: stateFormat
        },
        {
          id: 4,
          text: '右区金额' + '($)',
          checked: true,
          prop: 'fansAmountDollar',
          formatter: stateFormat
        },
        {
          id: 5,
          text: '左区业绩' + '($)',
          checked: false,
          prop: 'firstBuyAmountPv',
          formatter: stateFormat
        },
        {
          id: 6,
          text: '右区业绩' + '($)',
          checked: false,
          prop: 'upgradePv',
          formatter: stateFormat
        },
        {
          id: 7,
          text: '左区结余' + '($)',
          checked: false,
          prop: 'repurchasePv',
          formatter: stateFormat
        },
        {
          id: 8,
          text: '右区结余' + '($)',
          checked: false,
          prop: 'hiFunAmountPv',
          formatter: stateFormat
        }
      ],
      creationTime: [],
      creationTime1: [],
      select: {
        pkVertex: [],
        pkMemberTeam: [],
        dataTypes: [],
        memberCode: ''
      },
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 50
      },
      addOrEdit: '',
      total: 0,
      dialogVisible: false,
      loading:false,
      tableData: {
        censusSummaryList: []
      },
      moren: '/settlementCenter/placementData',
      topList: [
        {
          name: '安置数据',
          path: '/settlementCenter/placementData',
          url: 'placementData',
          changed: false
        },
        {
          name: '安置图表',
          path: '/settlementCenter/placementDatas',
          url: 'placementChat',
          changed: false
        }
      ],
      form: {
        name: ''
      },
      rules: {
        name: [{ required: true, message: '请输入规格类型', trigger: 'blur' }]
      },
      acList: [],
      verList: [],
      memberList: [],
      awardsList: [],
      vertexList: [],
      memberteamList: [],
      countryAllList: [],
      DataTypeList: [],
      copyData: null
    }
  },
  mounted() {
    // 获取下拉
    this.getData()
    // 获取列表
    this.getDataList()
    this.getUserRoute()
  },
  methods: {
    isLocalSymbol,
    exports() {
      this.download(
        '/member/manager/center/export',
        { ...this.select },
        `${'安置数据'}-${new Date().getTime()}.xlsx`
      )
    },
    getUserRoute() {
      getRouters().then((res) => {
        res.data.forEach((item) => {
          this.topList.forEach((items) => {
            if (item.routeName == items.url) {
              items.changed = true
            }
          })
        })
      })
    },
    stateFormat,
    reset() {
      this.creationTime = ''
      this.select = {
        pkVertex: [],
        pkMemberTeam: [],
        dataTypes: []
      }
    },
    getMenu(e, id) {
      if (e && id == 0) {
        this.menuList.forEach((item) => {
          this.$set(item, 'checked', true)
        })
      } else if (!e && id == 0) {
        this.menuList.forEach((item) => {
          this.$set(item, 'checked', false)
        })
      }
    },
    getData() {
      getDataType().then((res) => {
        this.DataTypeList = res.data
      })
      getvertexValue().then((res) => {
        this.vertexList = res.data
      })
      getmemberTeamList().then((res) => {
        this.memberteamList = res.rows
      })
      getAwardsListChiose().then((res) => {
        this.awardsList = res.rows
      })
      api.accountList().then((res) => {
        this.acList = res.data
      })
      api.vertexList().then((res) => {
        this.verList = res.data
      })
      api.memberTeam().then((res) => {
        this.memberList = res.rows
      })
      getCountryFindAll().then((res) => {
        this.countryAllList = res.data
      })
    },
    changeTime(val) {
      if (val) {
        this.select.startDate = val[0]
        this.select.endDate = val[1]
      }
    },
    changeTime1(val) {
      this.select.startEffectDate = val[0]
      this.select.endEffectDate = val[1]
    },
    // 点击修改
    toFixed(id) {
      this.addOrEdit = false
      this.dialogVisible = true
      this.$router.push({
        path: 'noticeList/details',
        query: {
          pkId: id
        }
      })
    },
    handleCopy(index, row, indexs) {
      const list = row.detailVOList[indexs]
      let str = ''
      for (const key in list) {
        if (key != 'dataType' && key != 'dataTypeVal') {
          str += list[key] + ' '
        }
      }
      this.copyData = str
      this.copy(this.copyData)
    },
    handleCopy1(index, row) {
      const list = row.detailVOList
      let str = ''
      list.forEach((item)=>{
        for (const key in item) {
          if (key != 'dataType' && key != 'dataTypeVal') {
            str += item[key] + ' '
          }
        }
      })
      this.copyData = str
      this.copy(this.copyData)
    },
    copy(data) {
      const url = data
      const oInput = document.createElement('input')
      oInput.value = url
      document.body.appendChild(oInput)
      oInput.select() // 选择对象;
      console.log(oInput.value)
      document.execCommand('Copy') // 执行浏览器复制命令
      this.$message({
        message: '复制成功',
        type: 'success'
      })
      oInput.remove()
    },
    // 删除
    handleDelete(id) {
      this.$confirm('确认删除?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        api.classifyDel(id).then((res) => {
          this.getDataList()
        })
      })
    },
    onSubmit(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          let url = ''
          if (this.addOrEdit == true) {
            url = classifySave
          } else {
            url = classifyUpdate
          }
          url(this.form).then((res) => {
            if (res.code == 200) {
              this.$message({
                message: res.msg,
                type: 'success'
              })
              this.dialogVisible = false
              // 充值数据
              this.$refs[formName].resetFields()
              // 获取列表
              this.getDataList()
            }
          })
        } else {
          return false
        }
      })
    },
    handleClose() {
      this.dialogVisible = false
      this.$refs['form'].clearValidate()
      this.$refs['form'].resetFields()
    },
    openDig() {
      this.$router.push({
        path: 'noticeList/details'
      })
    },
    getDataList() {
      this.loading = true
      if (this.creationTime == '' || this.creationTime == null) {
        this.select.startDate = ''
        this.select.endDate = ''
      }
      // const date = {
      //   'memberCode': 'CN30720201',
      //   'startDate': '2023-05-05',
      //   'endDate': '2023-05-25',
      //   'dataTypes': [
      //     1,
      //     2
      //   ]
      // }
      api
        .getShowPlace(Object.assign({}, this.select), `?pageNum=${this.queryParams.pageNum}&pageSize=${this.queryParams.pageSize}`)
        .then((res) => {
          this.loading = false
          this.tableData.censusSummaryList = res.rows
          // this.total = res.total
        })
    },
    handleSelectionChange(val) {},
    /** 导出按钮操作 */
    handleExport() {
      this.$confirm('是否确认导出所有数据项?', '警告', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then((_) => {
        this.download(
        '/member/manager/center/export',
        { ...this.select },
        `${'安置数据'}-${new Date().getTime()}.xlsx`
      )
      })
     
    },
    tableRowClassName({ row, rowIndex }) {
      if (rowIndex % 2 == 1) {
        return 'warning-row'
      } else if (rowIndex % 2 == 0) {
        return 'success-row'
      }
      return ''
    }
  }
}
</script>
<style scoped lang="scss">
::v-deep .el-table .cell:nth-child(1){
  text-align: center;
}
::v-deep .el-table .cell{
  padding: 0!important;
}
.buttonStyleS{
  border: none;
  background: none;
  font-size: 14px;
  padding: 0 20px!important;
}
.color-s{
  //color: #108EE9;
}
.border-s{
  border-bottom:  1px solid rgba(0,0,0,0.1);
}
::v-deep .el-range-editor.el-input__inner{
  width: 100%;
}
::v-deep .el-button{
  //height: 32px;
  //line-height: 32px;
  padding: 8px 20px;
}
::v-deep .el-date-editor .el-range__close-icon{
  margin-top: -10px;
}
::v-deep .el-date-editor .el-range-separator{
  margin-top: -10px;
}
::v-deep .el-date-editor .el-range__icon{
  margin-top: -10px;
}
::v-deep .el-input__inner{
  //height:28px;
  //line-height: 28px;
}
::v-deep .el-form-item{
  margin-bottom: 0;
}
::v-deep .el-form-item__label{
  color: #333;
  font-weight: inherit;
}

::v-deep .el-table .warning-row {
  background: #f9f9f9;
}

::v-deep .el-table .success-row {
  background: #ffffff;
}
::v-deep .el-table thead {
  color: #000000;
}
::v-deep .el-select {
  width: 100%;
}
.uploadIcon ::v-deep .el-upload--picture-card {
  display: none !important; /* 上传按钮隐藏 */
}
.page {
  padding: 20px;
  background: #f9f9f9;
  font-size: 14px;
  .main {
    background: #f9f9f9;
    //border-radius: 8px;
    //box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
    .maintop {
      display: flex;
      //padding: 10px 20px;
      //padding: 10px 0;
      justify-content: space-between;
      align-items: center;
      .mainbtn {
        .thebtn1 {
          background: #3181e5;
          color: #ffffff;
        }
        .thebtn2 {
          background: #ffad41;
          color: #ffffff;
        }
      }
      .maintitle {
        font-size: 10px;
        font-family: MicrosoftYaHei;
        color: #999999;
      }
    }
  }
  .tem {
    display: flex;
    align-items: center;
    justify-content: center;
    img {
      width: 28px;
      height: 20px;
      margin-right: 3px;
    }
  }
  .isRed {
    color: #ed1d25;
  }
  .isGreen {
    color: #1ab62b;
  }
  .bgImg {
    width: 48px;
    height: 48px;
  }
}
.openClose {
  text-align: right;
  margin-right: 10px;
  color: #3181e5;
}
.kuang {
  padding: 5px 20px;
  background: rgba(255, 255, 255, 0);
  border-radius: 4px;
  border: 1px solid #cccccc;
}
.heji {
  margin-top: 10px;
  .dis {
    display: flex;
    justify-content: right;
    padding: 5px 10px;
    font-size: 14px;
    color: #333333;
    :nth-child(1) {
      font-size: 14px;
      font-weight: bold;
      color: #333333;
      margin-right: 20px;
    }
  }
}
</style>
