drawRecord.vue
3.31 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
<template>
<div>
<el-drawer title="发送记录" :visible.sync="drawVisible" direction="rtl" size="50%">
<div class="horizon"></div>
<div class="drawer-body">
<div class="record-panel">
<div class="record-border">
<div class="record-status">发送成功</div>
<div class="record-num">{{ successCount }}</div>
</div>
<div class="record-border">
<div class="record-status">发送失败</div>
<div class="record-num">{{ failCount }}</div>
</div>
</div>
<GLTable ref="proGroupRef" @refreshTable="getListData" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :tableParams="tableParams" :pageConf="pageConf">
<div slot="status" slot-scope="scope">
<span style="color: #EB4E4E" v-if="scope.scope.status == 2">发送失败</span>
<span style="color: #2CCA74" v-else-if="scope.scope.status == 3">发送成功</span>
</div>
</GLTable>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
data() {
return {
successCount: 0,
failCount: 0,
drawVisible: false,
tableData: [],
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '员工',
prop: 'staffName',
minwidth: 240
},
{
label: '发送时间',
prop: 'sendTime',
minwidth: 180
},
{
label: '发送结果',
prop: 'status',
addHtml: 'status',
minwidth: 180
}
]
},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableTotal: 0,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }
}
},
methods: {
getListData() {
this.loading = true
const params = {
pageSize: this.$refs.proGroupRef.page.pageSize,
pageNum: this.$refs.proGroupRef.page.pageNum,
id: this.recordId
}
this.$apis.friendGroup.batchmomentRecord(params).then(res => {
this.loading = false
if (res) {
this.tableData = res.data
this.tableTotal = res.count
}
})
},
init(row) {
const { id, successCount = 0, failCount = 0 } = row
this.recordId = id
this.successCount = successCount
this.failCount = failCount
this.drawVisible = true
this.$nextTick(() => {
this.getListData()
})
}
}
}
</script>
<style scoped lang="scss">
.drawer-body {
padding: 20px;
}
.horizon {
width: 100%;
height: 1px;
background: #e8e8ea;
}
.record-panel {
display: flex;
.record-border {
width: 50%;
height: 66px;
padding: 8px 20px;
background: #ffffff;
border: 1px solid #e8e8ea;
border-radius: 4px;
box-sizing: border-box;
margin-bottom: 16px;
&:first-child {
margin-right: 20px;
.record-num {
color: #2cca74;
}
}
.record-status {
font-weight: 400;
font-size: 14px;
color: #666666;
letter-spacing: 0;
line-height: 22px;
}
.record-num {
font-size: 20px;
color: #eb4e4e;
letter-spacing: 0;
line-height: 24px;
margin-top: 6px;
}
}
}
</style>