index.vue
6.71 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<template>
<div class="send-assistant">
<div class="menu-sub">
<div class="menu-sub-item" :class="[activeIndex == '1' ? 'active' : '']" @click="switchMenu(1)">客户群发</div>
<div class="menu-sub-item" :class="[activeIndex == '2' ? 'active' : '']" @click="switchMenu(2)">客户群群发</div>
</div>
<div v-show="activeIndex == 1" class="container">
<div class="container-header">
<div class="text">企业统一选择要发送的客户,由添加客户的成员确认后发送给客户,消息内容仅管理员和负责人可创建。</div>
<el-button type="primary" icon="el-icon-plus" @click="btnClick('create', 1)">新建群发</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="gueast" :getListApi="customerList" :tableParams="gueastTableParams" :pageConf="gueastPageConf">
<!-- <div slot="entmicro-name" class="entmicro" slot-scope="scope">
<span v-for="(i, index) in scope.scope.userList" :key="index">{{ i.name }}({{ i.tips }});</span>
</div> -->
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" :disabled="scope.scope.isRemind == 1" @click="btnClick('edit', 1, scope.scope)">提醒发送</el-button>
<el-button type="text" @click="btnClick('detail', 2, scope.scope)">详情</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<div v-show="activeIndex == 2" class="container">
<div class="container-header">
<div class="text">管理员或负责人统一创建内容,群主收到通知后,可选择他管理的客户群并群发。</div>
<el-button type="primary" icon="el-icon-plus" @click="btnClick('create', 2)">新建群发</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="gueast" :getListApi="customerGroupList" :tableParams="gueastGroupTableParams" :pageConf="gueastPageConf">
<!-- <div slot="entmicro-name" class="entmicro" slot-scope="scope">
<span v-for="(i, index) in scope.scope.userList" :key="index">{{ i.name }}({{ i.tips }});</span>
</div> -->
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" :disabled="scope.scope.isRemind == 1" @click="btnClick('edit', 2, scope.scope)">提醒发送</el-button>
<el-button type="text" @click="btnClick('detail', 2, scope.scope)">详情</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
export default {
name: 'SendAssistant',
data() {
return {
activeIndex: '1',
gueastTableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '群发类型',
prop: 'sendType',
formatter: cellValue => {
return {
1: '立即发送',
2: '定时发送'
}[cellValue.sendType]
}
},
{
label: '群发内容',
prop: 'massName',
line: 2,
minWidth: '100px'
// addHtml: 'entmicro-name'
},
{
label: '发送时间',
prop: 'sendTime',
line: 2
},
{
label: '已发送员工',
prop: 'sendUserNum',
line: 2
},
{
label: '已送达客户',
prop: 'sendCustomerNum',
line: 2
},
{
label: '未发送员工',
prop: 'unsendUserNum',
line: 2
},
{
label: '未送达客户',
prop: 'unsendCustomerNum',
line: 2
},
{
label: '操作',
prop: 'optionBtns',
width: '140px',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
gueastPageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
customerList: this.$apis.customerTransform.customerList,
customerGroupList: this.$apis.customerTransform.customerGroupList,
gueastGroupTableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '群发名称',
prop: 'name'
},
{
label: '群发内容',
prop: 'massName',
line: 2,
minWidth: '100px'
// addHtml: 'entmicro-name'
},
{
label: '发送时间',
prop: 'sendTime',
line: 2
},
{
label: '已发送群主',
prop: 'sendUserNum',
line: 2
},
{
label: '已送达群聊',
prop: 'sendCustomerNum',
line: 2
},
{
label: '未发送群主',
prop: 'unsendUserNum',
line: 2
},
{
label: '未送达群聊',
prop: 'unsendCustomerNum',
line: 2
},
{
label: '操作',
prop: 'optionBtns',
width: '140px',
addHtml: 'optionBtns',
fixed: 'right'
}
]
}
}
},
methods: {
switchMenu(val) {
this.activeIndex = val
},
/**
* name: 按钮名称
* type: 1 客户 2 客户群
* rowData: 行数据
*/
btnClick(name, type, rowData) {
switch (name) {
case 'create':
if (type == 1) {
this.$router.push('/customerTransform/addCustomer')
} else {
this.$router.push('/customerTransform/addCustomerGroup')
}
break
case 'detail':
if (type == 1) {
this.$router.push('/customerTransform/detailCustomer')
} else {
this.$router.push('/customerTransform/detaiCustomeGroup')
}
break
default:
console.log(11)
}
}
}
}
</script>
<style lang="scss" scope>
.send-assistant {
.menu-sub {
.menu-sub-item {
display: inline-block;
text-align: center;
color: #666;
width: 180px;
height: 32px;
line-height: 32px;
cursor: pointer;
&.active {
background-color: #fff;
color: #5850ff;
}
}
}
.container {
margin-bottom: 20px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
margin-top: 2px;
&-header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 25px;
.text {
font-size: 14px;
color: #999;
}
}
}
}
</style>