Browse Source

修改满意度调查没有当前月的情况

dev
战立标 2 years ago
parent
commit
6ec7d9f7b7
  1. 1
      components/custom-tab-bar/index.js
  2. 16
      pages/work/work.js
  3. 14
      pages/work/work.wxml
  4. 14
      subpages/searchResult/pages/punchCard/punchCard.js
  5. 2
      subpages/searchResult/pages/punchCard/punchCard.wxml

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

@ -53,6 +53,7 @@ Component({
getStaffbasicinfo().then(res=>{ getStaffbasicinfo().then(res=>{
getOwnedRolesOfStaffId(res.data.id).then(res2 => { getOwnedRolesOfStaffId(res.data.id).then(res2 => {
app.globalData.user = res.data
this.setData({ this.setData({
"list[2].show": res2.data.filter(item => item.roleKey === 'secretary').length > 0 "list[2].show": res2.data.filter(item => item.roleKey === 'secretary').length > 0
}) })

16
pages/work/work.js

@ -13,7 +13,9 @@ Page({
communitySelfInspList:[], communitySelfInspList:[],
communitySelfInspTop:{}, communitySelfInspTop:{},
questionnaireUrl:'' questionnaireUrl:'',
agencyLevel: '',
curMonth: ''
}, },
/** /**
@ -25,8 +27,8 @@ Page({
navigationHeight: app.globalData.deviceInfo.navigationHeight, navigationHeight: app.globalData.deviceInfo.navigationHeight,
share:app.globalData.share, share:app.globalData.share,
agencyName:app.globalData.user.agencyName, agencyName:app.globalData.user.agencyName,
agencyLevel: app.globalData.user.level
}) })
this.getSituation() this.getSituation()
this.getInspRecord() this.getInspRecord()
}, },
@ -57,10 +59,16 @@ Page({
} }
getInspRecord(parm).then(res=>{ getInspRecord(parm).then(res=>{
res.data.list = res.data.list.reverse(); res.data.list = res.data.list.reverse();
let curMonth = new Date().getMonth() - 0 + 1
let communitySelfInspTop = res.data.list.filter(item => item.monthName-0 === curMonth).length?res.data.list.filter(item => item.monthName-0 === curMonth)[0]:{}
let communitySelfInspList = res.data.list.filter(item => item.monthName-0 !== curMonth)
this.setData({ this.setData({
communitySelfInspTop:res.data.list.splice(0,1)[0], communitySelfInspTop,communitySelfInspList,curMonth
communitySelfInspList:res.data.list.splice(0,2),
}) })
// this.setData({
// communitySelfInspTop:res.data.list.splice(0,1)[0],
// communitySelfInspList:res.data.list.splice(0,2),
// })
app.globalData.questionnaireUrl = this.data.communitySelfInspTop.questionnaireUrl app.globalData.questionnaireUrl = this.data.communitySelfInspTop.questionnaireUrl
}).catch(err=>{ }).catch(err=>{
wx.hideLoading() wx.hideLoading()

14
pages/work/work.wxml

@ -60,7 +60,7 @@
</view> </view>
</view> </view>
<image src="../../images/work/sqmp.png" bind:tap="toDemandCheck" class="center_img" mode=""/> <image src="../../images/work/sqmp.png" bind:tap="toDemandCheck" class="center_img" mode=""/>
<view class="bto"> <view class="bto" wx:if="{{agencyLevel!=='street'}}">
<view class="title"> <view class="title">
<view style="font-size: 34rpx; font-weight: 500;">满意度自查</view> <view style="font-size: 34rpx; font-weight: 500;">满意度自查</view>
<text bind:tap="toHistoryQuery" style="font-size: 28rpx;">历史自查 ></text> <text bind:tap="toHistoryQuery" style="font-size: 28rpx;">历史自查 ></text>
@ -68,15 +68,23 @@
<view class="content"> <view class="content">
<view class="bg_box"> <view class="bg_box">
<view class="bg_left"> <view class="bg_left">
<block wx:if="{{communitySelfInspTop.monthName}}">
<view class="h2" bind:tap="toSynthesis" > <view class="h2" bind:tap="toSynthesis" >
{{communitySelfInspTop.agencyName}}{{communitySelfInspTop.monthName}}月份满意度自查 {{communitySelfInspTop.agencyName}}{{communitySelfInspTop.monthName}}月份满意度自查
</view> </view>
<view class="submit">已提交 <b>{{communitySelfInspTop.personQty?communitySelfInspTop.personQty:'--'}}</b> 人</view> <view class="submit">已提交 <b>{{communitySelfInspTop.personQty?communitySelfInspTop.personQty:'--'}}</b> 人</view>
<view class="btn_Box"> <button class="btn_fx" bind:tap="handelClickShare" data-item="{{communitySelfInspTop}}" open-type="share" >一键分享</button> <view class="btn_tj" bind:tap="toSynthesis">查看统计</view> <view class="btn_Box">
<button class="btn_fx" bind:tap="handelClickShare" data-item="{{communitySelfInspTop}}" open-type="share" >一键分享</button>
<view class="btn_tj" bind:tap="toSynthesis">查看统计</view>
</view> </view>
</block>
<view class="h2" wx:else >
未创建{{curMonth}}月份满意度自查
</view>
</view> </view>
<view class="bg_right"> <view class="bg_right">
<text class="tag">进行中</text> <text class="tag" wx:if="{{communitySelfInspTop.monthName}}">进行中</text>
<image src="../../images/work/map.png" mode=""/> <image src="../../images/work/map.png" mode=""/>
</view> </view>
</view> </view>

14
subpages/searchResult/pages/punchCard/punchCard.js

@ -23,6 +23,7 @@ Page({
address:'', address:'',
longitude:'', longitude:'',
latitude:'', latitude:'',
agencyLevel: ''
}, },
/** /**
@ -43,6 +44,9 @@ Page({
key: 'CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ' key: 'CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ'
}) })
this.reverseLocation() this.reverseLocation()
this.setData({
agencyLevel: app.globalData.user.level
})
}, },
updateTime() { updateTime() {
let date = new Date(); let date = new Date();
@ -106,10 +110,18 @@ Page({
}, },
toWebView(){ toWebView(){
console.log(app.globalData); console.log(app.globalData);
if(app.globalData.questionnaireUrl) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/webView/webView?url=' + app.globalData.questionnaireUrl, url: '/pages/webView/webView?url=' + app.globalData.questionnaireUrl,
}) })
}, } else {
wx.showToast({
icon: "none",
title: '未创建满意度调查问卷',
})
}
},
toEvent(){ toEvent(){
let obj ={ let obj ={
resiId : this.data.resiId, resiId : this.data.resiId,

2
subpages/searchResult/pages/punchCard/punchCard.wxml

@ -41,6 +41,6 @@
<view class="card"> <view class="card">
<view class="title">相关操作</view> <view class="title">相关操作</view>
<view class="blue btn" bind:tap="toAddResi" style="margin-top: 40rpx ; ">修改居民信息</view> <view class="blue btn" bind:tap="toAddResi" style="margin-top: 40rpx ; ">修改居民信息</view>
<view class="yellow btn" bind:tap="toWebView">满意度调查</view> <view class="yellow btn" bind:tap="toWebView" wx:if="{{agencyLevel!=='street'}}">满意度调查</view>
<view class="green btn" bind:tap="toEvent">上报居民诉求</view> <view class="green btn" bind:tap="toEvent">上报居民诉求</view>
</view> </view>
Loading…
Cancel
Save