<template>
|
<div class="inner-bg-style evlaationMgtStyle">
|
<el-form class="evaluation" size="mini" ref="form" :model="form" label-width="100px" :rules="formRules">
|
<basic-info :form="form"></basic-info>
|
<el-form-item label="评价回复:" prop="reviewContent">
|
<el-input type="textarea" v-model="form.reviewContent" :autosize="{minRows:4,maxRows:8}"></el-input>
|
</el-form-item>
|
</el-form>
|
<el-row class="buttonPosition">
|
<el-button type="primary" size="mini" @click="submit">保存</el-button>
|
<el-button size="mini" @click="cancel">取消</el-button>
|
</el-row>
|
</div>
|
</template>
|
<script>
|
import basicInfo from '@/views/evaluationMgt/components/basicInfo.vue'
|
import evaluationApi from '@/api/evaluation'
|
export default {
|
components: { basicInfo },
|
data () {
|
return {
|
form: {},
|
formRules: {
|
reviewContent: [
|
{ required: true, message: '请输入评价回复' },
|
{ max: 1000, message: '评价回复最多只能输入 1000 个字' }]
|
}
|
}
|
},
|
created () {
|
this.getDetails()
|
},
|
methods: {
|
/**
|
* 查询详情
|
*/
|
getDetails () {
|
evaluationApi.detailsInfo({ evalId: this.$route.query.evalId }).then(res => {
|
if (res.data) {
|
this.form = JSON.parse(JSON.stringify(res.data))
|
}
|
})
|
},
|
/**
|
* 保存
|
*/
|
submit () {
|
this.$refs.form.validate().then(res => {
|
const params = {
|
evaluateId: this.form.id,
|
reviewContent: this.form.reviewContent
|
}
|
evaluationApi.replay(params).then(res => {
|
if (res.data) {
|
this.$message({
|
type: 'success',
|
message: '回复成功'
|
})
|
this.$router.push({ name: 'evaluationList' })
|
}
|
})
|
}).catch(() => {})
|
},
|
/**
|
* 取消
|
*/
|
cancel () {
|
this.$router.push({ name: 'evaluationList' })
|
}
|
}
|
}
|
</script>
|
<style lang="scss">
|
.buttonPosition{
|
text-align: center;
|
margin-top: 10px;
|
}
|
.evlaationMgtStyle{
|
padding:20px;
|
}
|
|
</style>
|