Commit b11c6f9a authored by xinzhedeai's avatar xinzhedeai

整改图片显示

parent ec25d8b5
...@@ -62,14 +62,14 @@ ...@@ -62,14 +62,14 @@
<span>隐患审核</span> <span>隐患审核</span>
</p> </p>
</div> </div>
<div class="item"> <!-- <div class="item">
<p class="bgImg" @click="nav('dw-list')"> <p class="bgImg" @click="nav('dw-list')">
<span>危险作业备案</span> <span>危险作业备案</span>
</p> </p>
<p class="bgImg" @click="nav('notice-list')"> <p class="bgImg" @click="nav('notice-list')">
<span>通知公告</span> <span>通知公告</span>
</p> </p>
</div> </div> -->
</div> </div>
</div> </div>
</body> </body>
......
...@@ -47,7 +47,7 @@ var userInfo = { ...@@ -47,7 +47,7 @@ var userInfo = {
} }
} }
var token ="Bearer eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiI2NmYxMGZlZWU1MTc0OTMxOTdiZjE0ZTk3ODhmZDBmYiIsInVzZXIiOiJhZG1pbiIsInN1YiI6ImFkbWluIn0.t8LqWVN2NzmbkGv5jf5Nkpla3ndkP8lkMBNvVT16VDEBtEwZXIalk-fjLTZAX8VZ3dspMgWvSHBRQsXYtjJULw"; var token ="Bearer eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiJhY2QyN2QzYmQ3YWY0OTY2YTU0Zjg1N2ZhMTFhN2M0MCIsInVzZXIiOiJhZG1pbiIsInN1YiI6ImFkbWluIn0.AMQx1ywGtp49yUTuO25p6ERTP7uGM90TQQafsQaRXeRZ2yZ8LzZoTv4g28MoLG3miFmYd9sv4ubKUT6b2Fcx1g";
localStorage.setItem('Authorization', token) localStorage.setItem('Authorization', token)
localStorage.setItem('appCounty', userInfo.user.county) localStorage.setItem('appCounty', userInfo.user.county)
......
...@@ -25,9 +25,25 @@ axios.interceptors.request.use(config => { ...@@ -25,9 +25,25 @@ axios.interceptors.request.use(config => {
axios.interceptors.response.use((res) => { axios.interceptors.response.use((res) => {
// 成功的响应数据 服务器的相关的数据返回来之后,响应拦截器能够检测到,可以做一些事 // 成功的响应数据 服务器的相关的数据返回来之后,响应拦截器能够检测到,可以做一些事
let response = res.data
console.log('res.statusCode', res)
if(response.statusCode >= 300||response.status >= 300){
// alert('系统发生错误')
vant.Dialog.alert({
title: '信息提示',
message: response.message,
})
return
}
vant.Toast.clear() vant.Toast.clear()
return res; return res;
}, (error) => { }, (error) => {
console.log('res.statusCode error', error)
vant.Dialog.alert({
title: '信息提示',
message: '网络错误',
})
// 响应失败的时候的回调函数 // 响应失败的时候的回调函数
return Promise.reject(new Error(error)) return Promise.reject(new Error(error))
}) })
...@@ -57,6 +73,7 @@ var http = { ...@@ -57,6 +73,7 @@ var http = {
}) })
.then(res => { .then(res => {
let response = res.data let response = res.data
debugger
console.log('res.statusCode', response) console.log('res.statusCode', response)
if(response.statusCode >= 300||response.status >= 300){ if(response.statusCode >= 300||response.status >= 300){
// alert('系统发生错误') // alert('系统发生错误')
...@@ -146,16 +163,6 @@ var http = { ...@@ -146,16 +163,6 @@ var http = {
'Authorization': localStorage.getItem('Authorization') 'Authorization': localStorage.getItem('Authorization')
}, },
}).then(res => { }).then(res => {
let response = res.data
console.log('res.statusCode', response)
if(response.statusCode >= 300||response.status >= 300){
// alert('系统发生错误')
vant.Dialog.alert({
title: '信息提示',
message: response.message,
})
return
}
resolve(res.data) resolve(res.data)
}) })
.catch(err => { .catch(err => {
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</van-popup> </van-popup>
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="form.hdDesc" :disabled="!editAble" label="隐患描述" placeholder="" /> <van-field v-model="form.comment" :disabled="!editAble" label="隐患描述" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="form.basis" :disabled="!editAble" label="检查依据" placeholder="" /> <van-field v-model="form.basis" :disabled="!editAble" label="检查依据" placeholder="" />
......
...@@ -122,13 +122,13 @@ window.addEventListener("load", function() { ...@@ -122,13 +122,13 @@ window.addEventListener("load", function() {
}) })
}, },
submit() { submit() {
if (!this.form.hdInspectDate) { if (!this.form.hdInspectDate) {
vant.Dialog.alert({ vant.Dialog.alert({
message: '检查日期不能为空', message: '检查日期不能为空',
}) })
return return
} }
this.form.hdInspectDate = this.form.hdInspectDate.replace(' 00:00:00', '') + ' 00:00:00'
if (!this.form.curSelectSecType) { if (!this.form.curSelectSecType) {
vant.Dialog.alert({ vant.Dialog.alert({
message: '请选择安全类别', message: '请选择安全类别',
...@@ -153,7 +153,7 @@ window.addEventListener("load", function() { ...@@ -153,7 +153,7 @@ window.addEventListener("load", function() {
}) })
return; return;
} }
if (!this.form.hdDesc) { if (!this.form.comment) {
vant.Dialog.alert({ vant.Dialog.alert({
message: '请填写隐患描述', message: '请填写隐患描述',
}) })
...@@ -208,9 +208,7 @@ window.addEventListener("load", function() { ...@@ -208,9 +208,7 @@ window.addEventListener("load", function() {
}) })
// }, 0) // }, 0)
if(!this.form.hdId){ // 添加时则 history.back()
location.reload()
}
}) })
}, },
formatDate(date, type) { formatDate(date, type) {
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<van-field v-model="form.hdName" :disabled="!editAble" label="发现问题" placeholder="" /> <van-field v-model="form.hdName" :disabled="!editAble" label="发现问题" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="form.hdDesc" :disabled="!editAble" label="隐患描述" placeholder="" /> <van-field v-model="form.comment" :disabled="!editAble" label="隐患描述" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-cell>隐患照片: <van-cell>隐患照片:
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<van-cell>整改后照片: <van-cell>整改后照片:
<div style="width: 2.5rem;"> <div style="width: 2.5rem;">
<van-image width="100" height="100" <van-image width="100" height="100"
:src="'data:image/jpg;base64,' + form.hdRectificationPic" /> :src="form.hdRectificationPic" />
</div> </div>
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>
...@@ -71,9 +71,9 @@ ...@@ -71,9 +71,9 @@
<van-field v-model="form.verifyStatusString" label="审核状态" placeholder="" /> <van-field v-model="form.verifyStatusString" label="审核状态" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="form.hdAcceptancePerson" label="审核人员" placeholder="" /> <van-field v-model="form.reviewer" label="审核人员" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group v-if="form.verifyStatus===2">
<van-field v-model="form.refuseReason" type="textarea" label="整改未过审原因" autosize <van-field v-model="form.refuseReason" type="textarea" label="整改未过审原因" autosize
placeholder="" /> placeholder="" />
</van-cell-group> </van-cell-group>
......
...@@ -8,28 +8,29 @@ window.addEventListener("load", function() { ...@@ -8,28 +8,29 @@ window.addEventListener("load", function() {
data() { data() {
return { return {
form: { form: {
enterpriseSubmitsTheRectificationDate: '',//2024-03-08 00:00:00', enterpriseSubmitsTheRectificationDate: '',//2024-03-08 00:00:00',
// 检查人员 // 检查人员
hdInspectExpert: '',//'发发发', hdInspectExpert: '',//'发发发',
// 发现问题 // 发现问题
hdName: '',//'测试问题', comment: '',//'隐患描述',
// 检查依据 // 检查依据
basis: '',//'测试依据', basis: '',//'测试依据',
// 隐患整改建议 // 隐患整改建议
verifyStatus: '',
// 隐患整改日期 // 隐患整改日期
hdRectificationDate: '',//'2024-03-08', hdRectificationDate: '',//'2024-03-08',
// 隐患整改图片 // 隐患整改图片
hdRectificationPic: '', hdRectificationPic: '',
hdPic: '', hdPic: '',
// 审核人 // 审核人
hdAcceptancePerson: "刘德华", reviewer: "",
recEvaluation: '24年02月22日 审核未通过;24年02月22日 审核未通过', recEvaluation: '',
verifyStatusString: '', // 审核状态 verifyStatusString: '', // 审核状态
}, },
// 企业id // 企业id
companyId: localStorage.getItem('companyId'), // companyId: localStorage.getItem('companyId'),
editAble: true, editAble: false,
} }
}, },
mounted() { mounted() {
...@@ -37,19 +38,32 @@ window.addEventListener("load", function() { ...@@ -37,19 +38,32 @@ window.addEventListener("load", function() {
}, },
methods: { methods: {
// 整改后照片
transferUrl(hdRectificationPic) {
console.log(hdRectificationPic);
if (hdRectificationPic) {
return (
axios.defaults.baseURL +
"/hd_rectification_pic_to_verify/" +
hdRectificationPic.split("\\hd_rectification_pic_to_verify\\")[1]
);
} else {
return null;
}
},
detail(){ detail(){
var hdId = gemhoUtil.getParameter('hdId') var id = gemhoUtil.getParameter('id')
http.get('/api/hiddenDangerToVerify', { http.get('/api/hiddenDangerToVerify', {
page: 0, // 每次请求增加下一页 page: 0, // 每次请求增加下一页
size: 1, size: 1,
county: localStorage.getItem('appCounty'), county: localStorage.getItem('appCounty'),
hd_id: hdId, id,
// enName: this.companyName, // enName: this.companyName,
sort: 'verify_status,asc', sort: 'verify_status,asc',
}).then((res) => { }).then((res) => {
this.loading = false; // 加载状态结束 this.loading = false; // 加载状态结束
this.form = res.content[0] this.form = res.content[0]
this.form.hdRectificationPic = this.transferUrl(this.form.hdRectificationPic)
}) })
}, },
}, },
......
...@@ -113,18 +113,22 @@ window.addEventListener("load", function() { ...@@ -113,18 +113,22 @@ window.addEventListener("load", function() {
}) })
}, },
detail(item) { detail(item) {
gemhoUtil.navigatePage('./yh-verify-detail.html?companyId=' + gemhoUtil.getParameter('companyId') + gemhoUtil.navigatePage('./yh-verify-detail.html?id=' + item.id + '&type=detail')
'&hdId=' + item.hdId + '&type=detail')
}, },
getList() { getList() {
http.get('/api/hiddenDangerToVerify', { var reqParam = {
page: this.page++, // 每次请求增加下一页 page: this.page++, // 每次请求增加下一页
size: this.size, size: this.size,
county: localStorage.getItem('appCounty'), county: localStorage.getItem('appCounty'),
verifyState: this.curVerifyStatusVal,
enName: this.companyName,
sort: 'verify_status,asc', sort: 'verify_status,asc',
}).then((res) => { }
if(this.curVerifyStatusVal){
reqParam.verifyState = this.curVerifyStatusVal
}
if(this.companyName){
reqParam.enName = this.companyName
}
http.get('/api/hiddenDangerToVerify', reqParam).then((res) => {
this.loading = false; // 加载状态结束 this.loading = false; // 加载状态结束
this.list.push(...res.content); this.list.push(...res.content);
......
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