<template>
  <div class="mb30" v-loading='loading'>
    <div v-if="isShow">
      <table class="leaderReimbursementTableNav" border="0" cellspacing="1" cellpadding="0">
        <tr>
          <th width="8%">{{$t('sm.chufadi')}}</th>
          <th width="30%">{{$t('objFill.xingchengmc')}}</th>
          <th width="15%">{{$t('visa.v_tuanhao')}}</th>
          <th width="15%">{{$t('Airticket.Air_StartTime')}}</th>
          <th width="8%">{{$t('ground.tianshu')}}</th>
          <th width="8%">{{$t('ground.ctrenshu')}}</th>
          <th width="8%">{{$t('leader.leader_Leader')}}</th>
          <th width="8%">{{$t('leader.leader_Guide')}}</th>
        </tr>
        <tr v-for='item in nav'>
          <td>{{item.StartCityNames}}</td>
          <td>
            <div class="padding10">{{item.Titles}}</div>
          </td>
          <td>{{item.TCNUMS}}</td>
          <td>{{item.FlightDate}}</td>
          <td>{{item.DayNum}}{{$t('hotel.hotel_day')}}</td>
          <td>{{item.TotalSeat}}{{$t('hotel.hotel_people')}}</td>
          <td>{{item.LeaderName}}</td>
          <td>{{item.GuideName}}</td>
        </tr>
      </table>
      <table class="leaderReimbursementTable" border="0" cellspacing="1" cellpadding="0">
        <tbody>
          <tr class="title">
            <th width="80" class="bgwhite" :rowspan="list.BusList.length+1">{{$t('ground.clshiyong')}}</th>
            <th width="100">{{$t('objFill.shiyongsj')}}</th>
            <th width="300">{{$t('ground.sijiName')}}</th>
            <th width="100">{{$t('ground.sijiPhone')}}</th>
            <th width="150">{{$t('objFill.v101.busManagement.chepeih')}}</th>
            <th width="150">{{$t('objFill.v101.LeaderManagement.cheliangh')}}</th>
            <th width="80">{{$t('objFill.yongchefs')}}</th>
            <th width="150">{{$t('objFill.v101.LeaderManagement.shijixinx')}}</th>
            <th width="150">{{$t('objFill.shijijine')}}</th>
            <th width="150">{{$t('objFill.v101.LeaderManagement.yujijine')}}</th>
            <th width="150">{{$t('hotel.hotel_payType')}})</th>
            <th width="300">{{$t('pub.pubRemark')}}</th>
            <th width="300">{{$t('ground.pingzheng')}}</th>
          </tr>
          <tr v-for='(item,index) in list.BusList'>
            <td>{{item.PlanDateStr}}</td>
            <td>{{item.DriverName}}</td>
            <td>{{item.DriverTel}}</td>
            <td>{{item.BusCode}}</td>
            <td>{{item.BusNum}}</td>
            <td>
              <span v-if='index==0'>{{$t('objFill.pickup')}}</span>
              <span v-if='index!=0&&index!=list.BusList.length-1'>{{item.AirportPickUpStr}}</span>
              <span v-if='index==list.BusList.length-1'>{{$t('objFill.send')}}</span>
            </td>
            <td>
              <template v-for="(sonItem,sonIndex) in item.ReimburseList.ReimburseDetailsList">
                <div v-if="sonItem.ID!==0">
                  {{sonItem.UserTypeStr}}：{{sonItem.UserNum}}*{{sonItem.UnitPrice}}
                </div>
              </template>
            </td>
            <td>
              {{busTotalPrice(item.ReimburseList.ReimburseDetailsList)}}
            </td>
            <!--添加实际金额和付款方式-->
            <td class="jdtd" valign="middle">
              {{item.CostPrice*(Number(item.TransferNum)+1)+item.HighSpeedPrice}}
            </td>
            <td class="jdtd" valign="middle">
              {{item.PayType !=null && item.PayType !='' ? (item.PayType== 1? $t('objFill.xianfu') :(item.PayType ==2 ? $t('objFill.qiandan') :(item.PayType == 4 ? $t('objFill.yufu') :(item.PayType ==5 ?$t('objFill.shiweidikou') :'')))):''}}
            </td>

            <td class="jdtd" valign="middle">
              {{item.Remarks}}
            </td>
            <td>
              <div class="uploadListDiv ownScrollbarStyle">
                <p v-for="(img,imgIndex) in item.VoucherPicList" @click="analyzeItem(item.VoucherPicList,imgIndex)">
                  {{img.FileName}}
                </p>
              </div>
            </td>
          </tr>
        </tbody>
      </table>
      <table class="leaderReimbursementTable" border="0" cellspacing="1" cellpadding="0">
        <tr class="title">
          <th width="80" class="bgwhite" colspan="10">{{$t('ground.jdshiyong')}}</th>
        </tr>
        <tr class="title">
          <th width="100">{{$t('objFill.shiyongsj')}}</th>
          <th width="300">{{$t('hotel.table_hotelname')}}</th>
          <th width="100">{{$t('objFill.v101.hote.zhancbzc')}}</th>
          <th width="150">{{$t('objFill.v101.LeaderManagement.fangjianlxsl')}}</th>
          <th width="150">{{$t('objFill.v101.LeaderManagement.shijixinx')}}</th>
          <th width="80">{{$t('objFill.shijijine')}}</th>
          <th width="80">{{$t('objFill.v101.LeaderManagement.yujijine')}}</th>
          <th width="80">{{$t('hotel.hotel_payType')}})</th>
          <th width="300">{{$t('pub.pubRemark')}}</th>
          <th>{{$t('ground.pingzheng')}}</th>
        </tr>
        <template v-for="(outItem,outIndex) in list.HotelOrderListReport">
          <template v-for='(subItem,subIndex) in outItem.HotelOrderList'>
            <template v-for="(childItem,childIndex) in subItem.HouseStatistics.HouseTypeList"
              v-if="childItem.HouseTypeCount>0">
              <tr v-if="subItem.RowSpan>1">
                <td v-if="childIndex==0" :rowspan="subItem.RowSpan">{{subItem.CheckInDateStr}}</td>
                <td v-if="childIndex==0" :rowspan="subItem.RowSpan">
                  {{subItem.HotelName}}
                </td>
                <td v-if="childIndex==0" :rowspan="subItem.RowSpan">
                  {{subItem.HouseStatistics.NeedBed}}/{{subItem.HouseStatistics.NoNeedBed}}
                </td>
                <td >
                  {{childItem.HouseTypeName}}：{{childItem.HouseTypeCount}}
                </td>
                <td v-if="childIndex==0" :rowspan="subItem.RowSpan">
                   <template v-for="(sonItem,sonIndex) in subItem.ReimburseList.ReimburseDetailsList">
                    <template v-if="sonItem.ID!==0 && childIndex==sonIndex">
                      {{sonItem.UserTypeStr}}：{{sonItem.UserNum}}*{{sonItem.UnitPrice}}
                    </template>
                  </template>
                </td>
                <td v-if="childIndex==0" :rowspan="subItem.RowSpan">
                  {{hotelTotalPrice(subItem.OrderDetailsList)}}
                </td>
                <td class="jdtd" valign="middle" v-if="childIndex==0" :rowspan="subItem.RowSpan">
                  {{HotelPrice(subItem)}}
                </td>
                <td class="jdtd" valign="middle" v-if="childIndex==0" :rowspan="subItem.RowSpan">
                  {{subItem.PayType !=null && subItem.PayType !='' ? (subItem.PayType== 1? $t('objFill.xianfu') :(subItem.PayType ==2 ? $t('objFill.qiandan') :(subItem.PayType == 4 ? $t('objFill.yufu') :(subItem.PayType ==5 ?$t('objFill.shiweidikou') :'')))):''}}
                </td>
                <td class="jdtd" valign="middle" v-if="childIndex==0" :rowspan="subItem.RowSpan" >
                  {{subItem.ReimburseList.Remarks}}
                </td>
                <td v-if="childIndex==0" :rowspan="subItem.RowSpan">
                  <div class="uploadListDiv ownScrollbarStyle" style="overflow-y: auto;">
                    <p v-for="(img,index) in subItem.ReimburseList.VoucherPicList"
                      @click="analyzeItem(subItem.VoucherPicList,index)">
                      {{img.FileName}}
                    </p>
                  </div>
                </td>
              </tr>
              <tr v-else>
                <td>{{subItem.CheckInDateStr}}</td>
                <td>
                  {{subItem.HotelName}}
                </td>
                <td>
                  {{subItem.HouseStatistics.NeedBed}}/{{subItem.HouseStatistics.NoNeedBed}}
                </td>
                <td>
                  {{childItem.HouseTypeName}}：{{childItem.HouseTypeCount}}
                </td>
                <td>
                  <template v-for="(sonItem,sonIndex) in subItem.ReimburseList.ReimburseDetailsList">
                    <template v-if="sonItem.ID!==0 && childIndex==sonIndex">
                      {{sonItem.UserTypeStr}}：{{sonItem.UserNum}}*{{sonItem.UnitPrice}}
                    </template>
                  </template>
                </td>
                <td>
                  {{hotelTotalPrice(subItem.OrderDetailsList)}}
                </td>
                <td class="jdtd" valign="middle">
                  {{HotelPrice(subItem)}}
                </td>
                <td class="jdtd" valign="middle">
                  {{subItem.PayType !=null && subItem.PayType !='' ? (subItem.PayType== 1? $t('objFill.xianfu') :(subItem.PayType ==2 ? $t('objFill.qiandan') :(subItem.PayType == 4 ? $t('objFill.yufu') :(subItem.PayType ==5 ?$t('objFill.shiweidikou') :'')))):''}}
                </td>
                <td class="jdtd" valign="middle">
                  {{subItem.ReimburseList.Remarks}}
                </td>
                <td>
                  <div class="uploadListDiv ownScrollbarStyle" style="overflow-y: auto;">
                    <p v-for="(img,index) in subItem.ReimburseList.VoucherPicList"
                      @click="analyzeItem(subItem.VoucherPicList,index)">
                      {{img.FileName}}
                    </p>
                  </div>
                </td>
              </tr>
            </template>
          </template>
        </template>
      </table>

      <table class="leaderReimbursementTable" border="0" cellspacing="1" cellpadding="0">
        <tbody>
          <tr>
            <th colspan="10" class="bgwhite">{{$t('ground.canshishiyong')}}</th>
          </tr>
          <tr class="title">
            <th width="100">{{$t('objFill.shiyongsj')}}</th>
            <th width="300">{{$t('restaurant.res_resName')}}</th>
            <th width="100">{{$t('objFill.leibie')}}</th>
            <th width="150">{{$t('objFill.yongchanrenshu')}}</th>
            <th width="150">{{$t('objFill.v101.LeaderManagement.shijixinx')}}</th>
            <th width="80">{{$t('objFill.shijijine')}}</th>
            <th width="80">{{$t('objFill.v101.LeaderManagement.yujijine')}}</th>
            <th width="80">{{$t('hotel.hotel_payType')}})</th>
            <th width="300">{{$t('pub.pubRemark')}}</th>
            <th>{{$t('ground.pingzheng')}}</th>
          </tr>
          <template v-for='(item,index) in list.DiningList'>
            <template v-for='(subItem,subIndex) in item.DiningSummaryList'>
              <tr class="splitP ScenicTr" v-for='(childItem,childIndex) in subItem.DiningPriceList'>
                <td v-if="childIndex==0" :rowspan="3">
                  {{item.UseTimeStr}}
                </td>
                <td v-if="childIndex==0" :rowspan="3">
                  {{subItem.DiningName}}
                </td>
                <td v-if="childIndex==0" :rowspan="3">
                  {{subItem.UseDinnerTypeStr}}
                </td>
                <td>
                  {{peopleStrToWord(childItem.PeopleType)}}:{{childItem.PeopleNum}}
                </td>
                <td v-if="childIndex==0" :rowspan="3">
                  <template v-if="subItem.ReimburseList.ReimburseDetailsList[0].ID!==0">
                    {{subItem.ReimburseList.ReimburseDetailsList[0].UserTypeStr}}：{{subItem.ReimburseList.ReimburseDetailsList[0].UserNum}}*{{subItem.ReimburseList.ReimburseDetailsList[0].UnitPrice}}
                  </template>
                </td>
                <td v-if="childIndex==0" :rowspan="3">
                  {{diningTotalPrice(subItem.ReimburseList.ReimburseDetailsList)}}
                </td>
                <td class="jdtd" valign="middle" v-if="childIndex==0" :rowspan="3">
                  {{calculationPrice(subItem)}}
                </td>
                <td class="jdtd" valign="middle" v-if="childIndex==0" :rowspan="3">
                  {{getPayTypeStr(item.PayType)}}
                </td>
                <td class="jdtd" valign="middle" v-if="childIndex==0" :rowspan="3">
                  {{subItem.Remarks}}
                </td>
                <td v-if="childIndex==0" :rowspan="3">
                  <div class="uploadListDiv ownScrollbarStyle" style="overflow-y: auto;">
                    <p v-for="(img,imgIndex) in subItem.ReimburseList.VoucherPicList"
                      @click="analyzeItem(subItem.VoucherPicList,imgIndex)">
                      {{img.FileName}}
                    </p>
                  </div>
                </td>
              </tr>
            </template>
          </template>
        </tbody>
      </table>
      <table class="leaderReimbursementTable" border="0" cellspacing="1" cellpadding="0">
        <tbody>
          <tr>
            <th colspan="10" class="bgwhite">{{$t('ground.mpshiyong')}}</th>
          </tr>
          <tr class="title">
            <th width="100">{{$t('objFill.shiyongsj')}}</th>
            <th width="300">{{$t('visaT.jdname')}}</th>
            <th width="100">{{$t('objFill.zongrenshu')}}</th>
            <th width="150">{{$t('objFill.menpiaoleibie')}}</th>
            <th width="150">{{$t('objFill.v101.LeaderManagement.shijixinx')}}</th>
            <th width="80">{{$t('objFill.shijijine')}}</th>
            <th width="80">{{$t('objFill.v101.LeaderManagement.yujijine')}}</th>
            <th width="80">{{$t('hotel.hotel_payType')}})</th>
            <th width="300">{{$t('pub.pubRemark')}}</th>
            <th>{{$t('ground.pingzheng')}}</th>
          </tr>
          <template v-for='(item,index) in list.ScenicList'>
            <template v-for="(subItem,subIndex) in item.ScenicStatisticsList">
              <tr class="splitP ScenicTr" v-for="(childItem,childIndex) in subItem.TicketPriceList">
                <td v-if="childIndex==0&&subIndex==0" :rowspan="3*item.ScenicStatisticsList.length">{{item.UseTimeStr}}
                </td>
                <td v-if="childIndex==0" :rowspan="3">
                  {{subItem.ScenicName}}
                </td>
                <td v-if="childIndex==0" :rowspan="3">
                  {{subItem.UseAccount}}
                </td>
                <td>
                  {{peopleStrToWord(childItem.PeopleType)}}:{{childItem.PeopleNum}}
                </td>
                <td v-if="childIndex==0" :rowspan="3">
                  {{subItem.ReimburseList.ReimburseDetailsList[0].UserTypeStr}}：{{subItem.ReimburseList.ReimburseDetailsList[0].UserNum}}*{{subItem.ReimburseList.ReimburseDetailsList[0].UnitPrice}}
                </td>
                <td v-if="childIndex==0" :rowspan="3">
                  {{diningTotalPrice(subItem.ReimburseList.ReimburseDetailsList)}}
                </td v-if="childIndex==0" :rowspan="3">
                <td v-if="childIndex==0" :rowspan="3">
                  {{ScenicspotPrice(subItem)}}
                </td v-if="childIndex==0" :rowspan="3">
                <td v-if="childIndex==0" :rowspan="3">
                  {{item.PayType !=null && item.PayType !='' ? (item.PayType== 1?$t('objFill.xianfu') :(item.PayType ==2 ? $t('objFill.qiandan') :(item.PayType == 4 ? $t('objFill.yufu') :(item.item.PayType ==5 ?$t('objFill.shiweidikou') :'')))):''}}
                </td>
                <td v-if="childIndex==0" :rowspan="3">
                  {{subItem.Remarks}}
                </td>
                <td v-if="childIndex==0" :rowspan="3">
                  <div class="uploadListDiv ownScrollbarStyle" style="overflow-y: auto;">
                    <p v-for="(img,imgIndex) in subItem.ReimburseList.VoucherPicList"
                      @click="analyzeItem(subItem.VoucherPicList,imgIndex)">
                      {{img.FileName}}
                    </p>
                  </div>
                </td>
              </tr>
            </template>
          </template>
        </tbody>
      </table>
      <table class="leaderReimbursementTable" border="0" cellspacing="1" cellpadding="0">
        <tbody>
          <tr class="title">
            <th width="80" class="bgwhite" :rowspan="list.OtherOrderInfo.OtherList.length+1">{{$t('objFill.qitafeiyong')}}</th>
            <th width="100">{{$t('objFill.shiyongsj')}}</th>
            <th width="300">{{$t('objFill.v101.LeaderManagement.feiyongxm')}}</th>
            <th width="100">{{$t('objFill.zongrenshu')}}</th>
            <th width="150">{{$t('fnc.danjia')}}</th>
            <th width="150">{{$t('objFill.jingexj')}}</th>
            <th width="80">{{$t('hotel.hotel_commission')}})</th>
            <th width="300">{{$t('fnc.a_zongjine')}}</th>
            <th>{{$t('pub.pubRemark')}}</th>
          </tr>
          <tr v-for='(item,index) in list.OtherOrderInfo.OtherList'>
            <td>
              {{item.UseDateStr}}
            </td>
            <td>
              {{getCostProjectStr(item.CostProject)}}
            </td>
            <td>
              {{item.TotalNum}}
            </td>
            <td>
              {{item.UnitPrice}}
            </td>
            <td>
              {{item.TotalNum*item.UnitPrice}}
            </td>
            <td>
              {{item.Rebate}}%
            </td>
            <td v-if='index==0' :rowspan='list.OtherOrderInfo.OtherList.length'>
              {{otherTotalPrice(list.OtherOrderInfo.OtherList)}}
            </td>
            <td class="jdtd">
              {{item.Remark}}
            </td>
          </tr>
        </tbody>
      </table>
      <table class="leaderReimbursementTable" border="0" cellspacing="1" cellpadding="0">
        <tbody>
          <tr class="title">
            <th width="80" class="bgwhite" rowspan="2">{{$t('objFill.xiaofeisr')}}</th>
            <th width="100">{{$t('admin.admin_personNumber')}}</th>
            <th width="300">{{$t('fnc.danjia')}}</th>
            <th width="100">{{$t('fnc.a_zongjine')}}</th>
            <th>{{$t('pub.pubRemark')}}</th>
          </tr>
          <tr v-for='(item,index) in list.OtherOrderInfo.TipList'>
            <td>
              {{item.TotalNum}}
            </td>
            <td>
              {{item.UnitPrice}}
            </td>
            <td>{{item.TotalNum*item.UnitPrice}}</td>
            <td class="jdtd">
              {{item.Remark}}
            </td>
          </tr>
        </tbody>
      </table>
      <table class="leaderReimbursementTable" border="0" cellspacing="1" cellpadding="0">
        <tbody>
          <tr class="title">
            <th width="80" class="bgwhite" rowspan="2">{{$t('objFill.tuanfeixiaoji')}}</th>
            <th width="100">{{$t('fnc.jine')}}</th>
            <th>{{$t('pub.pubRemark')}}</th>
          </tr>
          <tr v-for='(item,index) in list.OtherOrderInfo.TeamList'>
            <td>
              {{item.UnitPrice}}
            </td>
            <td class="jdtd">
              {{item.Remark}}
            </td>
          </tr>
        </tbody>
      </table>
      <table class="leaderReimbursementTable" border="0" cellspacing="1" cellpadding="0">
        <tbody>
          <tr class="title">
            <th width="80" class="bgwhite" :rowspan="list.OtherOrderInfo.SelfPlayingIncomeList.length+1">{{$t('objFill.zifeir')}}</th>
            <th width="100">{{$t('objFill.shiyongsj')}}</th>
            <th width="300">{{$t('admin.admin_personNumber')}}</th>
            <th width="100">{{$t('fnc.danjia')}}</th>
            <th width="150">{{$t('objFill.jingexj')}}</th>
            <th width="150">{{$t('fnc.a_zongjine')}}</th>
            <th>{{$t('pub.pubRemark')}}</th>
          </tr>
          <tr v-for='(item,index) in list.OtherOrderInfo.SelfPlayingIncomeList'>
            <td>
              {{item.UseDate}}
            </td>
            <td>
              {{item.TotalNum}}
            </td>
            <td>
              {{item.UnitPrice}}
            </td>
            <td>{{item.TotalNum*item.UnitPrice}}</td>
            <td v-if='index==0' :rowspan="list.OtherOrderInfo.SelfPlayingIncomeList.length">
              {{otherTotalPrice(list.OtherOrderInfo.SelfPlayingIncomeList)}}
            </td>
            <td class="jdtd">
              {{item.Remark}}
            </td>
          </tr>
        </tbody>
      </table>
      <table class="leaderReimbursementTable" border="0" cellspacing="1" cellpadding="0">
        <tbody>
          <tr class="title">
            <th width="80" class="bgwhite" :rowspan="list.OtherOrderInfo.SelfPlayingExpendList.length+1">{{$t('objFill.zhifeizc')}}</th>
            <th width="100">{{$t('objFill.shiyongsj')}}</th>
            <th width="300">{{$t('admin.admin_personNumber')}}</th>
            <th width="100">{{$t('fnc.danjia')}}</th>
            <th width="150">{{$t('objFill.jingexj')}}</th>
            <th width="150">{{$t('hotel.hotel_commission')}})</th>
            <th width="80">{{$t('fnc.a_zongjine')}}</th>
            <th>{{$t('pub.pubRemark')}}</th>
          </tr>
          <tr v-for='(item,index) in list.OtherOrderInfo.SelfPlayingExpendList'>
            <td>
              {{item.UseDate}}
            </td>
            <td>
              {{item.TotalNum}}
            </td>
            <td>
              {{item.UnitPrice}}
            </td>
            <td>{{item.TotalNum*item.UnitPrice}}</td>
            <td>
              {{item.Rebate}}%
            </td>
            <td v-if='index==0' :rowspan="list.OtherOrderInfo.SelfPlayingExpendList.length">
              {{otherTotalPrice(list.OtherOrderInfo.SelfPlayingExpendList)}}
            </td>
            <td class="jdtd">
              {{item.Remark}}
            </td>
          </tr>
        </tbody>
      </table>
      <el-input type="textarea" v-model="UploadMsg.Remarks" rows="6" :placeholder="$t('objFill.qingshurbzxx')"></el-input>
      <br />
      <p class="alcenter">
        <input type="button" :value="$t('objFill.shenhetongguo')" class="normalBtn" @click="saveData(1)" />
        <input type="button" :value="$t('objFill.shenhebtg')" class="normalBtn" @click="saveData(2)" />
        <input type="button" :value="$t('ground.dayin')" class="normalBtn" @click="goUrl('leaderPrint','打印')" />
      </p>
      <div v-if='picIsShow' class="viewBigPicLayer">
        <i class="el-icon-circle-close-outline clolseViewBigPicLayer" @click="picIsShow=false,picObj=[]"></i>
        <el-carousel height="600px" :initial-index='initialIndex' :interval="5000" trigger="click">
          <el-carousel-item v-for="(item,index) in picObj" :key="index">
            <div class="inlineDiv ownScrollbarStyle"><img :src="item" /></div>
          </el-carousel-item>
        </el-carousel>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        isUpdate: false,
        loading: false,
        defaultSelectValue: 0,
        initialIndex: 0,
        picIsShow: false,
        picObj: [],
        TemporaryItem: {},
        msg: {
          TCIDs: '',
          NewCombinationNum: '',
          IsSelectAll: 1,
        },
        list: [],
        nav: [],
        TravelDayNum: 0,
        RealityNum: 0,
        isShow: false,
        UploadMsg: {
          Remarks: ""
        },
      }
    },
    methods: {
      // 获取付款方式类型字符串
      getPayTypeStr(type){
        // {{item.PayType !=null && item.PayType !='' ? (item.PayType== 1? $t('objFill.xianfu') :(item.PayType ==2 ? $t('objFill.qiandan') :(item.PayType == 4 ? $t('objFill.yufu') :(item.PayType ==5 ?$t('objFill.shiweidikou') :'')))):''}}
        if (type == 1) {
          return this.$t('objFill.xianfu')
        } else if (type == 2) {
          return this.$t('objFill.qiandan')
        } else if (type == 3) {
          return this.$t('objFill.shiweidikou')
        } else if (type == 4) {
          return this.$t('objFill.yufu')
        } else if (type == 5) {
          return this.$t('objFill.yufukuandk')
        } else if (type == 6) {
          return this.$t('objFill.gongsihtzf')
        } else if (type == 9) {
          return this.$t('objFill.yuejie')
        } else if (type == 11) {
          return this.$t('objFill.shuakai')
        } else if (type == 10) {
          return this.$t('objFill.lingduidydf')
        }
      },
      //获取自费项目类型字符串
      getCostProjectStr(type) {
        var str = "";
        switch (type) {
          case "1":
            str = this.$t('objFill.v101.LeaderManagement.daoyoujtie');
            break;
          case "2":
            str = this.$t('objFill.v101.LeaderManagement.shijijtie');
            break;
          case "3":
            str = this.$t('objFill.qitazhichu');
            break;
        }
        return str;
      },
      addOtherList() {
        this.list.OtherOrderInfo.OtherList.push({
          OrderType: '1',
          ID: 0,
          UseDate: '',
          CostProject: 0,
          TotalNum: '0',
          UnitPrice: '0',
          Rebate: '0',
          TotalPrice: '0',
          Remark: '',
          TCIDs: this.list.OtherOrderInfo.OtherList[0].TCIDs,
          VoucherPicList: []
        })
      },
      deleteOtherListItem(index) {
        this.list.OtherOrderInfo.OtherList.splice(index, 1)
      },
      addSelfPlayingIncomeList() {
        this.list.OtherOrderInfo.SelfPlayingIncomeList.push({
          OrderType: '4',
          ID: 0,
          UseDate: '',
          CostProject: 0,
          TotalNum: '0',
          UnitPrice: '0',
          Rebate: '0',
          TotalPrice: '0',
          Remark: '',
          TCIDs: this.list.OtherOrderInfo.SelfPlayingIncomeList[0].TCIDs,
          VoucherPicList: []
        })
      },
      deleteSelfPlayingIncomeListItem(index) {
        this.list.OtherOrderInfo.SelfPlayingIncomeList.splice(index, 1)
      },
      addSelfPlayingExpendList() {
        this.list.OtherOrderInfo.SelfPlayingExpendList.push({
          OrderType: '5',
          ID: 0,
          UseDate: '',
          CostProject: '',
          TotalNum: '0',
          UnitPrice: '0',
          Rebate: '0',
          TotalPrice: '0',
          Remark: '',
          TCIDs: this.list.OtherOrderInfo.SelfPlayingExpendList[0].TCIDs,
          VoucherPicList: []
        })
      },
      deleteSelfPlayingExpendList(index) {
        this.list.OtherOrderInfo.SelfPlayingExpendList.splice(index, 1)
      },
      busTotalPrice(obj) {
        let totalPrice = 0
        obj.forEach(x => {
          totalPrice += x.UserNum * x.UnitPrice
        })
        return totalPrice
      },

      hotelTotalPrice(obj) {
        let totalPrice = 0
        obj.forEach(x => {
          totalPrice += x.UnitPrice * (x.HouseGuestNum - x.HotelDiscount) * (1 - x.RebateRatio / 100)
        })
        return this.moneyFormat(totalPrice)
      },
      diningTotalPrice(obj) {
        let totalPrice = 0
        obj.forEach(x => {
          totalPrice += x.UserNum * x.UnitPrice
        })
        return totalPrice
      },
      scenicTotalPrice(obj) {
        let totalPrice = 0
        obj.forEach(x => {
          totalPrice += x.PeoplePrice * (x.UsePeopleNum - x.Discount) * (1 - x.DiscountPrice / 100)
        })
        return totalPrice
      },
      otherTotalPrice(obj) {
        let totalPrice = 0
        obj.forEach(item => {
          totalPrice += item.TotalNum * item.UnitPrice * (1 - item.Rebate / 100)
        })
        return totalPrice
      },
      saveData(type) {
        //通过
        if (type == 1) {
          this.list.LeaderApply.Status = 1;
        }
        //不通过
        else if (type == 2) {
          this.list.LeaderApply.Status = 2;
          if (this.UploadMsg.Remarks == "") {
            this.Info(this.$t('objFill.v101.LeaderManagement.qingtxbtgdyy'));
            return
          }
          this.list.LeaderApply.AuditReason = this.UploadMsg.Remarks;
        }
        this.apipost('dmcstatistics_post_SetLeaderApplyExcreteList', this.list, res => {
          if (res.data.resultCode == 1) {
            this.$message.success(res.data.message)
            this.getNav()
            this.getList()
          } else {
            this.$message.error(res.data.message)
          }
        }, err => {})
      },
      saveitem(obj) {
        this.TemporaryItem = obj
      },
      analyzeItem(obj, index) { //预览
        this.picObj = []
        obj.forEach(item => {
          this.picObj.push(item.url)
        })
        this.initialIndex = index
        this.picIsShow = true
      },
      peopleStrToWord(str) {
        if (str == '1')
          return this.$t('salesModule.Adult')
        if (str == '2')
          return this.$t('sm.ertong')
        if (str == '3')
          return this.$t('Operation.Op_baby')
      },
      UseDinnerTypeToWord(str) {
        if (str == 1)
          return this.$t('objFill.zaocan')
        if (str == 2)
          return this.$t('objFill.wucan')
        if (str == 3)
          return this.$t('objFill.wancan')
      },

      getNav() {
        this.apipost('dmcstatistics_post_GetHotelStaticsByTCIDs', {
          TCIDs: this.$route.query.id
        }, res => {
          if (res.data.resultCode == 1) {
            this.nav = res.data.data
          } else {
            this.$message.error(res.data.message)
          }
        }, err => {})
      },
      getList() {
        this.loading = true;
        this.apipost('dmcstatistics_post_GetNewLeaderPayMoneyStatics', this.msg, res => {
          if (res.data.resultCode == 1) {
            this.loading = false;
            this.isShow = true;
            this.list = res.data.data;
            this.list.OtherOrderInfo.OtherList.forEach(item => {
              item.CostProject = item.CostProject.toString()
            })
          } else {
            this.loading = false
            this.$message.error(res.data.message)
          }
        }, err => {})
      },

      goUrl(path, title) {
        this.$router.push({
          name: path,
          query: {
            "id": this.$route.query.id,
            blank: 'y',
            tab: title
          }
        })
      },

      // 酒店
      HotelPrice(obj) {
        let totalPrice = 0;
        obj.OrderDetailsList.forEach(item => {
          totalPrice += item.UnitPrice * (item.BookNum - item.HotelDiscount) * (1 - item.RebateRatio / 100);
        })
        obj.TotalPrice = totalPrice.toFixed(2);
        return obj.TotalPrice;
      },
      // 餐饮
      calculationPrice(obj) {
        let totalPrice = 0;
        obj.DiningPriceList.forEach(item => {
          totalPrice += item.PeoplePrice * (item.PeopleNum - item.Discount) * (1 - item.DiscountPrice / 100);
        })
        return totalPrice.toFixed(2)
      },
      // 景点
      ScenicspotPrice(obj) {
        let totalPrice = 0;
        obj.TicketPriceList.forEach(item => {
          totalPrice += item.PeoplePrice * (item.UsePeopleNum - item.Discount) * (1 - item.DiscountPrice / 100);
        })
        obj.TotalPrice = totalPrice.toFixed(2);
        return obj.TotalPrice
      },
    },
    mounted() {
      this.isUpdate = this.$route.query.isUpdate;
      this.msg.TCIDs = this.$route.query.id;
      this.getNav();
      this.getList();
    }
  }

</script>

<style>
  .leaderReimbursementTableNav {
    background: #d6cece;
    width: 100%;
    margin: 20px 0;
  }

  .leaderReimbursementTableNav tr th {
    background: #E6E6E6;
    height: 40px;
    font-size: 12px;
    color: #333;
  }

  .leaderReimbursementTableNav tr {
    background: #fff;
    text-align: center;
    height: 40px;
    font-size: 12px;
  }

  .leaderReimbursementTableNav tr td {
    background: #fff;
    text-align: center;
    height: 20px;
    font-size: 12px;
  }

  .leaderReimbursementTableNav ._go_detail p {
    cursor: pointer;
    line-height: 25px;
  }

  .leaderReimbursementTable {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
  }

  .leaderReimbursementTable tr th {
    background: #E6E6E6;
    height: 40px;
    font-size: 13px;
    color: #333;
    border: 1px solid #ccc;
    text-align: center;
  }

  .leaderReimbursementTable tr td {
    border: 1px solid #ccc;
    line-height: 25px;
    height: 25px;
    font-size: 12px;
    background: #fff;
    text-align: center;
  }
</style>
