From 55022bbb121dc55fce5c4033c8334521eb6d5148 Mon Sep 17 00:00:00 2001 From: zhaobing Date: Tue, 2 Jan 2024 10:37:41 +0800 Subject: [PATCH] feat:fix bugs --- api/app/lib/controllers/organization/user.js | 3 ++- weapp/package/troubleshooting/index.js | 4 +++- weapp/package/troubleshooting/index.wxml | 6 +++--- weapp/package/troubleshooting/shootingForm/index.js | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/api/app/lib/controllers/organization/user.js b/api/app/lib/controllers/organization/user.js index 673e279..cd56d2d 100644 --- a/api/app/lib/controllers/organization/user.js +++ b/api/app/lib/controllers/organization/user.js @@ -396,7 +396,7 @@ async function getStructuresUsers(ctx, next) { let structs = await models.Project.findAll({ where: {}, - attributes: ['id', 'name',], + attributes: ['id', 'name','type'], order: [['id', 'asc']], include: [{ model: models.Point, @@ -408,6 +408,7 @@ async function getStructuresUsers(ctx, next) { rslt.push({ id: s.id, name: s.name, + type:s.type, points: s.points, users: userRes.filter(x => x.structure && x.structure.find(v => v == s.id)).map(d => { return { id: d.id, name: d.name, department: d.department } }) }); diff --git a/weapp/package/troubleshooting/index.js b/weapp/package/troubleshooting/index.js index 53b3522..fe146a8 100644 --- a/weapp/package/troubleshooting/index.js +++ b/weapp/package/troubleshooting/index.js @@ -264,9 +264,11 @@ Page({ * 生命周期函数--监听页面显示 */ onShow () { + const userInfo = wx.getStorageSync('userInfo'); Request.get(getStructuresUsers(), {}).then(res => { this.setData({ - structList: res + structList:userInfo?.username==='SuperAdmin'?res: + userInfo?.role?.includes('管理')?res.filter(item=>item.type==='管廊'):res }) }) this.getData({ }) diff --git a/weapp/package/troubleshooting/index.wxml b/weapp/package/troubleshooting/index.wxml index b82da53..5839841 100644 --- a/weapp/package/troubleshooting/index.wxml +++ b/weapp/package/troubleshooting/index.wxml @@ -36,7 +36,7 @@ - + @@ -45,8 +45,8 @@ - - + + {{item.PatrolRecord.points.project.name}} diff --git a/weapp/package/troubleshooting/shootingForm/index.js b/weapp/package/troubleshooting/shootingForm/index.js index 3d3bc66..66ba419 100644 --- a/weapp/package/troubleshooting/shootingForm/index.js +++ b/weapp/package/troubleshooting/shootingForm/index.js @@ -342,7 +342,7 @@ Page({ checkDesc, cost, checkImgs } = this.data let nextState = '' - let confirmData = {} + let confirmData = state===1?{ createTime:moment()}:{}//解决小程序端创建计划没有任务下发时间问题 let successMsg = '' if (state == 1 || state == 3) { nextState = 2