<template>
|
<view>
|
<!-- 自定义导航栏 -->
|
<view class="navBarBox">
|
<!-- 状态栏占位 -->
|
<view class="statusBar" :style="{ paddingTop: statusBarHeight + 'px' }"></view>
|
<!-- 真正的导航栏内容 -->
|
<view style="display: flex; flex-direction: column;">
|
<view class="navBar">
|
<u-icon name="arrow-left" color="black" size="17" @click="goBack" />
|
<view class="barText">信息详情</view>
|
</view>
|
|
<view class="divider"></view>
|
</view>
|
</view>
|
<!-- 页面内容 -->
|
<view style="padding: 10px 15px;display: flex;flex-direction: column;">
|
<text style="font-size: 18px;"><b>标题:</b>{{detailData.title}}</text>
|
<text class="textTop"><b>类别:</b>{{detailData.disaster}}</text>
|
<view style="display: flex;align-items: center;" class="textTop">
|
<text><b>级别:</b></text>
|
<u-tag
|
:color="detailData.warningLevel === 3 ? 'rgb(255, 244, 88)' :detailData.warningLevel === 2 ? 'orange':detailData.warningLevel === 1 ?'red':'blue'"
|
:text="detailData.warningLevel === 3 ? '黄色' : detailData.warningLevel === 2 ? '橙色': detailData.warningLevel === 1 ?'红色':'蓝色'"
|
:bg-color="detailData.warningLevel === 3 ? 'rgb(254, 255, 230)' :detailData.warningLevel === 2 ? 'rgb(255, 210, 179)':detailData.warningLevel === 1 ?'rgb(255, 128, 128)':'rgb(121, 150, 255)'"
|
border-color="white">
|
</u-tag>
|
</view>
|
<text class="textTop"><b>发布单位:</b>{{detailData.publishingUnit}}</text>
|
<text class="textTop"><b>短信内容:</b><i style="background-color: rgb(240, 248, 255);">{{detailData.content}}发布单位:{{detailData.publishingUnit}}</i></text>
|
<view style="display: flex;">
|
<text class="textTop" style="width: 76px;" ><b>附件内容:</b></text>
|
<view class="attache">
|
<view v-for="(item, index) in detailData.attachments" :key="index" >
|
|
<view style="display: flex;margin-top: 10px;" @click="openFile(item)">
|
<u-icon name="attach" color="#2979ff" size="20"></u-icon> {{item.attachementName}}
|
</view>
|
|
</view>
|
</view>
|
</view>
|
<text class="textTop" v-if="detailData.role == 'leader'"><b>信息提交人:</b>{{detailData.infoSubmitter}}</text>
|
<view class="textTop" v-if="detailData.role == 'leader'">
|
<text ><b>审核状态:</b></text>
|
<text v-if="detailData.reviewStatus == 1" class="responseStatus"
|
style='color: red;'>待审核</text>
|
<text v-else-if="detailData.reviewStatus == 2" class="responseStatus"
|
style='color: rgb(17, 204, 33);'>已审核通过</text>
|
<text v-else class="responseStatus"
|
style='color: rgb(153, 148, 143);'>已驳回</text>
|
</view>
|
<view class="textTop" v-else>
|
<text ><b>响应状态:</b></text>
|
<text v-if="detailData.responseStatus == 1" class="responseStatus"
|
style='background-color:rgb(247, 108, 125);color: white;'>待叫应</text>
|
<text v-else-if="detailData.responseStatus == 2" class="responseStatus"
|
style='background-color:limegreen'>已叫应</text>
|
<text v-else class="responseStatus"
|
style='background-color:rgb(247, 108, 125); color: white;'>超时未叫应</text>
|
</view>
|
<view v-if="detailData.role == 'leader' && detailData.reviewStatus == 1" class="btn">
|
<u-button
|
style="background-color:rgb(6, 202, 23);color: white;width: 180px;"
|
@click="approved"
|
>审核通过</u-button>
|
<u-button
|
style="background-color:rgb(247, 108, 125);color: white;width: 180px;"
|
@click="reject"
|
>审核驳回</u-button>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import VUE_APP_BASE_URL from '../../../common/constant.js'
|
import { submit } from '../../../api/examine.js'
|
export default {
|
data() {
|
return {
|
// 状态栏高度
|
statusBarHeight: 0,
|
key: 1,
|
detailData: {
|
id: null,
|
warnInfoId: null,
|
disasterType: null,
|
warningLevel: null,
|
title: "",
|
content: "",
|
publishingUnit: "",
|
attachments: [],
|
responseStatus: null
|
},
|
submitData: {
|
id: null,
|
reviewStatus: null
|
}
|
}
|
},
|
onLoad:function(options){
|
//获取手机状态栏高度
|
this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight'];
|
let test = options.data && JSON.parse(decodeURIComponent(options.data));
|
this.detailData = test;
|
console.log("wwwwwwww",this.detailData)
|
if(this.detailData.role == 'leader') {
|
this.detailData.attachments = this.detailData.attachment;
|
if (this.detailData.attachments){
|
this.detailData.attachments.forEach((item,index) => {
|
item.attachementName = this.detailData.attachment[index].attachmentName;
|
})
|
}
|
|
|
}
|
this.detailData.disaster = test.disasterType == 1 ? '地震': test.disasterType == 2 ? '洪涝' : test.disasterType == 3 ? '气象' : test.disasterType == 4 ? '泥石流': test.disasterType == 5 ? '水旱': '森林草原火灾';
|
},
|
methods: {
|
goBack() {
|
console.log("1111")
|
uni.navigateBack({
|
url:'./notice/notice'
|
});
|
},
|
//审核通过
|
approved() {
|
this.submitData.id = this.detailData.id;
|
this.submitData.reviewStatus = 2;
|
submit(this.submitData).then(res => {
|
if(res.code==100) {
|
this.goBack();
|
}
|
});
|
},
|
//审核驳回
|
reject() {
|
this.submitData.id = this.detailData.id;
|
this.submitData.reviewStatus = 3;
|
submit(this.submitData).then(res => {
|
if(res.code==100) {
|
this.goBack();
|
}
|
})
|
},
|
openFile(item) {
|
let fileUrl = '';
|
console.log("iiii",item)
|
if(item.role == 'leader'){
|
fileUrl = VUE_APP_BASE_URL + item.attachment;
|
console.log("url",fileUrl)
|
}else {
|
fileUrl = VUE_APP_BASE_URL + item.attachement;
|
console.log("url",VUE_APP_BASE_URL + item.attachement)
|
}
|
|
uni.downloadFile({
|
url: encodeURI('http://192.168.0.38:8086/uploadtest/2023/naturalDisaster/Warninginfo/0620/abc051b6ee66402d98e7b27216662d17.pdf'),
|
header: {
|
'Content-type': 'application/json',
|
'tk':uni.getStorageSync('tk'),
|
'uid': uni.getStorageSync('uid')
|
},
|
success:function(res){
|
console.log("下载res",res);
|
var filePath = res.tempFilePath;
|
const sidx = filePath.lastIndexOf('(');
|
const eidx = filePath.lastIndexOf(')');
|
// 用于处理文档打开问题(ps:第一次打开 第二次无法打开问题)
|
if (sidx > -1 && eidx > -1) {
|
const restr = filePath.substr(sidx, eidx - sidx + 1);
|
filePath = filePath.replace(restr, '');
|
}
|
// plus.runtime.openFile(filePath)
|
uni.openDocument({
|
filePath: escape(filePath),
|
success:function(){
|
console.log('成功')
|
},
|
fail:function(){
|
uni.showToast({
|
icon: 'none',
|
title: '暂不支持此类型',
|
duration: 2000
|
})
|
}
|
})
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style>
|
a{
|
text-decoration: none;
|
}
|
.navBarBox .navBar {
|
/* background-color:lightgrey; */
|
height: 30px;
|
display: flex;
|
flex-direction: row;
|
/* justify-content: center; */
|
align-items: center;
|
/* padding-top:5px ; */
|
padding: 5px 8px;
|
}
|
.barText{
|
margin-left: 36%;
|
font-weight: 600;
|
font-size: 18px;
|
|
}
|
.navBarBox .navBar .logo {
|
width: 82rpx;
|
height: 82rpx;
|
margin-right: 10rpx;
|
}
|
.textTop{
|
margin-top: 20px;
|
font-size: 15px;
|
|
}
|
.attache{
|
margin-top: 10px;
|
flex: 1;
|
display: flex;
|
flex-direction: column;
|
}
|
.responseStatus{
|
padding:5px;
|
color:#2a2a2a;
|
border-radius: 5px;
|
}
|
.divider{
|
height: 1px;
|
width: 93%;
|
background-color: lightgray;
|
margin-left: 15px;
|
}
|
.btn{
|
margin-top: 80px;
|
display: flex;
|
align-items: center;
|
justify-content: space-around;
|
width: 100%;
|
}
|
</style>
|