<style>
  .guidstatisticalDetails .dataIn {
    margin: 30px 0;
  }

  .guidstatisticalDetails .backBtn {
    float: right;
    margin-right: 10px;
  }

  .guidstatisticalDetails .totalPrice {
    line-height: 0;
  }

  .guidstatisticalDetails .total {
    position: relative;
    top: 10px;
    font-family: PingFangSC-Semibold, sans-serif;
    font-size: 14px;
  }

  .guidstatisticalDetails .totalPrice label {
    display: block;
    width: 100%;
    height: 20px;
  }

  .guidstatisticalDetails .mainInfo {
    margin-top: 20px;
    font-size: 14px;
    overflow: auto;
  }

  .guidstatisticalDetails .infoTitle {
    width: 100%;
    height: 38px;
    background-color: #ededed;
    line-height: 38px;
    min-width: 1400px;
  }

  .guidstatisticalDetails .infoTitle span {
    display: inline-block;
    color: #000000;
    font-family: PingFangSC-Semibold, sans-serif;
    font-size: 12px;
    width: 9%;
    text-align: center;
  }

  .guidstatisticalDetails .listInfo {
    width: 100%;
    height: 50px;
    background-color: #fff;
    margin-bottom: 10px;
    min-width: 1400px;
    line-height: 50px;
    font-size: 12px;
  }

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

  .guidstatisticalDetails .listInfo span {
    display: inline-block;
    width: 9%;
    text-align: center;
  }

  .guidstatisticalDetails .littleTotal {
    font-size: 12px;
    color: #666666;
    position: relative;
    top: 10px;
  }

  .guidstatisticalDetails .c1 {
    color: #2aaef2;
  }

  .guidstatisticalDetails .c2 {
    color: #47bf8c;
  }

  .guidstatisticalDetails .c3 {
    color: #ff793e;
  }

  .guidstatisticalDetails .c4 {
    color: #ffba1f;
  }

  .guidstatisticalDetails .statistical {
    display: none;
    width: 100%;
    height: 500px;
  }

  .guidstatisticalDetails .hidDiv {
    display: none;
  }

  .guidstatisticalDetails .disDiv {
    display: block;
  }

  .guidstatisticalDetails .chartsMap {
    width: 100%;
    height: 500px;
    background-color: #fff;
    padding-top: 50px;
  }

  .guidstatisticalDetails .storeName {
    font-size: 12px;
    float: left;
  }

  .guidstatisticalDetails .leaderName,
  .jixiao {
    position: relative;
    top: -10px;
  }

  .guidstatisticalDetails .headerImg {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-block;
  }

  .guidstatisticalDetails .headerImg img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
  }

  .guidstatisticalDetails .icon-money {
    color: #ffba1f;
  }

  .guidstatisticalDetails .jixiao {
    margin-left: 20px;
  }

  .guidstatisticalDetails .totalNum {
    font-size: 16px;
    color: #e95252;
    font-family: PingFangSC-Semibold, sans-serif;
  }

</style>
<template>
  <div class='flexOne guidstatisticalDetails'>
    <div class="dataIn clearfix">
      <div class="storeName">
        <div class="headerImg">
          <img v-if="!EmPhoto" src="../../assets/img/default_head_img.jpg" alt="">
          <img v-else :src="EmPhoto" :onerror="defaultImg">
        </div>
        <span class="leaderName">{{LeaderName}} &nbsp;&nbsp;总提成:<span style="color:red;">&nbsp;{{totalSum}}</span></span>
      </div>
      <input type="button" class="hollowFixedBtn backBtn" @click="goUrl('leaderManagement')" :value="$t('pub.returnBack')" />
    </div>
    
    <table class="singeRowTable" border="0" cellspacing="0" cellpadding="0" v-loading="loading">
      <tr>
        <th width="25%">购物店</th>
        <th width="25%">进店日期</th>
        <th width="25%" >关联团号</th>
        <th width="25%">提成</th>
      </tr>
      <tr v-for="item in DataList" :key="item.subCode">
        <td>{{item.ShopName}}</td>
        <td>{{item.StoreTime}}</td>
        <td>{{item.TCNUM}}({{item.TCID}})</td>
        <td>￥{{item.LeaderCommission}}</td>
      </tr>
    </table>
    <el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage"
      layout="total,prev, pager, next, jumper" :page-size="msg.pageSize" :total="total">
    </el-pagination>
    <div class="statistical" :class="{'disDiv':isShow}">
      <div class="charts">
        <el-col :span='24'>
          <div id="guidstatisticalDetailschartsMap" class="chartsMap"></div>
        </el-col>
      </div>
    </div>
    <div class="noData" v-show="noData">
      {{$t('system.content_noData')}}
    </div>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        msg: {
          pageIndex: 1,
          pageSize: 15,
          LeaderID: "",
          Type: 0
        },
        noData: false,
        loading: true,
        currentPage: 1,
        total: 0,
        isShow: false,
        DataList: "",
        LeaderName: "",
        EmPhoto: "", //头像
        totalSum: "",
        defaultImg: 'this.src="' + require('../../assets/img/default_head_img.jpg') + '"',
      };
    },
    methods: {
      getList() {
        this.loading = true;
        this.apipost(
          "LeaderSchedule_get_GetLeaderPageList",
          this.msg,
          res => {
            this.loading = false;
            if (res.data.resultCode == 1) {
              this.LeaderName = res.data.data.pageData.LeaderName;
              this.EmPhoto = res.data.data.pageData.EmPhoto;
              this.totalSum = res.data.data.pageData.totalSum;
              this.total = res.data.data.count;
              this.noData = !this.total > 0;
              this.DataList = res.data.data.pageData.Data;
            }
          },
          err => {}
        );
      },
      handleCurrentChange(val) {
        //翻页功能按钮
        this.msg.pageIndex = val;
        this.getList();
      },
      goUrl(path) {
        this.$router.push({
          path: path
        });
      },
      showStatis(type) {
        if (type == 1) {
          this.isShow = true;
        } else {
          this.isShow = false;
        }
        var that = this;
        this.apipost(
          "LeaderSchedule_get_GetLeaderStatisticsList",
          this.msg,
          res => {
            if (res.data.resultCode == 1) {
              var xDatas = res.data.data.Time;
              var yDatas = res.data.data.LeaderExtract;
              that.$chartsUtils.LeaderCurrentPerformance(
                "guidstatisticalDetailschartsMap",
                xDatas,
                yDatas
              );
            }
          },
          err => {}
        );
      }
    },
    mounted() {
      this.msg.LeaderID = this.$route.query.id;
      this.msg.Type = this.$route.query.Type;
      this.getList();
    }
  };

</script>
