diff --git a/subpages/InspectionReport/pages/InspectionReport/InspectionReport.js b/subpages/InspectionReport/pages/InspectionReport/InspectionReport.js index 12ff1b9..ee6e5ce 100644 --- a/subpages/InspectionReport/pages/InspectionReport/InspectionReport.js +++ b/subpages/InspectionReport/pages/InspectionReport/InspectionReport.js @@ -4,7 +4,7 @@ import { const config = require('../../../../utils/config') const QQMapWX = require('../../../../utils/qqmap-wx-jssdk') const App = getApp() - +import {timestampToTime} from "../../../../utils/index" import { addRecord, securityCheckk, @@ -127,17 +127,6 @@ Page({ return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; }, submitBiao() { - if (this.data.newContent) { - let newArr = this.data.addHiddenDangeList.concat({ - hazardDesc: this.data.newContent, - hazardStatus: 0 - }); - console.log(newArr) - this.setData({ - addHiddenDangeList: newArr, - }); - } - console.log(this.data.addHiddenDangeList); if(!this.data.companyId){ wx.showToast({ title: '请选择企业', @@ -159,7 +148,7 @@ Page({ }) return false } - if(this.data.checkResultFlag == 0 && !this.data.getData){ + if(this.data.checkResultFlag == 0 && !this.data.currentDateShow){ wx.showToast({ title: '请选择拟复查时间', icon:'none' @@ -167,7 +156,7 @@ Page({ return false } - if(this.data.checkResultFlag == 0 && this.data.checkboxValue.length<1&&this.data.addHiddenDangeList<1){ + if(this.data.checkResultFlag == 0 && this.data.checkboxValue.length<1&&this.data.addHiddenDangeList<1&&!this.data.newContent){ wx.showToast({ title: '隐患明细最少输入一条', icon:'none' @@ -197,13 +186,23 @@ Page({ addHiddenDangeList: newArr, }); } - + if (this.data.newContent) { + let newArr = this.data.addHiddenDangeList.concat({ + hazardDesc: this.data.newContent, + hazardStatus: 0 + }); + console.log(newArr) + this.setData({ + addHiddenDangeList: newArr, + }); + } + console.log(this.data.addHiddenDangeList); let form={ companyId: this.data.companyId, checkTime: this.getCurrentDateTime(), checkPersonsIdList: this.data.checkPersonsIdList, checkResultFlag: this.data.checkResultFlag, - reviewTime:this.data.getData, + reviewTime:this.data.currentDateShow, hiddenDangeList:this.data.checkboxOptions.concat(this.data.addHiddenDangeList), attachmentUrls:this.data.uploadImageList.map(item=>({fileName:item.originFileName,attachmentUrl:item.ossUrl.url})), remark: this.data.remarks, @@ -680,7 +679,14 @@ Page({ closePopup() { this.setData({ showPopup: false }); }, + handelConfirmDate(value){ + this.setData({ + showtime:false, + currentDateShow:timestampToTime(value.detail,1), + currentDate:value.detail + }) + }, onInput(event) { var date = new Date(event.detail); var year = date.getFullYear(); @@ -694,8 +700,9 @@ Page({ this.setData({ getData:formattedDateTime }) - + console.log(this.data.getData) }, + onConfirm(event) { const { value } = event.detail; diff --git a/subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml b/subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml index b2cfac6..0549506 100644 --- a/subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml +++ b/subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml @@ -103,8 +103,8 @@ 拟复查时间 - - {{getData?getData:'请选择'}} + + {{currentDateShow?currentDateShow:'请选择'}}