10 changed files with 381 additions and 3 deletions
After Width: | Height: | Size: 418 B |
@ -0,0 +1,127 @@ |
|||
import {event12345Rates} from "../../../../utils/statisticsApi"; |
|||
import {formatTime} from "../../../../utils/util"; |
|||
const formatDay2 = date => { |
|||
const year = date.getFullYear() |
|||
const month = date.getMonth() + 1 |
|||
const day = date.getDay() |
|||
return [year, month, day].map(formatNumber).join('-') |
|||
} |
|||
const formatDay = date => { |
|||
const year = date.getFullYear() |
|||
const month = date.getMonth() |
|||
const day = date.getDay() |
|||
return [year, month, day].map(formatNumber).join('-') |
|||
} |
|||
const formatNumber = n => { |
|||
n = n.toString() |
|||
return n[1] ? n : '0' + n |
|||
} |
|||
Component({ |
|||
properties: { |
|||
curVal: { |
|||
type: String, |
|||
value: '1', |
|||
observer: function () { |
|||
this.getList(); |
|||
} |
|||
} |
|||
}, |
|||
data: { |
|||
list: [], |
|||
day: '', |
|||
day2: '', |
|||
showitem: 3, |
|||
}, |
|||
ready() { |
|||
this.setData({ |
|||
day: formatDay(new Date()), |
|||
}) |
|||
this.setData({ |
|||
day2: formatDay2(new Date()) |
|||
}) |
|||
|
|||
this.getList() |
|||
}, |
|||
methods: { |
|||
onChange(e) { |
|||
this.setData({ |
|||
day: e.detail.value |
|||
}) |
|||
}, |
|||
onChange2(e) { |
|||
this.setData({ |
|||
day2: e.detail.value |
|||
}) |
|||
}, |
|||
onSearch(){ |
|||
if(this.data.day>this.data.day2){ |
|||
wx.showToast({ |
|||
title: '起止日期错误', |
|||
icon: 'error', |
|||
duration: 2000 |
|||
}) |
|||
return false |
|||
} |
|||
this.getList() |
|||
}, |
|||
showall(){ |
|||
if(this.data.showitem==99999){ |
|||
this.setData({ |
|||
showitem: 3 |
|||
}) |
|||
}else{ |
|||
this.setData({ |
|||
showitem: 99999 |
|||
}) |
|||
} |
|||
}, |
|||
getList() { |
|||
if (this.data.curVal == '1') { |
|||
this.getEventList(false) |
|||
} else { |
|||
this.getEventList(false) |
|||
} |
|||
}, |
|||
getEventList(deptFlag) { |
|||
|
|||
|
|||
event12345Rates({ |
|||
startDate: this.data.day.toString() + ' ' + '00:00:00', |
|||
endDate: this.data.day2.toString() + ' ' + '23:59:59', |
|||
usableFlag: true, |
|||
deptFlag: deptFlag, |
|||
}).then(res => { |
|||
console.log('++++++++++++',res.data) |
|||
// res.data.list.forEach(item => {
|
|||
// item.reportTime = this.formatTime(item.reportTime)
|
|||
// })
|
|||
this.setData({ |
|||
list: res.data |
|||
}) |
|||
}) |
|||
}, |
|||
formatTime(date) { |
|||
if (date) { |
|||
let _date = new Date(date) |
|||
let M = _date.getMonth() - 0 + 1 > 10 ? _date.getMonth() - 0 + 1 : '0' + (_date.getMonth() - 0 + 1) |
|||
let D = _date.getDate() > 10 ? _date.getDate() : '0' + _date.getDate() |
|||
return M + '-' +D |
|||
} |
|||
return '' |
|||
|
|||
}, |
|||
|
|||
gotopage(e) { |
|||
if (this.data.stayVal === '1') { |
|||
wx.navigateTo({ |
|||
url: '/subpages/statistics/pages/event/detail/detail?id=' + e.currentTarget.dataset.id+'&is12345=2', |
|||
}) |
|||
} else { |
|||
wx.navigateTo({ |
|||
url: '/subpages/statistics/pages/demand/detail/detail?id=' + e.currentTarget.dataset.id+'&type=1', |
|||
}) |
|||
} |
|||
|
|||
} |
|||
} |
|||
}); |
@ -0,0 +1,6 @@ |
|||
{ |
|||
"component": true, |
|||
"usingComponents": { |
|||
"no-data": "../../../../components/noData/nodata" |
|||
} |
|||
} |
@ -0,0 +1,84 @@ |
|||
<view class="container"> |
|||
<view class="screen"> |
|||
<picker |
|||
mode="date" |
|||
model:value="{{ day }}" |
|||
fields="day" |
|||
bind:change="onChange" |
|||
> |
|||
<view class="picker"> |
|||
<text>{{ day }}</text> |
|||
<image src="../../../../images/statistics/down.png" mode="widthFix"/> |
|||
</view> |
|||
|
|||
</picker> |
|||
<picker |
|||
mode="date" |
|||
model:value="{{ day2 }}" |
|||
fields="day" |
|||
bind:change="onChange2" |
|||
> |
|||
<view class="picker"> |
|||
<text>{{ day2 }}</text> |
|||
<image src="../../../../images/statistics/down.png" mode="widthFix"/> |
|||
</view> |
|||
|
|||
</picker> |
|||
|
|||
<view class="btn" bindtap="onSearch"> |
|||
查询 |
|||
</view> |
|||
</view> |
|||
<view class="stay-list" wx:if="{{list.length}}"> |
|||
<!-- <view class="stay-item" wx:for="{{list}}" bind:tap="gotopage" data-id="{{item.icEventId || item.demandRecId}}"> |
|||
<view class="date">{{item.happenTime || item.reportTime}}</view> |
|||
<view class="tit-text">{{item.eventContent || item.content}}</view> |
|||
</view> --> |
|||
<view class="hotline-rate" wx:for="{{list}}" wx:for-index="idx" wx-if="{{idx<showitem}}"> |
|||
<view class="name"> |
|||
<view class="ranking">{{idx+1}}</view> |
|||
<view class="leader-name" wx-if="{{curVal=='1'}}">{{item.assignOrgLeader || item.assignOrgName}}</view> |
|||
<view class="leader-name" wx-if="{{curVal=='2'}}">{{item.assignOrgName}}</view> |
|||
</view> |
|||
<view class="num"> |
|||
<view class="child"> |
|||
<view class="lab">收件数</view> |
|||
<view class="val">{{item.total}}</view> |
|||
</view> |
|||
<view class="child"> |
|||
<view class="lab">未回复</view> |
|||
<view class="val">0</view> |
|||
</view> |
|||
<view class="child"> |
|||
<view class="lab">不满意</view> |
|||
<view class="val">{{item.notSatisfiedTotal}}</view> |
|||
</view> |
|||
<view class="child"> |
|||
<view class="lab">未解决</view> |
|||
<view class="val">{{item.unresolveTotal}}</view> |
|||
</view> |
|||
</view> |
|||
<view class="num"> |
|||
<view class="child"> |
|||
<view class="lab">按时办理率</view> |
|||
<view class="val">{{item.replyRate}}%</view> |
|||
</view> |
|||
<view class="child"> |
|||
<view class="lab">响应率</view> |
|||
<view class="val">{{item.responseRate}}%</view> |
|||
</view> |
|||
<view class="child"> |
|||
<view class="lab">满意度</view> |
|||
<view class="val">{{item.satisfiedRate}}%</view> |
|||
</view> |
|||
<view class="child"> |
|||
<view class="lab">解决率</view> |
|||
<view class="val">{{item.resolveRate}}%</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="showall" bind:tap="showall" wx-if="{{list.length>3}}" >{{showitem==99999?"收起":"展开"}}</view> |
|||
</view> |
|||
|
|||
<no-data wx:else isShow="{{true}}"/> |
|||
</view> |
@ -0,0 +1,120 @@ |
|||
.container { |
|||
padding: 0rpx 24rpx; |
|||
} |
|||
.hotline-rate { |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
border-bottom: 2px solid #FFFFFF; |
|||
padding: 0rpx 0; |
|||
} |
|||
.name{ |
|||
display: flex; |
|||
} |
|||
.ranking{ |
|||
font-size:16px; |
|||
margin-right: 10px; |
|||
font-weight:bold; |
|||
} |
|||
.leader-name{ |
|||
font-size:16px; |
|||
font-weight:bold; |
|||
margin-bottom: 10px; |
|||
} |
|||
.num{ |
|||
width:100%; |
|||
display: flex; |
|||
height:56px; |
|||
} |
|||
.child{ |
|||
flex:1; |
|||
height:56px; |
|||
text-align:center; |
|||
} |
|||
.lab{ |
|||
font-size:12px; |
|||
height:20px; |
|||
color:#999999; |
|||
line-height:20px; |
|||
} |
|||
.val{ |
|||
height:36px; |
|||
line-height:36px; |
|||
font-size:18px; |
|||
} |
|||
.screen { |
|||
display: flex; |
|||
justify-content: space-between; |
|||
background: #fff; |
|||
padding: 0rpx 0rpx 40rpx 0rpx ; |
|||
} |
|||
|
|||
.picker { |
|||
width: 236rpx; |
|||
margin-right: 10rpx; |
|||
height: 56rpx; |
|||
background: rgba(58, 128, 231, 0.16); |
|||
border: 1px solid #3A80E7; |
|||
border-radius: 28rpx; |
|||
font-size: 30rpx; |
|||
font-weight: 500; |
|||
color: #3A80E7; |
|||
line-height: 56rpx; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
padding: 0 20rpx; |
|||
box-sizing: border-box; |
|||
white-space: nowrap; |
|||
} |
|||
|
|||
.picker-type image, |
|||
.picker image { |
|||
width: 28rpx; |
|||
height: 28rpx; |
|||
} |
|||
|
|||
.picker-type text { |
|||
white-space: nowrap; |
|||
text-overflow: ellipsis; |
|||
overflow: hidden; |
|||
width: calc(100% - 24rpx); |
|||
} |
|||
.picker-type { |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
padding: 0 30rpx; |
|||
margin-right: 10rpx; |
|||
box-sizing: border-box; |
|||
width: 180rpx; |
|||
height: 56rpx; |
|||
background: rgba(193, 193, 193, 0.16); |
|||
border: 1px solid #DBDBDB; |
|||
border-radius: 28rpx; |
|||
font-size: 30rpx; |
|||
font-weight: 500; |
|||
color: #C1C1C1; |
|||
line-height: 56rpx; |
|||
text-align: center; |
|||
|
|||
} |
|||
|
|||
.btn { |
|||
width: 120rpx; |
|||
height: 56rpx; |
|||
line-height: 56rpx; |
|||
background: #3A80E7; |
|||
border-radius: 28rpx; |
|||
font-size: 28rpx; |
|||
font-weight: 500; |
|||
color: #FFFFFF; |
|||
text-align: center; |
|||
} |
|||
.showall{ |
|||
text-align: center; |
|||
background:#f7f7f7; |
|||
margin:10px 0 10px 0; |
|||
height:40px; |
|||
line-height:40px; |
|||
color:blue; |
|||
} |
Loading…
Reference in new issue