<template>
  <div class="app-container">
    <el-tabs v-model="activeTab">
      <el-tab-pane label="领料单据" name="receive">
        <SoIndex :so-by-type="soByType"/>
      </el-tab-pane>
      <el-tab-pane label="作废单据" name="voidReceive">
        <SoVoid :so-by-type="soByType" />
      </el-tab-pane>
      <el-tab-pane label="领料明细" name="detailReceive">
        <SoiTable :so-by-type="soByType" />
      </el-tab-pane>
      <el-tab-pane label="领料单" name="receiveCreate">
        <SoInfo :so-by-type="soByType"/>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import SoInfo from "@/views/repair/stockOperate/Components/SoInfo.vue";
import SoIndex from "@/views/repair/stockOperate/Components/SoIndex.vue";
import SoVoid from "@/views/repair/stockOperate/Components/SoVoid.vue";
import SoiTable from "@/views/repair/stockOperate/Components/SoiTable.vue";

export default {
  name: "OutStock",
  components: {
    SoiTable,
    SoVoid,
    SoIndex,
    SoInfo
  },
  data() {
    return {
      activeTab: 'receive',
      soByType: true,
    }
  },
  created() {
    this.isType()
  },
  methods: {
    // 判断是什么单据，决定字段的属性、展示否等
    async isType() {
      const url = this.$route.path
      this.soByType = url.includes("soi")
    },
  }
}
</script>

<style scoped lang="scss">

</style>
