<style>
@import "../../assets/css/newTravelManager.css";

/* 送签日期 */
.groupInquiry_edit{
  overflow: auto;
  display: block;
  position: fixed;
  z-index: 50;
  bottom: 0;
  left: 0;
  border-top: 3px solid #38425d;
  background-color: #f9f9f9;
  padding: 10px;
  width: 100%;
  min-width: 1146px;
}

.groupInquiry_edit::-webkit-scrollbar {
  width: 4px;
  height: 8px;
}
.groupInquiry_edit::-webkit-scrollbar-thumb {
  border-radius: 4px;
  -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
  background: #c9c9c9;
}
.groupInquiry_edit::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  background: #ededed;
}
.groupInquiry_edit_tit>span{
  padding-left: 10px;
  border-left: 3px solid #e95252;
  font-size: 16px;
  font-family: "PingFangSc-Fine";
  color: #000000;
}
.groupInquiry_edit_tit>div{
  float: right;
}
.groupInquiry_edit_form{
  margin: 20px 0 30px 0;
  padding: 0 0 0 13px;
}
.groupInquiry_edit_form > div > em {
  margin: 0 10px 0 0;
  font-size: 12px;
  color: #666666;
}
.groupInquiry_edit_form > div > .groupInquiry_header_input2 {
  width: 160px;
}

/* 进馆日 */
.groupInquiry_admission{
  overflow: auto;
  display: block;
  position: fixed;
  z-index: 50;
  bottom: 0;
  left: 0;
  border-top: 3px solid #38425d;
  background-color: #f9f9f9;
  padding: 10px;
  width: 100%;
  min-width: 1146px;
}

.groupInquiry_admission::-webkit-scrollbar {
  width: 4px;
  height: 8px;
}
.groupInquiry_admission::-webkit-scrollbar-thumb {
  border-radius: 4px;
  -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
  background: #c9c9c9;
}
.groupInquiry_admission::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  background: #ededed;
}
.groupInquiry_admission_tit>span{
  padding-left: 10px;
  border-left: 3px solid #e95252;
  font-size: 16px;
  font-family: "PingFangSc-Fine";
  color: #000000;
}
.groupInquiry_admission_tit>div{
  float: right;
}
.groupInquiry_admission_form{
  margin: 20px 0 30px 0;
  padding: 0 0 0 13px;
}
.groupInquiry_admission_formItem{
    white-space: nowrap;
}
.groupInquiry_admission_formItem > em {
  margin: 0 10px 0 0;
  font-size: 12px;
  color: #666666;
}
.groupInquiry_admission_formItem .groupInquiry_admission_input2 {
  width: 160px;
}
.GQ_companyList span {
  display: inline-block;
  font-size: 12px;
  padding: 5px 10px;
  border: 1px solid #d1d1d1;
  margin: 5px 10px 0 0;
  border-radius: 4px;
  cursor: pointer;
}
.GQ_companyList span:first-child {
  margin-right: 20px;
}
.GQ_companyList {
  padding-top: 15px;
  margin-left: 32px;
}
.GQ_companyList{
  margin-bottom:20px;
}
.TC_checked {
  border: 1px solid #d95454 !important;
  box-sizing: border-box;
}
/* 名单 */
  .RL-remarkTitle {
    display: inline-block;
    width: 36px;

    white-space: nowrap;
    font-size: 14px;
  }
.RL-remarkCon span {
    margin-right: 5px;
}
.person_fan{
    width: 100%;
    border-top: 1px solid #e5e5e5;
    padding: 0 10px;
    font-size: 12px;
    padding: 15px 6px;
    box-sizing: border-box;
}
/* 财务单据的颜色 */
  .groupTourOrder_tickets_red {
    color: #FF0000;
    text-decoration: underline;
    cursor: pointer;
  }

  .groupTourOrder_tickets_blue {
    color: #0000FF;
    text-decoration: underline;
    cursor: pointer;
  }

  .groupTourOrder_tickets_green {
    color: #008000;
    cursor: pointer;
    text-decoration: underline;
  }
.groupTourOrder_tickets_black {
  color: #000000;
  text-decoration: underline;
}
.comSearchDiv-span{
  display: flex;
  justify-content: space-between;
}
</style>
<template>
  <div>
    <!-- <ul class="TC_ListNav clearfix" v-if="queryCommonData.IsParentCompany==1">
      <el-tabs v-model="queryCommonData.activeName" @tab-click="getCompanyTab(queryCommonData.activeName)">
        <el-tab-pane :label="$t('advmanager.v_all')" name="-1"></el-tab-pane>
        <el-tab-pane :label="item.BName" :name="item.Id.toString()" :key="item.subCode" v-for="item in queryCommonData.BranchList">
        </el-tab-pane>
      </el-tabs>
    </ul> -->
    <div class="GQ_companyList" v-if="queryCommonData.IsParentCompany==1">
      <span :class="{'TC_checked':queryCommonData.checkCompanyAll}" @click="getCompanyCheckAll()">{{$t('advmanager.v_all')}}</span>
      <span v-for="(item,bindex) in queryCommonData.BranchList" :class="{'TC_checked':item.isShow}" @click="getCompanyCheck(item)">{{item.BName}}</span>
    </div>
    <div class="TC_Content TC-MyList">
      <div class="query-box">
        <ul>
          <li>
            <span>
              <em>{{$t('system.table_ssLine')}}</em>
              <el-select class='w150' v-model="queryMsg.LineId" filterable :placeholder="$t('pub.pleaseSel')" @change="getLineTeamList()">
                <el-option :label="$t('pub.unlimitedSel')" :value='queryCommonData.SelectDefaultValue'></el-option>
                <el-option v-for="(item,index) in queryCommonData.LineList" :label='item.LineName' :value='item.LineID' :key='index+10000'>
                </el-option>
              </el-select>
            </span>
          </li>
          <li>
            <span>
              <em>{{$t('active.ad_xlmc')}}</em>
              <el-select class='w150' v-model="queryMsg.LineteamId" filterable :placeholder="$t('pub.pleaseSel')">
                <el-option :label="$t('pub.unlimitedSel')" :value='queryCommonData.SelectDefaultValue'></el-option>
                <el-option v-for="item in queryCommonData.LineTeamList" :label='item.LtName' :value='item.LtID' :key='item.LtID'>
                </el-option>
              </el-select>
            </span>
          </li>
          <li>
            <span>
              <em>{{$t('visa.v_tuanhao')}}</em>
              <el-input maxlength="50" v-model="queryMsg.TCNUM" class="permiss-input w150" @keyup.native.enter="getControlList"
                :placeholder="$t('pub.pleaseImport')"></el-input>
            </span>
          </li>
          <li>
            <span>
              <em>{{$t('scen.sc_ftTime')}}</em>
              <el-date-picker class="w150" type="date" v-model='queryMsg.StartGroupDate' :picker-options="pickerBeginDateBefore"
                value-format="yyyy-MM-dd" placeholder="">
              </el-date-picker>
              <el-date-picker class="w150" type="date" v-model='queryMsg.EndGroupDate' :picker-options="pickerBeginDateAfter"
                value-format="yyyy-MM-dd" placeholder="">
              </el-date-picker>
            </span>
          </li>
          <li>
            <span>
              <em>{{$t('visa.v_qianzhengst')}}</em>
              <el-select v-model="queryMsg.TCVisaStatus" clearable  class="w150" filterable  :placeholder="$t('pub.pleaseSel')">
                <el-option :label="$t('pub.unlimitedSel')" value="-1"></el-option>
                <el-option :label="$t('visa.v_weibanli')" value="1"></el-option>
                <el-option :label="$t('visa.v_banlizhong')" value="2"></el-option>
                <el-option :label="$t('visa.v_yibanli')" value="3"></el-option>
              </el-select>
            </span>
          </li>
          <li>
            <span>
              <em>{{$t('objFill.tuanduilx')}}</em>
              <el-select v-model="queryMsg.TeamType" clearable  class="w150" filterable  :placeholder="$t('pub.pleaseSel')">
                <el-option :label="$t('objFill.changguit')" value="0"></el-option>
                <el-option :label="$t('objFill.xiaobaot')" value="1"></el-option>
              </el-select>
            </span>
          </li>
          <li class="advancedLi">
            <el-popover popper-class="advanceQueryList" v-model="queryCommonData.showHigradeSearch" trigger="click">
              <div>
                <div class="TC_queryTitle">{{$t('visa.v_tkgjcx')}}</div>
                <div class="clearfix">
                  <div class="TC_leftSearch">
                    <div>
                      <span>{{$t('system.query_airCompanyName')}}</span>
                      <el-select v-model="queryMsg.AirTicketId" filterable :placeholder="$t('system.ph_buxian')" class="w150">
                        <el-option :label='$t("system.ph_buxian")' :value='queryCommonData.SelectDefaultValue'></el-option>
                        <el-option v-for="item in queryCommonData.AirlineList" :key="item.AirLineId" :label="item.AlName" :value="item.AirLineId">
                        </el-option>
                      </el-select>
                    </div>
                    <div>
                      <span>{{$t('visa.v_czuser')}}</span>
                      <el-select class='w150' v-model="queryMsg.CreateBy" filterable :placeholder="$t('pub.pleaseSel')">
                        <el-option :label="$t('pub.unlimitedSel')" :value='queryCommonData.SelectDefaultValue'></el-option>
                        <el-option v-for="item in queryCommonData.EmployeeList" :label='item.EmName' :value='item.EmployeeId' :key='item.EmployeeId'>
                        </el-option>
                      </el-select>
                    </div>
                    <div>
                      <span>{{$t('visa.v_xcdays')}}</span>
                      <el-input maxlength="50" v-model="queryMsg.DayNum" @keyup.native="checkInteger(queryMsg,'DayNum')"
                        class="w150" :placeholder="$t('pub.pleaseImport')"></el-input>
                    </div>

                    <div>
                      <span>{{$t('visa.v_lycity')}}</span>
                      <el-select class='w150' filterable v-model="queryMsg.UnionCityId" :placeholder="$t('pub.pleaseSel')">
                        <el-option :label="$t('pub.unlimitedSel')" :value='queryCommonData.SelectDefaultValue'></el-option>
                        <el-option v-for="item in queryCommonData.CityList" :label='item.Name' :value='item.ID' :key='item.ID'>
                        </el-option>
                      </el-select>
                    </div>

                  </div>
                  <div class="TC_rightSearch">
                    <div>
                      <span>{{$t('visa.v_teamnum')}}</span>
                      <el-input maxlength="50" class="w80" v-model="queryMsg.TeamMinNum" @keyup.native="checkInteger(queryMsg,'TeamMinNum')"
                        :placeholder="$t('pub.pleaseImport')"></el-input>
                      -
                      <el-input maxlength="50" class="w80" v-model="queryMsg.TeamMaxNum" @keyup.native="checkInteger(queryMsg,'TeamMaxNum')"
                        @blur="checkTeamNum(queryMsg)" :placeholder="$t('pub.pleaseImport')"></el-input>
                    </div>
                    <div>
                      <span>{{$t('leader.leader_registraNum')}}</span>
                      <el-input maxlength="50" class="w80" v-model="queryMsg.ApplyMinNum" @keyup.native="checkInteger(queryMsg,'ApplyMinNum')"
                        :placeholder="$t('pub.pleaseImport')"></el-input>
                      -
                      <el-input maxlength="50" class="w80" v-model="queryMsg.ApplyMaxNum" @keyup.native="checkInteger(queryMsg,'ApplyMaxNum')"
                        @blur="checkTeamNum(queryMsg)" :placeholder="$t('pub.pleaseImport')"></el-input>
                    </div>
                    <div class="OnlyShowOverTeam">
                      <span>{{$t('visa.v_zkbaochaotuan')}}</span>
                      <el-switch v-model="queryMsg.OnlyShowOverTeam" active-value="true" inactive-value="false"></el-switch>
                    </div>
                    <div>
                        <span>{{$t('visa.v_salecompany')}}</span>
                        <el-select class="w180 multiple_input" :class="{'SaleBranchList':queryMsg.SaleBranchId==''}" v-model="queryMsg.SaleBranchId" multiple>
                          <el-option v-for='item in queryCommonData.companyList' :key="item.id" :label="item.bName" :value="item.id">
                          </el-option>
                        </el-select>
                    </div>
                  </div>
                </div>
                <div class="comSearchDiv">
                  <span class="comSearchDiv-span"> <span>{{$t('scen.sc_temStatu')}}</span> <el-checkbox v-model="queryCommonData.checkTCStateAll" @change="checkAllTeam">{{$t('system.table_chekAll')}}</el-checkbox></span>
                  <span>
                    <el-checkbox-group v-model="queryMsg.TCState" @change="checkedTeamList">
                      <el-checkbox v-for="team in $tripUtils.TeamStatesList.TeamStates" :label="team.Id" :key="team.Name">{{team.Name}}</el-checkbox>
                    </el-checkbox-group>
                  </span>
                </div>
                <!-- <div class="comSearchDiv" v-if="queryCommonData.showPlatForm"> -->
                <div class="comSearchDiv">
                  <span class="comSearchDiv-span"><span>{{$t('Airticket.Air_salesPlatform')}}</span><el-checkbox v-model="queryCommonData.checkPlatForm" @change="checkAllSales">{{$t('system.table_chekAll')}}</el-checkbox></span>
                  <span>

                    <el-checkbox-group v-model="queryMsg.SalePlat" @change="checkSales">
                      <el-checkbox v-for="sales in $tripUtils.TeamStatesList.salsPlat" :label="sales.Id" :key="sales.Name">{{sales.Name}}</el-checkbox>
                    </el-checkbox-group>
                  </span>
                </div>
                <div class="comSearchDiv">
                  <span class="comSearchDiv-span"><span>{{$t('visa.v_tqstatus')}}</span><el-checkbox v-model="queryCommonData.checkGroupALL" @change="checkGroupAll">{{$t('system.table_chekAll')}}</el-checkbox></span>
                  <span>

                    <el-checkbox-group v-model="queryMsg.GroupState" @change="checkGroup">
                      <el-checkbox v-for="state in $tripUtils.TeamStatesList.teamDateStates" :label="state.Id" :key="state.Name">{{state.Name}}</el-checkbox>
                    </el-checkbox-group>
                  </span>
                </div>
                <div class="comSearchDiv">
                  <span>{{$t('visa.v_hbstatus')}}</span>
                  <span>
                    <el-checkbox-group v-model="queryCommonData.flightCKed" style="margin-left:0;">
                      <el-checkbox v-for="state in flightStatus" :label="state.Id" :checked="state.Checked" @change="checkedFlight(state)" :key="state.Name">{{state.Name}}</el-checkbox>
                    </el-checkbox-group>
                  </span>
                </div>

                <button class="normalBtn TC_SearchBtn" @click="getControlList(),resetPageIndex(),queryCommonData.showHigradeSearch=false">{{$t('pub.searchBtn')}}</button>
              </div>
              <span class="advancedQuery" slot="reference">{{$t('visa.v_gjchaxun')}}<i class="iconfont icon-xiaotuziCduan_1"></i></span>
            </el-popover>
          </li>
          <li>
            <button class="hollowFixedBtn" @click="getControlList(),resetPageIndex()">{{$t('pub.searchBtn')}}</button>
          </li>
        </ul>
      </div>

      <div class="TravelTclList" v-loading="queryCommonData.loading">
        <ul>
        <el-pagination background @current-change="handleCurrentChange" :current-page.sync="queryMsg.currentPage" layout="total,prev, pager, next, jumper"
          :page-size='queryMsg.pageSize' :total='queryMsg.total'>
        </el-pagination>
          <li v-for="(item,index) in queryCommonData.dataList" :key="index">
                      <div>
                          <div class="el-col" style="width:280px">
                              <div>
                                  <div class="TCL-TCNUM">{{item.TCNUM}}({{item.TCID}})</div>
                                  <div class="d12" style="float:none;margin:3px auto;">
                                      <p><i class="iconfont icon-biaoti1"></i>{{item.LineName}}</p>
                                      <p class="d12p">{{item.Title}}</p>
                                  </div>
                                  <div class="TC_TravelSalePlat clearfix">
                                    <span class="TC_neibu" v-if="item.TCState==3" :class="{'TCneibu':plat==3,'TCb2b':plat==1,'TCb2c':plat==2,'AppPlat':plat==4,'otherPlat':plat==5}"
                                      v-for="plat in item.SalePlatList" :key="plat.subCode">
                                      {{$tripUtils.getPlatName(plat)}}
                                    </span>
                                    <span class="TC_xiajia daiwanshan" v-if="item.TCState==1">{{$t('visa.v_dwanshan')}}</span>
                                    <span class="TC_xiajia" v-if="item.TCState==2">{{$t('visa.v_yxiajia')}}</span>
                                    <span class="TC_xiajia quxiao" v-if="item.TCState==4">{{$t('hotel.hotel_HasBeenCancelled')}}</span>
                                  </div>
                              </div>
                          </div>
                          <div class="el-col" style="width:200px;">
                              <div class="d2">
                                  <p class="TCLflight_GO"><i class="iconfont icon-hangban1"></i>{{$t('visa.v_hangban')}}</p>
                                  <el-popover width="900" trigger="click" popper-class="TC_tripDetails">
                                      <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                          <tr class="_color_666" style="text-align:center;">
                                              <th width="60">{{$t('Airticket.Air_segment')}}</th>
                                              <th width="80">{{$t('system.query_flightNum')}}</th>
                                              <th width="150">{{$t('system.ph_flightTime')}}</th>
                                              <th width="80">{{$t('system.query_arrivalTime')}}</th>
                                              <th width="100">{{$t('system.query_stopCity')}}</th>
                                          </tr>
                                          <tr v-for="(ds,din) in item.flightList" :key="din" style="text-align:center;">
                                              <td class="_d_name _color_666">
                                                  <span v-if="din==0">{{$t('Airticket.Air_go')}}</span>
                                                  <span v-else-if="din==item.flightList.length-1">{{$t('Airticket.Air_returnTrip')}}</span>
                                                  <span v-else-if="din>0 && din!=item.flightList.length-1">{{$t('Airticket.Air_transit')}}</span>
                                              </td>
                                              <td>
                                                  <div>{{ds.Flight_number}}</div>
                                                  <div style="margin-top:5px;">{{ds.AlName}}</div>
                                              </td>
                                              <td>
                                                  <div>{{ds.FlightDate}} {{ds.Departure_time}}</div>
                                                  <div style="margin-top:5px;">{{ds.dName}}</div>
                                              </td>
                                              <td>
                                                  <div>{{ds.FlightArrivalTime}} {{ds.Arrival_time}}</div>
                                                  <div style="margin-top:5px;">{{ds.aName}}</div>
                                              </td>
                                              <td>{{ds.StopoverName}}</td>
                                          </tr>
                                      </table>
                                      <div class="FlightDiv-TCL" slot="reference">
                                        <div v-for="subItem in item.flightList" slot="reference" :key="subItem.subCode" class="TCL-flighInfoList">
                                          <span class="TCL-FlightNumber">{{subItem.Flight_number}}</span>
                                          <span>{{subItem.DepartureName}}</span>
                                          <span v-if="subItem.StopoverName">-</span>
                                          <span>{{subItem.StopoverName}}</span>
                                          <span v-if="subItem.ArrivalCityName">-</span>
                                          <span>{{subItem.ArrivalCityName}}</span>
                                          <span v-if="subItem.FlightState==1" class="TCL-greenType">【{{$t('pub.sureBtn')}}】</span>
                                          <span v-if="subItem.FlightState==2" class="TCL-redType">【{{$t('visa.v_zanding')}}】</span>
                                        </div>
                                      </div>
                                  </el-popover>
                              </div>
                          </div >
                          <div class="el-col" style="width:190px;">
                              <div class="d3">
                                  <p><i class="iconfont icon-tuandui"></i>{{$t('visa.v_teaminfo')}}<em>{{item.DayNum}}{{$t('hotel.hotel_day')}}{{item.NightNum}}{{$t('Operation.Op_night')}}</em></p>
                                  <p><span>{{$t('Airticket.Air_StartTime')}}</span>{{item.StartDate}}</p>
                                  <p><span>{{$t('scen.sc_cp')}}</span>{{item.OutBranchName}}</p>
                              </div>
                          </div>
                          <div class="el-col" style="width:200px;">
                              <div class="d5">
                                  <p><i class="iconfont icon-tuanwei"></i>{{$t('visa.v_tuanweiinfo')}}</p>
                                  <p><span>{{$t('visa.v_currentseat')}}</span><i>{{item.SurplusSeat=item.SurplusSeat < 0 ? 0:item.SurplusSeat}}</i></p>
                                  <p><span>{{$t('visa.v_yibaoru')}}</span><i @click='goUrlX("RegistrationList", item.TCID)' style="cursor:pointer;">{{item.OrderGuestNum}}<span class="TCL-redType" v-if="item.OrderLeaderGuestNum>=1">+{{item.OrderLeaderGuestNum}}</span>{{$t('hotel.hotel_people')}}</i>({{$t('Operation.Op_takeSeat')}}:{{item.Occupied}}{{$t('Operation.Op_people')}})</p>
                                  <p><span>{{$t('visa.v_houbu')}}</span>
                                      <span v-if='item.IsSubstitution==1' class="TCL-greenType">{{$t('visa.v_yxhoubu')}}</span>
                                      <span v-else class="TCL-redType">{{$t('visa.v_byxhoubu')}}</span>
                                  </p>
                                  <p><span @click="goUrlY('TravelPassengerList',item.TCID)" style="cursor:pointer;text-decoration:underline;">{{$t('salesModule.LKMD')}}</span></p>
                              </div>
                          </div>
                          <div class="el-col" style="width:130px;">
                              <div class="d5 TC-oparation">
                                  <p><i class="iconfont icon-yuangong"></i>{{$t('Operation.Op_caozuoop')}}</p>
                                  <div class="clearfix TC-OpInfo">
                                      <div class="TC-leftIMG">
                                          <img v-if="item.OPPhoto" :src="item.OPPhoto" alt="">
                                          <img v-else src="../../assets/img/default_head_img.jpg" alt="">
                                      </div>
                                      <div class="TC-OPName">{{item.OPName}}</div>
                                  </div>
                                  <div class="TC_SeatList">
                                    {{$t('Airticket.Air_firstClass')}}:{{item.FSeat}}
                                  </div>
                                  <div class="TC_SeatList">
                                    {{$t('Airticket.Air_businessClass')}}:{{item.CSeat}}
                                  </div>
                                  <div class="TC_SeatList">
                                    {{$t('Airticket.Air_EconomyClass')}}:{{item.YSeat}}
                                  </div>
                              </div>
                          </div>
                          <div class="el-col" style="width:190px;">
                              <div class="d3">
                                  <p><i class="iconfont icon-qianzheng"></i>{{$t('active.cl_qianzheng')}}</p>
                                  <p><span>{{$t('visa.v_qianzhengst')}}:</span><i @click="goUrlP('visaWorksheet',item.TCID)" style="cursor:pointer;">{{item.VisaStatusName}}</i></p>
                                  <p><span>{{$t('visa.v_sqtime')}}:</span>{{item.SendVisaTime}}</p>
                                  <p><span>{{$t('visa.v_cqtime')}}:</span>{{item.OutVisaTime}}</p>
                                  <p><span>{{$t('objFill.v101.Rest.jingguanrq')}}:</span>{{item.EnterVisaTime}}</p>
                                  <p v-for="(item2, index2) in item.VisaFileList" :key="index2">
                                    <span style="cursor:pointer;text-decoration: underline;" @click="downloadFile(item2)">{{item2.Name}}</span><i class="iconfont icon-Close" style="font-size:12px;cursor:pointer;" @click="delUnpload(item.TCID,item2)"></i>
                                  </p>
                                  <p>
                                    <el-upload :http-request="UploadAttachment" :data='item' ref="upload" :multiple="false" :show-file-list='false' action="">
                                      <span style="color:#00C6FF;cursor:pointer;" @click='saveitem(item.TCID)'>{{$t('objFill.v101.Rest.shangcqzzl')}}</span>
                                    </el-upload>
                                  </p>
                              </div>
                          </div>
                          <div class="el-col">
                              <div class="d7">
                                <div>
                                  <el-button type="primary" style='background:#00C6FF; border-color:#00C6FF' v-if="item.VisaStatus==1" @click="goUrlZ('VisaApplicationDetails',item.LineID,item.TCID,item.TCNUM)">{{$t('visa.v_banliqianzheng')}}</el-button>
                                  <el-button type="primary" style='background:#00C6FF; border-color:#00C6FF' v-if="item.VisaStatus==2" @click="goUrlZ('VisaApplicationDetails',item.LineID,item.TCID,item.TCNUM)">{{$t('visa.v_chakanjindu')}}</el-button>
                                  <el-button type="primary" style='background:#00C6FF; border-color:#00C6FF' v-if="item.VisaStatus==3" @click="goUrlZ('VisaApplicationDetails',item.LineID,item.TCID,item.TCNUM)">{{$t('visa.v_chakanjieguo')}}</el-button>
                                </div>
                                <el-button v-if="item.LineID==14" @click="goUrlT('visaList2',item.TCID)" type="primary" style='background:#F16C3C; border-color:#F16C3C'>{{$t('objFill.v101.Rest.qianzhenglb ')}}</el-button>
                                <!-- <el-button @click="goTeamBalance(item.TCID,item.OutBranchId)" type="primary" style='background:#00C6FF; border-color:#00C6FF'>团队支出</el-button> -->
                                <el-button @click="goUrl('VisaFinancialDocuments',item.TCID,item.OutBranchId,item.TCNUM,'签证财务单据')" type="primary" style='background:#F16C3C; border-color:#F16C3C'>{{$t('objFill.v101.FinancialModule.feiyongmx')}}</el-button>
                                <el-button @click='openEdit(item)' type="primary" style='background:#F16C3C; border-color:#F16C3C'>{{$t('visa.v_sqtime')}}</el-button>
                                <el-button @click="openAdmission(item)"  type="primary" style='background:#00C6FF; border-color:#00C6FF'>{{$t('objFill.v101.Rest.jingguanrq')}}</el-button>
                                <el-button @click='openEdit2(item)' type="primary" style='background:#F16C3C; border-color:#F16C3C'>{{$t('visa.v_cqtime')}}</el-button>
                              </div>
                          </div>
                      </div>
                      <div class="person_fan">
                          <div style="padding:10px 0">
                            <span class="RL-remarkTitle">{{$t('salesModule.MD')}}:</span>
                            <span class="RL-redType RL-remarkCon" v-if="item.VisaGuestList.length>0">
                              <span style="color:blue !important" v-for="(childItem) in item.VisaGuestList">
                                <span v-if="childItem.VisaStatus===2" class="groupTourOrder_tickets_blue" >{{childItem.GuestName}}</span>
                              <span v-else-if="childItem.VisaStatus===3" class="groupTourOrder_tickets_black" >{{childItem.GuestName}}</span>
                              <span v-else-if="childItem.VisaStatus===1" class="groupTourOrder_tickets_red" >{{childItem.GuestName}}</span>

                                </span>
                            </span>
                            <span class="RL-redType RL-remarkCon" v-else>
                              <span>{{$t('salesModule.ZWMD')}}</span>
                            </span>
                          </div>
                          <div>
                            <span>{{$t('hotel.hotel_Order')}}:</span>
                            <span @click="goUrl('VisaFinancialDocuments',item.TCID,item.OutBranchId,item.TCNUM,'签证财务单据')" style="margin-right:5px;cursor:pointer" v-for="item2 in item.VisaFinanceList" :key="item2.FrID">
                              <span v-if="item2.ColorState===1" class="groupTourOrder_tickets_blue" >{{item2.FrID}}</span>
                              <span v-else-if="item2.ColorState===2" class="groupTourOrder_tickets_green" >{{item2.FrID}}</span>
                              <span v-else-if="item2.ColorState===3" class="groupTourOrder_tickets_red" >{{item2.FrID}}</span>
                              <span v-else-if="item2.ColorState===4" class="groupTourOrder_tickets_black" >{{item2.FrID}}</span>
                            </span>
                            <span v-if="item.VisaFinanceList.length===0">{{$t('system.content_noData')}}</span>
                          </div>
                      </div>
                      <div class="TC_remarkContent">
                          <div class="clearfix TCL-redType">
                              <div class="TCL_remarkTitle">{{$t('op.DJBZTH')}}:</div>
                              <div class="TCL_Content"> {{item.DMCNum}}</div>
                          </div>
                          <div class="clearfix TCL-redType">
                              <div class="TCL_remarkTitle">{{$t('objFill.v101.activity.opduiwbz')}}:</div>
                              <div class="TCL_Content">{{item.OPRemark}}</div>
                          </div>
                          <div class="clearfix TCL-redType TCL-Opremark">
                              <div class="TCL_remarkTitle">{{$t('Operation.Op_duineiRemark')}}:</div>
                              <div class="TCL_Content">{{item.OPInnerRemark}}</div>
                          </div>
                          <div class="clearfix TCL-redType TCL-Opremark">
                              <div class="TCL_remarkTitle">{{$t('Operation.Op_dijieRemark')}}:</div>
                              <div class="TCL_Content">{{item.DmcRemarkLast!=null?item.DmcRemarkLast.DMCRemark:""}}</div>
                          </div>
                      </div>
          </li>
        </ul>
        <div class="noData" v-show="queryMsg.noData">
          {{$t('system.content_noData')}}
        </div>
        <el-pagination background @current-change="handleCurrentChange" :current-page.sync="queryMsg.currentPage" layout="total,prev, pager, next, jumper"
          :page-size='queryMsg.pageSize' :total='queryMsg.total'>
        </el-pagination>
        </div>
    </div>

    <div class="combottomDiv TC_divCon" v-if="queryCommonData.setPlatDialog">
        <div class="combottomTitle">{{$t('Operation.Op_choicePlat')}}</div>
        <span class="setPlatLeft">{{$t('Airticket.Air_salesPlatform')}}</span>
        <span>
          <el-checkbox v-model="queryCommonData.checkDialogAll" @change="checkAllDialog" style="margin-right:20px;">{{$t('system.table_chekAll')}}</el-checkbox>
          <el-checkbox-group v-model="queryCommonData.ckedplat"  @change="checkDialog">
            <el-checkbox v-for="sales in $tripUtils.TeamStatesList.salsPlat" :label="sales.Id" :key="sales.Name">{{sales.Name}}</el-checkbox>
          </el-checkbox-group>
        </span>
        <span>
            <button class="normalBtn" style="margin-left:50px;" @click="SetshelvesUp">{{$t('pub.sureBtn')}}</button>
            <button class="hollowFixedBtn" @click="queryCommonData.setPlatDialog=false">{{$t('pub.cancelBtn')}}</button>
        </span>
    </div>


    <div class="combottomDiv OPremarkDiv" v-if="queryCommonData.outerVisible">
        <div class="combottomTitle">{{$t('Operation.Op_remark')}}</div>
        <el-form label-width="100px">
          <el-col :span="8">
            <el-form-item :label="$t('objFill.v101.activity.opduiwbz')" prop="Remark">
                <el-input type="textarea" v-model="remarkMsg.OPRemark"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item :label="$t('Operation.Op_duineiRemark')" prop="Remark">
                <el-input type="textarea" v-model="remarkMsg.OPInnerRemark"></el-input>
            </el-form-item>
          </el-col>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <button class="hollowFixedBtn" @click="queryCommonData.outerVisible = false">{{$t('pub.cancelBtn')}}</button>
            <button class="normalBtn" type="primary" @click="setOPremark">{{$t('pub.sureBtn')}}</button>
        </div>
    </div>
        <!-- 送签日期窗口 -->
        <div class="groupInquiry_edit" v-show="editShow">
            <div class="groupInquiry_edit_tit">
                <span>{{$t('objFill.v101.Rest.xiugaisongqr')}}</span>
                <div>
                    <button class="hollowFixedBtn" type="button" @click="closeEdit">{{$t('pub.cancelBtn')}}</button>
                    <button class="normalBtn" type="button" @click="editOk">{{$t('pub.saveBtn')}}</button>
                </div>
            </div>
            <div class="groupInquiry_edit_form">
                <div>
                    <em>{{$t('visa.v_sqtime')}}</em>
                    <el-date-picker class="groupInquiry_header_input2" v-model='msg_edit.SendVisaTime' @change="editInput" type="date" value-format="yyyy-MM-dd" :placeholder="$t('admin.admin_choDate')" clearable></el-date-picker>
                </div>
            </div>
        </div>
        <!-- 出签日期窗口 -->
        <div class="groupInquiry_edit" v-show="editShow2">
            <div class="groupInquiry_edit_tit">
                <span>{{$t('objFill.v101.Rest.xiugaichuqr')}}</span>
                <div>
                    <button class="hollowFixedBtn" type="button" @click="closeEdit2">{{$t('pub.cancelBtn')}}</button>
                    <button class="normalBtn" type="button" @click="editOk2">{{$t('pub.saveBtn')}}</button>
                </div>
            </div>
            <div class="groupInquiry_edit_form">
                <div>
                    <em>{{$t('visa.v_cqtime')}}</em>
                    <el-date-picker class="groupInquiry_header_input2" v-model='msg_edit2.OutVisaTime' @change="editInput2" type="date" value-format="yyyy-MM-dd" :placeholder="$t('admin.admin_choDate')" clearable></el-date-picker>
                </div>
            </div>
        </div>
        <!-- 进馆日窗口 -->
        <div class="groupInquiry_admission" v-show="admissionShow">
            <div class="groupInquiry_admission_tit">
                <span>{{$t('objFill.v101.Rest.xiugaijingr')}}</span>
                <div>
                    <button class="hollowFixedBtn" type="button" @click="closeAdmission">{{$t('pub.cancelBtn')}}</button>
                    <button class="normalBtn" type="button" @click="admissionOk">{{$t('pub.saveBtn')}}</button>
                </div>
            </div>
            <el-form :model="msg_admission" :rules="rules" ref="admissionForm" :inline="true" class="groupInquiry_admission_form">
                <el-form-item :label="$t('objFill.v101.Rest.jingguanrq')" prop="EnterVisaTime" class="groupInquiry_admission_formItem">
                    <el-date-picker class="groupInquiry_admission_input2" v-model='msg_admission.EnterVisaTime' @change="admissionInput" type="date" value-format="yyyy-MM-dd" :placeholder="$t('admin.admin_choDate')" clearable></el-date-picker>
                </el-form-item>
                <el-form-item :label="$t('visa.v_visaType')" prop="VisaType" class="groupInquiry_admission_formItem">
                    <el-select class="groupInquiry_admission_input2" v-model="msg_admission.VisaType" :placeholder="$t('objFill.v101.Rest.xuanzeqzlx')">
                        <el-option :label="$t('visa.v_gvisa')" value='1'></el-option>
                        <el-option :label="$t('visa.v_tvisa')" value='2'></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item :label="$t('objFill.v101.Rest.ouzhouqianz')" prop="EuropeVisaType" class="groupInquiry_admission_formItem" v-if="msg_admission.LineID===2">
                    <el-select class="groupInquiry_admission_input2" v-model="msg_admission.EuropeVisaType" @change="visaTypeChange" :placeholder="$t('objFill.v101.Rest.xuanzeqzlx')">
                        <el-option v-for="(item, index) in EuropeVisaTypeList" :key="index" :label='item.Name' :value='item.Id'></el-option>
                    </el-select>
                </el-form-item>
                <div style="display: inline-block;vertical-align: top;white-space: nowrap;">
                    <el-form-item :label="$t('system.table_country')" prop="EuropeSchengen" class="groupInquiry_admission_formItem" v-show="msg_admission.LineID===2&&msg_admission.EuropeVisaType==='2'">
                        <el-select class="groupInquiry_admission_input2" v-model="msg_admission.EuropeSchengen" @change="SchengenChange" :placeholder="$t('objFill.xuanzheguojia')">
                            <el-option v-for="(item, index) in EuropeSchengenList" :key="index+2000" :label='item.Name' :value='item.Id'></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item prop="EuropeVisaName" class="groupInquiry_admission_formItem" v-show="msg_admission.EuropeVisaType==='2'&&msg_admission.EuropeSchengen==='5'">
                        <el-input class="groupInquiry_admission_input2" v-show="msg_admission.EuropeSchengen==='5'" v-model="msg_admission.EuropeVisaName" :placeholder="$t('objFill.v101.Rest.qingshurgjmc')"></el-input>
                    </el-form-item>
                </div>
            </el-form>
        </div>
  </div>
</template>
<script>
export default {
  data() {
        // 欧洲签证验证
        var testVisaType = (rule, value, callback) => {
            if (this.msg_admission.LineID===2&&value==="") {
                callback(new Error(this.$t('objFill.v101.Rest.qingxzouzqzlx')));
            } else {
                callback();
            }
        }
        //国家验证
        var testSchengen = (rule, value, callback) => {
            if (this.msg_admission.EuropeVisaType==='2'&&value==="") {
                callback(new Error(this.$t('visaT.qxzguojia')));
            } else {
                callback();
            }
        }
        // 国家名称验证
        var testVisaName = (rule, value, callback) => {
            this.msg_admission.EuropeVisaName = value.trim()
            if (this.msg_admission.EuropeSchengen==='5'&&value.trim()==="") {
                callback(new Error(this.$t('objFill.v101.Rest.guojiamcbunwk')));
            } else {
                callback();
            }
        }
    return {
        uploadTCID: 0,
        // 送签日期
        editShow: false,
        msg_edit: {
            TCID: 0,
            SendVisaEndDate: "",
            SendVisaTime: ""
        },
        // 出签日期
        editShow2: false,
        msg_edit2: {
            TCID: 0,
            SendVisaEndDate: "",
            OutVisaTime: ""
        },
        // 进馆日
        admissionShow: false,
        msg_admission: {
            TCID: 0,
            LineID: 0,
            SendVisaEndDate: "",
            EnterVisaTime: "",
            VisaType: "1",
            EuropeVisaType: "",
            EuropeSchengen: "",
            EuropeVisaName: ""
        },
        // 签证类型数组
        EuropeVisaTypeList:[],
        // 申根签证类型数组
        EuropeSchengenList:[],
        rules: {
            EnterVisaTime: [
                {required: true, message: this.$t('objFill.v101.Rest.jinguanrqbnwk'), trigger: 'blur' },
            ],
            EuropeVisaType: [
                {validator: testVisaType, required: true, trigger: 'blur' },
            ],
            EuropeSchengen: [
                {validator: testSchengen, required: true, trigger: 'blur' },
            ],
            EuropeVisaName: [
                {validator: testVisaName, required: true, trigger: 'blur' },
            ]
        },
      //查询数据列表
      queryCommonData: {
        //线路列表
        LineList: [],
        //系列列表
        LineTeamList: [],
        //下拉框默认值
        SelectDefaultValue: 0,
        //公司选项卡默认选中
        activeName: "-1",
        //航空公司
        AirlineList: [],
        //员工列表
        EmployeeList: [],
        //公司数据
        BranchList: [],
        //是否为分公司
        IsParentCompany: "",
        //显示销售平台
        showPlatForm: false,
        //团期全选
        checkGroupALL: false,
        //销售平台全选
        checkPlatForm: false,
        //团队状态全选
        checkTCStateAll: false,
        //是否显示弹出框
        setPlatDialog: false,
        //弹出框全选
        checkDialogAll: false,
        //选择上架平台
        ckedplat: [],
        //loading
        loading: false,
        //中间变量ID
        comID: "",
        //中间变量TCState
        comState: "",
        //标题
        comPlatTitle: "",
        //高级搜索
        showHigradeSearch: false,
        //数据列表
        dataList: [],
        //中国下面城市
        CityList: [],
        //销售公司
        companyList: [],
        singleTCID: 0,
        outerVisible: false,
        flightCKed:[],
        loading:false,
        checkCompanyAll: true,
      },
      //查询参数
      queryMsg: {
        pageIndex: 1,
        pageSize: 10,
        LineId: 0,
        LineIdList: [],
        LineteamId: 0,
        TCNUM: "",
        StartGroupDate: "",
        EndGroupDate: "",
        OutBranchId: -1,
        OutBranchIds:[],
        AirTicketId: 0,
        TeamMinNum: "",
        TeamMaxNum: "",
        CreateBy: 0,
        ApplyMinNum: "1",
        ApplyMaxNum: "",
        DayNum: "",
        OnlyShowOverTeam: false,
        TCState: [1,3],
        GroupState: [1,2,5],
        SalePlat: [],
        UnionCityId: 0,
        SaleBranchId: [],
        total: 0,
        //是否有数据
        noData: false,
        currentPage: 1,
        //航班配置
        FlightState:0,
        TCVisaStatus: '-1',
        IsShowUnion:-1,
        QueryType:1,//查询类型 1:签证
        TeamType:'0',//0常规团 1小包团
      },
      remarkMsg: {
        TCID: 0,
        OPRemark: "",
        OPInnerRemark: ""
      },
      flightStatus: [{
          Id: 0,
          Name: this.$t('pub.unlimitedSel'),
          Checked:true
        }, {
          Id: 1,
          Name: this.$t('objFill.v101.activity.yipeizhi'),
          Checked:false
        }, {
          Id: 2,
          Name: this.$t('objFill.v101.traveltrip.weipeizhi'),
          Checked:false
      }],
      pickerBeginDateBefore: {
        disabledDate: time => {
          let endTime = new Date(this.queryMsg.EndGroupDate);
          return endTime.getTime() < time.getTime();
        }
      },
      pickerBeginDateAfter: {
        disabledDate: time => {
          let startTime = new Date(this.queryMsg.StartGroupDate);
          return startTime.getTime() >= time.getTime();
        }
      }
    };
  },
  methods: {
    goUrl(path, TCID,OutBranchId,TCNUM, name) {
          this.$router.push({
            name: path,
            query: {
              TCID:TCID,
              OutBranchId:OutBranchId,
              TCNUM:TCNUM,
              blank: 'y',
              tab: name
            }
          });
      },
    saveitem(tcid) {
			this.uploadTCID = tcid
		},
    //上传
    UploadAttachment(file) {
			let newArr = [];
			newArr.push(file.file);
			let path = "/Upload/Temporary/";
			this.UploadSelfFileT(path, newArr, x => {
        this.apipost('dmc_get_visa_UploadVisaInformation', {
          Path: x.data.FilePath,
          FileName: file.file.name,
          Status: 1,
          TCID: this.uploadTCID
        }, res => {
          if (res.data.resultCode===1) {
            this.$message.success(this.$t('tips.scchenggong'))
            this.getControlList();
          } else {
            this.$message.error(this.$t('objFill.v101.Rest.shangchuansb'))
          }
        })
			});
    },
    delUnpload: function (tcid, item) {
      this.$confirm(this.$t('objFill.v101.Rest.shifscgqzzil'), this.$t('tips.tips'), {
          confirmButtonText: this.$t('pub.sureBtn'),
          cancelButtonText: this.$t('pub.cancelBtn'),
          type: 'warning'
        }).then(()=>{
          this.apipost('dmc_get_visa_UploadVisaInformation', {
            Path: item.FullUrl,
            FileName: item.Name,
            Status: 2,
            TCID: tcid
          }, res => {
            if (res.data.resultCode===1) {
              this.$message.success(this.$t('tips.shanchuchenggong'))
              this.getControlList();
            } else {
              this.$message.error(this.$t('tips.shanchushibai'))
            }
        })
      })
    },
    downloadFile: function (item) {
      let reg = /^http(s)?:\/\/(.*?)\//
			this.downloadFileRename(item.FullUrl.replace(reg,''),item.Name);
    },
    // 送签日期不能大于送签结束日期
    editInput: function (val) {
      if (val > this.msg_edit.SendVisaEndDate) {
        this.$message.error(this.$t('tips.songqrqbndyjsrq'));
        this.msg_edit.SendVisaTime = ''
      }
    },
    // 打开送签日期窗口
    openEdit: function (item) {
        this.msg_edit.TCID = item.TCID
        this.msg_edit.SendVisaEndDate = item.SendVisaEndDate
        this.msg_edit.SendVisaTime = item.SendVisaTime
        this.editShow = true
        this.editShow2 = false
        this.admissionShow = false
    },
    // 关闭送签日期窗口
    closeEdit: function () {
      this.editShow = false
    },
    // 提交送签日期
    editOk: function () {
      if (this.msg_edit.SendVisaTime !== '') {
        this.apipost(
          "dmc_post_SetTravelSendVisaTime",
          this.msg_edit,
          res => {
            if (res.data.resultCode == 1) {
              this.editShow = false
              this.$message.Success(`${this.$t('pub.updateMsg')}${this.$t('objFill.chenggong')}`) ;
              this.getControlList();
            } else {
              this.$message.error(this.$t('objFill.v101.Rest.xiugaishib'));
            }

          },
          err => {}
        )
      } else {
        this.$message.error(this.$t('objFill.v101.Rest.songqrqbnwk'))
      }
    },
    // 出签日期不能大于结束日期
    editInput2: function (val) {
      if (val > this.msg_edit2.SendVisaEndDate) {
        this.$message.error(this.$t('objFill.v101.Rest.chuqrqbndyjsrq'));
        this.msg_edit2.OutVisaTime = ''
      }
    },
    // 打开出签日期窗口
    openEdit2: function (item) {
        this.msg_edit2.TCID = item.TCID
        this.msg_edit2.SendVisaEndDate = item.SendVisaEndDate
        this.msg_edit2.OutVisaTime = item.OutVisaTime
        this.editShow = false
        this.editShow2 = true
        this.admissionShow = false
    },
    // 关闭出签日期窗口
    closeEdit2: function () {
      this.editShow2 = false
    },
    // 提交出签日期
    editOk2: function () {
      if (this.msg_edit2.SendVisaEndDate !== '') {
        this.apipost(
          "dmc_post_SetTravelSendVisaTime",
          this.msg_edit2,
          res => {
            if (res.data.resultCode == 1) {
              this.editShow2 = false
              this.$message.Success(`${this.$t('pub.updateMsg')}${this.$t('objFill.chenggong')}`) ;
              this.getControlList();
            } else {
              this.$message.error(this.$t('objFill.v101.Rest.xiugaishib'));
            }

          },
          err => {}
        )
      } else {
        this.$message.error(this.$t('objFill.v101.Rest.songqrqbnwk'))
      }
    },
    // 进馆签日期不能大于结束日期
    admissionInput: function (val) {
        if (val > this.msg_admission.SendVisaEndDate) {
            this.$message.error(this.$t('objFill.v101.Rest.jingrqbndyjsrq'));
            this.msg_admission.EnterVisaTime = ''
        }
    },
    // 打开进馆日窗口
    openAdmission: function (item) {
        this.apipost("dmc_get_GetTravelEnterVisaTime", {TCID:item.TCID}, res => {
            if (res.data.resultCode == 1) {
                this.msg_admission.TCID = item.TCID
                this.msg_admission.LineID = item.LineID
                this.msg_admission.SendVisaEndDate = item.SendVisaEndDate
                this.msg_admission.EnterVisaTime = res.data.data.EnterVisaTime
                this.msg_admission.VisaType = res.data.data.VisaType===0?'1':res.data.data.VisaType.toString()
                this.msg_admission.EuropeVisaType = res.data.data.EuropeVisaType===0?'':res.data.data.EuropeVisaType.toString()
                this.msg_admission.EuropeSchengen = res.data.data.EuropeSchengen===0?'':res.data.data.EuropeSchengen.toString()
                this.msg_admission.EuropeVisaName = res.data.data.EuropeVisaName
                this.editShow = false
                this.editShow2 = false
                this.admissionShow = true
            } else {
                this.$message.error(this.$t('objFill.v101.Rest.huoqjingrxqsb'))
            }
        });
    },
    // 关闭进馆日窗口
    closeAdmission: function () {
        this.admissionShow = false
        this.$refs['admissionForm'].resetFields();
    },
    // 欧洲签证改变赋值
    visaTypeChange: function (val) {
        if (val!=='2') {
            for (let i = 0; i < this.EuropeVisaTypeList.length; i++) {
                if (val === this.EuropeVisaTypeList[i].Id) {
                    this.msg_admission.EuropeVisaName = this.EuropeVisaTypeList[i].Name
                }
            }
        }
    },
    // 国家改变赋值
    SchengenChange: function (val) {
        if (val!=='5') {
            for (let i = 0; i < this.EuropeSchengenList.length; i++) {
                if (val === this.EuropeSchengenList[i].Id) {
                    this.msg_admission.EuropeVisaName = this.EuropeSchengenList[i].Name
                }
            }
        } else {
            this.msg_admission.EuropeVisaName = ''
        }
    },
    // 提交进馆日
    admissionOk: function () {
        this.$refs['admissionForm'].validate((valid) => {
            if (valid) {
                this.apipost("dmc_post_SetTravelEnterVisaTime", this.msg_admission, res => {
                    if (res.data.resultCode == 1) {
                        this.$message.success(this.$t('objFill.v101.Rest.jingrszcg'))
                        this.getControlList();
                        this.admissionShow = false
                        this.$refs['admissionForm'].resetFields();
                    } else {
                        this.$message.error(this.$t('objFill.v101.Rest.jingrszsb'))
                    }
                });
            } else {
                return false;
            }
        });
        // this.admissionShow = false
    },
    // 获取签证类型数组
    getEuropeVisaType: function () {
        this.apipost("dmc_get_GetEuropeVisaTypeList", {}, res => {
            if (res.data.resultCode == 1) {
                this.EuropeVisaTypeList = res.data.data;
            } else {
                this.$message.error(this.$t('objFill.v101.Rest.qianzlxhqsb'))
            }
        });
    },
    // 获取申根签证类型数组
    getEuropeSchengen: function () {
        this.apipost("dmc_get_GetEuropeSchengenTypeList", {}, res => {
            if (res.data.resultCode == 1) {
                this.EuropeSchengenList = res.data.data;
            } else {
                this.$message.error(this.$t('objFill.v101.Rest.shengqzlxhqsb'))
            }
        });
    },
    //翻页
    handleCurrentChange(val) {
      this.queryMsg.pageIndex = val;
      this.getControlList();
    },
    //重新查询
    resetPageIndex() {
      this.queryMsg.pageIndex = 1;
      this.queryMsg.currentPage = 1;
    },
    //获取线路列表
    getLineList() {
      let userInfo = this.getLocalStorage();
      let num=1;
      if(userInfo.RB_Group_id==2){
        num=1
      }else{
        num=0;
      }
      let msg={
        IsVisaSelect:num
      };
      this.apipost("line_post_GetAllList", msg, res => {
        if (res.data.resultCode == 1) {
          this.queryCommonData.LineList = res.data.data;
        }
      });
    },
    //获取系列列表
    getLineTeamList() {
      this.queryMsg.LineteamId = 0;
      let msg = {
        lineID: this.queryMsg.LineId,
        isTOOP: 1
      };
      this.apipost("team_post_GetList", msg, res => {
        if (res.data.resultCode == 1) {
          this.queryCommonData.LineTeamList = res.data.data;
        }
      });
    },
    //切换公司
    getCompanyTab(Id) {
    	this.queryMsg.OutBranchIds=[]
    	if(Id!='-1')
    	{
    		this.queryMsg.OutBranchIds.push(Id)
    	}
      this.queryMsg.OutBranchId = Id;
      this.queryMsg.currentPage = 1;
      this.getControlList();
    },
    //获取航空公司
    getAirlineList() {
      this.apipost(
        "airline_post_GetList",
        {},
        res => {
          if (res.data.resultCode == 1) {
            this.queryCommonData.AirlineList = res.data.data;
          }
        },
        err => {}
      );
    },
    //根据当前员工所在部门获取该部门及子部门员工信息
    getEmployeeList() {
      let userInfo = this.getLocalStorage();
      let msg = {
        GroupId: userInfo.RB_Group_id,
        BranchId: "-1",
        DepartmentId: "-1",
        PostId: "-1",
        IsLeave: "0"
      };
      this.apipost(
        "admin_get_EmployeeGetList",
        {},
        res => {
          if (res.data.resultCode == 1) {
            this.queryCommonData.EmployeeList = res.data.data;
          }
        },
        err => {}
      );
    },

    //新获取列表数据
    getControlList() {
      var msg = JSON.parse(JSON.stringify(this.queryMsg));
      if (msg.TeamMinNum == "") {
        msg.TeamMinNum = -1;
      }
      if (msg.TeamMaxNum == "") {
        msg.TeamMaxNum = -1;
      }
      if (msg.ApplyMinNum == "") {
        msg.ApplyMinNum = -1;
      }
      if (msg.ApplyMaxNum == "") {
        msg.ApplyMaxNum = -1;
      }
      if (msg.DayNum == "") {
        msg.DayNum = -1;
      }
      msg['IsVisaSelect'] = 1;
      this.queryCommonData.loading=true;
      this.apipost(
        "travel_get_GetTravelPrciePageList_V2",
        msg,
        res => {
          this.queryCommonData.loading=false;
          if (res.data.resultCode == 1) {
            this.queryCommonData.dataList = res.data.data.pageData;
            this.queryMsg.total = res.data.data.count;
            this.queryMsg.noData = !this.queryMsg.total > 0;
            this.queryCommonData.dataList.forEach(item => {
              item.SalePlatList = [];
              if (item.SalePlat !== null) {
                var SalePlatArr = item.SalePlat.split(",");
                SalePlatArr.forEach(y=>{
                  item.SalePlatList.push(parseInt(y))
                })
              }
            });
          }
        },
        err => {}
      );
    },

    //验证大小
    checkTeamNum(queryMsg) {
      var TeamMinNum = parseInt(queryMsg.TeamMinNum);
      var TeamMaxNum = parseInt(queryMsg.TeamMaxNum);
      var ApplyMinNum = parseInt(queryMsg.ApplyMinNum);
      var ApplyMaxNum = parseInt(queryMsg.ApplyMaxNum);
      if (TeamMaxNum < TeamMinNum) {
        queryMsg.TeamMaxNum = "";
      }
      if (ApplyMaxNum < ApplyMinNum) {
        queryMsg.ApplyMaxNum = "";
      }
    },
    //初始化公司
    getCompanyList() {
      let userInfo = this.getLocalStorage();
      var RB_Group_id = userInfo.RB_Group_id;
      let msg = {
        Status: 0,
        is_show: 0,
        RB_Group_Id: RB_Group_id
      };
      this.apipost(
        "admin_get_BranchGetList",
        msg,
        res => {
          if (res.data.resultCode == 1) {
            this.queryCommonData.BranchList = res.data.data;
            this.queryCommonData.BranchList.forEach(x => {
              x.isShow = false;
            });
          }
        },
        err => {}
      );
    },
    //团期状态全选
    checkGroupAll(val) {
      this.queryMsg.GroupState = [];
      if (val) {
        this.$tripUtils.TeamStatesList.teamDateStates.forEach(x => {
          this.queryMsg.GroupState.push(x.Id);
        });
      }
    },
    checkGroup(value) {
      let checkedCount = value.length;
      this.queryCommonData.checkGroupALL =
        checkedCount === this.$tripUtils.TeamStatesList.teamDateStates.length;
    },
    //销售平台全选
    checkAllSales(val) {
      this.queryMsg.SalePlat = [];
      if (val) {
        this.$tripUtils.TeamStatesList.salsPlat.forEach(x => {
          this.queryMsg.SalePlat.push(x.Id);
        });
      }
    },
    checkSales(value) {
      let checkedCount = value.length;
      this.queryCommonData.checkPlatForm =
        checkedCount === this.$tripUtils.TeamStatesList.salsPlat.length;
    },
    //团队状态全选
    checkAllTeam(val) {
      this.queryMsg.TCState = [];
      if (val) {
        this.$tripUtils.TeamStatesList.TeamStates.forEach(x => {
          this.queryMsg.TCState.push(x.Id);
        });
      }
      if (
        this.queryMsg.TCState.indexOf(
          this.$tripUtils.TeamStatesList.TeamStates[2].Id
        ) > -1
      ) {
        this.queryCommonData.showPlatForm = true;
      } else {
        this.queryCommonData.showPlatForm = false;
      }
    },
    checkedTeamList(value) {
      if (value.indexOf(this.$tripUtils.TeamStatesList.TeamStates[2].Id) > -1) {
        this.queryCommonData.showPlatForm = true;
      } else {
        this.queryCommonData.showPlatForm = false;
      }
      let checkedCount = value.length;
      this.queryCommonData.checkTCStateAll =
        checkedCount === this.$tripUtils.TeamStatesList.TeamStates.length;
    },
    //全选弹出框
    checkAllDialog(val) {
      this.queryCommonData.ckedplat = [];
      if (val) {
        this.$tripUtils.TeamStatesList.salsPlat.forEach(x => {
          this.queryCommonData.ckedplat.push(x.Id);
        });
      }
    },
    checkDialog(value) {
      let checkedCount = value.length;
      this.queryCommonData.checkDialogAll =
        checkedCount === this.$tripUtils.TeamStatesList.salsPlat.length;
    },
    //点击上架
    setUpPlat(item) {
      this.queryCommonData.outerVisible = false;
      this.queryCommonData.setPlatDialog = true;
      this.queryCommonData.singleTCID = item.TCID;
      if(item.TCState==2){
        this.queryCommonData.ckedplat=[];
        this.queryCommonData.checkDialogAll = false;
      }else if(item.TCState==3){
        item.SalePlatList.forEach(x => {
          this.queryCommonData.ckedplat.push(parseInt(x));
        });
        if(item.SalePlatList.length == this.$tripUtils.TeamStatesList.salsPlat.length){
            this.queryCommonData.checkDialogAll = true;
        }
      }
    },
    //单团设置下架
    Setshelves(TCID) {
      let msg = {
        TCID: TCID,
        TCState: 2,
        SalePlat: ""
      };
      this.apipost("travel_post_SetPriceTCState", msg, res => {
        if (res.data.resultCode == 1) {
          this.Success(res.data.message);
          this.getControlList();
          this.queryCommonData.checkDialogAll = false;
          this.queryCommonData.ckedplat = [];
        }
      });
    },
    //单团设置上架
    SetshelvesUp() {
      let msg = {
        TCID: this.queryCommonData.singleTCID,
        TCState: 3,
        SalePlat: this.queryCommonData.ckedplat.join(",")
      };
      if (msg.SalePlat == "") {
        this.Error(this.$t('Operation.Op_choicePlat'));
        return;
      }
      this.apipost("travel_post_SetPriceTCState", msg, res => {
        if (res.data.resultCode == 1) {
          this.Success(res.data.message);
          this.getControlList();
          this.queryCommonData.setPlatDialog = false;
          this.queryCommonData.checkDialogAll = false;
          this.queryCommonData.ckedplat = [];
        }
      });
    },

    goUrlX(path, id) {
      this.$router.push({ name: path, query: { id: id,blank:'y',tab: '报名清单'} });
    },
    goUrlY(path, id) {
      this.$router.push({ name: path, query: { id: id,blank:'y',tab:'旅客名单'} });
    },
    goUrlZ(path,LineID, id, num) {
      this.$router.push({ name: path, query: { LineID:LineID,id: id, num: num,blank:'y',tab:'签证办理'} });
    },
    goUrlT(path, tcid) {
      this.$router.push({ name: path, query: { tcid: tcid, blank:'y', tab:'签证列表'} });
    },
    goTeamBalance(id, OutBranchId) {
        this.$router.push({
          name: "TeamBalancePayment",
          query: {
            id: id,
            OutBranchId: OutBranchId,
            blank: "y",
            tab: "团队收支明细"
          }
        });
    },
    goUrlP(path,tcid) {
      this.$router.push({ name: path, query: {tcid:tcid, blank:'y', tab:'签证工作表'} });
    },
    goUrlR(path,TCID,ConfigId) {
      let routeData = this.$router.resolve({
        name: path,
        query: { id: TCID, configId: ConfigId }
      });
      window.open(routeData.href, "_blank");
    },
    goB2B(ConfigId) {
      window.open(
        "http://www.oytour.com/#/detail/" +
          encodeURIComponent(ConfigId) +
          "/preview",
        "_blank"
      );
    },
    goTeamBalance(id, OutBranchId) {
      this.$router.push({
        name: "TeamBalancePayment",
        query: { id: id, OutBranchId: OutBranchId,blank:'y',tab:'团队收支明细'}
      });
    },
    //开团或修改
    goToOpenTravel(path, configId) {
      if (configId > 0) {
        this.$store.commit("pageConditionUpdate", this.queryMsg);
        this.$router.push({
          name: path,
          query: { configId: configId, openState: 1,blank:'y',tab:'团期配置' }
        });
      } else {
        this.$router.push({ name: path });
      }
    },
    //删除团期
    removeTeamInfo(TCID) {
      var that = this;
      that.Confirm(that.$t('tips.shifoushanchu'), function() {
        var msg = {
          TCID: TCID
        };
        that.apipost(
          "travel_post_RemoveTravelPrice",
          msg,
          res => {
            if (res.data.resultCode == 1) {
              that.Success(res.data.message);
              that.getControlList();
            } else {
              that.Error(res.data.message);
            }
          },
          null
        );
      });
    },
    //获取城市
    getCountryCity() {
      this.apipost("sellorder_get_GetAllStartCity", {}, res => {
        if (res.data.resultCode == 1) {
          this.queryCommonData.CityList = res.data.data;
        }
      });
    },
    getSellorCompany() {
      //出团公司
      this.apipost(
        "sellorder_post_GetBranchList",
        {},
        res => {
          if (res.data.resultCode == 1) {
            this.queryCommonData.companyList = res.data.data;
          }
        },
        err => {}
      );
    },
    //点击op备注
    ckOPremark(item) {
      this.remarkMsg.TCID = item.TCID;
      this.remarkMsg.OPRemark = item.OPRemark;
      this.remarkMsg.OPInnerRemark = item.OPInnerRemark;
      this.queryCommonData.setPlatDialog = false;
      this.queryCommonData.outerVisible = true;
    },
    //设置OP备注
    setOPremark() {
      this.apipost(
        "travel_post_SetTravelPrcieOpRemark",
        this.remarkMsg,
        res => {
          if (res.data.resultCode == 1) {
            this.Success(res.data.message);
            this.queryCommonData.outerVisible = false;
            this.getControlList();
          } else {
            this.Error(res.data.message);
          }
        },
        err => {}
      );
    },
    checkedFlight(item){
       this.queryMsg.FlightState=item.Id;
       this.queryCommonData.flightCKed=[];
       this.queryCommonData.flightCKed.push(item.Id);
    },
      //查询全部
    getCompanyCheckAll() {
      this.queryCommonData.checkCompanyAll = true;
      this.queryMsg.OutBranchIds = [];
      this.queryCommonData.BranchList.forEach(x => {
        x.isShow = false;
      });
      this.getControlList();
    },
      //点击选取出团公司
    getCompanyCheck(item) {
      item.isShow = !item.isShow;
      this.queryCommonData.checkCompanyAll = false;
      this.$forceUpdate();
      this.queryMsg.OutBranchIds = [];

      this.queryCommonData.BranchList.forEach(x => {
        if (x.isShow) {
          this.queryMsg.OutBranchIds.push(x.Id);
        }
      });
      if (
        this.queryMsg.OutBranchIds.length ==
        this.queryCommonData.BranchList.length ||
        this.queryMsg.OutBranchIds.length == 0
      ) {
        this.queryCommonData.checkCompanyAll = true;
      }
      this.getControlList();
    },


  },
  filters: {
    formatStartDate(value) {
      let dataArr = value.split("-");
      return dataArr[1] + "-" + dataArr[2];
    },
    priceFormat(value) {
      if (value == null) {
        return 0.0;
      }
      let nStr = value.toFixed(2);
      nStr += "";
      let x = nStr.split(".");
      let x1 = x[0];
      let x2 = x.length > 1 ? "." + x[1] : "";
      var rgx = /(\d+)(\d{3})/;
      while (rgx.test(x1)) {
        x1 = x1.replace(rgx, "$1" + "," + "$2");
      }
      return x1 + x2;
    }
  },
  mounted() {
    // this.queryMsg.LineId = this.$route.query.LineId;
    // this.queryMsg.LineteamId = this.$route.query.LineteamId;
    // this.getLineTeamList();

    //销售公司
    this.getSellorCompany();
    this.getCompanyList();
    this.getLineList();
    this.getAirlineList();
    this.getEmployeeList();
    this.getCountryCity();
    // 进馆日相关数据获取
    this.getEuropeVisaType();
    this.getEuropeSchengen();
  },
  created() {
    let userInfo = this.getLocalStorage();
    if (userInfo.IsParentCompany == undefined) {
      this.queryCommonData.IsParentCompany = 2;
    } else {
      this.queryCommonData.IsParentCompany = userInfo.IsParentCompany;
    }

    let ActionMenuCode = userInfo.ActionMenuCode;
    if (ActionMenuCode.indexOf("isSuperManagement") != -1) {
      this.queryCommonData.IsParentCompany = 1;
    }

    if (this.$route.query.hasOwnProperty("cache")) {
      if (this.$store.state.pageCondition != null) {
        this.queryMsg = this.$store.state.pageCondition;
      }
    }

    var nowDate = new Date().Format('yyyy-MM-dd')
    this.queryMsg.TCNUM = this.$route.query.tcnum!==undefined?this.$route.query.tcnum:'';
    this.queryMsg.StartGroupDate = this.$route.query.startDate!==undefined?this.$route.query.startDate:nowDate;

    if (this.queryCommonData.IsParentCompany != 1) {
      this.queryMsg.OutBranchIds.push(userInfo.RB_Branch_id);
    }
    this.getControlList();
  },
};
</script>