importDetailControl.vue
2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!-- 导入明细&回单主页面 -->
<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>