diff --git a/api/app/lib/controllers/patrolManage/patrolRecord.js b/api/app/lib/controllers/patrolManage/patrolRecord.js index bc763b4..8436da0 100644 --- a/api/app/lib/controllers/patrolManage/patrolRecord.js +++ b/api/app/lib/controllers/patrolManage/patrolRecord.js @@ -308,8 +308,14 @@ async function getPatrolRecordIssueHandle(ctx) { model: models.PatrolRecord, where: { - } + }, + include:[{ + model:models.Project, + attributes:['type'] }] + }, + + ] } if (pointId) { diff --git a/weapp/package/troubleshooting/index.js b/weapp/package/troubleshooting/index.js index b03fc86..dd5a407 100644 --- a/weapp/package/troubleshooting/index.js +++ b/weapp/package/troubleshooting/index.js @@ -54,13 +54,15 @@ Page({ }, getData (params) { + const userInfo = wx.getStorageSync('userInfo'); //已办 Request.get(getPatrolRecordIssueHandle(), { ...params,type:'haveDone',wx:true }).then(res => { + const rslt=userInfo?.role?.includes('管理')?res.filter(item=>item?.project?.type==='管廊'):res this.setData({ - doneLength:res.length, - dataList: res.map(r => { + doneLength:rslt.length, + dataList: rslt.map(r => { return { ...r, key:r.id, @@ -73,9 +75,10 @@ Page({ Request.get(getPatrolRecordIssueHandle(), { ...params,type:'backlog',wx:true }).then(res => { + const rslt=userInfo?.role?.includes('管理')?res.filter(item=>item?.project?.type==='管廊'):res this.setData({ - willLength:res.length, - willdoneList: res.map(r => { + willLength:rslt.length, + willdoneList: rslt.map(r => { return { key:r.id, ...r,