|
@@ -0,0 +1,169 @@
|
|
1
|
+<template>
|
|
2
|
+ <el-dialog
|
|
3
|
+ :visible.sync="dialogVisible"
|
|
4
|
+ :before-close="handleCancel"
|
|
5
|
+ class="list-dialog"
|
|
6
|
+ :title="dialogTitle"
|
|
7
|
+ width="900px"
|
|
8
|
+ >
|
|
9
|
+ <!-- <div>
|
|
10
|
+ <selfInput label_name="关键字" @inputChange="onInputKeyword" />
|
|
11
|
+ </div> -->
|
|
12
|
+ <div class="form-wrap" v-loading="loading">
|
|
13
|
+ <el-table ref="tableDom" :max-height="height" :data="list" tooltip-effect="dark" style="width: 100%; margin-top: 10px;">
|
|
14
|
+ <el-table-column label="客户群名称" prop="name" min-width="120" align="center">
|
|
15
|
+ <template slot-scope="{ row }">
|
|
16
|
+ <span>{{ row.name || '未设置群名称' }}</span>
|
|
17
|
+ </template>
|
|
18
|
+ </el-table-column>
|
|
19
|
+ <el-table-column label="群主名称" prop="owner_name" min-width="100" align="center" />
|
|
20
|
+ <el-table-column label="分配返回码" prop="errno" min-width="80" align="center" />
|
|
21
|
+ <el-table-column label="分配结果说明" prop="msg" align="center" min-width="160">
|
|
22
|
+ <template slot-scope="{ row }">
|
|
23
|
+ <span :style="{ color: row.errno == 0 ? '#00B38A' : '#EB4315' }">{{ row.msg || '-' }}</span>
|
|
24
|
+ </template>
|
|
25
|
+ </el-table-column>
|
|
26
|
+ </el-table>
|
|
27
|
+ <div class="pagination" v-show="pagination.total > 0">
|
|
28
|
+ <el-pagination background :current-page="pagination.page" @current-change="handleCurrentChange" layout="prev, pager, next" :page-count="Number(pagination.pages)" />
|
|
29
|
+ </div>
|
|
30
|
+ </div>
|
|
31
|
+ <div slot="footer" class="dialog-footer">
|
|
32
|
+ <!-- <el-button size="mini" @click="handleCancel">关 闭</el-button> -->
|
|
33
|
+ </div>
|
|
34
|
+ </el-dialog>
|
|
35
|
+</template>
|
|
36
|
+
|
|
37
|
+<script>
|
|
38
|
+import selfInput from '@/components/assembly/screen/input.vue'
|
|
39
|
+export default {
|
|
40
|
+ components: {
|
|
41
|
+ selfInput,
|
|
42
|
+ },
|
|
43
|
+ props: {
|
|
44
|
+ // 控制弹框是否显示
|
|
45
|
+ dialogVisible: {
|
|
46
|
+ type: Boolean,
|
|
47
|
+ default: () => false
|
|
48
|
+ },
|
|
49
|
+ config_id: {
|
|
50
|
+ type: String | Number,
|
|
51
|
+ default: () => ''
|
|
52
|
+ },
|
|
53
|
+ },
|
|
54
|
+ data() {
|
|
55
|
+ return {
|
|
56
|
+ height: 500,
|
|
57
|
+ loading: false,
|
|
58
|
+ pagination: {
|
|
59
|
+ page: 1,
|
|
60
|
+ page_size: 100,
|
|
61
|
+ pages: 0,
|
|
62
|
+ total: 0,
|
|
63
|
+ },
|
|
64
|
+ filter: {
|
|
65
|
+ keyword: '',
|
|
66
|
+ },
|
|
67
|
+ list: [],
|
|
68
|
+ }
|
|
69
|
+ },
|
|
70
|
+ computed: {
|
|
71
|
+ // 弹框标题
|
|
72
|
+ dialogTitle() {
|
|
73
|
+ return '客户群分配结果'
|
|
74
|
+ }
|
|
75
|
+ },
|
|
76
|
+ watch: {
|
|
77
|
+ dialogVisible(isShow) {
|
|
78
|
+ // 弹框显示 => 初始化表单数据
|
|
79
|
+ if (isShow) {
|
|
80
|
+ this.pagination.page = 1
|
|
81
|
+ this.filter.keyword = ''
|
|
82
|
+ this.handleInitList()
|
|
83
|
+ this.handleGetList()
|
|
84
|
+ }
|
|
85
|
+ },
|
|
86
|
+ },
|
|
87
|
+ methods: {
|
|
88
|
+ // 获取列表数据
|
|
89
|
+ async handleGetList() {
|
|
90
|
+ try {
|
|
91
|
+ this.loading = true
|
|
92
|
+ const url = `${this.URL.BASEURL}${this.URL.groupTransfer_record}`
|
|
93
|
+ const params = {
|
|
94
|
+ config_id: this.config_id,
|
|
95
|
+ // keyword: this.filter.keyword,
|
|
96
|
+ page: this.pagination.page,
|
|
97
|
+ // page_size: this.pagination.page_size,
|
|
98
|
+ }
|
|
99
|
+ const { data: res = {} } = await this.$axios.get(url, { params })
|
|
100
|
+ if (res && res.errno == 0 && Array.isArray(res.rst.data)) {
|
|
101
|
+ this.list = res.rst.data;
|
|
102
|
+ this.pagination.total = res.rst.pageInfo.total;
|
|
103
|
+ this.pagination.pages = res.rst.pageInfo.pages;
|
|
104
|
+ this.$refs.tableDom.bodyWrapper.scrollTop = 0
|
|
105
|
+ } else if (res.errno != 4002) {
|
|
106
|
+ this.$message.warning(res.err)
|
|
107
|
+ this.handleInitList()
|
|
108
|
+ }
|
|
109
|
+ } catch (error) {
|
|
110
|
+ console.log(error)
|
|
111
|
+ this.handleInitList()
|
|
112
|
+ } finally {
|
|
113
|
+ this.loading = false
|
|
114
|
+ }
|
|
115
|
+ },
|
|
116
|
+ // 监听当前页数变化
|
|
117
|
+ handleCurrentChange(currentPage) {
|
|
118
|
+ this.pagination.page = currentPage
|
|
119
|
+ this.handleGetList()
|
|
120
|
+ },
|
|
121
|
+ // 监听"搜索剧集"变化
|
|
122
|
+ onInputKeyword(val) {
|
|
123
|
+ this.filter.keyword = val || ''
|
|
124
|
+ this.pagination.page = 1
|
|
125
|
+ this.handleGetList()
|
|
126
|
+ },
|
|
127
|
+ // 初始化列表数据
|
|
128
|
+ handleInitList() {
|
|
129
|
+ this.list = [];
|
|
130
|
+ this.pagination.total = 0;
|
|
131
|
+ this.pagination.pages = 0;
|
|
132
|
+ },
|
|
133
|
+ handleCancel() {
|
|
134
|
+ this.$emit('close')
|
|
135
|
+ },
|
|
136
|
+ },
|
|
137
|
+};
|
|
138
|
+</script>
|
|
139
|
+
|
|
140
|
+<style lang="scss" scoped>
|
|
141
|
+.list-dialog {
|
|
142
|
+ .status {
|
|
143
|
+ margin: 2px auto;
|
|
144
|
+ padding: 0 6px;
|
|
145
|
+ color: #32B38A;
|
|
146
|
+ border: 1px solid #32B38A;
|
|
147
|
+ }
|
|
148
|
+ .form-wrap {
|
|
149
|
+ padding: 0 10px;
|
|
150
|
+ }
|
|
151
|
+ .dialog-footer {
|
|
152
|
+ text-align: center;
|
|
153
|
+ }
|
|
154
|
+ /deep/ .el-dialog {
|
|
155
|
+ position: absolute;
|
|
156
|
+ top: 50%;
|
|
157
|
+ left: 50%;
|
|
158
|
+ margin: 0 !important;
|
|
159
|
+ transform: translate(-50%, -50%);
|
|
160
|
+ }
|
|
161
|
+
|
|
162
|
+ /deep/ .el-dialog__body {
|
|
163
|
+ padding: 0 10px 10px;
|
|
164
|
+ }
|
|
165
|
+ /deep/ .el-dialog__footer {
|
|
166
|
+ padding: 0;
|
|
167
|
+ }
|
|
168
|
+}
|
|
169
|
+</style>
|