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({ let structs = await models.Project.findAll({
where: {}, where: {},
attributes: ['id', 'name',], attributes: ['id', 'name','type'],
order: [['id', 'asc']], order: [['id', 'asc']],
include: [{ include: [{
model: models.Point, model: models.Point,
@ -408,6 +408,7 @@ async function getStructuresUsers(ctx, next) {
rslt.push({ rslt.push({
id: s.id, id: s.id,
name: s.name, name: s.name,
type:s.type,
points: s.points, 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 } }) 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 () { onShow () {
const userInfo = wx.getStorageSync('userInfo');
Request.get(getStructuresUsers(), {}).then(res => { Request.get(getStructuresUsers(), {}).then(res => {
this.setData({ this.setData({
structList: res structList:userInfo?.username==='SuperAdmin'?res:
userInfo?.role?.includes('管理')?res.filter(item=>item.type==='管廊'):res
}) })
}) })
this.getData({ }) this.getData({ })

6
weapp/package/troubleshooting/index.wxml

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

2
weapp/package/troubleshooting/shootingForm/index.js

@ -342,7 +342,7 @@ Page({
checkDesc, cost, checkImgs checkDesc, cost, checkImgs
} = this.data } = this.data
let nextState = '' let nextState = ''
let confirmData = {} let confirmData = state===1?{ createTime:moment()}:{}//解决小程序端创建计划没有任务下发时间问题
let successMsg = '' let successMsg = ''
if (state == 1 || state == 3) { if (state == 1 || state == 3) {
nextState = 2 nextState = 2

Loading…
Cancel
Save