<template>
  <div class="page-body myActiveOrder">
    <div class="row col" style="height: 40px">
      <div class="row col " style="align-items: center;margin-bottom: 10px">
         <q-btn color="accent" size="sm" class="q-mr-md " label="返回" @click="goBack" />
          <div v-if="activeName">
            活动名称：{{activeName}}
          </div>
      </div>
    </div>
    <div class="page-content">
      <OrderItem :dataList="data.List" ref="orderL" :authObj="authObj" :modityOrderType="2" :cancelList="CancelList"
        @success="refreshClassOrder"></OrderItem>
         <div class="row" style="justify-content: flex-end;padding: 5px 20px">
        <q-pagination v-model="msg.pageIndex" :max="pageCount" @input="changePage" class="full-width justify-end"
          color="primary" :input="true">
        </q-pagination>
      </div>
    </div>
  </div>
</template>
<script>
  import {
    quertClassOrderList
  } from '../../api/sale/sale';

  import OrderItem from '../../components/sale/activeOrder-item.vue'
  export default {
    components: {
      OrderItem
    },
    data() {
      return {
        data: {},
        activeName:"",
        msg: {
          pageIndex:1,
          pageSize:10,
          ActivityId: 0
        },
        pageCount:0,
        //正常订单
        dataList: [],
        //取消订单
        CancelList: [],
        //权限判断
        authObj: {
          isShowName: true, //不显示班级名称
          isShowEditSale: true, //显示修改销售按钮
          isShowEducationRemark: true, //显示修改教务备注
          isShowPrincipalRemark: true, //显示校长备注
          isShowManagerRemark: true, //显示总经理备注
          isShowCommissionEdit: true, //显示修改提成按钮
          isShowRewardEdit: true, //显示修改额外提成按钮
        }
      }
    },
    created() {
      if (this.$route.query.Id) {
        this.msg.ActivityId = this.$route.query.Id
      }
      if (this.$route.query.name) {
        this.activeName = this.$route.query.name
      }
      this.getList();
    },
    mounted() {

    },
    methods: {
       //获取订单列表
      getList() {
        this.loading = true;
        this.apipostDS("/api/Education/GetConsultOrderStatisticsPage",this.msg, (res) => {
          this.loading = false
          if (res.data.resultCode === 1) {
              this.data = res.data.data.pageData;
              this.pageCount = res.data.data.pageCount;
          }
        })
      },
      //刷新页面
      refreshClassOrder() {
        this.getList();
      },
      goBack(){
          this.$router.go(-1)
      },
       //翻页
      changePage(val) {
          this.msg.pageIndex = val;
          this.getList()
      },
    }
  }

</script>
<style >
.myActiveOrder .table-body{
  height: calc(100vh - 220px);
}
</style>
