Browse Source

待复核列表详情信息不正确

data-page-V4.3.1
是小王呀\24601 1 year ago
parent
commit
4fbb6be968
  1. 21
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.js
  2. 25
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml
  3. 22
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss

21
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({

25
subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml

@ -1,8 +1,9 @@
<!--subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml-->
<view class="form_add">
<view class="prosecutors" bind:tap="showPopup">
<text class="prosecutors_req">*</text>
<view>
<text class="prosecutors_req">*</text>
<text class="prosecutors_pre">检查人员</text>
</view>
<text class="prosecutors_name">{{ selectedNames }}</text>
@ -13,16 +14,21 @@
<view class="prosecutors" style="border-bottom: none;">
<view>
<text class="prosecutors_req" wx:if="{{checkResultFlag == 0}}">*</text>
<text class="prosecutors_pre">整改隐患</text>
<text class="prosecutors_pre">整改隐患</text>
</view>
</view>
<view class="checkbox1">
<van-checkbox-group value="{{checkboxValue}}" bind:change="onChange" wx:if="{{checkboxOptions}}" >
<van-checkbox custom-class="group" name="{{index}}" wx:for="{{checkboxOptions}}">{{item.hazardDesc}}</van-checkbox>
<van-checkbox custom-class="group" name="{{index}}" wx:for="{{checkboxOptions}}">{{index + 1}}. {{item.hazardDesc}}</van-checkbox>
</van-checkbox-group>
<view class="addHiddenDangeList">
<text wx:for="{{addHiddenDangeList}}" wx:for-index="index" class="addHiddenDangeListText"
wx:for-item="item">{{index + checkboxOptionsnumber
}}. {{item.hazardDesc}}</text>
</view>
</view>
<view class="input1">
<input bindinput="changenewContent" value="{{newContent}}" type="text" placeholder=" 请输入新的隐患信息" />
<input bindinput="changenewContent" value="{{newContentWithIndex}}" type="text" placeholder=" 请输入新的隐患信息" />
</view>
<view class="add" bind:tap="addAnother">
<image src="../../../../images/add.png" class="add_img"></image>
@ -62,7 +68,7 @@
<view class="image-box">
<view class="{{ uploadImageList.length < 4 ? 'image-list' : uploadImageList.length > 3 && uploadImageList.length < 7 ? 'image-list image-list-2' : uploadImageList.length > 6 && uploadImageList.length < 10 ? 'image-list image-list-3' : 'image-list image-list-4' }}">
<view class=" image-list-label">
<view class="field-text">上传图片</view>
<view class="field-text">附件</view>
</view>
<view
class="image-item"
@ -109,7 +115,7 @@
</view>
<view>
<text class="logs-content-title">隐患明细:</text>
<text class="logs-content-txt" wx:for="{{item.hiddenDangeList}}">{{item.hazardDesc}}</text>
<text class="logs-content-txt" name="{{index}}" wx:for="{{item.hiddenDangeList}}">{{index + 1}}. {{item.hazardDesc}}</text>
</view>
<view>
<text class="logs-content-title">整改要求:</text>
@ -127,15 +133,14 @@
<text wx:else>--</text>
</view>
<view>
<view >
<text class="logs-content-title">备注:</text>
<text class="logs-content-txt">{{item.remark||'--'}}</text>
</view>
<!-- <view>
<view wx:if="{{index}}" >
<text class="logs-content-title">巡查定位:</text>
<text class="logs-content-txt">--</text>
<text class="logs-content-txt">{{item.name}}</text>
</view> -->
</view>
</view>
</view>
</view>

22
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%;
@ -412,3 +412,23 @@ margin-bottom: 20rpx;
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;
}
Loading…
Cancel
Save