<template>
    <div class="interview">
        <!-- <Spin size="large" fix v-if="spinShow" style="font-size:25px">加载中...</Spin> -->
        <div class="interview-left">
            <div class="leftcontentTop" style="height:100px;display:none">
                <div style="height:90%;float:left;width:30%;background:rgb(0,146,255);margin-left:1%;margin-top:10px"></div>
                <div style="height:90%;float:left;width:30%;background:rgb(253,85,83);margin-left:3%;margin-top:10px"></div>
                <div style="height:90%;float:left;width:30%;background:rgb(0,176,160);margin-left:3%;margin-top:10px"></div>
            </div>
            <div style="float:left;margin-left:1%;width:99%;overflow-y: auto;height:95%;margin-bottom:40px">
                <div style="margin:50px auto;width:300px;height:200px;line-height:200px;text-align:center;font-size:20px;color:LightGray" v-show="Essentialinformation.length==0">暂无数据</div>
               <div class="leftcontentContent" v-for="(item,index) in Essentialinformation " :key='index'>
               <div class="contentMassage">
                   <p style="margin-top:7px">
                      <span style="margin-left:10px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;display:inline-block;cursor:pointer" @click="Seedetail(item.id)">{{item.ownerName}} |</span>
                      <span @click="Seedetail(item.id)" style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;display:inline-block;cursor:pointer">{{item.ownerMobile}}  |</span>
                      <span @click="Seedetail(item.id)" style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;display:inline-block;width:20%;cursor:pointer">{{item.ownerExpectTitles}}</span>
                      <span style="color:#2d8cf0;float:right;margin-right:35px;cursor:pointer" @click="updateInterview(item.id,item.interviewerName,item.seeTime,item.inviterName)">更改约面信息</span>
                   </p>
                   <p style="margin-top:8px;color:Grey">
                    <span style="margin-left:10px;display:inline-block;width:22%;">邀约人: {{item.inviterName}} </span>
                    <span style="margin-left:7%;display:inline-block;width:22%;">面试官: {{item.interviewerName}}</span>
                    <span style="float:right;margin-right:35px">面试时间：{{ item.seeTime}}</span>
                   </p>
               </div>
               <div class="contentState">
                    <p style="margin-top:8px">
                        <span style="margin-left:20px" @click="modal4=true">当前状态</span>
                        <span style="float:right;margin:0 20px 0 0px;color:#2d8cf0;cursor:pointer"  @click="Stopinterview(item.id)"   v-if="item.flowStatus=='OPTION'">终止面试</span>
                        <span style="float:right;margin:0 20px 0 0px;color:#2d8cf0;cursor:pointer"  @click="Stopinterview(item.id)"   v-if="item.flowStatus=='TO_SEE'">终止面试</span>
                        <span style="float:right;margin:0 20px 0 0px;color:#2d8cf0;cursor:pointer"  @click="Stopinterview(item.id)"   v-if="item.flowStatus=='HAS_SEE'">终止面试</span>
                        <span style="float:right;margin:0 20px 0 0px;color:#2d8cf0;cursor:pointer"  @click="Stopinterview(item.id)"   v-if="item.flowStatus=='SEE_FAIL'">终止面试</span>
                        <span style="float:right;margin:0 20px 0 0px;color:#2d8cf0;cursor:pointer"  @click="Stopinterview(item.id)"   v-if="item.flowStatus=='INTERVIEW_FAIL'">终止面试</span>
                        <span style="float:right;margin:0 20px 0 0px;color:#2d8cf0;cursor:pointer"  @click="Stopinterview(item.id)"   v-if="item.flowStatus=='TO_SENT_OFFER'">终止面试</span>
                        <span style="float:right;margin:0 20px 0 0px;color:#2d8cf0;cursor:pointer"  @click="Stopinterview(item.id)"   v-if="item.flowStatus=='TO_ENTRY'">终止面试</span>
                        <span style="float:right;margin:0 20px 0 0px;color:#2d8cf0;cursor:pointer"  @click="Stopinterview(item.id)"   v-if="item.flowStatus=='HAS_ENTRY'">终止面试</span>
                        <span style="float:right;margin:0 20px 0 0px;color:#2d8cf0;cursor:pointer"  @click="Stopinterview(item.id)"   v-if="item.flowStatus=='NO_ENTRY'">终止面试</span>
                        <span style="float:right;margin:0 20px 0 0px;color:#2d8cf0;cursor:pointer"  @click="Stopinterview(item.id)"   v-if="item.flowStatus=='PASS'">终止面试</span>
                        <span style="float:right;margin:0 20px 0 0px;color:#2d8cf0;cursor:pointer"  @click="Stopinterview(item.id)"   v-if="item.flowStatus=='HAS_SENT_OFFER'">终止面试</span>
                        <span style="float:right;margin:0 20px 0 0px;color:#2d8cf0;cursor:pointer"  @click="Stopinterview(item.id)"   v-if="item.flowStatus=='ARRIVED'">终止面试</span>
                        <span style="float:right;margin:0 20px 0 10px;color:#2d8cf0;cursor:pointer" @click="OPPeninterview(item.id,item.flowStatus)"  v-if="item.flowStatus=='END'">重启面试</span>
                    </p>
                    <p  class="nowstatus"  style="margin-top:8px;color:Grey">
                        <span style="margin:0 20px 0 20px" v-if="item.flowStatus=='OPTION'">备选</span>
                        <span style="margin:0 20px 0 20px" v-if="item.flowStatus=='TO_SEE'">准备约面</span>
                        <span style="margin:0 20px 0 20px" v-if="item.flowStatus=='HAS_SEE'">已邀约</span>
                        <span style="margin:0 20px 0 20px" v-if="item.flowStatus=='SEE_FAIL'">邀约失败</span>
                        <span style="margin:0 20px 0 20px" v-if="item.flowStatus=='INTERVIEW_FAIL'">面试淘汰</span>
                        <span style="margin:0 20px 0 20px" v-if="item.flowStatus=='TO_SENT_OFFER'">待offer</span>
                        <span style="margin:0 20px 0 20px" v-if="item.flowStatus=='TO_ENTRY'">待入职</span>
                        <span style="margin:0 20px 0 20px" v-if="item.flowStatus=='HAS_ENTRY'">已入职</span>
                        <span style="margin:0 20px 0 20px" v-if="item.flowStatus=='NO_ENTRY'">未入职</span>
                        <span style="margin:0 20px 0 20px;color:red" v-if="item.flowStatus=='END'">终止面试</span>
                        <span style="margin:0 20px 0 20px" v-if="item.flowStatus=='PASS'">PASS</span>
                        <span style="margin:0 20px 0 20px" v-if="item.flowStatus=='HAS_SENT_OFFER'">已发offer</span>
                        <span style="margin:0 20px 0 20px" v-if="item.flowStatus=='TO_RESULT'">面试结果待定</span>
                        <span style="margin:0 20px 0 20px" v-if="item.flowStatus=='ARRIVED'">已到达</span>
                        <span v-show="item.flowStatus!=='END'">
                            <select style="border:0;margin-right:10px;float:right;cursor:pointer"  @change="selectchangeElement($event,item.id)" v-model='statusValue'>
                                <option value="0" style="color:#2d8cf0">变更状态 ∨</option>
                                <option value="1" style="color:#2d8cf0">已邀约 </option>
                                <option value="3" style="color:#2d8cf0">邀约失败</option>
                                <option value="4" style="color:#2d8cf0">面试淘汰</option>
                                <option value="5" style="color:#2d8cf0">待offer</option>
                                <option value="6" style="color:#2d8cf0">已发offer</option>
                                <option value="8" style="color:#2d8cf0">未入职</option>
                                <option value="9" style="color:#2d8cf0">已入职</option>  
                            </select>
                        </span>
                        <span v-show="item.flowStatus=='END'" style="float:right;margin-right:10px;">
                            变更状态 ∨
                        </span>
                    </p>
                </div>
                <div class="contentRecord" style="text-align:center">
                    <p style="margin-top:3px"><span style="color:#2d8cf0;cursor:pointer" @click="RecordSEE(item.id,item.ownerName)">操作记录</span></p>
                    <p style="font-size:12px;color:Grey">最后操作人|<span style="margin-left:8px;text-align:center">{{item.d}}</span></p>
                    <p style="color:Grey">{{item.modifyTime}}</p>
                </div>
             </div>
             </div> 
             <div class="InpageBottom">
                <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 class="interview-right">
            <Form :label-width="80" onsubmit="return false;">
            <FormItem label="关键词：" style="margin-top:20px;margin-left:1%">
                <Input placeholder="请输入关键词" style="width:80%" v-model="keywords"  @keyup.enter.native="Sousuo()"/>
            </FormItem>
             <FormItem label="学历：" class="Education2">
                <span  v-for="(item,index) in Education2" style="cursor:pointer" :class="{'active2':index==clickIndex1}" @click="selectSeeElement(item.Num2,index)" :key="'Education2'+index" class="edu"> {{item.status2}}</span>
            </FormItem>
            <FormItem label="邀约人：" style="margin-top:20px">
                <Select style="width:80%"  placeholder="请选择" :label-in-value='true' @on-change="selectinterviewElement2">
                  <Option v-for="(item,index) in Inviter" :key="index" :value="index" >{{item}}</Option>
                </Select>
            </FormItem>
            <FormItem label="面试官：" style="margin-top:20px">
                <Select style="width:80%;height:20px"  placeholder="请选择"  :label-in-value='true' @on-change='selectinterviewElement'>
                  <Option v-for="(item,index) in Interviewer" :key="index" :value="index" >{{item}}</Option>
                </Select>
            </FormItem>
             <FormItem label="状态：" class="state2">
                <span  v-for="(item,index) in state" style="cursor:pointer"  :class="{'active2':item.sta==true}" @click="selectElement3(item.Num3,index,item.status3,item.sta)" :key="'state2'+index"> {{item.status3}}</span>
            </FormItem>
          </Form>
          <Button type="primary" size='small' style="width:150px;margin-left:150px;font-size:15px" @click="Sousuo">搜索</Button>
        </div>
       <!-- 操作记录弹出框 -->
       <Modal
        v-model="recordModal"
         width='550px'
        :footer-hide="true"
         :closable='false'>
        <div>
            <h2 style="text-align: center;color:black" >操作记录</h2>
            <h2 style="text-align: center;color:#999999;margin-top:10px">候选人:{{toseename}}</h2>
            <div v-for="(item,index) in recordList" :key="index">
                <p style="margin-top:30px;" class="Recode">
                    <span style="display:inline-block;width:70px;margin-left:15px;">{{item.approveUserName}}</span>
                    <span style="display:inline-block;width:140px">{{item.dateTime}}</span>
                    <span style="color:#0092FF;display:inline-block;width:70px;" v-if=" item.previousState=='INTERVIEW_OK'">面试合适</span>
                    <span style="color:#0092FF;display:inline-block;width:70px;" v-if=" item.previousState=='INTERVIEW_FAIL'">面试淘汰</span>
                    <span style="color:#0092FF;display:inline-block;width:70px;" v-if=" item.previousState=='END'">终止面试</span>
                    <span style="color:#0092FF;display:inline-block;width:70px;" v-if=" item.previousState=='SEE_FAIL'">约面失败</span>
                    <span style="color:#0092FF;display:inline-block;width:70px;" v-if=" item.previousState=='NO_ENTRY'">未入职</span>
                    <span style="color:#0092FF;display:inline-block;width:70px;" v-if=" item.previousState=='TO_SEE'">准备约面</span>
                    <span style="color:#0092FF;display:inline-block;width:70px;" v-if=" item.previousState=='HAS_SEE'">已邀约</span>
                    <span style="color:#0092FF;display:inline-block;width:70px;" v-if=" item.previousState=='OPTION'">备选</span>
                    <span style="color:#0092FF;display:inline-block;width:70px;" v-if=" item.previousState=='TO_SENT_OFFER'">待Offer</span>
                    <span style="color:#0092FF;display:inline-block;width:70px;" v-if=" item.previousState=='HAS_SENT_OFFER'">已发offer</span>
                    <span style="color:#0092FF;display:inline-block;width:70px;" v-if=" item.previousState=='TO_ENTRY'">待入职</span>
                    <span style="color:#0092FF;display:inline-block;width:70px;" v-if=" item.previousState=='HAS_ENTRY'">已入职</span>
                    <span style="color:#0092FF;display:inline-block;width:70px;" v-if=" item.previousState=='PASS'">PASS</span>
                    <span style="color:#0092FF;display:inline-block;width:70px;" v-if=" item.previousState=='TO_DO'">待处理</span>
                    <span style="color:#0092FF;display:inline-block;width:70px;" v-if=" item.previousState=='RESET'">重启面试</span>
                     <span style="color:#0092FF;display:inline-block;width:70px;" v-if=" item.previousState=='ARRIVED'">已到达</span>
                    <span style="display:inline-block;width:50px;">变更为</span>
                    <span style="color:#0092FF" v-if=" item.afterState=='INTERVIEW_OK'">面试合适</span>
                    <span style="color:#0092FF" v-if=" item.afterState=='INTERVIEW_FAIL'">面试淘汰</span>
                    <span style="color:#0092FF" v-if=" item.afterState=='END'">终止面试</span>
                    <span style="color:#0092FF" v-if=" item.afterState=='SEE_FAIL'">约面失败</span>
                    <span style="color:#0092FF" v-if=" item.afterState=='NO_ENTRY'">未入职</span>
                    <span style="color:#0092FF" v-if=" item.afterState=='TO_SEE'">准备约面</span>
                    <span style="color:#0092FF" v-if=" item.afterState=='HAS_SEE'">已邀约</span>
                    <span style="color:#0092FF" v-if=" item.afterState=='OPTION'">备选</span>
                    <span style="color:#0092FF" v-if=" item.afterState=='TO_SENT_OFFER'">待Offer</span>
                    <span style="color:#0092FF" v-if=" item.afterState=='HAS_SENT_OFFER'">已发offer</span>
                    <span style="color:#0092FF" v-if=" item.afterState=='TO_ENTRY'">待入职</span>
                    <span style="color:#0092FF" v-if=" item.afterState=='HAS_ENTRY'">已入职</span>
                    <span style="color:#0092FF" v-if=" item.afterState=='PASS'">PASS</span>
                    <span style="color:#0092FF" v-if=" item.afterState=='TO_DO'">待处理</span>
                    <span style="color:#0092FF" v-if=" item.afterState=='RESET'">重启面试</span>
                     <span style="color:#0092FF" 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="recordModal=false">关闭</Button>
        </div>
       </Modal>
     <!-- 更改面试信息弹出框 -->
    <Modal
        v-model="modal2"
        :closable="false"
        width='300px'>
        <h3 style="text-align:center">更改约面信息</h3>
        <Form :label-width="80" ref="formInline" :rules="ruleInline" :model="formInline">
            <FormItem label="邀约人" style="margin-top:20px" prop="UpdateOWER">
                <Input v-model="formInline.UpdateOWER" :maxlength="5"/>
            </FormItem>
            <FormItem label="面试时间" style="margin-top:20px"  prop="UpdateTIME">
               <DatePicker type="datetime"  style="width:185px" v-model="formInline.UpdateTIME" @on-change="selectTime" placeholder="请选择时间" :options="options3" :editable='false' format="yyyy-MM-dd HH:mm"></DatePicker>
            </FormItem>
            <FormItem label="面试官" style="margin-top:20px"  prop="UpdateVIEW">
                <Input v-model="formInline.UpdateVIEW" :maxlength="5"/>
            </FormItem>
        </Form>
        <div  slot='footer' style="text-align:center">
            <Button type='primary' @click='modal2=false'>取消</Button>
            <Button type='primary' @click="changeUpdate">确定</Button>
        </div>
    </Modal>
    <!-- 终止面试弹出框 -->
    <Modal
        v-model="modal3"
        :closable="false"
        width='230px'>
        <h3 style="text-align:center">提示</h3>
        <p>终止面试流程后，仍可以重启流程，<br>是否确定终止该后选人的面试</p>
        <div  slot='footer' style="text-align:center">
            <Button type='primary' @click='modal3=false'>取消</Button>
            <Button type='primary' @click="STOPinterview">确定</Button>
        </div>
    </Modal>
    <!-- 重启面试弹出框 -->
    <Modal
        v-model="modal4"
        :closable="false"
        width='240px'
       >
        <h3 style="text-align:center">提示</h3>
        <p style="text-align:center">终止面试时的简历状态为:  {{OPPeninterviewSTA}}，
            <br>请选择重启后的状态</p>
        <div style="text-align:center;margin-top:15px;">
            <select name="a" id="333333"  @change="selectFnelement($event)" style="text-align:center;margin-top:15px;display:inline-block">
                <option value="1">待处理 ∨</option>
                <option value="2">Pass</option>
                <option value="3">备选</option>
                <!-- <option value="5" >已邀约</option> -->
                <option value="6">邀约失败</option>
                <option value="10">面试淘汰</option>
                <option value="11">待Offer</option>
                <option value="12">已发Offer</option>
                <option value="13">待入职</option>
            </select>
        </div>
        <div  slot='footer' style="text-align:center">
            <Button type='primary' @click='modal4=false'>取消</Button>
            <Button type='primary' @click="OPPinterview">确定</Button>
        </div>
    </Modal>
    </div>
</template>
<script> 
import moment from 'moment'
import {changeinterviewMassage,SerchList,Serchinterviewor,SerchInvitationOwer,NewAddInterview,SInterview,oppenInterview,recodeLIST,changestatus,seedetail,formstatus} from '../../api/interview.server.js'
export default {
    data(){
        return{
            pageT:'',
            statusValue: '0',
            ruleInline: {
                UpdateOWER: [
                    {  required: true, message: '邀约人不能为空', trigger: 'blur' }
                ],
                UpdateTIME: [
                    {  required: true,  message: '面试时间不能为空', trigger: 'date' }
                ],
                    UpdateVIEW: [
                    {  required: true,message: '面试官不能为空',  trigger: 'blur' }
                ],
            },
            formInline:{
                UpdateOWER:'',
                UpdateTIME:'',
                UpdateVIEW:''
            },
            recordModal:false,
            modal2:false,
            modal3:false,
            modal4:false,
            modal5:false,
            changestatuss:'',
            spinShow:true,
            Ishow:[],
            aaaaa:'',
            nowstate:[{value:'已邀约',label:'已邀约'},{value:'邀约失败',label:'邀约失败'},{value:'面试淘汰',label:'面试淘汰'},{value:'待offer',label:'待offer'},{value:'已发offer',label:'已发offer'},{value:'待入职',label:'待入职'},{value:'未入职',label:'未入职'},{value:'已入职',label:'已入职'},],
            keywords:'',
            recordList:[],
            oppenInterviewStatus:'TO_DO',
            oppenInterviewID:'',
            OPPeninterviewSTA:'',
            toseename:'',
            clickIndex1: 0,
            clickIndex2: 0,
            clickIndex3: 0,
            // UpdateOWER:'',
            // UpdateTIME:'',
            // UpdateVIEW:'',
            UpdateID:'',
            options3: {
              disabledDate (date) {
                return date && date.valueOf() <Date.now()-3600*24*1000;
              }
            },
            Interviewer:[],
            Inviter:[],
            stopinterviewID:'',
            Interviewoperation:0,
            UpdateOWERNEW:'',
            UpdateTIMENEW:'',
            UpdateVIEWNEW:'',
            highestDegreeNum:'',
            flowStatusList:[],
            inviterName:'',//邀约人
            interviewerName:'',//面试官
            changestatusSTATUS:'',
            pageIndex:1,
            pageSize:30,
            totalSize:null,
            searchInfo:{
              pageSize:30,
              pageIndex:1,
              STA:[],
            },
            Education2:[{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:'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},],
            OPtionData:[{value:'0',label:'面试淘汰'}],
            activeName:'',
            Essentialinformation:[],
            serchData:[],
            serchData2:[]
        }
    },
    methods: {
        // 变更状态
        selectFn2(e) {
            if(e.target.value==5){
                this.modal5=true
            }
        },
         // 操作记录查询
        RecordSEE(RID,sname){
            this.toseename=sname
            this.recordModal=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
                })
            })
        },
        //更改面试信息弹出框
        updateInterview(InterID,InterOWOR,InterTime,InterVIEW){
            this.formInline.UpdateOWER=InterVIEW,
            this.formInline.UpdateVIEW=InterOWOR,
            this.formInline.UpdateTIME=InterTime,
            this.UpdateID=InterID
            this.modal2=true
        },
        selectTime(b){
            this.UpdateTIME=b
        },
        //准备约面取消
        StopInterview(){
            this.status=status
            this.modal2=false
        },
        //终止面试弹出框
        Stopinterview(sid){
            this.stopinterviewID=sid
            this.modal3=true
        },
        //重启面试
        OPPeninterview(tid,sta4){
            this.oppenInterviewID=tid
            let parmars={
                resumeId:tid
            }
            formstatus(parmars).then(res=>{
                if(res.data.success==true){
                  this.OPPeninterviewSTA=res.data.body.workFlow
                }
            })
            this.modal4=true
        },
        //操作状态
        UpdateStatus(LLL){
            let STATUS=LLL;
        
            if(this.STATUS=='终止面试'){
                this.modal3=true
            }
            if(this.STATUS=='重启面试'){
                this.modal4=true
            }

        },
        // 更改约面信息
        changeUpdate(){
            let parmars={
                resumeId:this.UpdateID,
                inviterName:this.formInline.UpdateOWER,
                seeTime:moment(this.formInline.UpdateTIME).format('YYYY-MM-DD HH:mm'),
                interviewerName:this.formInline.UpdateVIEW
            }
            if(this.formInline.UpdateOWER==''||this.formInline.UpdateTIME==""||this.formInline.UpdateVIEW==''){
                this.$Notice.error({
                    title: '提示',
                    desc:  '请您填写完整的约面信息'
                });
                return
            }
            changeinterviewMassage(parmars).then(res=>{
                if(res.data.success==true){
                  this.formInline.UpdateTIME==""
                  this.formInline.UpdateVIEW==''
                  this.formInline.UpdateOWER==''
                  this.modal2=false;
                  this.Sousuo( this.pageT)
                }
            })
        },
        // 查询面试信息
        serchListInterview(page) {
            page = typeof(page)=='number'?page:1
            this.searchInfo.pageIndex = page
            this.pageIndex = page
            let parmars={
                pageSize:this.searchInfo.pageSize,
                pageIndex:this.searchInfo.pageIndex,
                parameter:{
                    keywordString:'',
                    highestDegreeNum:'',
                    flowStatusList:[],
                    interviewerName:'',
                    inviterName:'',
                }
            }
            SerchList(parmars).then(res=>{
                if(res.data.success==true){
                    this.spinShow=false
                    this.totalSize=res.data.body.totalNumber
                    this.Essentialinformation=res.data.body.items.map((item,index)=>{
                        item.id=item.id
                        item.flowStatus=item.flowStatus
                        item.interviewerName=  item.interviewerName
                        item.inviterName=item.inviterName
                        item.modifier=item.modifier
                        item.c=item.modifier==''?item.modifier:item.modifier.split('_')
                        item.d=item.c[0]
                        item.modifyTime=item.modifyTime
                        item.ownerExpectTitles=item.ownerExpectTitles
                        item.ownerMobile=item.ownerMobile
                        item.ownerName=item.ownerName
                        item.seeTime=item.seeTime
                        return item
                    })  
                }
            })
        },
        // 面试官查询
        Serchlistinterview(){
            Serchinterviewor().then(res=>{
                console.log(res)
            if (!res.data.succes) {
                return
            }
            this.Interviewer=res.data.body
            this.Interviewer.unshift('不限')
            })
        },
        // 邀约人查询
        SerchInvitation(){
            SerchInvitationOwer().then(res=>{
                 
              if (!res.data.success) {
                return
              }
              this.Inviter= res.data.body
              this.Inviter.unshift('不限')
            })

        },
        //新增约面信息
        newaddInterview(){
            let parmars={
                resumeId:this.UpdateOWERNEW,
                inviterName:this.UpdateTIMENEW,
                interviewerName:this.UpdateVIEWNEW,
                seeTime:this.UpdateTIMENEW
            }
            NewAddInterview(parmars).then(res=>{
                if(res.data.success==true){
                    this.$Message.success('新增约面信息成功')
                }
            })
        },
        // 终止面试
        STOPinterview(){
            SInterview(this.stopinterviewID).then(res=>{
                if(res.data.success==true){
                    this.modal3=false
                  this.Sousuo(this.pageT)
                }
            })
        },
        // 操作重启时选择的状态
        selectFnelement(e){
            if(e.target.value==1){
              this.oppenInterviewStatus='TO_DO'  
            }
            if(e.target.value==2){
              this.oppenInterviewStatus='PASS'  
            }
            if(e.target.value==3){
              this.oppenInterviewStatus='OPTION'  
            }
            if(e.target.value==4){
              this.oppenInterviewStatus='OPTION'  
            }
            if(e.target.value==5){
              this.oppenInterviewStatus='HAS_SEE'  
            }
            if(e.target.value==6){
              this.oppenInterviewStatus='SEE_FAIL'  
            }
            if(e.target.value==10){
              this.oppenInterviewStatus='INTERVIEW_FAIL'  
            }
            if(e.target.value==11){
              this.oppenInterviewStatus='TO_SENT_OFFER'  
            }
            if(e.target.value==12){
              this.oppenInterviewStatus='HAS_SENT_OFFER'  
            }
            if(e.target.value==13){
              this.oppenInterviewStatus='TO_ENTRY'  
            }
        },
        //重启面试
        OPPinterview(){
            oppenInterview(this.oppenInterviewID,this.oppenInterviewStatus).then(res=>{
                if(res.data.success==true){
                  this.$Notice.success({
                    title: '提示',
                    desc:  '已成功重启流程'
                   });
                    this. serchListInterview()
                }
            })
            this.modal4=false
        },
        // 选择变更状态时的元素
        selectchangeElement(e,SID){
            if(e.target.value==1){
                this.changestatusSTATUS='HAS_SEE'
                changestatus(SID, this.changestatusSTATUS).then(res=>{
                    this.Sousuo(this.pageT)
                })
            }
            if(e.target.value==2){
                this.changestatusSTATUS='HAS_SEE'
                changestatus(SID, this.changestatusSTATUS).then(res=>{
                    this.Sousuo(this.pageT)
                })
            }
            if(e.target.value==3){
                this.changestatusSTATUS='SEE_FAIL'
                changestatus(SID, this.changestatusSTATUS).then(res=>{
                    this.Sousuo(this.pageT)
                })
            }
            if(e.target.value==4){
                this.changestatusSTATUS='INTERVIEW_FAIL'
                changestatus(SID, this.changestatusSTATUS).then(res=>{
                    this.Sousuo(this.pageT)
                })
            }
            if(e.target.value==5){
                this.changestatusSTATUS='TO_SENT_OFFER'
                changestatus(SID, this.changestatusSTATUS).then(res=>{
                   this.Sousuo(this.pageT)
                })
            }
            if(e.target.value==6){
                this.changestatusSTATUS='HAS_SENT_OFFER'
                changestatus(SID, this.changestatusSTATUS).then(res=>{
                     this.Sousuo(this.pageT)
                })
            }
            if(e.target.value==7){
                this.changestatusSTATUS='TO_ENTRY'
                changestatus(SID, this.changestatusSTATUS).then(res=>{
                    this.Sousuo(this.pageT)
                })  
            }
            if(e.target.value==8){
                this.changestatusSTATUS='NO_ENTRY'
                changestatus(SID, this.changestatusSTATUS).then(res=>{
                    this.Sousuo(this.pageT)
                })
            }
            if(e.target.value==9){
                this.changestatusSTATUS='HAS_ENTRY'
                changestatus(SID, this.changestatusSTATUS).then(res=>{
                   this.Sousuo(this.pageT)
                })
            }
            this.statusValue = '0'
        },
         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)
           }
        },
        Seedetail(Tid){
            this.DOWNID=Tid
            let newpage = this.$router.resolve({ 
                name: 'resumeDetail',
                params:{},
               query:{id:this.DOWNID,noShowBtn:''}
            })
            window.open(newpage.href, '_blank');
        },
        //搜索
        Sousuo(page){
            page = typeof(page)=='number'?page:1
            this.searchInfo.pageIndex = page
            this.pageIndex = page
            let parmars={
                pageSize:this.searchInfo.pageSize,
                pageIndex:this.searchInfo.pageIndex,
                parameter:{
                    keywordString:this.keywords,
                    highestDegreeNum:this.highestDegreeNum,
                    flowStatusList:this.searchInfo.STA,
                    interviewerName:this.interviewerName,
                    inviterName:this.inviterName,
                }
            }
             SerchList(parmars).then(res=>{
               let Ishow=res.data.items  
                if(res.data.success==true){
                    this.spinShow=false
                    this.totalSize=res.data.body.totalNumber
                    this.Essentialinformation=res.data.body.items.map((item,index)=>{
                        item.id=item.id
                        item.flowStatus=item.flowStatus
                        item.interviewerName=  item.interviewerName
                        item.inviterName=item.inviterName
                        item.modifier=item.modifier
                        item.c=item.modifier==''?item.modifier:item.modifier.split('_')
                        item.d=item.c[0]
                        item.modifyTime=item.modifyTime
                        item.ownerExpectTitles=item.ownerExpectTitles
                        item.ownerMobile=item.ownerMobile
                        item.ownerName=item.ownerName
                        item.seeTime=item.seeTime
                        return item
                    })  
                }
            })
        },
        // 选择要搜索的元素
        selectSeeElement(Titem,Tindex){
            this.highestDegreeNum=Titem
            this.clickIndex1=Tindex
        },
        selectinterviewElement(e){
            if(e.label=='不限'){
              this.interviewerName=''
            }else{
              this.interviewerName=e.label
            }
        },
        selectinterviewElement2(e){
             if(e.label=='不限'){
              this.inviterName=''
            }else{
              this.inviterName=e.label
            }
        },
        //改变页码
        pageChange(page){
          this.pageT=page
          this.Sousuo(this.pageT)
        },
        pageSizeChange(page){
            this.searchInfo.pageSize=page
            this.pageSize=page
            this.Sousuo()
        },
        
    },
    mounted(){
     this.serchListInterview()
     this.Serchlistinterview()
     this.SerchInvitation()
   }
}
</script>
<style>
.interview{
    height: 100%;
    width:100%;
    background:#EDEDED;
    overflow: hidden;
}
.interview-left{
  height:100%;
  overflow:hidden; 
  width: 70%;
  float: left;
  background: #F2F2F2;
}
.interview-right{
    height: 100%;
    width: 29%;
    float: left;
    overflow: hidden;
    background:white;
    margin-top:10px;
    margin-left: 1%;
}
.leftcontentTop{
    height: 120px;
    width: 100%;
}
.leftcontentContent{
    width: 100%;
    margin-top: 10px;
    margin-bottom: 40px;
}
.contentMassage{
    width: 53%;
    height: 60px;
    float: left;
    margin-left: 0%;
    background: white;
    margin-top: 10px
    /* margin-bottom: 35px */
}
.contentState{
    width:23%;
    height: 60px;
    float: left;
    margin-left: 1.5%;
    background: white;
     margin-top: 10px
     /* margin-bottom: 35px */
}
.contentRecord{
    width:20%;
    height: 60px;
    float: left;
    margin-left: 1.5%;
    background: white;
     margin-top: 10px
      /* margin-bottom: 35px */
}
.InpageBottom{
    height: 40px;
    width: 56%;
    background:#EDEDED;
    position: fixed;
    bottom: 0;
    margin-left:0.6%;
}
.active2{
    color: #0092FF
}
select::-ms-expand{display:none;}
select{
    appearance:none;
    -moz-appearance:none;
    -webkit-appearance:none;
    outline: none;
    border: none;
    color: #0092FF
}
option::-ms-expand{ display: none; }
option{
    -moz-appearance:none; /* Firefox */
    -webkit-appearance:none; /* Safari 和 Chrome */
    appearance:none;
}
/* --背景色字体颜色--*/
option:hover{
    color:#fff;
    background-color:#1E90FF;
}
.active{
    color: blue;
}
.Education2{
    width:380px;
}
.Education2 :nth-child(2){
    margin-left: 11%
}
.Education2 :nth-child(3){
    margin-left: 15%
}
.Education2 :nth-child(4){
    margin-left:15px
}
.Education2 :nth-child(6){
    margin-left: 10%
}
.Education2 :nth-child(7){
    margin-left: 10%
}
.state2{
    width: 380px;
}
.state2 :nth-child(2){
    margin-left: 6%
}
.state2 :nth-child(3){
    margin-left: 6%
}
.state2 :nth-child(4){
    margin-left: 6%
}
.state2 :nth-child(5){
    margin-left: 10%
}
.state2 :nth-child(7){
    margin-left: 11%
}
.state2 :nth-child(8){
    margin-left: 12%
}
.state2 :nth-child(9){
    margin-left: 11%
}
.state2 :nth-child(12){
    margin-left: 10%
}
.state2 :nth-child(11){
    margin-left: 9%
}
.state2 :nth-child(13){
    margin-left: 10%
}
</style>
