Blame view

src/components/owner/ownerComplaints.vue 3.23 KB
af1bcbd6   wuxw   房屋页面开发中
1
  <template>
81955f61   wuxw   优化房屋页面
2
3
    <el-dialog :visible.sync="dialogVisible" :title="$t('ownerComplaints.title')" width="80%" top="5vh"
      @close="handleClose">
af1bcbd6   wuxw   房屋页面开发中
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
      <el-row>
        <el-col :span="24">
          <div class="table-container">
            <el-table :data="ownerComplaintsInfo.complaints" border stripe>
              <el-table-column prop="typeCdName" :label="$t('ownerComplaints.type')" align="center" />
              <el-table-column :label="$t('ownerComplaints.room')" align="center">
                <template #default="{ row }">
                  {{ row.floorNum }}-{{ row.unitNum }}-{{ row.roomNum }}
                </template>
              </el-table-column>
              <el-table-column prop="complaintName" :label="$t('ownerComplaints.contact')" align="center" />
              <el-table-column prop="tel" :label="$t('ownerComplaints.phone')" align="center" />
              <el-table-column prop="stateName" :label="$t('ownerComplaints.status')" align="center" />
              <el-table-column :label="$t('ownerComplaints.handler')" align="center">
                <template #default="{ row }">
                  {{ row.currentUserName || $t('ownerComplaints.none') }}
                </template>
              </el-table-column>
              <el-table-column :label="$t('ownerComplaints.handlerPhone')" align="center">
                <template #default="{ row }">
                  {{ row.currentUserTel || $t('ownerComplaints.none') }}
                </template>
              </el-table-column>
              <el-table-column prop="createTime" :label="$t('ownerComplaints.createTime')" align="center" />
            </el-table>
          </div>
81955f61   wuxw   优化房屋页面
30
31
          <el-pagination background layout="prev, pager, next, sizes, total" :total="totalCount" :page-size="pageSize"
            :current-page="currentPage" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
af1bcbd6   wuxw   房屋页面开发中
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
        </el-col>
      </el-row>
    </el-dialog>
  </template>
  
  <script>
  import { listComplaints } from '@/api/room/ownerComplaintsApi'
  
  export default {
    name: 'OwnerComplaints',
    data() {
      return {
        dialogVisible: false,
        ownerComplaintsInfo: {
          complaints: [],
          ownerId: ''
        },
        totalCount: 0,
        pageSize: 10,
        currentPage: 1
      }
    },
    methods: {
      open(ownerId) {
        this.ownerComplaintsInfo.ownerId = ownerId
        this.dialogVisible = true
        this._loadOwnerComplaintInfo(1, this.pageSize)
      },
      handleClose() {
        this.dialogVisible = false
      },
      handleSizeChange(size) {
        this.pageSize = size
        this._loadOwnerComplaintInfo(this.currentPage, size)
      },
      handleCurrentChange(page) {
        this.currentPage = page
        this._loadOwnerComplaintInfo(page, this.pageSize)
      },
      async _loadOwnerComplaintInfo(page, size) {
        try {
          const params = {
            page: page,
            row: size,
81955f61   wuxw   优化房屋页面
76
            communityId: this.getCommunityId(),
af1bcbd6   wuxw   房屋页面开发中
77
78
            ownerId: this.ownerComplaintsInfo.ownerId
          }
81955f61   wuxw   优化房屋页面
79
  
af1bcbd6   wuxw   房屋页面开发中
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
          const response = await listComplaints(params)
          this.ownerComplaintsInfo.complaints = response.data
          this.totalCount = response.total
          this.currentPage = page
        } catch (error) {
          console.error('加载业主投诉信息失败:', error)
        }
      }
    }
  }
  </script>
  
  <style scoped>
  .table-container {
    margin-top: 15px;
  }
  </style>