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
83
<template>
    <div class="inner-bg-style userSuggestStyle">
        <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="replyContent">
               <el-input type="textarea" v-model="form.replyContent" :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/userSuggest/components/basicInfo.vue'
import userSuggestApi from '@/api/userSuggest'
export default {
  components: { basicInfo },
  data () {
    return {
      form: {
        replyContent: null
      },
      formRules: {
        replyContent: [
          { required: true, message: '请输入反馈回复' },
          { max: 1000, message: '反馈回复最多只能输入 1000 个字' }]
      }
    }
  },
  created () {
    this.getDetails()
  },
  methods: {
    /**
       * 查询详情
       */
    getDetails () {
      userSuggestApi.detailsInfo({ id: this.$route.query.id }).then(res => {
        if (res.data) {
          this.form = res.data
        }
      })
    },
    /**
       * 保存
       */
    submit () {
      this.$refs.form.validate().then(res => {
        const params = {
          id: this.form.id,
          replyContent: this.form.replyContent
        }
        userSuggestApi.replay(params).then(res => {
          if (res.data) {
            this.$message({
              type: 'success',
              message: '回复成功'
            })
            this.$router.push({ name: 'userSuggestList' })
          }
        })
      }).catch(() => {})
    },
    /**
     * 取消
     */
    cancel () {
      this.$router.push({ name: 'userSuggestList' })
    }
  }
}
</script>
<style lang="scss">
.buttonPosition{
    text-align: center;
    margin-top: 10px;
}
.userSuggestStyle{
  padding:20px;
}
</style>