Blame view

src/components/contract/contractDetailRoom.vue 4.48 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
d767b5e6   wuxw   v1.9 合同费用bug 修复
2
    <div class="">
fc9bd1db   wuxw   开发完成合同详情
3
4
5
6
      <div class="flex justify-end">
        <div :span="2" class="padding-right-xs padding-left-xl"></div>
        <div :span="2" class="padding-right-xs padding-right-xl"></div>
        <div :span="8" class="text-right">
d767b5e6   wuxw   v1.9 合同费用bug 修复
7
          <!-- <el-button type="primary" size="small" style="margin-left:10px" v-if="hasPrivilege('502023021978930012')"
fc9bd1db   wuxw   开发完成合同详情
8
9
10
            @click="_openAddContractRoom">
            <i class="el-icon-plus"></i>
            {{ $t('contractDetailRoom.addPropertyChange') }}
d767b5e6   wuxw   v1.9 合同费用bug 修复
11
          </el-button> -->
fc9bd1db   wuxw   开发完成合同详情
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
        </div>
      </div>
      <div class="margin-top">
        <el-table :data="contractDetailRoomInfo.rooms" style="width: 100%" border stripe>
          <el-table-column prop="roomName" :label="$t('contractDetailRoom.room')" align="center"></el-table-column>
          <el-table-column prop="layer" :label="$t('contractDetailRoom.floor')" align="center"></el-table-column>
          <el-table-column prop="roomSubTypeName" :label="$t('contractDetailRoom.type')" align="center"></el-table-column>
          <el-table-column :label="$t('contractDetailRoom.area')" align="center">
            <template slot-scope="scope">
              {{ scope.row.builtUpArea }}/{{ scope.row.roomArea }}
            </template>
          </el-table-column>
          <el-table-column prop="roomRent" :label="$t('contractDetailRoom.rent')" align="center"></el-table-column>
          <el-table-column prop="stateName" :label="$t('contractDetailRoom.roomStatus')" align="center"></el-table-column>
          <el-table-column :label="$t('contractDetailRoom.operation')" align="center">
            <template slot-scope="scope">
              <el-button v-if="scope.row.state != '2002'" size="mini" @click="_toSimplifyAcceptance(scope.row)">
                {{ $t('contractDetailRoom.businessAcceptance') }}
              </el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-row class="margin-top">
          <el-col :span="4">
            <span>{{ $t('contractDetailRoom.contractArea') }}:</span>
            {{ contractDetailRoomInfo.totalArea }}
          </el-col>
          <el-col :span="8" class="text-right">
            <el-pagination @current-change="handlePageChange" :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 { queryContractRoom } from '@/api/contract/contractDetailRoomApi'
  import { getCommunityId } from '@/api/community/communityApi'
  
  export default {
    name: 'ContractDetailRoom',
    data() {
      return {
        contractDetailRoomInfo: {
          rooms: [],
          contractId: '',
          roomNum: '',
          totalArea: '0'
        },
        pagination: {
          currentPage: 1,
          pageSize: 10,
          total: 0
        }
      }
    },
    methods: {
      open(data) {
        this.contractDetailRoomInfo.contractId = data.contractId
        this._loadContractDetailRoomData(1, this.pagination.pageSize)
      },
      _loadContractDetailRoomData(page, row) {
        const params = {
          contractId: this.contractDetailRoomInfo.contractId,
          page: page || 1,
          row: row || 10
        }
  
        queryContractRoom(params).then(response => {
          this.contractDetailRoomInfo.rooms = response.data
          this._sumRoomArea()
          this.pagination.total = response.total || 0
        }).catch(error => {
          console.error('请求失败:', error)
        })
      },
      _sumRoomArea() {
        const rooms = this.contractDetailRoomInfo.rooms
        if (!rooms || rooms.length < 1) {
          this.contractDetailRoomInfo.totalArea = '0'
          return '0'
        }
        let totalArea = 0
        rooms.forEach(room => {
          totalArea += parseFloat(room.builtUpArea)
        })
        this.contractDetailRoomInfo.totalArea = totalArea.toFixed(2)
        return totalArea.toFixed(2)
      },
      _toSimplifyAcceptance(room) {
e94f0676   wuxw   跳转到业务受理页面处理完成
104
105
          this.$router.push('/pages/property/simplifyAcceptance?tab=业务受理&searchType=1&searchValue=' + `${room.floorNum}-${room.unitNum}-${room.roomNum}`)
  
fc9bd1db   wuxw   开发完成合同详情
106
      },
fc9bd1db   wuxw   开发完成合同详情
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
      handlePageChange(currentPage) {
        this.pagination.currentPage = currentPage
        this._loadContractDetailRoomData(currentPage, this.pagination.pageSize)
      },
    },
    created() {
      this.communityId = getCommunityId()
    }
  }
  </script>
  
  <style scoped>
  .margin-top {
    margin-top: 20px;
  }
  
  .margin-top-lg {
    margin-top: 30px;
  }
  
  .padding-right-xs {
    padding-right: 5px;
  }
  
  .padding-left-xl {
    padding-left: 20px;
  }
  
  .text-right {
    text-align: right;
  }
  </style>