Browse Source

feat:fix bugs

master
zhaobing 10 months ago
parent
commit
55022bbb12
  1. 3
      api/app/lib/controllers/organization/user.js
  2. 4
      weapp/package/troubleshooting/index.js
  3. 6
      weapp/package/troubleshooting/index.wxml
  4. 2
      weapp/package/troubleshooting/shootingForm/index.js

3
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 } })
});

4
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({ })

6
weapp/package/troubleshooting/index.wxml

@ -36,7 +36,7 @@
<!-- </van-checkbox-group> -->
</view>
</van-dropdown-item>
<van-dropdown-item title="{{ '任务下发时间' }}" bind:close="onDropDownClose">
<van-dropdown-item title="{{ '时间' }}" bind:close="onDropDownClose">
<view style="max-height:60%; display:flex" class="time-option">
<van-datetime-picker show-toolbar="{{false}}" type="date" value="{{ startTime }}" bind:input="onStartTimeChange" min-date="{{1640966400000}}"/>
<view style="display:flex; align-items:center">至</view>
@ -45,8 +45,8 @@
</van-dropdown-item>
</van-dropdown-menu>
</view>
<view wx:if="{{willVis}}" style="height:100vh - 98rpx; overflow:auto; padding: 0rpx 30rpx 20rpx">
<view wx:for="{{willdoneList}}" class="mission-card">
<view wx:if="{{willVis}}" style="height:100vh - 98rpx; overflow:auto; padding: 0rpx 30rpx 20rpx">
<view wx:for="{{willdoneList}}" wx:key='index' class="mission-card">
<view class="mission-card-title">
<image class="icon" src="../../images/title_icon.svg"></image>
<view class="title">{{item.PatrolRecord.points.project.name}}</view>

2
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

Loading…
Cancel
Save