<style scoped>
  @import "./css/cssReset.css";

  .page_fnDm {
    background-color: white;
  }

  .PAGE_teamRE .query-box {
    overflow: inherit;
    padding-bottom: 0;
    margin-top: 20px;
  }

  ._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 page-body" 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 class="w150" :disabled="!isHavePriceAction" v-model="msg.SchoolId" filterable
                :placeholder="$t('pub.pleaseSel')" @change="getPageList()">
                <el-option label="不限" :value="-1"></el-option>
                <el-option v-for="item in BranchList" :label="item.SName" :key="item.SId" :value="item.SId">
                  {{item.SName}}</el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="类型：">
              <el-select filterable v-model="msg.DateType">
                <el-option :value="-1" 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-input v-model="msg.ClassNo"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="班级编号:">
              <el-input v-model="msg.ClassId"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="班级名称:">
              <el-input v-model="msg.ClassName"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="	班级状态:">
              <el-select filterable v-model="msg.ClassState">
                <el-option :value="-1" 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-input v-model="msg.CourseName"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="教师名称:">
              <el-input v-model="msg.TeacherName"></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" 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="2" >
            <div style="height: 40px;padding-top: 5px;">
              <!-- <button class="normalBtn" @click="resetPageIndex(),getPageList()">{{$t('pub.searchBtn')}}</button> -->
              <q-btn color="primary" size="11px" :label="$t('pub.searchBtn')" @click="resetPageIndex(),getPageList()" style="marginRight:10px"/>
              <!-- <button class="hollowFixedBtn" @click="method5()">导出</button> -->
              <q-btn color="primary" size="11px" label="导出" @click="method5()"/>
            </div>
          </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">
          <span>
          </span>
        </li>
      </ul>
    </div>
    <ul class="other_report clearfix">
    </ul>
    <div class="_fnDm_content" v-loading="loading">
      <v-table is-horizontal-resize column-width-drag :show-vertical-border="true" style="width:100%" :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 style="padding-bottom:15px">
        <el-pagination background @current-change="handleCurrentChanges" layout="total,prev, pager, next, jumper"
          :page-size="msg.pageSize" :total='total'>
        </el-pagination>
      </div>
    </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 {
    mapState
  } from "vuex";
  import XLSX from "xlsx";

  import {
    getRevenueReportPageList,
  } from '../../api/report/index'
  import {
    EduDownLoad,
  } from '../../api/common/common';
  import {
    getSchoolDropdown, //获取校区列表
  } from '../../api/school/index';
  import {
    setTimeout
  } from "timers";
  Vue.component("TCIDJump", {
    //  团队跳转
    template: `
  <div>
    <span style="cursor: pointer" v-if="rowData.DataType===1"  @click="goUrl('TeamBalancePayment',rowData.TCID)">{{rowData.TCID}}</span>
    <span style="cursor: pointer" v-if="rowData.DataType===2" @click="goUrl('individualTicket',rowData.TCID)">{{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.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>
  </div>

  `,
    props: {
      rowData: {
        type: Object
      },
      field: {
        type: String
      },
      index: {
        type: Number
      }
    },
    methods: {
      goUrl(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("TCNUMJump", {
    //  团队跳转
    template: `<div>
  <span style="cursor: pointer;text-decoration:underline" v-if="rowData.DataType===1"  @click="goUrl('TravelControlList',rowData.TCNUM)">{{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)">{{rowData.TCNUM}}</span>
  </div>`,
    props: {
      rowData: {
        type: Object
      },
      field: {
        type: String
      },
      index: {
        type: Number
      }
    },
    methods: {
      goHand(path, rowData) {
        let TCID = rowData.TCID;
        let BranchId = rowData.OutBranchId;
        this.$router.push({
          path: "/" + path,
          query: {
            'ReTCID': TCID,
            "BranchId": BranchId,
            blank: "y"
          }
        });
      },
      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 StartTime = "";
        if (rowData.DataType === 6) {
          BankID = 14;
        }
        if (rowData.DataType === 7) {
          BankID = 15;
        }
        if (rowData.DataType === 12) {
          BankID = 19;
        }
        // 机票折让费
        if (rowData.DataType === 13) {
          BankID = "";
          StartTime = moment(rowData.StartTime).format("YYYY-MM-DD");
        }
        if (rowData.TCNUM.indexOf('JAP') != -1 || rowData.TCNUM.indexOf('LAO') != -1) {
          StartTime = moment(rowData.StartTime).format("YYYY-MM-DD");
        }
        this.$router.push({
          path: "/" + path,
          query: {
            'rec': 'rec',
            'StartTime': StartTime,
            "BankID": BankID,
            blank: "y"
          }
        });
      },
      goAIR(path, rowData) {
        let StartTime = "";
        if (rowData.TCNUM.indexOf('AIR') != -1) {
          StartTime = moment(rowData.StartTime).format("YYYY-MM-DD");
        }
        this.$router.push({
          path: "/" + path,
          query: {
            'air': 'air',
            'StartTime': StartTime,
            "BankID": 17,
            blank: "y"
          }
        });

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

      },
      goUrl(path, id) {
        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.OutTCStatus==0"></span>
          <span v-if="rowData.OutTCStatus==1">已出团</span>
          <span v-if="rowData.OutTCStatus==2">未出团</span>
          <span v-if="rowData.OutTCStatus==3">未发团</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: {
          pageIndex: 1,
          pageSize: 20,
          SchoolId: -1,
          DateType: 1,
          ClassId: 0,
          ClassName: "",
          ClassState: -1,
          CourseId: 0,
          CourseName: "",
          TeacherId: 0,
          TeacherName: '',
          StartTime: '',
          EndTime: '',
          ClassNo:'',
          ClassId:'',
        },
        DataList: [],
        UpdateStaus: 0,
        UpdateStartTime: '',
        UpdateEndTime: '',
        productionDate: [],
        loading: false,
        currentPage: 1,
        total: 0,
        tableData: [],
        multipleSort: false,
        kaiqiZzBox: false,
        KaiqiZzTime: [],
        LeaderList: [],
        kaiqiZzTitle: "",
        kaiqiZzLoading: false,
        kaiqiZzMsg: {
          QStartTime: "",
          QEndDate: "",
          Is_Open: ""
        },
        SDate: '',
        EDate: '',
        defaultMonth: [],
        BranchList: [],
        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: "SchoolName",
            title: "校区",
            width: 80,
            titleAlign: "left",
            columnAlign: "left",
            isResize: true,
            result: [],
            type: "select",
            isFrozen: true
          },
          {
            field: "ClassId",
            title: "编号",
            width: 50,
            titleAlign: "left",
            columnAlign: "left",
            isResize: true,
            isFrozen: true,

          },
          {
            field: "ClassNo",
            title: "班号",
            width: 95,
            titleAlign: "left",
            columnAlign: "left",
            isResize: true,
            isFrozen: true,

          },
          {
            field: "",
            title: "班级",
            width: 120,
            titleAlign: "left",
            columnAlign: "left",
            isResize: true,
            result: "",
            filterMultiple: false,
            type: "text",
            isFrozen: true,
            formatter: function (rowData, rowIndex, pagingIndex, field) {
              return `<span class='cell-edit-color' style="text-decoration: underline">${rowData.ClassName}</span>`;
            },
          },
          {
            field: "ClassBeginsStr",
            title: "开班时间",
            width: 90,
            titleAlign: "left",
            columnAlign: "left",
            isResize: true,
          },
          {
            field: "ClassState",
            title: "班级状态",
            width: 80,
            titleAlign: "left",
            columnAlign: "left",
            isResize: true,
            result: [],
            type: "select",
            formatter: function (rowData, rowIndex, pagingIndex, field) {
              let state = rowData.ClassState
              let text = ''
              if (state == 1) {
                text = '未开课'
              } else if (state == 2) {
                text = '学习中'
              } else if (state == 3) {
                text = '已结课'
              }
              return `<span class='cell-edit-color'>${text}</span>`;
            },

          },
          {
            field: "CourseName",
            title: "课程",
            width: 150,
            titleAlign: "left",
            columnAlign: "left",
            isResize: true,
            result: [],
            type: "select",
          },
          {
            field: "TeacherName",
            title: "教师",
            width: 70,
            titleAlign: "left",
            columnAlign: "left",
            isResize: true,
          },
          {
            field: "YingShou",
            formatter: this.moneyFormat,
            title: "原价",
            width: 100,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          }, //,orderBy:''
          {
            field: "ShiShou",
            formatter: this.moneyFormat,
            title: "实收",
            width: 100,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          }, //,orderBy:''
          {
            field: "TuiKuan",
            formatter: this.moneyFormat,
            title: "退款",
            width: 100,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "PingTaiShuiJin",
            formatter: this.moneyFormat,
            title: "手续费",
            width: 100,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "YouHui",
            formatter: this.moneyFormat,
            title: "优惠金额",
            width: 100,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "DaiShou",
            formatter: this.moneyFormat,
            title: "待收",
            width: 100,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "YiShou",
            formatter: this.moneyFormat,
            title: "溢收",
            width: 100,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "GuestNum",
            title: "学生数量",
            width: 100,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "QTShouRu",
            formatter: this.moneyFormat,
            title: "其他收入",
            width: 100,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "TiCheng",
            formatter: this.moneyFormat,
            title: "提成",
            width: 100,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "ClassFee",
            title: "课时费",
            width: 70,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "JiXiaoMoney",
            title: "绩效奖金",
            width: 80,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "QTZhiChu",
            title: "其他支出",
            width: 80,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "YingFu",
            formatter: this.moneyFormat,
            title: "应付",
            width: 90,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "MaoLi",
            formatter: this.moneyFormat,
            title: "毛利",
            width: 90,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "MaoLiRate",
            title: "毛利率",
            width: 90,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "ShiJiLiRun",
            formatter: this.moneyFormat,
            title: "实际利润",
            width: 120,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "Remark",
            title: "备注",
            width: 90,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "HoursNum",
            title: "总课时",
            width: 90,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "ConsumeNum",
            title: "已上课时",
            width: 80,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
            formatter: function (rowData, rowIndex, pagingIndex, field) {
              if(rowData.SchoolName=='合计'){
                return `<span class='cell-edit-color' >${rowData.ConsumeNum}</span>`;
              }else{
                return `<span class='cell-edit-color' style="text-decoration: underline">${rowData.ConsumeNum}</span>`;
              }
            },
          },
          {
            field: "ConsumeMoney",
            title: "已上课金额",
            width: 90,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "AverageIncome",
            title: "平均收入",
            width: 80,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "AverageCost",
            title: "平均成本",
            formatter: this.moneyFormat,
            width: 80,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
          {
            field: "AverageProfit",
            title: "平均利润",
            formatter: this.moneyFormat,
            width: 100,
            titleAlign: "left",
            columnAlign: "right",
            isResize: true,
          },
        ],
        footer: [],
        pageSize: 6,
        pageIndex: 1,
        AALloading: false,
        BranchStatus: true,
        shujuType: false,
        PlaceList: [],
        F_GeneralManager: false,
      };
    },
    created() {
      this.msg.StartTime = this.$route.query.StartTime != undefined ? this.$route.query.StartTime : '';
      this.msg.EndTime = 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.EndTime != "") {
        this.productionDate[0] = this.msg.StartTime;
        this.productionDate[1] = this.msg.EndTime;
      }
      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 (this.$route.query.BranchId) {
        this.msg.SchoolId = this.$route.query.BranchId != undefined ? Number( this.$route.query.BranchId ): '';

      } else {
        if (userInfo.School_Id > 0) {
          this.msg.SchoolId = userInfo.School_Id
        } else {
          this.msg.SchoolId = -1
        }
      }
      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';
        }
      }
    },
    computed: mapState({
      isHavePriceAction(state) {
        if (state.user.userInfo&&state.user.userInfo.ActionMenuList&&state.user.userInfo.ActionMenuList.length>0) {
          let action = state.user.userInfo.ActionMenuList.find(x => {
            if (x.FunctionCode == "SelectAllSchool") {
              return x;
            }
          });
          return action && action.FunctionCode;
        }
        return false;
      }
    }),
    mounted() {
      this.getPageList()
      this.getCompanyList()
    },
    methods: {
      GetSupperOrderEditAuth() {
        var actionCode = this.$AuthCode.F_GeneralManager_Special;
      },
      rowClick(rowIndex, rowData, column) {
        //新加跳入班级收支查询
        if (column.title == '班级' && rowData.ClassId > 0) {
          this.$router.push({
            path: '/course/paymentDetail',
            query: {
              ClassId: rowData.ClassId,
              School_Id: rowData.SchoolId,
              ClassName:encodeURI(rowData.ClassName), 
              blank: 'y'
            }
          })
        }else if(column.title == '已上课时'){
          if(rowData.ClassId>0){
            let ClassName = encodeURI(rowData.ClassName)
            this.OpenNewUrl('/course/monthLessonCost' , {
              ClassId: rowData.ClassId,
              ClassName:ClassName,
            });
          }
        }
      },
      submitKaiqiZzBox: function () {
        // 开关闸提交
        if (
          this.kaiqiZzMsg.QStartTime === "" ||
          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 = {
          QStartTime: "",
          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;
        EduDownLoad("/finance/GetRevenueReportToExcel", msg, "营收报表.xls")
      },
      exportExcelCurrentPage() {
        //待实现
        // 导出文件名
        let xlsxName = "团队营收报表";
        // 数据源
        let dataSource = this.DataList;
        let data = [];
        // 创建表头数据
        data.push([
          "线路",
          "团队编号",
          "团号",
          "是否有联运支出",
          "应收金额",
          "实收金额",
          "退款",
          "平台税金",
          "优惠金额",
          "待收金额",
          "溢收金额",
          "人数",
          "邀请函",
          "车资",
          "机票款",
          "国内联运机票",
          "签证",
          "其他",
          "地接款支出",
          "地接款收入",
          "自费收入",
          "小费收入",
          "单据小费",
          "团队小费",
          "佣金收入",
          "应付金额",
          "毛利",
          "毛利率",
          "实际利润",
          "备注",
          "平均收入",
          "平均成本",
          "平均利润"
        ]);
        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"] = [];
        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 === "YouHui") return this.priceFormat(rowData.YouHui);
        if (field === "QTShouRu") return this.priceFormat(rowData.QTShouRu);
        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";
        }
      },
      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 {}
      },
      // 数据筛选
      filterMethod(filters) {
        this.total = tableData.length;
      },
      handleCurrentChanges(val) {
        this.pageIndex = this.msg.pageIndex = val;
        this.getPageList();
      },
      // 获取数据
      getPageList() {
        getRevenueReportPageList(this.msg).then((res) => {
          this.loading = true;
          this.total = res.Data.pageModel.Count;
          let data = res.Data.pageModel.PageData;
          this.UpdateStaus = res.Data.Status;
          this.UpdateStartTime = res.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.SchoolName = "合计";
                x.ClassId = "";
                x.ClassName = "";
                x.TCID = "";
                x.TCNUM = "";
                x.Is_Transport = "";
                x.BName = "";
                newData.push(x);
              }
            });
            this.DataList = newData;
          }
          this.loading = false;
        })
      },
      timeAdd(type) {
        // 日期格式
        if (type === 1) {
          if (!this.productionDate) {
            this.msg.StartTime = "";
            this.msg.EndTime = "";
            return;
          }
          this.msg.StartTime = this.productionDate[0];
          this.msg.EndTime = this.productionDate[1];
        }
        if (type === 2) {
          if (!this.KaiqiZzTime) {
            this.kaiqiZzMsg.QStartTime = "";
            this.kaiqiZzMsg.QEndDate = "";
            return;
          }
          this.kaiqiZzMsg.QStartTime = 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;
      },
      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
        };
        getSchoolDropdown({}).then(res => {
          if (res.Code == 1) {
            var tempArray = res.Data;
            this.BranchList = tempArray;
          }
        })
      },
    },
  };

</script>
