basicInfo.vue
6.57 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
<template>
<div class="container">
<div class="title">基础信息</div>
<div class="content">
<div class="content-info">
<div class="content-text">
<div class="detail-item">
<div class="detail-label">创建者:</div>
<div class="detail-value">{{basicInfo.createdBy ? basicInfo.createdBy : '-'}}</div>
</div>
<div class="detail-item">
<div class="detail-label">群发类型:</div>
<div class="detail-value">{{basicInfo.sendType == 1 ? '立即发送': '定时发送'}}</div>
</div>
<div class="detail-item" v-show="form == 'customer'">
<div class="detail-label">发送状态:</div>
<div class="detail-value">{{STATUS_TYPE[basicInfo.status]}}</div>
</div>
<div class="detail-item" v-show="form == 'customer' && basicInfo.sendType == 2">
<div class="detail-label">发送时间:</div>
<div class="detail-value">{{basicInfo.sendTime}}</div>
</div>
<div class="detail-item">
<div class="detail-label">群发对象:</div>
<div class="detail-value">
<span v-for="(item, index) in basicInfo.userList" :key="item.id">
[{{item.staffName}}]
<span v-show="basicInfo.userList.length -1 != index">、</span>
</span>
</div>
</div>
<div class="detail-item">
<div class="detail-label">群发内容:</div>
<div
class="detail-value"
>[共{{basicInfo.attachmentList ? basicInfo.attachmentList.length : '0'}}条]</div>
<div class="detail-tips">详见右侧视图</div>
</div>
</div>
<div class="title">数据统计</div>
<div class="statistics-info">
<div class="statistics-ul">
<div class="statistics-li statistics-border">
<div class="statistics-number">
<span>{{form == 'customer' ? statistic.senderStaffCount: statistic.senderStaffCount}}</span>
人
</div>
<div>已发送{{form == 'customer' ? '成员': '群主'}}</div>
</div>
<div class="statistics-li">
<div class="statistics-number">
<span>{{form == 'customer' ? statistic.senderCustomerCount :statistic.senderGroupCount}}</span>
人
</div>
<div>送达{{form == 'customer' ? '客户': '群聊'}}</div>
</div>
</div>
<div class="statistics-ul">
<div class="statistics-li statistics-border">
<div class="statistics-number">
<span>{{form == 'customer' ?statistic.unSenderStaffCount:statistic.unSenderStaffCount}}</span>
人
</div>
<div>未发送{{form == 'customer' ? '成员': '群主'}}</div>
</div>
<div class="statistics-li">
<div class="statistics-number">
<span>{{form == 'customer' ?statistic.unSenderCustomerCount:statistic.unSenderGroupCount}}</span>
人
</div>
<div>未送达{{form == 'customer' ? '客户': '群聊'}}</div>
</div>
</div>
<div v-if="form == 'customer'" class="statistics-ul">
<div class="statistics-li">
<div class="statistics-number">
<span>{{statistic.senderCustomerFailureCount}}</span>
人
</div>
<div>客户送达失败</div>
</div>
</div>
</div>
</div>
<Preview :eventBus="eventBus" :list.sync="basicInfo.attachmentList"></Preview>
</div>
</div>
</template>
<script>
const STATUS = {
'-1': '创建失败',
'0': '创建成功',
'1': '发送成功',
'2': '发送失败'
}
import Preview from '../components/preview.vue'
export default {
name: 'BasicInof',
props: ['form', 'id', 'eventBus'],
components: {
Preview
},
data() {
return {
STATUS_TYPE: STATUS,
basicInfo: {},
statistic: {}
}
},
mounted() {
this.getCustomerDetail(this.id)
console.log(this.form)
this.getStatistic()
},
methods: {
getCustomerDetail(id) {
this.$apis.customerTransform.customerDetail({ id }).then(res => {
console.log(res)
this.basicInfo = res
this.eventBus.$emit('update', this.basicInfo.attachmentList)
})
},
getStatistic() {
const { id, form } = this
if (form == 'customer') {
this.$apis.customerTransform.detailStatistic({ id }).then(res => {
console.log(res)
this.statistic = res
})
} else if (form == 'customerGroup') {
this.$apis.customerTransform.groupDetailStatistic({ id }).then(res => {
console.log(res)
this.statistic = res
})
}
}
}
}
</script>
<style lang="scss" scope>
.container {
margin-bottom: 20px;
background-color: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
.title {
padding: 20px 0 17px 20px;
font-size: 16px;
color: #333;
border-bottom: 1px solid #d8d8d8;
}
.content {
display: flex;
align-items: flex-end;
justify-content: space-between;
box-sizing: border-box;
width: 100%;
height: 100%;
padding: 20px 24px 40px 0;
.content-info {
width: calc(100% - 360px);
.content-text {
padding-left: 52px;
height: 400px;
}
.detail-item {
display: flex;
font-size: 14px;
color: #333;
line-height: 20px;
margin-bottom: 24px;
.detail-tips {
margin-left: 8px;
color: #939393;
}
}
.statistics-info {
display: flex;
justify-content: space-around;
margin-top: 24px;
margin-left: 52px;
.statistics-ul {
border-radius: 2px;
background-color: #f6f6ff;
border: 1px solid rgba(88, 80, 255, 0.8);
}
.statistics-li {
display: inline-block;
width: 142px;
color: #424242;
font-size: 14px;
text-align: center;
margin: 42px 35px;
&.statistics-border {
padding-right: 35 px;
margin-right: 0;
border-right: 1px solid #5850ff;
}
.statistics-number {
margin-bottom: 12px;
font-size: 16px;
color: #333;
span {
font-size: 26px;
}
}
}
}
}
}
}
</style>