Blame view

src/components/fee/carDetailOwner.vue 5.42 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
24d3590f   wuxw   房屋收费页面开发完成
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
    <div>
      <el-row>
        <el-col :span="24" class="text-right"></el-col>
      </el-row>
      <div class="margin-top">
        <el-table :data="carDetailOwnerInfo.owners" border stripe>
          <el-table-column :label="$t('carDetailOwner.ownerFace')" align="center">
            <template slot-scope="scope">
              <el-image 
                style="width: 60px; height: 60px; border-radius: 4px;"
                :src="scope.row.url || '/img/noPhoto.jpg'"
                :preview-src-list="[scope.row.url]"
                v-if="scope.row.url"
              ></el-image>
              <el-image 
                style="width: 60px; height: 60px; border-radius: 4px;"
                src="/img/noPhoto.jpg"
                v-else
              ></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">
            <template slot-scope="scope">
              {{scope.row.idCard || '-'}}
            </template>
          </el-table-column>
          <el-table-column prop="address" :label="$t('carDetailOwner.address')" align="center">
            <template slot-scope="scope">
              {{scope.row.address || '-'}}
            </template>
          </el-table-column>
          <el-table-column prop="roomCount" :label="$t('carDetailOwner.roomCount')" align="center">
            <template slot-scope="scope">
              {{scope.row.roomCount || 0}}
            </template>
          </el-table-column>
          <el-table-column prop="memberCount" :label="$t('carDetailOwner.memberCount')" align="center">
            <template slot-scope="scope">
              {{scope.row.memberCount || 0}}
            </template>
          </el-table-column>
          <el-table-column prop="carCount" :label="$t('carDetailOwner.carCount')" align="center">
            <template slot-scope="scope">
              {{scope.row.carCount || 0}}
            </template>
          </el-table-column>
          <el-table-column prop="complaintCount" :label="$t('carDetailOwner.complaintCount')" align="center">
            <template slot-scope="scope">
              {{scope.row.complaintCount || 0}}
            </template>
          </el-table-column>
          <el-table-column prop="repairCount" :label="$t('carDetailOwner.repairCount')" align="center">
            <template slot-scope="scope">
              {{scope.row.repairCount || 0}}
            </template>
          </el-table-column>
          <el-table-column prop="oweFee" :label="$t('carDetailOwner.oweFee')" align="center">
            <template slot-scope="scope">
              {{scope.row.oweFee || '0.00'}}
            </template>
          </el-table-column>
          <el-table-column prop="contractCount" :label="$t('carDetailOwner.contractCount')" align="center">
            <template slot-scope="scope">
              {{scope.row.contractCount || 0}}
            </template>
          </el-table-column>
          <el-table-column :label="$t('carDetailOwner.actions')" align="center">
            <template slot-scope="scope">
              <el-button-group>
                <el-button size="mini" @click="_toCarDetailOwnerDetail(scope.row)">
                  {{ $t('carDetailOwner.detail') }}
                </el-button>
              </el-button-group>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          @current-change="handleCurrentChange"
          :current-page="currentPage"
          :page-size="pageSize"
          layout="total, prev, pager, next"
          :total="total">
        </el-pagination>
      </div>
    </div>
  </template>
  
  <script>
  import { getCommunityId } from '@/api/community/communityApi'
  import { queryOwners } from '@/api/fee/carDetailOwnerApi'
  
  export default {
    name: 'CarDetailOwner',
    data() {
      return {
        DEFAULT_PAGE: 1,
        DEFAULT_ROWS: 10,
        carDetailOwnerInfo: {
          owners: [],
          ownerId: ''
        },
        currentPage: 1,
        pageSize: 10,
        total: 0
      }
    },
    created() {
      this._initEvent()
    },
    methods: {
      _initEvent() {
        this.$on('switch', this.handleSwitch)
        this.$on('notify', this._loadCarDetailOwnerData)
      },
      handleSwitch(data) {
        this.carDetailOwnerInfo.ownerId = data.ownerId
        this._loadCarDetailOwnerData(this.DEFAULT_PAGE, this.DEFAULT_ROWS)
      },
      handleCurrentChange(val) {
        this._loadCarDetailOwnerData(val, this.DEFAULT_ROWS)
      },
      async _loadCarDetailOwnerData(page, row) {
        try {
          const res = await queryOwners({
            ownerId: this.carDetailOwnerInfo.ownerId,
            communityId: getCommunityId(),
            ownerTypeCd: '1001',
            page,
            row
          })
          this.carDetailOwnerInfo.owners = res.data
f9f29297   wuxw   v1.9 分页 record 传给...
143
          this.total = res.total
24d3590f   wuxw   房屋收费页面开发完成
144
145
146
147
148
        } catch (error) {
          console.error('Request failed:', error)
        }
      },
      _toCarDetailOwnerDetail(owner) {
9d019fa6   wuxw   测试OA相关流程
149
        window.open(`/#/views/owner/ownerDetail?ownerId=${owner.ownerId}`)
24d3590f   wuxw   房屋收费页面开发完成
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
      },
      open(params) {
        this.handleSwitch(params)
      }
    }
  }
  </script>
  
  <style scoped>
  .margin-top {
    margin-top: 15px;
  }
  .text-right {
    text-align: right;
  }
  </style>