Commit 976ba0b6 authored by xinzhedeai's avatar xinzhedeai

小程序端 隐患新增校验添加 编辑字段与新增保持一致 审查界面完善

parent 6727dc0f
...@@ -51,7 +51,28 @@ Page({ ...@@ -51,7 +51,28 @@ Page({
topAnimation: {}, topAnimation: {},
curRole:'', curRole:'',
isToEnLarge: false, isToEnLarge: false,
xcx:'xcx' xcx:'xcx',
// 总的安全类别
secType: [
{
name: '安全资料类'
},
{
name: '现场检查类'
}
],
//
curSelectSecType: '',
// 安全检查类别
secCheckType: [],
// 安全检查类别替代
secCheckTypeReplace: [],
// 当前选择的安全检查类别
curSelectSecCheckTypeReplace: '',
// 安全检查内容
secCheckContent: [],
// 当前选择的安全检查内容
curSelectCheckContent: '',
}, },
/** /**
...@@ -62,6 +83,9 @@ Page({ ...@@ -62,6 +83,9 @@ Page({
this.setData({ this.setData({
curRole: app.globalData.curRole curRole: app.globalData.curRole
}) })
const animation = wx.createAnimation({ const animation = wx.createAnimation({
delay: 10, delay: 10,
timingFunction: 'linear' timingFunction: 'linear'
...@@ -71,6 +95,15 @@ Page({ ...@@ -71,6 +95,15 @@ Page({
this.setData( this.setData(
app.globalData.currentHD app.globalData.currentHD
) )
console.log('app.globalData.currentHD',app.globalData.currentHD)
// 设置回显数据
this.setData({
curSelectSecType: app.globalData.currentHD.type, // 安全类别
curSelectSecCheckTypeReplace: app.globalData.currentHD.category, // 安全检查类别
curSelectCheckContent: app.globalData.currentHD.inspectionContent, // 安全检查内容
hdName: app.globalData.currentHD.hdName, // 安全发现问题
editAble: app.globalData.currentHD.hdStatus===0 || app.globalData.currentHD.hdStatus===2,
})
// console.log(app.globalData.currentHD, 'currentHD') // console.log(app.globalData.currentHD, 'currentHD')
// 调用接口 获取图片 // 调用接口 获取图片
wx.request({ wx.request({
...@@ -90,7 +123,7 @@ Page({ ...@@ -90,7 +123,7 @@ Page({
Authorization: app.globalData.Authorization Authorization: app.globalData.Authorization
}, },
success: (res) => { success: (res) => {
if (res.statusCode === 401) { if (res.status === 401) {
wx.redirectTo({ wx.redirectTo({
url: '/pages/login/login', url: '/pages/login/login',
}) })
...@@ -178,11 +211,189 @@ Page({ ...@@ -178,11 +211,189 @@ Page({
onShareAppMessage: function () { onShareAppMessage: function () {
}, },
// 输入整改评价
inputEvaluation(event) { // 选择检查日期
selectCheckDate(event) {
this.setData({
hdInspectDate: event.detail.value
})
},
// 输入检查专家
inputHdInspectExpert(event) {
this.data.hdInspectExpert = event.detail.value
},
//
inputHdComment(event) {
console.log(event,'event.....')
if(event.detail.value!=''||event.detail.value!=null){
this.data.comment = event.detail.value
}
},
//安全类别
chooseSecType(e){
let that=this;
that.setData({
// 安全检查类别替代
secCheckTypeReplace: [],
// 当前选择的安全检查类别
curSelectSecCheckTypeReplace: '',
// 安全检查内容
secCheckContent: [],
// 当前选择的安全检查内容
curSelectCheckContent: '',
// 发现问题
secCheckDiscover: [],
// 隐患名称
hdName: '',
})
wx.request({
url: app.globalData.appBaseUrl + '/api/enterpriseSafetyInspectionContent',
method: 'get',
header: {
Authorization: app.globalData.Authorization
},
data: {
county:app.globalData.appCounty,
level: 1,
type: that.data.secType[e.detail.value].name,
page: 0,
size: 99999,
},
success: (res) => {
this.setData({
secCheckTypeReplace: [...res.data.content],
curSelectSecType: that.data.secType[e.detail.value].name
})
}
})
},
//安全检查类别
chooseSecCheckType(event) {
let that = this;
that.setData({
// 安全检查内容
secCheckContent: [],
// 当前选择的安全检查内容
curSelectCheckContent: '',
// 发现问题
secCheckDiscover: [],
// 隐患名称
hdName: '',
})
wx.request({
url: app.globalData.appBaseUrl + '/api/enterpriseSafetyInspectionContent',
method: 'get',
header: {
Authorization: app.globalData.Authorization
},
data: {
county:app.globalData.appCounty,
level: 2,
page: 0,
size: 9999,
pid: that.data.secCheckTypeReplace[event.detail.value].id
},
success: (res) => {
this.setData({
secCheckContent: [...res.data.content],
curSelectSecCheckTypeReplace: that.data.secCheckTypeReplace[event.detail.value].name
})
}
})
},
//安全检查内容
chooseSecCheckContent(event) {
let that=this;
that.setData({
// 发现问题
secCheckDiscover: [],
// 隐患名称
hdName: '',
})
wx.request({
url: app.globalData.appBaseUrl + '/api/enterpriseSafetyMatter',
method: 'get',
header: {
Authorization: app.globalData.Authorization
},
data: {
inspectionContentId: this.data.secCheckContent[event.detail.value].id,
page: 0,
size: 9999
},
success: (res) => {
this.setData({
secCheckDiscover: res.data.content,
curSelectCheckContent: this.data.secCheckContent[event.detail.value].name
})
}
})
},
chooseSecCheckDiscover(event) {
this.data.hdName = this.data.secCheckDiscover[event.detail.value].name
this.setData({
hdName: this.data.hdName,
basis: this.data.secCheckDiscover[event.detail.value].basis,
suggestion: this.data.secCheckDiscover[event.detail.value].suggestion
})
},
// 输入隐患名称
inputHdName(event) {
this.data.hdName = event.detail.value
},
// 输入隐患类型
inputHDType(event) {
console.log(event, 'hdTypeInput')
this.data.hdLevel = event.detail.value
},
// 输入检查依据
inpoutBasis(event) {
this.data.basis = event.detail.value
},
// 输入整改建议
inputRectSug(event) {
// this.data.hdRectificationSug = event.detail.value
this.data.suggestion = event.detail.value
},
// 输入整改评价
inputEvaluation(event) {
this.data.recEvaluation = event.detail.value this.data.recEvaluation = event.detail.value
}, },
/** // 输入整改期限
inputRectification(event) {
this.setData({
recDeadLine: event.detail.value
})
},
// 输入整改日期
inputRectDate(event) {
this.setData({
hdRectificationDate: event.detail.value
})
},
// 输入验收人
inputHdAcceptancePerson(event) {
this.data.hdAcceptancePerson = event.detail.value
},
/**
* 拍摄整改照片
*/
/**
* 拍摄隐患图片 * 拍摄隐患图片
*/ */
takePhoto() { takePhoto() {
...@@ -213,36 +424,6 @@ Page({ ...@@ -213,36 +424,6 @@ Page({
} }
}) })
}, },
// /**
// * 拍摄整改照片
// */
// takePhoto() {
// wx.chooseImage({
// success: (res) => {
// if(res.tempFilePaths[0]){
// this.setData({
// checkImg: true
// })
// }else{
// this.setData({
// checkImg: false
// })
// }
// console.log(res.tempFilePaths[0],'res.tempFilePaths[0]',this.data.checkImg)
// this.data.rectFilePath = res.tempFilePaths[0]
// wx.getFileSystemManager().readFile({
// filePath: res.tempFilePaths[0], // 选择图片返回的相对路径
// encoding: 'base64', // 编码格式
// success: res1 => { // 成功的回调
// this.setData({
// imgrecturl: 'data:image/png;base64,' + res1.data
// })
// }
// })
// }
// })
// },
/** /**
* 输入整改日期 * 输入整改日期
*/ */
...@@ -284,7 +465,7 @@ Page({ ...@@ -284,7 +465,7 @@ Page({
}, },
/** /**
* 提交修改 * 提交修改
*/ */
submitEdit() { submitEdit() {
...@@ -331,9 +512,9 @@ Page({ ...@@ -331,9 +512,9 @@ Page({
success: (res) => { success: (res) => {
console.log(res, '文件编辑上传') console.log(res, '文件编辑上传')
wx.hideLoading() wx.hideLoading()
if (res.status === 201) { if (res.status === 200) {
wx.showToast({ wx.showToast({
title: '编辑成功', title: '操作成功',
icon: 'success' icon: 'success'
}) })
wx.navigateBack() wx.navigateBack()
...@@ -405,8 +586,7 @@ Page({ ...@@ -405,8 +586,7 @@ Page({
}, },
data: this.formatFormData(formData), data: this.formatFormData(formData),
success: (res) => { success: (res) => {
console.log(res, '上传成功了吗afhdhsfhhdsfhadsf') if(res.status===200){
if(res.statusCode===204){
wx.showToast({ wx.showToast({
title: '编辑成功', title: '编辑成功',
icon: 'success', icon: 'success',
...@@ -416,7 +596,7 @@ Page({ ...@@ -416,7 +596,7 @@ Page({
wx.navigateBack() wx.navigateBack()
}, 2000); }, 2000);
}else if(res.statusCode===400){ }else if(res.status===400){
wx.showToast({ wx.showToast({
title: res.data.message, title: res.data.message,
icon: 'error', icon: 'error',
......
This diff is collapsed.
...@@ -177,4 +177,172 @@ ...@@ -177,4 +177,172 @@
.enlarge-pic { .enlarge-pic {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
} }
\ No newline at end of file
/* pages/dangerregister/dangerregister.wxss */
.danger-register-wrapper {
width: 100%;
height: 100%;
}
.danger-form-wrapper {
width: 100vw;
margin: 0 auto;
/* background-color: #eee; */
padding-top: 2vh;
padding-bottom: 2vh;
}
.danger-order {
display: flex;
margin: 3vh 2vw;
background-color: white;
padding: 1vh 1vw;
}
.danger-order text {
flex-grow: 0;
flex-shrink: 0;
}
.danger-order input {
flex-grow: 1;
flex-shrink: 0;
}
.danger-check-date {
display: flex;
background-color: white;
margin: 3vh 5vw;
justify-content: space-between;
padding: 1vh 2vw;
border-radius: 5px;
box-shadow: 1rpx 1rpx 0.5rpx 0.5rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee;
}
.danger-check-date .danger-pick-date {
flex: 1;
text-align: right;
}
.danger-expert {
display: flex;
background-color: white;
margin: 3vh 5vw;
justify-content: space-between;
padding: 1vh 2vw;
border-radius: 5px;
box-shadow: 1rpx 1rpx 0.5rpx 0.5rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee;
}
.danger-name {
display: flex;
background-color: white;
margin: 3vh 5vw;
justify-content: space-between;
padding: 1vh 2vw;
border-radius: 5px;
box-shadow: 1rpx 1rpx 0.5rpx 0.5rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee;
}
.child-hdname {
padding: 20rpx;
border-radius: 5rpx;
box-shadow: 1rpx 1rpx 0.5rpx 0.5rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee;
margin: 10rpx 10rpx;
}
.danger-type {
display: flex;
background-color: white;
margin: 3vh 5vw;
justify-content: space-between;
padding: 1vh 2vw;
border-radius: 5px;
box-shadow: 1rpx 1rpx 0.5rpx 0.5rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee;
}
.danger-rect {
background-color: white;
margin: 3vh 5vw;
justify-content: space-between;
padding: 1vh 2vw;
border-radius: 5px;
box-shadow: 1rpx 1rpx 0.5rpx 0.5rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee;
}
.danger-img {
background-color: white;
margin: 3vh 5vw;
justify-content: space-between;
padding: 1vh 2vw;
border-radius: 5px;
box-shadow: 1rpx 1rpx 0.5rpx 0.5rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee;
}
.danger-img button {
background-color: #1d2089!important;
}
.danger-preview {
background-color: white;
margin: 3vh 5vw;
justify-content: space-between;
padding: 1vh 2vw;
border-radius: 5px;
box-shadow: 1rpx 1rpx 0.5rpx 0.5rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee;
}
.danger-preview image{
width: 100%;
}
.danger-rect-date {
display: flex;
background-color: white;
margin: 3vh 5vw;
justify-content: space-between;
padding: 1vh 2vw;
border-radius: 5px;
box-shadow: 1rpx 1rpx 0.5rpx 0.5rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee;
}
.danger-recept-per {
display: flex;
background-color: white;
margin: 3vh 5vw;
justify-content: space-between;
padding: 1vh 2vw;
border-radius: 5px;
box-shadow: 1rpx 1rpx 0.5rpx 0.5rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee;
}
.rect-img {
background-color: white;
margin: 3vh 5vw;
justify-content: space-between;
padding: 1vh 1vw;
}
.rect-preview {
background-color: white;
margin: 3vh 5vw;
justify-content: space-between;
padding: 1vh 1vw;
}
.danger-status {
display: flex;
background-color: white;
margin: 3vh 5vw;
justify-content: space-between;
padding: 1vh 2vw;
border-radius: 5px;
box-shadow: 1rpx 1rpx 0.5rpx 0.5rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee;
}
.danger-submit button {
background-color: #1d2089!important;
}
.c11-1 {
display: flex;
background-color: white;
margin: 3vh 5vw;
justify-content: space-between;
padding: 1vh 2vw;
border-radius: 5px;
box-shadow: 1rpx 1rpx 0.5rpx 0.5rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee;
}
\ No newline at end of file
This diff is collapsed.
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
<span wx:else>{{item.hdName}}</span> <span wx:else>{{item.hdName}}</span>
</view> </view>
<view > <view >
<span>整改中</span> <span>{{item.hdStatus}}</span>
</view> </view>
<view style="float: right; margin-top: 20px;"> <view style="float: right; margin-top: 20px;">
<button type="default" class="editBtn" size="mini" bindtap="editHD" data-index="{{index}}">查看</button> <button wx-if="{{item.hdStatus===1||item.hdStatus===3}}" type="default" class="editBtn" size="mini" bindtap="editHD" data-index="{{index}}">查看</button>
<button type="default" class="editBtn" size="mini" bindtap="editHD" data-index="{{index}}" >编辑</button> <button wx-if="{{item.hdStatus===0||item.hdStatus===2}}" type="default" class="editBtn" size="mini" bindtap="editHD" data-index="{{index}}" >编辑</button>
<button type="warn" class="delBtn" size="mini" data-index="{{index}}" bindtap="deleteHD">删除</button> <button wx-if="{{item.hdStatus===0}}" type="warn" class="delBtn" size="mini" data-index="{{index}}" bindtap="deleteHD">删除</button>
</view> </view>
</view> </view>
<view wx:if="{{dglist.length === 0}}" class="no-hd">暂无隐患</view> <view wx:if="{{dglist.length === 0}}" class="no-hd">暂无隐患</view>
......
...@@ -6,6 +6,8 @@ Page({ ...@@ -6,6 +6,8 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
inputEnterName: '',
animationSearch: {},
enterImgUrl: 'http://39.102.232.151:8030/cover/企业搜索icon.png', enterImgUrl: 'http://39.102.232.151:8030/cover/企业搜索icon.png',
verifyStatus: [{ verifyStatus: [{
name: '整合中', name: '整合中',
...@@ -25,8 +27,8 @@ Page({ ...@@ -25,8 +27,8 @@ Page({
value: 2 value: 2
}, },
], ],
selectedStatus: '', selectedStatusText: '',
selectedstatus: '', selectedStatusValue: '',
msgShow: false, msgShow: false,
dglist: [], dglist: [],
curEnterName: '', curEnterName: '',
...@@ -161,22 +163,77 @@ Page({ ...@@ -161,22 +163,77 @@ Page({
onShareAppMessage: function () { onShareAppMessage: function () {
// console.log('dgonshareappmessage') // console.log('dgonshareappmessage')
}, },
focusInputName(event) {
let repheight = 0
wx.getSystemInfoAsync({
success: (result) => {
repheight = result.windowHeight
},
})
this.repheight = repheight
console.log(this.repheight, 'this.repheight')
// animationsearch
//animationlist
const repAnimation = wx.createAnimation({
duration: 40,
timingFunction: 'linear'
})
this.animate1 = repAnimation
// repAnimation.translateY(-repheight/2 + 'px').scale(1).step()
repAnimation.top(0).scale(1.0).step()
this.setData({
animationsearch: repAnimation.export()
})
const tempAnimation = wx.createAnimation({
durartion: 400,
timingFunction: 'linear'
})
this.animate2 = tempAnimation
tempAnimation.opacity(1).step()
this.setData({
animationlist: tempAnimation.export()
})
},
/**
* 输入企业信息
*/
// enterNameInput(event) {
// this.data.inputEnterName = event.detail.value
// },
/**
* 触摸面板 搜索企业信息
*/
enterNameConfirm(event) {
this.data.inputEnterName = event.detail.value
this.getDataList()
},
getDataList() { getDataList() {
wx.showLoading({
title: '加载中',
})
let reqParam = {
county: app.globalData.appCounty,
// companyId: app.globalData.currentEnter.companyId,
enName: this.data.inputEnterName,
verifyState: this.data.selectedstatusValue,
sort: 'verify_status,asc',
page: 0,
size: 99999
}
if(!reqParam.verifyState){
delete reqParam['verifyState']
}
if(!reqParam.enName){
delete reqParam['enName']
}
wx.request({ wx.request({
url: app.globalData.appBaseUrl + '/api/hiddenDangerToVerify', url: app.globalData.appBaseUrl + '/api/hiddenDangerToVerify',
method: 'GET', method: 'GET',
header: { header: {
Authorization: app.globalData.Authorization Authorization: app.globalData.Authorization
}, },
data: { data: reqParam,
county: app.globalData.appCounty,
// companyId: app.globalData.currentEnter.companyId,
// enName: '',
// verifyState: this.selectedstatus,
sort: 'verify_status,asc',
page: 0,
size: 99999
},
header: { header: {
Authorization: app.globalData.Authorization Authorization: app.globalData.Authorization
}, },
...@@ -199,9 +256,10 @@ Page({ ...@@ -199,9 +256,10 @@ Page({
chooseCounty(e) { chooseCounty(e) {
let that = this; let that = this;
this.setData({ this.setData({
selectedStatus: that.data.verifyStatus[e.detail.value].name, selectedStatusText: that.data.verifyStatus[e.detail.value].name,
selectedstatus: that.data.verifyStatus[e.detail.value].value selectedstatusValue: that.data.verifyStatus[e.detail.value].value
}) })
this.getDataList()
}, },
/** /**
* 审核通过 * 审核通过
...@@ -308,12 +366,12 @@ Page({ ...@@ -308,12 +366,12 @@ Page({
placeholderText: '请输入审核拒绝原因', placeholderText: '请输入审核拒绝原因',
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
if(!res.content){ if (!res.content) {
wx.showToast({ wx.showToast({
title: '原因不能为空', title: '原因不能为空',
icon: 'error', icon: 'error',
duration: 2000 duration: 2000
}) })
return return
} }
that.confirmRefuse(id, res.content) that.confirmRefuse(id, res.content)
......
<!--pages/dangerlist/dangerlist.wxml--> <!--pages/dangerlist/dangerlist.wxml-->
<!-- bindtap="addNewHD" wx:if="{{!(curRole=='政府')}}">新增</button> --> <!-- bindtap="addNewHD" wx:if="{{!(curRole=='政府')}}">新增</button> -->
<view class="search-wrapper"> <view class="search-wrapper">
<input type="text" class="enter-name-input" placeholder="请输入企业名称" value="{{inputEnterName}}" confirm-type="search" bindconfirm="enterNameConfirm" bindinput="enterNameInput" bindfocus="focusInputName" bindblur="blurInputName" animation="{{animationSearch}}" bindfocus="searchInputFocus"> <input type="text" class="enter-name-input" placeholder="请输入企业名称" value="{{inputEnterName}}" confirm-type="search" bindconfirm="enterNameConfirm" bindinput="enterNameInput">
<image class="enter-img" src="{{enterImgUrl}}" alt="error"></image> <image class="enter-img" src="{{enterImgUrl}}" alt="error"></image>
</input> </input>
</view> </view>
<view class="choose-county"> <view class="verfyStatusWrapper">
<picker header-text="选择状态" mode="selector" range="{{verifyStatus}}" range-key="name" bindchange="chooseCounty"> <picker header-text="选择状态" mode="selector" range="{{verifyStatus}}" range-key="name" bindchange="chooseCounty">
审核状态: 审核状态:
<span> {{selectedStatus}}</span> <span> {{selectedStatusText}}</span>
</picker> </picker>
</view> </view>
<view class="dangerlist-wrapper"> <view class="dangerlist-wrapper">
...@@ -21,12 +19,12 @@ ...@@ -21,12 +19,12 @@
<span wx:else>{{item.hdName}}</span> <span wx:else>{{item.hdName}}</span>
</view> </view>
<view> <view>
<span>整改中</span> <span>{{item.verifyStatus}}</span>
</view> </view>
<view style="float: right; margin-top: 20px;"> <view style="float: right; margin-top: 20px;">
<button type="default" class="editBtn" size="mini" bindtap="detail" data-index="{{index}}">查看</button> <button type="default" class="editBtn" size="mini" bindtap="detail" data-index="{{index}}">查看</button>
<button type="default" class="editBtn" size="mini" bindtap="pass" data-index="{{index}}">通过</button> <button type="default" class="editBtn" wx-if="{{item.verifyStatus===3}}" size="mini" bindtap="pass" data-index="{{index}}">通过</button>
<button type="default" class="editBtn" size="mini" bindtap="refuse" data-index="{{index}}">拒绝</button> <button type="default" class="editBtn" wx-if="{{item.verifyStatus===3}}" size="mini" bindtap="refuse" data-index="{{index}}">拒绝</button>
</view> </view>
</view> </view>
<view wx:if="{{dglist.length === 0}}" class="no-hd">暂无数据</view> <view wx:if="{{dglist.length === 0}}" class="no-hd">暂无数据</view>
......
/* pages/dangerlist/dangerlist.wxss */ /* pages/dangerlist/dangerlist.wxss */
.verfyStatusWrapper{
margin-top: 120rpx;
margin-left: 30rpx;
/* position: relative;
top: 120rpx;
left: 20rpx; */
}
.enterprises-wrapper { .enterprises-wrapper {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
...@@ -47,7 +56,7 @@ ...@@ -47,7 +56,7 @@
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
position: relative; position: relative;
padding-top: 120rpx; padding-top: 40rpx;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
} }
......
...@@ -277,15 +277,6 @@ Page({ ...@@ -277,15 +277,6 @@ Page({
* 拍照 * 拍照
*/ */
takePhoto() { takePhoto() {
// const ctx = wx.createCameraContext()
// ctx.takePhoto({
// quality: 'high',
// success: (res) => {
// this.setData({
// imgsrc: res.tempImagePath
// })
// }
// })
wx.chooseImage({ wx.chooseImage({
success: (res) => { success: (res) => {
this.data.hdFilePath = res.tempFilePaths[0] this.data.hdFilePath = res.tempFilePaths[0]
...@@ -293,8 +284,6 @@ Page({ ...@@ -293,8 +284,6 @@ Page({
filePath: res.tempFilePaths[0], // 选择图片返回的相对路径 filePath: res.tempFilePaths[0], // 选择图片返回的相对路径
encoding: 'base64', //编码格式 encoding: 'base64', //编码格式
success: res1 => { // 成功的回调 success: res1 => { // 成功的回调
// console.log('data:image/png;base64, ' + res1.data)
// this.imgsrc = 'data:image/png;base64,' + res1.data
this.setData({ this.setData({
imgsrcurl: 'data:image/png;base64,' + res1.data imgsrcurl: 'data:image/png;base64,' + res1.data
}) })
...@@ -364,14 +353,55 @@ Page({ ...@@ -364,14 +353,55 @@ Page({
}, },
// 提交隐患 // 提交隐患
submitDanger() { submitDanger() {
if(!this.data.imgsrcurl){
wx.showToast({ if(!this.data.hdInspectDate){
title: '没有隐患照片', wx.showToast({
icon: 'error', title: '检查日期不能为空',
duration: 1000 icon: 'error',
}) duration: 1000
return })
} return
}
if (!this.data.curSelectSecType) {
wx.showToast({
title: '请选择安全类别',
icon: 'error',
duration: 1000
})
return;
}
if (!this.data.curSelectSecCheckTypeReplace) {
wx.showToast({
title: '请选择安全检查类别',
icon: 'error',
duration: 1000
})
return;
}
if (!this.data.curSelectCheckContent) {
wx.showToast({
title: '请选择安全检查内容',
icon: 'error',
duration: 1000
})
return;
}
if (!this.data.hdName) {
wx.showToast({
title: '请选择发现问题',
icon: 'error',
duration: 1000
})
return;
}
if(!this.data.imgsrcurl){
wx.showToast({
title: '没有隐患照片',
icon: 'error',
duration: 1000
})
return
}
console.log(this.data.curRole) console.log(this.data.curRole)
if (this.data.hdFilePath) { if (this.data.hdFilePath) {
let county = app.globalData.appCounty let county = app.globalData.appCounty
...@@ -405,7 +435,9 @@ Page({ ...@@ -405,7 +435,9 @@ Page({
url: app.globalData.appBaseUrl + '/api/thHiddenDanger', url: app.globalData.appBaseUrl + '/api/thHiddenDanger',
formData: formData, formData: formData,
header: { header: {
Authorization: app.globalData.Authorization Authorization: app.globalData.Authorization,
chartset: 'utf-8',
'content-type': 'application/x-www-form-urlencoded'
}, },
success: (res) => { success: (res) => {
console.log(res, '文件上传') console.log(res, '文件上传')
...@@ -447,7 +479,7 @@ Page({ ...@@ -447,7 +479,7 @@ Page({
} else { } else {
delete formData.hdInspectDate delete formData.hdInspectDate
} }
if(that.data.comment==''||that.data.comment==null||!that.data.comment){ if(!that.data.comment){
delete formData.comment delete formData.comment
} }
if (formData.hdRectificationDate) { if (formData.hdRectificationDate) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment