Files
api-client/src/views/rating/topicReview/components/ReviewEdit.vue
2026-06-15 15:37:27 +08:00

82 lines
2.5 KiB
Vue

<template>
<el-dialog :title="title" :visible.sync="dialogFormVisible" width="500px" @close="close">
<el-form ref="form" label-width="100px" :model="form">
<el-form-item label="审核结果">
<el-tag :type="form.status === 2 ? 'success' : 'danger'">
{{ form.status === 2 ? '通过' : '拒绝' }}
</el-tag>
</el-form-item>
<el-form-item v-if="form.status === 3" label="拒绝原因">
<el-input v-model="form.rejectReason" placeholder="选填,请输入拒绝原因" :rows="3" type="textarea" />
</el-form-item>
<el-form-item label="审核备注">
<el-input v-model="form.auditRemark" placeholder="选填,请输入内部审核备注" :rows="3" type="textarea" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button :loading="saving" type="primary" @click="save"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { reviewTopic } from '@/api/rating/topicOperate'
export default {
name: 'ReviewEdit',
data() {
return {
title: '审核确认',
dialogFormVisible: false,
saving: false,
form: {
topicId: '',
itemId: '',
userId: '',
status: '',
type: '', // topic 或 topicItem
rejectReason: '',
auditRemark: '',
},
}
},
methods: {
showEdit(row, status, type) {
this.title = `审核确认 (${type === 'topic' ? '话题' : '评价项'})`
this.form = {
topicId: type === 'topic' ? row.id : row.topicId || '',
itemId: type === 'topicItem' ? row.id : '',
userId: this.$store.state.user.userId || '',
status,
type,
rejectReason: '',
auditRemark: '',
}
this.dialogFormVisible = true
},
close() {
this.dialogFormVisible = false
this.saving = false
},
async save() {
this.saving = true
try {
const payload = { ...this.form }
if (payload.itemId && !payload.itemmId) {
payload.itemmId = payload.itemId
}
const { msg } = await reviewTopic(payload)
this.$baseMessage(msg || '操作成功', 'success')
this.$emit('fetch-data')
this.close()
} catch (error) {
console.error(error)
} finally {
this.saving = false
}
},
},
}
</script>