<style scoped>
.page_fnDm {
  background-color: white;
}
.PAGE_teamRE .query-box {
  overflow: inherit;
  padding-bottom: 0;
}
._nav {
  margin: 20px 0 0 0;
  background-color: #f5f5f5;
}
._nav li {
  float: left;
  font-size: 14px;
  color: #666666;
  padding: 15px 20px;
  cursor: pointer;
  position: relative;
  background-color: #f1f1f1;
  margin-right: 5px;
}
._nav li._active {
  background-color: #ffffff;
  color: #333333;
}
._nav li._active::after {
  content: "";
  width: 20px;
  height: 3px;
  background-color: #e95252;
  display: inline-block;
  position: absolute;
  bottom: 0;
  left: 38%;
}
.el-range-editor.el-input__inner {
  border-radius: 0;
}
.PAGE_teamRE .query-box {
  border: none;
}
.hight_query {
  position: relative;
}
.hight_query span {
  height: 34px;
  line-height: 34px;
  color: #e95252;
}
.hight_query span .icon-gengduo {
  font-size: 12px;
}
.hight_query span em {
  text-decoration: underline;
  cursor: pointer;
}
.hight_query_box {
  position: absolute;
  background-color: white;
  z-index: 2000;
  right: 200px;
  width: 800px;
}
._hqb_shadow {
  box-shadow: 3px 2px 10px rgb(204, 203, 203);
  border: 1px solid #ececec;
}
.PAGE_teamRE .query-box ul {
  overflow: initial;
}
.hqb_t {
  padding: 10px 20px;
  font-size: 16px;
  background-color: #e95252;
  border: 1px solid #e95252;
  color: #fff;
  text-align: center;
  margin-bottom: 15px;
}
.PAGE_teamRE .query-box li:last-child {
  float: left;
}
.PAGE_teamRE .query-box > ul > li:last-child {
  float: right;
}
.PAGE_teamRE .query-box .hight_query ul .el-input {
  width: inherit;
}
.hight_query_box ul li {
  margin-top: 0;
  float: left;
  margin-right: 15px;
}
.hight_query_box ul li label {
  font-size: 14px;
}
.hight_query_box .el-form {
  padding: 0 20px;
}
.hight_query_box ul li._hqb_btn {
  float: right;
  margin-right: 25px;
  padding-top: 5px;
  position: inherit;
}
.Receipt_box {
  padding: 15px;
  color: #c94052;
  width: 614px;
  background-color: rgba(242, 242, 242, 1);
  border: 1px solid rgba(228, 228, 228, 1);
}
.Receipt_box.color_blur {
  color: #106baf;
}
.Receipt_box.color_blur .rb_stit span {
  display: inline-block;
  border-bottom: 2px solid #106baf;
  padding: 0 20px;
}
.rb_tit {
  font-size: 18px;
  text-align: center;
}
.rb_stit {
  font-size: 14px;
  text-align: center;
}
.rb_stit span {
  display: inline-block;
  border-bottom: 2px solid #c94052;
  padding: 0 20px;
}
.rb_top_row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.rb_top_row span._r_name {
  color: #333333;
}
.rb_top_row span._r_bold {
  font-weight: bold;
}
.rb_top_row ._r_time span {
  color: #333333;
}
._r_mb5 {
  margin-bottom: 5px;
}
.Receipt_table {
  width: 100%;
  font-size: 14px;
  text-align: center;
}
.Receipt_table .th {
  font-weight: 200 !important;
}
._r_mt10 {
  margin-top: 10px;
}
._bg__ {
  display: inline-block;
  padding: 2px 8px;
  color: white;
  border-radius: 4px;
}
._bg_red {
  background-color: #e95252;
}
._bg_green {
  background-color: #2bb87c;
}
.text_d {
  text-decoration: underline;
  cursor: pointer;
}
.PingFangSC {
  font-weight: bold;
}
.Bill_par {
  position: relative;
}
tr th,
tr td {
  text-align: left;
  padding-left: 20px;
}
tr._item_list {
  border-bottom: 1px solid #e5e5e5;
  height: 78px;
}
tr._item_list td {
  border-bottom: 1px solid #e5e5e5;
  padding: 10px;
}
/* tr._t_head th{border-top: 1px solid #e5e5e5;} */
tr._item_list td:first-child {
  border-left: 1px solid #e5e5e5;
}
tr._item_list td:last-child {
  border-right: 1px solid #e5e5e5;
}
._head_img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  vertical-align: middle;
}
._btn_group {
  font-size: 14px;
}
.icon-daiqueren {
  color: #4bca81;
}
.icon-yiqueren {
  color: #4bca81;
}
.icon-yiquxiao {
  color: #959595;
}
.icon-shenhebohui {
  color: #e95252;
}
.icon-icon-zancun {
  color: #ff9c01;
}
.singeRowTable tr:hover {
  background-color: white;
}
._TradeWayList {
  padding: 5px 10px;
  background-color: #eeeeee;
  border-radius: 4px;
  margin: 10px 0;
  width: 190px;
}
._bold {
  font-weight: bold;
}
._bank_name,
._bank_type {
  display: inline-block;
  background-color: #333333;
  color: white;
  padding: 2px 4px;
  border-radius: 4px;
  margin-left: 10px;
}
._bank_name {
  margin-left: 10px;
}
._bank_type {
  background-color: #2aaef2;
}
._bank_type2 {
  background-color: #ff9c01;
}
._font_init {
  color: #333333;
  font-size: 12px;
  vertical-align: top;
}
.InfoChangeLog {
  height: auto;
  max-height: 220px;
  background-color: #ffffff;
}
.changLogList {
  padding-left: 20px;
  max-height: 180px;
  overflow: auto;
}
.changLogList_l {
  border-left: 1px solid #e9e9e9;
  position: relative;
  padding-bottom: 10px;
  padding-left: 20px;
  padding-top: 10px;
}
._radius_green {
  background-color: #47bf8c;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  position: absolute;
  left: -4px;
  top: 19px;
}
.changLog_time {
  color: #666666;
  font-size: 12px;
  display: inline-block;
  padding-right: 10px;
}
._icon_btn i {
  width: 30px;
  height: 30px;
  display: inline-block;
  color: white !important;
  border-radius: 50%;
  text-align: center;
  line-height: 30px;
  margin-right: 10px;
  cursor: pointer;
  outline: none;
}
._icon_btn i.edit {
  background-color: #00c6ff;
  font-size: 16px;
}
._icon_btn i.edit:hover {
  background-color: #59daff;
}
._icon_btn i.edit:active {
  background-color: #00b8ec;
}
._icon_btn i.icon-sousuo {
  background-color: #47bf8c;
}
._icon_btn i.icon-sousuo:hover {
  background-color: #66bb97;
}
._icon_btn i.icon-sousuo:active {
  background-color: #35ab79;
}
._icon_btn i.icon-ico_commodity_defaul {
  background-color: #f16c3c;
}
._icon_btn i.icon-ico_commodity_defaul:hover {
  background-color: #e87c54;
}
._icon_btn i.icon-ico_commodity_defaul:active {
  background-color: #f76630;
}
._icon_btn i.icon-quxiao1 {
  background-color: #e95252;
}
._icon_btn i.icon-quxiao1:hover {
  background-color: #ea6d6d;
}
._icon_btn i.icon-quxiao1:active {
  background-color: #e42d2d;
}
._icon_btn i.icon-zhuanjiao1 {
  background-color: #e6a014;
  font-size: 16px;
}
._icon_btn i.icon-zhuanjiao1:hover {
  background-color: rgb(235, 184, 84);
}
._icon_btn i.icon-zhuanjiao1:active {
  background-color: rgb(223, 150, 6);
}
._tag_span {
  background-color: rgba(64, 158, 255, 0.1);
  display: inline-block;
  padding: 0 5px;
  height: 22px;
  line-height: 20px;
  font-size: 12px;
  color: #409eff;
  border-radius: 4px;
  box-sizing: border-box;
  border: 1px solid rgba(64, 158, 255, 0.2);
  white-space: nowrap;
  margin-bottom: 4px;
}
._tag_span._tag_warr {
  background-color: rgba(103, 194, 58, 0.1);
  border-color: rgba(103, 194, 58, 0.2);
  color: #67c23a;
}
._fex_cen {
  display: flex;
  align-items: center;
}
._pad5 {
  padding: 5px 10px;
}
._color_gar {
  color: gray;
}
._TCIDAndTCNUMList {
  display: flex;
}
.other_report {
  padding: 0 28px 15px 28px;
}
.other_report li {
  float: left;
  color: #fff;
  background-color: #b00;
  border-color: #b00;
  min-width: 80px;
  padding: 4px 12px;
  margin-bottom: 0;
  font-size: 14px;
  font-weight: normal;
  text-align: center;
  cursor: pointer;
  border-radius: 4px;
  margin-bottom: 10px;
}

</style>

<template>
  <div class="My_table_tell page_fnDm page_RecPayQuery PAGE_teamRE" v-loading="AALloading">
    <div class="query-box">
      <el-form class="_info_box clearfix" label-width="110px">
        <el-row style="padding:15px 20px 0 0;">
          <el-col :span="4">
            <el-form-item label="出团公司：">
              <el-select :disabled="BranchStatus" filterable v-model="msg.OutBranchId" class>
                <el-option :value="-1" label="不限"></el-option>
                <el-option
                  v-for="item in CompanyList"
                  :label="item.BName"
                  :value="item.Id"
                  :key="item.BName"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="出发城市：">
              <el-select filterable v-model="msg.StartCityId" class>
                <el-option :value="0" label="不限"></el-option>
                <el-option
                  v-for="item in startCityList1"
                  :label="item.startCityName"
                  :value="item.ID"
                  :key="item.startCityName"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="线路：">
              <el-select filterable v-model="msg.LineId" @change="getLineTeamList(msg.LineId,-1),getLinePlaceList(msg.LineId)">
                <el-option :value="0" label="不限"></el-option>
                <el-option
                  v-for="item in LineList"
                  :label="item.LineName"
                  :value="item.LineID"
                  :key="item.LineName"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="目的地">
              <el-select filterable v-model="msg.PlaceId" @change="getLineTeamList(msg.LineId,msg.PlaceId)">
                <el-option :value="0" label="不限"></el-option>
                <el-option
                  v-for="(item,index) in PlaceList"
                  :label="item.PlaceName"
                  :value="item.PlaceID"
                  :key="index+1000"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="系列：">
              <el-select filterable v-model="msg.LineTeamId" class>
                <el-option :value="0" label="不限"></el-option>
                <el-option
                  v-for="item in LineTeamList"
                  :label="item.LtName"
                  :value="item.LtID"
                  :key="item.LtName"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="团号：">
              <el-input v-model="msg.TCNUM" class></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="团队编号：">
              <el-input v-model="msg.TCID" class></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="发团日期：">
              <el-date-picker
                class="h34"
                @change="timeAdd(1)"
                v-model="productionDate"
                type="daterange"
                value-format="yyyy-MM-dd"
                :picker-options="pickerOptions"
                range-separator="至"
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="数据类别：">
              <el-select v-model="msg.DataType" :disabled="shujuType" filterable class="w150"  v-if="isShowGrounding==true">
                <el-option value="-1" v-if="isShowType" label="不限"></el-option>
                <el-option value="1" v-if="isShowType" label="团队营收"></el-option>
                <el-option value="3" v-if="isShowType" label="单办签证"></el-option>
                <el-option value="2" label="国际机票"></el-option>
                <el-option value="4" label="国内票务"></el-option>
                <!-- <el-option value="5" v-if="isShowType" label="散卖机票"></el-option> -->
                <el-option value="6" v-if="isShowType" label="日本地接部专户"></el-option>
                <el-option value="12" v-if="isShowType" label="日本地接部专户(人民币)"></el-option>
                <el-option value="7" v-if="isShowType" label="老挝地接部专户"></el-option>
                <el-option value="8" label="票务部专户"></el-option>
                <el-option value="9" v-if="isShowType" label="酒店住宿"></el-option>
                <el-option value="10" v-if="isShowType" label="景点门票"></el-option>
                <el-option value="11" v-if="isShowType" label="餐厅美食"></el-option>
                <el-option value="13" label="机票折让收入"></el-option>
                <el-option value="14" label="单机票收入"></el-option>
                <el-option value="15" v-if="isShowType" label="手配费收入"></el-option>
                <el-option value="16" v-if="isShowType" label="印象票务"></el-option>
              </el-select>
              <el-select v-model="msg.DataType" :disabled="shujuType" filterable class="w150"  v-if="isShowGrounding==false">
                <el-option value="6" v-if="isShowType" label="日本地接部专户"></el-option>
                <el-option value="12" v-if="isShowType" label="日本地接部专户(人民币)"></el-option>
                <el-option value="9" v-if="isShowType" label="酒店住宿"></el-option>
                <el-option value="10" v-if="isShowType" label="景点门票"></el-option>
                <el-option value="11" v-if="isShowType" label="餐厅美食"></el-option>
                <el-option value="15" v-if="isShowType" label="手配费收入"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <template v-if="heightQueryBox">
            <el-col :span="4">
              <el-form-item label="状态：">
                <el-select v-model="msg.QueryCondition" filterable class="w150">
                  <el-option value="-1" label="不限"></el-option>
                  <el-option value="0" label="待收"></el-option>
                  <el-option value="1" label="退款"></el-option>
                  <el-option value="2" label="在途"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="出团状态：">
                <el-select v-model="msg.OutTCStatus" filterable class="w150">
                  <el-option value="0" label="不限"></el-option>
                  <el-option value="1" label="已出团"></el-option>
                  <el-option value="2" label="未出团"></el-option>
                  <el-option value="3" label="未发团"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            
          <el-col :span="4">
              <el-form-item label="是否联运：">
                <el-select v-model="msg.Is_Transport" filterable class="w150">
                  <el-option value="-1" label="不限"></el-option>
                  <el-option value="1" label="是"></el-option>
                  <el-option value="0" label="否"></el-option>
                </el-select>
              </el-form-item>
            </el-col>   
            <el-col :span="4">
              <el-form-item label="地接团号：">
                <el-input v-model="msg.DMCNUM" class></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="领队类型：">
                <el-select v-model="msg.LeaderType" filterable class="w150" @change="GetLeaderList()">
                  <el-option :value="0" label="请选择"></el-option>
                  <el-option :value="1" label="领队"></el-option>
                  <el-option :value="2" label="领兼导"></el-option>
                  <el-option :value="3" label="导游"></el-option>
                </el-select>
              </el-form-item>
            </el-col>   
            <el-col :span="4">
              <el-form-item label="领队/导游：">
                <el-select v-model="msg.LeaderId" filterable class="w150">
                  <el-option :label="$t('pub.unlimitedSel')" :value="0"></el-option>
                  <el-option v-for="item in LeaderList" :label='item.Name' :value='item.ID' :key='item.ID'></el-option>
                </el-select>
              </el-form-item>
            </el-col>  
            <el-col :span="4">
              <el-form-item label="只看收据未制单：" label-width="125px">
                <el-select v-model="msg.IsSelectReceipt" filterable class="w150">
                  <el-option label="是" :value="1"></el-option>
                  <el-option label="否" :value="0"></el-option>
                </el-select>
              </el-form-item>
            </el-col>  
          </template>
          <el-col :span="4" v-if="userId==1 || userId==5 || F_GeneralManager">
              
              <el-button @click="msg.Is_Open=0,SetTravelClose()" type="danger" size="small" round :loading="btnloading">开启团队收支</el-button>
              <el-button @click="msg.Is_Open=1,SetTravelClose()" type="danger" size="small" round :loading="btnloading">关闭团队收支</el-button>
            </el-col>    
          <el-col :span="5">
            <p v-if="UpdateStaus==1">正在更新,更新开始时间 {{UpdateStartTime}}</p>
            <p v-if="UpdateStaus==2">
              上次更新时间 {{UpdateStartTime}}<br/>
              每日8点、12点、19点、22点数据更新~
            </p>
            </el-col>  
               
          
        </el-row>
      </el-form>
      <ul class="clearfix">
        <li class="hight_query">
          <!-- <button class="normalBtn" @click="openKaiQiZzBox('一键开启')">一键开启</button>
          <button class="hollowFixedBtn" @click="openKaiQiZzBox('一键关闭')">一键关闭</button>-->
          <span>
              <em @click.stop="heightQueryBox=!heightQueryBox">高级查询 <i class="iconfont icon-gengduo"></i></em>
          </span>
          <button class="normalBtn" @click="resetPageIndex(),getPageList()">{{$t('pub.searchBtn')}}</button>
          <button class="hollowFixedBtn" @click="method5()">导出</button>
          <!-- <button class="normalBtn" @click="togbu">一键同步</button> -->
          <!--<button class="hollowFixedBtn" @click="exportExcelCurrentPage">导出2</button>-->
        </li>
      </ul>
    <!-- <div class="query-box">以下统计数据每隔2小时自动更新一次，上次更新时间：{{SDate===''?暂无:SDate}}，下次更新时间为：{{EDate===''?'暂无':EDate}}</div> -->
    </div>
    <ul class="other_report clearfix">
      <!-- <li @click="goEasyReport">简易报表</li> -->
    </ul>
    <div class="_fnDm_content" v-loading="loading">
      <v-table
        is-horizontal-resize
        column-width-drag
        :show-vertical-border="true"
        style="width:100%;height:616px;"
        :columns="columns"
        :table-data="DataList"
        :filter-method="filterMethod"
        :total="total"
        :pageSize="msg.pageSize"
        :pageIndex="msg.pageIndex"
        :handleCurrentChange="handleCurrentChanges"
        :row-height="30"
        :column-cell-class-name="columnCellClass"
        @on-custom-comp="customCompFunc"
        @sort-change="sortChange"
        :footer="footer"
        :footer-row-height="33"
        :multiple-sort="multipleSort"
        :row-click="rowClick" 
      >
        <!-- 多个排序 -->
      </v-table>
    </div>
    <el-dialog
      custom-class="w750"
      :title="kaiqiZzTitle"
      :visible.sync="kaiqiZzBox"
      center
      :before-close="initKaiqiZzBox"
      v-loading="kaiqiZzLoading"
    >
      <div style="text-align: center">
        <label>发团日期：</label>
        <el-date-picker
          class="h34"
          @change="timeAdd(2)"
          v-model="KaiqiZzTime"
          type="daterange"
          value-format="yyyy-MM-dd"
          :picker-options="pickerOptions2"
          range-separator="至"
        ></el-date-picker>
      </div>
      <div slot="footer" style="text-align: right;margin-top: 15px;" class="dialog-footer">
        <button class="normalBtn" type="primary" @click="submitKaiqiZzBox">确定</button>
        <button class="hollowFixedBtn" @click="initKaiqiZzBox">{{$t('pub.cancelBtn')}}</button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import moment from 'moment'
import Vue from "vue";
import XLSX from "xlsx";
import downloadExcelEasy from "../../../assets/utils/downloadExcelEasy";
import { setTimeout } from "timers";
Vue.component("TCIDJump", {
  //  团队跳转
  template: `
  <div>
    <span style="cursor: pointer" v-if="rowData.DataType===1"  @click="goUrl('TeamBalancePayment',rowData.TCID,rowData)">{{rowData.TCID}}</span> 
    <span style="cursor: pointer" v-if="rowData.DataType===2" @click="goUrl('individualTicket',rowData.TCID,rowData)">{{rowData.TCID}}</span>
    <span style="cursor: pointer" v-if="rowData.DataType===3" @click="goUrlVisa('VisaProductOrder',rowData.TCID)">{{rowData.TCID}}</span>
    <span style="cursor: pointer" v-if="rowData.DataType===4" @click="goUrl('SettlementOrder',rowData.TCID,rowData)">{{rowData.TCID}}</span>
    <span style="cursor: pointer" v-if="rowData.DataType===6||rowData.DataType===7||rowData.DataType===12||rowData.DataType===13">{{rowData.TCID}}</span>
    <span style="cursor: pointer" v-if="rowData.DataType===8">{{rowData.TCID}}</span>
    <span style="cursor: pointer" v-if="rowData.DataType===9">{{rowData.TCID}}</span>
    <span style="cursor: pointer" v-if="rowData.DataType===10">{{rowData.TCID}}</span>
    <span style="cursor: pointer" v-if="rowData.DataType===11">{{rowData.TCID}}</span>
    <span style="cursor: pointer" v-if="rowData.DataType===14" @click="goSAirRec('TicketManager',rowData)">{{rowData.TCID}}</span>
    <span style="cursor: pointer" v-if="rowData.DataType===15">{{rowData.TCID}}</span>
    <span style="cursor: pointer" v-if="rowData.DataType===16">{{rowData.TCID}}</span>
  </div>
  
  `,
  props: {
    rowData: {
      type: Object
    },
    field: {
      type: String
    },
    index: {
      type: Number
    }
  },
  methods: {
    goUrl(path, id ,row) {
      if(row.TeamType==2){//为一日游的时候跳转到一日游团控列表
        this.$router.push({
            path: "/oneDayTrip" ,
            query: { id: id, blank: "y" }
          });
      }else{
        this.$router.push({
          path: "/" + path,
          query: { id: id, blank: "y" }
        });
      }
      
    },
    goUrlVisa(path, id) {
      this.$router.push({
        path: "/" + path,
        query: { id: id,isShow:0,EmId:-1, blank: "y" }
      });
    }
  }
});
Vue.component("TCNUMJump", {
  //  团队跳转
  template: `<div>
  <span style="cursor: pointer;text-decoration:underline" v-if="rowData.DataType===1"  @click="goUrl('TravelControlList',rowData.TCNUM,rowData)">{{rowData.TCNUM}}</span> 
  <span style="cursor: pointer;text-decoration:underline" v-if="rowData.DataType===2" @click="goUrlExtend('SettlementOrder',rowData.TCID)">{{rowData.TCNUM}}</span>
  <span style="cursor: pointer;text-decoration:underline" v-if="rowData.DataType===3" @click="goUrlVisa('VisaProductOrder',rowData.TCID)">{{rowData.TCNUM}}</span>
  <span style="cursor: pointer;text-decoration:underline" v-if="rowData.DataType===4" @click="goUrlExtend('SettlementOrder',rowData.TCID)">{{rowData.TCNUM}}</span>
  <span style="cursor: pointer;text-decoration:underline" v-if="rowData.DataType===6" @click="goRec('RecPayQuery',rowData)">{{rowData.TCNUM}}</span>
  <span style="cursor: pointer;text-decoration:underline" v-if="rowData.DataType===7" @click="goRec('RecPayQuery',rowData)">{{rowData.TCNUM}}</span>
  <span style="cursor: pointer;text-decoration:underline" v-if="rowData.DataType===12" @click="goRec('RecPayQuery',rowData)">{{rowData.TCNUM}}</span>
  <span style="cursor: pointer;text-decoration:underline" v-if="rowData.DataType===13" @click="goRec('RecPayQuery',rowData)">机票折让{{rowData.TCNUM}}</span>
  <span style="cursor: pointer;text-decoration:underline" v-if="rowData.DataType===14" @click="goSAirRec('TicketManager',rowData)">{{rowData.TCNUM}}</span>
  <span style="cursor: pointer;text-decoration:underline" v-if="rowData.DataType===8" @click="goAIR('RecPayQuery',rowData)">{{rowData.TCNUM}}</span>
  <span style="cursor: pointer;text-decoration:underline" v-if="rowData.DataType===9" @click="goHotelOrder('HotelOrderTotal',rowData)">{{rowData.TCNUM}}</span>
  <span style="cursor: pointer;text-decoration:underline" v-if="rowData.DataType===10" @click="goHotelOrder('ScenTicketOrder',rowData)">{{rowData.TCNUM}}</span>
  <span style="cursor: pointer;text-decoration:underline" v-if="rowData.DataType===11" @click="goHotelOrder('FoodOrder',rowData)">{{rowData.TCNUM}}</span>
  <span style="cursor: pointer;text-decoration:underline" v-if="rowData.DataType===15" @click="goHand('JumpReport',rowData,15)">{{rowData.TCNUM}}</span>
  <span style="cursor: pointer;text-decoration:underline" v-if="rowData.DataType===16" @click="goHand('planeTicketOrder',rowData,16)">{{rowData.TCNUM}}</span>
  </div>`,
  props: {
    rowData: {
      type: Object
    },
    field: {
      type: String
    },
    index: {
      type: Number
    }
  },
  methods: {
    goHand(path,rowData,type){
      if(type==15){
        let TCID=rowData.TCID;
        let BranchId=rowData.OutBranchId;
        this.$router.push({
          path: "/" + path,
          query: {'ReTCID':TCID,"BranchId":BranchId,blank: "y"}
        });
      }if(type==16){
        this.planeTicketOrder(path,rowData)
      }
    },
    // crm核算统计
    planeTicketOrder(path,item){
      let data = [
          {
              path: path,
              OrderId: item.TCID
          },
      ];
    let href = this.domainManager().crmRoutingUrl +
      "automaticLogin?token=" +
      this.getLocalStorage().token +
      "&data=" +
      JSON.stringify(data);
      window.open(href);
  },
    goHotelOrder(path,rowData){
      let TCID=rowData.TCID;
      if(rowData.DataType==9){
        TCID=rowData.TCNUM
      }
      this.$router.push({
        path: "/" + path,
        query: {'teamTCID':TCID,blank: "y"}
      });
    },
    goRec(path,rowData){
      let BankID="";
      let StartDate="";
      if(rowData.DataType===6){
        BankID=14;
      }
      if(rowData.DataType===7){
        BankID=15;
      }
      if(rowData.DataType===12){
        BankID=19;
      }
      // 机票折让费
      if(rowData.DataType===13){
        BankID="";
        StartDate=moment(rowData.StartDate).format("YYYY-MM-DD");
      }
      if(rowData.TCNUM.indexOf('JAP')!=-1 || rowData.TCNUM.indexOf('LAO')!=-1){
        StartDate=moment(rowData.StartDate).format("YYYY-MM-DD");
      }
      this.$router.push({
        path: "/" + path,
        query: {'rec':'rec','StartDate':StartDate,"BankID":BankID,blank: "y"}
      });
    },
    goAIR(path,rowData){
      let StartDate="";
      if(rowData.TCNUM.indexOf('AIR')!=-1){
        StartDate=moment(rowData.StartDate).format("YYYY-MM-DD");
      }
      this.$router.push({
        path: "/" + path,
        query: {'air':'air','StartDate':StartDate,"BankID":17,blank: "y"}
      });

    },
    goSAirRec(path,rowData){
      this.$router.push({
        path: "/" + path,
        query: {'id':rowData.TCID,blank: "y"}
      });

    },
    goUrl(path, id,row) {
      if(row.TeamType==2){//为一日游的时候跳转到一日游团控列表
          this.$router.push({
            path: "/oneDayTrip" ,
            query: { id: row.TCID, blank: "y" }
          });
      }else{
        this.$router.push({
        path: "/" + path,
        query: { tcmun: id, blank: "y" }
      });
      }
      
    },
    goUrlExtend(path, id) {
      this.$router.push({
        path: "/" + path,
        query: { id: id, blank: "y" }
      });
    },
    goUrlVisa(path, id) {
      this.$router.push({
        path: "/" + path,
        query: { id: id,isShow:0,EmId:-1, blank: "y" }
      });
    }
  }
});
Vue.component("GuestNum", {
  // 人数
  template: `<span>{{rowData.GuestNum}}+{{rowData.LeaderNum}}</span>`,
  props: {
    rowData: {
      type: Object
    },
    field: {
      type: String
    },
    index: {
      type: Number
    }
  }
});
Vue.component("ManNum", {
  // 人数
  template: `<span>{{rowData.ManNum}}/{{rowData.WoManNum}}</span>`,
  props: {
    rowData: {
      type: Object
    },
    field: {
      type: String
    },
    index: {
      type: Number
    }
  }
});

Vue.component("TCStatusport", {
  template: `<span>
          <span v-if="rowData.DataType!=16 && rowData.OutTCStatus==0"></span>
          <span v-if="rowData.DataType!=16 && rowData.OutTCStatus==1">已出团</span>
          <span v-if="rowData.DataType!=16 && rowData.OutTCStatus==2">未出团</span>
          <span v-if="rowData.DataType!=16 && rowData.OutTCStatus==3">未发团</span>
          <span v-if="rowData.DataType==16 && rowData.OutTCStatus==1">未完结</span>
          <span v-if="rowData.DataType==16 && rowData.OutTCStatus==4">收损</span>
          <span v-if="rowData.DataType==16 && rowData.OutTCStatus==3">部分收损</span>
          <span v-if="rowData.DataType==16 && rowData.OutTCStatus==5">已完结</span>
          <span v-if="rowData.DataType==16 && rowData.OutTCStatus==6">收损完结</span>
          </span>`,
  props: {
    rowData: {
      type: Object
    },
    field: {
      type: String
    },
    index: {
      type: Number
    }
  }
});
Vue.component("Transport", {
  //  是否联运团
  template: `<span><span v-if="rowData.Is_Transport==='是'" style="color: red;">{{rowData.Is_Transport}}</span><span v-else>{{rowData.Is_Transport}}</span></span>`,
  props: {
    rowData: {
      type: Object
    },
    field: {
      type: String
    },
    index: {
      type: Number
    }
  }
});
Vue.component("TCIDJumpWang", {
  template: `<div>
  <span style="cursor: pointer" v-if="rowData.DataType===1"  @click="goUrl('TeamBalancePayment',rowData.TCID)">{{rowData[field]}}</span> 
  <span v-else >{{rowData[field]}}</span>
  </div>`,
  props: {
    rowData: {
      type: Object
    },
    field: {
      type: String
    },
    index: {
      type: Number
    }
  },
  data(){
    return {
      red: false
    }
  },mounted(){
 
  },
  methods: {
    goUrl(path, id) {
      this.$router.push({
        path: "/" + path,
        query: { id: id, blank: "y" }
      });
    }
  }
});
export default {
  data() {
    return {
      heightQueryBox:false,
      btnloading:false,
      showID: false,
      active: 1,
      userId: 0,
      //是否显示
      isShowType:true,
      isShowGrounding:true,
      msg: {
        Is_Open:-1,
        pageIndex: 1,
        pageSize: 16,
        OutBranchId:-1,
        StartCityId: "",
        LineId: "",
        LineTeamId: "",
        TCID: "",
        startDate: "",
        endDate: "",
        Type: 1,
        QueryCondition: "-1",
        DataType: "1",
        Is_Transport:'-1',
        LeaderId:0,
        LeaderType:0,
        OutTCStatus:'0',
        IsSelectReceipt:0,
      },
      getCompanyMsg: {
        // 公司
        RB_Group_Id: "0",
        Status: "0"
      },
      DataList: [],
      UpdateStaus:0,
      UpdateStartTime:'',
      UpdateEndTime:'',
      CompanyList: [],
      productionDate: [],
      loading: false,
      currentPage: 1,
      total: 0,
      tableData: [],
      LineList: [],
      LineTeamList: [],
      startCityList1: [],
      multipleSort: false,
      kaiqiZzBox: false,
      KaiqiZzTime: [],
      LeaderList: [],
      kaiqiZzTitle: "",
      kaiqiZzLoading: false,
      kaiqiZzMsg: {
        QStartDate: "",
        QEndDate: "",
        Is_Open: ""
      },
      SDate:'',
      EDate:'',
      defaultMonth: [],
      pickerOptions: {
        onPick: ({ maxDate, minDate }) => {
          this.choiceDate = minDate.getTime();
          if (maxDate) {
            this.choiceDate = "";
          }
        },
        disabledDate: time => {
          if (time < new Date("2018-12-31")) {
            return true;
          } else {
            if (this.choiceDate) {
              const one = 365 * 24 * 3600 * 1000;
              const minTime = this.choiceDate - one;
              const maxTime = this.choiceDate + one;
              return time.getTime() < minTime || time.getTime() > maxTime;
            }
          }
        }
      },
      pickerOptions2: {
        onPick: ({ maxDate, minDate }) => {
          this.choiceDate = minDate.getTime();
          if (maxDate) {
            this.choiceDate = "";
          }
        },
        disabledDate: time => {
          if (this.choiceDate) {
            const one = 30 * 24 * 3600 * 1000;
            const minTime = this.choiceDate - one;
            const maxTime = this.choiceDate + one;
            return time.getTime() < minTime || time.getTime() > maxTime;
          }
        }
      },
      columns: [
        // 团队编号、团号 点击跳转团控列表
        {
          field: "LineName",
          title: "线路",
          width: 120,
          titleAlign: "left",
          columnAlign: "left",
          isResize: true,
          result: [],
          type: "select",
          isFrozen: true
        },
        {
          field: "TCID",
          title: "团队编号",
          width: 80,
          titleAlign: "left",
          columnAlign: "left",
          isResize: true,
          isFrozen: true,
          componentName: "TCIDJump"
        },
        {
          field: "TCNUM",
          title: "团号",
          width: 150,
          titleAlign: "left",
          columnAlign: "left",
          isResize: true,
          result: "",
          filterMultiple: false,
          type: "text",
          isFrozen: true,
          componentName: "TCNUMJump"
        },
        {
          field: "OutTCStatus",
          title: "团队状态",
          width: 80,
          titleAlign: "left",
          columnAlign: "left",
          isResize: true,
          isFrozen: true,
          componentName: "TCStatusport"
        },
        {
          field: "LeaderName",
          title: "领队",
          width: 60,
          titleAlign: "left",
          columnAlign: "left",
          isResize: true,
          result: [],
          type: "select",
          isFrozen: true
        },
        {
          field: "GuideName",
          title: "导游",
          width: 60,
          titleAlign: "left",
          columnAlign: "left",
          isResize: true,
          result: [],
          type: "select",
          isFrozen: true
        },
        {
          field: "Is_Transport",
          title: "是否有联运支出",
          width: 80,
          titleAlign: "left",
          columnAlign: "left",
          isResize: true,
          isFrozen: true,
          componentName: "Transport"
        },
        {
          field: "DMCNUM",
          formatter: this.moneyFormat,
          title: "地接团号",
          width: 100,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        }, //,orderBy:''
        {
          field: "YingShou",
          formatter: this.moneyFormat,
          title: "应收金额",
          width: 100,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        }, //,orderBy:''
        {
          field: "ShiShou",
          formatter: this.moneyFormat,
          title: "实收金额",
          width: 100,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "TuiKuan",
          formatter: this.moneyFormat,
          title: "退款",
          width: 100,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "PingTaiShuiJin",
          formatter: this.moneyFormat,
          title: "平台税金",
          width: 100,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "ZaiTu",
          formatter: this.moneyFormat,
          title: "在途",
          width: 100,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "YouHui",
          formatter: this.moneyFormat,
          title: "优惠",
          width: 100,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "RedEnvelopeMoney",
          formatter: this.moneyFormat,
          title: "幸福存折",
          width: 100,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "DaiShou",
          formatter: this.moneyFormat,
          title: "待收金额",
          width: 100,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "YiShou",
          formatter: this.moneyFormat,
          title: "溢收金额",
          width: 100,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "GuestNum",
          title: "人数",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "GuestNum"
        },
        {
          field: "ManNum",
          title: "男/女",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "ManNum"
        },
        {
          field: "AgeAvg",
          title: "平均年龄",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "YaoQingHan",
          formatter: this.moneyFormat,
          title: "邀请函",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "CheZi",
          formatter: this.moneyFormat,
          title: "车资",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "JiPiao",
          formatter: this.moneyFormat,
          title: "机票款",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "GuoNeiLianYunJiPiao",
          formatter: this.moneyFormat,
          title: "国内联运机票",
          width: 120,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        // {field: 'Money11', title: '房费',width: 90, titleAlign: 'left',columnAlign:'left',isResize:true},
        {
          field: "Visa",
          formatter: this.moneyFormat,
          title: "签证",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "TiCheng",
          title: "提成",
          width: 100,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "CompensationMoney",
          title: "赔偿",
          formatter: this.moneyFormat,
          width: 100,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "BaoXian",
          title: "保险费",
          formatter: this.moneyFormat,
          width: 100,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "QiTa",
          formatter: this.moneyFormat,
          title: "其他支出",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "DiJieZhiChu",
          formatter: this.moneyFormat,
          title: "地接款支出",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "DiJieShouRu",
          formatter: this.moneyFormat,
          title: "地接款收入",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "ZiFei",
          formatter: this.moneyFormat,
          title: "自费收入",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "XiaoFeiShouRu",
          formatter: this.moneyFormat,
          title: "小费收入",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "XiaoFeiFinance",
          formatter: this.moneyFormat,
          title: "单据小费",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "XiaoFeiTravelStr",
          formatter: this.moneyFormat,
          title: "团队小费",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "YongJinShouRu",
          formatter: this.moneyFormat,
          title: "佣金收入",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "YongJinShouRuAvg",
          formatter: this.moneyFormat,
          title: "平均佣金收入",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "QTShouRu",
          formatter: this.moneyFormat,
          title: "其他收入",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "YingFu",
          formatter: this.moneyFormat,
          title: "应付金额",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "MaoLi",
          formatter: this.moneyFormat,
          title: "毛利",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "MaoLiRate",
          // formatter: this.moneyFormat,
          title: "毛利率",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "GZIncome",
          // formatter: this.moneyFormat,
          title: "挂账收入",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "CDIncome",
          // formatter: this.moneyFormat,
          title: "挂账支出",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "ShiJiLiRun",
          formatter: this.moneyFormat,
          title: "实际利润",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true,
          componentName: "TCIDJumpWang"
        },
        {
          field: "Remark",
          formatter: this.moneyFormat,
          title: "备注",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "BName",
          title: "公司别",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TransportCD",
          title: "成都",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TransportKM",
          title: "昆明",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TransportCQ",
          title: "重庆",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TransportWH",
          title: "武汉",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TransportXA",
          title: "西安",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TransportCS",
          title: "长沙",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TransportGY",
          title: "贵阳",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TransportNC",
          title: "南昌",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TransportXM",
          title: "厦门",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TransportLZ",
          title: "兰州",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TransportNJ",
          title: "南京",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TransportWT",
          title: "微途",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TransportHF",
          title: "合肥",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TransportNN",
          title: "南宁",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TransportZZ",
          title: "郑州",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TransportXC",
          title: "西昌",
          width: 50,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TransportCost",
          formatter: this.moneyFormat,
          title: "联运成本",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "UnionExtraMoney",
          formatter: this.moneyFormat,
          title: "额外返佣",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "UnionTiCheng",
          formatter: this.moneyFormat,
          title: "联运提成",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "YingYeE",
          formatter: this.moneyFormat,
          title: "联运营业额",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "RealIncome",
          formatter: this.moneyFormat,
          title: "实际营业额",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "GRPNum",
          title: "GRP",
          width: 60,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "TKTNum",
          title: "TKT",
          width: 60,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "VisaNum",
          title: "VISA",
          width: 60,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "ZiYouXingNum",
          title: "自由行",
          width: 60,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "DiJieNum",
          title: "地接",
          width: 60,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "HotelNum",
          title: "酒店",
          width: 60,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "DanTuanNum",
          title: "单团",
          width: 60,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "HuZhaoNum",
          title: "护照",
          width: 60,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "AverageIncome",
          formatter: this.moneyFormat,
          title: "平均收入",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "AverageCost",
          formatter: this.moneyFormat,
          title: "平均成本",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "AverageProfit",
          formatter: this.moneyFormat,
          title: "平均利润",
          width: 90,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "ReceiptNotFinance",
          title: "未制单收据",
          width: 60,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        },
        {
          field: "ReceiptNotAudit",
          title: "制单未审核收据",
          width: 60,
          titleAlign: "left",
          columnAlign: "right",
          isResize: true
        }
      ],
      footer: [],
      pageSize: 6,
      pageIndex: 1,
      AALloading: false,
      BranchStatus:true,
      shujuType:false,
      PlaceList:[],
      F_GeneralManager:false,
    };
  },
  created() {
    this.msg.startDate=this.$route.query.StartTime!=undefined?this.$route.query.StartTime:'';
    this.msg.endDate=this.$route.query.EndTime!=undefined?this.$route.query.EndTime:'';
    this.msg.LineId=this.$route.query.LineId!=undefined?Number(this.$route.query.LineId):'';
    this.msg.OutBranchId=this.$route.query.OutBranchId?Number(this.$route.query.OutBranchId):this.msg.OutBranchId;
    if(this.$route.query.LtIdStr){
      this.msg.LtIdStr=this.$route.query.LtIdStr
    }
    if(this.$route.query.IsSelectTravelLoss){
      this.msg.IsSelectTravelLoss=this.$route.query.IsSelectTravelLoss
    }
    if(this.msg.endDate!=""){
      this.productionDate[0]=this.msg.startDate;
      this.productionDate[1]=this.msg.endDate;
    }
    
    if(this.msg.LineId>0){
      this.msg.DataType="1";
    }
    if(this.msg.LineId==-1){
      // 其余都是不限
      this.msg.DataType="-1";
      this.msg.OutBranchId=45;
      this.msg.LineId=0;
    }
    if(this.msg.LineId==-2){
      this.msg.DataType="2";
    }
    if(this.msg.LineId==-3){
      this.msg.DataType="5";
    }
    if(this.msg.LineId==-4){
      this.msg.DataType="3";
    }
    //景点门票
    if(this.msg.LineId==-8){
      this.msg.DataType="10";
    }
    // 票务部专户
    if(this.msg.LineId==-7){
      this.msg.DataType="8";
    }
    // 酒店住宿
    if(this.msg.LineId==-9){
      this.msg.DataType="9";
    }
    // 餐厅美食
    if(this.msg.LineId==-10){
      this.msg.DataType="11";
    }
    // 单机票
    if(this.msg.LineId==-11){
      this.msg.DataType="14";
    }
    // 单机票
    if(this.msg.LineId==-11){
      this.msg.DataType="14";
    }
    // 老挝地接部
    if(this.msg.LineId==-6){
      this.msg.DataType="7";
    }
    // 日本地接部
    if(this.msg.LineId==-5){
      this.msg.DataType="6";
    }
    let userInfo = this.getLocalStorage();
    if((","+userInfo.ActionMenuCode+",").indexOf(',F_Query_TicketTeamRevenueReport,')!=-1){
        this.isShowType = false;
        this.msg.DataType='2';
    }else{
      if((","+userInfo.ActionMenuCode+",").indexOf(',F_Query_LocalTeamRevenueReport,')!==-1){
            this.isShowGrounding = false;
            this.msg.DataType='6';
        }
    }
    
  },
  components: {},
  mounted() {
    let allH, allW, cH, cW;
    allH = document.documentElement.clientHeight;
    allW = document.documentElement.clientWidth;
    cW = allW - 90;
    cH = allH - 350 - 52;
    this.msg.pageSize = parseInt(cH / 30) - 2;
    let userInfo = this.getLocalStorage();
    this.getCompanyMsg.RB_Group_Id = userInfo.RB_Group_id; //集团ID
    this.userId = userInfo.EmployeeId;
    this.getCompanyList();   
    this.getLineList();
    this.getStartList1();
    this.getPageList();
    this.GetSupperOrderEditAuth();
  },
  methods: {
    GetSupperOrderEditAuth() {
          // F_GeneralManager_Special 财务总经理副总经理权限
          var actionCode = this.$AuthCode.F_GeneralManager_Special;
          this.CheckUserAuth(actionCode, res => {
          if (res.data.resultCode == 1 && res.data.data == 1) {
              this.F_GeneralManager = true;
          }
          });
      },
    rowClick(rowIndex,rowData,column){
      let path='RegistrationList';
      if(this.msg.DataType==1 || this.msg.DataType=='1'){
        if(column.title=="待收金额" || column.title=="溢收金额"){
          this.$router.push({
            name: path,
            query: {
              id: rowData.TCID,
              blank: "y",
            }
          });
        }
      }
    },
     //获取目的地列表
      getLinePlaceList(lineId) {
        let msg = {
          lineID: lineId,
        }
        this.apipost('team_post_GetLinePlace', msg, res => {
          if (res.data.resultCode == 1) {
            this.PlaceList = res.data.data;
          }
        })
      },
      //获取领队和导游
      GetLeaderList() {
        this.LeaderList=[];
        this.msg.LeaderId=0;
        let msg = {
          Type: this.msg.LeaderType,
        }
        this.apipost(
          'leader_post_GetList', msg,
          res => {
            if (res.data.resultCode == 1) {
              this.LeaderList = res.data.data;
            }
          },
          err => {}
        )
      },
      getLineTeamList(lineId,PlaceId) { 
        
        
       //获取系列列表
      this.apipost(
        "team_post_GetList",
        {
          lineID: lineId,
          placeID:PlaceId,
          isTOOP: 1
        },
        res => {
          if (res.data.resultCode == 1) {
            this.msg.LineTeamId = "-1";
            this.LineTeamList = res.data.data;
          }
        }
      );
    },
    SetTravelClose(){
      this.btnloading=true;
      this.apipost(
        "financestatistics_post_SetTravelCloseReceipts",
        this.msg,
        res => {
          this.btnloading=false;
          if (res.data.resultCode == 1) {
            this.$message.success(res.data.message);
          } else {
            this.AALloading = false;
            this.Error(res.data.message);
          }
        }
      );
    },
    goEasyReport: function() {
      let year = this.productionDate[0]
        ? this.productionDate[0].substring(0, 4)
        : "";
      this.$router.push({
        path: "/EasyReport",
        query: { year: year, blank: "y" }
      });
    },
    togbu: function() {
      this.AALloading = true;
      this.apipost(
        "financestatistics_post_InsertFinanceStatistics",
        {},
        res => {
          if (res.data.resultCode == 1) {
            this.$message.success(res.data.message);
          } else {
            this.AALloading = false;
            this.$message.error(res.data.message);
          }
        }
      );
    },
    submitKaiqiZzBox: function() {
      // 开关闸提交
      if (
        this.kaiqiZzMsg.QStartDate === "" ||
        this.kaiqiZzMsg.QEndDate === ""
      ) {
        return this.$message.error("请选择发团日期");
      }
      this.kaiqiZzLoading = true;
      this.apipost(
        "travel_post_UpdateBatchBrakeAccountStatus",
        this.kaiqiZzMsg,
        r => {
          if (r.data.resultCode === 1) {
            this.getPageList();
            this.initKaiqiZzBox();
            this.kaiqiZzLoading = false;
            this.$message.success(r.data.message);
          } else {
            this.kaiqiZzLoading = false;
          }
        },
        null
      );
    },
    openKaiQiZzBox: function(text) {
      // 打开开关闸弹窗
      this.kaiqiZzMsg.Is_Open = text === "一键开启" ? 0 : 1;
      this.kaiqiZzTitle = text;
      this.kaiqiZzBox = true;
    },
    initKaiqiZzBox: function() {
      // 初始化开关闸信息
      this.KaiqiZzTime = [];
      this.kaiqiZzMsg = {
        QStartDate: "",
        QEndDate: "",
        Is_Open: ""
      };
      this.kaiqiZzBox = false;
    },
    method5: function() {
      let msg = JSON.parse(JSON.stringify(this.msg));
      delete msg.pageIndex;
      delete msg.pageSize;
      msg.EmployeeId = this.userId;
      this.GetLocalFile(
        "financestatistics_post_OutToExcelRevenueReportList",
        msg,
        "营收报表.xls"
      );
    },
    exportExcelCurrentPage() {
      //待实现
      // 导出文件名
      let xlsxName = "团队营收报表";
      // 数据源
      let dataSource = this.DataList;
      let data = [];
      // 创建表头数据
      data.push([
        "线路",
        "团队编号",
        "团号",
        "是否有联运支出",
        "应收金额",
        "实收金额",
        "退款",
        "平台税金",
        "优惠金额",
        "待收金额",
        "溢收金额",
        "人数",
        "邀请函",
        "车资",
        "机票款",
        "国内联运机票",
        "签证",
        "其他",
        "地接款支出",
        "地接款收入",
        "自费收入",
        "小费收入",
        "单据小费",
        "团队小费",
        "佣金收入",
        "应付金额",
        "毛利",
        "毛利率",
        "实际利润",
        "备注",
        "公司别",
        "成都",
        "昆明",
        "重庆",
        "武汉",
        "西安",
        "长沙",
        "贵阳",
        "南昌",
        "厦门",
        "兰州",
        "南京",
        "微途",
        "合肥",
        "南宁",
        "联运成本",
        "联运提成",
        "营业额",
        "GRP",
        "TKT",
        "VISA",
        "自由行",
        "地接",
        "酒店",
        "单团",
        "护照",
        "平均收入",
        "平均成本",
        "平均利润"
      ]);
      downloadExcelEasy.downLoad(data[0], dataSource, this.footer);
      return;
      let wscols = {};
      // 每列的宽度
      wscols = [];

      // 组装表格内容
      dataSource.forEach((x, index) => {
        let obj = [];
        obj.push(x.FrID + " ");
        obj.push(x.TCNUM);
        obj.push(x.TCID);
        obj.push("否");
        for (let i = 0; i <= data[0].length - 5; i++) {
          obj.push(Math.random() * 9999);
        }
        data.push(obj);
        if (index === dataSource.length - 1) {
          let obj = [];
          this.footer[0].forEach(x => {
            obj.push(x);
          });
          data.push(obj);
        }
      });
      let colName = [
        "A",
        "B",
        "C",
        "D",
        "E",
        "F",
        "G",
        "H",
        "I",
        "J",
        "K",
        "L",
        "M",
        "N",
        "O",
        "P",
        "Q",
        "R",
        "S",
        "T",
        "U",
        "V",
        "W",
        "X",
        "Y",
        "Z",
        "AA",
        "AB",
        "AC",
        "AD",
        "AE",
        "AF",
        "AG",
        "AH",
        "AI",
        "AJ",
        "AK",
        "AL",
        "AM",
        "AN",
        "AO",
        "AP",
        "AQ",
        "AR",
        "AS",
        "AT",
        "AU",
        "AV",
        "AW",
        "AX",
        "AY",
        "AZ",
        "BA",
        "BB",
        "BC",
        "BD",
        "BE",
        "BF",
        "BG"
      ];
      const ws = XLSX.utils.aoa_to_sheet(data);
      ws["!cols"] = wscols;
      ws["!rows"] = [];
      // colName.forEach((x,index)=>{
      //   wscols.push({wpx: 100})
      // });
      // dataSource.forEach((x,index)=>{
      //   if(index===dataSource.length)
      //     ws['!rows'].push({ hpx:30 });
      //   else
      //     ws['!rows'].push({});
      // });
      const wb = XLSX.utils.book_new();
      XLSX.utils.book_append_sheet(wb, ws, xlsxName);
      var dataInfo = wb.Sheets[wb.SheetNames[0]];
      // return
      data[0].forEach((x, i) => {
        dataInfo[colName[i] + "1"].s = {
          fill: { fgColor: { rgb: "#ffff00" } },
          font: {
            name: "微软雅黑",
            sz: 32,
            color: { rgb: "#ffff00" },
            bold: true,
            italic: true,
            underline: true
          },
          alignment: {
            horizontal: "center",
            vertical: "center"
          }
        };
      });
      // return
      XLSX.writeFile(wb, xlsxName + ".xlsx");
    },
    moneyFormat(rowData, rowIndex, pagingIndex, field) {
      if (field === "YingShou") return this.priceFormat(rowData.YingShou);
      if (field === "ShiShou") return this.priceFormat(rowData.ShiShou);
      if (field === "TuiKuan") return this.priceFormat(rowData.TuiKuan);
      if (field === "PingTaiShuiJin")
        return this.priceFormat(rowData.PingTaiShuiJin);
      if (field === "DaiShou") return this.priceFormat(rowData.DaiShou);
      if (field === "ZaiTu") return this.priceFormat(rowData.ZaiTu);
      if (field === "RealIncome") return this.priceFormat(rowData.RealIncome);
      if (field === "YiShou") return this.priceFormat(rowData.YiShou);
      if (field === "YaoQingHan") return this.priceFormat(rowData.YaoQingHan);
      if (field === "CheZi") return this.priceFormat(rowData.CheZi);
      if (field === "JiPiao") return this.priceFormat(rowData.JiPiao);
      if (field === "GuoNeiLianYunJiPiao")
        return this.priceFormat(rowData.GuoNeiLianYunJiPiao);
      if (field === "Visa") return this.priceFormat(rowData.Visa);
      if (field === "TiCheng") return this.priceFormat(rowData.TiCheng);
      if (field === "CompensationMoney")
        return this.priceFormat(rowData.CompensationMoney);
      if (field === "QiTa") return this.priceFormat(rowData.QiTa);
      if (field === "DiJieZhiChu") return this.priceFormat(rowData.DiJieZhiChu);
      if (field === "DiJieShouRu") return this.priceFormat(rowData.DiJieShouRu);
      if (field === "ZiFei") return this.priceFormat(rowData.ZiFei);
      if (field === "MianShuiDian")
        return this.priceFormat(rowData.MianShuiDian);
      if (field === "XiaoFeiShouRu")
        return this.priceFormat(rowData.XiaoFeiShouRu);
      if (field === "YongJinShouRu")
        return this.priceFormat(rowData.YongJinShouRu);
      if (field === "YingFu") return this.priceFormat(rowData.YingFu);
      if (field === "MaoLi") return this.priceFormat(rowData.MaoLi);
      // if (field === "MaoLiRate") return rowData.MaoLiRate;
      if (field === "ShiJiLiRun") return this.priceFormat(rowData.ShiJiLiRun);
      if (field === "TransportCost")
        return this.priceFormat(rowData.TransportCost);
      if(field === "UnionExtraMoney")
      return this.priceFormat(rowData.UnionExtraMoney);
        if (field === "UnionTiCheng")
        return this.priceFormat(rowData.UnionTiCheng);
      if (field === "YingYeE") return this.priceFormat(rowData.YingYeE);
      if (field === "AverageIncome")
        return this.priceFormat(rowData.AverageIncome);
      if (field === "AverageCost") return this.priceFormat(rowData.AverageCost);
      if (field === "AverageProfit")
        return this.priceFormat(rowData.AverageProfit);
    },
    setFooterCellClass(rowIndex, colIndex, value) {
      if (colIndex === 0) {
        return "footer-cell-class-name-title";
      } else {
        return "footer-cell-class-name-normal";
      }
    },
    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;
    },
    columnCellClass(rowIndex, columnName, rowData) {
       if(rowData.YingShou < 0 && columnName=="YingShou"){
        return "column-cell-class-name-test-red"
      }
       if(rowData.ShiShou < 0 && columnName=="ShiShou"){
        return "column-cell-class-name-test-red"
      }
       if(rowData.TuiKuan < 0 && columnName=="TuiKuan"){
        return "column-cell-class-name-test-red"
      }
       if(rowData.PingTaiShuiJin < 0 && columnName=="PingTaiShuiJin"){
        return "column-cell-class-name-test-red"
      }
       if(rowData.ZaiTu < 0 && columnName=="ZaiTu"){
        return "column-cell-class-name-test-red"
      }
       if(rowData.YouHui < 0 && columnName=="YouHui"){
        return "column-cell-class-name-test-red"
      }
      if(rowData.DaiShou < 0 && columnName=="DaiShou"){
        return "column-cell-class-name-test-red"
      }
      if(rowData.YiShou < 0 && columnName=="YiShou"){
        return "column-cell-class-name-test-red"
      }
      if(rowData.GuestNum < 0 && columnName=="GuestNum"){
        return "column-cell-class-name-test-red"
      }
      if(rowData.YaoQingHan < 0 && columnName=="YaoQingHan"){
        return "column-cell-class-name-test-red"
      }
      if(rowData.CheZi < 0 && columnName=="CheZi"){
        return "column-cell-class-name-test-red"
      }
      if(rowData.JiPiao < 0 && columnName=="JiPiao"){
        return "column-cell-class-name-test-red"
      }
      if(rowData.GuoNeiLianYunJiPiao < 0 && columnName=="GuoNeiLianYunJiPiao"){
        return "column-cell-class-name-test-red"
      }
      if(rowData.Visa < 0 && columnName=="Visa"){
        return "column-cell-class-name-test-red"
      }
      if(rowData.TiCheng < 0 && columnName=="TiCheng"){
            return "column-cell-class-name-test-red"
      }
     if(rowData.CompensationMoney < 0 && columnName=="CompensationMoney"){
            return "column-cell-class-name-test-red"
      }
      if(rowData.BaoXian < 0 && columnName=="BaoXian"){
            return "column-cell-class-name-test-red"
      }
      if(rowData.QiTa < 0 && columnName=="QiTa"){
            return "column-cell-class-name-test-red"
      }
      if(rowData.DiJieZhiChu < 0 && columnName=="DiJieZhiChu"){
            return "column-cell-class-name-test-red"
      }
      if(rowData.DiJieShouRu < 0 && columnName=="DiJieShouRu"){
            return "column-cell-class-name-test-red"
      }

      if(rowData.ZiFei < 0 && columnName=="ZiFei"){
            return "column-cell-class-name-test-red"
      }
      if(rowData.XiaoFeiShouRu < 0 && columnName=="XiaoFeiShouRu"){
            return "column-cell-class-name-test-red"
      }
      if(rowData.YongJinShouRu < 0 && columnName=="YongJinShouRu"){
            return "column-cell-class-name-test-red"
      }
      if(rowData.YingFu < 0 && columnName=="YingFu"){
            return "column-cell-class-name-test-red"
      }
      if(rowData.MaoLi < 0 && columnName=="MaoLi"){
            return "column-cell-class-name-test-red"
      }
      if(rowData.MaoLiRate < 0 && columnName=="MaoLiRate"){
            return "column-cell-class-name-test-red"
      }
       if(rowData.ShiJiLiRun < 0 && columnName=="ShiJiLiRun"){
            return "column-cell-class-name-test-red"
      }
      if(rowData.TransportCD < 0 && columnName=="TransportCD"){
            return "column-cell-class-name-test-red"
      }
       if(rowData.TransportKM < 0 && columnName=="TransportKM"){
            return "column-cell-class-name-test-red"
      }
      if(rowData.TransportCQ < 0 && columnName=="TransportCQ"){
            return "column-cell-class-name-test-red"
      }
      if(rowData.TransportWH < 0 && columnName=="TransportWH"){
            return "column-cell-class-name-test-red"
      }
      if(rowData.TransportXA < 0 && columnName=="TransportXA"){
            return "column-cell-class-name-test-red"
      }
      if(rowData.TransportCS < 0 && columnName=="TransportCS"){
            return "column-cell-class-name-test-red"
      }
      if(rowData.TransportGY < 0 && columnName=="TransportGY"){
            return "column-cell-class-name-test-red"
      }
      if(rowData.TransportNC < 0 && columnName=="TransportNC"){
            return "column-cell-class-name-test-red"
      }
       if(rowData.TransportXM < 0 && columnName=="TransportXM"){
            return "column-cell-class-name-test-red"
      }
       if(rowData.TransportLZ < 0 && columnName=="TransportLZ"){
            return "column-cell-class-name-test-red"
      }
       if(rowData.TransportNJ < 0 && columnName=="TransportNJ"){
            return "column-cell-class-name-test-red"
      }
       if(rowData.TransportWT < 0 && columnName=="TransportWT"){
            return "column-cell-class-name-test-red"
      }
       if(rowData.TransportHF < 0 && columnName=="TransportHF"){
            return "column-cell-class-name-test-red"
      }
       
       if(rowData.TransportNN < 0 && columnName=="TransportNN"){
        return "column-cell-class-name-test-red"
      }
       if(rowData.TransportCost < 0 && columnName=="TransportCost"){
        return "column-cell-class-name-test-red"
      }
      if(rowData.UnionExtraMoney<0 && columnName=="UnionExtraMoney"){
        return "column-cell-class-name-test-red"
      }
       if(rowData.UnionTiCheng < 0 && columnName=="UnionTiCheng"){
        return "column-cell-class-name-test-red"
      }
       if(rowData.YingYeE < 0 && columnName=="YingYeE"){
        return "column-cell-class-name-test-red"
      }
       if(rowData.RealIncome < 0 && columnName=="RealIncome"){
        return "column-cell-class-name-test-red"
      }
       if(rowData.GRPNum < 0 && columnName=="GRPNum"){
        return "column-cell-class-name-test-red"
      }
       if(rowData.TKTNum < 0 && columnName=="TKTNum"){
        return "column-cell-class-name-test-red"
      }
       if(rowData.VisaNum < 0 && columnName=="VisaNum"){
        return "column-cell-class-name-test-red"
      }
      if(rowData.ZiYouXingNum < 0 && columnName=="ZiYouXingNum"){
        return "column-cell-class-name-test-red"
      }
      if(rowData.DiJieNum < 0 && columnName=="DiJieNum"){
        return "column-cell-class-name-test-red"
      }
      if(rowData.HotelNum < 0 && columnName=="HotelNum"){
        return "column-cell-class-name-test-red"
      }
      if(rowData.DanTuanNum < 0 && columnName=="DanTuanNum"){
        return "column-cell-class-name-test-red"
      }
      if(rowData.HuZhaoNum < 0 && columnName=="HuZhaoNum"){
        return "column-cell-class-name-test-red"
      }
      if(rowData.AverageIncome < 0 && columnName=="AverageIncome"){
        return "column-cell-class-name-test-red"
      }
      if(rowData.AverageCost < 0 && columnName=="AverageCost"){
        return "column-cell-class-name-test-red"
      }
      
      if(rowData.AverageProfit < 0 && columnName=="AverageProfit"){
        return "column-cell-class-name-test-red"
      }
      
      // 给三行column为‘hobby’的列设置className
      if (columnName === "LineName") {
        return "column-cell-class-name-test";
      }
      if (columnName === "TCNUM") {
        return "column-cell-class-name-test2";
      }
      if (columnName === "TCID") {
        return "column-cell-class-name-test3";
      }
      if (columnName === "islianyun") {
        return "column-cell-class-name-test4";
      }
      if (rowIndex === 18) {
        return "column-cell-class-name-test-row";
      }
    },
    getStartList1() {
      // 获取出发城市
      this.apipost(
        "city_post_GetList",
        {
          isDefault: -1,
          priceType: -1
        },
        res => {
          if (res.data.resultCode == 1) {
            this.startCityList1 = res.data.data;
          } else {
          }
        }
      );
    },

    
    getLineList() {
      // 获取线路
      this.apipost("line_post_GetAllList", {}, res => {
        if (res.data.resultCode == 1) {
          this.LineList = res.data.data;
        } else {
          this.$message.error(res.data.message);
        }
      });
    },
    customCompFunc(param) {

    },
    compare(property, type) {
      // 升序  t 1升 2降
      if (type === 1) {
        return function(a, b) {
          let value1 = a[property];
          let value2 = b[property];
          return value1 - value2;
        };
      } else {
        return function(a, b) {
          let value1 = a[property];
          let value2 = b[property];
          return value2 - value1;
        };
      }
    },
    sortChange(param) {

      if (param.YingShou === "asc") {
        this.DataList.sort(this.compare("YingShou", 1));
      } else if (param.YingShou === "desc") {
        this.DataList.sort(this.compare("YingShou", 2));
      } else {
      }
      //自己写实现
      //{gender:"",name:"asc"}
    },
    // 数据筛选
    filterMethod(filters) {
      this.total = tableData.length;
    },
    handleCurrentChanges(val) {
      this.pageIndex = this.msg.pageIndex = val;
      this.getPageList();
    },
    getPageList() {
      // 获取列表数据
      this.loading = true;
      if (!this.msg.StartCityId) this.msg.StartCityId = 0;
      if (!this.msg.LineId) this.msg.LineId = 0;
      if (!this.msg.LineTeamId) this.msg.LineTeamId = 0;
      if (!this.msg.TCID) this.msg.TCID = 0;
      if (this.msg.startDate == "") this.msg.startDate = "2019-01-01";
      this.apipost(
        "financestatistics_post_GetPageList",
        this.msg,
        res => {
          if (res.data.resultCode == 1) {
            let BranchStatus=res.data.data.IsBranchButton;
            if(BranchStatus==-2){
              BranchStatus = -1;
              this.shujuType = true;
              this.apipost("line_post_GetList", {'LineDirection':2}, res => {
                if (res.data.resultCode == 1) {
                  this.LineList = res.data.data;
                } else {
                  this.Error(res.data.message);
                }
              });
            }
            if(BranchStatus==-1){
              this.BranchStatus=false;
            }else{
                this.BranchStatus=true;
                this.msg.OutBranchId=BranchStatus;
            }
            
       
            let data = res.data.data.pmodel.pageData;
            
            this.total = res.data.data.pmodel.count;
            this.SDate=res.data.data.pmodel.StartDate;
            this.EDate=res.data.data.pmodel.NextDate;
            this.UpdateStaus=res.data.data.Status;
            this.UpdateStartTime=res.data.data.UpdateTime;
            if (this.total == 0) {
              this.DataList = [];
            } else {
              let newData = [];
              data.forEach((x, index) => {
                  x.MaoLiRate=x.MaoLiRate+"%";
                if (index !== data.length - 1) {
                  x.Is_Transport = x.Is_Transport === 0 ? "否" : "是";
                  newData.push(x);
                } else {
                  // x.MaoLiRate =
                  //   this.total === 0 ? 0 : parseFloat(x.MaoLiRate / this.total);
                  // x.AverageIncome =
                  //   this.total === 0
                  //     ? 0
                  //     : parseFloat(x.AverageIncome / this.total);
                  // x.AverageCost =
                  //   this.total === 0
                  //     ? 0
                  //     : parseFloat(x.AverageCost / this.total);
                  // x.AverageProfit =
                  //   this.total === 0
                  //     ? 0
                  //     : parseFloat(x.AverageProfit / this.total);
                  x.LineName = "合计";
                  x.TCID = "";
                  x.TCNUM = "";
                  x.Is_Transport = "";
                  x.BName = "";
                  newData.push(x);
                }
              });
              this.DataList = newData;
              // this.footer.push(data[data.length-1])
            }
            this.loading = false;
          } else {
            this.loading = false;
            this.$message.error(res.data.message);
          }
          // if (this.msg.OutBranchId === -1) this.msg.OutBranchId = -1;
          if (!this.msg.StartCityId) this.msg.StartCityId = 0;
          if (!this.msg.LineId) this.msg.LineId = 0;
          if (!this.msg.LineTeamId) this.msg.LineTeamId = 0;
          if (!this.msg.TCID) this.msg.TCID = "";
        },
        err => {}
      );
    },
    getCompanyList() {
      //获取公司列表
      this.apipost(
        "admin_get_BranchGetList",
        this.getCompanyMsg,
        res => {
          if (res.data.resultCode == 1) {
            this.CompanyList = res.data.data;
          } else {
          }
        },
        err => {}
      );
    },
    timeAdd(type) {
      // 日期格式
      if (type === 1) {
        if (!this.productionDate) {
          this.msg.startDate = "";
          this.msg.endDate = "";
          return;
        }
        this.msg.startDate = this.productionDate[0];
        this.msg.endDate = this.productionDate[1];
      }
      if (type === 2) {
        if (!this.KaiqiZzTime) {
          this.kaiqiZzMsg.QStartDate = "";
          this.kaiqiZzMsg.QEndDate = "";
          return;
        }
        this.kaiqiZzMsg.QStartDate = this.KaiqiZzTime[0];
        this.kaiqiZzMsg.QEndDate = this.KaiqiZzTime[1];
      }
    },
    handleCurrentChange(val) {
      //翻页
      this.msg.pageIndex = val;
      this.getPageList();
    },
    resetPageIndex() {
      // 重置页码
      this.msg.pageIndex = 1;
      this.currentPage = 1;
    }
  }
};
</script>
