aRoomDetailComplaint.vue
3.82 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<template>
<div class="margin-top">
<el-table :data="aRoomDetailComplaintInfo.complaints" border style="width: 100%" class="margin-top">
<el-table-column prop="typeCdName" :label="$t('aRoomDetailComplaint.type')" align="center" />
<el-table-column :label="$t('aRoomDetailComplaint.room')" align="center">
<template slot-scope="scope">
{{ scope.row.floorNum }}-{{ scope.row.unitNum }}-{{ scope.row.roomNum }}
</template>
</el-table-column>
<el-table-column prop="complaintName" :label="$t('aRoomDetailComplaint.contact')" align="center" />
<el-table-column prop="tel" :label="$t('aRoomDetailComplaint.phone')" align="center" />
<el-table-column prop="stateName" :label="$t('aRoomDetailComplaint.status')" align="center" />
<el-table-column :label="$t('aRoomDetailComplaint.handler')" align="center">
<template slot-scope="scope">
{{ scope.row.currentUserName || $t('aRoomDetailComplaint.none') }}
</template>
</el-table-column>
<el-table-column :label="$t('aRoomDetailComplaint.handlerPhone')" align="center">
<template slot-scope="scope">
{{ scope.row.currentUserTel || $t('aRoomDetailComplaint.none') }}
</template>
</el-table-column>
<el-table-column prop="createTime" :label="$t('aRoomDetailComplaint.createTime')" align="center" />
<el-table-column :label="$t('aRoomDetailComplaint.actions')" align="center" width="180">
<template slot-scope="scope">
<el-button size="mini" @click="handleOpenComplaintDetail(scope.row)">
{{ $t('aRoomDetailComplaint.detail') }}
</el-button>
<el-button size="mini" @click="handleOpenWorkflowImage(scope.row)">
{{ $t('aRoomDetailComplaint.flowChart') }}
</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="margin-top">
<el-col :span="24" class="text-right">
<el-pagination @current-change="handlePageChange" :current-page="pagination.currentPage"
:page-size="pagination.pageSize" layout="total, prev, pager, next" :total="pagination.total" />
</el-col>
</el-row>
<complaint-detail ref="complaintDetail" />
<view-image ref="viewImage" />
</div>
</template>
<script>
import { listAdminComplaints } from '@/api/aCommunity/aRoomDetailComplaintApi'
import ComplaintDetail from '@/components/oa/complaintDetail'
import ViewImage from '@/components/system/viewImage'
export default {
name: 'ARoomDetailComplaint',
components: {
ComplaintDetail,
ViewImage
},
data() {
return {
aRoomDetailComplaintInfo: {
complaints: [],
ownerId: '',
name: '',
currentAppUserId: ''
},
pagination: {
currentPage: 1,
pageSize: 10,
total: 0
}
}
},
methods: {
open(data) {
this.aRoomDetailComplaintInfo.ownerId = data.ownerId
this.loadComplaintData()
},
loadComplaintData() {
const params = {
memberId: this.aRoomDetailComplaintInfo.ownerId,
page: this.pagination.currentPage,
row: this.pagination.pageSize
}
listAdminComplaints(params).then(response => {
this.aRoomDetailComplaintInfo.complaints = response.data
this.pagination.total = response.total
}).catch(error => {
console.error('Failed to load complaints:', error)
})
},
handlePageChange(currentPage) {
this.pagination.currentPage = currentPage
this.loadComplaintData()
},
handleOpenComplaintDetail(complaint) {
this.$refs.complaintDetail.open(complaint)
},
handleOpenWorkflowImage(complaint) {
this.$refs.viewImage.open(complaint.workflowImageUrl)
}
}
}
</script>
<style scoped>
.margin-top {
margin-top: 20px;
}
.text-right {
text-align: right;
}
</style>