<style scoped>
    ._PrintPage{
        width: 100%;
        background-color: white;
        position: absolute;
    }
    ._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;
        }
    } */
    ._PrintPage_box{
        position: relative;
    }
    ._PrintPage_box .SetDiv{
      position: absolute;      
      color:#106BAF;
      left: -290px;
    }
    ._PrintPage_box .SetDiv span{
        color:#106BAF;
        cursor: pointer;
        font-size: 15px;
    }
    ._PrintPage_always{
      page-break-after: always;
      padding-top: 10px;
    }
</style>
<template v-loading="loading">
    <div class="_PrintPage">
        <div class="_PrintPage_box">
          <div v-for="(items,index) in printDatas" class="_PrintPage_always">
            <template v-if="items.type=='2'&&(items.Merge=='0'||items.Merge==null)">
                <div class="SetDiv">
                    <el-select size="mini" v-model="titleName" :placeholder="$t('objFill.qingxuanzhettname')"
                    style="width: 150px;">
                        <el-option
                          v-for="item in optionsList"
                          :key="item.value"
                          :label="item.Name"
                          :value="item.value">
                        </el-option>
                    </el-select>
                </div>
                <template v-for="(item,index) in loopNumT">
                  <div v-if="index+1==2"
                  :class="{'_border_1':index+1==2}">
                      <my-Bill :ID="items.id" :width="widthSon" :isPrintPage="true" :color="colorSon" :OrderSource="items.OrderSource" :name='index+1' :titleName="titleName"></my-Bill>
                  </div>
                </template>
            </template>
            <template v-else-if="items.type=='1'&&(items.Merge=='0'||items.Merge==null)">
                <div class="SetDiv">
                    <el-select size="mini" v-model="titleName" :placeholder="$t('objFill.qingxuanzhettname')"
                    style="width: 150px;">
                        <el-option
                          v-for="item in optionsList"
                          :key="item.value"
                          :label="item.Name"
                          :value="item.value">
                        </el-option>
                    </el-select>
                </div>
                <template v-for="(item,index) in loopNumN">
                  <div v-if="index+1==2" class="_border_1">
                    <my-RVB-Bill v-on:helloPP="numAdd" :Num="num" :ID="items.id" :width="widthSon" :isPrintPage="true" :OrderSource="items.OrderSource" :color="colorSon" :name='index+1' :titleName="titleName"></my-RVB-Bill>
                  </div>
                </template>
            </template>
            <template v-if="items.type=='7'&&(items.Merge=='0'||items.Merge==null)">
              <template v-for="(item,index) in loopNumT">
                <div v-if="index+1==2" class="_border_1">
                  <my-GZ-Bill :ID="items.id" :width="widthSon" :isPrintPage="true" :color="colorSon" :OrderSource="items.OrderSource" :name='index+1'></my-GZ-Bill>
                </div>
              </template>
            </template>
            <template v-if="items.Merge=='1'">
              <template v-for="(item,index) in loopNumN">
                <div v-if="index+1==2" class="_border_1">
                  <my-HB-Bill v-on:helloPP="numAdd" :Num="num" :ID="items.id" :width="widthSon" :isPrintPage="true" :color="colorSon" :name='index+1'></my-HB-Bill>
                </div>
              </template>
            </template>            
          </div>
        </div>
    </div>
</template>
<script>
import myBill from "./FinancialModule/FinancialSubmodule/BillModule.vue";
import myrbvBill from "./FinancialModule/FinancialSubmodule/ReceivablesModule.vue";
import myhrBill from "./FinancialModule/FinancialSubmodule/MergeBillModule.vue";
import myGZBill from "./FinancialModule/FinancialSubmodule/GZBillModule.vue";
export default {
    data(){
        return{
            titleName:'',
            optionsList:[
                {Name:'和平',value:'四川和平国际旅行社'},
                {Name:'微途',value:'成都微途科技有限公司'},
                {Name:'欧亚',value:'成都欧亚旅行社'},
                {Name:'兆鸿',value:'四川兆鸿文化传播有限公司'},
            ],
            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,
            printDatas:[]
        }
    },components:{
        'my-Bill': myBill,
        'my-RVB-Bill':myrbvBill,
        'my-HB-Bill':myhrBill,
        'my-GZ-Bill': myGZBill
    },methods:{
        numAdd(){
            this.num = this.num + 1
        }
    },mounted(){

    },created(){
        this.printDatas = JSON.parse(this.$route.query.list)
        this.$i18n.locale = localStorage.language?localStorage.language:'zh-CN'
  }
}
</script>
