importDetailControl.vue 2.09 KB
<!-- 导入明细&回单主页面 -->
<template>
  <div class="importDetail">
    <div class="header"
         slot="header">
      <div>
        <import-one ref="importOne"
                    v-if="activeName === 'one'"
                    @oneStepComplete="oneStepComplete" />
        <import-two v-if="activeName === 'two'"
                    :task-info="taskInfo"
                    @twoStepComplete="twoStepComplete"
                    @goBackOneStep="goBackOneStep" />
        <import-three v-if="activeName === 'three'"
                      :result-info="resultInfo"
                      @importAgain="importAgain"
                      @goBackListPage="goBackListPage" />
      </div>
    </div>
  </div>
</template>

<script>
import importOne from './components/importOne'
import importTwo from './components/importTwo'
import importThree from './components/importThree'
import { mapActions } from 'vuex'
export default {
  name: 'StaffIndex',
  data() {
    return {
      userInfo: this.$store.state.d2admin.user.info,
      activeName: 'one',
      taskInfo: null,
      resultInfo: null
    }
  },

  components: {
    importOne,
    importTwo,
    importThree
  },

  mounted() {
    if (this.$route.query.step) {
      console.log('step', this.$route.query.step)
      this.activeName = this.$route.query.step
      this.taskInfo = this.$route.query.taskInfo
    }
  },

  methods: {
    ...mapActions({
      get: 'd2admin/base/get',
      close: 'd2admin/page/close'
    }),
    oneStepComplete(data) {
      console.log('data', data)
      this.activeName = 'two'
    },
    goBackOneStep() {
      this.activeName = 'one'
    },
    twoStepComplete(data) {
      this.resultInfo = data
      this.activeName = 'three'
    },
    importAgain() {
      this.activeName = 'one'
    },
    goBackListPage() {
      this.close({ tagName: "/importDetailControl" })
      this.$router.push({
        name: "theAssetData"
      })
    }

  }
}

</script>
<style lang="scss" scoped>
.importDetail {
  padding: 0 20px;

  .header {
    ::v-deep .el-tabs__header {
      margin: 0;
      padding: 0 20px;
    }
  }
}
</style>