<style scoped>
  ._PrintPage{
    width: 100%;
    background-color: white;
    position: absolute;
    padding-top: 20px;
  }
  ._PrintPage_box{
    width: 1000px;
    margin: 0 auto;
    padding: 0 !important;
  }
  ._border_1{
    border: 1px solid #333333;
    margin-bottom:30px;
    /* page-break-after: always; */
  }
  /* @media print {
      ._PrintPage{
          margin-left:-145px;
      }
  } */
</style>
<template v-loading="loading">
  <div class="_PrintPage">
    <div class="_PrintPage_box">
      <template v-if="type==='2'&&(Merge==='0'||Merge===null)">
        <template v-for="(item,index) in loopNumT">
          <div v-if="index==1" class="_border_1">
            <my-Bill :ID="id" :width="widthSon" :isPrintPage="true" :color="colorSon" :OrderSource="OrderSource" :name='index+1'></my-Bill>
          </div>
        </template>
      </template>
      <template v-else-if="type==='1'&&(Merge==='0'||Merge===null)">
        <template v-for="(item,index) in loopNumN">
          <div v-if="index==1" class="_border_1">
            <my-RVB-Bill v-on:helloPP="numAdd" :Num="num" :ID="id" :width="widthSon" :isPrintPage="true" :OrderSource="OrderSource" :color="colorSon" :name='index+1'></my-RVB-Bill>
          </div>
        </template>
      </template>
      <template v-if="type==='7'&&(Merge==='0'||Merge===null)">
        <template v-for="(item,index) in loopNumT">
          <div v-if="index==1" class="_border_1">
            <my-GZ-Bill :ID="id" :width="widthSon" :isPrintPage="true" :color="colorSon" :OrderSource="OrderSource" :name='index+1'></my-GZ-Bill>
          </div>
        </template>
      </template>
      <!-- 收据3 -->
      <template v-if="type==='3'">
        <template v-for="(item,index) in loopNumT">
          <div v-if="index==1" class="_border_1">
            <my-SJ-Bill :ID="id" :width="widthSon" :isPrintPage="true" :color="colorSon" :OrderSource="OrderSource" :name='index+1'></my-SJ-Bill>
          </div>
        </template>
      </template>
      <template v-if="Merge==='1'">
        <template v-for="(item,index) in loopNumN">
          <div v-if="index==1" class="_border_1">
            <my-HB-Bill v-on:helloPP="numAdd" :Num="num" :ID="id" :width="widthSon" :isPrintPage="true" :color="colorSon" :name='index+1'></my-HB-Bill>
          </div>
        </template>
      </template>
    </div>
  </div>
</template>
<script>
  import myBill from "../components/BillModule.vue";
  import myrbvBill from "../components/ReceivablesModule.vue";
  import myhrBill from "../components/MergeBillModule.vue";
  import myGZBill from "../components/GZBillModule.vue";
  import mySJBill from "../components/SJBillModule.vue";
  export default {
    data(){
      return{
        loading:true,
        id:null,
        type:null,
        isKehu:null,
        widthSon:"100%",
        colorSon:"#ffffff",
        num:0,
        loopNumN:this.$route.query.isKehu==='1'?3:2,
        loopNumT:2,
        Merge:null,
        OrderSource:-1
      }
    },components:{
      'my-Bill': myBill,
      'my-RVB-Bill':myrbvBill,
      'my-HB-Bill':myhrBill,
      'my-GZ-Bill': myGZBill,
      'my-SJ-Bill': mySJBill,

    },methods:{
      numAdd(){
        this.num = this.num + 1
      }
    },mounted(){

    },created(){
      this.id = this.$route.query.id;
      this.type = this.$route.query.type;
      this.isKehu = this.$route.query.isKehu;
      this.Merge = this.$route.query.Merge;
      this.OrderSource = this.$route.query.OrderSource;
    }
  }
</script>
