Browse Source

Bug

v4.3.1_xiaowang_bug
是小王呀\24601 1 year ago
parent
commit
17fc937489
  1. 41
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.js
  2. 6
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml
  3. 26
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.js
  4. 3
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss

41
subpages/InspectionReport/pages/InspectionReport/InspectionReport.js

@ -4,7 +4,7 @@ import {
const config = require('../../../../utils/config')
const QQMapWX = require('../../../../utils/qqmap-wx-jssdk')
const App = getApp()
import {timestampToTime} from "../../../../utils/index"
import {
addRecord,
securityCheckk,
@ -127,17 +127,6 @@ 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: '请选择企业',
@ -159,7 +148,7 @@ Page({
})
return false
}
if(this.data.checkResultFlag == 0 && !this.data.getData){
if(this.data.checkResultFlag == 0 && !this.data.currentDateShow){
wx.showToast({
title: '请选择拟复查时间',
icon:'none'
@ -167,7 +156,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&&!this.data.newContent){
wx.showToast({
title: '隐患明细最少输入一条',
icon:'none'
@ -197,13 +186,23 @@ Page({
addHiddenDangeList: newArr,
});
}
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);
let form={
companyId: this.data.companyId,
checkTime: this.getCurrentDateTime(),
checkPersonsIdList: this.data.checkPersonsIdList,
checkResultFlag: this.data.checkResultFlag,
reviewTime:this.data.getData,
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.remarks,
@ -680,7 +679,14 @@ Page({
closePopup() {
this.setData({ showPopup: false });
},
handelConfirmDate(value){
this.setData({
showtime:false,
currentDateShow:timestampToTime(value.detail,1),
currentDate:value.detail
})
},
onInput(event) {
var date = new Date(event.detail);
var year = date.getFullYear();
@ -694,8 +700,9 @@ Page({
this.setData({
getData:formattedDateTime
})
console.log(this.data.getData)
},
onConfirm(event) {
const { value } = event.detail;

6
subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml

@ -103,8 +103,8 @@
<view class="nes" bind:tap="showTime" >
<view class="conclusion">
<text class="prosecutors_pre">拟复查时间</text>
<view class="{{getData?'':'gray'}} prosecutors_name">
{{getData?getData:'请选择'}}
<view class="{{currentDateShow?'':'gray'}} prosecutors_name">
{{currentDateShow?currentDateShow:'请选择'}}
</view>
<!-- <picker mode="date" class="prosecutors_name" bindchange="pickerChange1" value="{{data}}">
<view class="{{getData?'':'gray'}}">
@ -165,7 +165,7 @@
min-date="{{ minDate }}"
max-date="{{ maxDate }}"
bind:input="onInput"
bind:confirm="onConfirm"
bind:confirm="handelConfirmDate"
bind:cancel="onCancel"
/>
</van-popup>

26
subpages/safetyinspection/pages/safetyinspection/safetyinspection.js

@ -53,7 +53,7 @@ Page({
companyId: options.resiId,
orgid:App.globalData.user.agencyId,
checkResultFlagRouter:options.flag,
currentDateShow:timestampToTime(new Date().getTime(),1)
})
}
this.showRecordData()
@ -311,16 +311,7 @@ Page({
},
handelClickSave(){
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.checkboxOptions)
console.log(this.data.addHiddenDangeList)
if(this.data.selectedOptions.length === 0){
@ -362,7 +353,7 @@ handelClickSave(){
});
if(this.data.checkResultFlag == 0 && !hasHazardStatus1 && this.data.addHiddenDangeList.length<1){
if(this.data.checkResultFlag == 0 && !hasHazardStatus1 && this.data.addHiddenDangeList.length<1&&!this.data.newContent){
console.log("1111",hasHazardStatus1)
wx.showToast({
title: '请填写隐患明细',
@ -370,6 +361,16 @@ if(this.data.checkResultFlag == 0 && !hasHazardStatus1 && this.data.addHiddenDan
})
return false
}
if (this.data.newContent) {
let newArr = this.data.addHiddenDangeList.concat({
hazardDesc: this.data.newContent,
hazardStatus: 0
});
console.log(newArr)
this.setData({
addHiddenDangeList: newArr,
});
}
const now = new Date();
const hours = now.getHours().toString().padStart(2, '0');
const minutes = now.getMinutes().toString().padStart(2, '0');
@ -391,6 +392,7 @@ if(this.data.checkResultFlag == 0 && !hasHazardStatus1 && this.data.addHiddenDan
this.setData({
newContent:null
})
console.log(form);
addRecord(form).then(res => {
if(res.code == 0){
wx.showToast({

3
subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss

@ -424,6 +424,9 @@ margin-bottom: 20rpx;
width: 40rpx;
height: 40rpx;
}
.gray{
padding-left: 80rpx;
}
.addHiddenDangeList{
display: flex;
flex-direction: column;

Loading…
Cancel
Save