Commit 82d82137140a2367ada09308dba3509085d0471c

Authored by wuxw
1 parent 9ac65158

v1.9 优化业主详情投诉不显示 bug

src/api/owner/ownerDetailComplaintApi.js
1 1 import request from '@/utils/request'
2 2  
3 3 export function listComplaints(params) {
4   - return request({
5   - url: '/complaint.listComplaints',
6   - method: 'get',
7   - params
  4 + return new Promise((resolve, reject) => {
  5 + request({
  6 + url: '/complaint.listComplaints',
  7 + method: 'get',
  8 + params
  9 + })
  10 + .then(response => {
  11 + resolve(response.data)
  12 + })
  13 + .catch(error => {
  14 + reject(error)
  15 + })
8 16 })
9 17 }
10 18  
11 19 export function listRunWorkflowImage(params) {
12   - return request({
  20 + return new Promise((resolve, reject) => {
  21 + request({
13 22 url: '/complaint/listRunWorkflowImage',
14   - method: 'get',
15   - params
  23 + method: 'get',
  24 + params
  25 + })
  26 + .then(response => {
  27 + resolve(response.data)
  28 + })
  29 + .catch(error => {
  30 + reject(error)
  31 + })
16 32 })
17 33 }
18 34 \ No newline at end of file
... ...
src/components/owner/ownerDetailComplaint.vue
1 1 <template>
2 2 <div class="margin-top">
3 3 <el-table :data="ownerDetailComplaintInfo.complaints" style="width: 100%">
4   - <el-table-column prop="typeCdName" :label="$t('complaint.table.type')" align="center"></el-table-column>
  4 + <el-table-column prop="typeName" :label="$t('complaint.table.type')" align="center"></el-table-column>
5 5 <el-table-column :label="$t('complaint.table.room')" align="center">
6 6 <template slot-scope="scope">
7   - {{scope.row.floorNum}}-{{scope.row.unitNum}}-{{scope.row.roomNum}}
  7 + {{scope.row.roomName}}
8 8 </template>
9 9 </el-table-column>
10 10 <el-table-column prop="complaintName" :label="$t('complaint.table.contact')" align="center"></el-table-column>
... ... @@ -27,9 +27,7 @@
27 27 <el-button size="mini" @click="_openComplaintDetailModel(scope.row)">
28 28 {{ $t('common.detail') }}
29 29 </el-button>
30   - <el-button size="mini" @click="_openRunWorkflowImage(scope.row)">
31   - {{ $t('ownerDetailComplaint.flowChart') }}
32   - </el-button>
  30 +
33 31 </el-button-group>
34 32 </template>
35 33 </el-table-column>
... ... @@ -81,7 +79,7 @@ export default {
81 79 this.ownerDetailComplaintInfo.link = link
82 80 this._loadOwnerDetailComplaintData(1, this.pagination.pageSize)
83 81 },
84   - _loadOwnerDetailComplaintData(page, row) {
  82 + async _loadOwnerDetailComplaintData(page, row) {
85 83 const params = {
86 84 communityId: getCommunityId(),
87 85 memberId: this.ownerDetailComplaintInfo.ownerId,
... ... @@ -89,12 +87,10 @@ export default {
89 87 row: row
90 88 }
91 89  
92   - listComplaints(params).then(response => {
93   - this.ownerDetailComplaintInfo.complaints = response.complaints
94   - this.pagination.total = response.total
95   - }).catch(error => {
96   - console.error('请求失败处理', error)
97   - })
  90 + const res = await listComplaints(params)
  91 +
  92 + this.ownerDetailComplaintInfo.complaints = res.data
  93 + this.pagination.total = res.total
98 94 },
99 95 _openComplaintDetailModel(complaint) {
100 96 this.$refs.complaintDetail.open(complaint)
... ...