<style>
  .guideMg input.normalBtn {
    width: auto;
    padding: 0 30px;
  }

  .guideMg .addCompany {
    width: 440px;
    height: 600px;
  }

  .guideMg .addCompany .el-dialog__body {
    height: 486px;
    overflow: auto;
  }

  .guideMg .name_input .el-form-item__content .el-input input {
    border-radius: 0;
  }

  .guideMg .name_input .el-form-item__content .el-input:first-child input {
    border-top-left-radius: 17px;
    border-bottom-left-radius: 17px;
  }

  .guideMg .cn_name .el-form-item:nth-child(2) .el-form-item__content .el-input:last-child input,
  .guideMg .is-error .el-form-item__content {
    border-top-right-radius: 17px;
    border-bottom-right-radius: 17px;
  }

  .guideMg .el-form-item__content .el-textarea {
    width: 217px;
  }

  .guideMg .cn_name .el-form-item:nth-child(1) {
    width: 55%;
    float: left;
  }

  .guideMg .cn_name .el-form-item:nth-child(2) {
    width: 45%;
    float: left;
    position: relative;
    left: -5px;
  }

  .guideMg .cn_name .el-form-item:nth-child(2) .el-form-item__content {
    margin: 0 !important;
  }

  .guideMg .cn_name .el-form-item:nth-child(2) .el-form-item__content input {
    border-radius: 0;
    border-top-right-radius: 17px;
    border-bottom-right-radius: 17px;
  }

  .guideMg .cn_name .name_input .el-form-item__content,
  .guideMg .cn_name .name_input .el-form-item__content .el-input input {
    width: 108.5px;
  }

  .guideMg .time .el-input--prefix .el-input__inner {
    padding-left: 30px;
  }

  .guideMg .contentDiv {
    width: 100%;
    min-height: 500px;
    margin-top: 40px;
  }

  .guideMg .query-box {
    border-bottom: none;
  }

  .guideMg .listDiv {
    width: 360px;
    height: 220px;
    background-color: #fff;
    margin: 0 40px 40px 0;
    float: left;
    border-radius: 4px;
  }

  .guideMg .topInfo {
    width: 100%;
    height: 100%;
    background: url(../../assets/img/fangwei.png);
    font-size: 12px;
    color: #666666;
    border-radius: 4px;
    position: relative;
  }

  .guideMg .leftImg {
    float: left;
    margin: 16px 0 0 20px;
    width: 80px;
    text-align: center;
  }

  .guideMg .leftImg div {
    width: 80px;
    height: 80px;
    margin-bottom: 7px;
    overflow: hidden;
  }

  .guideMg .leftImg div img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
  }

  .guideMg .midInfo {
    float: left;
    margin: 16px 0 0 20px;
    line-height: 20px;
  }

  .guideMg .nainfo {
    font-size: 14px;
    color: #666;
  }

  .guideMg .naIn {
    color: #333;
  }

  .guideMg .midList {
    margin-top: 0;
  }

  .guideMg .icon-dianhua,
  .guideMg .icon-zuoji {
    color: #47bf8c;
    margin-right: 10px;
  }

  .guideMg .leftCode {
    float: left;
    margin: 5px 0 0 10px;
  }

  .guideMg .phoneNum {
    float: right;
    font-size: 14px;
    color: #333;
    margin: 15px 30px 0 0;
  }

  .guideMg .botmInfo {
    float: left;
    width: 100%;
    margin-top: 15px;
  }

  .guideMg .lagurage {
    width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .guideMg .btnList {
    position: absolute;
    top: 0;
    right: 0;
    height: 30px;
    line-height: 30px;
    display: none;
    background-color: #e95252;
    text-align: center;
    color: #fff;
    font-size: 12px;
    border-radius: 4px;
  }

  .guideMg .btnList span {
    display: inline-block;
    width: 35px;
    cursor: pointer;
    position: relative;
  }

  .guideMg .btnList span i {
    position: absolute;
    top: 11px;
    left: 35px;
    width: 1px;
    height: 10px;
    background-color: #fff;
  }

  .guideMg .listDiv:hover .btnList {
    display: block;
  }

  .guideMg .listDiv:hover {
    box-shadow: 0px 0px 20px rgba(191, 191, 191, 1);
    transition: all linear 0.5s;
  }

  .guideMg .leftCode text {
    letter-spacing: 18px;
  }

  .guideMg .leftCode canvas {
    height: 60px;
  }

  .guideMg ._sanjiao_ {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-top: 20px solid #e73828;
    border-bottom: 20px solid transparent;
    border-left: 20px solid #e73828;
    border-right: 20px solid transparent;
  }

  .guideMg ._sanjiao_:after {
    content: '外';
    position: absolute;
    top: -15px;
    left: -14px;
    white-space: nowrap;
    color: #FFFFFF;
    font-size: 12px;
  }

  .guideMg ._regMsg {
    width: 400px;
  }

  .guideMg ._regMsg .el-dialog__body div {
    display: flex;
  }

  .guideMg ._regMsg .el-dialog__body div p {
    color: #666;
    width: 50%;
  }

  .guideMg ._regMsg .el-dialog__body div p i {
    display: inline-block;
    width: 80px;
    text-align: right;
  }

  .guideMg ._regMsg .el-dialog__body div p span {
    color: #333;
  }

  .guideMg ._regMsg .el-dialog__body p._regMsg_tips {
    color: red;
    font-size: 12px;
    margin-top: 10px;
    text-align: center;
  }

  .guideMg ._regMsg .el-dialog__body {
    padding-bottom: 0;
  }

  .guideMg .btnList span:last-child {
    width: 65px;
  }

</style>
<template>
  <div class="flexOne guideMg">
    <div class="query-box">
      <ul>
        <li>
          <span>
            <em>{{$t('system.query_company')}}</em>
            <el-select v-model="msg.RB_Branch_id" clearable filterable :placeholder="$t('system.ph_choice')">
              <el-option :label="$t('system.ph_buxian')" :value='BranchDefaultValue'></el-option>
              <el-option v-for='item in BranchList' :key="item.Id" :label="item.BName" :value="item.Id">
              </el-option>
            </el-select>
          </span>
        </li>
        <li>
          <span>
            <em>{{$t('system.query_workType')}}</em>
            <el-select v-model="msg.Type" clearable :placeholder="$t('system.ph_choice')">
              <el-option :label="$t('system.ph_buxian')" value='0'></el-option>
              <el-option v-for="item in workTypeList" :key="item.Key" :label="item.Key" :value="item.Value">
              </el-option>
            </el-select>
          </span>
        </li>
        <li>
          <span>
            <em>{{$t('system.query_name')}}</em>
            <el-input v-model="msg.FullName" clearable @keyup.native.enter="getList" :placeholder="$t('system.ph_in')">
            </el-input>
          </span>
        </li>
        <li>
          <span>
            <em>{{$t('admin.admin_GuideLeibie')}}</em>
            <el-select v-model="msg.LeaderGuidClass" clearable :placeholder="$t('system.ph_choice')">
              <el-option :label="$t('system.ph_buxian')" :value='-1'></el-option>
              <el-option :label="$t('admin.admin_cpGuide')" :value='0'></el-option>
              <el-option :label="$t('admin.admin_waiGuide')" :value='1'></el-option>
            </el-select>
          </span>
        </li>
        <li>
          <span>
            <em>{{$t('system.table_Passport')}}</em>
            <el-input v-model="msg.Passport" clearable></el-input>
          </span>
        </li>
        <li>
          <span>
            <em>{{$t('system.table_IDcard')}}</em>
            <el-input v-model="msg.IdCard" clearable></el-input>
          </span>
        </li>
        <li>
          <span>
            <em>{{$t('system.table_phone')}}</em>
            <el-input v-model="msg.MobilePhone" clearable></el-input>
          </span>
        </li>
        <li>
          <span>
            <em>{{$t('ground.jingwaidh')}}</em>
            <el-input v-model="msg.SpareTel" clearable></el-input>
          </span>
        </li>
        <li>
          <span>
            <em>{{$t('ground.yuangongzh')}}</em>
            <el-select v-model="msg.EmployeeId" filterable :placeholder="$t('system.ph_in')" class="w120">
              <el-option :label="$t('pub.unlimitedSel')" value="0"></el-option>
              <el-option v-for="item in EmployeeList" :label="item.EmName" :value="item.EmployeeId"
                :key="item.EmployeeId"></el-option>
            </el-select>
          </span>
        </li>
        <li>
          <input type="button" class="hollowFixedBtn" :value="$t('pub.searchBtn')"
            @click="resetPageIndex(),getList()" />
          <input type="button" class="normalBtn" :value="$t('admin.admin_addGuide')"
            @click="outerVisible = true,dialogTitle=$t('ground.xinzenglddy'),initAddMsg()" />
        </li>
      </ul>
    </div>
    <div class="contentDiv clearfix">
      <div class="listDiv" v-for="(item, index) in DataList" :key="index">
        <div class="topInfo clearfix" v-if="item.Type === 3">
          <div class="_sanjiao_" v-if="item.LeaderGuidClass==1"></div>
          <div class="leftImg">
            <div class="">
              <img v-if="item.EmPhoto" :src="item.EmPhoto" :onerror='defaultImg'>
              <img v-else src="../../assets/img/default_head_img.jpg" />
            </div>
            <span>{{item.TypeEnumStr}}</span>
          </div>
          <div class="midInfo">
            <div class="nainfo">
              <span v-if="!item.LeaderGuidClass">{{$t('admin.admin_xing')}}</span>
              <span v-else>{{$t('admin.admin_xing')}}{{$t('admin.admin_ming')}}</span>：
              <span class="naIn" v-if="!item.LeaderGuidClass">{{item.Surname}}/{{item.EnSurname}}</span>
              <span class="naIn" v-if="item.LeaderGuidClass==1">{{item.Surname}}{{item.Name}}</span>
            </div>
            <div class="nainfo" v-if="item.LeaderGuidClass==1">
              <div class="phoneNum" style="margin-top: 10px;float: left">
                <i class="iconfont icon-dianhua"></i>{{item.MobilePhone?item.MobilePhone:$t('fnc.no')}}<br />
                <i class="iconfont icon-zuoji"></i><span
                  style="margin-left: 0">{{item.SpareTel?item.SpareTel:$t('fnc.no')}}</span>
              </div>
            </div>
            <div class="nainfo" v-if="!item.LeaderGuidClass">{{$t('admin.admin_ming')}}：<span
                class="naIn">{{item.Name}}/{{item.EnName}}</span></div>
            <div class="midList" v-if="!item.LeaderGuidClass">
              {{$t('system.table_sex')}}：{{item.Sex==0?$t('ground.manM'):$t('ground.nvM')}}</div>
            <div v-if="!item.LeaderGuidClass">{{$t('system.query_goCoun')}}：{{item.CountryName}}</div>
            <el-tooltip class="item" effect="dark" :content="item.LanguageName" placement="top-start"
              popper-class="max-w200" v-if="!item.LeaderGuidClass">
              <div class="lagurage" v-if="item.Type==3">{{$t('system.query_Language')}}：{{item.LanguageName}}
              </div>
            </el-tooltip>
          </div>
          <div class="clearfix botmInfo" v-if="!item.LeaderGuidClass">
            <div class="leftCode">
            </div>
            <div class="phoneNum">
              <i class="iconfont icon-dianhua"></i>{{item.MobilePhone?item.MobilePhone:$t('fnc.no')}}<br />
              <i class="iconfont icon-zuoji"></i><span
                style="margin-left: 0">{{item.SpareTel?item.SpareTel:$t('fnc.no')}}</span>
            </div>
          </div>
          <div class="btnList">
            <span
              @click="outerVisible=true,updateData(item.ID),dialogTitle=$t('ground.xiugailddy')">{{$t('pub.updateMsg')}}<i></i></span>
            <span @click="goUrl('leaderChedule',item.ID)">{{$t('leader.leader_schedule')}}<i></i></span>
            <span @click="goUrl2('leaderStateDetails',item.ID)">{{$t('leader.leader_performance')}}<i></i></span>
            <span @click="deletelist(item.ID)">{{$t('system.table_delete')}}<i></i></span>
            <span @click="AccountManage(item)">{{$t("visaT.Accountmanagement")}}</span>
          </div>
        </div>
        <div class="topInfo clearfix" v-else-if="item.Type !== 3">
          <div class="leftImg">
            <div class="">
              <img v-if="item.EmPhoto" :src="item.EmPhoto" :onerror='defaultImg'>
              <img v-else src="../../assets/img/default_head_img.jpg" />
            </div>
            <span>{{item.TypeEnumStr}}</span>
          </div>
          <div class="midInfo">
            <div class="nainfo">
              <span>{{$t('admin.admin_xing')}}</span>：
              <span class="naIn">{{item.Surname}}/{{item.EnSurname}}</span>
            </div>
            <div class="nainfo">{{$t('admin.admin_ming')}}：<span class="naIn">{{item.Name}}/{{item.EnName}}</span></div>
            <div class="midList">{{$t('system.table_sex')}}：{{item.Sex==0?$t('ground.manM'):$t('ground.nvM')}}</div>
            <div>{{$t('system.query_goCoun')}}：{{item.CountryName}}</div>
            <div>{{$t("ground.daituanshu")}}：{{item.TourNum}}</div>
            <el-tooltip class="item" effect="dark" :content="item.LanguageName" placement="top-start"
              popper-class="max-w200">
              <div class="lagurage" v-if="item.Type==3">{{$t('system.query_Language')}}：{{item.LanguageName}}
              </div>
            </el-tooltip>
          </div>
          <div class="clearfix botmInfo">
            <div class="leftCode">
            </div>
            <div class="phoneNum">
              <i class="iconfont icon-dianhua"></i>{{item.MobilePhone?item.MobilePhone:$t('fnc.no')}}<br />
              <i class="iconfont icon-zuoji"></i><span
                style="margin-left: 0">{{item.SpareTel?item.SpareTel:$t('fnc.no')}}</span>
            </div>
          </div>
          <div class="btnList">
            <span
              @click="outerVisible=true,updateData(item.ID),dialogTitle=$t('ground.xiugailddy')">{{$t('pub.updateMsg')}}<i></i></span>
            <span @click="goUrl('leaderChedule',item.ID)">{{$t('leader.leader_schedule')}}<i></i></span>
            <span @click="goUrl2('leaderStateDetails',item.ID)">{{$t('leader.leader_performance')}}<i></i></span>
            <span @click="deletelist(item.ID)">{{$t('system.table_delete')}}<i></i></span>
            <span @click="AccountManage(item)">{{$t("visaT.Accountmanagement")}}</span>
          </div>
        </div>
      </div>
    </div>
    <el-pagination background @current-change="handleCurrentChange" :current-page.sync="msg.currentPage"
      layout="total,prev, pager, next, jumper" :page-size="msg.pageSize" :total="msg.total">
    </el-pagination>
    <el-dialog custom-class='addCompany' :title="dialogTitle" :visible.sync="outerVisible" center
      :before-close="closeChangeMachie">
      <el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="100px">
        <el-form-item>
          <el-radio-group v-model="addMsg.LeaderGuidClass">
            <el-radio :label="0">{{$t('admin.admin_waiGuideT')}}</el-radio>
            <el-radio :label="1">{{$t('admin.admin_GuideLeibieT')}}</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item :label="$t('system.query_workType')" prop="Type" v-if="addMsg.LeaderGuidClass==0">
          <el-select v-model="addMsg.Type" :placeholder="$t('admin.admin_workType')" class="w210">
            <el-option v-for='item in workTypeList' :key="item.Value" :label="item.Key" :value="item.Value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('admin.admin_language')" class='multiple_input LanguageList'
          v-if="addMsg.Type==3&&addMsg.LeaderGuidClass==0">
          <el-select v-model="LanguageIdS" multiple :placeholder="$t('admin.admin_phlanguage')" class="w210">
            <el-option v-for='item in LanguageList' :key="item.ID" :label="item.Name" :value="item.ID">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('system.query_type')" v-if="addMsg.Type==2&&addMsg.LeaderGuidClass==0">
          <el-radio-group v-model="addMsg.LeaderGuidType">
            <el-radio label="1">{{$t("Operation.Op_longTerm")}}</el-radio>
            <el-radio label="2">{{$t("Operation.Op_shortTerm")}}</el-radio>
          </el-radio-group>
        </el-form-item>
        <div class="cn_name clearfix">
          <el-form-item :label="$t('admin.admin_Surname')" prop="Surname" class="name_input">
            <el-input v-model="addMsg.Surname" :placeholder="$t('admin.admin_xing')"
              v-on:input="setEngName(1,addMsg.Surname)"></el-input>
          </el-form-item>
          <el-form-item prop="Name" class="name_input">
            <el-input v-model="addMsg.Name" :placeholder="$t('admin.admin_ming')"
              v-on:input="setEngName(2,addMsg.Name)"></el-input>
          </el-form-item>
        </div>
        <div class="cn_name clearfix" v-if="addMsg.LeaderGuidClass==0">
          <el-form-item :label="$t('admin.admin_EnSurname')" prop="EnSurname" class="name_input">
            <el-input v-model="addMsg.EnSurname" :placeholder="$t('admin.admin_xing')"></el-input>
          </el-form-item>
          <el-form-item prop="EnName" class="name_input">
            <el-input v-model="addMsg.EnName" :placeholder="$t('admin.admin_ming')"></el-input>
          </el-form-item>
        </div>
        <el-form-item :label="$t('system.query_goCoun')" prop="CountryID" v-if="addMsg.LeaderGuidClass==0">
          <el-select v-model="addMsg.CountryID" filterable :placeholder="$t('admin.admin_choCou')" class="w210">
            <el-option v-for='item in countryList' :key="item.ID" :label="item.Name" :value="item.ID">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('system.query_company')" prop="RB_Branch_id" v-if="addMsg.LeaderGuidClass==0">
          <el-select v-model="addMsg.RB_Branch_id" filterable :placeholder="$t('system.ph_choice')" class="w210"
            @change="getDerpartMent(addMsg.RB_Branch_id)">
            <el-option v-for='item in BranchList' :key="item.Id" :label="item.BName" :value="item.Id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('admin.admin_IDcard')" prop="IdCard" class="other_input"
          v-if="addMsg.LeaderGuidClass==0">
          <el-input type="text" v-model="addMsg.IdCard" :placeholder="$t('admin.admin_phIDcard')" class="w210">
          </el-input>
        </el-form-item>
        <el-form-item :label="$t('admin.admin_BirthDate')" prop="BirthDate" class='time'
          v-if="addMsg.LeaderGuidClass==0">
          <el-date-picker class="w210" v-model="addMsg.BirthDate" type="date"
            :placeholder="$t('admin.admin_phBirthDate')" value-format="yyyy-MM-dd">
          </el-date-picker>
        </el-form-item>
        <el-form-item :label="$t('admin.admin_BirthPlace')" prop="BirthPlace" v-if="addMsg.LeaderGuidClass==0">
          <el-select v-model="addMsg.BirthPlace" filterable :placeholder="$t('admin.admin_phBirthPlace')" class="w210">
            <el-option v-for='item in cityList' :key="item.ID" :label="item.Name" :value="item.ID">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('system.table_sex')" prop="Sex">
          <el-select v-model="addMsg.Sex" :placeholder="$t('leader.leader_Sex')" class="w210">
            <el-option v-for='item in SexOptions' :key="item.value" :label="item.type" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('pub.mbPhoneNum')" prop="MobilePhone" class="other_input">
          <el-input type="text" v-model="addMsg.MobilePhone" :placeholder="$t('admin.admin_phPhone')" class="w210">
          </el-input>
        </el-form-item>
        <el-form-item :label="$t('ground.jingwaidh')" prop="SpareTel" class="other_input">
          <el-input type="text" v-model="addMsg.SpareTel" :placeholder="$t('admin.admin_SpareTel')" class="w210">
          </el-input>
        </el-form-item>
        <el-form-item :label="$t('system.table_Passport')" v-if="addMsg.LeaderGuidClass==0" prop="Passport"
          class="other_input">
          <el-input type="text" v-model="addMsg.Passport" :placeholder="$t('system.ph_Passport')" maxlength="9"
            class="w210"></el-input>
        </el-form-item>
        <el-form-item :label="$t('admin.admin_IssuePlace')" prop="IssuePlace" v-if="addMsg.LeaderGuidClass==0">
          <el-select v-model="addMsg.IssuePlace" filterable remote reserve-keyword
            :placeholder="$t('ground.qingshurugjz')" :remote-method="searchKey" :loading="loading2">
            <el-option v-for="item in searchList" :key="item.ID" :label="item.Name" :value="item.ID">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('admin.admin_IssueDate')" prop="IssueDate" class='time'
          v-if="addMsg.LeaderGuidClass==0">
          <el-date-picker class="w210" v-model="addMsg.IssueDate" type="date" :placeholder="$t('admin.admin_choDate')"
            value-format="yyyy-MM-dd">
          </el-date-picker>
        </el-form-item>
        <el-form-item :label="$t('admin.admin_ExpiryDate')" prop="ExpiryDate" class='time'
          v-if="addMsg.LeaderGuidClass==0">
          <el-date-picker class="w210" v-model="addMsg.ExpiryDate" type="date" :placeholder="$t('admin.admin_choDate')"
            value-format="yyyy-MM-dd">
          </el-date-picker>
        </el-form-item>
        <el-form-item :label="$t('admin.admin_VisaNumber')" prop="VisaNumber" v-if="addMsg.LeaderGuidClass==0">
          <el-radio-group v-model="addMsg.VisaNumber">
            <el-radio label="0">{{$t('pub.manyTime')}}</el-radio>
            <el-radio label="1">{{$t('pub.singleTime')}}</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item :label="$t('hotel.hotel_remark')" v-if="addMsg.LeaderGuidClass==0">
          <el-input type="textarea" v-model="addMsg.Remarks" class="w210"></el-input>
        </el-form-item>
        <el-form-item v-if="addMsg.LeaderGuidClass==1" :label="$t('admin.admin_password')">
          <el-input type="password" v-model="addMsg.EmPassword" class="w210"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <button class="normalBtn" type="primary" @click="submitForm('addMsg')">{{$t('pub.saveBtn')}}</button> &nbsp;
        <button class="hollowFixedBtn"
          @click="outerVisible = false,resetForm('addMsg')">{{$t('pub.cancelBtn')}}</button>
      </div>
    </el-dialog>
    <el-dialog custom-class='_regMsg' :title="$t('tips.tips')" :visible.sync="regMsgVisible" center>
      <div>
        <p><i>{{$t('system.query_workType')}}：</i><span>{{regMsg.TypeName}}</span></p>
        <p><i>{{$t('system.query_name')}}：</i><span>{{regMsg.Name}}</span></p>
      </div>
      <div>
        <p><i>{{$t('system.table_acc')}}：</i><span>{{regMsg.LoginName}}</span></p>
        <p><i>{{$t('admin.admin_password')}}：</i><span>{{regMsg.PassWord}}</span></p>
      </div>
      <p class="_regMsg_tips">{{$t("ground.mimabaoguantips")}}</p>
      <div slot="footer" class="dialog-footer" style="text-align: right">
        <button class="hollowFixedBtn" @click="regMsgVisible=false">{{$t("pub.sureBtn")}}</button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        searchList: [],
        loading2: false,
        outerVisible: false,
        //选择的语言
        LanguageIdS: "",
        //默认图片
        defaultImg: 'this.src="' + require("../../assets/img/default_head_img.jpg") + '"',
        //下拉框默认值
        DefaultSelectValue: 0,
        //分公司默认值
        BranchDefaultValue: -1,
        //请求数据参数
        msg: {
          Type: '0',
          FullName: "",
          RB_Branch_id: -1,
          pageIndex: 1,
          pageSize: 8,
          total: 0,
          currentPage: 1,
          // 查询类型【1-地接查询(领兼地和导游),2-操作查询领队】
          QueryType: 0,
          LeaderGuidClass: -1
        },
        addMsg: {
          ID: "0",
          Type: "3",
          EmployeeId: "",
          Surname: "",
          Name: "",
          EnSurname: "",
          EnName: "",
          IdCard: "",
          BirthDate: "",
          BirthPlace: "",
          Sex: "",
          MobilePhone: "",
          Passport: "",
          IssuePlace: "",
          IssueDate: "",
          ExpiryDate: "",
          CountryID: "",
          LanguageId: "",
          Remarks: "",
          VisaNumber: "",
          LeaderGuidType: "",
          LeaderGuidClass: 0,
          SpareTel: '',
          emRB_Department_Id: '',
          emRB_Post_Id: '',
          RB_Branch_id: '',
          EmPassword: '',
          EmAccount: '',
        },
        getDepartmentMsg: {
          RB_Group_Id: '0',
          RB_Branch_Id: '-1',
          Status: '0',
        },
        PostList: [],
        getPostMsg: {
          RB_Group_Id: '0',
          RB_Branch_Id: '-1',
          RB_Department_Id: '0',
        },
        SexOptions: [{
            value: "0",
            type: "男"
          },
          {
            value: "1",
            type: "女"
          }
        ],
        //数据列表
        DataList: [],
        //国家列表
        countryList: [],
        //城市列表
        cityList: [],
        //语言列表
        LanguageList: [],
        //工作类型列表
        workTypeList: [],
        //员工列表
        EmployeeList: [],
        //分公司列表
        BranchList: [],
        //部门
        departMentList: [],
        //操作标题
        dialogTitle: "",
        //加载层
        loading: true,
        hidePassworShow: true,
        regMsgVisible: false,
        regMsg: {},
        rules: {
          //表单必填验证
          CountryID: [{
            required: true,
            message: this.$t('visaT.qxzguojia'),
            trigger: "change"
          }],
          Type: [{
            required: true,
            message: this.$t('admin.admin_workType'),
            trigger: "change"
          }],
          RB_Branch_id: [{
            required: true,
            message: this.$t('rule.qszssgongsi'),
            trigger: "change"
          }],
          emRB_Department_Id: [{
            required: true,
            message: this.$t('rule.qxzsubm'),
            trigger: "change"
          }],
          emRB_Post_Id: [{
            required: true,
            message: this.$t('rule.qxzsugw'),
            trigger: "change"
          }],
          Surname: [{
              required: true,
              message: this.$t('visaT.qsrzwx'),
              trigger: "change"
            },
            {
              pattern: this.$commonUtils.Regex.el_IsChinese,
              message: this.$t('visaT.qsrzwx'),
            }
          ],
          Name: [{
              required: true,
              message: this.$t('rule.qsrzwm'),
              trigger: "change"
            },
            {
              pattern: this.$commonUtils.Regex.el_IsChinese,
              message: this.$t('rule.qsrzwm'),
            }
          ],
          EnSurname: [{
              required: true,
              message: this.$t('visaT.qsrywx'),
              trigger: "change"
            },
            {
              pattern: this.$commonUtils.Regex.el_IsEnglish,
              message: this.$t('visaT.qsrywx'),
            }
          ],
          EnName: [{
              required: true,
              message: this.$t('rule.qsrywm'),
              trigger: "change"
            },
            {
              pattern: this.$commonUtils.Regex.el_IsEnglish,
              message: this.$t('rule.qsrywm'),
            }
          ],
          IdCard: [{
              required: true,
              message: this.$t('rule.qsrIdnum'),
              trigger: "change"
            },
            {
              pattern: this.$commonUtils.Regex.el_IsIDnumber,
              message: this.$t('rule.qsrIdnum'),
            }
          ],
          BirthDate: [{
            required: true,
            message: this.$t('admin.admin_phBirthDate'),
            trigger: "change"
          }],
          Sex: [{
            required: true,
            message: this.$t('rule.qxzxb'),
            trigger: "change"
          }],
          MobilePhone: [{
              required: true,
              message: this.$t('rule.qsrzqsjh'),
              trigger: "change"
            },
            {
              pattern: this.$commonUtils.Regex.el_isInteger,
              message: this.$t('rule.qsrzqsjh'),
            }
          ],
          // SpareTel: [
          //   {
          //     pattern: this.$commonUtils.Regex.el_isInteger,
          //     message: "请输正确的电话"
          //   }
          // ],
          Passport: [{
              required: true,
              message: this.$t('rule.qsrzqhzh'),
              trigger: "change"
            },
            {
              pattern: this.$commonUtils.Regex.el_IsNumEn,
              message: this.$t('rule.qsrzqhzh'),
            }
          ],
          IssuePlace: [{
            required: true,
            message: this.$t('rule.qxzqfgj'),
            trigger: "change"
          }],
          IssuePlaceCity: [{
            required: true,
            message: this.$t('rule.qxzqfcs'),
            trigger: "change"
          }],
          IssueDate: [{
            required: true,
            message: this.$t('rule.qxzqfrq'),
            trigger: "change"
          }],
          ExpiryDate: [{
            required: true,
            message: this.$t('rule.qxzgqr'),
            trigger: "change"
          }],
          BirthPlace: [{
            required: true,
            message: this.$t('visaT.qxzguojia'),
            trigger: "change"
          }],
          EmPassword: [{
            required: true,
            message: this.$t('admin.admin_lnLoginName'),
            trigger: "blur"
          }],
          EmAccount: [{
            required: true,
            message: this.$t('admin.admin_lnLoginPwd'),
            trigger: "blur"
          }],
        }
      };
    },
    methods: {
      searchKey(query) {
        if (query !== '') {
          this.loading2 = true
          this.apipost(
            "dict_post_Destination_GetCountryByKeyWord", {
              keyWord: query
            },
            res => {
              if (res.data.resultCode == 1) {
                this.searchList = res.data.data
              } else {
                this.Error(res.data.message);
              }
              this.loading2 = false
            },
            err => {}
          );
        }
      },
      //领队账户管理
      AccountManage(item) {
        this.$router.push({
          name: "empBankAccount",
          query: {
            id: item.ID,
            type: 7,
            blank: 'y',
            tab: '账户管理'
          }
        });
      },
      setEngName(type, name) {
        if (type == 1 && name != "") {
          this.addMsg.EnSurname = this.$languageUtils.ConvertChineseToPinYin(
            name
          );
        } else {
          this.addMsg.EnName = this.$languageUtils.ConvertChineseToPinYin(name);
        }
      },
      goUrl(path, ID) {
        this.$router.push({
          path: path,
          query: {
            id: ID,
            blank: 'y',
            tab: '档期管理'
          }
        });
      },
      goUrl2(path, ID) {
        this.$router.push({
          path: path,
          query: {
            id: ID,
            Type: 2,
            blank: 'y',
            tab: '绩效统计'
          }
        });
      },
      //获取现有领队列表
      getList() {
        var that = this;
        that.loading = true;
        that.apipost(
          "leader_post_GetPageList",
          that.msg,
          res => {
            that.loading = false;
            if (res.data.resultCode == 1) {
              that.DataList = res.data.data.pageData;
              that.msg.total = res.data.data.count;
            } else {
              that.Error(res.data.message);
            }
          },
          err => {}
        );
      },
      getCountry() {
        //获取国家
        this.apipost(
          "dict_post_Destination_GetCountry", {},
          res => {
            this.countryList = res.data.data;
          },
          err => {}
        );
      },
      //获取工作类型(值获取领兼地和导游)
      getWorkType() {
        this.apipost(
          "leader_post_GetType", {},
          res => {
            if (res.data.resultCode == 1) {
              res.data.data.forEach(item => {
                // if (item.Value != 1) {
                this.workTypeList.push(item);
                // }
              });
            }
          },
          err => {}
        );
      },
      //获取中国下面的城市列表
      getCityList() {
        this.apipost(
          "dict_post_Destination_GetChildList", {
            Id: 2
          },
          res => {
            this.cityList = res.data.data;
          },
          err => {}
        );
      },
      //获取语言
      getLanguage() {
        this.apipost(
          "language_post_GetList", {},
          res => {
            this.LanguageList = res.data.data;
          },
          err => {}
        );
      },
      //获取员工列表获取账号
      getEmployeeList() {
        let msg = {
          GroupId: "",
          BranchId: "",
          DepartmentId: "",
          PostId: "",
          IsLeave: "0"
        };
        this.apipost(
          "admin_get_EmployeeGetList",
          msg,
          res => {
            this.EmployeeList = res.data.data;
          },
          err => {}
        );
      },
      //获取公司列表
      getBranchList() {
        let msg = {
          Status: "0",
          is_show: "",
          RB_Group_Id: ""
        };
        this.apipost(
          "admin_get_BranchGetList",
          msg,
          res => {
            this.BranchList = res.data.data;
          },
          err => {}
        );
      },
      //获取部门
      getDerpartMent(id) {
        this.getDepartmentMsg.RB_Branch_Id = id;
        this.apipost('admin_get_DepartmentGetList', this.getDepartmentMsg, res => {
          if (res.data.resultCode == 1) {
            this.departMentList = res.data.data;
          } else {}
        }, err => {})
      },
      //岗位
      getPost(id, id2) {
        this.getPostMsg.RB_Department_Id = id2;
        this.getPostMsg.RB_Branch_Id = id;
        this.apipost('admin_get_PostGetList', this.getPostMsg, res => {
          if (res.data.resultCode == 1) {
            this.PostList = res.data.data;
          } else {}
        }, err => {})
      },
      //添加
      addGroupGuide() {
        this.apipost(
          "leader_post_Set",
          this.addMsg,
          res => {
            if (res.data.resultCode == 1) {
              this.Success("保存成功！");
              this.getList();
              this.outerVisible = false;
              this.initAddMsg();
              if (res.data.data.PassWord) {
                this.regMsgVisible = true;
                this.regMsg = res.data.data;
              }
            } else {
              this.Error(res.data.message);
            }
          },
          err => {}
        );
      },
      submitForm(addMsg) {
        //提交创建、修改表单
        let that = this;
        let LanguageSring = "";
        if (this.LanguageIdS != "") {
          that.LanguageIdS.forEach(x => {
            LanguageSring = LanguageSring + x + ",";
          });
        }
        that.addMsg.LanguageId = LanguageSring;
        that.$refs[addMsg].validate(valid => {
          if (valid) {
            that.addGroupGuide();
          } else {
            return false;
          }
        });
      },
      deletelist(ID) {
        var that = this;
        that.Confirm(this.$t('tips.shifoushanchu'), function () {
          that.apipost(
            "leader_post_Remove", {
              ID: ID
            },
            res => {
              if (res.data.resultCode == 1) {
                that.getList();
              }
            },
            err => {}
          );
        });
      },
      initAddMsg() {
        //初始化创建、修改表单数据
        let newMsg = {
          ID: "0",
          Type: "3",
          EmployeeId: "",
          Surname: "",
          Name: "",
          EnSurname: "",
          EnName: "",
          IdCard: "",
          BirthDate: "",
          BirthPlace: "",
          Sex: "",
          MobilePhone: "",
          Passport: "",
          IssuePlace: "",
          IssueDate: "",
          ExpiryDate: "",
          CountryID: "",
          LanguageId: "",
          Remarks: "",
          VisaNumber: "",
          LeaderGuidType: "",
          LeaderGuidClass: 0,
          SpareTel: '',
          emRB_Department_Id: '',
          emRB_Post_Id: '',
          RB_Branch_id: '',
          EmAccount: '',
          EmPassword: ''
        };
        this.addMsg = newMsg;
      },
      //翻页功能按钮
      handleCurrentChange(val) {
        this.msg.pageIndex = val;
        this.getList();
      },
      //查询初始化页码
      resetPageIndex() {
        this.msg.pageIndex = 1;
        this.msg.currentPage = 1;
      },
      //修改
      updateData(ID) {
        this.LanguageIdS = [];
        this.apipost(
          "leader_post_Get", {
            ID: ID
          },
          res => {
            let LanguageIdArr = [];
            this.addMsg = res.data.data;
            this.addMsg.LeaderGuidClass = this.addMsg.LeaderGuidClass ? this.addMsg.LeaderGuidClass : 0;
            this.addMsg.Type = this.addMsg.Type.toString();
            this.addMsg.Sex = this.addMsg.Sex.toString();
            this.addMsg.LeaderGuidType = this.addMsg.LeaderGuidType.toString();
            this.addMsg.VisaNumber = this.addMsg.VisaNumber.toString();
            if (this.addMsg.emRB_Department_Id) {
              this.getPost(this.addMsg.RB_Branch_id, this.addMsg.emRB_Department_Id);
              this.getDerpartMent(this.addMsg.RB_Branch_id)
            }
            if (this.addMsg.LanguageId) {
              this.addMsg.LanguageId = this.addMsg.LanguageId.substr(
                0,
                this.addMsg.LanguageId.length - 1
              );
              LanguageIdArr = this.addMsg.LanguageId.split(",");
              LanguageIdArr.forEach(x => {
                this.LanguageIdS.push(Number(x));
              });
            }
            this.searchKey(this.addMsg.CityName)
            this.addMsg.EmPassword = "";
          },
          err => {}
        );
      },
      //弹出框关闭初始化弹框内表单
      closeChangeMachie(done) {
        done();
        this.resetForm("addMsg");
      },
      //弹出框取消 初始化谈框内表单
      resetForm(formName) {
        this.$refs[formName].resetFields();
        this.LanguageIdS = [];
      }
    },
    mounted() {
      this.getList();
      this.getCountry();
      this.getCityList();
      this.getWorkType();
      this.getLanguage();
      this.getEmployeeList();
      this.getBranchList();
      let userInfo = this.getLocalStorage();
      // this.getPostMsg.RB_Group_Id=this.getDepartmentMsg.RB_Group_Id=this.addMsg.RB_Group_id=this.msg.RB_Group_id=userInfo.RB_Group_id;    //集团
    }
  };

</script>
