integrated_traffic_uniapp/pages/application/hidden-danger-management/hidden-danger-review/hidden-danger-review-detail...

839 lines
24 KiB
Vue

<template>
<view>
<cu-custom bgColor="bg-gradual-blueness" :isBack="true">
<block slot="backText">返回</block>
<block slot="content">待复查隐患-详情</block>
</cu-custom>
<scroll-view scroll-y>
<view class="de-card-list de-list">
<view class="de-item">
<view class="de-sub-title">
<text class="text-semi">{{pd.HIDDENDESCR}}</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi"></text>
</view>
</view>
<!-- <view class="de-title">
<text class="text-semi">隐患信息</text>
</view> -->
<view class="de-item">
<view class="de-sub-title">
<text class="text-grey">隐患来源</text>
</view>
<view class="uni-flex-item text-right">
<text v-if="pd.SOURCE=='1'" class="text-semi">隐患快报</text>
<text v-if="pd.SOURCE=='2'" class="text-semi">隐患排查</text>
<text v-if="pd.SOURCE=='3'" class="text-semi">隐患排查</text>
</view>
</view>
<view class="de-item" v-if="pd.SOURCE==2">
<view class="de-sub-title">
<text class="text-grey">风险点(单元)</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{pd.RISK_UNIT}}</text>
</view>
</view>
<view class="de-item" v-if="pd.SOURCE==2">
<view class="de-sub-title">
<text class="text-grey">辨识部位</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{pd.IDENTIFICATION}}</text>
</view>
</view>
<view class="de-item" v-if="pd.SOURCE==2">
<view class="de-sub-title">
<text class="text-grey">存在风险</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{pd.RISK_DESCR}}</text>
</view>
</view>
<view class="de-item" v-if="pd.SOURCE==2">
<view class="de-sub-title">
<text class="text-grey">风险分级</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{pd.LEVEL}}</text>
</view>
</view>
<view class="de-item" v-if="pd.SOURCE==2">
<view class="de-sub-title">
<text class="text-grey">检查内容</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{pd.CHECK_CONTENT}}</text>
</view>
</view>
<!-- <view class="de-item-sp">
<view class="de-sub-title">
<text class="text-grey">隐患描述</text>
</view>
<view class="de-sub-content">
<text class="text-semi">{{pd.HIDDENDESCR}}</text>
</view>
</view> -->
<view class="de-item">
<view class="de-sub-title">
<text class="text-grey">隐患部位</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{pd.HIDDENPART}}</text>
</view>
</view>
<view class="de-item">
<view class="de-sub-title">
<text class="text-grey">发现人</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{pd.CREATORNAME}}</text>
</view>
</view>
<view class="de-item">
<view class="de-sub-title">
<text class="text-grey">发现时间</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{pd.CREATTIME}}</text>
</view>
</view>
<view class="de-item">
<view class="de-sub-title">
<text class="text-grey">隐患类型</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{pd.HIDDENTYPE_NAME}}</text>
</view>
</view>
<view class="de-item">
<view class="de-sub-title">
<text class="text-grey">整改类型</text>
</view>
<view class="uni-flex-item text-right">
<text v-if="pd.RECTIFICATIONTYPE=='1'" class="text-semi">立即整改</text>
<text v-else-if="pd.RECTIFICATIONTYPE=='2'" class="text-semi">延期整改</text>
</view>
</view>
<view v-if="pd.RECTIFICATIONTYPE=='2'" class="de-item">
<view class="de-sub-title">
<text class="text-grey">整改期限</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{pd.RECTIFICATIONDEADLINE}}</text>
</view>
</view>
<view class="de-item-sp">
<view class="de-sub-title">
<text class="text-grey">隐患照片</text>
</view>
<view class="de-sub-content">
<scroll-view scroll-x class="bg-white nav" scroll-with-animation>
<view class="cu-item" v-for="(item,index) in files" v-bind:key="index">
<view class="imgs">
<image :src="baseImgPath+item.FILEPATH" :data-index="index" @click="ViewShowImage" mode=""></image>
</view>
</view>
</scroll-view>
</view>
</view>
<view class="de-item-sp" v-if="videoList.length>0">
<view class="de-sub-title">
<text class="text-grey">隐患视频</text>
</view>
<view class="de-sub-content" style="background-color: #000;width: 120upx;">
<image src="/static/icon-apps/video.png" mode="aspectFill" @click="playVideo"
:data-src="baseImgPath + videoList[0].FILEPATH"
style="width: 120upx;height: 120upx;"></image>
</view>
</view>
</view>
<view class="de-card-list de-list">
<view class="de-title">
<text class="text-semi">整改信息</text>
</view>
<view class="de-item-sp">
<view class="de-sub-title">
<text class="text-grey">整改描述</text>
</view>
<view class="de-sub-content">
<text class="text-semi">{{pd.RECTIFYDESCR}}</text>
</view>
</view>
<view class="de-item">
<view class="de-sub-title">
<text class="text-grey">整改部门</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{pd.RECTIFICATIONDEPTNAME}}</text>
</view>
</view>
<view class="de-item">
<view class="de-sub-title">
<text class="text-grey">整改人</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{pd.RECTIFICATIONORNAME}}</text>
</view>
</view>
<view class="de-item">
<view class="de-sub-title">
<text class="text-grey">整改时间</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{pd.RECTIFICATIONTIME}}</text>
</view>
</view>
<view class="de-item-sp">
<view class="de-sub-title">
<text class="text-grey">整改后图片</text>
</view>
<view class="de-sub-content">
<scroll-view scroll-x class="bg-white nav" scroll-with-animation>
<view class="cu-item" v-for="(item,index) in files2" v-bind:key="index">
<view class="imgs">
<image :src="baseImgPath+item.FILEPATH" :data-index="index" @click="ViewShowImage2" mode=""></image>
</view>
</view>
</scroll-view>
</view>
</view>
<view class="de-item">
<view class="de-sub-title">
<text class="text-grey">整改方案</text>
</view>
<view class="uni-flex-item text-right">
<text v-if="pd.HAVESCHEME==0" class="text-semi">无</text>
<text v-else-if="pd.HAVESCHEME==1" class="text-semi">有</text>
<text v-else class="text-semi"></text>
</view>
</view>
<view class="de-item" v-if="hs">
<view class="de-sub-title">
<text class="text-grey">排查日期</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{hs.SCREENINGDATE}}</text>
</view>
</view>
<view class="de-item" v-if="hs">
<view class="de-sub-title">
<text class="text-grey">隐患清单</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{hs.LISTNAME}}</text>
</view>
</view>
<view class="de-item" v-if="hs">
<view class="de-sub-title">
<text class="text-grey">治理标准要求</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{hs.GOVERNSTANDARDS}}</text>
</view>
</view>
<view class="de-item" v-if="hs">
<view class="de-sub-title">
<text class="text-grey">治理方法</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{hs.GOVERNMETHOD}}</text>
</view>
</view>
<view class="de-item" v-if="hs">
<view class="de-sub-title">
<text class="text-grey">经费和物资的落实</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{hs.EXPENDITURE}}</text>
</view>
</view>
<view class="de-item" v-if="hs">
<view class="de-sub-title">
<text class="text-grey">负责治理人员</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{hs.PRINCIPAL}}</text>
</view>
</view>
<view class="de-item" v-if="hs">
<view class="de-sub-title">
<text class="text-grey">工时安排</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{hs.PROGRAMMING}}</text>
</view>
</view>
<view class="de-item" v-if="hs">
<view class="de-sub-title">
<text class="text-grey">时限要求</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{hs.TIMELIMITFOR}}</text>
</view>
</view>
<view class="de-item" v-if="hs">
<view class="de-sub-title">
<text class="text-grey">应急预案附件</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi" @click="$noMultipleClicks(goToOpen,baseImgPath+hs.FILEPATH)">下载</text>
</view>
</view>
<view class="de-item" v-if="hs">
<view class="de-sub-title">
<text class="text-grey">工作要求</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{hs.JOBREQUIREMENT}}</text>
</view>
</view>
<view class="de-item" v-if="hs">
<view class="de-sub-title">
<text class="text-grey">其他事项</text>
</view>
<view class="uni-flex-item text-right">
<text class="text-semi">{{hs.OTHERBUSINESS}}</text>
</view>
</view>
<view class="de-item-sp" v-if="hs">
<view class="de-sub-title">
<text class="text-grey">方案图片</text>
</view>
<view class="de-sub-content">
<scroll-view scroll-x class="bg-white nav" scroll-with-animation>
<view class="cu-item" v-for="(item,index) in files4" v-bind:key="index">
<view class="imgs">
<image :src="baseImgPath+item.FILEPATH" :data-index="index" @click="ViewShowImage4" mode=""></image>
</view>
</view>
</scroll-view>
</view>
</view>
<view class="de-item">
<view class="de-sub-title">
<text class="text-grey">整改计划</text>
</view>
<view class="uni-flex-item text-right">
<text v-if="pd.HAVEPLAN==0" class="text-semi">无</text>
<text v-else-if="pd.HAVEPLAN==1" class="text-semi">有</text>
<text v-else class="text-semi"></text>
</view>
</view>
<view class="de-item-sp" v-if="pd.HAVEPLAN==1">
<view class="de-sub-title">
<text class="text-grey">计划图片</text>
</view>
<view class="de-sub-content">
<scroll-view scroll-x class="bg-white nav" scroll-with-animation>
<view class="cu-item" v-for="(item,index) in files5" v-bind:key="index">
<view class="imgs">
<image :src="baseImgPath+item.FILEPATH" :data-index="index" @click="ViewShowImage4" mode=""></image>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
<view class="de-card-list de-list">
<view class="de-title">
<text class="text-semi">隐患复查</text>
</view>
<view class="cu-form-group margin-top">
<view class="title text-hui">是否合格</view>
<radio-group class="selected">
<view class="group mr20">
<radio class='radio' value="1" :checked="checkStatus==='1'" @click="radio('1')"></radio>
<text></text>
</view>
<view class="group">
<radio class='radio' value="0" :checked="checkStatus==='0'" @click="radio('0')"></radio>
<text></text>
</view>
</radio-group>
</view>
<view v-if="checkStatus=='0'" class="cu-form-textarea">
<view class="cu-form-title text-grey">复查驳回原因</view>
<textarea maxlength="-1" @input="textareaAInput" placeholder="请对复查驳回原因进行详细描述(必填项)"></textarea>
</view>
<view v-if="checkStatus=='1'" class="cu-form-group bb">
<view class="title">复查日期</view>
<picker mode="date" :value="REVIEWTIME" start="2015-09-01" :end="date" @change="changeDate">
<view class="picker">
{{REVIEWTIME==''?'请选择':REVIEWTIME}}
</view>
</picker>
</view>
<view class="cu-form-group" v-if="checkStatus=='1'">
<view class="title">验收部门</view>
<view class="picker" @tap="showZgTree">{{pd.CHECKDEPTNAME?pd.CHECKDEPTNAME:'请选择'}}</view>
<tki-tree ref="tkiTree"
:selectParent=true
:range="treeNode"
rangeKey="name"
@confirm="zgtreeConfirm"></tki-tree>
</view>
</view>
<view class="padding flex flex-direction">
<button class="cu-btn bg-green margin-tb-sm lg" @click="$noMultipleClicks(goSubmit)">提 交</button>
</view>
<view class="cu-tabbar-height"></view>
</scroll-view>
<view :class="['cu-modal',{'show':modalShow}]" v-if="modalShow">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">播放视频</view>
<view class="action" @tap="modalShow = false">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<video :src="videoSrc" :autoplay="true" @fullscreenchange="fullScreenHandler"></video>
<view class="cu-bar bg-white justify-end">
<view class="action">
<button class="cu-btn line-green text-green" @click="modalShow = false"></button>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
basePath,corpinfoId,loginSession,baseImgPath,loginUser
} from '@/common/tool.js';
import tkiTree from "@/components/select-tree/select-tree.vue"
export default {
components: {
tkiTree
},
data() {
return {
noClick: true,
date: '',
RECTIFICATIONTIME: '',
REVIEWTIME: '',
imgList: [],
id: '',
treeNode:[],//部门下拉数据
CHECKDEPT:'',//验收部门
CHECKDEPTNAME:'请选择',//验收部门
pd: [],
hs: [],
files: [],
files2: [],
files3: [],
files4: [],
files5:[],
videoList: [],
REJECTREASON: '',
basePath:basePath,
baseImgPath:baseImgPath,
checkStatus:'1',
modalShow: false,
videoSrc: '',
}
},
onLoad(e) {
this.id = e.id;
// let now = new Date();
// this.date = formatDate(now, 'yyyy-MM-dd');
this.getData();
this.getDept();
loginSession();
},
// filters: {
// formatDate(time) {
// time = time * 1
// let date = new Date(time)
// return formatDate(date, 'yyyy-MM-dd hh:mm')
// }
// },
methods: {
fullScreenHandler(e) {
if (uni.getSystemInfoSync().platform == "ios") { return }
},
getData() {
var _this = this;
uni.showLoading({
title: '请稍候'
})
uni.request({
url: basePath + '/app/hidden/goEdit',
method: 'POST',
dataType: 'json',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
data: {
HIDDEN_ID: _this.id,
CORPINFO_ID:loginUser.CORPINFO_ID,
USER_ID:loginUser.USER_ID,
},
success: (res) => {
console.info(res);
if ("success" == res.data.result) {
uni.hideLoading();
_this.pd = res.data.pd; //参数map
_this.hs = res.data.hs; //参数map
for (let i = 0; i < res.data.hImgs.length; i++) {
if(res.data.hImgs[i].FILEPATH.substring(res.data.hImgs[i].FILEPATH.lastIndexOf(".") + 1, res.data.hImgs[i].FILEPATH.length) === 'mp4'){
_this.videoList.push(res.data.hImgs[i])
}else {
_this.files.push(res.data.hImgs[i])
}
}
// _this.files = res.data.hImgs;
_this.files2 = res.data.rImgs;
_this.files3 = res.data.cImgs;
_this.files4 = res.data.sImgs;
_this.files5 = res.data.pImgs;
} else if ("exception" == data.result) {
uni.showToast({
title: '错误',
duration: 2000
});
}
}
});
},
//图片上传
ChooseImage() {
var _this = this;
uni.chooseImage({
count: 4, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['camera', 'album'], //从相册选择
success: (res) => {
if (this.imgList.length != 0) {
this.imgList = this.imgList.concat(res.tempFilePaths)
} else {
this.imgList = res.tempFilePaths
}
}
});
},
ViewImage(e) {
uni.previewImage({
urls: this.imgList,
current: e.currentTarget.dataset.url
});
},
DelImg(e) {
uni.showModal({
title: '双控平台',
content: '确定要删除这张图片吗?',
cancelColor: "#000000",
cancelText: '取消',
confirmText: '确定',
success: res => {
if (res.confirm) {
this.imgList.splice(e.currentTarget.dataset.index, 1)
}
}
})
},
textareaAInput(e) {
this.REJECTREASON = e.detail.value
},
goSubmit() {
var _this = this;
if(this.checkStatus == '0'){
if (!_this.REJECTREASON) {
uni.showToast({
icon: 'none',
title: '请输入驳回原因',
duration: 1500
});
return;
}
} else {
if (!_this.pd.CHECKDEPT) {
uni.showToast({
icon: 'none',
title: '请选择整改部门',
duration: 1500
});
return;
}
if (!_this.REVIEWTIME) {
uni.showToast({
icon: 'none',
title: '请选择复查时间',
duration: 1500
});
return;
}
}
uni.showLoading({
title: '请稍候'
})
uni.request({
url: basePath + "/app/hidden/review", //提交接口
method: 'POST',
dataType: 'json',
header:{
'Content-type':'application/x-www-form-urlencoded'
},
data: {
REJECTREASON:this.REJECTREASON,
REVIEWTIME:this.REVIEWTIME,
HIDDENSCHEME_ID:this.hs?this.hs.HIDDENSCHEME_ID:'',
CHECKDEPT:this.pd.CHECKDEPT,
ISPASS:this.checkStatus,
HIDDEN_ID: _this.id,
CORPINFO_ID:loginUser.CORPINFO_ID,
USER_ID:loginUser.USER_ID,
},
success: (res) => {
uni.hideLoading();
if ("success" == res.data.result) {
uni.showToast({
icon: 'none',
title: '提交成功',
duration: 1500
});
setTimeout(function(){
var pages = getCurrentPages(); // 获取当前页面栈
var prePage = pages[pages.length - 2]; // 上一个页面
prePage.$vm.initflag = true; // A 页面 init方法 为true
uni.navigateBack({});
uni.hideLoading();
},1500);
}else{
uni.showToast({
title: '错误',
duration: 2000
});
}
}
});
},
uploadImg(tempFilePaths,i) {
var _this = this;
uni.showLoading({
title: '上传中'
})
uni.uploadFile({
url: basePath + '/app/imgfiles/add',
filePath: tempFilePaths[i],
name: 'FFILE',
formData: {
'FOREIGN_KEY': _this.id,
'TYPE': '4',
CORPINFO_ID: loginUser.CORPINFO_ID,
USER_ID: loginUser.USER_ID,
},
success: (res) => {
i++;
if (tempFilePaths.length > i) {
_this.uploadImg(tempFilePaths, i);
} else {
_this.submit();
}
},
fail: (err) => {
uni.hideLoading();
console.log('uploadImage fail', err);
uni.showModal({
content: err.errMsg,
showCancel: false
});
}
})
},
getDept() {
var _this = this;
uni.request({
url: basePath + '/app/sys/listTree',//部门下拉接口
method: 'POST',
dataType: 'json',
header: {
'Content-type':'application/x-www-form-urlencoded'
},
data: {
CORPINFO_ID:loginUser.CORPINFO_ID,
USER_ID:loginUser.USER_ID,
},
success: (res) => {
if("success" == res.data.result){
_this.treeNode=eval(res.data.zTreeNodes);
} else {
uni.showToast({
title: res.data.message,
duration: 2000
});
}
}
});
},
// 确定回调事件
zgtreeConfirm(e) {
this.pd.CHECKDEPT=e[0].id;
this.pd.CHECKDEPTNAME=e[0].name;
this.uindex=-1;
this.$forceUpdate();//强制刷新
},
// 显示树形选择器
showZgTree() {
this.$refs.tkiTree._show();
},
submit() {
var _this = this;
uni.request({
url: basePath + "/app/hidden/rectify", //提交接口
method: 'POST',
dataType: 'json',
header:{
'Content-type':'application/x-www-form-urlencoded'
},
data: {
RECTIFICATIONTIME: _this.RECTIFICATIONTIME,
RECTIFYDESCR: _this.RECTIFYDESCR,
HIDDEN_ID: _this.id,
CORPINFO_ID:loginUser.CORPINFO_ID,
USER_ID:loginUser.USER_ID,
},
success: (res) => {
uni.hideLoading();
/* if (res.data.code == '000000000') { */
uni.showToast({
icon: 'none',
title: '提交成功',
duration: 1500
});
var pages = getCurrentPages(); // 获取当前页面栈
var prePage = pages[pages.length - 2]; // 上一个页面
prePage.$vm.initflag = true; // A 页面 init方法 为true
uni.navigateBack({});
uni.hideLoading();
/* }else{
uni.showToast({
title: res.data.message,
duration: 2000
});
} */
}
});
},
changeDate(e) {
this.REVIEWTIME = e.detail.value
},
radio(e){
this.checkStatus = e
},
ViewShowImage(e) {
let files = [];
for (var i = 0; i < this.files.length; i++) {
files.push(baseImgPath+this.files[i].FILEPATH)
}
uni.previewImage({
urls: files,
current: e.currentTarget.dataset.index
});
},
ViewShowImage2(e) {
let files = [];
for (var i = 0; i < this.files2.length; i++) {
files.push(baseImgPath+this.files2[i].FILEPATH)
}
uni.previewImage({
urls: files,
current: e.currentTarget.dataset.index
});
},
ViewShowImage4(e) {
let files = [];
for (var i = 0; i < this.files4.length; i++) {
files.push(baseImgPath+this.files4[i].FILEPATH)
}
uni.previewImage({
urls: files,
current: e.currentTarget.dataset.index
});
},
playVideo(e) {
this.videoSrc = e.currentTarget.dataset.src
this.modalShow = true
}
}
}
</script>
<style>
.bb {
border-top: 1upx solid #f1f1f1;
border-bottom: 1upx solid #f1f1f1;
}
.cu-bar .action:first-child {
font-size: 26upx
}
.cu-form-title {
padding: 20upx 0;
}
.cu-form-textarea {
background-color: #ffffff;
padding: 1upx 30upx 20upx;
min-height: 100upx;
}
.cu-form-textarea textarea {
height: 4.6em;
width: 100%;
line-height: 1.2em;
flex: 1;
font-size: 28upx;
padding: 0;
}
.cu-form-group {
padding: 0upx 25upx;
}
.cu-form-group picker .picker {
line-height: 76upx;
}
.cu-form-group .title {
font-size: 28upx;
line-height: 76upx;
color: #888;
}
.cu-form-group uni-picker::after {
top: -11upx;
}
.selected {
display: flex;
align-items: center;
}
.selected .radio {
transform: scale(0.5);
margin-right: 10upx;
}
.cu-btn {
border-radius: 0;
width: 100%;
height: 84upx;
font-weight: bold;
}
.group {
display: flex;
align-items: center;
}
</style>