Commit 310430e1 authored by xinzhedeai's avatar xinzhedeai

应急演练

parent 00d42871
...@@ -111,7 +111,7 @@ window.addEventListener("load", function() { ...@@ -111,7 +111,7 @@ window.addEventListener("load", function() {
http.get('/api/dangerJobReport/page', { http.get('/api/dangerJobReport/page', {
page: 0, // 每次请求增加下一页 page: 0, // 每次请求增加下一页
size: 1, size: 1,
// companyId: gemhoUtil.getParameter('companyId'), // companyId: localStorage.getItem('companyId'),
id: gemhoUtil.getParameter('dwId'), id: gemhoUtil.getParameter('dwId'),
sort: 'id,asc', sort: 'id,asc',
}).then((res) => { }).then((res) => {
......
...@@ -33,7 +33,7 @@ window.addEventListener("load", function() { ...@@ -33,7 +33,7 @@ window.addEventListener("load", function() {
http.get('/api/dangerJobReport/page',{ http.get('/api/dangerJobReport/page',{
page: this.page++,// 每次请求增加下一页 page: this.page++,// 每次请求增加下一页
size: this.size, size: this.size,
// companyId: gemhoUtil.getParameter('companyId'), // companyId: localStorage.getItem('companyId'),
county: localStorage.getItem('appCounty'), county: localStorage.getItem('appCounty'),
sort: 'id,desc', sort: 'id,desc',
}).then((res)=>{ }).then((res)=>{
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, viewprot-fit:cover">
<title>应急演练-详情</title>
<script type="text/javascript" src="../js/includeHead.js"></script>
<style>
html,
body {
background-color: #fff;
}
/* 表单相关 */
.formValue {
float: right;
}
/**
* 框架样式覆盖修改
*/
.van-cell__value {
overflow: unset;
}
.van-cell:after {
border-bottom: none;
}
</style>
</head>
<body>
<div id="app">
<div class="content" v-cloak :class="{'disable-van-cell': !disabled}">
<span style="font-size: 16px; color #000; font-weight: bold;margin-left:0.25rem;" >演练任务</span>
<van-cell-group>
<van-field v-model="form.planName" :disabled="true" label="计划名称" placeholder="" />
</van-cell-group>
<van-cell-group>
<van-field v-model="form.publishDept" :disabled="true" label="发布部门" placeholder="" />
</van-cell-group>
<van-cell-group>
<van-field v-model="form.publishDate" :disabled="true" label="发布时间" placeholder="" />
</van-cell-group>
<van-cell-group>
<van-field v-model="form.publishDesc" :disabled="true" label="演练描述" placeholder="" />
</van-cell-group>
<span style="font-size: 16px; color #000; font-weight: bold; margin-left:0.25rem" >演练情况</span>
<van-button v-if="!disabled" type="info" size="small" @click="submit" style="margin-left: 4.2rem;width: 1.2rem; height:0.6rem;}">提交</van-button>
<div>
<van-cell-group>
<van-field v-model="form.issueDescription" :disabled="disabled" label="发现问题" placeholder="" />
</van-cell-group>
<van-cell-group>
<van-field v-model="form.processDescription" :disabled="disabled" label="过程描述" placeholder="" />
</van-cell-group>
<van-cell-group :class="{'disable-van-cell': true}" v-show="form.filePathList[0]">
<van-cell>文件预览:
<div style="width: 6.5rem;">
<van-image
v-show="(form.filePathList[0]) && (form.filePathList[0].indexOf('.png')>-1 || form.filePathList[0].indexOf('.jpg')>-1 || form.filePathList[0].indexOf('.jpeg')>-1)"
width="100"
height="100"
:src="previewUrl+'/' + form.filePathList[0]"
/>
</div>
<span v-show="form.filePathList[0] && !disabled" style="font-weight: bold; cursor: pointer;" @click="form.filePathList=[];fileList=[]"> 删除</span>
</van-cell>
</van-cell-group>
<van-cell-group v-show="!form.filePathList[0]" :class="{'disable-van-cell': disabled}">
<van-cell>文件:
<div style="width: 2.5rem;">
<van-uploader v-model="fileList"
accept=".jpg,.jpeg,.png"
:preview-image="false"
:before-upload="beforeUpload"
:after-read="afterRead"
:max-count="1" :deletable="!disabled" :preview-full-image="false">
<van-button v-show="!form.filePathList.length" size="mini" icon="plus" type="primary">上传文件</van-button>
</van-uploader>
</div></van-cell>
</van-cell-group>
<van-cell-group :class="{'disable-van-cell': disabled}">
<van-cell is-link @click="showPopup('showPopup4completionDate')">报告时间<span class="formValue">{{form.completionDate}}</span></van-cell>
<van-popup v-model="showPopup4completionDate" position="bottom" :style="{ height: '30%' }">
<van-datetime-picker v-model="completionDate" type="date" title="选择年月日" @confirm="confirm4completionDate" @cancel="showPopup4completionDate=false" />
</van-popup>
</van-cell-group>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
/**
* author: dabao
*/
var VUE = null
window.addEventListener("load", function() {
VUE = new Vue({
el: '#app',
data() {
return {
form: {
id: "",
// companyIds: [],
// 企业id
planName: "",
// 验收人
publishDate: "",
// 隐患描述
publishDeptName: "",
publishDesc: "",
filePathList: [],
completionDate: "",
issueDescription: "",
processDescription: "",
},
// 整改日期模态框
completionDate: '',
showPopup4completionDate: false,
// companyId: localStorage.getItem('companyId'),
previewUrl: axios.defaults.baseURL,
disabled: false,
fileList: [],
}
},
mounted() {
this.detail()
},
methods: {
submit() {
if (!this.form.completionDate) {
vant.Dialog.alert({
message: '请输入演练完成日期',
})
return;
}
if (!this.form.issueDescription) {
vant.Dialog.alert({
message: '请输入发现问题',
})
return;
}
if (!this.form.processDescription) {
vant.Dialog.alert({
message: '请输入过程描述',
})
return;
}
var reqParam = {
companyId: localStorage.getItem('companyId'),
drillPhotoList: this.form.filePathList,
planId: gemhoUtil.getParameter('planId'),
// planName: this.form.planName,
processDescription: this.form.processDescription,
issueDescription: this.form.issueDescription,
completionDate: this.form.completionDate
}
var url = "/api/enterpriseDrills"
http.post(url, reqParam).then((res) => {
console.log('添加结果', res)
vant.Toast({
message: '操作成功',
})
history.back()
})
},
previewFile(){
// var src = 'emergencydrill/e40eda16-7a86-4a2a-976b-892e17eeed49.pdf'
// location.href = './pdfViewer.html?pdfSrc='+ src
console.log(this.previewUrl + '/' + this.form.filePathList[0])
location.href = this.previewUrl + '/' + this.form.filePathList[0]
},
beforeUpload(file) {
console.log('beforeUpload',file)
// 在文件上传之前的处理逻辑,例如校验文件大小、文件类型等
return true; // 返回 true 继续上传,返回 false 中止上传
},
afterRead(file) {
console.log('afterRead',file)
// 文件读取完成后的处理逻辑
const formData = new FormData();
formData.append('file', file.file); // 通过FormData构建要上传的文件数据
formData.append('modelName', 'emergencydrill');
// 发送HTTP POST请求
fetch(this.previewUrl + '/api/common/upload', {
method: 'POST',
body: formData
})
.then(response => {
if (response.ok) {
return response.json();
}
throw new Error('Network response was not ok.');
})
.then(data => {
console.log(data); // 处理后端返回的数据
// 可根据后端返回的数据做进一步处理,如显示上传成功信息等
this.form.filePathList = data.body ? [data.body] : []
})
.catch(error => {
console.error('There has been a problem with your fetch operation:', error);
});
},
showPopup(popupType) {
if (!this.disabled) {
this[popupType] = true
}
},
confirm4completionDate(value) {
console.log('value', value)
this.form.completionDate = gemhoUtil.formatDate(new Date(value))
this.showPopup4completionDate = false
},
getEnterprisePlansCompanyDetail() {
},
// 整改后照片
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(){
http.get('/api/enterpriseDrills', {
page: 0, // 每次请求增加下一页
size: 1,
planId: gemhoUtil.getParameter('planId'),
companyId: localStorage.getItem('companyId'),
}).then((res) => {
this.loading = false; // 加载状态结束
this.form = res.body.content[0]
if(this.form.completionStatus===1){
this.disabled = true
}else{
this.disabled = false
}
this.form.filePathList = this.form.drillPhotoList || [];
})
},
},
});
});
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, viewprot-fit:cover">
<title>应急演练-列表</title>
<script type="text/javascript" src="../js/includeHead.js"></script>
<style>
/**
* 框架样式覆盖修改
*/
.van-cell__value{overflow: unset; }
.van-cell:after{border-bottom:none;}
</style>
</head>
<body>
<div id="app">
<div class="search-wrapper">
<van-search v-model="planName" placeholder="请输入计划名称" @search="onSearch" @clear="onClear" />
</div>
<div class="content" v-cloak>
<van-list v-model:loading="loading" :offset="10" :finished="finished" finished-text="没有更多了" @load="getList">
<van-cell v-for="(item, index) in list" :key="item">
<div class="list-item-wrapper" @click="detail(item)">
<p class="list-status-tag">
<van-tag :type="item.completionStatus==1?'primary':'warning'" size="mini">{{item.completionStatus==1 ? '完成': '未完成'}}</van-tag>
</p>
<p class="">
计划名称:{{item.planName}}
</p>
<p class="">
发布日期:{{item.publishDate}}
</p>
<p class="">
演练描述:{{item.publishDesc}}
</p>
</div>
</van-cell>
</van-list>
</div>
</div>
</body>
</html>
\ No newline at end of file
/**
* author: dabao
*/
var VUE = null
window.addEventListener("load", function() {
VUE = new Vue({
el: '#app',
data() {
return {
planName: '',
value: '',
list: [],
loading: false,
finished: false,
page: 0,
size: 10,
total: 0
}
},
mounted() {
this.getList()
},
methods: {
detail(item){
gemhoUtil.navigatePage('./emergency-detail.html?planId='+item.id)
},
resetSearchForm(){
this.page = 0
this.size = 20
this.total = 0
this.list = []
this.finished = false;
},
onClear(){
this.resetSearchForm()
this.getList()
},
onSearch(val){
this.resetSearchForm()
console.log('search', val)
this.getList()
},
exportFile(item){
http.downloadFile('/api/dangerJobReport/export',{
fileType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
fileName: 'DW-'+ gemhoUtil.getTargetDateYMD().replaceAll('-', '') +'.xlsx'
}).then((res)=>{
vant.Toast({
message: '操作成功',
})
this.loading = false; // 加载状态结束
})
},
add(){
gemhoUtil.navigatePage('./dw-list-detail.html?type=add')
},
edit(item){
gemhoUtil.navigatePage('./dw-list-detail.html?dwId='+item.id+'&type=edit')
},
getList(){
http.get('/api/enterpriseDrillPlans/company',{
page: this.page++,// 每次请求增加下一页
size: this.size,
planName: this.planName,
companyId: localStorage.getItem('companyId'),
}).then((res)=>{
this.loading = false; // 加载状态结束
this.list.push(...res.body.content);
this.total = res.body.totalElements
if(this.page*this.size >= this.total){
this.finished = true; // 下滑不在刷新数据
}
})
}
},
});
});
\ No newline at end of file
...@@ -21,10 +21,10 @@ window.addEventListener("load", function() { ...@@ -21,10 +21,10 @@ window.addEventListener("load", function() {
}, },
methods: { methods: {
detail(item){ detail(item){
gemhoUtil.navigatePage('./yh-list-detail.html?companyId='+gemhoUtil.getParameter('companyId')+'&hdId='+item.hdId+'&type=detail') gemhoUtil.navigatePage('./yh-list-detail.html?companyId='+localStorage.getItem('companyId')+'&hdId='+item.hdId+'&type=detail')
}, },
edit(item){ edit(item){
gemhoUtil.navigatePage('./yh-list-detail.html?companyId='+gemhoUtil.getParameter('companyId')+'&hdId='+item.hdId+'&type=edit') gemhoUtil.navigatePage('./yh-list-detail.html?companyId='+localStorage.getItem('companyId')+'&hdId='+item.hdId+'&type=edit')
}, },
getList(){ getList(){
http.get('/api/thHiddenDanger',{ http.get('/api/thHiddenDanger',{
......
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