Blame view

src/components/oa/complaintDetail.vue 5.01 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
2e81c59f   wuxw   完成办公功能测试
2
3
    <el-dialog :title="`${form.typeName} ${$t('complaint.detail.title')}`" :visible.sync="visible" width="70%"
      top="5vh">
0a06b2d1   wuxw   开发完成投诉建议
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
      <el-form label-width="120px">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item :label="$t('complaint.detail.room')">
              <el-input v-model="form.roomName" readonly />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('complaint.detail.id')">
              <el-input v-model="form.complaintId" readonly />
            </el-form-item>
          </el-col>
        </el-row>
  
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item :label="$t('complaint.detail.type')">
2e81c59f   wuxw   完成办公功能测试
21
              <el-input v-model="form.typeName" readonly />
0a06b2d1   wuxw   开发完成投诉建议
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
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('complaint.detail.status')">
              <el-input v-model="form.stateName" readonly />
            </el-form-item>
          </el-col>
        </el-row>
  
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item :label="$t('complaint.detail.contact')">
              <el-input v-model="form.complaintName" readonly />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('complaint.detail.phone')">
              <el-input v-model="form.tel" readonly />
            </el-form-item>
          </el-col>
        </el-row>
  
        <template v-if="form.showCurrentUser">
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item :label="$t('complaint.detail.handler')">
                <el-input v-model="form.currentUserName" readonly />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item :label="$t('complaint.detail.handlerPhone')">
                <el-input v-model="form.currentUserTel" readonly />
              </el-form-item>
            </el-col>
          </el-row>
          <el-form-item :label="$t('complaint.detail.handlerId')">
            <el-input v-model="form.currentUserId" readonly />
          </el-form-item>
        </template>
  
2e81c59f   wuxw   完成办公功能测试
62
        <el-form-item :label="`${$t('complaint.detail.content')}`">
0a06b2d1   wuxw   开发完成投诉建议
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
          <el-input type="textarea" :rows="4" v-model="form.context" readonly />
        </el-form-item>
  
        <el-form-item :label="$t('complaint.detail.photos')" v-if="form.photosShow.length > 0">
          <div style="display:flex;flex-wrap:wrap;gap:10px">
            <el-image v-for="(photo, index) in form.photosShow" :key="index" style="width:100px;height:100px"
              :src="photo.url" :preview-src-list="form.photosShow.map(p => p.url)" fit="cover" />
          </div>
        </el-form-item>
      </el-form>
  
      <el-table :data="form.comments" border style="width:100%;margin-top:20px">
        <el-table-column prop="index" :label="$t('complaint.detail.serial')" width="80" align="center">
          <template slot-scope="scope">
            {{ scope.$index + 1 }}
          </template>
        </el-table-column>
        <el-table-column prop="auditName" :label="$t('complaint.detail.handler')" align="center" />
        <el-table-column prop="stateName" :label="$t('complaint.detail.status')" align="center" />
        <el-table-column prop="auditTime" :label="$t('complaint.detail.handleTime')" align="center" />
        <el-table-column prop="duration" :label="$t('complaint.detail.duration')" align="center" />
        <el-table-column prop="message" :label="$t('complaint.detail.comment')" align="center" />
      </el-table>
    </el-dialog>
  </template>
  
  <script>
  import { getCommunityId } from '@/api/community/communityApi'
  import { listWorkflowAuditInfo } from '@/api/oa/complaintApi'
  
  export default {
    name: 'ComplaintDetail',
    data() {
      return {
        visible: false,
        form: {
          complaintId: '',
          typeCd: '',
          complaintName: '',
          tel: '',
          context: '',
2e81c59f   wuxw   完成办公功能测试
104
          typeName: '',
0a06b2d1   wuxw   开发完成投诉建议
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
          stateName: '',
          roomName: '',
          currentUserName: '',
          currentUserTel: '',
          currentUserId: '',
          showCurrentUser: true,
          photos: [],
          photosShow: [],
          comments: []
        }
      }
    },
    methods: {
      open(row) {
        this.visible = true
2e81c59f   wuxw   完成办公功能测试
120
        console.log(row)
0a06b2d1   wuxw   开发完成投诉建议
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
        this.form = {
          ...row,
          photosShow: row.photos.map(photo => ({
            url: `/callComponent/download/getFile/file?fileId=${photo.url}&communityId=-1&time=${new Date()}`
          })),
          showCurrentUser: row['currentUserName'],
          currentUserName: row.currentUserName || this.$t('common.none'),
          currentUserTel: row.currentUserTel || this.$t('common.none'),
          currentUserId: row.currentUserId || this.$t('common.none')
        }
        this.loadComments()
      },
      async loadComments() {
        try {
          const params = {
            communityId: getCommunityId(),
            businessKey: this.form.complaintId
          }
          const { data } = await listWorkflowAuditInfo(params)
          this.form.comments = data
        } catch (error) {
          console.error('获取处理记录失败:', error)
        }
      }
    }
  }
  </script>