<style>
.scenicSpotAccounting .el-collapse-item__header {
  background-color: #e3e3e3;
  color: #333333 !important;
  padding-left: 20px;
  height: 40px;
  line-height: 40px;
  border-radius: 4px;
}
.scenicSpotAccounting .el-collapse-item__arrow {
  line-height: 40px;
}
.scenicSpotAccounting .el-collapse-item__wrap {
  background-color: transparent;
  padding: 20px 0;
}
.scenicSpotAccounting .OrderList {
  width: 250px;
  height: 336px;
  background-color: #fff;
  margin: 20px 20px 20px 0;
  float: left;
  position: relative;
  border-radius: 4px;
}
.scenicSpotAccounting .OrderList:before,
.scenicSpotAccounting .OrderList:after {
  content: "";
  position: absolute;
  -webkit-transform: rotate(-3deg);
  transform: rotate(-3deg);
  bottom: 13px;
  box-shadow: 0 15px 5px rgba(0, 0, 0, 0.3);
  height: 20px;
  left: 3px;
  max-width: 300px;
  width: 40%;
}
.scenicSpotAccounting .OrderList:after {
  -webkit-transform: rotate(3deg);
  transform: rotate(3deg);
  left: auto;
  right: 3px;
}
.scenicSpotAccounting .OrderList .content {
  cursor: pointer;
  position: relative;
  z-index: 2;
  height: 100%;
  font-size: 13px;
  border-radius: 4px;
  text-align: center;
  background: #fff;
}
.scenicSpotAccounting .topImg {
  width: 100%;
  height: 158px;
  position: relative;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  overflow: hidden;
  text-align: center;
}
.scenicSpotAccounting .monthDiv {
  position: absolute;
  width: 80px;
  height: 80px;
  top: 20px;
  left: 85px;
  border-radius: 50%;
  border: 6px solid #ededed;
  background-color: #ffffff;
  line-height: 70px;
}
.scenicSpotAccounting .monNum {
  font-size: 35px;
}
.scenicSpotAccounting .mon {
  font-size: 12px;
}
.scenicSpotAccounting .dayList {
  width: 140px;
  height: 25px;
  background-color: rgba(255, 255, 255, 0.8);
  position: absolute;
  bottom: 15px;
  font-size: 12px;
  text-align: center;
  line-height: 25px;
  border-radius: 20px;
  left: 55px;
}
.scenicSpotAccounting .commonDiv {
  width: 85%;
  border-bottom: 1px dashed #e3e3e3;
  margin: auto;
  font-size: 14px;
}
.scenicSpotAccounting .comTitle {
  color: #333333;
  float: left;
  margin: 15px 0 10px 0;
}
.scenicSpotAccounting .numList {
  float: right;
  font-weight: bold;
  margin: 15px 0 10px 0;
}
.scenicSpotAccounting .income {
  color: #32cc8a;
}
.scenicSpotAccounting .outcome {
  color: #e85252;
}
.scenicSpotAccounting {
  margin-top: 30px;
}
.scenicSpotAccounting .is-active .el-collapse-item__header {
  background-color: #e85252;
  color: #fff !important;
}
.scenicSpotAccounting .weijie {
  font-weight: bold;
}
.scenicSpotAccounting ._weijieImg {
  position: absolute;
  z-index: 2018;
  bottom: 50px;
  right: 45px;
}
.scenicSpotAccounting .nocursor{cursor: default!important;}
.scenicSpotAccounting .hotel_box{min-height: 500px;}
</style>
<template>
  <div class="flexOne scenicSpotAccounting">
       <div class="hotel_box" v-loading="loading">
            <el-collapse v-model="activeNames">
            <el-collapse-item :title="item.YearStr+$t('restaurant.res_AnnualAccounts')" v-for="(item,index) in dateInfo" :name="index+1" :key="index">
                <div class="OrderList" v-for="items in dateInfo[index].SubList" :key="items.subCode">
                    <div class="content" @click="goUrl('scenicSpotDetails',item,items)" :class="{'nocursor':items.MonthStr==0}">
                        <div class="topImg">
                            <img src="../../assets/img/internalAccount.png">
                            <div class="monthDiv" v-if="items.MonthStr>0">
                                <span class="monNum">{{items.MonthStr}}</span><span class="mon">{{$t('pub.month')}}</span>
                            </div>
                            <div class="monthDiv" v-else>
                                <span class="weijie">{{$t('restaurant.res_OutStandingBills')}}</span>
                            </div>
                            <div class="dayList" v-if="items.MonthStr>0">
                                {{items.StartTime}}{{$t('restaurant.res_To')}}{{items.EndTime}}
                            </div>
                            <div class="dayList" v-else>
                                {{$t('restaurant.res_ContainsAll')}}
                            </div>

                        </div>
                        <div class="commonDiv clearfix">
                            <span class="comTitle">{{$t('restaurant.res_income')}}:</span>
                            <span class="numList income" v-if="items.MonthStr!==0">¥{{items.TotalPrice}}</span>
                        </div>
                        <div class="commonDiv clearfix">
                            <span class="comTitle">{{$t('restaurant.res_outcome')}}:</span>
                            <span class="numList outcome" v-if="items.MonthStr!==0">¥{{items.CostPrice}}</span>
                        </div>
                        <div class="commonDiv clearfix">
                            <span class="comTitle profit">{{$t('restaurant.res_profit')}}:</span>
                            <span class="numList income" v-if="items.MonthStr!==0">¥{{items.Profit}}</span>
                        </div>
                        <img v-if="items.MonthStr==0" class="_weijieImg" src="../../assets/img/bills.png" alt="">
                    </div>
                </div>
            </el-collapse-item>
            </el-collapse>
       </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      activeNames: 1,
      loading: false,
      dateInfo: ""
    };
  },
  methods: {
    getList() {
      this.loading = true;
      let msg = {};
      this.apipost(
        "dmcindex_get_GetTicketCouponsInteriorAccountingList",
        msg,
        res => {
          this.loading = false;
          if (res.data.resultCode == 1) {
            this.dateInfo = res.data.data;
            this.dateInfo.forEach(x => {
              x.YearStr = x.YearStr.toString();
            });
          }
        },
        err => {}
      );
    },
    goUrl(path, item, items) {
      if (items.MonthStr > 0) {
        this.$router.push({
          path: path,
          query: {
            YearStr: item.YearStr,
            MonthStr: items.MonthStr,
            TotalPrice: items.TotalPrice,
            CostPrice: items.CostPrice,
            Profit: items.Profit,
            blank:'y',tab:'核算详情'
          }
        });
      }
    }
  },
  mounted() {
    this.getList();
  }
};
</script>