Browse Source

feat:fix bugs

master
sundalingg 10 months ago
parent
commit
a9c08bf907
  1. 25
      weapp/package/troubleshooting/index.js
  2. 56
      weapp/package/troubleshooting/index.wxml
  3. 2
      weapp/pages/workbench/workbench.js

25
weapp/package/troubleshooting/index.js

@ -15,6 +15,7 @@ Page({
// //
isEdit:false,//管理端控制不可编辑 isEdit:false,//管理端控制不可编辑
dataList: [], dataList: [],
willdoneList:[],
currentTab: 0, currentTab: 0,
// 筛选选择 // 筛选选择
structList: [], structList: [],
@ -26,6 +27,8 @@ Page({
endTime: '', endTime: '',
doneLength:0, doneLength:0,
willLength:0, willLength:0,
// doneVis:false,
willVis:true,
// //
timeSelectedUnrealFlag: true, timeSelectedUnrealFlag: true,
powerCheckDetail: false powerCheckDetail: false
@ -33,20 +36,25 @@ Page({
// 顶部tab切换 // 顶部tab切换
clickTab (e) { clickTab (e) {
// console.log('e.detail.name',e.detail.name)
this.setData({ this.setData({
currentTab: e.detail.name currentTab: e.detail.name,
// doneVis:e.detail.name==='待办事项'?true:false,
willVis:e.detail.name===0?true:false
}) })
this.setData({ this.setData({
page: 0, page: 0,
dataList: [] dataList: [],
willdoneList:[]
}, () => { }, () => {
this.getData({ this.getData({
type: e.detail.name === 0 ? 'backlog' : 'haveDone' // type: e.detail.name === 0 ? 'backlog' : 'haveDone'
}); });
}) })
}, },
getData (params) { getData (params) {
//已办
Request.get(getPatrolRecordIssueHandle(), { Request.get(getPatrolRecordIssueHandle(), {
...params,type:'haveDone' ...params,type:'haveDone'
}).then(res => { }).then(res => {
@ -55,18 +63,21 @@ Page({
dataList: res.map(r => { dataList: res.map(r => {
return { return {
...r, ...r,
key:r.id,
createTime: r.createTime ? moment(r.createTime).format('YYYY-MM-DD HH:mm:ss') : '--' createTime: r.createTime ? moment(r.createTime).format('YYYY-MM-DD HH:mm:ss') : '--'
} }
}) })
}) })
}) })
//待办
Request.get(getPatrolRecordIssueHandle(), { Request.get(getPatrolRecordIssueHandle(), {
...params,type:'backlog' ...params,type:'backlog'
}).then(res => { }).then(res => {
this.setData({ this.setData({
willLength:res.length, willLength:res.length,
dataList: res.map(r => { willdoneList: res.map(r => {
return { return {
key:r.id,
...r, ...r,
createTime: r.createTime ? moment(r.createTime).format('YYYY-MM-DD HH:mm:ss') : '--' createTime: r.createTime ? moment(r.createTime).format('YYYY-MM-DD HH:mm:ss') : '--'
} }
@ -226,10 +237,14 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad (options) { onLoad (options) {
if(options?.home){
wx.setNavigationBarTitle({
title: '维修台账',
});
}
// this.getCount() // this.getCount()
const userInfo = wx.getStorageSync('userInfo'); const userInfo = wx.getStorageSync('userInfo');
let bool=false let bool=false
console.log('userInfo',userInfo)
if(userInfo?.role.includes('管理')){ if(userInfo?.role.includes('管理')){
bool=true bool=true
} }

56
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,7 +45,59 @@
</van-dropdown-item> </van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</view> </view>
<view 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 class="mission-card-title">
<image class="icon" src="../../images/title_icon.svg"></image>
<view class="title">{{item.PatrolRecord.points.project.name}}</view>
</view>
<view style="width: 630rpx; margin: 0 auto;">
<text class="text-key">点位名称:</text><text class="text-value">{{item.PatrolRecord.points.itemData.name}}</text>
</view>
<view style="width: 630rpx; margin: 8px auto 0;">
<text class="text-key">异常等级:</text><text class="text-value">{{item.PatrolRecord.points.itemData.name}}</text>
</view>
<view style="width: 630rpx; margin: 8px auto 0;">
<text class="text-key">任务下发时间:</text><text class="text-value">{{item.createTime}}</text>
</view>
<view class="divider"></view>
<van-button disabled="{{isEdit}}" class="btn" wx:if="{{powerCheckDetail || currentTab == 0}}" size="small" type="info" round bind:click="toShootingForm" data-shootingid="{{item.id}}">
{{
currentTab == 0?
item.state == 1 ?'制定计划':
item.state == 2 ?'审批计划':
item.state == 3 ?'修改计划':
item.state == 4 ?'维修处理':
item.state == 5 ?'质检验收':
item.state == 6 ?'查看详情':'驳回重修'
:
item.state == 1 ?'制定计划':
item.state == 2 ?'计划已提交待审批':
item.state == 3 ?'计划审批驳回':
item.state == 4 ?'计划审批通过待维修':
item.state == 5 ?'维修完成待验收':
item.state == 6 ?'验收通过':'驳回重修'
}}
</van-button>
<van-button class="btn" wx:elif="{{!powerCheckDetail}}" size="small" type="info" round disabled>
{{
item.state == 1 ?'制定计划':
item.state == 2 ?'计划已提交待审批':
item.state == 3 ?'计划审批驳回':
item.state == 4 ?'计划审批通过待维修':
item.state == 5 ?'维修完成待验收':
item.state == 6 ?'验收通过':'驳回重修'
}}
</van-button>
</view>
<view style="height:128rpx"/>
<!-- 暂无数据 -->
<view wx:if="{{!willdoneList.length}}">
<image class="noData" src="../../images/noData.png"></image>
<view class="noTxt">暂无数据~</view>
</view>
</view>
<view wx:else style="height:100vh - 98rpx; overflow:auto; padding: 0rpx 30rpx 20rpx">
<view wx:for="{{dataList}}" class="mission-card"> <view wx:for="{{dataList}}" 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>

2
weapp/pages/workbench/workbench.js

@ -44,7 +44,7 @@ Page({
{ {
iconPath: '/images/workbench/issues.png', iconPath: '/images/workbench/issues.png',
text: '维修台账', text: '维修台账',
page: '/package/troubleshooting/index' page: '/package/troubleshooting/index?home=true'
} }
] ]
}, },

Loading…
Cancel
Save