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

<script>
import { mapActions } from "vuex";
import importOne from "./components/importOne";
import importThree from "./components/importThree";
import importTwo from "./components/importTwo";

export default {
	name: "StaffIndex",

	components: {
		ImportOne: importOne,
		ImportTwo: importTwo,
		ImportThree: importThree,
	},
	data() {
		return {
			userInfo: this.$store.state.d2admin.user.info,
			activeName: "one",
			taskInfo: null,
			resultInfo: null,
		};
	},

	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>