155 lines
4.9 KiB
Vue
155 lines
4.9 KiB
Vue
<template>
|
|
<ai-detail class="AppDynamicDetail">
|
|
<template slot="title">
|
|
<ai-title title="详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
|
<template #rightBtn>
|
|
<div class="title-btns">
|
|
<el-button type="primary" icon="iconfont iconRegister" @click="isShowExamine = true" v-if="info.status == 0">审核</el-button>
|
|
</div>
|
|
</template>
|
|
</ai-title>
|
|
</template>
|
|
<template slot="content">
|
|
<ai-card title="基本信息">
|
|
<template #content>
|
|
<ai-wrapper label-width="120px">
|
|
<ai-info-item label="内容" isLine :value="info.content"></ai-info-item>
|
|
<ai-info-item label="所属网格" isLine :value="info.girdName"></ai-info-item>
|
|
<ai-info-item label="类型" >{{dict.getLabel("wyGirdNewsType", info.type)}}</ai-info-item>
|
|
<ai-info-item label="地址" >{{info.address}}</ai-info-item>
|
|
<ai-info-item label="网格员姓名" :value="info.name"></ai-info-item>
|
|
<ai-info-item label="状态" >{{dict.getLabel("auditStatus", info.status)}}</ai-info-item>
|
|
<ai-info-item label="发布时间" :value="info.createTime"></ai-info-item>
|
|
<ai-info-item label="图片" isLine>
|
|
<div class="files">
|
|
<div class="file-item" v-for="(item, index) in info.files" :key="index">
|
|
<img :src="item.url" v-viewer="{movable: true}">
|
|
</div>
|
|
</div>
|
|
</ai-info-item>
|
|
</ai-wrapper>
|
|
</template>
|
|
</ai-card>
|
|
<ai-card title="审核信息" v-if="info.status != 0">
|
|
<template #content>
|
|
<ai-wrapper label-width="120px">
|
|
<ai-info-item label="审批意见" isLine :value="info.examineOpinion"></ai-info-item>
|
|
<ai-info-item label="审批人" :value="info.examineUserName"></ai-info-item>
|
|
<ai-info-item label="审批时间" :value="info.examineTime"></ai-info-item>
|
|
</ai-wrapper>
|
|
</template>
|
|
</ai-card>
|
|
<ai-dialog
|
|
:visible.sync="isShowExamine"
|
|
width="800px"
|
|
title="审核"
|
|
@closed="isShowExamine=false"
|
|
@onConfirm="handleEvent">
|
|
<el-form class="ai-form" label-width="120px" :model="form" ref="form">
|
|
<el-form-item label="是否通过" prop="status" style="width: 100%;" :rules="[{ required: true, message: '请选择是否通过' }]">
|
|
<el-radio-group v-model="form.status">
|
|
<el-radio label="1">是</el-radio>
|
|
<el-radio label="0">否</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
<el-form-item label="审批意见" prop="opinion" style="width: 100%;" >
|
|
<el-input type="textarea" :rows="5" :maxlength="500" v-model="form.opinion" clearable placeholder="请输入审批意见" show-word-limit></el-input>
|
|
</el-form-item>
|
|
<!-- <el-form-item label="图片" prop="files" style="width: 100%;">
|
|
<ai-uploader
|
|
:instance="instance"
|
|
isShowTip
|
|
v-model="form.files"
|
|
:limit="9">
|
|
</ai-uploader>
|
|
</el-form-item> -->
|
|
</el-form>
|
|
</ai-dialog>
|
|
</template>
|
|
</ai-detail>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'Detail',
|
|
|
|
props: {
|
|
instance: Function,
|
|
dict: Object,
|
|
params: Object,
|
|
moduleId: String
|
|
},
|
|
|
|
data () {
|
|
return {
|
|
info: {},
|
|
id: '',
|
|
isShowExamine: false,
|
|
form: {status: '', opinion: ''}
|
|
}
|
|
},
|
|
|
|
created () {
|
|
this.dict.load('wyGirdNewsType', 'auditStatus').then(() => {
|
|
this.getDetail()
|
|
})
|
|
},
|
|
|
|
methods: {
|
|
getDetail () {
|
|
this.instance.post(`/app/appgirdnews/queryDetailById?id=${this.params.id}`).then(res => {
|
|
if (res.code === 0) {
|
|
this.info = res.data
|
|
this
|
|
this.info = {
|
|
...res.data
|
|
}
|
|
}
|
|
})
|
|
},
|
|
|
|
handleEvent() {
|
|
this.$refs.form.validate(v => {
|
|
if (v) {
|
|
this.instance.post(`/app/appgirdnews/examine?id=${this.params.id}&pass=${this.form.status}&opinion=${this.form.opinion}`).then(res => {
|
|
if (res?.code == 0) {
|
|
this.isShowExamine = false
|
|
this.$message.success('审核成功!')
|
|
this.cancel(true)
|
|
}
|
|
})
|
|
}
|
|
})
|
|
},
|
|
|
|
cancel (isRefresh) {
|
|
this.$emit('change', {
|
|
type: 'List',
|
|
isRefresh: !!isRefresh
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.AppDynamicDetail {
|
|
.files {
|
|
display: flex;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
.file-item {
|
|
width: 150px;
|
|
height: 150px;
|
|
margin: 0 20px 20px 0;
|
|
|
|
img, video {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: cover;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|