Blame view

src/components/fee/feeDetailRoom.vue 3.65 KB
f80ea09a   wuxw   加入费用详情
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
  <template>
    <div>
      <div class="margin-top">
        <el-table :data="feeDetailRoomInfo.rooms" style="width: 100%">
          <el-table-column :label="$t('feeDetailRoom.roomId')" 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('feeDetailRoom.floor')" align="center"></el-table-column>
          <el-table-column prop="roomSubTypeName" :label="$t('feeDetailRoom.type')" align="center"></el-table-column>
          <el-table-column :label="$t('feeDetailRoom.area')" align="center">
            <template slot-scope="scope">{{ scope.row.builtUpArea }}/{{ scope.row.roomArea }}</template>
          </el-table-column>
          <el-table-column prop="roomRent" :label="$t('feeDetailRoom.rent')" align="center"></el-table-column>
          <el-table-column prop="stateName" :label="$t('feeDetailRoom.roomStatus')" align="center"></el-table-column>
          <el-table-column :label="$t('feeDetailRoom.roomArrears')" align="center">
            <template slot-scope="scope">{{ scope.row.roomOweFee ||
              '0.00'}}({{ $t('feeDetailRoom.updateDaily') }})</template>
          </el-table-column>
          <el-table-column :label="$t('feeDetailRoom.operation')" align="center">
            <template slot-scope="scope">
              <el-button v-if="scope.row.state != '2002'" size="mini" @click="_toSimplifyAcceptance(scope.row)">
                {{ $t('feeDetailRoom.businessAcceptance') }}
              </el-button>
            </template>
          </el-table-column>
        </el-table>
  
        <el-row class="margin-top">
          <el-col :span="12"></el-col>
          <el-col :span="12">
            <el-pagination @current-change="handleCurrentChange" :current-page="pagination.currentPage"
              :page-size="pagination.pageSize" layout="total, prev, pager, next" :total="pagination.total">
            </el-pagination>
          </el-col>
        </el-row>
      </div>
    </div>
  </template>
  
  <script>
  import { queryRooms } from '@/api/fee/feeDetailRoomApi'
  import { getCommunityId } from '@/api/community/communityApi'
  
  export default {
    name: 'FeeDetailRoom',
    data() {
      return {
        feeDetailRoomInfo: {
          rooms: [],
          roomId: '',
          roomNum: '',
          allOweFeeAmount: '0'
        },
        pagination: {
          currentPage: 1,
          pageSize: 10,
          total: 0
        }
      }
    },
    methods: {
      open(params) {
        this.feeDetailRoomInfo.roomId = params.payerObjId
        this._loadFeeDetailRoomData()
      },
      _loadFeeDetailRoomData() {
        const params = {
          communityId: getCommunityId(),
          roomId: this.feeDetailRoomInfo.roomId,
          page: this.pagination.currentPage,
          row: this.pagination.pageSize
        }
  
        queryRooms(params).then(res => {
          this.feeDetailRoomInfo.rooms = res.rooms
          this.pagination.total = res.records
        }).catch(error => {
          console.error('Failed to load room details:', error)
        })
      },
      handleCurrentChange(val) {
        this.pagination.currentPage = val
        this._loadFeeDetailRoomData()
      },
      _toSimplifyAcceptance(room) {
        const date = new Date()
        this.$store.dispatch('app/saveData', {
          key: 'JAVA110_IS_BACK',
          value: date.getTime()
        })
        this.$store.dispatch('app/saveData', {
          key: 'simplifyAcceptanceSearch',
          value: {
            searchType: '1',
            searchValue: `${room.floorNum}-${room.unitNum}-${room.roomNum}`,
            searchPlaceholder: this.$t('feeDetailRoom.searchPlaceholder')
          }
        })
        this.$router.push('/pages/property/simplifyAcceptance?tab=businessAcceptance')
      }
    }
  }
  </script>