detaiCustomeGroup.vue
5.36 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<template>
<div>
<BasicInof :form="'customerGroup'" :eventBus="eventBus" :id="$route.params.id"></BasicInof>
<div class="group-detail-container">
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<div slot="footer" class="search-btns">
<el-button :size="size" @click="update">更新</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</div>
</glsx-combi-form>
<!-- 表格区域 开始 -->
<GLTable style="margin-top: 20px;" ref="table" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :hasPage="false" :pageConf="pageConf">
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" :disabled="scope.scope.status == 1 || (scope.scope.status == 0 && scope.scope.remindStatus == 1)" @click="remind(scope.scope)">提醒发送</el-button>
</div>
</GLTable>
</div>
</div>
</template>
<script>
import Vue from 'vue'
import BasicInof from './components/basicInfo.vue'
export default {
components: {
BasicInof
},
data() {
return {
searchForm: {},
eventBus: new Vue(),
searchFormData: [
{
label: '群聊名称',
name: 'keyWord',
type: 'input',
maxlength: 20
},
{
label: '群主',
name: 'staffId',
type: 'select',
isClear: true,
optionLabel: 'staffName',
optionId: 'staffId',
optionList: []
},
{
label: '消息送达状态',
name: 'status',
type: 'select',
isClear: true,
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '全部',
value: ''
},
{
label: '未发送',
value: '0'
},
{
label: '已发送',
value: '1'
},
{
label: '发送失败',
value: '2'
}
]
}
],
tableParams: {
listName: '',
tableOption: false,
tableColumns: [
{
label: '群聊名称',
prop: 'groupName'
},
{
label: '群主',
prop: 'staffName'
},
{
label: '群主所在部门',
prop: 'departmentName'
},
{
label: '群客户人数',
prop: 'customerCount'
},
{
label: '消息送达状态',
prop: 'status',
formatter: cellValue => {
return {
0: '未发送',
1: '已发送',
2: '发送失败'
}[cellValue.status]
}
},
{
label: '确认发送时间',
prop: 'senderTime'
// formatter: cellValue => {
// return new Date(cellValue.createdDate).toLocaleDateString().replace(/\//g, '-')
// }
},
{
label: '操作',
prop: 'optionBtns',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
getListApi: this.$apis.customerTransform.groupDetailList,
footerLeft: 0,
footerWidth: 0
}
},
mounted() {
const id = this.$route.params.id
this.getCustomerDetail(id)
this.searchForm.massId = id
let clientHeight = document.documentElement.clientHeight
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.boxHeight = clientHeight - 200
},
methods: {
remind(data) {
this.$apis.customerTransform
.remindUserGroup({
id: data.id,
type: 2
})
.then(res => {
this.handleSearch()
this.$message({
type: 'success',
message: '已提醒'
})
// this.$set(this.employeelist[index], 'isRemind', true)
})
},
handleSearch() {
this.$refs.table.refreshTable()
},
handleReset() {
this.searchForm = {
massId: this.$route.params.id
}
},
getCustomerDetail(id) {
this.$apis.customerTransform.customerDetail({ id }).then(res => {
this.searchFormData[1].optionList = res.userList
})
},
update() {
const id = this.$route.params.id
this.$apis.customerTransform.groupDetailUpdate({ id }).then(res => {
console.log(res)
if (res) {
this.handleSearch()
}
})
}
}
}
</script>
<style lang="scss" scope>
.group-detail-container {
// margin-bottom: 84px;
padding: 20px;
background-color: #ffffff;
box-shadow: 0px 1px 5px 0px rgba(38, 38, 38, 0.1);
.search-btns {
// float: right;
text-align: right;
}
}
.footer-panel {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 0px;
height: 64px;
width: 100%;
background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
z-index: 4;
}
</style>