<template>
|
<view class="">
|
|
|
<view class="item-row flex j-c-s-b a-i-c">
|
<text>场所名称</text>
|
<text class="item-content">{{info.placeName}}</text>
|
</view>
|
<view class="item-row flex j-c-s-b a-i-c">
|
<text>地址</text>
|
<text class="item-content">{{info.location}}</text>
|
</view>
|
<view class="item-row flex j-c-s-b a-i-c">
|
<text>描述</text>
|
<text class="item-content">{{info.remark}}</text>
|
</view>
|
|
<view class="item-row flex j-c-s-b a-i-c">
|
<text>审核状态</text>
|
<text class="item-content" v-if="info.confirmFlag == 1">待审核</text>
|
<text class="item-content" v-if="info.confirmFlag == 2">审核通过</text>
|
<text class="item-content" v-if="info.confirmFlag == 3">审核驳回</text>
|
<text class="item-content" v-if="info.confirmFlag == 4">待处理</text>
|
</view>
|
|
<view class="item-row flex j-c-s-b a-i-c" v-if="info.confirmFlag == 3">
|
<text>驳回原因</text>
|
<text>{{info.confirmNotion}}</text>
|
</view>
|
|
<view class="item-row flex j-c-s-b a-i-c">
|
<text>时间</text>
|
<text>{{info.createTime}}</text>
|
</view>
|
|
|
<view class="item-row flex j-c-s-b a-i-c" v-if="info.type == 1">
|
<text>隐患类型</text>
|
<text>{{troubleValue}}</text>
|
</view>
|
|
<view class="item-row flex j-c-s-b a-i-c" v-if="info.isProblem">
|
<text>是否隐患</text>
|
<text>{{info.isProblem == 1?"是":"否"}}</text>
|
</view>
|
<view class="item-row flex j-c-s-b a-i-c" v-if="info.isHandle">
|
<text>是否处理</text>
|
<text>{{info.isHandle == 1?"是":"否"}}</text>
|
</view>
|
|
<view class="image-wrap bgc-ff" v-if="images.length">
|
<view class="mb-20">
|
图片
|
</view>
|
<view class="flex flex-wrap">
|
<view class="image-item" v-for="(i,k) in images" @click="previewImage(images,i)">
|
<u-image :src="i" width="100rpx" height="100rpx"></u-image>
|
</view>
|
</view>
|
</view>
|
|
<block v-if="roleTypeName == 'mj'">
|
<view class="image-wrap bgc-ff">
|
<view class="mb-20">
|
<text style="color: red;">* </text> 处理意见
|
</view>
|
<view class="flex flex-wrap">
|
<u-textarea v-model="confirmNotion" placeholder="请输入处理意见"
|
:disabled="info.confirmFlag == 2?true:false"></u-textarea>
|
</view>
|
</view>
|
|
<view class="image-wrap bgc-ff">
|
<view class="mb-20">
|
<text style="color: red;">* </text> 工作照片
|
</view>
|
<view class="flex-wrap" v-if="info.confirmFlag == 2">
|
<view class="mr-20" v-for="i in workImage">
|
<u-image :src="i" width="140rpx" height="140rpx" @click="previewImage(workImage,i)"></u-image>
|
</view>
|
</view>
|
<u-upload v-else :fileList="form.images" :previewFullImage="uploadConfig.previewFullImage"
|
:accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple" :maxCount="uploadConfig.maxCount"
|
:capture="uploadConfig.capture" @afterRead="afterReadImg" @delete="deletePic">
|
<view class="upload-item upload-icon flex_base">
|
<u-icon name="/static/icon/upload.png" width="60rpx" height="60rpx"></u-icon>
|
</view>
|
</u-upload>
|
</view>
|
|
</block>
|
|
|
|
<view class="image-wrap bgc-ff" v-if="roleTypeName == 'xyzt' && info.confirmFlag == 4">
|
<u-form labelWidth="70" :model="form" ref="form">
|
<u-form-item label="是否隐患:" labelWidth="100" prop="isProblem">
|
<u-radio-group v-model="form.isProblem">
|
<u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in statusList" :key="index"
|
:label="item.name" :name="item.id">
|
</u-radio>
|
</u-radio-group>
|
</u-form-item>
|
<u-form-item label="是否处理:" labelWidth="100" prop="isHandle" v-if="form.isProblem == 1">
|
<u-radio-group v-model="form.isHandle" @change="changeRadio">
|
<u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in statusList" :key="index"
|
:label="item.name" :name="item.id">
|
</u-radio>
|
</u-radio-group>
|
</u-form-item>
|
|
<!-- <u-form-item label="是否上报:" labelWidth="100" prop="isReporting" v-if="form.isHandle == 2">
|
<u-radio-group v-model="form.isReporting">
|
<u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in statusList" :key="index"
|
:label="item.name" :name="item.id">
|
</u-radio>
|
</u-radio-group>
|
</u-form-item> -->
|
</u-form>
|
</view>
|
|
<view class="blank"></view>
|
|
<!-- <audit-action @handle="submit"
|
v-if="roleType == 2 && info.confirmFlag == 1 && roleTypeName == 'mj' "></audit-action> -->
|
<!-- <footer-btn v-if="roleType == 1 && info.confirmFlag == 3" text="编辑" @click="navToEdit" /> -->
|
<footer-btn v-if="roleTypeName == 'xyzt' && info.confirmFlag == 4 " @click="submitInfo" />
|
<footer-btn v-if="roleType == 2 && info.confirmFlag == 1 && roleTypeName == 'mj'" text="确定"
|
@click="submitInfo" />
|
</view>
|
|
</template>
|
|
<script>
|
import uploadMixin from "@/mixin/uploadMixin";
|
import auditAction from '@/components/btn/actionBtn.vue'
|
import {
|
getTroubleReportDetail,
|
auditTroubleReport
|
} from "@/api/school/school.js"
|
import {
|
bizDictionary
|
} from '@/api/system/dict.js'
|
export default {
|
components: {
|
auditAction
|
},
|
mixins: [uploadMixin],
|
data() {
|
return {
|
info: {},
|
roleType: 1,
|
id: "",
|
images: [],
|
confirmNotion: "",
|
form: {
|
images: []
|
},
|
statusList: [{
|
name: "是",
|
id: 1
|
},
|
{
|
name: "否",
|
id: 2
|
}
|
],
|
roleTypeName: "",
|
workImage: [],
|
troubleValue: ""
|
}
|
},
|
|
onLoad(option) {
|
let {
|
roleName,
|
roleAlias
|
} = uni.getStorageSync("activeRole");
|
this.roleTypeName = roleAlias;
|
if (roleAlias == "mj" || roleAlias == "xyzt") {
|
this.roleType = 2;
|
}
|
if (roleAlias == "inhabitant" || roleAlias == "xyty") {
|
this.roleType == 1;
|
}
|
this.id = option.id;
|
},
|
|
onShow() {
|
this.getDetail(this.id)
|
},
|
|
methods: {
|
getDangerTypeList(callback) {
|
bizDictionary({
|
code: "hiddenDangerType"
|
}).then(res => {
|
if (res.code == 200) {
|
callback(res.data);
|
}
|
})
|
},
|
|
getDetail(id) {
|
getTroubleReportDetail({
|
id
|
}).then(res => {
|
this.info = res.data;
|
if (res.data.images) {
|
this.images = this.$setImageUrl(res.data.images);
|
}
|
if (Number(res.data.type) == 1) {
|
uni.setNavigationBarTitle({
|
title: "隐患排查详情"
|
})
|
this.getDangerTypeList(data => {
|
this.troubleValue = this.$getIndex(data, res.data.hiddenDangerType, "dictKey",
|
"dictValue").name
|
})
|
} else {
|
uni.setNavigationBarTitle({
|
title: "矛盾纠纷详情"
|
})
|
}
|
if (res.data.workImage) {
|
this.workImage = this.$setImageUrl(res.data.workImage);
|
}
|
if (res.data.type == 1) {
|
uni.setNavigationBarTitle({
|
title: "安全隐患排查详情"
|
})
|
} else {
|
uni.setNavigationBarTitle({
|
title: "矛盾纠纷排查详情"
|
})
|
}
|
})
|
},
|
|
changeRadio(e) {
|
if (e == 2) {
|
this.form.isReporting = 1;
|
}
|
},
|
|
previewImage(urls, current) {
|
uni.previewImage({
|
urls,
|
current
|
})
|
},
|
|
submit(val) {
|
let data = {
|
id: this.info.id,
|
confirmFlag: val.type == 2 ? 2 : 3,
|
}
|
if (val.type == 3) {
|
data.confirmNotion = val.remark;
|
}
|
auditTroubleReport(data).then(res => {
|
if (res.code == 200) {
|
this.$showTips("操作成功", "success");
|
setTimeout(() => {
|
uni.navigateBack();
|
}, 300)
|
}
|
})
|
},
|
|
submitInfo() {
|
let data = {
|
id: this.info.id,
|
isProblem: this.form.isProblem,
|
isHandle: this.form.isHandle,
|
}
|
if (this.roleTypeName == "xyzt") {
|
if (!this.form.isProblem) {
|
this.$showTips("请选择是否隐患")
|
return;
|
}
|
if (this.form.isProblem == 1 && !this.form.isHandle) {
|
this.$showTips("请选择是否处理")
|
return;
|
}
|
if (this.form.isProblem == 2) {
|
if (this.form.isHandle) {
|
delete this.form.isHandle;
|
}
|
data.confirmFlag = 2;
|
} else if (this.form.isHandle == 1) {
|
data.confirmFlag = 2;
|
} else {
|
data.confirmFlag = 1;
|
}
|
} else {
|
if (!this.confirmNotion) {
|
this.$showTips("请输入处理意见")
|
return;
|
}
|
if (this.form.images.length) {
|
let urls = []
|
this.form.images.forEach(e => {
|
urls.push(e.name)
|
})
|
data.workImage = urls.join(",")
|
|
} else {
|
this.$showTips("请上传工作照片")
|
return;
|
}
|
data.confirmFlag = 2;
|
data.confirmNotion = this.confirmNotion
|
delete this.form.images;
|
}
|
auditTroubleReport(data).then(res => {
|
if (res.code == 200) {
|
this.$showTips("操作成功", "success");
|
setTimeout(() => {
|
uni.navigateBack();
|
}, 300)
|
}
|
})
|
},
|
|
navToEdit() {
|
uni.navigateTo({
|
url: `edit?id=${this.info.id}`
|
})
|
},
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
page {
|
background-color: #f5f5f5;
|
}
|
|
.item-row {
|
width: 100%;
|
padding: 30rpx;
|
box-sizing: border-box;
|
border-bottom: 1px solid #f5f5f5;
|
font-size: 28rpx;
|
background-color: #fff;
|
|
.item-content {
|
width: 70%;
|
text-align: right;
|
}
|
|
.item-left {
|
width: 70%;
|
}
|
}
|
|
.image-wrap {
|
margin-top: 20rpx;
|
padding: 20rpx;
|
|
.image-item {
|
margin-right: 20rpx;
|
}
|
}
|
|
|
.upload-item {
|
width: 140rpx;
|
height: 140rpx;
|
border: 1px solid #EEEEEE;
|
}
|
|
.upload {
|
margin: 0 30rpx;
|
padding: 30rpx;
|
}
|
|
.blank {
|
width: 100%;
|
height: 200rpx;
|
}
|
</style>
|