fuliqi
2024-01-24 29c1e7eb5ac16e90d8991a86c1c071bc312ec8d9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<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>