北尚诉办前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

328 lines
10 KiB

<template>
<div class="project-handle">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" style="width: 100%; height: 100%;">
<div class="project-detail">
<div class="project-detail-tip">议题详情</div>
<el-form label-position="right" label-width="120px">
<el-form-item label="议题内容:" prop="eventContent">
<div>{{dataForm.eventContent}}</div>
<span v-for="(imgUrl, index) in urls" :key="index" style="margin: 5px">
<el-popover placement="bottom" title="" trigger="click">
<img :src="imgUrl" style='width: 800px;height: 600px;'>
<img slot="reference" :src="imgUrl" :alt="imgUrl" style="max-height: 100px;max-width: 100px">
</el-popover>
</span>
</el-form-item>
<el-form-item label="所属网格:" prop="ownGrid">
<div>{{dataForm.ownGrid}}</div>
</el-form-item>
<el-form-item label="上报时间:" prop="createdTime">
<div>{{dataForm.createdTime}}</div>
</el-form-item>
<el-form-item label="上报人:" prop="nickName">
<div>{{dataForm.nickName}}</div>
</el-form-item>
<el-form-item label="电话:" prop="mobile">
<div>{{dataForm.mobile}}</div>
</el-form-item>
</el-form>
<div class="container">
<div class="location">上报位置: {{dataForm.address}}</div>
<div id="map"></div>
</div>
</div>
<div class="handle-operation">
<div class="handle-operation-tip">处理操作</div>
<el-form label-width="120px" label-position="right" style="width: 720px;">
<el-form-item label="审核:" prop="eventState">
<el-radio v-model="dataForm.eventState" label="4">审核通过</el-radio>
<el-radio v-model="dataForm.eventState" label="2">驳回</el-radio>
</el-form-item>
<el-form-item label="议题所属类别:" prop="categoryId" v-if="categoryVisible">
<el-select v-model="dataForm.categoryId" placeholder="请选择">
<el-option
v-for="item in categoryOptions"
:key="item.id"
:label="item.categoryName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="处理意见:" prop="advice">
<el-input :rows="4" v-model="dataForm.advice" type="textarea" placeholder="请您填写居民诉求的处理情况及答复意见,向居民公开展示,500字以内"></el-input>
</el-form-item>
<el-form-item style="float: right;">
<el-button size="small" style="width: 95px" type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
<el-button size="small" style="width: 95px" @click="backToItemDeal">{{ '返回' }}</el-button>
</el-form-item>
</el-form>
</div>
</el-form>
</div>
</template>
<script>
import debounce from 'lodash/debounce'
import BMap from 'BMap'
import 'element-ui/lib/theme-chalk/timeline.css'
import 'element-ui/lib/theme-chalk/timeline-item.css'
export default {
name: 'IssueReviewDetailView',
data () {
return {
map: '',
dataForm: {
id: '',
eventContent: '',
nickName: '',
categoryId: '',
advice: '',
eventState: '4'
},
categoryVisible: true,
urls: [],
categoryOptions: []
}
},
mounted () {
this.dataForm.id = this.$route.query.id
this.init()
},
computed: {
dataRule () {
return {
categoryId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
eventState: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
advice: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
watch: {
'dataForm.eventState': function (val) {
if (val === '2') {
this.categoryVisible = false
} else {
this.categoryVisible = true
}
}
},
methods: {
backToItemDeal () {
this.$parent.selectComponent = 'IssueReviewList'
},
init () {
this.$nextTick(() => {
if (this.dataForm.id) {
this.getInfo()
this.getCategoryList()
}
})
},
initBmap (latitude, longitude) {
this.map = new BMap.Map('map')
const point = new BMap.Point(120.38821849395045, 36.120219258412966)
var marker = new BMap.Marker(point)
this.map.addOverlay(marker)
this.map.centerAndZoom(point, 13)
this.map.enableScrollWheelZoom(true)
},
getCategoryList () {
this.$http.get('/events/eventcategory/list',
{
params: {
categoryCode: '0'
}
}
).then(({ data: res }) => {
this.dataListLoading = false
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.categoryOptions = res.data
}).catch(() => {})
},
// 获取信息
getInfo () {
this.$http.get(`/events/epdcevents/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
this.initBmap(this.dataForm.issueLatitude, this.dataForm.issueLongitude)
this.urls = res.data.imageArray
}).catch(() => {})
},
// 表单提交
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
if (this.dataForm.advice.length > 500) {
return this.$message.error('处理意见不超过500字')
}
this.$http['post']('/events/epdcevents/review', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$parent.selectComponent = 'IssueReviewList'
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>
<style lang="scss">
.project-handle {
.el-timeline {
padding-left: 9px;
font-size: 13px;
}
.el-textarea {
width: 600px !important;
}
.el-input {
width: 600px !important;
}
}
</style>
<style lang="scss" scoped>
.project-handle {
width: 100%;
height: calc(100vh - 120px);
background: #ffffff;
box-sizing: border-box;
padding: 10px;
.project-detail {
width: 100%;
height: 49%;
border: 2px solid #ccc;
box-sizing: border-box;
padding: 10px;
padding-top: 20px;
float:left;
margin-bottom: 1%;
position:relative;
.project-detail-tip {
position: absolute;
top: 0;
left:0;
width: 80px;
height: 30px;
line-height: 30px;
color: #ffffff;
background: #4ac38b;
text-align:center;
}
.el-form {
width: 58%;
height: 100%;
float:left;
overflow-y:auto;
&::-webkit-scrollbar {
width: 5px;
height: 1px;
}
&::-webkit-scrollbar-thumb {
border-radius: 5px;
background: #ccc;
}
&::-webkit-scrollbar-track {
border-radius: 10px;
background: #fff;
}
}
.container {
width: 40%;
height: 100%;
float: right;
.location {
height: 30px;
line-height: 30px;
}
#map {
width: 100%;
height: calc(100% - 30px);
}
}
}
.project-progress {
width: 20%;
height: 100%;
float: right;
border: 2px solid #ccc;
box-sizing: border-box;
margin-left: 1%;
padding-top: 20px;
overflow-y:auto;
&::-webkit-scrollbar {
width: 5px;
height: 1px;
}
&::-webkit-scrollbar-thumb {
border-radius: 5px;
background: #aaa;
}
&::-webkit-scrollbar-track {
border-radius: 10px;
background: #ccc;
}
}
.handle-operation {
padding-top: 30px;
box-sizing: border-box;
width: 100%;
height: 49%;
box-sizing: border-box;
border: 2px solid #ccc;
float:left;
position: relative;
overflow-y:auto;
&::-webkit-scrollbar {
width: 5px;
height: 1px;
}
&::-webkit-scrollbar-thumb {
border-radius: 5px;
background: #aaa;
}
&::-webkit-scrollbar-track {
border-radius: 10px;
background: #ccc;
}
.handle-operation-tip {
position: absolute;
top: 0;
left:0;
width: 80px;
height: 30px;
line-height: 30px;
color: #ffffff;
background: #ff7600;
text-align:center;
}
}
}
</style>