Blame view

src/components/aCommunity/aCarDetailOwner.vue 4.39 KB
0b8f34f9   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
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
  <template>
    <div>
      <el-row>
        <el-col :span="24" class="text-right"></el-col>
      </el-row>
  
      <div class="margin-top">
        <el-table :data="aCarDetailOwnerInfo.owners" style="width: 100%">
          <el-table-column :label="$t('carDetailOwner.ownerFace')" align="center" width="100">
            <template slot-scope="scope">
              <el-image style="width: 60px; height: 60px;" :src="scope.row.url || '/img/noPhoto.jpg'" fit="cover"
                @click="_viewOwnerFace(scope.row.url)" class="border-radius">
              </el-image>
            </template>
          </el-table-column>
          <el-table-column :label="$t('carDetailOwner.name')" align="center">
            <template slot-scope="scope">
              {{ scope.row.name }}({{ scope.row.link }})
            </template>
          </el-table-column>
          <el-table-column :label="$t('carDetailOwner.gender')" align="center">
            <template slot-scope="scope">
              {{ scope.row.sex == 0 ? $t('carDetailOwner.male') : $t('carDetailOwner.female') }}
            </template>
          </el-table-column>
          <el-table-column prop="idCard" :label="$t('carDetailOwner.idCard')" align="center"></el-table-column>
          <el-table-column prop="address" :label="$t('carDetailOwner.address')" align="center"></el-table-column>
          <el-table-column prop="roomCount" :label="$t('carDetailOwner.roomCount')" align="center"></el-table-column>
          <el-table-column prop="memberCount" :label="$t('carDetailOwner.memberCount')" align="center"></el-table-column>
          <el-table-column prop="carCount" :label="$t('carDetailOwner.carCount')" align="center"></el-table-column>
          <el-table-column prop="complaintCount" :label="$t('carDetailOwner.complaintCount')"
            align="center"></el-table-column>
          <el-table-column prop="repairCount" :label="$t('carDetailOwner.repairCount')" align="center"></el-table-column>
          <el-table-column prop="oweFee" :label="$t('carDetailOwner.oweFee')" align="center"></el-table-column>
          <el-table-column prop="contractCount" :label="$t('carDetailOwner.contractCount')"
            align="center"></el-table-column>
          <el-table-column :label="$t('common.operation')" align="center" width="120">
            <template slot-scope="scope">
              <el-button type="text" size="small" @click="_toACarDetailOwnerDetail(scope.row)">
                {{ $t('carDetailOwner.detail') }}
              </el-button>
            </template>
          </el-table-column>
        </el-table>
  
        <el-row class="margin-top">
          <el-col :span="12"></el-col>
          <el-col :span="12" class="text-right">
            <el-pagination @current-change="handlePageChange" :current-page="currentPage" :page-size="pageSize"
              layout="total, prev, pager, next" :total="total">
            </el-pagination>
          </el-col>
        </el-row>
      </div>
  
      <view-image ref="viewImage"></view-image>
    </div>
  </template>
  
  <script>
  import { queryAdminOwners } from '@/api/aCommunity/aCarDetailOwnerApi'
  import ViewImage from '@/components/system/viewImage'
  
  export default {
    name: 'ACarDetailOwner',
    components: {
      ViewImage
    },
    data() {
      return {
        aCarDetailOwnerInfo: {
          owners: [],
          ownerId: ''
        },
        currentPage: 1,
        pageSize: 10,
        total: 0
      }
    },
    methods: {
      open(data) {
        this.handleSwitch(data)
      },
      handleSwitch(data) {
        this.aCarDetailOwnerInfo.ownerId = data.ownerId
        this._loadACarDetailOwnerData(1, this.pageSize)
      },
      handlePageChange(page) {
        this.currentPage = page
        this._loadACarDetailOwnerData(page, this.pageSize)
      },
      async _loadACarDetailOwnerData(page, row) {
        try {
          const param = {
            ownerId: this.aCarDetailOwnerInfo.ownerId,
            ownerTypeCd: '1001',
            page,
            row
          }
          const response = await queryAdminOwners(param)
          this.aCarDetailOwnerInfo.owners = response.data
f9f29297   wuxw   v1.9 分页 record 传给...
102
          this.total = response.total
0b8f34f9   wuxw   完成admin下的房屋详情页面,业...
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
        } catch (error) {
          console.error('Failed to load owner data:', error)
        }
      },
      _viewOwnerFace(url) {
        if (url) {
          this.$refs.viewImage.showImage({ url })
        }
      },
      _toACarDetailOwnerDetail(owner) {
        window.open('/#/views/aCommunity/adminOwnerDetail?ownerId=' + owner.ownerId)
      }
    }
  }
  </script>
  
  <style scoped>
  .margin-top {
    margin-top: 20px;
  }
  
  .text-right {
    text-align: right;
  }
  
  .border-radius {
    border-radius: 4px;
  }
  </style>