<style>
@import url("../../assets/css/domestic/TicketingModule.css");
</style>
<template>
  <div class="m_TicketingModule">
    <div class="_tit">
      <span class="_text">{{$t('objFill.v101.traveltrip.jipiaoxx')}}</span>
      <div>
        <span class="_btn" v-if="tableShow" @click="tableShow=false">{{$t('fnc.shouqi')}}<i class="iconfont icon-gengduo _rotate"></i></span>
        <span class="_btn" v-else @click="tableShow=true">{{$t('fnc.zhankai')}}<i class="iconfont icon-gengduo"></i></span>
      </div>
    </div>
    <div v-show="tableShow" class="_padding_20_15">
      <table class="singeRowTable" border="0" style="border:1px solid #E6E6E6;" cellspacing="0" cellpadding="0">
        <tr>
          <th>{{$t('system.query_airCompanyName')}}</th>
          <th>{{$t('system.query_flightNum')}}</th>
          <th>{{$t('salesModule.Time')}}</th>
          <th>{{$t('commonPickUp.Pick_StartCity')}}</th>
          <th>{{$t('system.query_arrivalCity')}}</th>
          <th>{{$t('hotel.table_UseAmount')}}</th>
          <th>{{$t('hotel.hotel_status')}}</th>
        </tr>
        <tr  v-for="item in DataList.FlightList">
          <td>{{item.AlName}}</td>
          <td>
            {{item.Flight_number}}
          </td>
          <td>
             {{item.FlightDateStr}} {{item.Departure_time}}
          </td>
          <td>
            {{item.DepartureName}}
          </td>
          <td>
            {{item.ArrivalCityName}}
          </td>
          <td>{{DataList.UseAccount}}</td>
          <td v-if="Type">{{getTypeStr()}}</td>
        </tr>
      </table>
    </div>
  </div>
</template>
<script>
export default {
  props:["SourceID","id","Callback"],
  data() {
    return {
      tableShow: false,
      //机票编号
      // SourceID: 0,
      //数据列表
      DataList: {},
      //数据对象
      // Callback: {},
      //定金类型
      Type: null
    };
  },
  methods: {
    getTypeStr() {
      var str = "";
      switch (this.Type) {
        case 1:
          str = this.$t('objFill.v101.traveltrip.col2.t1');
          break;
        case 2:
          str = this.$t('objFill.v101.traveltrip.col2.t2');
          break;
        case 3:
          str = this.$t('objFill.v101.traveltrip.col2.t3');
          break;
        case 4:
          str = this.$t('objFill.v101.traveltrip.col2.t4');
          break;
        case 5:
          str = this.$t('objFill.v101.traveltrip.col2.t5');
          break;
      }
      return str;
    },
    getList() {
      this.apipost(
        "AirTicket_Get_GetAirticketById",
        {
          ID: this.SourceID
        },
        r => {
          if (r.data.resultCode == 1) {
            this.DataList = r.data.data;
          }
        },
        null
      );
    }
  },
  mounted() {
    let obj = JSON.parse(this.Callback);
    this.Type =  obj.Type;  
    this.getList();
  }
};
</script>
