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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<template>
<el-dialog :title="title" append-to-body :visible.sync="show" width="800px">
<div v-loading="loading">
<div>销售顾问:{{dialogObj.staff_name}}</div>
<el-table :data="list">
<el-table-column prop="month_order_rate">
</el-table-column>
</el-table>
<page :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange"/>
</div>
</el-dialog>
</template>
<script>
import { getVisitedApi,getClassOpenedApi } from "@service/api";
import page from '@framework/page'
export default {
name: "TeamDialog",
components: {page},
props: {
dialogObj: {
type: Object,
required: true,
default: () => {}
}
},
data() {
return {
show: false,
loading: true,
list: [],
title: '',
total: 0,
nowPage: 1,
limit: 10,
}
},
mounted() {
this.initDialog()
},
methods: {
initDialog() {
console.log(this.dialogObj)
if (this.dialogObj) {
this.show = this.dialogObj.show;
if (this.dialogObj.type == 'callback') {
this.getVisited();
} else if (this.dialogObj.type == 'class') {
this.getClass();
}
}
},
getVisited() {
let json = {
teacher_id: this.dialogObj.teacher_id,
start_at: this.dialogObj.start_at,
page: this.nowPage,
limit: this.limit
}
getVisitedApi(json).then(res => {
this.loading = false;
console.log(res)
})
},
getClass() {
let json = {
teacher_id: this.dialogObj.teacher_id,
start_at: this.dialogObj.start_at,
page: this.nowPage,
limit: this.limit
}
getClassOpenedApi(json).then(res => {
this.loading = false;
console.log(res)
})
},
onPageChange(val) {
this.nowPage = val
this.getData()
},
onSizeChange(val) {
this.limit = val;
this.nowPage = 1;
this.getData()
},
},
watch: {
dialogObj: {
handler: function () {
this.loading = true;
this.initDialog()
},
deep: true
},
show(value) {
this.$emit("changeShow", value);
}
}
}
</script>