diff --git a/subpages/InspectionReport/pages/InspectionReport/InspectionReport.js b/subpages/InspectionReport/pages/InspectionReport/InspectionReport.js
index 3a340ba..b8fd705 100644
--- a/subpages/InspectionReport/pages/InspectionReport/InspectionReport.js
+++ b/subpages/InspectionReport/pages/InspectionReport/InspectionReport.js
@@ -88,7 +88,16 @@ Page({
showtime:true
})
},
-
+ onInputChange(e){
+ const index = e.currentTarget.dataset.index;
+ const value = e.detail.value;
+ let addHiddenDangeList = this.data.addHiddenDangeList;
+ addHiddenDangeList[index].hazardDesc = value;
+ this.setData({
+ addHiddenDangeList: addHiddenDangeList
+ });
+ console.log(this.data.addHiddenDangeList);
+ },
showRecordData() {
this.setData({
checkboxOptions:[]
@@ -147,7 +156,7 @@ Page({
return false
}
- if(this.data.checkResultFlag == 0 && this.data.checkboxValue.length<1&&!this.data.newContent){
+ if(this.data.checkResultFlag == 0 && this.data.checkboxValue.length<1&&!this.data.addHiddenDangeList<1){
wx.showToast({
title: '隐患明细最少输入一条',
icon:'none'
diff --git a/subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml b/subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml
index b18253b..b2cfac6 100644
--- a/subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml
+++ b/subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml
@@ -51,18 +51,21 @@
{{index + 1}}. {{item.hazardDesc}}
-
- {{item.hazardDesc}}
+
+
-
+
diff --git a/subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxss b/subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxss
index 596198b..835531d 100644
--- a/subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxss
+++ b/subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxss
@@ -293,10 +293,14 @@ page {
.addHiddenDangeList{
display: flex;
flex-direction: column;
- margin-left: 70rpx;
+ margin-left: 60rpx;
}
.addHiddenDangeListText {
margin-bottom: 20rpx;
+margin-top: 10rpx;
+background-color: #f7f7f7;
+width: 550rpx;
+height: 60rpx;
}
.group{
margin-top: 20rpx;
diff --git a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.js b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.js
index f0e6270..2e4e051 100644
--- a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.js
+++ b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.js
@@ -121,6 +121,16 @@ Page({
});
});
},
+ onInputChange(e){
+ const index = e.currentTarget.dataset.index;
+ const value = e.detail.value;
+ let addHiddenDangeList = this.data.addHiddenDangeList;
+ addHiddenDangeList[index].hazardDesc = value;
+ this.setData({
+ addHiddenDangeList: addHiddenDangeList
+ });
+ console.log(this.data.addHiddenDangeList);
+ },
handelShowTime(){
this.setData({
showtime:true
@@ -398,6 +408,29 @@ addRecord(form).then(res => {
})
console.log(form);
},
+addAnother() {
+ if ( !this.data.newContent) {
+ wx.showModal({
+ title: '提示',
+ content: '输入不能为空',
+ success (res) {
+ if (res.confirm) {
+ console.log('用户点击确定')
+ } else if (res.cancel) {
+ console.log('用户点击取消')
+ }
+ }
+ })
+ }else{
+ let newArr = this.data.addHiddenDangeList.concat({ hazardDesc: this.data.newContent, hazardStatus: 0 });
+ this.setData({
+ addHiddenDangeList: newArr,
+ newContent: '', // 清空输入框的值
+ });
+ console.log('添加后的数组:', this.data.addHiddenDangeList);
+
+ }
+},
chooseImage() {
if (this.data.uploadImageList.length > 3) {
wx.showToast({
diff --git a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml
index 143b113..9d25236 100644
--- a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml
+++ b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml
@@ -40,18 +40,21 @@
{{index + 1}}. {{item.hazardDesc}}
-
- {{item.hazardDesc}}
+
+
-
+
*
diff --git a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss
index c76320a..bf8ad3f 100644
--- a/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss
+++ b/subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss
@@ -431,6 +431,9 @@ margin-bottom: 20rpx;
}
.addHiddenDangeListText {
margin-bottom: 20rpx;
+background-color: #f7f7f7;
+width: 500rpx;
+height: 60rpx;
}
.field-text{
width: 61rpx;