Browse Source

四率

taidong
huxiaolei 11 months ago
parent
commit
f5192a5e45
  1. 4
      components/custom-tab-bar/index.js
  2. BIN
      images/statistics/down.png
  3. 127
      pages/statistics/modules/HotlineRates/HotlineRates.js
  4. 6
      pages/statistics/modules/HotlineRates/HotlineRates.json
  5. 84
      pages/statistics/modules/HotlineRates/HotlineRates.wxml
  6. 120
      pages/statistics/modules/HotlineRates/HotlineRates.wxss
  7. 6
      pages/statistics/statistics.js
  8. 3
      pages/statistics/statistics.json
  9. 28
      pages/statistics/statistics.wxml
  10. 6
      utils/statisticsApi.js

4
components/custom-tab-bar/index.js

@ -64,13 +64,13 @@ Component({
getOwnedRolesOfStaffId(res.data.id).then(res2 => { getOwnedRolesOfStaffId(res.data.id).then(res2 => {
app.globalData.user = res.data app.globalData.user = res.data
this.setData({ this.setData({
"list[3].show": res2.data.filter(item => item.roleKey === 'secretary' || item.roleKey === 'admin').length > 0 "list[3].show": res2.data.filter(item => item.roleKey === 'secretary' || item.roleKey === 'administrator' || item.roleKey === 'street_secretary').length > 0
}) })
}) })
}) })
} else { } else {
this.setData({ this.setData({
"list[3].show": app.globalData.roleList.filter(item => item.roleKey === 'secretary' || item.roleKey === 'admin').length > 0 "list[3].show": app.globalData.roleList.filter(item => item.roleKey === 'secretary' || item.roleKey === 'administrator' || item.roleKey === 'street_secretary').length > 0
}) })
} }
console.log(app.globalData.roleList, 'userss') console.log(app.globalData.roleList, 'userss')

BIN
images/statistics/down.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

127
pages/statistics/modules/HotlineRates/HotlineRates.js

@ -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',
})
}
}
}
});

6
pages/statistics/modules/HotlineRates/HotlineRates.json

@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"no-data": "../../../../components/noData/nodata"
}
}

84
pages/statistics/modules/HotlineRates/HotlineRates.wxml

@ -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>

120
pages/statistics/modules/HotlineRates/HotlineRates.wxss

@ -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;
}

6
pages/statistics/statistics.js

@ -19,6 +19,7 @@ Page({
}], }],
monthIndex: 0, monthIndex: 0,
stayVal: '1', stayVal: '1',
curVal: '1',
tabValue: '' tabValue: ''
}, },
onLoad(options) { onLoad(options) {
@ -45,6 +46,11 @@ Page({
stayVal: index stayVal: index
}) })
}, },
setCur({currentTarget: {dataset: {index}}}) {
this.setData({
curVal: index
})
},
tabChange({detail}) { tabChange({detail}) {
this.setData({ this.setData({
tabValue: detail tabValue: detail

3
pages/statistics/statistics.json

@ -10,6 +10,7 @@
"RequirementAnalysis": "./modules/RequirementAnalysis/RequirementAnalysis", "RequirementAnalysis": "./modules/RequirementAnalysis/RequirementAnalysis",
"EventPrediction": "./modules/EventPrediction/EventPrediction", "EventPrediction": "./modules/EventPrediction/EventPrediction",
"CrowdPortrait": "./modules/CrowdPortrait/CrowdPortrait", "CrowdPortrait": "./modules/CrowdPortrait/CrowdPortrait",
"custom-tab-bar":"../../components/custom-tab-bar" "custom-tab-bar":"../../components/custom-tab-bar",
"HotlineRates": "./modules/HotlineRates/HotlineRates"
} }
} }

28
pages/statistics/statistics.wxml

@ -31,6 +31,34 @@
</view> </view>
<view class="card">
<view class="title" >
<view class="title-tabs">
<view
class="title-tab {{curVal === '1'? 'current': ''}}"
data-index="1"
bind:tap="setCur"
>
分管领导“四率”
</view>
<view
class="title-tab {{curVal === '2'? 'current': ''}}"
data-index="2"
bind:tap="setCur"
>
承办部门“四率”
</view>
</view>
</view>
<view class="cur-con">
<HotlineRates curVal="{{curVal}}" />
</view>
</view>
<view class="card"> <view class="card">
<view class="title"> <view class="title">
<text>集中突出问题</text> <text>集中突出问题</text>

6
utils/statisticsApi.js

@ -8,6 +8,12 @@ const paramsFormat = function (params) {
} }
return strArray.join('&') return strArray.join('&')
} }
// 不满意事项类型分析
export function event12345Rates(params) {
return request.post(`governance/icEvent/EventCategoryAnalysis`, params)
}
// 不满意事项类型分析 // 不满意事项类型分析
export function satisfactionGroup(params) { export function satisfactionGroup(params) {
return request.get(`governance/satisfactionOverview/satisfactionGroup`, params) return request.get(`governance/satisfactionOverview/satisfactionGroup`, params)

Loading…
Cancel
Save