<template>
  <div class="view-CarrierListMachineryPreparation-c">
    <div class="view-CarrierListMachineryPreparation-box">
      <div class="view-CarrierListMachineryPreparation-box-left">
        <el-radio-group v-model="summarizing">
          <el-radio-button label="汇总数据"></el-radio-button>
          <el-radio-button label="原数据"></el-radio-button>
        </el-radio-group>
      </div>

      <div class="view-CarrierListMachineryPreparation-box-right">
        <MissionDetail :detail="detail" />
      </div>
    </div>

    <CarrierSummarizing v-if="summarizing == '汇总数据'" />
    <CarrierPrimaryData v-if="summarizing == '原数据'" />
  </div>
</template>

<script>
import CarrierPrimaryData from '../primaryData/index.vue'
import CarrierSummarizing from '../summarizing/index.vue'
import { queryFlyTaskAircraft } from '@/api/carrierStandard/carrierListMachineryPreparation'

export default {
  name: 'CarrierListShipping',
  components: { CarrierPrimaryData, CarrierSummarizing },
  data() {
    // 这里存放数据
    return {
      summarizing: '汇总数据',
      detail: null
    }
  },
  mounted() {
    this.initData()
  },
  methods: {
    async initData() {
      let postData = {
        taskId: this.$route.params.id
      }
      const { code, data } = await queryFlyTaskAircraft(postData)
      if (code == 200) {
        this.detail = data
        this.$store.commit('app/updataTagsItemMetaTitle', { id: this.$route.params.id, otherTitle: '携行清单航材编制-编制', newTitle: `携行清单航材编制-编制-${this.detail.taskName}` })
      }
    }
  }
}
</script>

<style lang="scss" scoped>
@import './index.scss';
</style>
