Files
dvcp_v2_wxcp_app/src/project/saas/AppCooperationPropaganda/cooperationDetail.vue

315 lines
7.4 KiB
Vue
Raw Normal View History

2022-07-12 18:10:42 +08:00
<template>
2022-07-15 16:43:41 +08:00
<div class="cooperationDetail">
2022-07-13 16:59:58 +08:00
<AiTopFixed>
<div class="tab-select">
<div class="item" :class="tabIndex == index ? 'active' : ''" v-for="(item, index) in tabs" :key="index" @click="tabClick(index)">{{ item }}<span></span>
</div>
</div>
</AiTopFixed>
<div class="content">
<div class="header">
<div class="header_left">
<div>防疫宣传群发通知</div>
2022-07-15 14:48:27 +08:00
<div>创建时间: <span>{{ createTime }}</span></div>
2022-07-13 16:59:58 +08:00
</div>
<div class="header_right" @click="toDetail">查看详情</div>
</div>
<div class="pieEcharts">
<div class="pie_info">
2022-07-15 16:43:41 +08:00
<div class="tips">数据更新于<span>{{ info.remindTime }}</span></div>
2022-07-13 16:59:58 +08:00
<div class="pie_card">
2022-07-15 17:07:56 +08:00
<div v-if="info.executedCount!=null" id="pieEcharts"></div>
<AiEmpty description="暂无数据" v-else />
2022-07-13 16:59:58 +08:00
<div class="pie_right">
2022-07-15 16:43:41 +08:00
<div>计划送达居民群: <span>{{ info.planCount || 0 }}</span></div>
<div>未送达居民群: <span>{{ info.unExecutedCount || 0 }}</span></div>
<div>已送达居民群: <span>{{ info.executedCount || 0 }}</span></div>
<div>无法送达居民群: <span>{{ info.cannotExecuteCount || 0 }}</span></div>
2022-07-13 16:59:58 +08:00
</div>
</div>
2022-07-15 17:07:56 +08:00
<div class="btn" v-if="info.status == 4" @click="remindSend">提醒成员发送</div>
2022-07-13 16:59:58 +08:00
</div>
</div>
<div class="list_content">
<div class="list_card">
<div class="tab">
<u-subsection :list="subsection" :current="subIndex"></u-subsection>
</div>
2022-07-15 14:48:27 +08:00
<AiTable :data="tableData" :colConfigs="colConfigs0" v-if="tabIndex == 0"/>
<AiTable :data="tableData" :colConfigs="colConfigs1" v-if="tabIndex == 1"/>
2022-07-13 16:59:58 +08:00
</div>
</div>
</div>
</div>
2022-07-12 18:10:42 +08:00
</template>
<script>
2022-07-13 16:59:58 +08:00
import echarts from 'echarts'
2022-07-12 18:10:42 +08:00
export default {
data() {
2022-07-13 16:59:58 +08:00
return {
tabs: ['成员统计', '居民群统计'],
tabIndex: 0,
pieEcharts: null,
subsection: [
{name: '未送达'},
{name: '已送达'},
{name: '无法送达'}
],
subIndex: 0,
2022-07-15 14:48:27 +08:00
tableData: [],
createTime: '',
id: '',
info: {},
current: 1,
2022-07-13 16:59:58 +08:00
}
},
computed: {
colConfigs0() {
return [
2022-07-15 14:48:27 +08:00
{ label: '成员', prop: 'groupOwnerId', width: '240rpx', dict: 'householdRelation' },
{ label: '预计未送达居民', prop: 'groupCount'},
2022-07-13 16:59:58 +08:00
]
},
colConfigs1() {
return [
2022-07-15 14:48:27 +08:00
{ label: '居民群', prop: 'groupName', width: '240rpx', dict: 'householdRelation' },
{ label: '群人数', prop: 'memberCount', width: '200rpx' },
{ label: '群主', prop: 'groupOwnerId', dict: 'sex' },
2022-07-13 16:59:58 +08:00
]
},
},
2022-07-15 14:48:27 +08:00
onLoad(o) {
this.id = o.id
this.createTime = o.time
this.getStatistics()
},
2022-07-13 16:59:58 +08:00
methods: {
tabClick(index) {
this.tabIndex = index
},
toDetail() {
2022-07-15 16:43:41 +08:00
uni.navigateTo({url: `./detail?id=${this.id}`})
2022-07-13 16:59:58 +08:00
},
2022-07-15 14:48:27 +08:00
// 提醒发送
remindSend() {
2022-07-15 16:43:41 +08:00
var timer = null
var num = 60 * 60 * 1000
2022-07-15 14:48:27 +08:00
this.$http.post('/app/appmasssendingtask/remindSend',null,{
params: {
id: this.id
}
}).then(res => {
2022-07-15 16:43:41 +08:00
if(res?.code==0) {
this.$u.toast('已提醒成员发送')
timer = setInterval(()=>{
if(this.num == 0) {
clearInterval(timer)
}
num = num - 1
}, 60 * 60 * 1000)
} else {
this.$u.toast(res.msg)
}
}).catch(() => {
this.$u.toast(`${num}s后可再次提醒发送`)
2022-07-15 14:48:27 +08:00
})
},
getStatistics() {
this.$http.post(`/app/appmasssendingtask/detailStatistics`, null, {
params: {
type: this.tabIndex,
sendStatus: this.subIndex,
taskId: this.id,
current: this.current
}
}).then(res => {
if(res?.data) {
this.tableData = res.data.executedList
}
})
},
2022-07-13 16:59:58 +08:00
// 带百分比饼图
getPieEcharts() {
this.pieEcharts = echarts.init(document.getElementById('pieEcharts'))
this.pieEcharts.setOption( {
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)'
},
color:['#1684fc','#ccc'],
series: [
{
name: '群发送达率',
type: 'pie',
radius: ['65', '50%'],
avoidLabelOverlap: false,
label: {
normal: {
show: false,
position: 'center'
},
},
labelLine: {
show: false
},
data: [
{value: 10, name: '群发送达率', label:{
normal:{
show:true,
2022-07-15 10:44:31 +08:00
formatter: `{d}%\n群发居民群`,
2022-07-13 16:59:58 +08:00
textStyle: {
fontSize: 16,
},
}}
},
{value: 120,}
]
}
]
})
}
},
onShow() {
document.title = "群发居民群统计"
2022-07-12 18:10:42 +08:00
},
2022-07-13 16:59:58 +08:00
mounted() {
this.getPieEcharts()
}
2022-07-12 18:10:42 +08:00
}
</script>
<style lang="scss" scoped>
2022-07-15 16:43:41 +08:00
.cooperationDetail {
2022-07-13 16:59:58 +08:00
::v-deep .AiTopFixed .content {
padding: 0;
}
.tab-select {
width: 100%;
height: 96px;
line-height: 96px;
background: #3975C6;
display: flex;
.item {
flex: 1;
text-align: center;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #CDDCF0;
}
.active {
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
position: relative;
color: #fff;
span {
width: 48px;
height: 4px;
background: #FFF;
position: absolute;
bottom: 14px;
left: 50%;
margin-left: -24px;
}
}
}
.header {
height: 160px;
padding: 32px;
box-sizing: border-box;
background: #FFF;
display: flex;
align-items: center;
.header_left {
width: calc(100% - 120px);
div:first-child {
color: #000000;
font-size: 32px;
font-weight: 600;
margin-bottom: 10px;
}
div:last-child {
color: #666666;
}
}
.header_right {
width: 120px;
color: #5297FF;
}
}
.pieEcharts {
width: 100%;
padding: 32px;
box-sizing: border-box;
.pie_info {
background: #FFF;
border-radius: 16px;
padding-bottom: 20px;
box-sizing: border-box;
.tips {
color: #666666;
padding: 40px 32px 0 32px;
box-sizing: border-box;
}
.pie_card {
display: flex;
width: 100%;
align-items: center;
#pieEcharts {
width: 60%;
height: 400px;
}
2022-07-15 17:07:56 +08:00
::v-deep .emptyWrap {
width: 60%;
}
2022-07-13 16:59:58 +08:00
.pie_right {
width: 40%;
div {
margin-bottom: 10px;
}
}
}
.btn {
margin: 0 auto;
width: 90%;
height: 80px;
line-height: 80px;
text-align: center;
color: #FFF;
background: #3AA0FF;
border-radius: 8px;
}
}
}
.list_content {
padding: 0 32px;
box-sizing: border-box;
.list_card {
background: #FFF;
border-radius: 16px;
padding: 30px 30px;
.tab {
margin-bottom: 34px;
}
}
}
}
2022-07-12 18:10:42 +08:00
</style>