Browse Source

安检巡查bug

data-page-V4.3.1
mk 1 year ago
parent
commit
31cf5807cc
  1. 65
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.js
  2. 19
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml
  3. 98
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.js
  4. 78
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml
  5. 5
      subpages/securityCheck/pages/securityCheck.js
  6. 4
      subpages/securityCheck/pages/securityCheck.wxml
  7. 27
      utils/index.js

65
subpages/InspectionReport/pages/InspectionReport/InspectionReport.js

@ -18,7 +18,6 @@ Page({
data: { data: {
showtime:false, showtime:false,
checkboxOptions:[], checkboxOptions:[],
checkboxOptionsnumber:0,
hiddenDangeList: [], hiddenDangeList: [],
newObj:[], newObj:[],
addRecord: [], addRecord: [],
@ -67,7 +66,8 @@ Page({
newContent:'', newContent:'',
currentDate: new Date().getTime(), currentDate: new Date().getTime(),
minDate: new Date(2020, 0, 1).getTime(), minDate: new Date(2020, 0, 1).getTime(),
maxDate: new Date(2030, 11, 31).getTime() maxDate: new Date(2030, 11, 31).getTime(),
checkboxValue:[]
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
@ -90,25 +90,21 @@ Page({
}, },
showRecordData() { showRecordData() {
console.log(this.data.companyId) this.setData({
checkboxOptions:null
})
let parm = { let parm = {
id: this.data.companyId id: this.data.companyId
} }
showRecord(parm).then(res => { showRecord(parm).then(res => {
console.log(res)
if(res.data[0].hiddenDangeList){ if(res.data[0].hiddenDangeList){
let checkboxOptions = res.data[0].hiddenDangeList.filter(item=>item.hazardStatus === 0).map(item=>({hazardDesc:item.hazardDesc,hazardStatus:0})); let checkboxOptions = res.data[0].hiddenDangeList.filter(item=>item.hazardStatus === 0).map(item=>({hazardDesc:item.hazardDesc,hazardStatus:0,id:item.id}));
let checkboxOptionsnumber=checkboxOptions.length+1;
console.log(checkboxOptionsnumber)
this.setData({ this.setData({
checkboxOptions, checkboxOptions,
checkboxOptionsnumber beforeFlag: res.data[0].checkResultFlag
}) })
console.log(this.data.checkboxOptions);
} }
this.setData({
showList:res.data
})
console.log(this.data.showList)
}) })
}, },
getCurrentDateTime() { getCurrentDateTime() {
@ -122,19 +118,6 @@ Page({
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}, },
submitBiao() { submitBiao() {
console.log("zhixingle")
console.log(this.data.newContent)
if (this.data.newContent) {
let newArr = this.data.addHiddenDangeList.concat({
hazardDesc: this.data.newContent,
hazardStatus: 0
});
console.log(newArr)
this.setData({
addHiddenDangeList: newArr,
});
}
if(!this.data.companyId){ if(!this.data.companyId){
wx.showToast({ wx.showToast({
title: '请选择企业', title: '请选择企业',
@ -163,30 +146,29 @@ Page({
}) })
return false return false
} }
console.log( this.data.addHiddenDangeList)
if(this.data.checkResultFlag == 0 && this.data.addHiddenDangeList.length<1){ if(this.data.checkResultFlag == 0 && this.data.checkboxValue.length<1&&!this.data.hazardDesc2){
wx.showToast({ wx.showToast({
title: '隐患明细最少输入一条', title: '隐患明细最少输入一条',
icon:'none' icon:'none'
}) })
return false return false
} }
const now = new Date(); this.data.checkboxOptions.forEach(item => {
const hours = now.getHours().toString().padStart(2, '0'); if(this.checkboxValue.findIndex(itemC=>itemC === item.value) == -1){
const minutes = now.getMinutes().toString().padStart(2, '0'); item.hazardStatus = '1';
const seconds = now.getSeconds().toString().padStart(2, '0'); }else{
let checkboxOptions =this.data.addHiddenDangeList.filter(item=>item.hazardStatus === 0).map(item=>({hazardDesc:item.hazardDesc,hazardStatus:2,requirements:this.data.hazardDesc2})); item.hazardStatus = '0';
this.setData({ }
addHiddenDangeList:checkboxOptions
}) })
console.log(this.data.addHiddenDangeList) console.log(this.data.checkboxValue);
console.log(this.data.checkboxOptions);
let form={ companyId: this.data.companyId, let form={ companyId: this.data.companyId,
checkTime: this.getCurrentDateTime(), checkTime: this.getCurrentDateTime(),
checkPersonsIdList: this.data.checkPersonsIdList, checkPersonsIdList: this.data.checkPersonsIdList,
checkResultFlag: this.data.checkResultFlag, checkResultFlag: this.data.checkResultFlag,
reviewTime:this.data.getData, reviewTime:this.data.getData,
hiddenDangeList:this.data.checkboxOptions.concat(this.data.addHiddenDangeList), hiddenDangeList:null,
attachmentUrls:this.data.uploadImageList.map(item=>({fileName:item.originFileName,attachmentUrl:item.ossUrl.url})), attachmentUrls:this.data.uploadImageList.map(item=>({fileName:item.originFileName,attachmentUrl:item.ossUrl.url})),
remark: '', remark: '',
reviewAddress:this.data.addressContent reviewAddress:this.data.addressContent
@ -277,13 +259,11 @@ Page({
*/ */
onShareAppMessage() {}, onShareAppMessage() {},
onChange(event) { onChange(event) {
console.log("111", event) console.log(event);
this.setData({ this.setData({
result: event.detail checkboxValue: event.detail
}); });
console.log(this.data.result); console.log(this.data.checkboxValue);
console.log(this.data.hiddenDangeList);
}, },
afterRead(event) { afterRead(event) {
const { const {
@ -402,7 +382,8 @@ Page({
// 更新当前选中的索引 // 更新当前选中的索引
this.setData({ this.setData({
gridNName: this.data.companyList[e.detail.value].name, gridNName: this.data.companyList[e.detail.value].name,
companyId:this.data.companyList[e.detail.value].id companyId:this.data.companyList[e.detail.value].id,
checkboxValue:[]
}); });
this.showRecordData() this.showRecordData()
}, },

19
subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml

@ -44,13 +44,16 @@
<view class="prosecutors"> <view class="prosecutors">
<text class="prosecutors_req" wx:if="{{checkResultFlag == 0}}">*</text> <text class="prosecutors_req" wx:if="{{checkResultFlag == 0}}">*</text>
<view class="conclusion1"> <view class="conclusion1">
<text class="prosecutors_pre">隐患明细</text> <text class="prosecutors_pre">{{beforeFlag == 1?'隐患明细':'未整改隐患'}}</text>
</view> </view>
</view> </view>
<view class="checkbox1"> <view class="checkbox1">
<van-checkbox-group value="{{checkboxValue}}" bind:change="onChange" wx:if="{{checkboxOptions}}" >
<van-checkbox custom-class="group" name="{{item.id}}" wx:for="{{checkboxOptions}}">{{index + 1}}. {{item.hazardDesc}}</van-checkbox>
</van-checkbox-group>
<view class="addHiddenDangeList"> <view class="addHiddenDangeList">
<text wx:for="{{addHiddenDangeList}}" wx:for-index="index" class="addHiddenDangeListText" <text wx:for="{{addHiddenDangeList}}" wx:for-index="index" class="addHiddenDangeListText"
wx:for-item="item">{{index+1}}.{{item.hazardDesc}}</text> wx:for-item="item"> {{item.hazardDesc}}</text>
</view> </view>
</view> </view>
<view class="input1"> <view class="input1">
@ -62,18 +65,14 @@
</view> --> </view> -->
</view> </view>
<view class="pitfall" wx:if="{{beforeFlag == 1}}">
<view class="pitfall">
<view class="prosecutors"> <view class="prosecutors">
<view class="requirement"> <text class="prosecutors_req">*</text>
<view class="conclusion1">
<text class="prosecutors_pre">整改要求</text> <text class="prosecutors_pre">整改要求</text>
</view> </view>
</view> </view>
<!-- <view class="checkbox1">
<van-checkbox-group value="{{ hazardDesc }}">
<van-checkbox name="hazardDesc">{{ hazardDesc }}</van-checkbox>
</van-checkbox-group>
</view> -->
<view class="input1"> <view class="input1">
<input bindinput="changeHazardDescStatus2" type="text" placeholder=" 请输入" value="{{ hazardDesc2 }}" /> <input bindinput="changeHazardDescStatus2" type="text" placeholder=" 请输入" value="{{ hazardDesc2 }}" />
</view> </view>

98
subpages/safetyinspection/pages/safetyinspection/safetyinspection.js

@ -4,15 +4,13 @@ const App = getApp()
import { import {
showRecord,addRecord,inspectionStaff,securityCheckk showRecord,addRecord,inspectionStaff,securityCheckk
} from "../../../../utils/api" } from "../../../../utils/api"
import {timestampToTime} from "../../../../utils/index"
const config = require('../../../../utils/config') const config = require('../../../../utils/config')
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
checkboxOptionsnumber:0,
orgid:'', orgid:'',
orgType:'', orgType:'',
pageNo:'1', pageNo:'1',
@ -21,7 +19,6 @@ Page({
imageUrls:[], imageUrls:[],
remark:'',//备注 remark:'',//备注
reviewTime:'', reviewTime:'',
checkResultFlag:'',
array: ['不合格', '合格'], // 选择器的数据源 array: ['不合格', '合格'], // 选择器的数据源
arrlist:[], arrlist:[],
fileList: [], fileList: [],
@ -37,21 +34,26 @@ Page({
uploadImageList: [],//图片上传的数组 uploadImageList: [],//图片上传的数组
imageId:1, imageId:1,
addHiddenDangeList:[], addHiddenDangeList:[],
currentDate:null, currentDate: new Date().getTime(),
minDate: new Date(2020, 0, 1).getTime(), minDate: new Date(2020, 0, 1).getTime(),
maxDate: new Date(2030, 11, 31).getTime(), maxDate: new Date(2030, 11, 31).getTime(),
showtime:false, showtime:false,
checkResultFlag:null,
checkResultFlagRouter:null,
hazardStatus2:null
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
if(options){
this.setData({ this.setData({
companyId: options.resiId, companyId: options.resiId,
orgid:App.globalData.user.agencyId orgid:App.globalData.user.agencyId,
checkResultFlagRouter:options.flag,
currentDateShow:timestampToTime(new Date().getTime(),1)
}) })
console.log(App.globalData) }
this.showRecordData() this.showRecordData()
this.toOinspectionStaff() this.toOinspectionStaff()
this.securityCheckk() this.securityCheckk()
@ -67,13 +69,9 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
// this.setData({
console.log(111111); // currentDate:this.getCurrentDateTime()
debugger // })
console.log(this.getCurrentDateTime());
this.setData({
currentDate:this.getCurrentDateTime()
})
}, },
/** /**
@ -118,7 +116,7 @@ Page({
}); });
}); });
}, },
showTime(){ handelShowTime(){
this.setData({ this.setData({
showtime:true showtime:true
}) })
@ -138,6 +136,14 @@ Page({
checkboxValue:event.detail, checkboxValue:event.detail,
}) })
}, },
handelConfirmDate(value){
this.setData({
showtime:false,
currentDateShow:timestampToTime(value.detail,1),
currentDate:value.detail
})
},
afterRead(event) { afterRead(event) {
const { const {
file file
@ -172,21 +178,34 @@ Page({
id: this.data.companyId id: this.data.companyId
} }
showRecord(parm).then(res => { showRecord(parm).then(res => {
console.log(res) res.data.forEach(item => {
if (item.hiddenDangeList) {
item.hiddenDangeList0 = [];
item.hiddenDangeList1 = [];
item.hiddenDangeList2 = [];
item.hiddenDangeList.forEach(itemC => {
if (itemC.hazardStatus === 0) {
item.hiddenDangeList0.push(itemC);
} else if (itemC.hazardStatus === 1) {
item.hiddenDangeList1.push(itemC);
}else if (itemC.hazardStatus === 2) {
item.hiddenDangeList2.push(itemC);
}
});
}
});
if(res.data[0].hiddenDangeList){ if(res.data[0].hiddenDangeList){
let checkboxOptions = res.data[0].hiddenDangeList.filter(item=>item.hazardStatus === 0).map(item=>({hazardDesc:item.hazardDesc,hazardStatus:1})); let checkboxOptions = res.data[0].hiddenDangeList.filter(item=>item.hazardStatus === 0).map(item=>({hazardDesc:item.hazardDesc,hazardStatus:1}));
let checkboxOptionsnumber=checkboxOptions.length+1;
console.log(checkboxOptionsnumber)
this.setData({ this.setData({
checkboxOptions, checkboxOptions,
checkboxOptionsnumber
}) })
} }
this.setData({ this.setData({
showList:res.data showList:res.data
}) })
console.log(this.data.checkboxOptions) console.log(this.data.checkboxOptions)
console.log(this.data.showList) console.log(this.data.showList,'seeeeee')
}) })
}, },
toOinspectionStaff(){ toOinspectionStaff(){
@ -247,8 +266,6 @@ Page({
this.setData({ this.setData({
newContent: e.detail.value newContent: e.detail.value
}); });
console.log('添加后的数组:', this.data.newContent);
console.log(this.data.checkboxOptions)
}, },
// 删除选中的图片 // 删除选中的图片
@ -262,6 +279,11 @@ Page({
uploadImageList: this.data.uploadImageList uploadImageList: this.data.uploadImageList
}) })
} }
},
changenewHazardStatus2(e){
this.setData({
hazardStatus2:e.detail.value
})
}, },
getCurrentDateTime() { getCurrentDateTime() {
const now = new Date(); const now = new Date();
@ -271,15 +293,10 @@ Page({
const hours = now.getHours().toString().padStart(2, '0'); const hours = now.getHours().toString().padStart(2, '0');
const minutes = now.getMinutes().toString().padStart(2, '0'); const minutes = now.getMinutes().toString().padStart(2, '0');
const seconds = now.getSeconds().toString().padStart(2, '0'); const seconds = now.getSeconds().toString().padStart(2, '0');
debugger
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}, },
handelClickSave(){ handelClickSave(){
console.log(this.data.checkboxOptions)
console.log(this.data.newContent)
console.log("zhixingle")
console.log(this.data.newContent)
if (this.data.newContent) { if (this.data.newContent) {
let newArr = this.data.addHiddenDangeList.concat({ let newArr = this.data.addHiddenDangeList.concat({
hazardDesc: this.data.newContent, hazardDesc: this.data.newContent,
@ -306,13 +323,20 @@ handelClickSave(){
}) })
return false return false
} }
if(this.data.checkResultFlag == 0 && !this.data.getData){ if(this.data.checkResultFlag == 0 && !this.data.currentDate){
wx.showToast({ wx.showToast({
title: '请选择拟复查时间', title: '请选择拟复查时间',
icon:'none' icon:'none'
}) })
return false return false
} }
if(this.data.checkResultFlagRouter == 1 && !this.data.hazardStatus2){
wx.showToast({
title: '请填写整改要求',
icon:'none'
})
return false
}
console.log(this.data.checkboxOptions) console.log(this.data.checkboxOptions)
let hasHazardStatus1 = false; let hasHazardStatus1 = false;
this.data.checkboxOptions.forEach(item => { this.data.checkboxOptions.forEach(item => {
@ -331,7 +355,6 @@ handelClickSave(){
// } // }
// }); // });
// console.log(checkbox) // console.log(checkbox)
console.log( "11",hasHazardStatus1)
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({
@ -344,26 +367,23 @@ if(this.data.checkResultFlag == 0 && !hasHazardStatus1 && this.data.addHiddenDan
const hours = now.getHours().toString().padStart(2, '0'); const hours = now.getHours().toString().padStart(2, '0');
const minutes = now.getMinutes().toString().padStart(2, '0'); const minutes = now.getMinutes().toString().padStart(2, '0');
const seconds = now.getSeconds().toString().padStart(2, '0'); const seconds = now.getSeconds().toString().padStart(2, '0');
console.log(this.data.checkboxOptions)
console.log(this.data.addHiddenDangeList)
let form = { let form = {
companyId:this.data.companyId, companyId:this.data.companyId,
checkTime:this.getCurrentDateTime(), checkTime:this.getCurrentDateTime(),
checkPersonsIdList:this.data.selectedOptions, checkPersonsIdList:this.data.selectedOptions,
checkResultFlag:this.data.checkResultFlag, checkResultFlag:this.data.checkResultFlag,
reviewTime:this.data.getData, reviewTime:this.data.checkResultFlag === '1'?null:timestampToTime(this.data.currentDate,1),
hiddenDangeList:this.data.checkboxOptions.concat(this.data.addHiddenDangeList), hiddenDangeList:this.data.checkboxOptions.concat(this.data.addHiddenDangeList),
attachmentUrls:this.data.uploadImageList.map(item=>({fileName:item.originFileName,attachmentUrl:item.ossUrl.url})), attachmentUrls:this.data.uploadImageList.map(item=>({fileName:item.originFileName,attachmentUrl:item.ossUrl.url})),
remark:this.data.remark, remark:this.data.remark,
address:"" address:""
} }
console.log(this.data.checkboxOptions) if(this.data.hazardStatus2){
console.log(this.data.addHiddenDangeList) form.hiddenDangeList.push({hazardDesc:this.data.hazardStatus2,hazardStatus:2})
console.log(this.data.hiddenDangeList)
if (!this.data.reviewTime) {
form.reviewTime=null
} }
console.log(this.data.checkboxOptions.concat(this.data.addHiddenDangeList)) this.setData({
newContent:null
})
addRecord(form).then(res => { addRecord(form).then(res => {
if(res.code == 0){ if(res.code == 0){
wx.showToast({ wx.showToast({

78
subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml

@ -13,12 +13,27 @@
</view></view> </view></view>
</view> </view>
<view class="prosecutors" >
<text class="prosecutors_req">*</text>
<view class="nes">
<view class="conclusion">
<text class="prosecutors_pre">检查结论</text>
<picker class="prosecutors_name" bindchange="pickerChange" value="{{checkResultFlag}}" range="{{array}}">
<view class="{{checkResultFlagName?'':'gray'}}">
{{checkResultFlagName?checkResultFlagName:'请选择'}}
</view>
</picker>
</view>
<view class="conclusion_right">
<image src="../../../../images/right.png" class="prosecutors_img"></image>
</view></view>
</view>
<view class="pitfall"> <view class="pitfall">
<view class="prosecutors" style="border-bottom: none;"> <view class="prosecutors" style="border-bottom: none;">
<view> <view>
<text class="prosecutors_req" wx:if="{{checkResultFlag == 0}}">*</text> <text class="prosecutors_req" wx:if="{{checkResultFlag == 0}}">*</text>
<text class="prosecutors_pre1">未整改隐患</text> <text class="prosecutors_pre1">{{checkResultFlagRouter === '1'?'隐患明细':'未整改隐患'}}</text>
</view> </view>
</view> </view>
<view class="checkbox1"> <view class="checkbox1">
@ -38,35 +53,26 @@
<text>再添加一条</text> <text>再添加一条</text>
</view> --> </view> -->
</view> </view>
<view class="prosecutors" > <view class="prosecutors" wx:if="{{checkResultFlagRouter == 1}}">
<text class="prosecutors_req">*</text> <text class="prosecutors_req">*</text>
<view class="nes"> <view class="nes">
<view class="conclusion"> <view class="conclusion">
<text class="prosecutors_pre">检查结论</text> <text class="prosecutors_pre">整改要求</text>
<picker class="prosecutors_name" bindchange="pickerChange" value="{{checkResultFlag}}" range="{{array}}"> <input type="text" placeholder="请填写整改要求" bindinput="changenewHazardStatus2" value="{{hazardStatus2}}" style="margin-left: 10rpx;"/>
<view class="{{checkResultFlagName?'':'gray'}}">
{{checkResultFlagName?checkResultFlagName:'请选择'}}
</view>
</picker>
</view> </view>
<view class="conclusion_right"> <view class="conclusion_right">
<image src="../../../../images/right.png" class="prosecutors_img"></image> </view>
</view></view> </view>
</view> </view>
<view class="prosecutors" > <view class="prosecutors" wx:if="{{checkResultFlag == 0}}">
<text class="prosecutors_req" wx:if="{{checkResultFlag == 0}}">*</text> <text class="prosecutors_req">*</text>
<view class="nes" bind:tap="showTime"> <view class="nes" bind:tap="handelShowTime">
<view class="conclusion"> <view class="conclusion">
<text class="prosecutors_pre">拟复查时间</text> <text class="prosecutors_pre">拟复查时间</text>
<view class="{{currentDate?'prosecutors_name':'gray'}}"> <view class="{{currentDateShow?'prosecutors_name':'gray'}}">
{{currentDate?currentDate:'请选择'}} {{currentDateShow?currentDateShow:'请选择'}}
</view>
<!-- <picker mode="date" class="prosecutors_name" bindchange="pickerChange1" value="{{reviewTime}}">
<view class="{{reviewTime?'':'gray'}}">
{{reviewTime?reviewTime:'请选择'}}
</view> </view>
</picker> -->
</view> </view>
<view class="conclusion_right"> <view class="conclusion_right">
<image src="../../../../images/right.png" class="prosecutors_img"></image> <image src="../../../../images/right.png" class="prosecutors_img"></image>
@ -102,7 +108,7 @@
<view class="text2"> <view class="text2">
巡查记录 巡查记录
</view> </view>
<view class="logsBox" wx:for="{{showList}}" wx:for-index="index"> <view class="logsBox" wx:for="{{showList}}" wx:for-index="index" wx:key="index">
<view class="item-dian {{index!=0?'item-dian1':''}}"> <view class="item-dian {{index!=0?'item-dian1':''}}">
<view class="neidian"></view> <view class="neidian"></view>
</view> </view>
@ -112,8 +118,8 @@
<view class="logs-content"> <view class="logs-content">
<view class="logs-content-left"> <view class="logs-content-left">
<view> <view>
<text class="logs-content-title">检人员:</text> <text class="logs-content-title">检人员:</text>
<text class="logs-content-txt">{{item.chekPersons||'--'}}</text> <text class="logs-content-txt">{{item.checkPersons||'--'}}</text>
</view> </view>
<view> <view>
<text class="logs-content-title">检查结论:</text> <text class="logs-content-title">检查结论:</text>
@ -121,15 +127,19 @@
</view> </view>
<view> <view>
<text class="logs-content-title">{{index==0?'未整改隐患: ':'隐患明细:'}}</text> <text class="logs-content-title">{{index==0?'未整改隐患: ':'隐患明细:'}}</text>
<text class="logs-content-txt" name="{{index}}" wx:for="{{item.hiddenDangeList}}">{{index + 1}}.{{item.hazardDesc}}</text> <text class="logs-content-txt" name="{{index}}" wx:for="{{item.hiddenDangeList0}}">{{index + 1}}.{{item.hazardDesc}}</text>
</view> </view>
<view wx:if="{{index}}"> <view>
<text class="logs-content-title" wx:if="{{item.hiddenDangeList2.length == 0}}">已整改隐患:</text>
<text class="logs-content-txt" name="{{index}}" wx:for="{{item.hiddenDangeList1}}">{{index + 1}}.{{item.hazardDesc}}</text>
</view>
<view wx:if="{{item.hiddenDangeList2.length != 0}}">
<text class="logs-content-title">整改要求:</text> <text class="logs-content-title">整改要求:</text>
<text class="logs-content-txt" wx:for="{{item.hiddenDangeList}}">{{item.hazardStatus}}</text> <text class="logs-content-txt" wx:for="{{item.hiddenDangeList2}}">{{index + 1}}.{{item.hazardDesc}}</text>
</view> </view>
<view wx:if="{{index}}"> <view >
<text class="logs-content-title">拟复查时间:</text> <text class="logs-content-title">拟复查时间:</text>
<text class="logs-content-txt">{{item.reviewTime}}</text> <text class="logs-content-txt">{{item.reviewTime || '--'}}</text>
</view> </view>
<view> <view>
<text class="logs-content-title">附件:</text> <text class="logs-content-title">附件:</text>
@ -165,23 +175,13 @@
</view> </view>
</van-popup> </van-popup>
<wux-actionsheet id="wux-actionsheet" /> <wux-actionsheet id="wux-actionsheet" />
<view class="container">
<van-datetime-picker wx:if="{{showtime}}"
type="datetime"
value="{{ currentDate }}"
min-date="{{ minDate }}"
max-date="{{ maxDate }}"
bind:input="onInput"
/>
</view>
<van-popup show="{{ showtime }}" close-icon="close" position="bottom" custom-style="height: 50%" bind:close="closePopup" round> <van-popup show="{{ showtime }}" close-icon="close" position="bottom" custom-style="height: 50%" bind:close="closePopup" round>
<van-datetime-picker <van-datetime-picker
type="datetime" type="datetime"
value="{{ currentDate }}" value="{{ currentDate }}"
min-date="{{ minDate }}" min-date="{{ minDate }}"
max-date="{{ maxDate }}" max-date="{{ maxDate }}"
bind:confirm="handelConfirmDate"
bind:input="onInput" bind:input="onInput"
bind:confirm="onConfirm"
bind:cancel="onCancel"
/> />
</van-popup> </van-popup>

5
subpages/securityCheck/pages/securityCheck.js

@ -20,7 +20,6 @@ Page({
}, },
onLoad(options) { onLoad(options) {
this.getList() this.getList()
}, },
@ -133,7 +132,7 @@ onScrollToLower(e){
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
this.getList()
}, },
@ -176,7 +175,7 @@ onScrollToLower(e){
toDetails(e){ toDetails(e){
console.log(e) console.log(e)
wx.navigateTo({ wx.navigateTo({
url: `../../../subpages/safetyinspection/pages/safetyinspection/safetyinspection?resiId=${e.currentTarget.dataset.resiid}`, url: `../../../subpages/safetyinspection/pages/safetyinspection/safetyinspection?resiId=${e.currentTarget.dataset.resiid}&flag=${e.currentTarget.dataset.flag}`,
}) })
} }

4
subpages/securityCheck/pages/securityCheck.wxml

@ -12,7 +12,7 @@
<view class="section_5"> <view class="section_5">
<scroll-view scroll-y="{{true}}" scroll-into-view="scrollToHere" wx:if="{{waitingCheckStyle}}" style="width: 100%; height: 90vh;" <scroll-view scroll-y="{{true}}" scroll-into-view="scrollToHere" wx:if="{{waitingCheckStyle}}" style="width: 100%; height: 90vh;"
lower-threshold="{{ lowerThreshold }}" bindscrolltolower="onScrollToLower"> lower-threshold="{{ lowerThreshold }}" bindscrolltolower="onScrollToLower">
<view class="list_1" wx:for="{{flag0Array}}" bind:tap="toDetails" data-resiId="{{item.id}}"> <view class="list_1" wx:for="{{flag0Array}}" bind:tap="toDetails" data-flag="{{item.checkResultFlag}}" data-resiId="{{item.id}}">
<view class="section_1-0" id="scrollToHere"> <view class="section_1-0" id="scrollToHere">
<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>
@ -31,7 +31,7 @@
<scroll-view scroll-y="{{true}}" scroll-into-view="scrollToHere" wx:if="{{qualifiedStyle}}" style="width: 100%; height: 90vh;" lower-threshold="{{ lowerThreshold }}" bindscrolltolower="onScrollToLower"> <scroll-view scroll-y="{{true}}" scroll-into-view="scrollToHere" wx:if="{{qualifiedStyle}}" style="width: 100%; height: 90vh;" lower-threshold="{{ lowerThreshold }}" bindscrolltolower="onScrollToLower">
<view class="list_1" wx:for="{{flag1Array}}" data-resiId="{{item.id}}" bind:tap="toDetails"> <view class="list_1" wx:for="{{flag1Array}}" data-resiId="{{item.id}}" bind:tap="toDetails" data-flag="{{item.checkResultFlag}}">
<view class="section_1-0" id="scrollToHere" > <view class="section_1-0" id="scrollToHere" >
<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>

27
utils/index.js

@ -8,4 +8,29 @@ export function encryptedData(key, data) {
// 加密数据 // 加密数据
return encryptor.encrypt(data); return encryptor.encrypt(data);
} }
// 使用方法:
// timestampToTime(1591841249) //返回2020-06-11
// timestampToTime(1591841249,1) //返回 2020-06-11 10:10:10
// timestampToTime(1591841249,2) //返回2020年06月11日
export function timestampToTime(value, type = 0){
var time = new Date(value);
var year = time.getFullYear();
var month = time.getMonth() + 1;
var date = time.getDate();
var hour = time.getHours();
var minute = time.getMinutes();
var second = time.getSeconds();
month = month < 10 ? "0" + month : month;
date = date < 10 ? "0" + date : date;
hour = hour < 10 ? "0" + hour : hour;
minute = minute < 10 ? "0" + minute : minute;
second = second < 10 ? "0" + second : second;
var arr = [
year + "-" + month + "-" + date,
year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second,
year + "年" + month + "月" + date,
year + "年" + month + "月" + date + " " + hour + ":" + minute + ":" + second,
hour + ":" + minute + ":" + second
]
return arr[type];
}
Loading…
Cancel
Save