<template>
  <div v-if="bill">
    <el-card class="box-card">
      <div slot="header" class=" clearfix">
        <span class="header">整包账单明细</span>
        <p style="padding: 1% 0 0 3%">[{{bill.project.pro_name}}] {{bill.project.pro_status}}</p>
      </div>
      <el-row :gutter="20">
        <el-col class="" :span="12">
          <div class="module-title">企业方:{{bill.company.nickname}}({{bill.company.uid}})</div>
          <div class="module-content">
            <div>平台报价：￥{{bill.order.amount}}</div>
            <div>实际托管：￥{{Number(bill.order.real_amount/100)}}</div>
            <div>代金券抵扣：￥0.00</div>
            <div>税费：￥{{bill.project.tax/100}}（{{bill.project.tax_rate}}%）</div>
            <div>平台服务费：￥{{(bill.project.service_fee)/100}}
              （费率{{Number(bill.project.service_fee_rate) + Number(bill.project.company_fee_rate_vip_reduce)}}%,企业版会员减免{{bill.project.company_fee_rate_vip_reduce}}%）</div>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="module-title">开发者:{{bill.user.nickname}}({{bill.user.uid}})</div>
          <div class="module-content">
            <div>结算金额：￥{{bill.order.real_amount/100-bill.project.person_tax/100-bill.project.person_platform_fee/100}}</div>
            <div>开发款项：￥{{bill.order.amount}}</div>
<!--            <div>冻结金额：￥88.96(冻结20%）</div>-->
            <div>税费：￥{{Number(bill.project.person_tax/100+bill.project.person_tax_service_fee/100).toFixed(2)}}（税率{{parseFloat(bill.project.person_tax_rate)+parseFloat(bill.project.person_tax_service_fee_rate)}}%）</div>
            <div>平台服务费：￥{{bill.project.person_platform_fee/100}}
              （费率{{(Number(bill.project.person_platform_fee_rate)+Number(bill.project.person_fee_rate_vip_reduce)).toFixed(2)}}%,开发者会员减免{{bill.project.person_fee_rate_vip_reduce}}%）</div>
          </div>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="24">
          <div class="module-title">账单信息</div>
          <div class="module-content">
            <div>托管时间：{{bill.project.pro_time}}</div>
            <div>结算时间：{{bill.project.pro_finishtime}}</div>
            <div>关联订单：<a v-if="bill.order" href="1"></a>托管订单 结薪订单 冻结订单 退款订单</div>
          </div>
        </el-col>
      </el-row>
    </el-card>
  </div>
</template>

<script>
export default {
  data(){
    return {
     bill:null
    }
  },
  mounted() {
    this.getOrderDetail();
  },
  methods:{
    async getOrderDetail() {
      const res = await this.$post("/api/admin/project/get_order_detail", { project_id:this.$route.query.id});
      //console.log(res.data.order.amount);
      this.bill=res.data;
      //console.log(this.bill);
    }
  }
}
</script>

<style lang="scss" scoped>
.box-card {
  margin-bottom: 10px;
  width: 100%;
}

.header {
  font-size: 24px;
  color: #222222;
  font-weight: 600;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}

.clearfix:after {
  clear: both;
}

.el-col {
  padding-top: 20px;
  padding-bottom: 20px;
}

.module-title {
  font-weight: bold;
}

.module-content {
  margin-top: 17px;
  margin-left: 14px;
}
</style>
