Blame view

src/components/complaint/aComplaintDetailEvent.vue 1.75 KB
e4877374   wuxw   开发完成admin 小区投诉功能
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
  <template>
    <div class="event-container">
      <el-table :data="events" border style="width: 100%">
        <el-table-column prop="eventType" :label="$t('complaintDetailEvent.type')" align="center">
          <template slot-scope="scope">
            {{ getEventTypeName(scope.row.eventType) }}
          </template>
        </el-table-column>
        <el-table-column prop="createUserName" :label="$t('complaintDetailEvent.operator')" align="center"></el-table-column>
        <el-table-column prop="remark" :label="$t('complaintDetailEvent.remark')" align="center"></el-table-column>
        <el-table-column prop="createTime" :label="$t('complaintDetailEvent.time')" align="center"></el-table-column>
      </el-table>
    </div>
  </template>
  
  <script>
  import { listComplaintEvents } from '@/api/complaint/adminComplaintDetailApi'
  
  export default {
    name: 'AComplaintDetailEvent',
    props: {
      complaintId: {
        type: String,
        required: true
      }
    },
    data() {
      return {
        events: []
      }
    },
    methods: {
      async loadData() {
        try {
          const params = {
            complaintId: this.complaintId,
            page: 1,
            row: 100
          }
          const { data } = await listComplaintEvents(params)
          this.events = data || []
        } catch (error) {
          this.$message.error(this.$t('complaintDetailEvent.fetchError'))
        }
      },
      getEventTypeName(eventType) {
        switch (eventType) {
          case '1000': return this.$t('complaintDetailEvent.submit')
          case '1001': return this.$t('complaintDetailEvent.process')
          case '2002': return this.$t('complaintDetailEvent.evaluate')
          default: return this.$t('complaintDetailEvent.reply')
        }
      }
    }
  }
  </script>
  
  <style lang="scss" scoped>
  .event-container {
    padding: 20px 0;
  }
  </style>