Blame view

src/components/fee/aRoomDetailRoom.vue 3.16 KB
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
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
  <template>
    <div class="room-detail-container">
      <el-row :gutter="20">
        <el-col :span="8">
          <el-input v-model="roomNum" :placeholder="$t('adminRoomFee.roomNumPlaceholder')" clearable />
        </el-col>
        <el-col :span="4">
          <el-button type="primary" @click="loadData">
            {{ $t('common.search') }}
          </el-button>
        </el-col>
      </el-row>
  
      <el-table :data="rooms" class="margin-top" border>
        <el-table-column :label="$t('adminRoomFee.roomNum')" align="center">
          <template slot-scope="scope">
            {{ scope.row.floorNum }}-{{ scope.row.unitNum }}-{{ scope.row.roomNum }}
          </template>
        </el-table-column>
        <el-table-column prop="layer" :label="$t('adminRoomFee.floor')" align="center" />
        <el-table-column prop="roomSubTypeName" :label="$t('adminRoomFee.type')" align="center" />
        <el-table-column :label="$t('adminRoomFee.area')" align="center">
          <template slot-scope="scope">
            {{ scope.row.builtUpArea }}/{{ scope.row.roomArea }}
          </template>
        </el-table-column>
        <el-table-column prop="roomRent" :label="$t('adminRoomFee.rent')" align="center" />
        <el-table-column :label="$t('adminRoomFee.validity')" align="center">
          <template slot-scope="scope">
            {{ scope.row.startTime }}<br>
            ~{{ scope.row.endTime }}
          </template>
        </el-table-column>
        <el-table-column prop="stateName" :label="$t('adminRoomFee.roomStatus')" align="center" />
        <el-table-column prop="roomOweFee" :label="$t('adminRoomFee.roomOweFee')" align="center" />
        <el-table-column :label="$t('common.operation')" align="center" width="120">
          <template slot-scope="scope">
            <el-button size="mini" @click="toDetail(scope.row)">
              {{ $t('common.detail') }}
            </el-button>
          </template>
        </el-table-column>
      </el-table>
  
      <el-pagination :current-page="page.current" :page-size="page.size" :total="page.total"
        layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
        @current-change="handleCurrentChange" />
    </div>
  </template>
  
  <script>
  import { queryAdminOwnerRooms } from '@/api/fee/adminRoomFeeApi'
  
  export default {
    name: 'ARoomDetailRoom',
    props: {
      ownerId: {
        type: String,
        default: ''
      },
      roomId: {
        type: String,
        default: ''
      }
    },
    data() {
      return {
        rooms: [],
        roomNum: '',
        page: {
          current: 1,
          size: 10,
          total: 0
        }
      }
    },
    methods: {
      open() {
        this.loadData()
      },
      async loadData() {
        const params = {
          ownerId: this.ownerId,
          roomNum: this.roomNum,
          roomId: this.roomId,
          page: this.page.current,
          row: this.page.size
        }
  
        const res = await queryAdminOwnerRooms(params)
        this.rooms = res.rooms
        this.page.total = res.total
  
      },
      toDetail(room) {
        window.open(`/#/pages/community/adminRoomDetail?roomId=${room.roomId}`)
      },
      handleSizeChange(val) {
        this.page.size = val
        this.loadData()
      },
      handleCurrentChange(val) {
        this.page.current = val
        this.loadData()
      }
    }
  }
  </script>