<template>
    <div class="channel">
      <!-- <Spin size="large" fix v-if="spinShow" style="font-size:20px">加载中...</Spin> -->
      <div class="channel-left">
          <Form :label-width="90" style="width:88%;margin:0 auto;" class='emailForm'>
            <FormItem label="关键词：" style="margin-top:20px">
                <Input placeholder="请输入关键词" style="width:98%" v-model="keywords" @keyup.enter.native="SouSuo(item.Num1,item.Num2,item.Num3)"/>
            </FormItem>
            <FormItem label="历任公司：">
                <Input placeholder="请输入历任公司" style="width:98%" v-model="lrgs" @keyup.enter.native="SouSuo(item.Num1,item.Num2,item.Num3)"/>
            </FormItem>
            <FormItem label="性别：" class="sex">
                <span  v-for="(item,index) in sexs"  :class="{'active3':index==clickIndex1}" @click="selectElement1(item.status1,index)" :key="index" style="cursor:pointer"> {{item.status1}}</span>
            </FormItem>
            <FormItem label="学历：" class="Education">
                <span  v-for="(item,index) in Education"  :class="{'active3':index==clickIndex2}" @click="selectElement2(item.Num2,index)" :key="index" style="cursor:pointer"> {{item.status2}}</span>
            </FormItem>
            <FormItem label="状态：" class="state">
                <span  v-for="(item,index) in state"  :class="{'active3':item.sta==true}"  @click="selectElement3(item.Num3,index,item.status3,item.sta)" :key="index" style="cursor:pointer"> {{item.status3}}</span>
            </FormItem>
            <FormItem label="工作年限：" style="">
                <span style="width:100px">
                    <Select style="width:40%"  placeholder="不限"  :label-in-value='true' v-model="searchInfo.ownerWorkYears1" @on-change="judge1">
                      <Option v-for="item in ownerWorkYears1" :value="item.value" :key="item.value">{{item.label}}</Option>
                    </Select>
                    <span>-</span>
                    <Select style="width:40%" placeholder="不限" :label-in-value='true' v-model="searchInfo.ownerWorkYears2" @on-change="judge2">
                        <Option v-for="item in ownerWorkYears2" :value="item.value" :key="item.value">{{item.label}}</Option>
                    </Select>
                </span><br>
            </FormItem>
          </Form>
          <Button type="primary" style="width:30%;margin-left:34%;font-size:13px" @click="SouSuo(item.Num1,item.Num2,item.Num3)">搜索</Button>
      </div>
      <div class="channel-right">
          <div class="resumeRightContentTop">
              <div style="width:100%;height:80px;margin-top:20px;display:none">
                  <div style="width:47%;height:100%;float:left;background:rgb(61,169,247);margin-left:1%;line-height:80px;text-align:center;color:white;font-size:20px">数据展示</div>
                  <div style="width:48%;height:100%;float:left;background:rgb(253,85,83);margin-left:3%;line-height:80px;text-align:center;color:white;font-size:20px">提示语</div>
              </div>
              <div style="background:WhiteSmoke;width:100%;height:40px;" class='bar'>
                    <input   type='checkbox' class='selectAll' v-model='checked' @click='checkedAll'  style="margin-left:10px;cursor:pointer;">
                    <span  style="margin-left:5px;position:relative;">选择<Badge :count="interviewee.length" size='small' :class='["badge",{"badges1":interviewee.length>9, "badges": interviewee.length>99}]'></Badge></span>
                    <Button  type="primary" size="small" style="margin-left:4%;width:50px" @click="downloadAll">下载</Button>
                    <Button  type="primary" size="small" style="margin-left:2%;width:50px" @click="delateAll">删除</Button>
                    <Button  type="primary" size="small" style="margin-left:2%;" @click="transpond">
                   转发面试官
                   </Button>
                    <Button  type="primary" size="small" class='left'  @click="allexport">导出列表</Button>
                    <Button  type="primary" size="small" class='left leftBtn' @click="sendEmail(1)">邀请面试</Button>
              </div>
              <div style="margin-bottom:40px;float:left;width:100%;overflow-y: auto;height:100%" class="a">
              <div style="margin:50px auto;width:300px;height:200px;line-height:200px;text-align:center;font-size:20px;color:LightGray" v-show="ajaxData.length==0">暂无数据</div>
              <div class="Resumecontent"  v-for='(item,i) in ajaxData' :key="i">
                 <div class="detailResume" id="a" @mousemove="ahove(i,item.isShow)" @mouseleave="movleave(i,item.isShow)" :class="{red:item.isShow, grey: i%2!=0}"  >
                    <p class="massage" style="margin-left:10px;">  
                      <span style="display:inline-block;height:100%;font-size: 12px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap;margin-top:5px" class='inputcheck'>
                        <input type='checkbox' name='checkboxinput' style="cursor:pointer" class='input-checkbox' v-model='checkboxList' :value="item.id" @click="selectInputElement(i,item.id,item.flowStatus,item.STATES, item)"></span>
                      <span style="display:inline-block;height:100%;font-size: 12px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap;cursor:pointer" @click="Seedetail(item.id,item.uid,item.flowStatus)">{{item.ownerName}}  |</span>
                      <span style="display:inline-block;height:100%;font-size: 12px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap;cursor:pointer" @click="Seedetail(item.id,item.uid,item.flowStatus)"> {{item.ownerMobile}}  |</span>
                      <span style="display:inline-block;height:100%;font-size: 12px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap;cursor:pointer" @click="Seedetail(item.id,item.uid,item.flowStatus)"> {{item.ownerAge}}岁  |</span>
                      <span style="display:inline-block;height:100%;font-size: 12px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap;cursor:pointer" @click="Seedetail(item.id,item.uid,item.flowStatus)"> {{item.ownerSex||'&nbsp;'}}  |</span>
                      <span style="display:inline-block;height:100%;font-size: 12px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap;cursor:pointer" @click="Seedetail(item.id,item.uid,item.flowStatus)"> {{item.ownerWorkYears}}年  |</span>
                      <span style="display:inline-block;height:100%;font-size: 12px;margin-top:5px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap;cursor:pointer" @click="Seedetail(item.id,item.uid,item.flowStatus)"> {{item.ownerHighestDegree||'&nbsp;'}} <span v-show="item.ownerExpectTitles !==''">|</span></span>
                      <span style="display:inline-block;height:100%;font-size: 12px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap;width:25%;cursor:pointer" @click="Seedetail(item.id,item.uid,item.flowStatus)"> {{item.ownerExpectTitles}}</span>
                      <span style="display:inline-block;height:100%;font-size: 12px;float:right;text-align:right;margin-right:10px;width:25%;line-height:100%;margin-top:5px;">
                            <span style="margin-right:30px;margin-top:5px;" v-if="item.flowStatus=='INTERVIEW_OK'" class='status'><Icon type="ios-radio-button-on"  style="color:#43CD80" /><span style="margin-left:10px">面试合适</span></span>
                            <span style="margin-right:30px;margin-top:5px" v-else-if="item.flowStatus=='INTERVIEW_FAIL'" class='status'><Icon type="ios-radio-button-on" style="color:red"  /><span style="margin-left:10px" >面试淘汰</span></span>
                            <span style="margin-right:30px;margin-top:5px" v-else-if="item.flowStatus=='TO_RESULT'" class='status'><Icon type="ios-radio-button-on" style="color:red"  /><span style="margin-left:10px" >面试结果待定</span></span>
                            <span style="margin-right:30px;margin-top:5px" v-else-if="item.flowStatus=='END'" class='status'><Icon type="ios-radio-button-on"  style="color:red" /><span style="margin-left:10px" >终止面试</span></span>
                            <span style="margin-right:30px;margin-top:5px" v-else-if="item.flowStatus=='SEE_FAIL'" class='status'><Icon type="ios-radio-button-on" style="color:red" /><span style="margin-left:10px" >约面失败</span></span>
                             <span style="margin-right:30px;margin-top:5px" v-else-if="item.flowStatus=='ARRIVED'" class='status'><Icon type="ios-radio-button-on" style="color:#43CD80" /><span style="margin-left:10px" >已到达</span></span>
                            <span style="margin-right:30px;margin-top:5px" v-else-if="item.flowStatus=='NO_ENTRY'" class='status'><Icon type="ios-radio-button-on" style="color:red" /><span style="margin-left:10px">未入职</span></span>
                            <span style="margin-right:30px;margin-top:5px;" v-else-if="item.flowStatus=='TO_SEE'" class='status'>
                              <span style="text-align:left;cursor:pointer" >
                                <select name="3" id="3" @change="selectFn2($event,item.id)"  style="height:18px;text-align:center;margin-top:5px">
                                  <option value="1">邀请面试</option>
                                  <option value="2">备选</option>
                                  <option value="3">PASS</option>
                                  <option value="4">待处理</option>
                                </select>
                              </span>
                            </span>
                            <span style="margin-right:30px;margin-top:5px" v-else-if="item.flowStatus=='HAS_SEE'" class='status'><Icon type="ios-radio-button-on" style="color:#43CD80" /><span style="margin-left:10px" >已邀约</span></span>
                            <span style="margin-right:20px;margin-top:5px;" v-else-if="item.flowStatus=='OPTION'" class='status'>
                              <span>
                                <select name="4" id="4" @change="selectFn3($event,item.id)"  style="height:18px;text-align:center;margin-top:5px;cursor:pointer">
                                  <option value="1">备选</option>
                                  <option value="2">邀请面试</option>
                                  <option value="3">PASS</option>
                                  <option value="4">待处理</option>
                                </select>
                              </span>
                            </span>
                            <span style="margin-right:20px;margin-top:5px" v-else-if="item.flowStatus=='TO_SENT_OFFER'" class='status'><Icon type="ios-radio-button-on" style="color:#43CD80" /><span style="margin-left:10px" >待Offer</span></span>
                            <span style="margin-right:20px;margin-top:5px" v-else-if="item.flowStatus=='HAS_SENT_OFFER'" class='status'><Icon type="ios-radio-button-on" style="color:#43CD80"  /><span style="margin-left:10px">已发Offer</span></span>
                            <span style="margin-right:20px;margin-top:5px" v-else-if="item.flowStatus=='TO_ENTRY'" class='status'><Icon type="ios-radio-button-on" style="color:#43CD80" /><span style="margin-left:10px" >待入职</span></span>
                            <span style="margin-right:20px;margin-top:5px" v-else-if="item.flowStatus=='HAS_ENTRY'" class='status'><Icon type="ios-radio-button-on" style="color:#43CD80" /><span style="margin-left:10px">已入职</span></span>
                            <span style="margin-right:20px;margin-top:5px;" v-else-if="item.flowStatus=='PASS'" class='status'>
                              <span class='status'>
                                <select name="2" id="2" @change="selectFn4($event,item.id)"  style="height:18px;text-align:center;margin-top:5px;cursor:pointer">
                                  <option value="1">PASS</option>
                                  <option value="2">邀请面试</option>
                                  <option value="3">备选</option>
                                  <option value="4">待处理</option>
                                </select>
                              </span>
                            </span>
                            <select name="1" id="a"  @change="selectFn1($event,item.id)"  v-else-if="item.flowStatus=='TO_DO'" style="height:20px;margin-top:5px;margin-right:20px;text-align:center;cursor:pointer" class='status'>
                                <option value="1">待处理</option>
                                <option value="2">pass</option>
                                <option value="3">邀请面试</option>
                                <option value="4">备选</option>
                            </select>
                                <span class='record'><Icon type="md-download" @click="downloadONE(item.id)" style="font-size:15px;cursor:pointer;color:#0092FF"/></span>
                                <span class='record'><Icon  type="md-trash" v-if="item.flowStatus=='TO_SEE'"  @click="undelate" style="color:#b5b5b5;cursor:pointer;font-size:15px"/></span>
                                <span class='record'><Icon  type="md-trash" v-if="item.flowStatus=='HAS_SEE'"  @click="undelate" style="color:#b5b5b5;cursor:pointer;font-size:15px"/></span>
                                <span class='record'><Icon  type="md-trash" v-if="item.flowStatus=='SEE_FAIL'"  @click="undelate" style="color:#b5b5b5;cursor:pointer;font-size:15px"/></span>
                                <span class='record'><Icon  type="md-trash" v-if="item.flowStatus=='INTERVIEW_FAIL'"  @click="undelate" style="color:#b5b5b5;cursor:pointer;font-size:15px"/></span>
                                <span class='record'><Icon  type="md-trash" v-if="item.flowStatus=='TO_SENT_OFFER'"  @click="undelate" style="color:#b5b5b5;cursor:pointer;font-size:15px"/></span>
                                <span class='record'><Icon  type="md-trash" v-if="item.flowStatus=='TO_ENTRY'"  @click="undelate" style="color:#b5b5b5;cursor:pointer;font-size:15px"/></span>
                                <span class='record'><Icon  type="md-trash" v-if="item.flowStatus=='HAS_ENTRY'"  @click="undelate" style="color:#b5b5b5;cursor:pointer;font-size:15px"/></span>
                                <span class='record'><Icon  type="md-trash" v-if="item.flowStatus=='NO_ENTRY'"  @click="undelate" style="color:#b5b5b5;cursor:pointer;font-size:15px"/></span>
                                <span class='record'><Icon  type="md-trash" v-if="item.flowStatus=='END'"  @click="undelate" style="color:#b5b5b5;cursor:pointer;font-size:15px"/></span>
                                <span class='record'><Icon  type="md-trash" v-if="item.flowStatus=='HAS_SENT_OFFER'"  @click="undelate" style="color:#b5b5b5;cursor:pointer;font-size:15px"/></span>
                                <span class='record'><Icon  type="md-trash" v-if="item.flowStatus=='ARRIVED'"  @click="undelate" style="color:#b5b5b5;cursor:pointer;font-size:15px"/></span>
                                <span class='record'><Icon  type="md-trash" v-if="item.flowStatus=='PASS'"  @click="delateR(item.id)" style=";cursor:pointer;color:rgb(242, 93, 87);;font-size:15px;"/></span>
                                <span class='record'><Icon  type="md-trash" v-if="item.flowStatus=='OPTION'"  @click="delateR(item.id)" style="color:rgb(242, 93, 87);;font-size:15px;;cursor:pointer"/></span>
                                <span class='record'><Icon  type="md-trash" v-if="item.flowStatus=='TO_DO'"  @click="delateR(item.id)" style="color:rgb(242, 93, 87);;font-size:15px;;cursor:pointer"/></span>
                                <span @click="RecordSEE(item.id,item.ownerName)" style=";cursor:pointer;color:#2d8cf0;" class='recordtext'>记录</span>
                           </span>
                    </p>
                    <p style="margin-top:10px;color:Grey;padding-left:10px;" class='info'>
                     <span style="display:inline-block;font-size: 12px;color:orange" v-show="item.hasForward=='1'" class='transmit' >已转</span> 
                      <span style="display:inline-block;font-size: 12px;margin-left:20px;color:Grey" v-if="item.srcSite!==''" v-show="item.hasForward==null">{{item.deliveryTime}}投递  |</span> 
                      <span style="display:inline-block;font-size: 12px;margin-left:20px;color:Grey" v-if="item.srcSite==''"  v-show="item.hasForward==null">{{item.deliveryTime}}上传 <span v-show="item.optSource!==''">  |</span></span>
                      <span style="display:inline-block;font-size: 12px;margin-left:-2px;color:Grey" v-if="item.srcSite!==''" v-show="item.hasForward!==null">{{item.deliveryTime}}投递  |</span> 
                      <span style="display:inline-block;font-size: 12px;color:Grey;margin-left:-2px" v-if="item.srcSite==''" v-show="item.hasForward!==null">{{item.deliveryTime}}上传 <span v-show="item.optSource!==''">  |</span></span>
                      <span style="display:inline-block;font-size: 12px;margin-left:3px;color:Grey">{{item.optSource}}<span v-show="item.srcSite!==''">  |</span></span> 
                      <span style="display:inline-block;font-size: 12px;margin-left:3px;color:Grey">{{item.srcSite}}</span> 
                      <span style="display:inline-block;font-size: 12px;float:right;text-align:right;margin-right:10px;color:Grey;">
                          <span>{{item.modifyTime}}</span>
                          <span>最后操作人：{{item.d}}</span>
                      </span>
                    </p>
                 </div>
              </div>
        </div>
        <div class="pageBottom" style="width:100%;background:rgba(241,241,241,1);text-align:center;position:absolute;bottom:0;height:45px">
          <Page :total="totalSize" show-elevator show-total   @on-change="pageChange"  @on-page-size-change="pageSizeChange" :current='pageIndex' :page-size='pageSize' style="text-align:center;margin-top:4px"></Page>
        </div>
        </div>
       </div>
    <!-- 操作记录弹出框 -->
       <Modal
        v-model="modal1"
         width='500px'
        :footer-hide="true"
         :closable='false'>
        <div>
            <h2 style="text-align: center;color:black" >操作记录</h2>
            <h2 style="text-align: center;color:#999999">候选人:{{toseename}}</h2>
            <div v-for="(item,index) in recordList" :key="index">
                <p style="margin-top:30px;text-align:center" class="Recode">
                    <span>{{item.approveUserName}}</span>
                    <span>{{item.dateTime}}</span>
                    <span style="color:blue" v-if=" item.previousState=='INTERVIEW_OK'">面试合适</span>
                    <span style="color:blue" v-if=" item.previousState=='INTERVIEW_FAIL'">面试淘汰</span>
                    <span style="color:blue" v-if=" item.previousState=='END'">终止面试</span>
                    <span style="color:blue" v-if=" item.previousState=='SEE_FAIL'">约面失败</span>
                    <span style="color:blue" v-if=" item.previousState=='NO_ENTRY'">未入职</span>
                    <span style="color:blue" v-if=" item.previousState=='TO_SEE'">准备约面</span>
                    <span style="color:blue" v-if=" item.previousState=='HAS_SEE'">已邀约</span>
                    <span style="color:blue" v-if=" item.previousState=='OPTION'">备选</span>
                    <span style="color:blue" v-if=" item.previousState=='TO_SENT_OFFER'">待Offer</span>
                    <span style="color:blue" v-if=" item.previousState=='HAS_SENT_OFFER'">已发offer</span>
                    <span style="color:blue" v-if=" item.previousState=='TO_ENTRY'">待入职</span>
                    <span style="color:blue" v-if=" item.previousState=='HAS_ENTRY'">已入职</span>
                    <span style="color:blue" v-if=" item.previousState=='PASS'">PASS</span>
                    <span style="color:blue" v-if=" item.previousState=='TO_DO'">待处理</span>
                    <span style="color:blue" v-if=" item.previousState=='RESET'">重启面试</span>
                    <span style="color:blue" v-if=" item.previousState=='ARRIVED'">已到达</span>
                    <span>变更为</span>
                    <span style="color:blue" v-if=" item.afterState=='INTERVIEW_OK'">面试合适</span>
                    <span style="color:blue" v-if=" item.afterState=='INTERVIEW_FAIL'">面试淘汰</span>
                    <span style="color:blue" v-if=" item.afterState=='END'">终止面试</span>
                    <span style="color:blue" v-if=" item.afterState=='SEE_FAIL'">约面失败</span>
                    <span style="color:blue" v-if=" item.afterState=='NO_ENTRY'">未入职</span>
                    <span style="color:blue" v-if=" item.afterState=='TO_SEE'">准备约面</span>
                    <span style="color:blue" v-if=" item.afterState=='HAS_SEE'">已邀约</span>
                    <span style="color:blue" v-if=" item.afterState=='OPTION'">备选</span>
                    <span style="color:blue" v-if=" item.afterState=='TO_SENT_OFFER'">待Offer</span>
                    <span style="color:blue" v-if=" item.afterState=='HAS_SENT_OFFER'">已发offer</span>
                    <span style="color:blue" v-if=" item.afterState=='TO_ENTRY'">待入职</span>
                    <span style="color:blue" v-if=" item.afterState=='HAS_ENTRY'">已入职</span>
                    <span style="color:blue" v-if=" item.afterState=='PASS'">PASS</span>
                    <span style="color:blue" v-if=" item.afterState=='TO_DO'">待处理</span>
                    <span style="color:blue" v-if=" item.afterState=='RESET'">重启面试</span>
                    <span style="color:blue" v-if=" item.afterState=='ARRIVED'">已到达</span>
                </p>
            </div>
            
        </div>
        <div style="height:30px;width:100%;text-align:center;margin-top:30px">
            <Button type="primary" size='small' @click="modal1=false">关闭</Button>
        </div>
    </Modal>
    <!-- 准备约面弹出框 -->
    <Modal
        v-model="modal2"
         width='380px'
         :closable='false'>
        <div >
            <h2 style="text-align: center;color:black">提示</h2>
            <p style="margin-top:20px;line-height:25px">
                  <span>更改为<span style="color:blue">“邀请约面”</span>的状态后，你需要从<span style="color:blue">”面试管理“</span>中对该候选人进行后续的操作。</span>
            </p>
            <p style="margin-top:20px;line-height:25px">
                <Form :label-width="80" ref="formInline" :rules="ruleInline" :model="formInline">
                    <FormItem label="邀约人" style="margin-top:20px" prop="UpdateOWER">
                        <Input v-model="formInline.UpdateOWER" style="width:180px" :maxlength="5"/>
                    </FormItem>
                    <FormItem label="面试时间" style="margin-top:20px" prop="UpdateTIME">
                    <DatePicker type="datetime"  style="width:180px" v-model="formInline.UpdateTIME" format="yyyy-MM-dd HH:mm" @on-change="changeTime" :editable='false' :options="options3"></DatePicker>
                    </FormItem>
                    <FormItem label="面试官" style="margin-top:20px" prop="UpdateVIEW">
                        <Input v-model="formInline.UpdateVIEW" style="width:180px" :maxlength="5"/>
                    </FormItem>
                </Form>
            </p>
        </div>
        <div  slot='footer' style="text-align:center">
            <Button type='primary' @click='pushlist'>取消</Button>
            <Button type='primary' @click="addINTERVIEW" >确定</Button>
        </div>
    </Modal>
    <!-- 可删除状态下，删除提示框 -->
     <Modal
        v-model="modal3"
         width='280px'
         :closable='false'>
        <div >
            <h2 style="text-align: center;color:black">提示</h2>
            <p>删除后不可恢复，是否确定永久删除简历？</p>
        </div>
        <div  slot='footer' style="text-align:center">
            <Button type='primary' @click='modal3=false'>取消</Button>
            <Button type='primary' @click="delateONE" >确定</Button>
        </div>
    </Modal>
    <!-- 不可删除状态下，删除提示框 -->
    <Modal
        v-model="modal4"
         width='280px'
         :closable='false'>
        <div >
            <h2 style="text-align: center;color:black">提示</h2>
            <p>进入面试管理中的候选人，都不可删除。如需继续删除，请在面试管理中操作”终止面试“后，再重启流程，然后返回该页面进行删除。</p>
        </div>
        <div  slot='footer' style="text-align:center">
            <Button type='primary' @click='modal4=false'>取消</Button>
            <Button type='primary' @click="tointerview">面试管理</Button>
        </div>
    </Modal>
    <!-- 批量删除有不可删除状态时弹出框 -->
     <Modal
        v-model="modal5"
         width='280px'
         :closable='false'>
        <div >
            <h2 style="text-align: center;color:black">提示</h2>
            <p style="text-align: center;height:40px;line-height:40px">您选中的简历中包含不可删除简历</p>
        </div>
        <div  slot='footer' style="text-align:center">
            <Button type='primary' @click='modal5=false'>确定</Button>
        </div>
    </Modal>
    <Modal
        v-model="modal7"
         width='280px'
         :closable='false'>
        <div >
            <h2 style="text-align: center;color:black">提示</h2>
            <p>删除后不可恢复，是否确定永久删除简历？</p>
        </div>
        <div  slot='footer' style="text-align:center">
            <Button type='primary' @click='modal7=false'>取消</Button>
            <Button type='primary' @click="cofdelateAll" >确定</Button>
        </div>
    </Modal>
    <Modal
      v-model="modal12"
        width='450px'
        :closable='false'
        :footer-hide='true'
        :mask-closable='false'>
      <div style="text-align:center">
        <h2 style="text-align: center;color:black;font-size:16px">发送失败</h2>
        <p style="text-align: center;color:black;margin-top:15px;font-size:15px">该面试官没有通过微信端绑定账号，请提醒他关注并绑定。</p>
        <p style="text-align: center;color:#0092FF;margin-top:30px;font-size:15px;cursor:pointer;font-weight: 900" @click="modal12=false">我已知晓</p>
      </div>
    </Modal>
    <Modal
      v-model="modal13"
        width='480px'
        :closable='false'
        :footer-hide='true'
        :mask-closable='false'>
      <div style="text-align:center">
        <h2 style="text-align: center;color:black;font-size:16px">发送失败</h2>
        <p style="text-align: center;color:black;margin-top:15px;font-size:15px">该面试官没有关注微信，无法接收通知，请提醒他关注并绑定。</p>
        <p style="text-align: center;color:#0092FF;margin-top:30px;font-size:15px;cursor:pointer;font-weight: 900" @click="modal13=false">我已知晓</p>
      </div>
    </Modal>
    <!-- 发送邮件 -->
     <Modal
        v-model="emailMOdal"
         width='1000px'
         :mask-closable='false'
         :closable='false'
         :styles='{top: "50px"}'>
        <div >
            <h2 style="text-align:center;color:black" v-show="this.isShowAll==false">发送邮件</h2>
            <h2 style="text-align:center;color:black"  v-show="this.isShowAll==true">新建面试</h2>
            <h3 style="text-align:center;color:black"  v-show="this.isShowAll==true"> <span>新建面试后，你需要从<span style="color:#0092ff">“面试管理”</span>中对该候选人进行后续的操作。</span></h3>
        </div>
        <div class="emailModal-title">
          <div class="emailModalTitle-left">
            <p>
              <Form :label-width="70"  :model="emailInline" label-position="left" style="margin-left:5%" ref="emailInline" :rules="emailruleInline" class="emailForm">
                <FormItem label="选择模板" style="margin-top:20px" prop='moo'>
                  <Select style="width:95%" @on-change='getEmailContentValue' v-model="emailInline.moo" >
                      <Option  v-for="(item,index) in emailInline.modalArr" :key="index" :value="item.templateCode">{{item.templateName}}</Option>
                  </Select><br>
                  <!-- <span v-show="emailMassage==true">你尚未选择简历，请先选择简历</span> -->
                </FormItem>
                <FormItem label="收件人" style="margin-top:20px" prop='receiveEmail'>
                   <Input style="width:95%" v-model="emailInline.receiveEmail"  @on-focus='getfocus("emailInline","receiveEmail")'/>
                   <span style="position: absolute;left:0;top:30px;color:gray;font-size:12px;" v-show='!tip'>{{tipInfo}}</span>
                </FormItem>
                <FormItem label="抄送" style="margin-top:20px" prop='copyname'>
                  <Input style="width:95%" v-model="emailInline.copyname" @on-focus='getfocus("emailInline","copyname")'/>
                </FormItem>
                <FormItem label="主题" style="margin-top:20px" prop='theme'>
                    <Input  style="width:95%" v-model="emailInline.theme" @on-focus='getfocus("emailInline","theme")'/>
                </FormItem>
              </Form>
            </p>
          </div>
          <div class="emailModalTitle-right" v-show="interviewIsShow==true">
               <h3 style="text-align:center;margin-top:20px">请输入约面信息</h3>
               <Form :label-width="85" ref="formInline" :rules="ruleInline" :model="formInline" style="margin-top:35px" label-position="left" class="emailForm">
                    <FormItem label="邀约人" style="margin-top:20px" prop="UpdateOWER">
                        <Input v-model="formInline.UpdateOWER" style="width:100%" :maxlength="5" @on-focus='getfocus("formInline", "UpdateOWER")'/>
                    </FormItem>
                    <FormItem label="面试时间" style="margin-top:20px" prop="UpdateTIME">
                      <DatePicker type="datetime"  style="width:100%" v-model="formInline.UpdateTIME" format="yyyy-MM-dd HH:mm" @on-change="changeTime" :options="options3" :editable='false' @on-open-change='getfocus("formInline", "UpdateTIME", $event)'></DatePicker>
                    </FormItem>
                    <FormItem label="面试官" style="margin-top:20px" prop='UpdateVIEW'>
                       <Select v-model ='formInline.UpdateVIEW' filterable style='width:100%;' remote
                        :remote-method="remoteMethod"
                        :loading="loading1" placeholder='请输入面试官全名' clearable @on-open-change='getfocus("formInline", "UpdateVIEW", $event)'  ref='selList'>
                        <Option v-for='(item, index) in options' :key='index' :value='item.name' >{{item.name}}({{item.email}})</Option>
                     </Select>
                    </FormItem>
                </Form>
          </div>
        </div>
        <div class="ckeditor">
            <ckeditor :value='editorObject' ref='editor' :uploadUrl='uploadurl' height='300px' width='100%' style="margin-left:3%"></ckeditor>
        </div>
        <div class="uploadEnclosure">
            <p style="height:50px;">
              <span style="font-size:16px;display:inline-block;margin:20px 0 0 3%">添加附件</span>
              <span style="margin-left:500px">
                 <Upload
                    multiple
                    :before-upload='beforUpload'
                    action="//jsonplaceholder.typicode.com/posts/">
                 <Button  size='small' style="margin:-40px 0 0 95px" type="primary" @click="uploadFile">选择文件</Button>
                 </Upload>
               </span>
            </p>
            <p v-for="(item,index) in fileList" :key="index" style="height:30px;line-height:30px">
              <span style="margin-left:60px">{{item}}</span> 
              <span><Icon type="md-close" @click="delateFile(index)" style="font-size:16px;float:right;margin-right:80px" /></span>
            </p>
        </div>
        <div  slot='footer' style="text-align:center;position: relative;" class="Ubt">
            <Button type='primary' @click='emailModalPush'>取消</Button>
            <Button type='primary' @click='submit' v-show="this.isShowAll==false">发送</Button>
            <Button type='primary' @click='submit' v-show="this.isShowAll==true">添加并发送</Button>
            <Checkbox v-model="formInline.sendWeixin" class='wechat'><span>微信通知面试官</span></Checkbox>
        </div>
    </Modal>
    <Modal
        v-model="modal10"
         width='280px'
         :closable='false'>
        <div >
            <h2 style="text-align: center;color:black">提示</h2>
            <p style="text-align:center">确定要发送邮件吗？</p>
        </div>
        <div  slot='footer' style="text-align:center">
            <Button type='primary' @click='modal10=false'>取消</Button>
            <Button type='primary' @click="confireSendEmail" :disabled="!isDisable">确定</Button>
        </div>
    </Modal>
        <!-- 转发邮件 -->
    <Modal
        v-model="modal8"
         width='400'
         :closable='false'>
        <div style='min-height:300px;'>
          <div class='title'>
            <h2>转发给面试官</h2>
            <p class='hint'>该通知将以微信形式发送给面试官，面试官可通过微信筛选简历</p>
          </div>
          <Form ref="transpondFrom" :model="transpondFrom" :rules="transpondRule">
            <FormItem label='面试官' prop='interviewerName'>
             <Select v-model ='transpondFrom.interviewerName' filterable style='width:250px;' remote
                :remote-method="remoteMethod"
                :loading="loading1" placeholder='请输入面试官全名' clearable>
                <Option v-for='(item, index) in options' :key='index' :value='item.email'>{{item.name}}({{item.email}})</Option>
             </Select>
            </FormItem>
            <FormItem label='' prop='interviewee' >
              <div v-for='(item, index) in interviewee' :key='index' class='interviewee'>
                 <div class='pic'>
                  <Icon type="ios-close" size='25' style='color:red' @click='delInterviewee(item)'/>
                  <img src='https://o7oe0d6qz.qnssl.com/resume.png'></img>
                 </div>
                  <span style='overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width:100%;display: inline-block;'>{{item.ownerName}}</span>
              </div>
            </FormItem>
          </Form>
        </div>
        <div  slot='footer' style="text-align:center">
            <Button type='primary' @click='modal8=false'>取消</Button>
            <Button type='primary' @click="sendNotice" >发送</Button>
        </div>
    </Modal>
     <!-- 发送失败再次发送 -->
     <Modal
        v-model="modal11"
         width='350px'
         :closable='false'>
        <div >
            <h2 style="text-align: center;color:black">提示</h2>
            <p style="text-align:center;margin-top:10px;font-size: 14px;text-align:left;">{{errorInfo}}</p>
        </div>
        <div  slot='footer' style="text-align:center">
            <Button type='primary' @click='cancelSubmit'>取消</Button>
            <Button type='primary' @click="modal11=false">确定</Button>
        </div>
    </Modal>
    </div>
</template>
<script>
import moment from 'moment'
import {adoptOneSeeResumeList, serchList,downloadone,sousuoList,seedetail,PASS,OPTION,deleteREsume,downloadOne,exportLIST,recodeLIST,addinterview,TODORes,getEmailMoo,getEmailContent, sendEmail,findCompanyEmailByKey,forwardResume } from '../../api/resume.server.js'
import {Serchinterviewor} from '../../api/interview.server.js'
import {
  sapi
} from '../../config'
import{_debounce,_throttle, emailValidata, emailRule, vidte, validator} from '../../service/util.js'
import ckeditor from '../../components/ckeditor'
import {mapState} from 'vuex'
import localStorage from '../../service/localstorage.service'
export default {
  data(){
    return {
      modal11: false,
      interviewee: [],
      tip: false,
      tipInfo: '输入多个邮箱地址以英文”;“分隔',
      errorInfo: '',
      ruleInline: {
          UpdateOWER: [
              {  required: true, message: '邀约人不能为空', trigger: 'blur', validator: emailValidata.bind(this)}
          ],
          UpdateTIME: [
             {  required: true,  message: '面试时间不能为空', trigger: 'change', type:'date', validator: emailValidata.bind(this)}
          ],
           UpdateVIEW: [
             {  required: true,message: '面试官不能为空',  trigger: 'change', validator: emailValidata.bind(this)}
          ]
      },
      emailruleInline: {
        receiveEmail: [{required: true, trigger: 'blur', pattern: emailRule, validator: emailValidata.bind(this)}],
        theme: [{required: true, trigger: 'blur',message: '主题不能为空', validator: emailValidata.bind(this)}],
        copyname: [{required: false, trigger: 'blur', pattern: emailRule, validator: emailValidata.bind(this), empty: true}]
      },
      formInline:{
        UpdateOWER:'',
        UpdateTIME:'',
        UpdateVIEW:'',
        sendWeixin: true
      },
      editorObject: {type: '', value: ''},
      emailInline:{
        moo:'',
        modalArr:[],
        copyname:'',
        receiveEmail:'',//收件人
        theme:'',//主题
        Enclosure:[],//附件
        templateContent:'',//模板内容
      },
      transpondFrom: {
        interviewerName: ''
      },
      transpondRule: {
        interviewerName: [{required: true, trigger: 'blur', validator: validator.bind(this)}]
      },
      interviewerList: [{name: 'test', value: '1'}],
      loading1: false,
      options: [],
      limentName:0,
      emailMassage:false,
      allEmailVilitor:false,
      emailContent:'',
      emailFlowStatus:'',
      fileList:[],
      UpdateTIMETwo:'',
      uploadFileList:[],
      detailID:'',
      temp:'',
      uploadurl:`${sapi}/api/ckeditor/uploadImage?token=${localStorage.get('token')}&&backUrl=/getimage`,
      isShowAll:false,
      isShowTwo:false,
      isLimitSize:false,
      isDisable:true,
      disabledSingle:true,
      emailId:'',
      RescopyArr:[],
      interelement:'1',
      emailIdArr:[],
      attachFileList:[],
      flowStatusTT:'',
      sad:'',
      interviewIsShow:false,
      emailMOdal:false,
      a:[],
      checked: false,
      activeClass: 0,
      clickIndex1: 0,
      clickIndex2: 0,
      clickIndex3:0,
      pageT:'',
      spinShow:true,
      keywords:'',
      biaoshi:'',
      toseeid:'',
      options3: {
        disabledDate (date) {
          return date && date.valueOf() <Date.now()-3600*24*1000;
          }
      },
      Black:false,
      recordList:[],
      all:'all',
      lrgs:'',
      a:'',
      id:'',
      pageT:'',
      resumeDetailSta:'',
      modal1:false,
      modal2:false,
      modal3:false,
      modal4:false,
      modal5:false,
      modal7:false,
      modal8: false,
      modal10:false,
      modal12:false,
      modal13:false,
      optcode:'',
      toseename:'',
      // UpdateOWER:'',
      // UpdateTIME:'',
      // UpdateVIEW:'',
      item:[],
      delateARRALL:[],
      delateARRALL2:[],
      flowStatusarr:[],
      quanxuan:[],
      orignarr:['TO_SEE','HAS_SEE','SEE_FAIL','INTERVIEW_FAIL','TO_SENT_OFFER','TO_ENTRY','HAS_ENTRY','NO_ENTRY','END','ARRIVED'],
      totalSize:0,
      pageSize:30,
      pageIndex:1,
      searchInfo:{
        pageSize:30,
        pageIndex:1,
        id:'',
        SEX:'',
        Edu:'',
        ccc:'',
        itemSelect:'',
        STA:[],
        status:"",
        ownerWorkYears1:'',
        ownerWorkYears2:'',
      },
      arr:[],
      sexs:[{Num1:'',status1:'不限'},{Num1:'0',status1:"男"},{Num1:'0',status1:'女'}],
      Education:[{Num2:'',status2:'不限'},{Num2:"0",status2:'专科以下'},{Num2:'1',status2:'专科及以上'},{Num2:'2',status2:'本科及以上'},{Num2:'3',status2:'硕士及以上'},{Num2:'4',status2:'博士及以上'},{Num2:'99',status2:'985/211'}],
      state:[{Num3:[],status3:'不限',sta:true},{Num3:'TO_DO',status3:'待处理',sta:false},{Num3:'OPTION',status3:'备选',sta:false},{Num3:'PASS',status3:'Pass',sta:false},{Num3:'HAS_SEE',status3:'已邀约',sta:false},{Num3:'SEE_FAIL',status3:'邀约失败',sta:false},
          {Num3:'INTERVIEW_FAIL',status3:'面试淘汰',sta:false},{Num3:'TO_SENT_OFFER',status3:'待Offer',sta:false},{Num3:'HAS_SENT_OFFER',status3:'已发offer',sta:false},{Num3:'HAS_ENTRY',status3:'已入职',sta:false},{Num3:'NO_ENTRY',status3:'未入职',sta:false},{Num3:'END',status3:'终止面试',sta:false},],
      active:'',
      ownerWorkYears1:[{value:'',label:'不限'},{value:0,label:'0'},{value:1,label:'1'},{value:2,label:'2'},{value:3,label:'3'},{value:4,label:'4'},{value:5,label:'5'},
                {value:6,label:'6'},{value:7,label:'7'},{value:8,label:'8'},{value:9,label:'9'},{value:10,label:'10'}],
        ownerWorkYears2:[{value:'',label:'不限'},{value:0,label:'0'},{value:1,label:'1'},{value:2,label:'2'},{value:3,label:'3'},{value:4,label:'4'},{value:5,label:'5'},
                {value:6,label:'6'},{value:7,label:'7'},{value:8,label:'8'},{value:9,label:'9'},{value:10,label:'10'}],
      value:[],
      ajaxData: [],
      checkData: [],
      checkboxList:[],
      delateARRALL3: []
    }
  },
  computed:{
    
  },
  components:{
    ckeditor 
  },
  methods:{
      // 判断输入年限的大小
      judge1(value){
        this.searchInfo.ownerWorkYears1=value.value
        },
      judge2(value){
        this.searchInfo.ownerWorkYears2=value.value
        if(this.searchInfo.ownerWorkYears1>this.searchInfo.ownerWorkYears2){
            this.Black=true
            setInterval(() => {
              this.Black=false
            }, 3000)
        }
     },
    //全选与反选
    checkedAll: function() {
      if (this.checked) {//实现反选
          this.checkboxList = [];
          this.ajaxData.forEach( (item) => {
            this.removeInterviewee(item)
          this.checkboxList = [];
          this.delateARRALL=[];
          this.flowStatusarr=[]
          item.STATES=false
         });
          
      } else { //实现全选
        if(this.ajaxData.length==0){
        this.checkboxList=[]
        }
        this.checkboxList = [];
        this.ajaxData.forEach( (item) => {
            this.addInterviewee(item)
            this.checkboxList.push(item.id);
            this.delateARRALL.push(item.id);
            this.flowStatusarr.push(item.flowStatus)
            item.STATES=true
        });
      }
      },
  
    //操作处理面试状态
    selectFn1(e,SID,itemsta) {
            this.toseeid=SID
            this.emailId=SID
            this.emailIdArr=[]
           this.emailIdArr.push(SID)
            this.isShowTwo=true
            this.ITEMSTA=itemsta
            // 准备约面
            if(e.target.value==3){
              getEmailMoo().then(res=>{
                this.emailInline.modalArr.push(res.data.body[0])
              })
              this.emailMOdal=true
              this.emailFlowStatus='TO_SEE'
              this.isShowTwo=true
              this.sendEmail()
            }
            // 简历PASS
            if(e.target.value==2){
                let parmars={
                status:"PASS",
                id:SID,
                }
                PASS(parmars).then(res=>{
                    if(res.data.success==true){
                        this.SouSuo(this.pageT)
                    }
                })
            }
            // 简历备选
            if(e.target.value==4){
                let parmars={
                status:"OPTION",
                id:SID,
                }
                OPTION(parmars).then(res=>{
                    if(res.data.success==true){
                       this.SouSuo(this.pageT)
                    }
                })
            }
        },
        addINTERVIEW(){
            let parmars={
                resumeId: this.toseeid,
                inviterName:this.formInline.UpdateOWER,
                interviewerName:this.formInline.UpdateVIEW,
                seeTime:moment(this.formInline.UpdateTIME).format('YYYY-MM-DD HH:mm'),
            }
            if(this.formInline.UpdateOWER==''||this.formInline.UpdateVIEW==''||this.formInline.UpdateTIME==''){
               this.$Notice.error({
                    title: '提示',
                    desc:  '请您填写完整的约面信息'
                });
                return
            }
            addinterview(parmars).then(res=>{
              if(res.data.success==true){
                  this.modal2=false
                  this.formInline.UpdateOWER=''
                  this.formInline.UpdateVIEW=''
                  this.formInline.UpdateTIME=''
                  this.formInline.sendWeixin=true
                  this.SouSuo(this.pageT)
              }
              if(res.data.body.code==0){
                this.SouSuo(this.pageT)
              }
            })
        },
        nextStep(){
          this.beforeBtu=true
          this.modal2=false
          this.emailMOdal=true
          this.sendEmail()
        },
        selectFn2(e,SID,itemsta) {
          this.ITEMSTA=itemsta
          this.emailId=SID
          this.toseeid=SID
            // 准备约面
            if(e.target.value==1){
                 getEmailMoo().then(res=>{
                   this.emailInline.modalArr.push(res.data.body[0])
                 })
                  this.emailMOdal=true
                  this.emailFlowStatus='TO_SEE'
                 this.isShowTwo=true
                 this.sendEmail()
            }
            // 简历PASS
            if(e.target.value==3){
                let parmars={
                status:"PASS",
                id:SID,
                }
                PASS(parmars).then(res=>{
                    if(res.data.success==true){
                      this.SouSuo(this.pageT)
                    }
                })
            }
            // 简历备选
            if(e.target.value==2){
                let parmars={
                status:"OPTION",
                id:SID,
                }
                OPTION(parmars).then(res=>{
                    if(res.data.success==true){
                       this.SouSuo(this.pageT)
                    }
                })
            }
            if(e.target.value==2){
                let parmars={
                status:"TO_DO",
                id:SID,
                }
                TODORes(parmars).then(res=>{
                    if(res.data.success==true){
                       this.SouSuo(this.pageT)
                    }
                })
            }
        },
        selectFn3(e,SID,itemsta) {
          this.ITEMSTA=itemsta
          this.emailId=SID
          this.toseeid=SID
            // 准备约面
            if(e.target.value==2){
                 getEmailMoo().then(res=>{
                 this.emailInline.modalArr.push(res.data.body[0])
                 })
                 this.emailMOdal=true
                 this.emailFlowStatus='TO_SEE'
                 this.isShowTwo=true
                 this.sendEmail()
            }
            // 简历PASS
            if(e.target.value==3){
                let parmars={
                status:"PASS",
                id:SID,
                }
                PASS(parmars).then(res=>{
                    if(res.data.success==true){
                      this.SouSuo(this.pageT)
                    }
                })
            }
            // 简历备选
            if(e.target.value==1){
                let parmars={
                status:"OPTION",
                id:SID,
                }
                OPTION(parmars).then(res=>{
                    if(res.data.success==true){ 
                       this.SouSuo(this.pageT)
                    }
                })
            }
            if(e.target.value==4){
                let parmars={
                status:"TO_DO",
                id:SID,
                }
                TODORes(parmars).then(res=>{
                    if(res.data.success==true){
                       this.SouSuo(this.pageT)
                    }
                })
            }
        },
        selectFn4(e,SID,itemsta) {
           this.ITEMSTA=itemsta
           this.toseeid=SID
           this.emailId=SID
            // 准备约面
            if(e.target.value==2){
                 getEmailMoo().then(res=>{
                 this.emailInline.modalArr.push(res.data.body[0])
                 })
                 this.emailMOdal=true
                 this.emailFlowStatus='TO_SEE'
                 this.isShowTwo=true
                 this.sendEmail()
            }
            // 简历PASS
            if(e.target.value==1){
                let parmars={
                status:"PASS",
                id:SID,
                }
                PASS(parmars).then(res=>{
                    if(res.data.success==true){
                         this.SouSuo(this.pageT)
                    }
                })
            }
            // 简历备选
            if(e.target.value==3){
                let parmars={
                status:"OPTION",
                id:SID,
                }
                OPTION(parmars).then(res=>{
                    if(res.data.success==true){
                       this.SouSuo(this.pageT)
                    }
                })
            }
            if(e.target.value==4){
                let parmars={
                status:"TO_DO",
                id:SID,
                }
                TODORes(parmars).then(res=>{
                    if(res.data.success==true){
                       this.SouSuo(this.pageT)
                    }
                })
            }
        },
        changeTime(b){
          this.UpdateTIME=b
            if (!b){
              this.editorObject = {
                type: this.temp,
                value: this.emailInline.templateContent
              }
              return
            }
            var reg = /<span id="email_seeTime"><span>/g
            var time = b.split('-')
            var year = time[0]
            var mon = time[1]
            var day = time[2].split(' ')[0]
            var time = time[2].split(' ')[1]
            var content = `<span id="email_seeTime">${year}年${mon}月${day}日 ${time}<span>`
            this.editorObject = {
              type: this.temp,
              value: this.emailInline.templateContent.replace(reg, content)
            }
    },
    // 查看简历详情
     Seedetail(Tid,Uid,STATUS){
            this.detailID=Tid
            this.DOWNID=Uid
            this.resumeDetailSta=STATUS
            let newpage = this.$router.resolve({ 
                name: 'resumeDetail',
                params:{},
               query:{id:this.DOWNID,noShowBtn:'',ID:this.detailID,status:this.resumeDetailSta}
            })
            window.open(newpage.href, '_blank');
        },
    pageChange(page){
      this.pageT=page
      this.delateARRALL=[]
      this.flowStatusarr=[]
      this.searchInfo.ownerWorkYears1=''
      this.searchInfo.ownerWorkYears2=''
      this.SouSuo(this.pageT)
    },
    pageSizeChange(page){
        this.searchInfo.pageSize=page
        this.pageSize=page
        this.SouSuo()
    },
    // 跳转到面试管理
    tointerview(){
      this.$router.push('/interview')
    },
    downloadAll(){
        if(this.checkboxList==''){
            this.$Notice.error({
                title: '提示',
                desc:  '选项不能为空'
            });
            return
        }
        let url=`${sapi}/api/resume/download/formatted/compress`
        this.checkboxList.map((item,index)=>{
            url+=index==0?`?resumeId=${item}`:`&resumeId=${item}`
        })
        window.location.href=url
          this.checkboxList=[]
    },
    // 可删除状态下点击
    delateR(delateid){
        this.delateARRALL3 = []
        this.delateARRALL3.push(delateid)
        this.modal3=true
    },
    // 删除单条简历
    delateONE(){
      deleteREsume(this.delateARRALL3).then(res=>{
        if(res.data.success==true){
          this.delateARRALL3.map(item => {
            this.removeInterviewee({id:item})
          })
          this.modal3=false
           this.SouSuo(this.pageT)
        }
      })
    },
    // 选择input元素
    selectInputElement(index,doID,doStatus,sss, item){
      sss=!sss
      this.emailIdArr=[]
      this.emailId=doID
      this.ajaxData[index].STATES=sss
      Array.prototype.indexOf = function(val) { 
      for (var i = 0; i < this.length; i++) { 
      if (this[i] == val) return i; 
      } 
      return -1; 
      }
      Array.prototype.remove = function(val) { 
      var index = this.indexOf(val); 
      if (index > -1) { 
      this.splice(index, 1); 
      } 
      }
      if(sss==true){
        this.delateARRALL.push(doID)
        this.delateARRALL2.push(doID)
        this.flowStatusarr.push(doStatus)
        this.addInterviewee(item)
        this.emailIdArr.push(doID)
      }
      if(sss==false){
        this.delateARRALL.remove(doID)
        this.delateARRALL2.remove(doID)
        this.flowStatusarr.remove(doStatus)
        this.removeInterviewee(item)
         this.emailIdArr.remove(doID)
      }
  },
     //选择搜索元素
    selectElement1(tItem,Tindex){
      this.searchInfo.SEX=Tindex==0?'':tItem;
      this.clickIndex1=Tindex
    },
    selectElement2(tItem,Tindex){
      this.searchInfo.Edu=tItem;
      this.clickIndex2=Tindex
    },
     selectElement3(tItem,Tindex,status3,sta3){
            sta3=!sta3
            this.state[Tindex].sta=sta3
           if(Tindex==0){
                this.searchInfo.STA=[]
                this.state.map((item,index)=>{
                    if(index!==0){
                        item.sta=false
                    }
                    if(index==0){
                        item.sta=true
                    }
                    return item
                })
                return
           }
           if(Tindex!==0){
               this.state[0].sta=false
           }
           if(sta3==true){
              this.searchInfo.STA.push(tItem) 
           }
           if(sta3==false){
            Array.prototype.indexOf = function(val) { 
            for (var i = 0; i < this.length; i++) { 
            if (this[i] == val) return i; 
            } 
            return -1; 
            }
            Array.prototype.remove = function(val) { 
            var index = this.indexOf(val); 
            if (index > -1) { 
            this.splice(index, 1); 
            } 
            }
            this.searchInfo.STA.remove(tItem)
           }
        },
    // 不可删除状态下点击
    undelate(){
        this.modal4=true
    },
    // 批量删除
    delateAll(){
      var array1 = this.orignarr;//数组1
      var array2 = this.flowStatusarr;//数组2
      var tempArray1 = [];//临时数组1
      var tempArray2 = [];//临时数组2
      Array.prototype.indexOf = function(val) { 
        for (var i = 0; i < this.length; i++) { 
        if (this[i] == val) return i; 
        } 
        return -1; 
      }
      Array.prototype.remove = function(val) { 
        var index = this.indexOf(val); 
        if (index > -1) { 
        this.splice(index, 1); 
        } 
      }
      for(var i=0;i<array2.length;i++){
          tempArray1[array2[i]]=true;//将数array2 中的元素值作为tempArray1 中的键，值为true；
      }
      for(var i=0;i<array1.length;i++){
          if(tempArray1[array1[i]]){
              tempArray2.push(array1[i]);//过滤array1 中与array2 相同的元素；
          }
      }
      if(tempArray2.length!==0){
        this.$Notice.error({
          title: '提示',
          desc:  '您选中的简历中包含不可删除简历'
        });
        return
      }
      if(this.delateARRALL.length==0){
        this.$Notice.error({
          title: '提示',
          desc:  '选项不能为空'
        });
          return
      }
      if(tempArray2.length==0){
          this.modal7=true
      }
        },
        //确认批量删除
        cofdelateAll(){
            var array1 = this.orignarr;//数组1
            var array2 = this.flowStatusarr;//数组2
            var tempArray1 = [];//临时数组1
            var tempArray2 = [];//临时数组2
            for(var i=0;i<array2.length;i++){
                tempArray1[array2[i]]=true;//将数array2 中的元素值作为tempArray1 中的键，值为true；
            }
            for(var i=0;i<array1.length;i++){
                if(tempArray1[array1[i]]){
                    tempArray2.push(array1[i]);//过滤array1 中与array2 相同的元素；
                }
            }
            if(tempArray2.length!==0){
               this.modal5=true
            }
            Array.prototype.indexOf = function(val) { 
            for (var i = 0; i < this.length; i++) { 
            if (this[i] == val) return i; 
            } 
            return -1; 
            }
            Array.prototype.remove = function(val) { 
            var index = this.indexOf(val); 
            if (index > -1) { 
            this.splice(index, 1); 
            } 
            }
            this.DELATEARR=this.delateARRALL
             deleteREsume(this.DELATEARR).then(res=>{
              if(res.data.success==true){
                  this.modal7=false
                  this.delateARRALL.map(item => {
                    this.removeInterviewee({id:item})
                  })
                  this.delateARRALL=[]
                  this.flowStatusarr=[]
                  this.SouSuo(this.pageT)
              }
            })
        },
        // 刷新列表
        pushlist(){
            this.modal2=false
           this.SouSuo(this.pageT)
        },

    // 批量导出
    allexport(){
       this.optcode=this.$route.params.channelname
        let parmars={
          optSourceCode:this.optcode,
          keywordString:this.keywords==''?'':this.keywords,
          company:this.lrgs==''?'':this.lrgs,
          ownerSex:this.searchInfo.SEX,
          highestDegreeNum:this.searchInfo.Edu,
          flowStatusList:this.clickIndex3=0?this.searchInfo.STA=[]:this.searchInfo.STA,
          ownerWorkYears1:this.searchInfo.ownerWorkYears1,
          ownerWorkYears2:this.searchInfo.ownerWorkYears2,
        
          }
          if(this.searchInfo.ownerWorkYears1>this.searchInfo.ownerWorkYears2){
            this.$Message.error('最低年限不能大于最高年限')
            return
          }
          if(this.searchInfo.ownerWorkYears2<this.searchInfo.ownerWorkYears1){
            this.$Message.error('最高年限不能小于最小年限')
            return
          }
          window.location.href=`${sapi}/api/excel/output?optSourceCode=${parmars.optSourceCode}&keywordString=${parmars.keywordString}&company=${parmars.company}&ownerSex=${parmars.ownerSex}&highestDegreeNum=${parmars.highestDegreeNum}&flowStatusList=${parmars.flowStatusList}&ownerWorkYears1=${parmars.ownerWorkYears1}&ownerWorkYears2=${parmars.ownerWorkYears2}`
      
    },
     //下载单条简历
    downloadONE(downID){
      window.location.href=`${sapi}/api/resume/download/formatted/one?resumeId=${downID}`
    },
    // 操作记录查询
    RecordSEE(RID,sname){
      this.toseename=sname
      this.modal1=true
      let parmars={
          resumeId:RID
      }
      recodeLIST(parmars).then(res=>{
          this.ownerName=res.data.body.ownerName
          this.recordList=res.data.body.map((item,index)=>{
              item.ownerName=item.ownerName
              item.approveUserName=item.approveUserName
              item.dateTime=item.dateTime
              item.previousState=item.previousState
              item.afterState=item.afterState
              return item
          })
      })
    },
    delInterviewee (item) {
      this.removeInterviewee(item)
      let indexOf = this.checkboxList.indexOf(item.id)
      if (indexOf < 0) return
      this.checkboxList.splice(indexOf, 1)
      this.delateARRALL.splice(indexOf, 1)
      this.flowStatusarr.splice(indexOf, 1)
      this.ajaxData.filter((item, index) => {
        item
      })
      this.ajaxData.map((data, index) => {
        if (data.id == item.id) {
          data.STATES = false
        }
      })
    },
    //搜索
    SouSuo(page, status){
      page = typeof(page)=='number'?page:1
      this.searchInfo.pageIndex = page
      this.pageIndex = page
      this.interviewee = []
      let parmars={
        pageSize:this.searchInfo.pageSize,
        pageIndex:this.searchInfo.pageIndex,
        parameter:{
          optSourceCode:this.$route.params.channelname,
          keywordString:this.keywords==''?'':this.keywords,
          company:this.lrgs==''?'':this.lrgs,
          ownerSex:this.searchInfo.SEX,
          highestDegreeNum:this.searchInfo.Edu,
          flowStatusList:this.clickIndex3=0?this.searchInfo.STA=[]:this.searchInfo.STA,
          ownerWorkYears1:this.searchInfo.ownerWorkYears1,
          ownerWorkYears2:this.searchInfo.ownerWorkYears2,
        }
      }
      this.ajaxData=[]
      if(this.searchInfo.ownerWorkYears1>this.searchInfo.ownerWorkYears2){
       this.$Notice.error({
          title: '提示',
          desc:  '最高年限不能小于最低年限'
       });
        return
      }
      sousuoList(parmars, status).then(res=>{
        let Ishow=res.data.items
        if(res.data.success==true){
          this.checkboxList=[]
          if(res.data.body.totalNumber==0){
            this.totalSize=0
          }
          this.spinShow=false
          this.ajaxData=res.data.body.items.map((item,index)=>{
            this.totalSize=res.data.body.totalNumber
            item.id=item.id
            item.ownerName=item.ownerName
            item.ownerSex=item.ownerSex
            item.belongs=item.belongs
            item.emailSendtime=item.emailSendtime
            item.ownerMobile=item.ownerMobile
            item.ownerHighestDegree=item.ownerHighestDegree
            item.ownerExpectTitles=item.ownerExpectTitles
            item.flowStatus=item.flowStatus
            item.ownerAge=item.ownerAge
            item.ownerWorkYears=item.ownerWorkYears
            item.modifyTime=item.modifyTime
            item.srcSite=item.srcSite
            item.STATES=false
            item.isShow=false
            item.optSource=item.optSource
            item.modifier=item.modifier
            item.uid=item.uid
            item.c=item.modifier==''?item.modifier:item.modifier.split('_')
            item.d=item.c[0]
            if (item.STATES) { //以选中
              this.checkboxList.push(item.id)
              this.delateARRALL.push(item.id);
              this.flowStatusarr.push(item.flowStatus)
            }
            return item
          })  
        }
    })
    },
    // 刷新列表
    pushlist(){
      this.modal2=false
      this.SouSuo(this.pageT)
      this.formInline.UpdateOWER=''
      this.formInline.UpdateVIEW=''
      this.formInline.UpdateTIME=''
      this.formInline.sendWeixin=true
    },
    // 鼠标滑过事件
    ahove(index,vvv){
      this.ajaxData[index].isShow=true
    },
    movleave(index,vvv){
      this.ajaxData[index].isShow=false
    },
     // 发送邮件
     sendEmail(type){
      if(this.checkboxList.length == 0&&type) {
           this.$Notice.error({
            title: '提示',
            desc:  '你尚未选择简历，请先选择简历'
            })
           return
        }
        if (this.checkboxList.length > 1&&type){
          this.$Notice.error({
            title: '提示',
            desc:  '不能选择多份简历，请选择单份简历'
            })
           return
        }
        this.emailInline.modalArr=[]
        this.$refs.emailInline.resetFields()
        this.$refs.formInline.resetFields()
        this.options=[]
        this.emailMOdal=true
        getEmailMoo().then(res=>{
            this.emailInline.modalArr=res.data.body
        })
        this.emailInline.moo = 'TEMP_0001'
        this.getEmailContentValue(this.emailInline.moo)
      },
      getEmailContentValue(value){
        if (!value){
          return
        }
        this.isDisable=true
        this.temp=value
        if(this.isShowTwo==true){
            this.isShowAll=true
            this.interviewIsShow=true
        }else{
        if(this.emailIdArr.length>1&&(value=='TEMP_0001'||value=='TEMP_0005'||value=='TEMP_0006')){
          this.allEmailVilitor=true
        }else {
          this.allEmailVilitor=false
          if(this.temp=='TEMP_0001'){
              this.isShowAll=true
          }else{
              this.isShowAll=false
          }  
        }
        if(value=='TEMP_0001'){
          this.interviewIsShow=true
          this.isShowAll=true
          }else{
          this.interviewIsShow=false
          this.isShowAll=false
        }
        this.emailId=this.emailIdArr.length==0?'':this.emailIdArr[0]
        if(value=='TEMP_0001' &&this.emailId==''){
            this.interviewBtu=true
            this.isShowAll=true
            this.emailMassage=true
        }
        else if(value=='TEMP_0005' && this.emailId==''){
            this.emailMassage=true
        }
        else if(value=='TEMP_0006' && this.emailId==''){
            this.emailMassage=true
        }
        else{
            if(value=='TEMP_0001'){this.isShowAll=true}else{this.isShowAll=false}
            this.interviewBtu=false
            
            this.emailMassage=false 
        }}
        this.emailCode=value
        let parmars={
            resumeId:this.emailId==''?'':this.emailId,
            templateCode:this.emailCode
        }
        getEmailContent(parmars).then(res=>{
          this.emailInline.theme=res.data.body.templateSubject
          this.emailInline.receiveEmail=res.data.body.receiveEmail
          this.emailInline.templateContent=res.data.body.templateContent
          this.editorObject = {
            type: value,
            value: this.emailInline.templateContent || ''
          }
          if(res.data.body&&res.data.body.resumeInterviewVO){
          this.formInline.UpdateOWER=res.data.body.resumeInterviewVO.inviterName
          this.formInline.UpdateVIEW=res.data.body.resumeInterviewVO.interviewerName
          this.formInline.UpdateTIME=res.data.body.resumeInterviewVO.seeTime
          this.changeTime(this.formInline.UpdateTIME)
          }else{
        this.formInline.UpdateOWER=''
        this.formInline.UpdateVIEW=''
        this.formInline.UpdateTIME='' 
          }
          
        })
      },
        uploadFile(){
        //    this.uploadFileList=[]
           this.limentName=0
        },
        beforUpload(uploadFile){
          let isLiment=false
              if(uploadFile.size/1024 > 10240){
                  isLiment=true
                  this.limentName+=1
                  if(this.limentName==1){
              this.$Notice.error({
              title: '提示',
              desc:  '单个文件不能大于10M'
              })
            }
              }else{
                this.fileList.push(uploadFile.name)
                this.uploadFileList.push(uploadFile)
              }
            return false
        },
        // 发送全部内容
        sendContent(){},
        emailModalPush(){
          this.emailInline.modalArr=[]
          this.emailInline.theme=''
          this.emailInline.receiveEmail=''
          this.emailInline.templateContent=''
          this.sad=''
          this.fileList=[]
          this.emailInline.moo=''
          this.emailMOdal=false
          this.emailMassage=false 
          this.emailIdArr=[]
          this.emailFlowStatus=''
          this.formInline.UpdateOWER=''
          this.formInline.UpdateVIEW=''
          this.formInline.UpdateTIME=''
          this.formInline.sendWeixin=true
          this.emailInline.copyname=''
          this.isShowTwo=false
          this.isLimitSize=false 
          this.uploadFileList=[]
          this.SouSuo(this.pageT,'init')
          this.clearInterviewee()
        },
        getEditorValue(){ // 调编辑器组件方法获取数据
          return this.$refs.editor.getValue()
        },
        delateFile(index){    
            this.fileList.splice(index,1)
            this.uploadFileList.splice(index,1)
            //  this.isLimitSize=false
        },
        // 确认发送邮件
        confireSendEmail(){
          this.sad=this.getEditorValue()
           if(this.sad==''){
              this.$Notice.error({
                title: '提示',
                desc:  '请填写完整的信息'
              });
              return 
          }
         if(this.emailInline.moo==''){
           this.$Notice.error({
            title: '提示',
            desc:  '请填写完整的信息'
            });
            return 
         }
         if((this.temp=='TEMP_0001')&&(this.emailInline.moo==''||this.emailInline.receiveEmail==''||this.emailInline.theme==''||this.formInline.UpdateOWER==''||this.formInline.UpdateVIEW==''||this.formInline.UpdateTIME=='')){
            this.$Notice.error({
            title: '提示',
            desc:  '请填写完整的信息'
            });
            return
         }
         if((this.temp=='TEMP_0002'||this.temp=='TEMP_0003'||this.temp=='TEMP_0004'||this.temp=='TEMP_0005'||this.temp=='TEMP_0006')&&(this.emailInline.moo==''||this.emailInline.receiveEmail==''||this.emailInline.theme=='')){
           this.$Notice.error({
            title: '提示',
            desc:  '请填写完整的信息'
            });
            return  
         }
         if((this.temp=='TEMP_0001'|| this.temp=='TEMP_0005'|| this.temp=='TEMP_0006')&&this.emailId==''){
              this.$Notice.error({
              title: '提示',
              desc:  '请先选择简历'
             });
            return  
             
         }
         if(this.emailInline.copyname!==''&&!(/^((([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6}\;))*(([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})))$/.test(this.emailInline.copyname))){
            this.$Notice.error({
            title: '提示',
            desc:  '请正确填写邮箱地址'
           });
           return
        }
        if(!(/^((([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6}\;))*(([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})))$/.test(this.emailInline.receiveEmail))){
            this.$Notice.error({
            title: '提示',
            desc:  '请正确填写邮箱地址'
           });
           return
        }
         if((this.emailIdArr.length>1)&&(this.temp=='TEMP_0001'|| this.temp=='TEMP_0005'|| this.temp=='TEMP_0006')){
           this.$Notice.error({
              title: '提示',
              desc:  '不能选择多份简历，请选择单份简历'
            });
            return
         }
         this.attachFileList=this.uploadFileList.length==0?'':this.uploadFileList
         this.flowStatusTT=this.emailFlowStatus==''?'':'TO_SEE'
         this.UpdateTIMETwo=this.formInline.UpdateTIME==''?'':this.formInline.UpdateTIME
         if(this.temp=='TEMP_0001'){
            var formData= new FormData()
            if(this.attachFileList.length!==0){
               this.attachFileList.map(item=>{
              formData.append('attachFileList',item)
            }) 
            }else{
                formData.append('attachFileList','')   
            }
            formData.append('resumeId',this.emailId)
            formData.append('templateCode',this.emailCode)
            formData.append('subject',this.emailInline.theme)
            formData.append('toEmail',this.emailInline.receiveEmail)
            formData.append('ccEmail',this.emailInline.copyname)
            formData.append('emailContent',this.sad)
            formData.append('resumeInterviewVO.resumeId',this.emailId)
            formData.append('resumeInterviewVO.inviterName',this.formInline.UpdateOWER==''?'':this.formInline.UpdateOWER)
            formData.append('resumeInterviewVO.interviewerName',this.formInline.UpdateVIEW==''?'':this.formInline.UpdateVIEW)
            let info = this.options.find(item => item.name == this.formInline.UpdateVIEW)
            formData.append('resumeInterviewVO.email',(info&&info.email) || '')
            formData.append('sendWeixin',this.formInline.sendWeixin==true? 1:0)
            formData.append('resumeInterviewVO.seeTime',moment( this.UpdateTIMETwo).format('YYYY/MM/DD HH:mm'))
            formData.append(' flowStatus',this.flowStatusTT)
            sendEmail(formData).then(res=>{
                  this.isDisable=true
                if(res.data.success==true){
                    setTimeout(() => {
                      this.$Notice.success({
                        title: '提示',
                        desc:  '发送邮件成功'
                      })
                    }, 500)
                    this.emailMOdal=false
                    this.modal10=false
                    this.emailInline.modalArr=[]
                    this.emailInline.theme=''
                    this.emailInline.receiveEmail=''
                    this.emailInline.templateContent=''
                    this.sad=''
                    this.fileList=[]
                    this.emailInline.moo=''
                    this.emailMOdal=false
                    this.emailMassage=false 
                    this.emailIdArr=[]
                    this.emailFlowStatus=''
                    this.formInline.UpdateOWER=''
                    this.formInline.UpdateVIEW=''
                    this.formInline.UpdateTIME=''
                    this.formInline.sendWeixin=true
                    this.emailInline.copyname=''
                    this.isShowTwo=false
                    this.uploadFileList=[]
                    this.clearInterviewee()
                    this.SouSuo(this.pageT)
                }
                if(res.data.success==false){
                    this.modal10 = false
                    this.modal11 = true
                    this.errorInfo = res.data.body.message
                }
            })
         }else{
            var formData= new FormData()
            if(this.attachFileList.length!==0){
               this.attachFileList.map(item=>{
              formData.append('attachFileList',item)   
            }) 
            }else{
                formData.append('attachFileList','')   
            }
            formData.append('resumeId',this.emailId)
            formData.append('templateCode',this.emailCode)
            formData.append('subject',this.emailInline.theme)
            formData.append('toEmail',this.emailInline.receiveEmail)
            formData.append('ccEmail',this.emailInline.copyname)
            formData.append('emailContent',this.sad)
            formData.append(' flowStatus',this.flowStatusTT)
            this.isDisable=false
            sendEmail(formData).then(res=>{
                  this.isDisable=true
                if(res.data.success==true){
                    setTimeout(() => {
                      this.$Notice.success({
                        title: '提示',
                        desc:  '发送邮件成功'
                      })
                    }, 500)
                    this.emailMOdal=false
                    this.modal10=false
                    this.emailInline.modalArr=[]
                    this.emailInline.theme=''
                    this.emailInline.receiveEmail=''
                    this.emailInline.templateContent=''
                    this.sad=''
                    this.fileList=[]
                    this.emailInline.moo=''
                    this.emailMOdal=false
                    this.emailMassage=false 
                    this.emailIdArr=[]
                    this.emailFlowStatus=''
                    this.formInline.UpdateOWER=''
                    this.formInline.UpdateVIEW=''
                    this.formInline.UpdateTIME=''
                    this.formInline.sendWeixin=true
                    this.isShowTwo=false
                    this.isLimitSize=false 
                    this.emailInline.copyname=''
                    this.uploadFileList=[]
                    this.clearInterviewee()
                    this.SouSuo(this.pageT)
                }
                if(res.data.success==false){
                    this.modal10 = false
                    this.modal11 = true
                    this.errorInfo = res.data.body.message
                }
            }) 
         }
        },
        changenotice(a){
        },
       receiveEmail(){
        if(!(/^((([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6}\;))*(([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})))$/.test(this.emailInline.receiveEmail))){
            this.$Notice.error({
            title: '提示',
            desc:  '请正确填写邮箱地址'
           });
            this.isDisable=false
           return
        }else{
             this.isDisable=true
        }
       },
       copyname(){
        if(this.emailInline.copyname!==''&&!(/^((([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6}\;))*(([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})))$/.test(this.emailInline.copyname))){
            this.$Notice.error({
            title: '提示',
            desc:  '请正确填写邮箱地址'
           });
            this.isDisable=false
           return
        }else{
            this.isDisable=true
        }
       },
       theme(){
        if(this.emailInline.theme==''){
            this.$Notice.error({
            title: '提示',
            desc:  '请填写主题'
           });
            this.isDisable=false
           return
        }else{
            this.isDisable=true 
        }
       },
       UpdateOWER(){
           if(this.formInline.UpdateOWER==''){
               this.isDisable=false 
           }else{
              this.isDisable=true   
           }
       },
       UpdateTIME(){
           if(this.formInline.UpdateTIME==''){
               this.isDisable=false 
           }else{
              this.isDisable=true   
           }
       },
       UpdateVIEW(){
           if(this.formInline.UpdateVIEW==''){
               this.isDisable=false 
           }else{
              this.isDisable=true   
           }
       },
    delateFile(index){    
        this.fileList.splice(index,1)
    },
    transpond() { //打开转发简历的modal
      if(this.interviewee.length == 0) {
         this.$Notice.error({
                title: '提示',
                desc:  '请选择您要转发的简历'
            });
        return
      }
      this.$refs.transpondFrom.resetFields()
      this.modal8= true
    },
    sendNotice() {
      this.$refs.transpondFrom.validate(valid => {
        if(!this.transpondFrom.interviewerName){
          return
        }
        if (this.interviewee.length < 1) {
          this.$Notice.warning({title: '提示',desc: '发送内容为空，请勾选您要发送的简历'})
          return
        }
         let resumeIdList = []
         this.interviewee.map(item => {
            resumeIdList.push(item.id)
         })
         let params = {
             resumeIdList,
             email: this.transpondFrom.interviewerName
         }
         forwardResume(params).then(res => {
            if (res.data.success == true) {
              this.clearInterviewee()
              this.modal8 = false
                setTimeout(() => {
                  this.$Notice.success({
                    title: '提示',
                    desc:  '发送成功'
                  })
                }, 500)
            } else{
              this.errorCode=res.data.body.code
              this.clearInterviewee()
              this.modal8 = false
              if(this.errorCode=='40001'){
                this.modal12=true
              }
              if(this.errorCode=='40002'){
                this.modal13=true
              }
              // setTimeout(() => {
              //   this.$Notice.success({
              //     title: '提示',
              //     desc:  '发送失败'
              //   })
              // }, 500)
              // this.clearInterviewee()
              // this.modal8 = false
            }    
         })
      })
    },
    remoteMethod: function(query){
      if (query !== '') {
          this.loading1 = true;
          setTimeout(() => {
              this.loading1 = false;
              let list = []
              query = query.split('(')[0]
              findCompanyEmailByKey(query).then(res => {
                list = res
                this.options = list.data.body || []
          }, 200);
        })      
      } else {
          this.options = [];
      }
    },
    removeInterviewee (value) {
      this.interviewee.map((item, index) => {
        if (value&&item.id == value.id) {
          this.interviewee.splice(index, 1)
        }
      })
    },
    addInterviewee (data) {
      let flag = false
      this.interviewee.map(item => {
         if (data&&item.id == data.id) {
           flag = true
           return
         } 
      })
      if (!flag) {
        this.interviewee.push(data)
      }
    },
    clearInterviewee (value) {
      this.interviewee = []
      this.checkboxList = []
      this.delateARRALL = []
      this.flowStatusarr = []
      this.ajaxData.map(item => {
        item.STATES = false
      })
    },
    getfocus(form, name, e){
      let vm = this;
      let value = this[form][name]
      if(name == 'receiveEmail') {
        this.tip&&this.$refs[form].fields.forEach(function (e) {
            if (e.prop == name) {      
                e.resetField()
                vm[form][name] = value
                vm.tip = false
            }
        })
      } else {
        if (name=='UpdateTIME'&&e==false){ // 时间选择器关闭弹框的时候
          this.$refs.formInline.validateField('UpdateTIME', (e) => {})
          return
        }
        if (name=='UpdateVIEW'&&e==false){ // 选择关闭弹框的时候
          this.$refs.formInline.validateField('UpdateVIEW', (e) => {})
          return
        }
        this.$refs[form].fields.forEach(function (e) {
            if (e.prop == name) {      
                e.resetField()
                vm[form][name] = value
            }
        })
      }
      
    },
    submit() {
      let flag = false
      this.$refs.emailInline.validate(val => {
      if (!val) {
        flag = true
        return
      }
     })
     this.$refs.formInline.validate(val => {
      if (!val) {
        flag = true
        return
      }
     })
     if (!flag){
      this.modal10=true
     }
    },
    cancelSubmit(){
      this.modal11= false
      this.emailMOdal=false
      this.emailInline.modalArr=[]
      this.emailInline.theme=''
      this.emailInline.receiveEmail=''
      this.emailInline.templateContent=''
      this.sad=''
      this.fileList=[]
      this.emailInline.moo=''
      this.emailMOdal=false
      this.emailMassage=false 
      this.emailIdArr=[]
      this.emailFlowStatus=''
      this.formInline.UpdateOWER=''
      this.formInline.UpdateVIEW=''
      this.formInline.UpdateTIME=''
      this.formInline.sendWeixin=true
      this.emailInline.copyname=''
      this.isShowTwo=false
      this.isLimitSize=false 
      this.uploadFileList=[]
      this.clearInterviewee()
    }
  },
  watch: {
    '$route' (to, from) {
      this.searchInfo={
        pageSize:30,
        pageIndex:1,
        id:'',
        SEX:'',
        Edu:'',
        ccc:'',
        itemSelect:'',
        STA:[],
        status:"",
        ownerWorkYears1:'',
        ownerWorkYears2:'',
      }
      this.activeClass = 0
      this.clickIndex1 = 0
      this.clickIndex2 = 0
      this.lickIndex3 = 0
      this.keywords=''
      this.lrgs=''
      this.state.map(item => {
        item.sta = item.status3=='不限' ?true:false
      })
    let parmars={
         pageSize:this.searchInfo.pageSize,
         pageIndex:this.searchInfo.pageIndex,
         parameter:{
           optSourceCode:this.$route.params.channelname
         }
       }
       this.ajaxData=[]
       this.interviewee = []
       adoptOneSeeResumeList(parmars).then(res=>{
          if(res.data.success==true){
             this.checkboxList=[]
             if(res.data.body.totalNumber==0){
               this.totalSize=0
             }
             this.totalSize=res.data.body.totalNumber
            this.quanxuan.push(res.data.body.items.id)
            this.ajaxData=res.data.body.items.map((item,index)=>{
              item.id=item.id
              item.ownerName=item.ownerName
              item.ownerSex=item.ownerSex
              item.deliveryTime=item.deliveryTime
              item.belongs=item.belongs
              item.emailSendtime=item.emailSendtime
              item.ownerMobile=item.ownerMobile
              item.ownerHighestDegree=item.ownerHighestDegree
              item.ownerExpectTitles=item.ownerExpectTitles
              item.flowStatus=item.flowStatus
              item.ownerAge=item.ownerAge
              item.ownerWorkYears=item.ownerWorkYears
              item.modifyTime=item.modifyTime
              item.srcSite=item.srcSite
              item.STATES=false
              item.isShow=false
              item.optSource=item.optSource
              item.modifier=item.modifier
              item.uid=item.uid
              item.c=item.modifier==''?item.modifier:item.modifier.split('_')
              item.d=item.c[0]
              return item
            })  
          }
       })
    },
    checkboxList: {
      handler: function (val, oldVal) { 
        if(this.ajaxData.length==0){
           this.checked=false
           return
        }
        if(this.delateARRALL.length==30){
          this.checked=true
          return
        }
        if(this.delateARRALL.length!==30){
          this.checked=false
          return
        }
        if (this.checkboxList.length === this.ajaxData.length) {
            this.checked=true;
        }
         else {
            this.checked=false;
        }
      },
      deep: true
    }
    
  },
  mounted(){
    this.SouSuo(null, 'init')
  }
}
</script>
<style scoped lang='less'>
.channel{
  width: 100%;
  height: 100%
}
.wechat{
  position: absolute;
  right: -5px;
  top:30%;
  span{
    font-size: 13px;
  }
}
.bar{
  display:flex;
  align-items: center;
  position: relative;
  .left{
    position: absolute;
    right: 10px;
  }
  .leftBtn{
    right: 90px;
  }
}
.channel-left{
    height: 100%;
    width: 29.5%;
    box-shadow:#dcdee2 0 0 6px 1px;
    float: left;
}
.channel-right{
   height: 100%;
   overflow: hidden;
   width: 70.5%;
   float: left;
   position:relative;
  
}
.resumeRightContentTop{
    width: 100%;
     height: 100%;
     overflow: auto;
}
.Resumecontent{
    width: 100%;
    margin-bottom:0px;
}
.red{
    background: LightGray
}
.massage{
 height:25px;
 font-size: 8px;
 line-height: 25px;
}
 .Recode span{
      margin-left:20px
  }
select::-ms-expand{display:none;}
select{
  appearance:none;
 -moz-appearance:none;
 -webkit-appearance:none;
 outline: none;
 border: none;
 color:#2d8cf0;
 background-color: rgba(255,255,255,0.0)
}
.active3{
  color:#2d8cf0;
}
.sex span{
    margin-right: 20px;
}
.Education{
    width: 100%;
}
.Education span{
    margin-right: 20px;
    display:inline-block;
}
.state{
    width: 100%;
     margin-right: 20px;
}
.state span{
     margin-right: 20px;
    display: inline-block;
}
.state span:nth-child(1){
    margin-right: 20px;
    display:inline-block;
}
.text1{
    width: 80%;
    height: 60px;
    background:rgb(61,169,247) ;
    margin: 30px 0 0 30px
}
.text2{
    width: 80%;
    height: 60px;
    margin: 30px 0 0 30px
}
.text3{
    width: 80%;
    height: 60px;
    background:rgb(0,176,160);
    margin: 30px 0 0 30px
}
.detailResume{
    width:100%;
    height:60px;
}
.emailModal-title{
  height: 280px;
  width: 100%;
}
.emailModalTitle-left{
  height: 100%;
  width: 60%;
  float: left;
}
.emailModalTitle-right{
  height: 100%;
  width: 40%;
  float: left;
}
.ckeditor{
  width:100%
}
.uploadEnclosure{
    width: 100%;
}
.Ubt button{
    margin-left: 40px
}
.badge1{
  display: inline-block;
  position: absolute;
  width:25%;
  height:73%;
  line-height: 130%;
  top:-23%;
  left: -10%;
  background:red;
  border-radius: 50%;
}
.badge{
  position: absolute;
  top: -50%;
  right: -18px;
}
.badges {
  right: -30px;
}
.badges1 {
  right: -25px;
}
.interviewee{
  float:left;
  width:50px;
  margin :10px;
  height: 60px;
  text-align: center;
  .pic{
    position: relative;
    height:40px;
  }
  img{
    width:100%;
  }
  p{
    width: 100%;
    text-align: center;
  }
  i{
    position: absolute;
    right:-10px;
    top:-10px;
  }
  .hint{

  }
  .title{
    text-align: center;
    width:100%;
    margin-bottom: 10px;
  }
}
.grey{
 background:rgba(241,241,241,1);
}

</style>
<style>
.emailForm .ivu-form-item-label{
    font-size: 14px
}
.ivu-form-item-content{
font-size: 14px;
}
.ivu-form-item-error-tip{
  font-size:12px;
}
</style>
