<template>
  <div>
    <quickCreate v-show="isQuick" :equipments="equipments" @normalCreate="isQuick = false"></quickCreate>
    <normalCreate v-show="!isQuick" @quickCreate="isQuick = true"></normalCreate>

    <el-backtop target=".app-wrapper"></el-backtop>
  </div>
</template>

<script>
import normalCreate from "@/views/order/component/normalCreate.vue";
import quickCreate from "@/views/order/component/quickCreate.vue";
import {index} from "@/api/system/baseForm";
export default {
  components: {
    quickCreate,
    normalCreate
  },
  provide() {
    return {
      equipments: () => this.equipments
    }
  },
  data() {
    return {
      equipments: [],
      isQuick: false,
    }
  },
  methods: {
    async getEquipments () {
      this.equipments = (await index({
        table_name: 'equipments',
        page: 1,
        page_size: 9999
      },false))?.data || []
    },
  },
  computed: {},
  mounted() {
    // if (this.$route.params.cloneTransfer) {
    //   this.isQuick = false
    // } else {
    //   this.$confirm('选择调令创建方式','调令方式',{
    //     confirmButtonText: '快速调令',
    //     cancelButtonText: '普通调令',
    //     type: 'info',
    //     closeOnPressEscape: false,
    //     closeOnClickModal: false,
    //     showClose: false
    //   }).then(_ => this.isQuick = true).catch(_ => this.isQuick = false)
    // }
  },
  created() {
    this.getEquipments();
  }
}
</script>

<style scoped lang="scss">
</style>
