| | |
| | | userRealName: '', |
| | | |
| | | //历史评分详情 |
| | | assessmentCompleted: false, |
| | | historyPoint: { |
| | | time: '测评周期----年--月', |
| | | score: '--', |
| | |
| | | period: '' |
| | | }, |
| | | //台账完成情况 |
| | | ledgerInfo: { |
| | | ledgerCompleted: false, |
| | | monthInfo: { |
| | | //必填项总数 |
| | | totalMust: 0, |
| | | //必填项提交数 |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad: function (options) { |
| | | //判断用户是否为首次登录,决定是否强制修改默认密码 |
| | | if (app.globalData.userInfo.remark == null || app.globalData.userInfo.remark == '') { |
| | | wx.navigateTo({ |
| | | url: '/pages/mUser/pChangepw/pChangepw', |
| | | }) |
| | | } |
| | | |
| | | wx.getStorage({ |
| | | key: 'accessToken', |
| | | success: (result) => { |
| | |
| | | this.getLedgerType() |
| | | }, |
| | | |
| | | onPullDownRefresh(){ |
| | | onShow() { |
| | | if (app.globalData.isLogin) { |
| | | |
| | | } |
| | | }, |
| | | |
| | | onPullDownRefresh() { |
| | | console.log('onPullDownRefresh'); |
| | | wx.stopPullDownRefresh({ |
| | | success: (res) => {}, |
| | | fail: (res) => {}, |
| | | complete: (res) => {}, |
| | | }) |
| | | this.getNextEvaluationTime() |
| | | this.getNotice() |
| | | this.getHistoryPoint() |
| | | this.getNews() |
| | | this.getCommitment() |
| | | this.getLedgerType() |
| | | }, |
| | | |
| | | getNextEvaluationTime() { |
| | |
| | | let lastOne = data[0] |
| | | let year = lastOne.updateDate.substring(0, 4) |
| | | let month = lastOne.updateDate.substring(5, 7) |
| | | const now = moment() |
| | | if (now.year() == year && now.month() + 1 == month) { |
| | | that.setData({ |
| | | assessmentCompleted: true |
| | | }) |
| | | } |
| | | that.setData({ |
| | | historyPoint: { |
| | | time: `测评周期${year}年${month}月`, |
| | | time: `最新一期 ${year}年${month}月`, |
| | | score: lastOne.totalPoint, |
| | | rank: lastOne.rank, |
| | | legalIndex: lastOne.level, |
| | |
| | | ledgerservice.getLedgerSummary(app.globalData.accessToken.userId, app.globalData.userInfo.extension2, time, { |
| | | success(res) { |
| | | that.parseLedgerType(res) |
| | | }, |
| | | complete() { |
| | | wx.stopPullDownRefresh({ |
| | | success: (res) => {}, |
| | | fail: (res) => {}, |
| | | complete: (res) => {}, |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | let monthInfo = { |
| | | totalMust: 0, |
| | | finishedMust: 0, |
| | | totalSelf: 0, |
| | | finishedSelf: 0 |
| | | } |
| | | subtypes.forEach(s => { |
| | | //月度统计 |
| | | if (s.needUpdate) { |
| | | monthInfo.totalMust++ |
| | | //统计自巡查类型的台账,类别为-1(暂定) |
| | | if (s.ledgerTypeId == -1) { |
| | | monthInfo.totalSelf++ |
| | | } |
| | | if (s.upLoad) { |
| | | monthInfo.finishedMust++ |
| | | if (s.ledgerTypeId == -1) { |
| | | monthInfo.finishedSelf++ |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | monthInfo.percent = Math.round(monthInfo.finishedMust / monthInfo.totalMust * 100) |
| | | monthInfo.percent = monthInfo.totalMust == 0 ? 0 : Math.round(monthInfo.finishedMust / monthInfo.totalMust * 100) |
| | | monthInfo.percent2 = monthInfo.totalSelf == 0 ? 0 : Math.round(monthInfo.finishedSelf / monthInfo.totalSelf * 100) |
| | | |
| | | this.setData({monthInfo}) |
| | | this.setData({ |
| | | monthInfo, |
| | | ledgerCompleted: monthInfo.percent >= 100 && monthInfo.percent2 >= 100, |
| | | // ledgerCompleted: true |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | |
| | | switch (index) { |
| | | case "0": |
| | | //测评历史记录 |
| | | url = `/pages/gradereport/gradereport?period=${this.data.historyPoint.period}` |
| | | if (this.data.historyPoint.period == '') { |
| | | url = `/pages/mAssessment/grade/grade` |
| | | } else { |
| | | url = `/pages/mAssessment/gradereport/gradereport?period=${this.data.historyPoint.period}` |
| | | } |
| | | break; |
| | | case "5": |
| | | wx.switchTab({ |
| | | url: '/pages/module_ledger/ledgerhome/ledgerhome', |
| | | url: '/pages/mLedger/ledgerhome/ledgerhome', |
| | | }) |
| | | return; |
| | | case "6": |
| | | wx.switchTab({ |
| | | url: '/pages/promise/promise', |
| | | url: '/pages/mPromise/promisehome/promise', |
| | | }) |
| | | break; |
| | | return; |
| | | case "1": |
| | | //工作提醒 |
| | | url = "/pages/notice/notice" |
| | | url = "/pages/mNotice/notice/notice" |
| | | break; |
| | | case "2": |
| | | //智能在线咨询 |
| | | url = "/pages/module_consult/consulthome/consulthome" |
| | | url = "/pages/mConsult/consulthome/consulthome" |
| | | break; |
| | | case "3": |
| | | //在线守法学习 |
| | | url = `/pages/learn/learn` |
| | | url = `/pages/mLearn/learn/learn` |
| | | break; |
| | | case "4": |
| | | //守法动态 |
| | |
| | | let bodyUrl = e.currentTarget.dataset.url |
| | | let fileType = e.currentTarget.dataset.filetype |
| | | wx.showLoading({ |
| | | title: ' 文件下载中', |
| | | title: ' 加载中', |
| | | mask: true, |
| | | }) |
| | | wx.downloadFile({ |
| | |
| | | }) |
| | | } |
| | | }) |
| | | break; |
| | | return; |
| | | } |
| | | if (url != "") { |
| | | wx.navigateTo({ |