提交应急

This commit is contained in:
”Rain“ 2024-05-22 00:12:45 +08:00
parent 36db958732
commit efeceec3fe
13 changed files with 250 additions and 105 deletions

View File

@ -6,8 +6,12 @@ import request from "@/utils/request.js"
export function deviceLogin(data) {
// 设备、人员登录
// return request.post({
// url: "/xmgl/base/device/login",
// data
// })
return request.post({
url: "/xmgl/base/device/login",
url: "xmgl/workerInfo/selectWorkerInfoByIdCard",
data
})
}

View File

@ -5,7 +5,7 @@
应急警报
</view>
</headers>
<view class="item-boxs">
<view class="item-boxs" :style="{ 'margin-top': (statusBarHeight+52) + 'px' }">
<view class="item-box">
<view class="title">
应急类型
@ -22,7 +22,7 @@
<view class="title">
应急详情
</view>
<textarea class="textareaType" v-model="emergencyInfo.emergencyDetail" placeholder="请选择应急详情,描述当时情况" />
<textarea class="textareaType" maxlength="-1" v-model="emergencyInfo.emergencyDetail" placeholder="请选择应急详情,描述当时情况" />
</view>
<view class="item-box">
<view class="title">
@ -32,26 +32,29 @@
<view class="uploadImg">
<text>上传图片</text>
<view class="uni-form-input imgBox_wrap">
<view class="imgBox" v-show="imgFileList.length>0" v-for="(item,index) in imgFileList"
:key="index">
<image :src="url_config+'image/'+item.url" class="img"
@click="previewImage(url_config+'image/'+item.url)">
</image>
<view @click="deleteImg(item,1)" style="margin: 5px;" class="deleteImg">×</view>
<view v-show="imgFileList.length>0">
<view class="imgBox" v-for="(item,index) in imgFileList"
:key="index">
<image :src="url_config+'image/'+item.url" class="img"
@click="previewImage(url_config+'image/'+item.url)">
</image>
<view @click="deleteImg(item,1)" style="margin: 5px;" class="deleteImg">×</view>
</view>
</view>
<view class="addImgBox" @click="uploadImg(1)" v-if="imgFileList.length<5">
<view class="addImgBox" @click="uploadImg(1)" v-if="imgFileList.length<1">
<image src="/static/icon-add.png" class="icon-add"></image>
</view>
</view>
</view>
<view class="uploadImg">
<text>视频(mp4)附件</text>
<view v-if="videoFileList.length>0" class="imgBox flex2"
v-for="(item,index) in videoFileList" :key="index">
<view
style="color: #4181FE;width: 100%;white-space: nowrap; overflow: hidden;text-overflow: ellipsis;"
@click="playVideo(url_config+'image/'+item.url,'video')">
{{item.name}}
<view v-if="videoFileList.length>0" class="imgBox flex2">
<view style="overflow: hidden;" v-for="(item,index) in videoFileList" :key="index">
<view
style="color: #4181FE;width: 100%;white-space: nowrap; overflow: hidden;text-overflow: ellipsis;"
@click="playVideo(url_config+'image/'+item.url,'video')">
{{item.name}}
</view>
</view>
<view @click="deleteImg(item,2)" style="margin: 5px;color: gray;right: 0%;"
class="deleteImg">×
@ -66,7 +69,7 @@
<view class="item-box_address">
<view class="address">
<text>事发地</text>
<input class="inputAddress" v-model="emergencyInfo.incidentSite" placeholder="请输入详细地址" />
<input class="inputAddress" readonly disabled v-model="emergencyInfo.incidentSite" placeholder="请获取地址" />
</view>
<view class="getaddress" @click="getAddress()">
<text class="round"></text>
@ -116,7 +119,9 @@
},
onLoad(options) {
this.id = options.id;
this.projectSn = uni.getStorageSync('devInfoList')[0].projectSn;
console.log(uni.getStorageSync('devInfoList'));
this.projectSn = uni.getStorageSync('devInfoList').projectSn;
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight
console.log(options);
emergencyRecordQueryById({
projectSn: this.projectSn,
@ -152,6 +157,27 @@
methods: {
emergencyEdit() {
var that = this;
if(!this.emergencyInfo.emergencyTypeId){
uni.showToast({
title: "请输入类型",
icon: "none"
})
return
}
if(!this.emergencyInfo.emergencyDetail){
uni.showToast({
title: "请输入详情",
icon: "none"
})
return
}
if(!this.addressList){
uni.showToast({
title: "请输入事发地",
icon: "none"
})
return
}
emergencyRecordEdit({
id: this.id,
projectSn: this.projectSn,
@ -240,7 +266,7 @@
var that = this
if (type == 1) {
uni.chooseImage({
count: 5 - that.imgFileList.length,
count: 1,
success(res) {
const tempFilePaths = res.tempFilePaths;
uni.uploadFile({
@ -418,7 +444,7 @@
}
.emergencyalarm {
padding: 88rpx 24rpx 120rpx 24rpx;
padding: 0 24rpx 120rpx 24rpx;
.item-boxs {
.item-box {
@ -590,7 +616,7 @@
display: inline-flex;
position: relative;
margin-right: 30rpx;
margin-bottom: 16rpx;
// margin-bottom: 16rpx;
display: flex;
align-items: center;
@ -603,7 +629,7 @@
.deleteImg {
position: absolute;
right: -6rpx;
top: -36rpx;
top: -24rpx;
font-size: 36rpx;
color: #fff;
}

View File

@ -39,9 +39,8 @@
}
},
onShow() {
console.log(uni.getStorageSync('devInfoList')[0])
this.projectSn = uni.getStorageSync('devInfoList')[0].projectSn;
this.workerInfoId = uni.getStorageSync('devInfoList')[0].workerInfoId;
this.projectSn = uni.getStorageSync('devInfoList').projectSn;
this.workerInfoId = uni.getStorageSync('devInfoList').id;
},
methods: {
goNavigateTo(url, type) {

View File

@ -3,7 +3,7 @@
<u-icon :style="{
top: (statusBarHeight + 5) + 'px'
}" @click="gotoback" name="arrow-left" size="40" class="back"></u-icon>
<view class="title">请选择您的登录方式</view>
<!-- <view class="title">请选择您的登录方式</view> -->
<view class="loginBox">
<view class="tabs">
<view class="tab" v-for="(item,index) in tabs" :key="index" :class="{active:current==index}"
@ -28,9 +28,9 @@
</view>
</view>
<view class="submit" @click="submit">同意协议并登录</view>
<view class="bottomTitle" @click="showModal=true">
<!-- <view class="bottomTitle" @click="showModal=true">
云服务器设置
</view>
</view> -->
<view class="modalBox" v-show="showModal" @click="showModal=false">
<view class="modalContent" @click.stop="showModal=true">
<view class="modalTitle">
@ -51,11 +51,14 @@
import {
deviceLogin
} from "@/api/index.js"
import {
BASE_URL
} from "@/api/request.js"
export default {
data() {
return {
current: 0,
tabs: ["人员登录", "设备登录"],
tabs: ["人员登录"],
showModal: false,
ipPort: '',
form: {
@ -67,11 +70,15 @@
},
onLoad() {
let port = uni.getStorageSync('ipPort')
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight
let devInfoList = uni.getStorageSync('devInfoList')
if (port) {
this.ipPort = port;
Vue.prototype.url_config = port;
}
uni.setStorageSync('ipPort', BASE_URL);
Vue.prototype.url_config = BASE_URL;
getApp().globalData.siteUrl = BASE_URL;
if (devInfoList) {
// uni.reLaunch({
// url: '/pages/personLocation/home/home'
@ -136,7 +143,7 @@
//
uni.setStorageSync("loginType","device");
}
uni.setStorageSync("devInfoList", result.result.devInfoList);
uni.setStorageSync("devInfoList", result.result);
uni.redirectTo({
url: '/pages/personLocation/index/index'
});

View File

@ -6,7 +6,7 @@
</view>
</headers>
<!-- 新增问题 -->
<view class="immediate-rescue">
<view class="immediate-rescue" :style="{ 'margin-top': (statusBarHeight+52) + 'px' }">
<view class="content">
<!-- <view class="type flex">
<view class="name"><text class="star">*</text>是否处理完毕</view>
@ -351,7 +351,7 @@
},
onLoad(option) {
this.id = option.id;
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight
this.pageTitle = option.type == 'add' ? '新增检查' : '编辑检查';
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn;
this.userInfo = JSON.parse(uni.getStorageSync('userInfo'));
@ -752,7 +752,7 @@
},
//
bindPickerChange(e, type,eIndex) {
bindPickerChange(e, type, eIndex) {
console.log(e)
//type ==1 ;2;3;4 ;5; 6; 7; 8;
if (type == 1) {
@ -768,7 +768,7 @@
this.form.inspectTime = e.f3;
} else if (type == 'startTime2') {
// this.form.changeLimitTime = e.f3;
this.rescueList[eIndex].changeLimitTime = e.f3;
this.rescueList[eIndex].changeLimitTime = e.f3;
} else if (type == 6) {
this.changePeopleIndex = e.detail.value;
this.form.changeId = this.personUpdateList[e.detail.value].userId;
@ -997,7 +997,7 @@
if (res.confirm) {
if (type == 1) {
let fileArr = JSON.parse(JSON.stringify(that.rescueList[rowIndex]
.imgFileList));
.imgFileList));
fileArr.forEach((item, index) => {
if (item.url == val.url) {
fileArr.splice(index, 1)
@ -1042,7 +1042,7 @@
url: that.url_config + 'image/' + JSON.parse(uploadFileRes
.data).data[0].imageUrl
}
that.rescueList[eIndex].videoFileList.push(obj);
that.rescueList[eIndex].videoFileList.push(obj);
console.log('上传视频后的数据', that.videoFileList);
}
})
@ -1065,13 +1065,14 @@
//
addSaveBtn() {
// if (!data.regionId) {
// uni.showToast({
// title: '',
// icon: 'none'
// })
// return
// }
const everyTime = this.rescueList.every(item => item.changeLimitTime);
if (!everyTime && this.rescueList.length != 0) {
uni.showToast({
title: '处置完成时间有未填项',
icon: 'none'
})
return
}
console.log(this.rescueList);
this.sendRequest({
url: 'xmgl/xzEmergencyRecord/edit',
@ -1094,10 +1095,10 @@
success: res => {
console.log(res.result)
if (res.code == 200) {
uni.showToast({
title: '提交成功',
})
uni.navigateBack()
uni.showToast({
title: '提交成功',
})
uni.navigateBack()
}
}
})
@ -1245,7 +1246,7 @@
.immediate-rescue {
margin: 17% 4%;
margin: 0 4%;
position: relative;
}

View File

@ -5,7 +5,7 @@
处置详情
</view>
</headers>
<view class="disposal-detail">
<view class="disposal-detail" :style="{ 'margin-top': (statusBarHeight+52) + 'px' }">
<view class="rescue">
<view class="title">
基本信息
@ -86,7 +86,7 @@
</div>
</view>
</view>
<view class="rescue">
<view class="rescue" v-if="emergencyInfo.emergencyTypeId != -1">
<view class="title">
救援资料
</view>
@ -120,13 +120,13 @@
<text>处置人</text>
<text>{{item.disposalPersonName}}</text>
</view>
<view style="flex-direction: column;">
<view>
<text>现场情况视频</text>
<view v-if="item.liveVideoSituation && JSON.parse(item.liveVideoSituation).length>0"
class="imgBox flex2" v-for="(ele,index) in JSON.parse(item.liveVideoSituation)"
:key="index">
<view
style="color: #4181FE;width: 50%;white-space: nowrap; overflow: hidden;text-overflow: ellipsis;"
style="color: #4181FE;width: 100%;white-space: nowrap; overflow: hidden;text-overflow: ellipsis;"
@click="playVideo(ele.url,'video')">
{{ele.name}}
</view>
@ -185,7 +185,7 @@
</view>
<view v-if="emergencyDetail.dispositionStatus == 3"
style="color: #5181f6; cursor: pointer; height: 88rpx; justify-content: center; align-items: center;display: flex;"
@click="downloadReport(this.imgList)">
@click="downloadReport(imgList)">
下载处置报告
</view>
</view>
@ -211,6 +211,7 @@
imgList: [],
emergencyTypeList: [],
emergencyInfo: {},
statusBarHeight: "",
}
},
mounted() {
@ -218,6 +219,7 @@
},
onLoad(options) {
this.id = options.id;
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn;
console.log(options);
@ -228,20 +230,53 @@
},
methods: {
downloadReport(row) {
const url = row[0].url;
const fileName = row[0].name;
const url = row && row != "null" && row[0].url;
const fileName = row && row != "null" && row[0].name;
if (!url) {
uni.showToast({
title: "暂无下载文件!",
icon: "none"
})
return
}
uni.showLoading({
title: "保存中..."
})
uni.downloadFile({
url: url, //
success: (res) => {
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath, //
success: res => { //
uni.hideLoading()
uni.showToast({
title: "保存成功!"
})
}
})
}
}
});
fetch(url)
.then(response => response.blob())
.then(blob => {
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = fileName;
link.target = "_blank"; //
link.click();
});
// fetch(url)
// .then(response => response.blob())
// .then(blob => {
// const link = document.createElement('a');
// link.href = URL.createObjectURL(blob);
// link.download = fileName;
// link.target = "_blank"; //
// link.click();
// });
},
addSaveBtn() {
if (this.imgList == null||this.imgList.length == 0) {
uni.showToast({
title: "请提交处置报告",
icon: "none"
})
return
}
this.sendRequest({
url: 'xmgl/xzEmergencyRecord/edit',
method: 'post',
@ -269,6 +304,7 @@
canversList(e) {
const that = this;
console.log(e);
that.imgList = that.imgList == null ? [] : that.imgList;
uni.uploadFile({
url: that.url_config + 'upload/image', //
filePath: e.tempFilePaths[0],
@ -324,7 +360,7 @@
const find = that.emergencyTypeList.find(item => item.id == res.result
.emergencyTypeId);
that.emergencyInfo = find ? find : {};
this.imgList = res.result.disposalReport && JSON.parse(res.result.disposalReport);
this.imgList = (res.result.disposalReport && res.result.disposalReport != null) ? JSON.parse(res.result.disposalReport) : [];
}
})
},
@ -442,8 +478,8 @@
}
.disposal-detail {
margin: 88rpx 0;
padding: 0 30rpx;
// margin: 88rpx 0;
padding: 0 30rpx 30rpx;
position: relative;
.rescue {
@ -461,9 +497,9 @@
border-radius: 34rpx;
padding: 24rpx 24rpx;
view {
margin: 6rpx 0 !important;
}
// view {
// margin: 6rpx 0 !important;
// }
}
.rescue-item>view:last-child {
@ -560,4 +596,13 @@
}
}
}
.imgBox_wrap,
.imgBox {
margin: 0 !important;
view {
margin: 0 !important;
}
}
</style>

View File

@ -2,12 +2,12 @@
<view class="emergencyDisposal">
<headers class="fixedheader" :showBack="true">
<view class="headerName">
应急处置
{{this.getGoId == 2 ? '救援隐患审批' :'应急处置'}}
</view>
</headers>
<view class="problemOverview">
<view class="problemOverview" :style="{ 'margin-top': (statusBarHeight+52) + 'px' }">
<view class="overFlex">
<view class="overLeft">问题概览</view>
<view class="overLeft">{{this.getGoId == 2 ? '审批分析' :'处置分析'}}</view>
<view class="overRight">{{nowTime}}</view>
</view>
<view class="problemData">
@ -18,7 +18,7 @@
<view class="num">{{statisticsValue.totalNum}}</view>
<view class="text">总数</view>
</view>
<view class="dataBox2 dataStyle">
<view class="dataBox2 dataStyle" v-if="this.getGoId != 2">
<!-- <view class="day" v-if="statisticsValue.oseNumDifferYesterday<0">
较昨日{{statisticsValue.oseNumDifferYesterday}}</view>
<view class="day" v-else>
@ -210,7 +210,8 @@
//
getRecordList() {
let data = {
projectSn: this.projectSn
projectSn: this.projectSn,
inDispositionStatus:this.getGoId == 2 ? "2,3" : "1,2,3",
}
this.sendRequest({
url: 'xmgl/xzEmergencyRecord/statsDispositionStatus',
@ -335,7 +336,7 @@
// box-sizing: border-box;
border-radius: 10px;
// border: 3px solid #fafbfc;
margin: 88rpx 2% 11% 2%;
margin: 0 2% 11% 2%;
padding: 3% 3%;

View File

@ -2,8 +2,8 @@
<view>
<view class="page-body">
<view class="page-section page-section-gap">
<map style="width: 100%; height: 100%;" :markers="markersArr" :latitude="latitude"
:longitude="longitude">
<map style="width: 100%; height: 100vh;" :markers="markersArr" :latitude="latitude"
:longitude="longitude" @markertap="markTap">
</map>
</view>
</view>
@ -26,29 +26,67 @@
this.latitude = option.latitude ? option.latitude : '39.909';
this.longitude = option.longitude ? option.longitude : '116.39742';
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn;
this.getListData();
},
methods: {
markTap(e) {
console.log('ccccccc')
console.log(JSON.stringify(e))
console.log('ccccccc')
uni.openLocation({
//
latitude: e.target.latitude,
longitude: e.target.longitude,
//
success: function(res) {
console.log('调用成功:', res)
},
//
fail: function(res) {
console.log('调用失败:', res)
},
//
complete: function(res) {
console.log('调用完成:', res)
}
})
},
//
getListData() {
let that = this;
//
this.sendRequest({
url: 'xmgl/xzEmergencyRecord/page',
url: 'xmgl/xzEmergencyReliefGoods/list',
method: 'get',
data: {
projectSn: this.projectSn,
},
success: res => {
console.log(res)
that.markersArr = res.result.filter(item => item.longitude || item.latitude).map(
const newResult = res.result.filter(item => item.longitude || item.latitude).map(
(item, index) => {
return {
id: index + 1,
latitude: item.latitude ? item.latitude : 0,
longitude: item.longitude ? item.longitude : 0,
title: item.goodsName
title: item.goodsName,
label: {
content: item.goodsName,
textAlign:"center",
},
iconPath: '/static/address-logo1.png',
}
});
that.markersArr = newResult.concat([{
id: res.result.length + 2,
latitude: that.latitude,
longitude: that.longitude,
// title: item.goodsName,
iconPath: '/static/address-logo2.png',
}])
}
})
},
@ -56,6 +94,5 @@
}
</script>
<style>
<style scoped>
</style>

View File

@ -5,7 +5,7 @@
处置详情
</view>
</headers>
<view class="disposal-detail">
<view class="disposal-detail" :style="{ 'margin-top': (statusBarHeight+52) + 'px' }">
<view class="rescue">
<view class="title">
基本信息
@ -120,13 +120,14 @@
<text>处置人</text>
<text>{{item.disposalPersonName}}</text>
</view>
<view style="flex-direction: column;">
<!-- style="flex-direction: column;" -->
<view >
<text>现场情况视频</text>
<view v-if="item.liveVideoSituation && JSON.parse(item.liveVideoSituation).length>0"
class="imgBox flex2" v-for="(ele,index) in JSON.parse(item.liveVideoSituation)"
:key="index">
<view
style="color: #4181FE;width: 50%;white-space: nowrap; overflow: hidden;text-overflow: ellipsis;"
style="color: #4181FE;width: 100%;white-space: nowrap; overflow: hidden;text-overflow: ellipsis;"
@click="playVideo(ele.url,'video')">
{{ele.name}}
</view>
@ -167,7 +168,7 @@
</view>
<view v-if="this.imgList && this.imgList.length > 0"
style="color: #5181f6; cursor: pointer; height: 88rpx; justify-content: center; align-items: center;display: flex;"
@click="downloadReport(this.imgList)">
@click="downloadReport(imgList)">
下载处置报告
</view>
</view>
@ -203,6 +204,7 @@
},
onLoad(options) {
this.id = options.id;
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn;
console.log(options);
@ -213,18 +215,34 @@
},
methods: {
downloadReport(row) {
const url = row[0].url;
const fileName = row[0].name;
fetch(url)
.then(response => response.blob())
.then(blob => {
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = fileName;
link.target = "_blank"; //
link.click();
});
const url = row && row != "null" && row[0].url;
const fileName = row && row != "null" && row[0].name;
if (!url) {
uni.showToast({
title: "暂无下载文件!",
icon: "none"
})
return
}
uni.showLoading({
title: "保存中..."
})
uni.downloadFile({
url: url, //
success: (res) => {
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath, //
success: res => { //
uni.hideLoading()
uni.showToast({
title: "保存成功!"
})
}
})
}
}
});
},
onSubmitAll() {
this.sendRequest({
@ -276,6 +294,7 @@
canversList(e) {
const that = this;
console.log(e);
that.imgList = that.imgList == null ? [] : that.imgList;
uni.uploadFile({
url: that.url_config + 'upload/image', //
filePath: e.tempFilePaths[0],
@ -449,8 +468,7 @@
}
.disposal-detail {
margin: 88rpx 0;
padding: 0 30rpx;
padding: 0 30rpx 30rpx;
position: relative;
.rescue {
@ -468,9 +486,9 @@
border-radius: 34rpx;
padding: 24rpx 24rpx;
view {
margin: 6rpx 0 !important;
}
// view {
// margin: 6rpx 0 !important;
// }
}
.rescue-item>view:last-child {
@ -567,4 +585,11 @@
}
}
}
.imgBox_wrap,.imgBox {
margin: 0 !important;
view {
margin: 0 !important;
}
}
</style>

View File

@ -87,7 +87,7 @@
<view>特种验收</view>
</view>
<view class="menu" @click="reliefApprove">
<image class="icon" style="width: 30px; height: 30px;" src="@/static/safeMange/danger_check.png">
<image class="icon" style="width: 30px; height: 30px;" src="@/static/reliefApprove.png">
</image>
<view>新增隐患审批</view>
</view>

BIN
static/address-logo1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
static/address-logo2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
static/reliefApprove.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 994 B