diff --git a/subpages/InspectionReport/pages/InspectionReport/InspectionReport.js b/subpages/InspectionReport/pages/InspectionReport/InspectionReport.js index b8fd705..12ff1b9 100644 --- a/subpages/InspectionReport/pages/InspectionReport/InspectionReport.js +++ b/subpages/InspectionReport/pages/InspectionReport/InspectionReport.js @@ -127,6 +127,17 @@ 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: '请选择企业', @@ -156,7 +167,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){ wx.showToast({ title: '隐患明细最少输入一条', icon:'none' @@ -175,16 +186,7 @@ Page({ } }) } - 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.hazardDesc2) { let newArr = this.data.addHiddenDangeList.concat({ hazardDesc: this.data.hazardDesc2,