Browse Source

bug调整

data-xiaowang-bug
mk 1 year ago
parent
commit
d35cfc71bc
  1. 9
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.js
  2. 53
      subpages/securityCheck/pages/securityCheck.js
  3. 22
      subpages/securityCheck/pages/securityCheck.wxml

9
subpages/safetyinspection/pages/safetyinspection/safetyinspection.js

@ -351,14 +351,7 @@ handelClickSave(){
}
});
// let checkbox = this.data.checkboxOptions.map(item => {
// // item.hazardStatus = 0;
// // return item;
// if (item.hazardStatus = 0) {
// return
// }
// });
// console.log(checkbox)
if(this.data.checkResultFlag == 0 && !hasHazardStatus1 && this.data.addHiddenDangeList.length<1){
console.log("1111",hasHazardStatus1)
wx.showToast({

53
subpages/securityCheck/pages/securityCheck.js

@ -20,7 +20,6 @@ Page({
},
onLoad(options) {
this.getList()
},
handleTap() {
@ -32,7 +31,6 @@ Page({
onScrollToLower(e){
console.log('gundaodi')
if (this.data.loadMoreType === 'more') {
this.setData({
loadMoreVisible: true,
@ -46,42 +44,55 @@ onScrollToLower(e){
loadMoreVisible: true,
nodata: false,
loadMoreType: "more",
})
});
securityCheckk({
pageNo: this.data.pageNo,
pageSize: this.data.pageSize,
checkResultFlag: this.data.checkResultFlag
}).then(({ data }) => {
// this.setData({
// marsi: data.list,
// total: data.total
// })
// this.memem();
this.setData({
loadMoreType: data.list.length === this.data.pageSize ? 'more' : 'none',
flag0Array: this.data.flag0Array.concat(data.list).filter(item => item.checkResultFlag === 0 || item.checkResultFlag == null),
flag1Array: this.data.flag1Array.concat(data.list).filter(item => item.checkResultFlag === 1)
})
if (this.data.flag0Array.length == 0) {
data.list.forEach(item => {
if (item.hiddenDangeList) {
if (item.hiddenDangeList.findIndex(itemC => itemC.hazardStatus === 2) === -1) {
item.status = true;
item.hiddenDangeList0 = item.hiddenDangeList.filter(itemC => itemC.hazardStatus === 0);
item.hiddenDangeList1 = item.hiddenDangeList.filter(itemC => itemC.hazardStatus === 1);
} else {
item.status = false;
item.hiddenDangeList0 = item.hiddenDangeList.filter(itemC => itemC.hazardStatus === 0);
item.hiddenDangeList2 = item.hiddenDangeList.filter(itemC => itemC.hazardStatus === 2);
}
}
});
console.log(data.list);
if (this.data.flag0Array.length === 0) {
this.setData({
loadMoreVisible: false,
nodata: true
})
});
}
if (this.data.flag1Array.length == 0) {
if (this.data.flag1Array.length === 0) {
this.setData({
loadMoreVisible: false,
nodata: true
})
});
}
this.setData({
loadMoreType: data.list.length === this.data.pageSize ? 'more' : 'none',
flag0Array: this.data.flag0Array.concat(data.list.filter(item => item.checkResultFlag === 0 || item.checkResultFlag == null)),
flag1Array: this.data.flag1Array.concat(data.list.filter(item => item.checkResultFlag === 1)),
});
}).catch(err => {
console.log(err);
this.setData({
loadMoreVisible: false,
nodata: true,
})
})
});
});
},
memem() {
this.setData({
flag0Array: this.data.marsi.filter(item => item.checkResultFlag === 0 || item.checkResultFlag == null),
@ -132,6 +143,10 @@ onScrollToLower(e){
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
flag0Array:[],
flag1Array:[]
})
this.getList()
},

22
subpages/securityCheck/pages/securityCheck.wxml

@ -17,8 +17,20 @@
<view class="title">{{item.name}}</view>
<view class="title_mall">检查时间: {{item.orderDate}}</view>
<view class="title_mall">检查人员: {{item.checkPersons}}</view>
<view class="title_mall">隐患明细:</view>
<view class="title_mall" wx:for="{{item.hiddenDangeList}}" wx:key="index">{{item.hazardDesc}}</view>
<view class="title_mall">{{item.status?'未整改隐患':'隐患明细'}}:
<text wx:for="{{item.hiddenDangeList0}}" wx:key="index">{{index+1}}.{{item.hazardDesc}}</text>
</view>
<view wx:if="{{!item.status}}">
<view class="title_mall" wx:for="{{item.hiddenDangeList2}}" wx:key="index">
整改要求:{{item.hazardDesc}}
</view>
</view>
<view wx:if="{{item.status && item.hiddenDangeList1.length != 0}}">
<view class="title_mall" >
已整改隐患:<text wx:for="{{item.hiddenDangeList1}}" wx:key="indexC" wx:for-index='indexC'>{{indexC+1}}.{{item.hazardDesc}} </text>
</view>
</view>
<text wx:else class="title_mall">已整改隐患:--</text>
<view class="title_mall">拟复查时间: {{item.reviewTime}}</view>
</view>
</view>
@ -36,9 +48,9 @@
<view class="title">{{item.name}}</view>
<view class="title_mall">检查时间: {{item.orderDate}}</view>
<view class="title_mall">检查人员: {{item.checkPersons}}</view>
<view class="title_mall">隐患明细:</view>
<view class="title_mall" wx:for="{{item.hiddenDangeList}}" wx:key="index">{{item.hazardDesc}}</view>
<view class="title_mall">拟复查时间: {{item.reviewTime}}</view>
<view class="title_mall">检查结论: 合格</view>
<view class="title_mall">合格时间: {{item.reviewTime}}</view>
</view>
</view>
<movable-area class="movable-area">

Loading…
Cancel
Save