Browse Source

feat:fix bugs

master
zhaobing 1 year ago
parent
commit
19868332ee
  1. 10
      api/app/lib/controllers/patrolManage/patrolRecord.js
  2. 4
      weapp/package/troubleshooting/index.js
  3. 2
      weapp/package/troubleshooting/index.wxml

10
api/app/lib/controllers/patrolManage/patrolRecord.js

@ -298,7 +298,7 @@ async function getPatrolRecordIssueHandle(ctx) {
const { models } = ctx.fs.dc;
const { userId, userInfo } = ctx.fs.api
const { type, pointId, startTime, endTime } = ctx.query
const { type, pointId, startTime, endTime,wx } = ctx.query
let findOption = {
where: {
@ -311,7 +311,7 @@ async function getPatrolRecordIssueHandle(ctx) {
}
}]
}
if (pointId) {
findOption.include[0].where.pointId = { $in: pointId.split(',') }
}
@ -319,6 +319,12 @@ async function getPatrolRecordIssueHandle(ctx) {
findOption.where.createTime = {
$between: [moment(parseInt(startTime)).format(), moment(parseInt(endTime)).format()]
}
//小程序问题处理界面根据巡检记录筛选时间
if(wx==='true'){
findOption.include[0].where.inspectionTime={
$between: [moment(parseInt(startTime)).format('YYYY-MM-DD HH:mm:ss'), moment(parseInt(endTime)).format('YYYY-MM-DD HH:mm:ss')]
}
}
}
let isSuperA = userInfo.username == 'SuperAdmin'

4
weapp/package/troubleshooting/index.js

@ -56,7 +56,7 @@ Page({
getData (params) {
//已办
Request.get(getPatrolRecordIssueHandle(), {
...params,type:'haveDone'
...params,type:'haveDone',wx:true
}).then(res => {
this.setData({
doneLength:res.length,
@ -71,7 +71,7 @@ Page({
})
//待办
Request.get(getPatrolRecordIssueHandle(), {
...params,type:'backlog'
...params,type:'backlog',wx:true
}).then(res => {
this.setData({
willLength:res.length,

2
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>

Loading…
Cancel
Save