diff --git a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.js b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.js index 86f3992..7853b67 100644 --- a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.js +++ b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.js @@ -12,6 +12,7 @@ Page({ * 页面的初始数据 */ data: { + checkboxOptionsnumber:0, orgid:'', orgType:'', pageNo:'1', @@ -34,8 +35,8 @@ Page({ checkboxOptions:[], checkboxValue:[], uploadImageList: [],//图片上传的数组 - imageId:1 - + imageId:1, + addHiddenDangeList:[] }, /** * 生命周期函数--监听页面加载 @@ -138,8 +139,11 @@ Page({ showRecord(parm).then(res => { if(res.data[0].hiddenDangeList){ let checkboxOptions = res.data[0].hiddenDangeList.filter(item=>item.hazardStatus === 0).map(item=>({hazardDesc:item.hazardDesc,hazardStatus:0})); + let checkboxOptionsnumber=checkboxOptions.length+1; + console.log(checkboxOptionsnumber) this.setData({ - checkboxOptions + checkboxOptions, + checkboxOptionsnumber }) } this.setData({ @@ -199,12 +203,13 @@ Page({ }); }, addAnother() { - let newArr = this.data.checkboxOptions.concat({ hazardDesc: this.data.newContent, hazardStatus: 0 }); + let newArr = this.data.addHiddenDangeList.concat({ hazardDesc: this.data.newContent, hazardStatus: 0 }); this.setData({ - checkboxOptions: newArr, + addHiddenDangeList: newArr, newContent: '', // 清空输入框的值 }); - console.log('添加后的数组:', this.data.checkboxOptions); + console.log('添加后的数组:', this.data.addHiddenDangeList); + }, // 删除选中的图片 deleteImage(e) { @@ -269,11 +274,11 @@ handelClickSave(){ checkPersonsIdList:this.data.selectedOptions, checkResultFlag:this.data.checkResultFlag, reviewTime:`${this.data.reviewTime} ${hours}:${minutes}:${seconds}`, - hiddenDangeList:this.data.checkboxOptions, + hiddenDangeList:this.data.checkboxOptions.concat(this.data.addHiddenDangeList), attachmentUrls:this.data.uploadImageList.map(item=>({fileName:item.originFileName,attachmentUrl:item.ossUrl.url})), remark:this.data.remark } - +console.log(this.data.checkboxOptions.concat(this.data.addHiddenDangeList)) addRecord(form).then(res => { if(res.code == 0){ wx.showToast({ diff --git a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml index 5ebadc9..3eb885a 100644 --- a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml +++ b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml @@ -1,8 +1,9 @@ + + * - * 检查人员 {{ selectedNames }} @@ -13,16 +14,21 @@ * - 已整改隐患 + 未整改隐患 - {{item.hazardDesc}} + {{index + 1}}. {{item.hazardDesc}} + + {{index + checkboxOptionsnumber +}}. {{item.hazardDesc}} + - + @@ -62,7 +68,7 @@ - 上传图片 + 附件 隐患明细: - {{item.hazardDesc}} + {{index + 1}}. {{item.hazardDesc}} 整改要求: @@ -127,15 +133,14 @@ -- - + 备注: {{item.remark||'--'}} - + diff --git a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss index 68a8a2e..9ecf0f1 100644 --- a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss +++ b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss @@ -298,7 +298,6 @@ page { } .btn{ - display: flex; margin: 20rpx; background-color: #3974F6; @@ -331,6 +330,7 @@ margin-bottom: 20rpx; position: fixed; bottom: 0; left: 0; + z-index: 2; } .image-box { width: 100%; @@ -411,4 +411,24 @@ margin-bottom: 20rpx; right: -10rpx; width: 40rpx; height: 40rpx; +} +.addHiddenDangeList{ + display: flex; + flex-direction: column; + margin-left: 70rpx; +} +.addHiddenDangeListText { +margin-bottom: 20rpx; +} +.field-text{ + width: 61rpx; + height: 31rpx; + overflow-wrap: break-word; + color: rgba(102,102,102,1); + font-size: 32rpx; + font-family: PingFang-SC-Regular; + font-weight: normal; + text-align: left; + white-space: nowrap; + line-height: 42rpx; } \ No newline at end of file