|
@@ -1,7 +1,7 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="customerStaff-wrap" v-loading="pageLoading">
|
3
|
3
|
<!-- S 筛选区 -->
|
4
|
|
- <div class="screenBox" style="padding-right: 100px;">
|
|
4
|
+ <div class="screenBox" style="padding-right: 100px;min-height: 85px;">
|
5
|
5
|
<!-- 日期 -->
|
6
|
6
|
<datePicker :reset="reset" title="自定义" :quickFlag="true" :afferent_time="default_time" :clearFlag="false" @changeTime="onChangeTime" />
|
7
|
7
|
<!-- 企微主体 -->
|
|
@@ -10,6 +10,7 @@
|
10
|
10
|
<selfInputV2 style="margin-left: -20px;" :labelWidth="true" v-model="filter.user_name" label_name="成员" placeholder="请输入" @change="onChangeUserName" />
|
11
|
11
|
<selfChannelV2 v-model="filter.msg_type" title="消息类型" type="msgType" labelWidth :clearable="false" @change="onChangeMsgType" />
|
12
|
12
|
<div class="reset" @click="onClickReset">重置</div>
|
|
13
|
+ <el-button class="export-btn" type="primary" size="mini" @click="onClickExport">导出Excel</el-button>
|
13
|
14
|
</div>
|
14
|
15
|
<!-- E 筛选区 -->
|
15
|
16
|
<!-- S 明细表 detailsTable -->
|
|
@@ -71,6 +72,38 @@
|
71
|
72
|
<detailRuleKHPYQ v-if="isShowRuleKHPYQ" :is_copy='false' title="朋友圈详情" :rule_id='currentRuleId' :sysMsgCorpid="currentCorpid" @close="detailClose" />
|
72
|
73
|
</el-drawer>
|
73
|
74
|
<!-- E 详情 - 客户朋友圈 -->
|
|
75
|
+
|
|
76
|
+ <el-dialog
|
|
77
|
+ :visible.sync="msgExport.visible"
|
|
78
|
+ :before-close="handleCancelExport"
|
|
79
|
+ class="export-dialog"
|
|
80
|
+ title="系统消息导出"
|
|
81
|
+ width="530px"
|
|
82
|
+ :close-on-click-modal="false"
|
|
83
|
+ >
|
|
84
|
+ <div class="form-wrap" v-loading="msgExport.loading">
|
|
85
|
+ <div class="form-item">
|
|
86
|
+ <span class="tips">注:根据当前消息列表筛选条件导出,日期范围最多可选2天</span>
|
|
87
|
+ </div>
|
|
88
|
+ <div class="form-item">
|
|
89
|
+ <span class="lable required">导出日期:</span>
|
|
90
|
+ <el-date-picker
|
|
91
|
+ v-model="msgExport.time"
|
|
92
|
+ type="daterange"
|
|
93
|
+ range-separator="至"
|
|
94
|
+ start-placeholder="开始日期"
|
|
95
|
+ end-placeholder="结束日期"
|
|
96
|
+ size="mini"
|
|
97
|
+ style="width: 350px;"
|
|
98
|
+ :picker-options="msgExport.pickerOptions"
|
|
99
|
+ />
|
|
100
|
+ </div>
|
|
101
|
+ </div>
|
|
102
|
+ <div slot="footer" class="dialog-footer">
|
|
103
|
+ <el-button size="mini" @click="handleCancelExport" :disabled="msgExport.loading">取 消</el-button>
|
|
104
|
+ <el-button size="mini" type="primary" @click="handleConfirmExport" :disabled="msgExport.loading">确 定</el-button>
|
|
105
|
+ </div>
|
|
106
|
+ </el-dialog>
|
74
|
107
|
</div>
|
75
|
108
|
<!-- E 明细表 detailsTable -->
|
76
|
109
|
</div>
|
|
@@ -92,6 +125,7 @@ import detailRuleZNQF from '@/components/smartPushV3/createMassMsg.vue' // 智
|
92
|
125
|
|
93
|
126
|
import detailRuleKHPYQ from '@/components/customOperate/createFriendsCircle.vue' // 客户朋友圈-规则详情
|
94
|
127
|
|
|
128
|
+
|
95
|
129
|
export default {
|
96
|
130
|
components: {
|
97
|
131
|
selfInputV2,
|
|
@@ -136,6 +170,17 @@ export default {
|
136
|
170
|
msg_type: 1,
|
137
|
171
|
},
|
138
|
172
|
|
|
173
|
+ msgExport: {
|
|
174
|
+ loading: false,
|
|
175
|
+ visible: false,
|
|
176
|
+ time: [],
|
|
177
|
+ pickerOptions: {
|
|
178
|
+ disabledDate (time) {
|
|
179
|
+ return time > Date.now()
|
|
180
|
+ }
|
|
181
|
+ },
|
|
182
|
+ },
|
|
183
|
+
|
139
|
184
|
currentCorpid: '',
|
140
|
185
|
currentRuleId: '',
|
141
|
186
|
currentGroupId: '',
|
|
@@ -219,6 +264,86 @@ export default {
|
219
|
264
|
this.pagination.page = 1
|
220
|
265
|
this.handleGetData()
|
221
|
266
|
},
|
|
267
|
+
|
|
268
|
+ // 监听点击"导出"按钮
|
|
269
|
+ async onClickExport() {
|
|
270
|
+ this.msgExport.visible = true
|
|
271
|
+ },
|
|
272
|
+ handleExport(list) {
|
|
273
|
+ console.log('list => ', list)
|
|
274
|
+ let tHeader = []
|
|
275
|
+ let filterVal = []
|
|
276
|
+ let tableDatas = []
|
|
277
|
+
|
|
278
|
+ const col = this.detailsTableCol.filter(c => c.column !== 'handler')
|
|
279
|
+
|
|
280
|
+ tHeader = [
|
|
281
|
+ ...col.map(d => `${d.name}`),
|
|
282
|
+ ]
|
|
283
|
+
|
|
284
|
+ filterVal = [
|
|
285
|
+ ...col.map(d => `${d.column}`),
|
|
286
|
+ ]
|
|
287
|
+
|
|
288
|
+ tableDatas = [
|
|
289
|
+ ...list,
|
|
290
|
+ ]
|
|
291
|
+
|
|
292
|
+ const excelDatas = [
|
|
293
|
+ {
|
|
294
|
+ tHeader, // sheet表一头部
|
|
295
|
+ filterVal, // 表一的数据字段
|
|
296
|
+ tableDatas, // 表一的整体json数据
|
|
297
|
+ sheetName: ''// 表一的sheet名字
|
|
298
|
+ }
|
|
299
|
+ ]
|
|
300
|
+ this.$exportOrder({ excelDatas, name: `系统消息(导出时间:${this.$getDay(0)})` })
|
|
301
|
+ },
|
|
302
|
+ handleGetDays() {
|
|
303
|
+ const st = this.$moment(this.msgExport.time[0])
|
|
304
|
+ const et = this.$moment(this.msgExport.time[1])
|
|
305
|
+ return et.diff(st, 'days')
|
|
306
|
+ },
|
|
307
|
+ async handleConfirmExport() {
|
|
308
|
+ if (!this.msgExport.time || !this.msgExport.time.length) {
|
|
309
|
+ return this.$message.warning('请选择导出日期')
|
|
310
|
+ }
|
|
311
|
+ const days = this.handleGetDays()
|
|
312
|
+ if (days > 1) {
|
|
313
|
+ return this.$message.warning('日期范围最多可选2天')
|
|
314
|
+ }
|
|
315
|
+
|
|
316
|
+ this.msgExport.loading = true
|
|
317
|
+ try {
|
|
318
|
+ const params = {
|
|
319
|
+ sys_group_id: this.filter.sys_group_id,
|
|
320
|
+ start_date: this.msgExport.time[0],
|
|
321
|
+ end_date: this.msgExport.time[1],
|
|
322
|
+ corp_id: this.filter.corpid,
|
|
323
|
+ user_name: this.filter.user_name,
|
|
324
|
+ msg_type: this.filter.msg_type,
|
|
325
|
+ page: 1,
|
|
326
|
+ page_size: -1, // -1 后端不限制条数
|
|
327
|
+ }
|
|
328
|
+ const url = `${this.URL.BASEURL}${this.URL.system_sendNoticeListNew}`
|
|
329
|
+ const { data: res = {} } = await this.$axios.get(url, { params })
|
|
330
|
+ if (res && res.errno == 0) {
|
|
331
|
+ this.handleExport(res.rst.data)
|
|
332
|
+ this.msgExport.visible = false
|
|
333
|
+ this.msgExport.time = []
|
|
334
|
+ } else if (res.errno != 4002) {
|
|
335
|
+ this.$message.warning(res.err)
|
|
336
|
+ }
|
|
337
|
+ } catch (error) {
|
|
338
|
+ console.log('error => ', error)
|
|
339
|
+ } finally {
|
|
340
|
+ this.msgExport.loading = false
|
|
341
|
+ }
|
|
342
|
+ },
|
|
343
|
+ handleCancelExport() {
|
|
344
|
+ this.msgExport.visible = false
|
|
345
|
+ },
|
|
346
|
+
|
222
|
347
|
// 监听点击"重置"按钮
|
223
|
348
|
onClickReset() {
|
224
|
349
|
this.reset = !this.reset
|
|
@@ -287,12 +412,61 @@ export default {
|
287
|
412
|
this.isShowDetailZNQF = false
|
288
|
413
|
this.isShowRuleKHPYQ = false
|
289
|
414
|
},
|
|
415
|
+
|
|
416
|
+
|
290
|
417
|
},
|
291
|
418
|
}
|
292
|
419
|
</script>
|
293
|
420
|
|
294
|
421
|
<style lang="scss" scoped>
|
295
|
422
|
@import "@/style/list.scss";
|
|
423
|
+.export-dialog {
|
|
424
|
+ /deep/ .el-dialog__body {
|
|
425
|
+ max-height: 380px;
|
|
426
|
+ overflow-y: auto;
|
|
427
|
+ }
|
|
428
|
+ .form-wrap {
|
|
429
|
+ padding-right: 20px;
|
|
430
|
+ .form-item {
|
|
431
|
+ display: flex;
|
|
432
|
+ align-items: center;
|
|
433
|
+ margin-top: 20px;
|
|
434
|
+ &.flex-align-start {
|
|
435
|
+ align-items: flex-start;
|
|
436
|
+ }
|
|
437
|
+ &:first-child {
|
|
438
|
+ margin-top: 0;
|
|
439
|
+ }
|
|
440
|
+ .tips {
|
|
441
|
+ font-size: 13px;
|
|
442
|
+ color: #FFB055;
|
|
443
|
+ margin-left: 10px;
|
|
444
|
+ }
|
|
445
|
+ .lable {
|
|
446
|
+ width: 80px;
|
|
447
|
+ font-weight: 500;
|
|
448
|
+ flex-shrink: 0;
|
|
449
|
+ text-align: right;
|
|
450
|
+ margin-right: 20px;
|
|
451
|
+
|
|
452
|
+ &.required {
|
|
453
|
+ &::before {
|
|
454
|
+ position: relative;
|
|
455
|
+ right: 2px;
|
|
456
|
+ content: "*";
|
|
457
|
+ color: #f56c6c;
|
|
458
|
+ }
|
|
459
|
+ }
|
|
460
|
+ }
|
|
461
|
+ .el-select {
|
|
462
|
+ width: 430px;
|
|
463
|
+ }
|
|
464
|
+ }
|
|
465
|
+ }
|
|
466
|
+ .dialog-footer {
|
|
467
|
+ text-align: center;
|
|
468
|
+ }
|
|
469
|
+}
|
296
|
470
|
.customerStaff-wrap {
|
297
|
471
|
position: relative;
|
298
|
472
|
min-height: calc(100vh - 70px);
|
|
@@ -306,6 +480,7 @@ export default {
|
306
|
480
|
background: #fff;
|
307
|
481
|
padding: 5px 20px 10px;
|
308
|
482
|
position: relative;
|
|
483
|
+ align-items: flex-start;
|
309
|
484
|
.common-screen-item {
|
310
|
485
|
width: auto;
|
311
|
486
|
}
|
|
@@ -365,5 +540,6 @@ export default {
|
365
|
540
|
}
|
366
|
541
|
}
|
367
|
542
|
}
|
|
543
|
+
|
368
|
544
|
}
|
369
|
545
|
</style>
|