diff --git a/components/custom-tab-bar/index.js b/components/custom-tab-bar/index.js index 6052f25..b21e30c 100644 --- a/components/custom-tab-bar/index.js +++ b/components/custom-tab-bar/index.js @@ -53,6 +53,7 @@ Component({ getStaffbasicinfo().then(res=>{ getOwnedRolesOfStaffId(res.data.id).then(res2 => { + app.globalData.user = res.data this.setData({ "list[2].show": res2.data.filter(item => item.roleKey === 'secretary').length > 0 }) diff --git a/pages/work/work.js b/pages/work/work.js index d0268e5..67629e0 100644 --- a/pages/work/work.js +++ b/pages/work/work.js @@ -13,7 +13,9 @@ Page({ communitySelfInspList:[], communitySelfInspTop:{}, - questionnaireUrl:'' + questionnaireUrl:'', + agencyLevel: '', + curMonth: '' }, /** @@ -25,8 +27,8 @@ Page({ navigationHeight: app.globalData.deviceInfo.navigationHeight, share:app.globalData.share, agencyName:app.globalData.user.agencyName, + agencyLevel: app.globalData.user.level }) - this.getSituation() this.getInspRecord() }, @@ -57,10 +59,16 @@ Page({ } getInspRecord(parm).then(res=>{ 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({ - communitySelfInspTop:res.data.list.splice(0,1)[0], - communitySelfInspList:res.data.list.splice(0,2), + communitySelfInspTop,communitySelfInspList,curMonth }) + // this.setData({ + // communitySelfInspTop:res.data.list.splice(0,1)[0], + // communitySelfInspList:res.data.list.splice(0,2), + // }) app.globalData.questionnaireUrl = this.data.communitySelfInspTop.questionnaireUrl }).catch(err=>{ wx.hideLoading() diff --git a/pages/work/work.wxml b/pages/work/work.wxml index 80be371..1979d3b 100644 --- a/pages/work/work.wxml +++ b/pages/work/work.wxml @@ -60,7 +60,7 @@ - + 满意度自查 历史自查 > @@ -68,15 +68,23 @@ + {{communitySelfInspTop.agencyName}}{{communitySelfInspTop.monthName}}月份满意度自查 已提交 {{communitySelfInspTop.personQty?communitySelfInspTop.personQty:'--'}} - 查看统计 + + + 查看统计 + + + 未创建{{curMonth}}月份满意度自查 + + - 进行中 + 进行中 diff --git a/subpages/searchResult/pages/punchCard/punchCard.js b/subpages/searchResult/pages/punchCard/punchCard.js index 1196ed1..98dcc2d 100644 --- a/subpages/searchResult/pages/punchCard/punchCard.js +++ b/subpages/searchResult/pages/punchCard/punchCard.js @@ -23,6 +23,7 @@ Page({ address:'', longitude:'', latitude:'', + agencyLevel: '' }, /** @@ -43,6 +44,9 @@ Page({ key: 'CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ' }) this.reverseLocation() + this.setData({ + agencyLevel: app.globalData.user.level + }) }, updateTime() { let date = new Date(); @@ -106,10 +110,18 @@ Page({ }, toWebView(){ console.log(app.globalData); + if(app.globalData.questionnaireUrl) { + wx.navigateTo({ url: '/pages/webView/webView?url=' + app.globalData.questionnaireUrl, }) - }, + } else { + wx.showToast({ + icon: "none", + title: '未创建满意度调查问卷', + }) + } + }, toEvent(){ let obj ={ resiId : this.data.resiId, diff --git a/subpages/searchResult/pages/punchCard/punchCard.wxml b/subpages/searchResult/pages/punchCard/punchCard.wxml index 8bbe096..f1a51f3 100644 --- a/subpages/searchResult/pages/punchCard/punchCard.wxml +++ b/subpages/searchResult/pages/punchCard/punchCard.wxml @@ -41,6 +41,6 @@ 相关操作 修改居民信息 - 满意度调查 + 满意度调查 上报居民诉求 \ No newline at end of file