Browse Source

bug修改

data-page-V4.3.1
是小王呀\24601 1 year ago
parent
commit
e79c92fc78
  1. 103
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.js
  2. 2
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml
  3. 42
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.js
  4. 2
      subpages/securityCheck/pages/securityCheck.js

103
subpages/InspectionReport/pages/InspectionReport/InspectionReport.js

@ -91,19 +91,19 @@ Page({
showRecordData() {
this.setData({
checkboxOptions:null
checkboxOptions:[]
})
let parm = {
id: this.data.companyId
}
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,id:item.id}));
let checkboxOptions = res.data[0].hiddenDangeList.filter(item=>item.hazardStatus === 0).map(item=>({hazardDesc:item.hazardDesc,hazardStatus:0}));
this.setData({
checkboxOptions,
checkboxOptions: checkboxOptions || [],
beforeFlag: res.data[0].checkResultFlag
})
console.log(this.data.checkboxOptions);
console.log(this.data.beforeFlag);
}
})
},
@ -146,55 +146,80 @@ Page({
})
return false
}
if(this.data.checkResultFlag == 0 && this.data.checkboxValue.length<1&&!this.data.hazardDesc2){
if(this.data.checkResultFlag == 0 && this.data.checkboxValue.length<1&&!this.data.newContent){
wx.showToast({
title: '隐患明细最少输入一条',
icon:'none'
})
return false
}
this.data.checkboxOptions.forEach(item => {
if(this.checkboxValue.findIndex(itemC=>itemC === item.value) == -1){
item.hazardStatus = '1';
}else{
item.hazardStatus = '0';
}
})
console.log(this.data.checkboxValue);
console.log(this.data.checkboxOptions);
let form={ companyId: this.data.companyId,
if (this.data.checkboxOptions) {
console.log(this.data.checkboxOptions)
this.data.checkboxOptions.forEach(item => {
console.log(item)
console.log(this.data.checkboxValue)
if(this.data.checkboxValue.findIndex(itemC=>itemC === item.value) == -1){
item.hazardStatus = '1';
}else{
item.hazardStatus = '0';
}
})
}
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,
hazardStatus: 2
});
console.log(newArr)
this.setData({
addHiddenDangeList: newArr,
});
}
let form={
companyId: this.data.companyId,
checkTime: this.getCurrentDateTime(),
checkPersonsIdList: this.data.checkPersonsIdList,
checkResultFlag: this.data.checkResultFlag,
reviewTime:this.data.getData,
hiddenDangeList:null,
hiddenDangeList:this.data.checkboxOptions.concat(this.data.addHiddenDangeList),
attachmentUrls:this.data.uploadImageList.map(item=>({fileName:item.originFileName,attachmentUrl:item.ossUrl.url})),
remark: '',
remark: this.data.remarks,
reviewAddress:this.data.addressContent
}
if (!this.data.reviewTime) {
form.reviewTime=null
}
// if (!this.data.reviewTime) {
// form.reviewTime=null
// }
console.log(form)
// addRecord(
// form
// ).then(
// res => {
// if(res.code == 0){
// wx.showToast({
// title: '新增成功',
// duration:2000,
// success:function(){
// setTimeout(()=>{
// wx.navigateBack({
// delta: 1
// })
// },2000)
// }
// })
// }
// });
addRecord(
form
).then(
res => {
if(res.code == 0){
wx.showToast({
title: '新增成功',
duration:2000,
success:function(){
setTimeout(()=>{
wx.navigateBack({
delta: 1
})
},2000)
}
})
}
});
},

2
subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml

@ -67,7 +67,7 @@
<view class="pitfall" wx:if="{{beforeFlag == 1}}">
<view class="prosecutors">
<text class="prosecutors_req">*</text>
<!-- <text class="prosecutors_req">*</text> -->
<view class="conclusion1">
<text class="prosecutors_pre">整改要求</text>
</view>

42
subpages/safetyinspection/pages/safetyinspection/safetyinspection.js

@ -40,7 +40,8 @@ Page({
showtime:false,
checkResultFlag:null,
checkResultFlagRouter:null,
hazardStatus2:null
hazardStatus2:null,
name:""
},
/**
* 生命周期函数--监听页面加载
@ -48,6 +49,7 @@ Page({
onLoad(options) {
if(options){
this.setData({
companyId: options.resiId,
orgid:App.globalData.user.agencyId,
checkResultFlagRouter:options.flag,
@ -111,7 +113,10 @@ Page({
data
}) => {
console.log(data)
var firstItem = data.list[0];
console.log(firstItem)
this.setData({
reviewAddress:firstItem.address,
companyList: data.list,
});
});
@ -173,7 +178,6 @@ Page({
});
},
showRecordData() {
console.log("我执行了")
let parm = {
id: this.data.companyId
}
@ -372,11 +376,11 @@ if(this.data.checkResultFlag == 0 && !hasHazardStatus1 && this.data.addHiddenDan
checkTime:this.getCurrentDateTime(),
checkPersonsIdList:this.data.selectedOptions,
checkResultFlag:this.data.checkResultFlag,
reviewTime:this.data.checkResultFlag === '1'?null:timestampToTime(this.data.currentDate,1),
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.remark,
address:""
reviewAddress:""
}
if(this.data.hazardStatus2){
form.hiddenDangeList.push({hazardDesc:this.data.hazardStatus2,hazardStatus:2})
@ -384,21 +388,21 @@ if(this.data.checkResultFlag == 0 && !hasHazardStatus1 && this.data.addHiddenDan
this.setData({
newContent:null
})
addRecord(form).then(res => {
if(res.code == 0){
wx.showToast({
title: '新增成功',
duration:2000,
success:function(){
setTimeout(()=>{
wx.navigateBack({
delta: 1
})
},2000)
}
})
}
})
// addRecord(form).then(res => {
// if(res.code == 0){
// wx.showToast({
// title: '新增成功',
// duration:2000,
// success:function(){
// setTimeout(()=>{
// wx.navigateBack({
// delta: 1
// })
// },2000)
// }
// })
// }
// })
console.log(form);
},
chooseImage() {

2
subpages/securityCheck/pages/securityCheck.js

@ -175,7 +175,7 @@ onScrollToLower(e){
toDetails(e){
console.log(e)
wx.navigateTo({
url: `../../../subpages/safetyinspection/pages/safetyinspection/safetyinspection?resiId=${e.currentTarget.dataset.resiid}&flag=${e.currentTarget.dataset.flag}`,
url: `../../../subpages/safetyinspection/pages/safetyinspection/safetyinspection?resiId=${e.currentTarget.dataset.resiid}&flag=${e.currentTarget.dataset.flag}&name=${e.currentTarget.dataset.name}`,
})
}

Loading…
Cancel
Save