<style scoped>
  .ExpectedCommission-form{
    padding: 10px 20px 0 20px;
  }
  .groupTourOrder{
    display: flex;
    flex-wrap: nowrap;
    flex-grow: 1;
  }
  .groupTourOrder span{
    /* width: 50%; */
    white-space: nowrap;
    font-size: 14px;
    background: #DEE1E6;
    color: #333333;
    border-radius: 5px;
    padding: 5px 10px;
    margin-left: 20px;
    /* #333333 */
  }
  .groupTourOrder span span{
    color: red;
  }
  .CommissionLadder-form{
    display: flex;
    flex-wrap: wrap;
    margin: 0 20px;
    /* margin-bottom: 10px; */
  }
  .CommissionLadder{
    flex: 1;
    padding: 16px 20px 20px 20px;

    background: #ffffff;
  }
  .CommissionLadder.Line{
    margin: 0 0 10px 0;

  }
  .border-bottom{
    border-bottom: 1px dashed #BDBDBD;
  }
  .CommissionLadder .title{
    font-size: 16px;
    font-weight: bold;
    padding: 0 0 5px 0;
    display: flex;
    justify-content: space-between;
  }
  .CommissionLadder p {
    padding: 5px 0 0px 0;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
  }
  .CommissionLadder p span:last-child{
    color: red;
  }
  .CommissionInfor{
    padding: 0 0 10px 0;
  }
  .CommissionInfor span{
    margin-left: 5px;
    font-size: 13px;
  }
  .CommissionInfor span:first-child{
    margin-left: 0;
  }
  .CommissionInfor span span{
    color: red;
  }
  .CommissionLadder:last-child{
    margin-right: 0;
  }
  .OpenOrder{
    background: #ffffff;
    padding: 10px 20px 20px 20px;
  }
  .OpenOrderMore{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 10px 0;
    cursor: 0;
    font-size: 16px;
    font-weight: 400;
    color: #333333;
  }
  .OpenOrderMore span{
    color: #999999;
    font-size: 14px;
  }
  .headerTitle{
    display: flex;
  }
  .headerTitle p{
    font-weight: bold;
  }
  .headerTitle span{
    font-weight: 100;
    color: red;
    margin-right: 20px;
  }
  /deep/.ExpectedCommission-table .cell{
    padding: 0 !important;
    text-indent: 10px;
  }
  /deep/.ExpectedCommission-table .el-table .el-table__cell{
    padding: 0 !important;
  }
  /deep/.ExpectedCommission-table .has-gutter .el-table__cell{
    padding: 7px 0 !important;
  }

  .tableTd{
    line-height: 30px;
    border-bottom: 1px solid #DEE1E6;
  }
  .tableTd+ div{
    line-height: 30px;
  }
</style>
<template>
  <div style="height: 92vh;overflow-y: scroll;">
    <div style="display: flex;align-items: center; justify-content: space-between;background: #fff;
    height: 40px;padding: 0 20px;">
      <div class="headerTitle">
        <template v-if="CommissionInfor">
        <!-- <p>总提成：<span>{{CommissionInfor.TotalCMoney}}</span></p> -->
        <p>总订单数：<span>{{CommissionInfor.OtherOrderNum+CommissionInfor.SalesOrderNum+CommissionInfor.JapanOrderNum+CommissionInfor.EuropeOrderNum+GNOrderNum}}</span></p>
        <p>总人头数：<span>{{CommissionInfor.OtherPeopleNum+CommissionInfor.OtherPNum+CommissionInfor.PeopleNum+CommissionInfor.EuropePNum+CommissionInfor.SalesPeopleNum+CommissionInfor.JapanPeopleNum+CommissionInfor.EuropePeopleNum+GNEopleNum}}</span></p>
        <p>总预期奖金：<span>{{CommissionJJ}}</span></p>
        <p>总预期提成：<span>{{CommissionTC}}</span></p>
        </template>
      </div>
      <div style="display: flex;align-items: center;">
        <!-- <i class="el-icon-chat-dot-square"
        style="cursor: pointer;color: #33B3FF;font-size: 31px;margin-right: 10px;"
        @click="rightOpen=true"></i> -->
        <template v-for="(item ,index) in MonthList">
          <input type="button" :key="index"
          :class="{'normalBtn':Month==item.Id,'hollowFixedBtn':Month!=item.Id}"
          :value="item.Name"
          @click="clickActive(item)"></input>
        </template>
      </div>
    </div>

    <div class="CommissionLadder-form">
      <div style="display: flex;justify-content: space-between; width: 100%;">
        <div style="display: flex;flex-direction: column;flex-grow: 2;">
          <div class="CommissionLadder-form" style="margin: 20px 0 10px 0;">
            <div class="CommissionLadder" style="padding: 15px 20px 20px 0;">
              <div style="display: flex;align-items: center;justify-content: space-between; padding: 0 0 10px 20px;
              ">
              <span style="font-size: 16px;font-weight: bold;">公司所有国内出发线路(单团.散拚)</span>
                <div>
                  <detailsButtom :type="1" :obj="commissionMsg" :Month="Month"/>
                </div>
              </div>
              <div class="groupTourOrder">
                  <span>销售额：<span>{{CommissionInfor.SalesMoney}}</span></span>
                  <span>订单数：<span>{{CommissionInfor.SalesOrderNum}}</span></span>
                  <span>人头数：<span>{{CommissionInfor.SalesPeopleNum}}</span></span>
                  <span>提成比例：<span>{{CommissionInfor.SalesRate}}%</span></span>
                  <span>预期提成：<span>{{CommissionInfor.SalesCommission}}</span></span>
              </div>
            </div>
          </div>
          <div style="padding: 5px 0 5px 0;text-align: right;color: red;">
            注：5月1日起小包团、落地团 需结团完结后，方参与提成定档；（再次注意，人数奖励是分日本、欧洲、其他线三个模块独立计算）
          </div>
          <div style="display: flex;">
            <div class="CommissionLadder Line border-bottom" style="margin: 0 0 0 0;">
              <div class="title">
                <span>日本线小包团、落地团以及单项提成</span>
              </div>
              <p>当月个人毛利润</p>
              <div class="CommissionInfor">
                <span>
                  订单数量：<span>{{CommissionInfor.JapanOrderNum}}</span>
                </span>
                <span>
                  人头数量：<span>{{CommissionInfor.JapanPeopleNum}}</span>
                </span>
                <span>
                  预期利润：<span>{{CommissionInfor.JapanProfit}}</span>
                </span>
                <span>
                  预期比例：<span>{{CommissionInfor.JapanRate}}%</span>
                </span>
                <span>
                  预期提成：<span>{{CommissionInfor.JapanCommission}}</span>
                </span>
              </div>
              <div>
                <progressComm :commissionratioList="JapaneseProfit"></progressComm>
              </div>
            </div>
            <div class="CommissionLadder Line border-bottom" style="margin: 0 10px 0 10px;">
              <div class="title">
                <span>欧洲线小包团、落地团以及单项提成</span>
              </div>
              <p>当月个人毛利润</p>
              <div class="CommissionInfor">
                <span>
                  订单数量：<span>{{CommissionInfor.EuropeOrderNum}}</span>
                </span>
                <span>
                  人头数量：<span>{{CommissionInfor.EuropePeopleNum}}</span>
                </span>
                <span>
                  预期利润：<span>{{CommissionInfor.EuropeProfit}}</span>
                </span>
                <span>
                  预期比例：<span>{{CommissionInfor.EuropeRate}}%</span>
                </span>
                <span>
                  预期提成：<span>{{CommissionInfor.EuropeCommission}}</span>
                </span>
              </div>
              <div>
                <progressComm :commissionratioList="EuropeProfit"></progressComm>
              </div>
            </div>
            <div class="CommissionLadder Line border-bottom" style="margin: 0 0 0 0;">
              <div class="title">
                <span>其他线小包团、落地团以及单项提成</span>
              </div>
              <p>当月个人毛利润</p>
              <div class="CommissionInfor">
                <span>
                  订单数量：<span>{{CommissionInfor.OtherOrderNum}}</span>
                </span>
                <span>
                  人头数量：<span>{{CommissionInfor.OtherPeopleNum}}</span>
                </span>
                <span>
                  预期利润：<span>{{CommissionInfor.OtherProfit}}</span>
                </span>
                <span>
                  预期比例：<span>{{CommissionInfor.OtherRate}}%</span>
                </span>
                <span>
                  预期提成：<span>{{CommissionInfor.OtherCommission}}</span>
                </span>
              </div>
              <div>
                <progressComm :commissionratioList="OtherProfit"></progressComm>
              </div>
            </div>
          </div>
          <div style="display: flex;">
            <div class="CommissionLadder Line" style="margin: 0 0 10px 0;">
              <p><span>当月人头奖励/不含门票、包车、国内游、小包团以及单团(独立成团)</span><span></span></p>
              <div class="CommissionInfor">
                <span>
                  人头数量：<span>{{CommissionInfor.PeopleNum}}</span>
                </span>
                <span>
                  奖励：<span>{{CommissionInfor.PeopleMoney}}</span>
                </span>
              </div>
              <div>
                <progressComm :commissionratioList="JapaneseLine"></progressComm>
              </div>
            </div>
            <div class="CommissionLadder Line" style="margin: 0 0 10px 10px;">
              <p><span>当月人头奖励/不含门票、包车、国内游、小包团以及单团(独立成团)</span><span></span></p>
              <div class="CommissionInfor">
                <span>
                  人头数量：<span>{{CommissionInfor.EuropePNum}}</span>
                </span>
                <span>
                  奖励：<span>{{CommissionInfor.EuropeMoney}}</span>
                </span>
              </div>
              <div>
                <progressComm :commissionratioList="EuropeLine"></progressComm>
              </div>
            </div>
            <div class="CommissionLadder Line" style="margin: 0 0 10px 10px;">
              <p><span>当月人头奖励/不含门票、包车、国内游、小包团以及单团(独立成团)</span><span></span></p>
              <div class="CommissionInfor">
                <span>
                  人头数量：<span>{{CommissionInfor.OtherPNum}}</span>
                </span>
                <span>
                  奖励：<span>{{CommissionInfor.OtherMoney}}</span>
                </span>
              </div>
              <div>
                <progressComm :commissionratioList="OtherLine"></progressComm>
              </div>
            </div>
          </div>
          <div style="display: flex;">
            <div class="CommissionLadder Line" style="margin: 0;" v-if="isAnnualBonus">
              <div style="display: flex;justify-content: space-between;">
               <span>年终奖(不含门票、包车、国内游)</span>
               <div>
                <detailsButtom :type="3" :obj="commissionMsg" :Month="Month"/>
                </div>
              </div>
              <p style="padding: 0 0 10px 0;text-align: left;"><span style="font-size: 13px;color: red;">注:年终奖励从每年3月起始</span></p>
              <div class="CommissionInfor">
                <span>达标 <span style="margin-left: 5px;margin-right: 5px;">{{CommissionInfor.BonusNum}}</span>月</span>
                <span><span>每月人数35人以上</span></span>
              </span>
              </div>
              <div>
                <progressComm :commissionratioList="AnnualBonus"></progressComm>
              </div>
            </div>
            <div class="CommissionLadder Line" style="margin: 0 0 0 10px;padding: 16px 20px 0 20px;">
              <div style="display: flex;justify-content: space-between;">
                <span style="font-weight: bold;font-size: 16px;">国内提成
                  <span style="font-size: 13px;color: red;margin-left: 20px;">
                    注:国内提成需结团后方可发放提成，以实际结团为准，此处只提供参考；</span>
                </span>
                <div>
                  <detailsButtom :type="2" :obj="commissionMsg" :Month="Month"/>
                </div>
              </div>
              <p style="padding: 0 0 10px 0;text-align: left;"></p>
              <div class="ExpectedCommission-table">
                <el-table border ref="multipleTable" :data="isExpansion?newRlistAll:newRlist">
                  <el-table-column width="80" prop="RuleName"
                  label="团队类型" show-overflow-tooltip>
                    <template slot-scope="scope">
                      {{scope.row.RuleName}}
                    </template>
                  </el-table-column>
                  <el-table-column width="70" prop="OrderNum"
                  label="团队状态">
                  <template slot-scope="scope">
                    <div class="tableTd">已结团</div>
                    <div>
                      未结团
                    </div>
                  </template>
                  </el-table-column>
                  <el-table-column width="70" prop="OrderNum"
                  label="订单数">
                  <template slot-scope="scope">
                    <div class="tableTd">{{scope.row.OrderNum?scope.row.OrderNum:scope.row.OrderNum}}</div>
                    <div>
                      {{scope.row.WaitOrderNum?scope.row.WaitOrderNum:scope.row.WaitOrderNum}}
                    </div>
                  </template>
                  </el-table-column>
                  <el-table-column width="70" prop="PeopleNum"
                  label="报名数">
                  <template slot-scope="scope">
                    <div class="tableTd">{{scope.row.PeopleNum?scope.row.PeopleNum:scope.row.PeopleNum}}</div>
                    <div>
                      {{scope.row.WaitPeopleNum?scope.row.WaitPeopleNum:scope.row.WaitPeopleNum}}
                    </div>
                  </template>
                  </el-table-column>
                  <el-table-column prop="Way"
                  label="提成方式">
                    <template slot-scope="scope">
                      {{scope.row.Way==2?'利润提成':'人头奖励'}}
                    </template>
                  </el-table-column>
                  <el-table-column prop="ProfitRate"
                  label="提成" width="60">
                    <template slot-scope="scope">
                      <template v-if="scope.row.Way==1">
                        {{scope.row.Money+'/人'}}
                      </template>
                      <template v-if="scope.row.Way==2">
                        {{scope.row.ProfitRate+'%'}}
                      </template>
                      <!-- <p v-if="scope.row.Way == 2" style="font-size: 12px;color: #999999;white-space: wrap;">
                        利润比{{scope.row.ProfitRate}}%
                        利润<=0时 {{scope.row.Money}}元/人</p> -->
                    </template>
                  </el-table-column>
                  <el-table-column prop="Profit"
                  label="预期利润" show-overflow-tooltip>
                    <template slot-scope="scope">
                      <div class="tableTd">{{scope.row.Way==2&&scope.row.Profit?scope.row.Profit:'-'}}</div>
                      <div>
                        {{scope.row.Way==2&&scope.row.WaitProfit?scope.row.WaitProfit:'-'}}
                      </div>
                    </template>
                  </el-table-column>
                  <el-table-column prop="Commission"
                  label="预期提成" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <div class="tableTd">{{scope.row.Commission}}</div>
                    <div>
                      {{scope.row.WaitCommission}}
                    </div>
                  </template>
                </el-table-column>
                </el-table>
                <div style="color: red;font-size: 12px;text-align: right;padding: 0;">
                  <span style="cursor: pointer;display: inline-block;padding: 10px 5px;" @click="isExpansion=!isExpansion">
                    {{isExpansion?'收起':'展开'}}
                    <i :class="[isExpansion?'el-icon-arrow-up':'el-icon-arrow-down']"></i>
                  </span>
                </div>
              </div>
            </div>
          </div>
        </div>

      </div>
    </div>
    <div class="ExpectedCommission-form">
      <!-- 未平账单 -->
      <div class="OpenOrder">
        <div class="OpenOrderMore">
          <div>帐未平订单</div>
          <span @click="goMore" style="cursor: pointer;">更多<i class="el-icon-d-arrow-right"></i> </span>
        </div>
        <OrderList :OrderList="OrderList"></OrderList>
      </div>
      <div style="display: flex;justify-content: space-between;">
        <div style="padding: 10px 0 0 0;color: #E95252;line-height: 30px;width: 50%;white-space: wrap;">
          <p style="font-weight: bold;">出境提成提醒：</p>
          1.日本线.韩国线.东南亚线.南亚线散拚.与单团提成保持1%提成不变</br>
          2.增加境外散拚提成(日本线.欧洲线.其他线分别奖励计算)</br>
          3.增加人头奖励(日本线.欧洲线.其他线3种)</br>
          4.所有业绩结算皆以出发日.尾款收齐为基准</br>
          5.人头奖励包不含门票、包车、国内游、小包团以及单团(独立成团)</br>
          6.人头奖励每月至少20条方可进行奖励!</br>
          7.以上所有核算皆以月为单位.核算基础为出发日或签证收取日算起!</br>
          8.直客部门归属直客业务编制.不参与同业部门业务销售!</br>
          9.单项服务每月人头数与年终人头奖励接按0.5计算</br>
          10.5月1日起小包团、落地团 需结团完结后，方参与提成定档</br>
          11.单团或小包团若产生亏损.销售与操作皆无奖励与提成</br>
          12.单团或小包团无额外收入奖励.所有收入都计入单团核算.如客人取消增收(机票或团费等).也需与团队共同核算.核算后按公司业绩制度执行</br>
          13.以上制度公司会因市场变动与业务实际情况採取适当因应或调整,敬请注意!!</br>

        </div>
        <div style="padding: 10px 0 0 0;color: #E95252;line-height: 30px;width: 50%;white-space: wrap;">
          <p style="font-weight: bold;">关于提成发放流程的补充通知：</p>
          <p>提成按时发放是公司所有人的期盼，同时也是公司重视的一部份，202
            3年04月27日发布文件编号：2023-A-19“关于提成发放流程的通知”文件，在实际
            操作过程中还是有部份人员不重视、无公德心，未在规定时间内及时改价或成本录入
            未完成，导致5月提成未正常发放，为不影响其他销售的提成，特对提成规则做以下补充：</p>
          1.从2023年5月18日起，行政部会按提成规定对已平账订单进行制单；</br>
          2.未在规定时间内改价平账订单，违反提成规则，该订单报名当事人提成金额为0。</br>
          3.未平账订单继续追溯至下个月，直到全部帐平为止，再放发上月其他订单提成</br>
          4.未结团团期或成本遗漏补录等原因，造成团队利润变动，销售提成会在次月再次验证此团利润，多退少补；</br>
          5.签证订单 需OP点完结后方可参与提成。</br>
          6.提成工作环环相扣，请所有人员务必有公德心，同时遵守工作流程，尊重他人。</br>
        </div>
      </div>



    </div>
  </div>
</template>

<script>
  import OrderList from './components/OrderList'
  import detailsButtom from './components/details'
  // import OrderList from '../myOrdersAllType/components/OrderList'
  import progressComm from './components/progressComm'
  export default {
    components: {
      OrderList,
      progressComm,
      detailsButtom
    },
    data() {
      return {
        jianjinNum: 0,
        isExpansion: false,
        CommissionJJ:0,
        CommissionTC:0,
        GNOrderNum:0,
        GNEopleNum:0,
        GNCommission:0,
        newRlist:[],
        newRlistAll:[],
        DomesticLine:{},
        AnnualBonus:{
          type:3,
          AvgLureNum:0,
          AvfOrderNum:0,
          CommissionRate:0,
          Commission: 0,
          CommissionProfit: 0,
          CommissionRateList:[]
        },
        OtherProfit:{
          type:2,
          AvgLureNum:0,
          AvfOrderNum:0,
          CommissionRate:0,
          Commission: 0,
          CommissionProfit: 0,
          CommissionRateList:[]
        },
        OtherLine:{
          type:1,
          AvgLureNum:0,
          AvfOrderNum:0,
          CommissionRate:0,
          Commission: 0,
          CommissionProfit: 0,
          CommissionRateList:[]
        },
        EuropeProfit:{
          type:2,
          AvgLureNum:0,
          AvfOrderNum:0,
          CommissionRate:0,
          Commission: 0,
          CommissionProfit: 0,
          CommissionRateList:[]
        },
        EuropeLine:{
          type:1,
          AvgLureNum:0,
          AvfOrderNum:0,
          CommissionRate:0,
          Commission: 0,
          CommissionProfit: 0,
          CommissionRateList:[]
        },
        JapaneseProfit:{
          type:2,
          AvgLureNum:0,
          AvfOrderNum:0,
          CommissionRate:0,
          Commission: 0,
          CommissionProfit: 0,
          CommissionRateList:[]
        },
        JapaneseLine:{
          type:1,
          AvgLureNum:0,
          AvfOrderNum:0,
          CommissionRate:0,
          Commission: 0,
          CommissionProfit: 0,
          CommissionRateList:[]
        },
        dataRuleList:[],
        rightOpen: false,
        msg:{
          Month: ''
        },
        Month: 1,
        MonthList:[
          {Name:'上月',Id:'0'},
          {Name:'当月',Id:'1'},
        ],
        CommissionInfor:{},
        OrderList: [],
        loading: true,
        YearTime:'',
        LastMonthTime: '',
        MonthTime: '',
        commissionMsg:{
          pageIndex: 1,
          pageSize: 6,
          OrderId: "", //订单id
          GuestId: 0, //客人id
          EnterId: 0, //业务员id
          OrderState: '1', //订单状态
          Q_IsCollect: "2", //收款状态
          StartTime: "",//报名开始日期
          EndTime: "",//报名结束日期
          FinishSTime: "",//完结开始时间
          FinishETime: "",//完结结束时间
          DepartSTime: "",//出发开始
          DepartETime: "",//出发结束
          TCNUM: "",//团号
          ProductName: "",//商品名称
          CustomerName: "",//客户名称
          LureEmpId: 0,//引流人员
          LineId: 0,//线路
          TravelType: 0,//跟团类型 1跟团 2当地游
          OrderType: "0",//订单类型
          IsSelectCRM: 0,//1来源crm
          IsMyOrder: 1,//1我的订单
        },
        isAnnualBonus: false,// 年终奖权限
      };
    },
    mounted() {
      this.getList()
    },
    created() {
      let userInfo = this.getLocalStorage();
      // 年终奖权限 销售，  引流， 市场， 票务 ， 票務，总经理，总经理
      if(userInfo.PostName.indexOf('销售')||userInfo.PostName.indexOf('引流')||
      userInfo.PostName.indexOf('市场，')||userInfo.PostName.indexOf('票务')||
      userInfo.PostName.indexOf('票務')||userInfo.PostName.indexOf('总经理')||
      userInfo.PostName.indexOf('总经理')){
        this.isAnnualBonus = true
      }
      let nowdays = new Date()
      this.Year = new Date().getFullYear()
      this.LastMonthTime = new Date().getMonth()
      this.MonthTime = new Date().getMonth() + 1
      this.msg.Month = this.Year+'-'+(this.MonthTime>=10?this.MonthTime:'0'+this.MonthTime)
      this.MonthList[0].Name = this.MonthList[0].Name+'('+this.LastMonthTime+'月)'
      this.MonthList[1].Name = this.MonthList[1].Name+'('+this.MonthTime+'月)'

      //this.Year+'-'+(this.MonthTime>=10?this.MonthTime:'0'+this.MonthTime)+'-01'//出发开始
      this.commissionMsg.DepartSTime = this.getBeforeDate(93,this.getBeforeDate(0,new Date().Format("yyyy-MM-dd")))
      var MonthDayNum = new Date(this.Year, this.MonthTime, 0).getDate(); //计算当月的天数
      this.commissionMsg.DepartETime = this.Year+'-'+(this.MonthTime>=10?this.MonthTime:'0'+this.MonthTime)+'-'+(MonthDayNum>=10?MonthDayNum:'0'+MonthDayNum)//出发结束
      this.GetOrderPageList()
    },
    methods: {
      goMore(){
        this.$router.push({
          name: 'erpMyCustomerOrder',
          query: {
            blank: 'y',
            Q_IsCollect: "2",
            DepartSTime: this.commissionMsg.DepartSTime,
            DepartETime: this.commissionMsg.DepartETime
          }
        });
      },
      clickActive(item){
        this.Month = item.Id
        if(item.Id==1){
          this.msg.Month = this.Year+'-'+(this.MonthTime>=10?this.MonthTime:'0'+this.MonthTime)
        }else{
          this.msg.Month = this.Year+'-'+(this.LastMonthTime>=10?this.LastMonthTime:'0'+this.LastMonthTime)
        }
        this.getList()
        // this.getData()
      },
      // 获取规则列表数据
      getList() {
        this.apipost("sellcommission_GetTYSaleCommissionRuleList", {}, res => {
          this.loading = false;
          if (res.data.resultCode == 1) {
            this.dataRuleList = res.data.data[0];
            this.JapaneseLine.CommissionRateList = this.dataRuleList.AwardRuleList
            this.JapaneseProfit.CommissionRateList = this.dataRuleList.ProfitRuleList
            this.EuropeLine.CommissionRateList = this.dataRuleList.EuropeAwardRuleList
            this.EuropeProfit.CommissionRateList = this.dataRuleList.EuropeProfitRuleList
            this.OtherLine.CommissionRateList = this.dataRuleList.OtherAwardRuleList
            this.OtherProfit.CommissionRateList = this.dataRuleList.OtherProfitRuleList
            this.AnnualBonus.CommissionRateList = this.dataRuleList.BonusRuleList
            this.getData()
          }else{
            this.Error(res.data.message)
          }
        });
      },
      // 获取预期数据
      getData(){
        // 日本欧洲提成
        this.apipost('sellcommission_GetTYSaleExpectCommission', this.msg,
          res => {
            if (res.data.resultCode == 1) {
              let data = res.data.data
              this.CommissionInfor = data;

              // 日本及其他人头奖励
              this.JapaneseLine.AvgLureNum = this.CommissionInfor.PeopleNum?this.CommissionInfor.PeopleNum:0
              this.JapaneseLine.Commission = this.CommissionInfor.PeopleMoney?this.CommissionInfor.PeopleMoney:0
              // 日本及其他提成比例
              this.JapaneseProfit.AvgLureNum = this.CommissionInfor.JapanCommission?this.CommissionInfor.JapanCommission:0
              this.JapaneseProfit.AvfOrderNum = this.CommissionInfor.JapanOrderNum?this.CommissionInfor.JapanOrderNum:0
              this.JapaneseProfit.CommissionRate = this.CommissionInfor.JapanRate?this.CommissionInfor.JapanRate:0
              this.JapaneseProfit.Commission = this.CommissionInfor.JapanCommission?this.CommissionInfor.JapanCommission:0
              this.JapaneseProfit.CommissionProfit = this.CommissionInfor.JapanProfit?this.CommissionInfor.JapanProfit:0
              // 欧洲人头奖励
              this.EuropeLine.AvgLureNum = this.CommissionInfor.EuropePNum?this.CommissionInfor.EuropePNum:0
              this.EuropeLine.Commission = this.CommissionInfor.EuropeMoney?this.CommissionInfor.EuropeMoney:0
              // 欧洲及其他提成比例
              this.EuropeProfit.AvgLureNum = this.CommissionInfor.EuropeCommission?this.CommissionInfor.EuropeCommission:0
              this.EuropeProfit.AvfOrderNum = this.CommissionInfor.EuropeOrderNum?this.CommissionInfor.EuropeOrderNum:0
              this.EuropeProfit.CommissionRate = this.CommissionInfor.EuropeRate?this.CommissionInfor.EuropeRate:0
              this.EuropeProfit.Commission = this.CommissionInfor.EuropeCommission?this.CommissionInfor.EuropeCommission:0
              this.EuropeProfit.CommissionProfit = this.CommissionInfor.EuropeProfit?this.CommissionInfor.EuropeProfit:0
              // 其他人头奖励
              this.OtherLine.AvgLureNum = this.CommissionInfor.OtherPNum?this.CommissionInfor.OtherPNum:0
              this.OtherLine.Commission = this.CommissionInfor.OtherMoney?this.CommissionInfor.OtherMoney:0
              // 其他提成比例
              this.OtherProfit.AvgLureNum = this.CommissionInfor.OtherCommission?this.CommissionInfor.OtherCommission:0
              this.OtherProfit.AvfOrderNum = this.CommissionInfor.OtherOrderNum?this.CommissionInfor.OtherOrderNum:0
              this.OtherProfit.CommissionRate = this.CommissionInfor.OtherRate?this.CommissionInfor.OtherRate:0
              this.OtherProfit.Commission = this.CommissionInfor.OtherCommission?this.CommissionInfor.OtherCommission:0
              this.OtherProfit.CommissionProfit = this.CommissionInfor.OtherProfit?this.CommissionInfor.OtherProfit:0
              // 年终奖
              this.AnnualBonus.AvfOrderNum = this.CommissionInfor.BonusNum?this.CommissionInfor.BonusNum:0
              this.AnnualBonus.Commission = this.CommissionInfor.BonusPeriods?this.CommissionInfor.BonusPeriods:0
              this.GetGNSaleExpectCommission()
            }else {
              this.Error(res.data.message);
            }
            this.loading = false
          },
          err => {this.loading = false}
        );

      },
      GetGNSaleExpectCommission(){
          // 国内提成
          this.apipost('sellcommission_Post_GetGNSaleExpectCommission', this.msg,
          res => {
            if (res.data.resultCode == 1) {
              this.DomesticLine = res.data.data
              this.GNOrderNum = 0
              this.GNEopleNum = 0
              this.GNCommission = 0
              this.DomesticLine.Rlist.forEach(item=>{
                this.GNOrderNum+=Number(item.OrderNum)
                this.GNEopleNum+=Number(item.PeopleNum)
                this.GNCommission+=Number(item.Commission)
              })

              this.newRlistAll = [
                this.DomesticLine.Rlist[2],
                this.DomesticLine.Rlist[3],
                this.DomesticLine.Rlist[4],
                this.DomesticLine.Rlist[0],
                this.DomesticLine.Rlist[1]]
              this.newRlist = [this.DomesticLine.Rlist[2]]
              let arr1 =[this.CommissionInfor.OtherMoney,this.CommissionInfor.PeopleMoney,this.CommissionInfor.EuropeMoney]
              let arr2 =[this.CommissionInfor.OtherCommission,this.CommissionInfor.SalesCommission,this.CommissionInfor.JapanCommission,this.CommissionInfor.EuropeCommission,this.GNCommission]
              this.CommissionJJ = this.CalculatePrice(arr1,0)
              this.CommissionTC = this.CalculatePrice(arr2,2)
            }
          })
      },
      GetOrderPageList(){
        this.commissionMsg.IsMyOrder = '1'
        this.apipost('CarSingle_post_GetGuestOrderStatisticsPageList', this.commissionMsg,
          res => {
            if (res.data.resultCode == 1) {
              let data = res.data.data.pageData
              if(data.length>5){
                for(let i=0;i<5;i++){
                  this.OrderList.push(data[i])
                }
              }else{
                this.OrderList = data
              }
            }else {
              this.Error(res.data.message);
            }
            this.loading = false
          },
          err => {this.loading = false}
        )

      },
      //计算总成本
      CalculatePrice(arr1,num) {
        var CoastPrice = this.$commonUtils.CaluJsonArraySum2(
          arr1,
          num
        );
        return CoastPrice>0?CoastPrice:0
      },

    }
  };

</script>
