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){ if(this.data.checkResultFlag == 0 && !hasHazardStatus1 && this.data.addHiddenDangeList.length<1){
console.log("1111",hasHazardStatus1) console.log("1111",hasHazardStatus1)
wx.showToast({ wx.showToast({

53
subpages/securityCheck/pages/securityCheck.js

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

22
subpages/securityCheck/pages/securityCheck.wxml

@ -17,8 +17,20 @@
<view class="title">{{item.name}}</view> <view class="title">{{item.name}}</view>
<view class="title_mall">检查时间: {{item.orderDate}}</view> <view class="title_mall">检查时间: {{item.orderDate}}</view>
<view class="title_mall">检查人员: {{item.checkPersons}}</view> <view class="title_mall">检查人员: {{item.checkPersons}}</view>
<view class="title_mall">隐患明细:</view> <view class="title_mall">{{item.status?'未整改隐患':'隐患明细'}}:
<view class="title_mall" wx:for="{{item.hiddenDangeList}}" wx:key="index">{{item.hazardDesc}}</view> <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 class="title_mall">拟复查时间: {{item.reviewTime}}</view>
</view> </view>
</view> </view>
@ -36,9 +48,9 @@
<view class="title">{{item.name}}</view> <view class="title">{{item.name}}</view>
<view class="title_mall">检查时间: {{item.orderDate}}</view> <view class="title_mall">检查时间: {{item.orderDate}}</view>
<view class="title_mall">检查人员: {{item.checkPersons}}</view> <view class="title_mall">检查人员: {{item.checkPersons}}</view>
<view class="title_mall">隐患明细:</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">合格时间: {{item.reviewTime}}</view>
</view> </view>
</view> </view>
<movable-area class="movable-area"> <movable-area class="movable-area">

Loading…
Cancel
Save