<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;
        }
    } */
    ._PrintPage_box{
        position: relative;
    }
    ._PrintPage_box .SetDiv{
      position: absolute;
      top:10px;
      color:#106BAF;
      left: -290px;
    }
    ._PrintPage_box .SetDiv span{
        color:#106BAF;
        cursor: pointer;
        font-size: 15px;
    }
</style>
<template v-loading="loading">
    <div class="_PrintPage">
        <div class="_PrintPage_box">
            <template v-if="type==='2'&&(Merge==='0'||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>
                <div v-for="(item,index) in loopNumT"
                :class="{'_border_1':index+1===2}">
                    <my-Bill v-if="index+1===2" :ID="id" :width="widthSon" :isPrintPage="true" :color="colorSon" :OrderSource="OrderSource" :name='index+1' :titleName="titleName"></my-Bill>
                </div>
            </template>
            <template v-else-if="type==='1'&&(Merge==='0'||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>
                <div class="_border_1" v-for="(item,index) in loopNumN">
                    <my-RVB-Bill v-on:helloPP="numAdd" :Num="num" :ID="id" :width="widthSon" :isPrintPage="true" :OrderSource="OrderSource" :color="colorSon" :name='index+1' :titleName="titleName"></my-RVB-Bill>
                </div>
            </template>
            <template v-if="type==='7'&&(Merge==='0'||Merge===null)">
                <div class="_border_1" v-for="(item,index) in loopNumT">
                    <my-GZ-Bill :ID="id" :width="widthSon" :isPrintPage="true" :color="colorSon" :OrderSource="OrderSource" :name='index+1'></my-GZ-Bill>
                </div>
            </template>
            <template v-if="Merge==='1'">
              <div class="_border_1" v-for="(item,index) in loopNumN">
                <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>
        </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
        }
    },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.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;
        this.$i18n.locale = localStorage.language?localStorage.language:'zh-CN'
  }
}
</script>
