<template>
  <div class="customer-wrap">
    <div>
      <el-radio-group class="header-radio" v-model="selectedTab" @input="handleTabChange">
        <el-radio-button label="2" :disabled="isPrivate" :class="{ 'btn-disabled': isPrivate }">企业</el-radio-button>
        <el-radio-button label="1" :disabled="isPublic" :class="{ 'btn-disabled': isPublic }">商户</el-radio-button>
        <el-radio-button label="0" :disabled="isPublic" :class="{ 'btn-disabled': isPublic }">个人</el-radio-button>
      </el-radio-group>
      <el-row :gutter="24" style="flex-wrap: wrap;padding: 0 30px;">
        <el-col :span="this.shyh == '总行' ? 8 : 12" v-if="this.shyh != '客户经理'">
          <el-card class="box-card">
            <div class="my-span-checklist-header">

              <span class="my-span-checklist-title">我创建的营销清单</span>

              <span @click="handleWdAll" class="viewAll" v-if="this.shyh != '客户经理'">查看全部
                <i class="el-icon-arrow-right"></i>
              </span>
            </div>
            <div class="my-span-checklist-content">
              <div class="my-span-checklist-content-item" v-for="(item, index) in groupTag" :key="index"
                @click="handleCheckCustomerList(item, '我的')">{{ item.campaignName
                }}</div>
            </div>
          </el-card>
        </el-col>
        <el-col :span="this.shyh == '总行' ? 8 : this.shyh == '支行' ? 12 : 24">
          <el-card class="box-card">
            <div class="my-span-checklist-header">
              <span class="my-span-checklist-title">推送给我的营销清单</span>
              <span @click="handleTsAll" :class="{ active: currentTable === 1 }" class="viewAll"
                v-if="this.shyh != '总行'">查看全部
                <i class="el-icon-arrow-right"></i>
              </span>
            </div>

            <div class="my-span-checklist-content">
              <div class="my-span-checklist-content-item" v-for="(item, index) in groupTag2" :key="index"
                @click="handleCheckCustomerList(item, '推荐')">{{
                  item.campaignName }}</div>
            </div>
          </el-card>
        </el-col>
        <el-col :span="8" v-if="this.shyh == '总行'">
          <el-card class="box-card">
            <div class="my-span-checklist-header">
              <span class="my-span-checklist-title">其他的营销清单</span>
              <span @click="handleOtherAll" :class="{ active: currentTable === 1 }" class="viewAll">查看全部
                <i class="el-icon-arrow-right"></i>
              </span>
            </div>

            <div class="my-span-checklist-content">
              <div class="my-span-checklist-content-item" v-for="(item, index) in groupTag3" :key="index"
                @click="handleCheckCustomerList(item, '其他')">{{
                  item.campaignName }}</div>
            </div>
          </el-card>
        </el-col>
      </el-row>
      <el-row :gutter="24">
        <section class="main-wrap">
          <section class="search-box" v-if="showSearch">
            <section class="search-cnt">
              <el-input v-model="searchQuery" placeholder="输入客户号/证件号/手机号/网格名称" clearable
                @keyup.enter.native="handleSearch" @clear="handleSearch">
              </el-input>
              <section class="search-btn" @click="handleSearch">
                <i class="el-icon-search"></i>
              </section>
            </section>
          </section>
          <el-form ref="" :model="searchFrom" label-width="130px" v-if="this.shyh == '总行'" class="searchForm">
            <el-row :gutter="24">
              <el-col :span="7">
                <el-form-item label="客户经理认领状态">
                  <el-select v-model="searchFrom.custClaimStatus" @change="handleSearchChange" clearable>
                    <el-option v-for="(item, index) in rlList" :key="index" :label="item.label"
                      :value="item.value"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="7">
                <el-form-item label="推送支行" v-if="this.qdzt == '我的'">
                  <el-cascader v-model='searchFrom.belongDept' :options="departOptions" @change="handleSearchChange"
                    clearable :props="{ expandTrigger: 'hover', label: 'label', value: 'label', checkStrictly: true }">
                  </el-cascader>
                </el-form-item>
                <el-form-item label="下发支行" v-if="this.qdzt == '其他'">
                  <el-cascader v-model='searchFrom.sendDept' :options="departOptions" clearable
                    @change="handleSearchChange"
                    :props="{ expandTrigger: 'hover', label: 'label', value: 'id', checkStrictly: true }">
                  </el-cascader>
                </el-form-item>
              </el-col>
              <el-col :span="7">
                <el-form-item label="推送网点">

                  <el-input v-model="searchFrom.outlets" @keyup.enter.native="handleSearch" clearable
                    @clear="handleSearch"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="3" style="line-height: 38px;">
                <span v-if="!this.isZk" @click="handleZk" class="zhk">展开<i class="el-icon-arrow-down"></i></span>
                <span v-if="this.isZk" @click="handleSq" class="zhk">收起<i class="el-icon-arrow-up"></i></span>
              </el-col>
            </el-row>
            <el-row :gutter="24" v-if="this.isZk">
              <el-col :span="7">
                <el-form-item label="推送客户经理">
                  <el-input v-model="searchFrom.userName" @keyup.enter.native="handleSearch" clearable
                    @clear="handleSearch"></el-input>
                </el-form-item>
              </el-col>

            </el-row>
            <el-row>
              <el-col class="queryBtn">
                <el-button type="primary" @click="handleQuery" size="small">查询</el-button>
                <el-button @click="handleRest" size="small">重置</el-button>
              </el-col>
            </el-row>
          </el-form>
          <el-form ref="" :model="searchFrom" label-width="130px" v-if="this.shyh == '支行'" class="searchForm">
            <el-row :gutter="24">
              <el-col :span="7">
                <el-form-item label="推送网点">
                  <el-input v-model="searchFrom.outlets" @keyup.enter.native="handleSearch" clearable
                    @clear="handleSearch"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="7">
                <el-form-item label="推送客户经理">
                  <el-input v-model="searchFrom.userName" @keyup.enter.native="handleSearch" clearable
                    @clear="handleSearch"></el-input>
                </el-form-item>
              </el-col>
              <el-col class="queryBtn" :span="7">
                <el-button type="primary" @click="handleQuery" size="small">查询</el-button>
                <el-button @click="handleRest" size="small">重置</el-button>
              </el-col>
            </el-row>
          </el-form>
          <!-- <el-form ref="" :model="searchFrom" label-width="130px" v-if="this.shyh == '客户经理'" class="searchForm">
            <el-row :gutter="24">
              <el-col :span="7">
                <el-form-item label="推送一级网络">
                  <el-input v-model="searchFrom.topGridName" @keyup.enter.native="handleSearch" clearable
                    @clear="handleSearch"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="7">
                <el-form-item label="推送二级网络">
                  <el-input v-model="searchFrom.secGridName" @keyup.enter.native="handleSearch" clearable
                    @clear="handleSearch"></el-input>
                </el-form-item>
              </el-col>
              <el-col class="queryBtn">
                <el-button type="primary" @click="handleQuery" size="small">查询</el-button>
                <el-button @click="handleRest" size="small">重置</el-button>
              </el-col>
            </el-row>
            <el-row>
             
            </el-row>
          </el-form> -->
          <section class="moddle-btn">
            <div>
              <el-button @click="handleGoBank">返回上一级</el-button>
              <el-button type="primary" @click="custExport">批量导出</el-button>
              <el-button type="warning" @click="custClaminMore" v-if="isclaimmore">批量认领</el-button>
              <el-button :disabled="true" v-if="isremind">批量提醒</el-button>
              <el-button @click="handleNotCliamedCust" :loading="buttonLoading"
                v-if="ishandleNotCliamedOrg">未认领客户</el-button>
            </div>
            <right-toolbar :showSearch.sync="showSearch" @queryTable="initTableData" :columns="columns"></right-toolbar>
          </section>
          <section class="table-wrap">
            <el-table :data="tableData" style="width: 100%" ref="table1" @selection-change="handleSelectionChange"
              v-if="this.shyh == '总行'">
              <el-table-column type="selection" label="全选"></el-table-column>
              <el-table-column prop="createRole" label="清单来源" align="center" sortable v-if="columns[0].visible" :key="0"
                width="100">
                <template slot-scope="scope">
                  {{ scope.row.createRole == '0' ? '总行' : '支行' }}
                </template>
              </el-table-column>
              <el-table-column prop="sendDept" label="下发支行" sortable width="100"
                v-if="columns[22].visible && this.qdzt == '其他'" :key="22"></el-table-column>
              <el-table-column prop="groupName" label="清单名称" sortable v-if="columns[1].visible" width="100"
                :key="1"></el-table-column>
              <el-table-column prop="campaignName" label="任务名称" sortable v-if="columns[2].visible" width="100"
                :key="2"></el-table-column>
              <el-table-column prop="checkTarget" label="考核目标" sortable v-if="columns[24].visible" width="100"
                :key="24"></el-table-column>
              <el-table-column prop="custId" label="客户号" sortable v-if="columns[3].visible" :key="3"
                width="100"></el-table-column>
              <el-table-column prop="custIsn" label="客户内码" sortable v-if="columns[4].visible" :key="4"
                width="100"></el-table-column>

              <el-table-column prop="custName" label="商户名称" sortable v-if="this.selectedTab == '1' && columns[21].visible"
                :key="21" width="100"></el-table-column>
              <el-table-column prop="custName" label="企业名称" sortable v-if="this.selectedTab == '2' && columns[23].visible"
                :key="23" width="100"></el-table-column>
              <el-table-column :prop="this.selectedTab == '0' ? 'custName' : 'lpName'" :label="tabColName" sortable
                v-if="columns[5].visible" :key="5" width="130"></el-table-column>
              <el-table-column prop="custPhone" :label="tabColPhone" sortable v-if="columns[6].visible" :key="6"
                width="140"></el-table-column>
              <el-table-column :prop="this.selectedTab == '0' ? 'custIdc' : 'socialCreditCode'" label="证件号" sortable
                v-if="columns[7].visible" :key="7" width="100"></el-table-column>
              <el-table-column prop="startTime" label="开始时间" sortable v-if="columns[8].visible" :key="8" width="100">
                <template slot-scope="scope">
                  <span>{{ scope.row.startTime.substring(0, 10) }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="endTime" label="结束时间" sortable v-if="columns[9].visible" :key="9" width="100">
                <template slot-scope="scope">
                  <span>{{ scope.row.endTime.substring(0, 10) }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="campaignDegree" label="紧急程度" sortable v-if="columns[10].visible" width="100"
                :key="10"></el-table-column>

              <el-table-column prop="claimType" label="认领类型" sortable v-if="columns[12].visible" :key="12" width="100">
                <template slot-scope="scope">
                  {{ scope.row.claimType == '0' ? '强制认领' : '可选认领' }}
                </template>
              </el-table-column>
              <el-table-column prop="orgClaimStatus" label="机构认领状态" sortable
                v-if="columns[13].visible && this.qdzt == '我的'" :key="13" width="130">
                <template slot-scope="scope">
                  <span v-if="scope.row.orgClaimStatus == '0'">待认领</span>
                  <span v-else-if="scope.row.orgClaimStatus == '1'">已认领</span>
                  <span v-else>{{ scope.row.orgClaimStatus }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="orgDistributeStatus" label="机构分配状态" sortable
                v-if="columns[14].visible && this.qdzt == '我的'" :key="14" width="130">
                <template slot-scope="scope">
                  <span v-if="scope.row.orgDistributeStatus == '0'">待分配</span>
                  <span v-else-if="scope.row.orgDistributeStatus == '1'">已分配</span>
                  <span v-else>{{ scope.row.orgDistributeStatus }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="custClaimStatus" label="客户经理认领状态" sortable v-if="columns[15].visible" :key="15"
                width="150">
                <template slot-scope="scope">
                  <span v-if="scope.row.custClaimStatus == '0'">待认领</span>
                  <span v-else-if="scope.row.custClaimStatus == '1'">已认领</span>
                  <span v-else>{{ scope.row.custClaimStatus }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="belongDept" label="推送支行" sortable width="100"
                v-if="columns[16].visible && this.qdzt == '我的'" :key="16"></el-table-column>
              <el-table-column prop="outlets" label="推送网点" sortable v-if="columns[17].visible" width="100"
                :key="17"></el-table-column>
              <el-table-column prop="userName" label="推送客户经理" sortable v-if="columns[20].visible" :key="20"
                width="130"></el-table-column>

              <el-table-column prop="operate" label="操作" width="200px" fixed="right">
                <template slot-scope="scope">
                  <div>
                    <template>
                      <el-button type="text" @click="handleBox(scope.row.custId)">查看详情</el-button>
                    </template>
                  </div>
                </template>
              </el-table-column>
            </el-table>
            <el-table :data="tableData" style="width: 100%" ref="table1" @selection-change="handleSelectionChange"
              v-if="this.shyh == '支行'">
              <el-table-column type="selection" label="全选"></el-table-column>
              <el-table-column prop="createRole" label="清单来源" align="center" sortable v-if="columns[0].visible" :key="0"
                width="100">
                <template slot-scope="scope">
                  {{ scope.row.createRole == '0' ? '总行' : '支行' }}
                </template>
              </el-table-column>
              <el-table-column prop="sendDept" label="下发支行" sortable width="100"
                v-if="columns[22].visible && this.qdzt == '其他'" :key="22"></el-table-column>
              <el-table-column prop="groupName" label="清单名称" sortable v-if="columns[1].visible" width="100"
                :key="1"></el-table-column>
              <el-table-column prop="campaignName" label="任务名称" sortable v-if="columns[2].visible" width="100"
                :key="2"></el-table-column>
              <el-table-column prop="checkTarget" label="考核目标" sortable v-if="columns[24].visible" width="100"
                :key="24"></el-table-column>
              <el-table-column prop="custId" label="客户号" sortable v-if="columns[3].visible" :key="3"
                width="100"></el-table-column>
              <el-table-column prop="custIsn" label="客户内码" sortable v-if="columns[4].visible" :key="4"
                width="100"></el-table-column>

              <el-table-column prop="custName" label="商户名称" sortable v-if="this.selectedTab == '1' && columns[21].visible"
                :key="21" width="100"></el-table-column>
              <el-table-column prop="custName" label="企业名称" sortable v-if="this.selectedTab == '2' && columns[23].visible"
                :key="23" width="100"></el-table-column>
              <el-table-column :prop="this.selectedTab == '0' ? 'custName' : 'lpName'" :label="tabColName" sortable
                v-if="columns[5].visible" :key="5" width="130"></el-table-column>
              <el-table-column prop="custPhone" :label="tabColPhone" sortable v-if="columns[6].visible" :key="6"
                width="140"></el-table-column>
              <el-table-column :prop="this.selectedTab == '0' ? 'custIdc' : 'socialCreditCode'" label="证件号" sortable
                v-if="columns[7].visible" :key="7" width="100"></el-table-column>
              <el-table-column prop="startTime" label="开始时间" sortable v-if="columns[8].visible" :key="8" width="120">
                <template slot-scope="scope">
                  <span>{{ scope.row.startTime.substring(0, 10) }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="endTime" label="结束时间" sortable v-if="columns[9].visible" :key="9" width="120">
                <template slot-scope="scope">
                  <span>{{ scope.row.endTime.substring(0, 10) }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="campaignDegree" label="紧急程度" sortable v-if="columns[10].visible" width="100"
                :key="10"></el-table-column>

              <el-table-column prop="claimType" label="认领类型" sortable v-if="columns[12].visible" :key="12" width="100">
                <template slot-scope="scope">
                  {{ scope.row.claimType == '0' ? '强制认领' : '可选认领' }}
                </template>
              </el-table-column>
              <el-table-column prop="orgClaimStatus" label="机构认领状态" sortable
                v-if="columns[13].visible && this.qdzt == '推送'" :key="13" width="130">
                <template slot-scope="scope">
                  <span v-if="scope.row.orgClaimStatus == '0'">待认领</span>
                  <span v-else-if="scope.row.orgClaimStatus == '1'">已认领</span>
                  <span v-else>{{ scope.row.orgClaimStatus }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="orgDistributeStatus" label="机构分配状态" sortable
                v-if="columns[14].visible && this.qdzt == '推送'" :key="14" width="130">
                <template slot-scope="scope">
                  <span v-if="scope.row.orgDistributeStatus == '0'">待分配</span>
                  <span v-else-if="scope.row.orgDistributeStatus == '1'">已分配</span>
                  <span v-else>{{ scope.row.orgDistributeStatus }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="custClaimStatus" label="客户经理认领状态" sortable v-if="columns[15].visible" :key="15"
                width="150">
                <template slot-scope="scope">
                  <span v-if="scope.row.custClaimStatus == '0'">待认领</span>
                  <span v-else-if="scope.row.custClaimStatus == '1'">已认领</span>
                  <span v-else>{{ scope.row.custClaimStatus }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="outlets" label="推送网点" sortable v-if="columns[17].visible" width="100"
                :key="17"></el-table-column>
              <el-table-column prop="userName" label="推送客户经理" sortable v-if="columns[20].visible" :key="20"
                width="130"></el-table-column>

              <el-table-column prop="operate" label="操作" width="200px">
                <template slot-scope="scope">
                  <div>
                    <template>
                      <el-button type="text" @click="handleBox(scope.row.custId)">查看详情</el-button>
                    </template>

                  </div>
                </template>
              </el-table-column>
            </el-table>
            <el-table :data="tableData" style="width: 100%" ref="table1" @selection-change="handleSelectionChange"
              v-if="this.shyh == '客户经理'">
              <el-table-column type="selection" label="全选"></el-table-column>
              <el-table-column prop="createRole" label="清单来源" align="center" sortable v-if="columns[0].visible" :key="0"
                width="100">
                <template slot-scope="scope">
                  {{ scope.row.createRole == '0' ? '总行' : '支行' }}
                </template>
              </el-table-column>
              <el-table-column prop="groupName" label="清单名称" sortable v-if="columns[1].visible" width="100"
                :key="1"></el-table-column>
              <el-table-column prop="campaignName" label="任务名称" sortable v-if="columns[2].visible" width="100"
                :key="2"></el-table-column>
              <el-table-column prop="checkTarget" label="考核目标" sortable v-if="columns[24].visible" width="100"
                :key="24"></el-table-column>
              <el-table-column prop="custId" label="客户号" sortable v-if="columns[3].visible" :key="3"
                width="100"></el-table-column>
              <el-table-column prop="custIsn" label="客户内码" sortable v-if="columns[4].visible" :key="4"
                width="100"></el-table-column>

              <el-table-column prop="custName" label="商户名称" sortable v-if="this.selectedTab == '1' && columns[21].visible"
                :key="21" width="100"></el-table-column>
              <el-table-column prop="custName" label="企业名称" sortable v-if="this.selectedTab == '2' && columns[23].visible"
                :key="23" width="100"></el-table-column>
              <el-table-column :prop="this.selectedTab == '0' ? 'custName' : 'lpName'" :label="tabColName" sortable
                v-if="columns[5].visible" :key="5" width="130"></el-table-column>
              <el-table-column prop="custPhone" :label="tabColPhone" sortable v-if="columns[6].visible" :key="6"
                width="140"></el-table-column>
              <el-table-column :prop="this.selectedTab == '0' ? 'custIdc' : 'socialCreditCode'" label="证件号" sortable
                v-if="columns[7].visible" :key="7" width="100"></el-table-column>
              <el-table-column prop="startTime" label="开始时间" sortable v-if="columns[8].visible" :key="8" width="100">
                <template slot-scope="scope">
                  <span>{{ scope.row.startTime.substring(0, 10) }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="endTime" label="结束时间" sortable v-if="columns[9].visible" :key="9" width="100">
                <template slot-scope="scope">
                  <span>{{ scope.row.endTime.substring(0, 10) }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="campaignDegree" label="紧急程度" sortable v-if="columns[10].visible" width="100"
                :key="10"></el-table-column>
              <el-table-column prop="claimType" label="认领类型" sortable v-if="columns[12].visible" :key="12" width="100">
                <template slot-scope="scope">
                  {{ scope.row.claimType == '0' ? '强制认领' : '可选认领' }}
                </template>
              </el-table-column>
              <el-table-column prop="custClaimStatus" label="认领状态" sortable v-if="columns[13].visible" :key="13"
                width="130">
                <template slot-scope="scope">
                  <span v-if="scope.row.custClaimStatus == '0'">待认领</span>
                  <span v-else-if="scope.row.custClaimStatus == '1'">已认领</span>
                  <span v-else>{{ scope.row.custClaimStatus }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="userName" label="推送客户经理" sortable v-if="columns[20].visible" :key="20"
                width="130"></el-table-column>
              <el-table-column prop="operate" label="操作" width="200px" fixed="right">
                <template slot-scope="scope">
                  <div>
                    <template>
                      <el-button type="text" @click="handleBox(scope.row.custId)"
                        v-if="scope.row.claimType == '0'">去营销</el-button>
                      <el-button type="text" @click="handleBox(scope.row.custId)"
                        v-if="scope.row.claimType == '1'">查看详情</el-button>
                    </template>
                    <span v-if="scope.row.claimType == '1'&&isOutletShow" style="margin-left:10px ;">
                      <el-button type="text"
                        :disabled="scope.row.claimType == '1' && scope.row.custClaimStatus == '1'"
                        @click="custClaminOne(scope.row.custId, scope.row.groupId, scope.row.campaignId, scope.row.custPattern)">认领</el-button>
                    </span>

                  </div>
                </template>
              </el-table-column>
            </el-table>
            <!-- 分页区域 -->
            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
              :page-sizes="[10, 20, 30, 40]" :page-size="pageSize" layout="->,total,prev,pager,next,sizes" :total="total"
              :current-page="pageNum"></el-pagination>
          </section>
        </section>
      </el-row>

    </div>
    <el-dialog :title="pushTitle" :visible.sync="pushOpen" width="600px" append-to-body>
      <el-form ref="pushform" :model="pushform" :rules="pushroles" label-width="80px" :disabled="ispushformread">
        <el-row>
          <el-col :span="24">
            <el-form-item label="分群名称" prop="groupName">
              <el-input v-model="pushform.groupName" :disabled="true" maxlength="30" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="任务名称" prop="campaignName">
              <el-input v-model="pushform.campaignName" placeholder="请输入任务名称" maxlength="30" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="活动类型" prop="campaignType" style="flex: 1">
              <el-select v-model="pushform.campaignType" placeholder="请选择活动类型" width="100%">
                <el-option label="走访" value="走访"></el-option>
                <el-option label="电话" value="电话"></el-option>
                <el-option label="短信" value="短信"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="紧急程度" prop="campaignDegree" style="flex: 1">
              <el-select v-model="pushform.campaignDegree" placeholder="请选择紧急程度">
                <el-option label="高" value="高"></el-option>
                <el-option label="中" value="中"></el-option>
                <el-option label="低" value="低"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="认领类型" prop="claimType" style="flex: 1">
              <el-select v-model="pushform.claimType" placeholder="请选择认领类型" width="100%">
                <el-option label="强制认领" value="0"></el-option>
                <el-option label="可选认领" value="1"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <!-- 活动时间 -->
          <el-col :span="24">
            <el-form-item label="活动时间" prop="dateRange" style="flex: 1">
              <el-date-picker width="100%" v-model="pushform.dateRange" type="daterange" range-separator="至"
                start-placeholder="开始日期" end-placeholder="结束日期">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="认领时间" prop="claimdateRange" style="flex: 1">
              <el-date-picker width="100%" v-model="pushform.claimdateRange" type="daterange" range-separator="至"
                start-placeholder="开始日期" end-placeholder="结束日期">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- <el-row>
                    <el-col :span="24">
                        <el-form-item label="执行人" prop="executer" style="flex: 1;">
                            <el-radio-group v-model="pushform.executer" width="100%">
                                <el-radio label="0">机构</el-radio>
                                <el-radio label="1">个人</el-radio>
                                <el-radio label="2">混合分配</el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
                </el-row> -->
        <el-row>
          <el-col :span="24">
            <el-form ref="pushform" :model="pushform" :rules="pushroles" label-width="80px">
              <el-form-item label="分配规则" prop="distributeType" style="flex: 1">
                <el-radio-group v-model="pushform.distributeType" width="100%" @change="handleRadioGroup">
                  <el-radio label="0">手动指定</el-radio>
                  <el-radio label="1">按照客户归属机构</el-radio>
                  <el-radio label="2">按照地址归属</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-form>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="handleAllocateCustomerList">确 定</el-button>
        <el-button @click="
          () => {
            this.pushOpen = false;
          }
        ">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  findchecknamelist,
  findcheckcustomerlist,
  findchecklist,
  orgClaimList,
  allocateCustomerList,
  exportCustData,
  findCustDetail,
  custClaimCustomer
} from '@/api/system/checklist.js'
import { isHead, campaignDetail } from '@/api/system/findCustByGroupId.js'
import { campaignAdd } from '@/api/system/campaign.js'
import { getUserProfile } from '@/api/grid/anchor.js'
import { Message } from 'element-ui'
import { getDeptTree } from "@/api/grid/address/tree.js";
import { download } from '@/utils/request.js'
import { mapGetters } from 'vuex'

export default {
  data() {
    return {
      tabColName: '客户姓名',
      tabColPhone: '手机号',
      buttonLoading: false,
      isHead: false,
      isFindDetail: true,
      ishandleNotCliamedOrg: true,
      ishandleNotCliamedClick: false,
      isclaimmore: false,
      isremind: true,
      departOptions: [],
      rlList: [
        { label: '待认领', value: '0' },
        { label: '已认领', value: '1' }
      ],
      isRl: false,
      columns: [
        { key: 0, label: '清单来源', visible: true },
        { key: 1, label: '清单名称', visible: true },
        { key: 2, label: '任务名称', visible: true },
        { key: 3, label: '客户号', visible: true },
        { key: 4, label: '客户内码', visible: true },
        { key: 5, label: '客户姓名', visible: true },
        { key: 6, label: '手机号', visible: true },
        { key: 7, label: '证件号', visible: true },
        { key: 8, label: '开始时间', visible: true },
        { key: 9, label: '结束时间', visible: true },
        { key: 10, label: '紧急程度', visible: true },
        { key: 11, label: '执行机构', visible: true },
        { key: 12, label: '认领类型', visible: true },
        { key: 13, label: '机构认领状态', visible: true },
        { key: 14, label: '机构分配状态', visible: true },
        { key: 15, label: '客户经理认领状态', visible: true },
        { key: 16, label: '推送支行', visible: true },

        { key: 17, label: '推送网点', visible: true },
        { key: 18, label: '推送一级网络', visible: true },
        { key: 19, label: '推送二级网络', visible: true },
        { key: 20, label: '推送客户经理', visible: true },
        { key: 21, label: '商户名称', visible: true },
        { key: 22, label: '下发支行', visible: true },
        { key: 23, label: '企业名称', visible: true },
        { key: 24, label: '考核目标', visible: true },
      ],
      pushOpen: false,
      pushroles: {
        groupName: [
          { required: true, message: '分群名称不能为空', trigger: 'blur' },
          {
            min: 2,
            max: 20,
            message: '分群名称长度必须介于 2 和 20 之间',
            trigger: 'blur'
          }
        ],
        campaignName: [
          { required: true, message: '任务名称不能为空', trigger: 'blur' },
          {
            min: 2,
            max: 20,
            message: '任务名称长度必须介于 2 和 20 之间',
            trigger: 'blur'
          }
        ],
        campaignType: [{ required: true, message: '请选择活动类型' }],
        campaignDegree: [{ required: true, message: '请选择紧急程度' }],
        claimType: [{ required: true, message: '请选择认领类型' }],
        dateRange: [{ required: true, message: '请选择活动时间' }],
        claimdateRange: [{ required: true, message: '请选择认领时间' }],
        executer: [{ required: true, message: '请选择执行人' }],
        distributeType: [{ required: true, message: '请选择分配规则' }]
      },
      groupType: '0',
      pushform: {
        groupName: '',
        claimType: '',
        campaignDegree: '',
        campaignType: '',
        campaignName: '',
        executer: {},
        distributeType: {},
        claimdateRange: [],
        dateRange: []
      },
      pushOpen: false,
      pushTitle: '创建活动',
      radiosButonIsDisableFromMe: false,
      radiosButonIsDisableToMe: false,
      userType: '0',
      showmap: false,
      total: 0,
      pageSize: 10,
      currentPage: 1,
      isCreatePag: false,
      groupFlag: '1',
      groupTable: [],
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      searchQuery: '',
      showCreateDialog: false,
      selectedCreateType: '',
      isCreatePage: false,
      tableData: [],
      groupId: '',
      createRole: '',
      campaignId: '',
      ispushformread: false,
      pushformDetail: {},
      selectList: [],
      istogetit: false,
      groupTag: [],
      groupTag2: [],
      groupTag3: [],
      groupId: '',
      campaignId: '',
      todistribute: false,
      createRole: '',
      total: 0,
      pageSize: 10,
      isclaimone: false,
      pageNum: 1,
      showtable: false,
      currentTable: 1,
      selectedTab: '2', // 当前选中的选项
      searchQuery: '',
      custPattern: 0,
      personalData: [],
      merchantData: [],
      enterpriseData: [],
      myPersonalData: [],
      myMerchantData: [],
      myEnterpriseData: [],
      claimType: '',
      custClaimStatus: '',
      selectedIds: [],
      isOutletShow:true,
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        custPattern: 0
      },
      selectedRows: [],
      searchFrom: {
        custClaimStatus: '',
        belongDept: '',
        sendDept: '',
        outlets: '',
        topGridName: '',
        secGridName: '',
        userName: '',
      },
      statusList: [
        { label: '待认领', value: '0' },
        { label: '已认领', value: '1' }
      ],
      isZk: false,
      qdzt: '',
      shyh: '',
    }
  },

  created() {

    this.isUserType()
    this.initDeptTree()
  },
  computed: {
    ...mapGetters(['roles']),
    //对公
    isPublic() {
      return this.roles.includes('headPublic')
    },
    //对私
    isPrivate() {
      return this.roles.includes('headPrivate')
    }
  },
  methods: {
    getUser() {
      getUserProfile().then(res => {
        let deptId = res.data.dept.deptId
        this.initDeptTree(deptId)
      })
    },
    initDeptTree(deptId) {
      getDeptTree(deptId).then(res => {
        this.departOptions = res.data
      })
    },
    handleZk() {
      this.isZk = true
    },
    handleSq() {
      this.isZk = false
    },
    handleWdAll() {
      
      this.$router.push({
        path: '/taskManage/checklist', query: {
          custPattern: this.selectedTab,
          groupType:'0',
        }
      })
    },
    handleTsAll() {
      this.$router.push({
        path: '/taskManage/checklist', query: {
          custPattern: this.selectedTab,
          groupType:'1',
        }
      })
    },
    handleOtherAll() {
      this.$router.push({
        path: '/taskManage/checklist', query: {
          custPattern: this.selectedTab,
          groupType:'2',
        }
      })
    },
    handleQuery() {
      this.initTableData()
    },
    handleRest() {
      this.searchFrom = {}
      this.initTableData()
    },
    custClaminMore() {
      if (this.selectList && this.selectList.length == 0) {
        Message.warning('请先选择客户')
        return
      } else {
        if (this.selectList && this.selectList.length > 0) {
          let arr = this.selectList.map(item => item.custClaimStatus)
          if (arr.includes('1')) {
            Message.warning('请选择未认领的客户')
          } else {
            let selectedCustIds = this.selectList.map((item) => item.custId)
            custClaimCustomer({
              custIds: selectedCustIds.join(','),
              groupId: this.groupId,
              campaignId: this.campaignId
            }).then((res) => {
              console.log('this.custPattern====', this.custPattern);
              if (res.code == 200) {
                Message.success('认领成功')

                this.initTableData()
                this.isclaimone = true;
                this.$refs.table1.clearSelection()
              }
            })
          }
        }

      }


    },
    custClaminOne(id, groupId, campaignId, custPattern) {
      custClaimCustomer({
        custIds: id,
        groupId: groupId,
        campaignId: campaignId
      }).then((res) => {
        if (res.code == 200) {
          console.log('this.custPattern====', this.custPattern);
          Message.success('认领成功')
          this.isclaimone = true;
          this.initTableData()
          this.$refs.table1.clearSelection()
        }
      })
    },
    custExport() {
      console.log(this.$route.query.deptId, 'this.$route.query.deptId')
      if (this.selectList.length == 0) {
        Message.warning('请先指定客户导出')
      }
      else {
        let selectedCustIds = this.selectList.map((item) => item.custId)
        if (this.deptId) {
          this.download(
            `/system/listselectlist/export?deptId=${this.deptId}&custPattern=${this.selectedTab}&campaignId=${this.campaignId}&groupId=${this.groupId}&custIds=${selectedCustIds.join(',')}`,
            {},
            `checklist_customer_${new Date().getTime()}.xlsx`
          )
          Message.success('导出成功!')
          this.$refs.table1.clearSelection()
        } else {
          this.download(
            `/system/listselectlist/export?groupId=${this.groupId}&custPattern=${this.selectedTab}&campaignId=${this.campaignId}&custIds=${selectedCustIds.join(',')}`,
            {},
            `checklist_customer_${new Date().getTime()}.xlsx`
          )
          Message.success('导出成功!')
          this.$refs.table1.clearSelection()
        }

      }
    },
    // custInfoExport() {

    // },
    handleSelectionChange(selection) {

      this.selectList = selection

    },
    handleBox(custId) {
      this.$router.push({
        path: '/checklist/details',
        query: { custId: custId, type: this.selectedTab }
      })
    },

    handleGoBank() {
      this.$router.push({
        path: '/taskManage/checklist', query: {
          custPattern: this.selectedTab,
          groupType: this.groupType,
        }
      })
    },
    handleRadioGroup(value) {
      localStorage.setItem('distributeType', value)
    },
    handleAllocateCustomerList() {
      allocateCustomerList({
        campaignId: localStorage.getItem('campaignId'),
        distributeType: localStorage.getItem('distributeType'),
        groupId: localStorage.getItem('groupId')
      }).then((res) => {
        if (res.code == 200) {
          Message.success('支行管理员二次分配成功!')
          this.pushOpen = false
          this.findchecklist()
        }
      })
    },
    handleInfoSubmit() {
      this.isPushBtn = false
      this.$refs['pushform'].validate((valid) => {
        if (valid) {
          const startTime = this.formatDate(this.pushform.dateRange[0])
          const endTime = this.formatDate(this.pushform.dateRange[1])
          const claimStartTime = this.formatDate(this.pushform.claimdateRange[0])
          const claimEndTime = this.formatDate(this.pushform.claimdateRange[1])
          const queryParams = {}
          queryParams.startTime = startTime
          queryParams.endTime = endTime
          queryParams.claimStartTime = claimStartTime
          queryParams.claimEndTime = claimEndTime
          queryParams.groupId = this.groupId
          queryParams.campaignName = this.pushform.campaignName
          queryParams.campaignType = this.pushform.campaignType
          queryParams.campaignDegree = this.pushform.campaignDegree
          queryParams.executer = this.pushform.executer
          queryParams.distributeType = this.pushform.distributeType
          queryParams.claimType = this.pushform.claimType
          queryParams.createRole = this.createRole

          campaignAdd(queryParams).then((res) => {
            if (res.code == '200') {
              Message.success(`分群${this.pushform.groupName}活动创建成功!`)
              this.pushOpen = false
            }
          })
        } else {
          console.error('新增失败', error)
        }
      })
    },
    initTagList() {
      findchecklist({
        custPattern: this.custPattern,
        groupId: this.groupId,
        // groupType: this.groupType,
        pageNum: 1,
        pageSize: 100,
        isAsc: 'descending',
        // orderByColumn: 'updateTime'
      }).then((response) => {
        let arr1 = []
        let arr2 = []
        let arr3 = []

        response.rows.forEach(item => {
          if (item.groupType == '0') {
            arr1.push(item)
          } else if (item.groupType == '1') {
            arr2.push(item)
          } else if (item.groupType == '2') {
            arr3.push(item)
          }
        })
        if (arr1.length > 4) {
          this.groupTag = arr1.slice(0, 4)
        } else {
          this.groupTag = arr1
        }
        if (arr2.length > 4) {
          this.groupTag2 = arr2.slice(0, 4)
        } else {
          this.groupTag2 = arr2
        }
        if (arr3.length > 4) {
          this.groupTag3 = arr3.slice(0, 4)
        } else {
          this.groupTag3 = arr3
        }

      });
    },
    handlePushGroupCustomer(groupName, groupId, campaignId, groupType, orgDistribustStatus, orgClaimStatus) {
      if (orgClaimStatus == '1' && orgDistribustStatus == '1') {
        this.$router.push({
          path: '/groupBase/customerDetail',
          query: { groupId, groupName, campaignId, groupType }
        })
      }
      if (orgClaimStatus == '1' && orgDistribustStatus == '0') {
        this.pushOpen = true
        this.pushform.groupName = groupName
        this.groupId = groupId
        this.campaignId = campaignId
        localStorage.setItem('campaignId', campaignId)
        localStorage.setItem('groupId', groupId)
        // localStorage.setItem('distributeType',this.pushform.distributeType)
        campaignDetail({ campaignId: this.campaignId }).then((res) => {
          this.pushformDetail = res
          if (this.campaignId) {
            this.ispushformread = true
            if (this.ispushformread) {
              this.pushform.campaignName = this.pushformDetail.campaignName
              this.pushform.campaignDegree = this.pushformDetail.campaignDegree
              this.pushform.campaignType = this.pushformDetail.campaignType
              // this.pushform.executer = this.pushformDetail.executer;
              // this.pushform.distributeType = this.pushformDetail.distributeType;
              this.pushform.claimType = this.pushformDetail.claimType
              this.pushform.dateRange = [this.parseFormattedDate(this.pushformDetail.startTime), this.parseFormattedDate(this.pushformDetail.endTime)]
              this.pushform.claimdateRange = [
                this.parseFormattedDate(this.pushformDetail.claimStartTime),
                this.parseFormattedDate(this.pushformDetail.claimEndTime)
              ]
            }
          } else {
            this.ispushformread = false
          }
        })
      }
    },
    parseFormattedDate(formattedDateString) {
      const isoDateString = formattedDateString.replace(' ', 'T')
      const date = new Date(isoDateString)
      if (isNaN(date.getTime())) {
        return null
      }
      return date
    },
    handleorgDistributeStatus(status, status2) {
      if (status2 == '0' && status == '0') {
        return false
      }
      if (status2 == '1' && status == '1') {
        return true
      }
      if (status2 == '1' && status == '0') {
        return true
      }
    },
    handleorgClaimStatus(status) {
      return status != '0'
    },
    generateRowKey(row) {
      return `${row.groupId}_${Math.random().toString(36).substring(7)}`
    },
    handleorgClaim(groupId, campaignId) {
      orgClaimList({ groupId, campaignId }).then((res) => {
        if (res.code == 200) {
          Message.success('机构客户认领成功!')
          this.initTableData()
        }
      })
    },
    isUserType() {
      isHead().then((res) => {

        if (Object.keys(res)[0] == 'headAdmin') {
          this.createRole = '1'
          this.isremind = true
          this.ishandleNotCliamedOrg = true
          this.isclaimmore = false
          this.shyh = '总行'
          this.groupType = 0
          this.qdzt == '我的'
        } else if (Object.keys(res)[0]=='branchAdmin') {
          this.createRole = '0'
          this.isremind = true
          this.ishandleNotCliamedOrg = true
          this.isclaimmore = false
          this.shyh = '支行'
          this.groupType = 0
          this.qdzt == '我的'
        } else if (Object.keys(res)[0] == 'manager') {
          this.createRole = '2'
          this.isremind = false
          this.ishandleNotCliamedOrg = false
          this.isclaimmore = true
          this.shyh = '客户经理'
          this.groupType = 1
          this.qdzt == '推送'
        } else if (Object.keys(res)[0] == 'private') {
          this.createRole = '1'
          this.isremind = true
          this.ishandleNotCliamedOrg = true
          this.isclaimmore = false
          this.shyh = '总行'
          this.groupType = 0
          this.qdzt == '我的'
        } else if (Object.keys(res)[0] == 'public') {
          this.createRole = '1'
          this.isremind = true
          this.ishandleNotCliamedOrg = true
          this.isclaimmore = false
          this.shyh = '总行'
          this.groupType = 0
          this.qdzt == '我的'
        } else if(Object.keys(res)[0] == 'outlet'){
          this.createRole = '2'
          this.isremind = false
          this.ishandleNotCliamedOrg = false
          this.isclaimmore = true
          this.isOutletShow = false
          this.shyh = '客户经理'
          this.groupType = 1
          this.qdzt == '推送'
        }else if(Object.keys(res)[0] == 'ops'){
          this.createRole = '1'
          this.isremind = true
          this.ishandleNotCliamedOrg = true
          this.isclaimmore = false
          this.shyh = '总行'
          this.groupType = 0
          this.qdzt == '我的'
        }
      })
    },
    handleNotCliamedCust() {
      this.ishandleNotCliamedClick = !this.ishandleNotCliamedClick;

      if (this.ishandleNotCliamedClick == true) {
        this.searchFrom.custClaimStatus = '0'
        this.initTableData()
      }
      else {
        this.searchFrom.custClaimStatus = undefined
        this.initTableData()
      }

    },
    handleSizeChange(newSize) {
      this.pageSize = newSize
      this.initTableData()
      // this.handleSearch()
    },
    handleCurrentChange(newPage) {
      // console.log(newPage);
      this.pageNum = newPage
      this.initTableData()
      // this.handleSearch()
    },
    handleCheckCustomerList(item, type) {

      if (type == '我的') {
        this.groupType = '0'
      } else if (type == '推荐') {
        this.groupType = '1'
      } else if (type == '其他') {
        this.groupType = '2'
      }
      this.$router.push({
        path: '/taskManage/checklist', query: {
          custPattern: this.selectedTab,
          groupType: this.groupType,
        }
      })
    },
    // 处理搜索
    handleSearch() {
      this.initTableData()
    },
    formatDate(dateString) {
      const date = new Date(dateString)
      return date.toISOString().slice(0, 19).replace('T', ' ')
    },

    handleTabChange() {
      this.groupType = '0'
      this.qdzt = '我的'
      this.searchFrom = {}
      if (this.selectedTab == '0') {
        this.tabColName = '客户姓名'
        this.tabColPhone = '手机号'
        this.custPattern = 0
        // this.initTableData()
        // this.initTagList()
      } else if (this.selectedTab == '1') {
        this.tabColName = '经营者姓名'
        this.tabColPhone = '经营者手机号'
        this.custPattern = 1
        // this.initTableData()
        // this.initTagList()
      } else if (this.selectedTab == '2') {
        this.tabColName = '法人代表姓名'
        this.tabColPhone = '法人代表手机号'
        this.custPattern = 2
        // this.initTableData()
        // this.initTagList()
      }
      this.$router.push({
        path: '/taskManage/checklist', query: {
          custPattern: this.selectedTab,
          groupType: this.groupType,
        }
      })
    },
    initTableData() {
      const params = {
        ...this.searchFrom,
        custPattern: this.custPattern,
        campaignId: this.campaignId,
        groupType: this.groupType,
        groupId: this.groupId,
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        custName: this.searchQuery,
        isAsc: 'descending',
        deptId: this.deptId
      }

      params.belongDept = params.belongDept ? params.belongDept[params.belongDept.length - 1] : ''
      findcheckcustomerlist(params).then((res) => {
        console.log(res);
        this.tableData = res.rows
        this.total = res.total
      })
    },
    handleSearchChange() {
      this.initTableData()
    },
    initTabaLabel() {
      if (this.selectedTab == '0') {
        this.tabColName = '客户姓名'
        this.tabColPhone = '手机号'
        this.custPattern = 0
      } else if (this.selectedTab == '1') {
        this.tabColName = '经营者姓名'
        this.tabColPhone = '经营者手机号'
        this.custPattern = 1
      } else if (this.selectedTab == '2') {
        this.tabColName = '法人代表姓名'
        this.tabColPhone = '法人代表手机号'
      }
    },
  },
  mounted() {
    // 初始化表格数据

    const groupId = this.$route.query.groupId
    this.custPattern = this.$route.query.custPattern
    this.selectedTab = this.$route.query.custPattern
    const campaignId = this.$route.query.campaignId
    this.qdzt = this.$route.query.qdzt
    this.groupType = this.$route.query.groupType
    this.deptId = this.$route.query.deptId
    this.campaignId = campaignId
    this.groupId = groupId
    localStorage.setItem('groupId', groupId)
    this.initTabaLabel()
    this.isUserType()
    this.initTableData()
    this.initTagList()
    // findcheckcustomerlist({custPattern:'0'}).then(res=> {
    //     console.log(res);
    // })
  }
}
</script>

<style lang="scss" scoped>
.main-wrap {
  margin: 0 30px;
}

.remind-more {
  width: 108px;
  height: 36px;
  background: #4886f8;
  border-radius: 1px;
  color: #ffffff;
  font-family: PingFangSC-Regular;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0;
  line-height: 14px;
  margin-bottom: 25px;
}

.checklist-btn2 {
  width: 108px;
  height: 36px;
  background: #4886f80f;
  border-radius: 1px;
  color: #4886f8;
  font-family: PingFangSC-Regular;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0;
  line-height: 14px;
  margin-left: 12px;
  margin-bottom: 25px;
}

.checklist-btn3 {
  width: 108px;
  height: 36px;
  background: #4886f80f;
  border-radius: 1px;
  color: #4886f8;
  font-family: PingFangSC-Regular;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0;
  line-height: 14px;
  margin-left: 12px;
  margin-bottom: 25px;
}

.my-span-checklist-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.my-span-checklist-content-item {
  cursor: pointer;
  width: 45%;
  height: 44px;
  padding: 20px;
  text-align: left;
  font-size: 14px;
  background-color: #ffffff;
  font-weight: 200;
  border-radius: 5px;
  margin-top: 15px;
  line-height: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.box-card {
  height: 181px;
  background: #EAF5FF;
  border-radius: 8px;
  margin-top: 25px;
}

.box-card1 {
  height: 181px;
  background: #EAF5FF;
  border-radius: 8px;
  margin-top: 25px;
}

.my-span-checklist-header {
  display: flex;
  justify-content: space-between;
}

.my-span-checklist-title {
  height: 25px;
  font-family: PingFangSC-SNaNpxibold;
  font-weight: 600;
  font-size: 18px;
  color: #222222;
  letter-spacing: 0.5px;
}

.zhk {
  cursor: pointer;
}

.customer-wrap {
  background-color: #ffffff;
  overflow: hidden;
  box-shadow: 0 3px 8px 0 #00000017;
  border-radius: 16px 16px 0 0;

  .header-radio {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #ebebeb;

    .btn-disabled {
      ::v-deep .el-radio-button__inner {
        background-color: #e7e7e7;
      }
    }

    .el-radio-button {
      flex: 1;

      ::v-deep .el-radio-button__inner {
        width: 100%;
        border: none;
        font-weight: 400;
        letter-spacing: 0.44px;
        line-height: 25px;
        font-size: 16px;
        color: #666666;
        padding: 11px 0 12px 0;
      }

      ::v-deep .el-radio-button__orig-radio:checked+.el-radio-button__inner {
        background-color: #4886f8;
        font-weight: 400;
        color: #ffffff;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
      }

      &:nth-child(2) {

        &::before,
        &::after {
          content: '';
          position: absolute;
          top: 50%;
          transform: translateY(-50%);
          height: 21px;
          width: 1px;
          background: #ebebeb;
          z-index: 1;
        }

        &::after {
          right: 1px;
        }
      }

      &.is-active {

        &::before,
        &::after {
          content: none;
        }
      }
    }
  }

  .queryBtn {
    text-align: right;
    margin-right: 20px;
    margin-bottom: 20px;
  }

  .search-box {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 24px 0 0 0;

    .search-cnt {
      position: relative;
      width: 70%;
    }

    ::v-deep .el-input {
      width: 100%;
      position: relative;

      .el-input__inner {
        height: 44px;
        line-height: 44px;
        border-radius: 23px;
        border: 1px solid #ebebeb;
        padding-left: 30px;
      }

      .el-input__suffix {
        right: 85px;
      }
    }

    .search-btn {
      width: 80px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      position: absolute;
      right: 0;
      top: 2px;
      border: 1px solid #4886f8;
      background-color: #4886f8;
      border-radius: 20px;
      cursor: pointer;
      z-index: 1;

      .el-icon-search {
        color: #ffffff;
        font-size: 14px;
      }
    }
  }
}

.box-card {
  height: 181px;
  border-radius: 8px;
  margin-top: 25px;

}

.viewAll {
  cursor: pointer;
  height: 20px;
  font-family: PingFangSC-Regular;
  font-weight: 400;
  font-size: 14px;
  color: #959da6;
  letter-spacing: 0;
}

.box-card1 {
  width: 785px;
  height: 181px;
  background: #f8fbff;
  border-radius: 8px;
  margin-top: 25px;
  margin-left: 50px;
}

.my-span-checklist-title {
  height: 25px;
  font-family: PingFangSC-SNaNpxibold;
  font-weight: 600;
  font-size: 18px;
  color: #222222;
  letter-spacing: 0.5px;

}

.my-checkall {
  width: 56px;
  height: 20px;
  font-family: PingFangSC-Regular;
  font-weight: 400;
  font-size: 14px;
  color: #959da6;
  letter-spacing: 0;
}


.operate-cnt {
  margin: 24px 0 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;

  .plain-raido-btn {
    ::v-deep .el-radio-button__inner {
      color: #666666;
      font-size: 14px;
      font-weight: 400;
      border: 1px solid #ebebeb;
      border-radius: 0;
    }

    ::v-deep .el-radio-button__orig-radio:checked+.el-radio-button__inner {
      border: 1px solid #4886f8;
      color: #4886f8;
      background-color: #ffffff;
      box-shadow: none;
    }
  }
}

.searchForm {
  margin-top: 15px;
}

.moddle-btn {
  margin: 16px 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
</style>