Blame view

src/components/contract/contractDetailHisRoomFee.vue 4.94 KB
fc9bd1db   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
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
  <template>
    <div>
      <div class="margin-top">
        <el-table :data="contractDetailHisRoomFeeInfo.feeDetails" style="width: 100%; margin-top: 10px" border stripe>
          <el-table-column prop="feeName" :label="$t('contractDetailHisRoomFee.feeItem')" align="center" />
          <el-table-column prop="payerObjName" :label="$t('contractDetailHisRoomFee.payerObject')" align="center" />
          <el-table-column prop="cycles" :label="$t('contractDetailHisRoomFee.cycle')" align="center" />
          <el-table-column :label="$t('contractDetailHisRoomFee.receivableAmount')" align="center">
            <template #default="{ row }">
              {{ row.receivableAmount }}/{{ row.receivedAmount }}<br>
              <div v-if="row.acctAmount > 0">
                {{ $t('contractDetailHisRoomFee.accountDeduction') }}: {{ row.acctAmount }}<br>
              </div>
              <div v-for="(item, index) in row.payFeeDetailDiscountDtoList" :key="index">
                {{ item.discountName }}: {{ Math.abs(item.discountPrice) }}<br>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="primeRateName" :label="$t('contractDetailHisRoomFee.paymentMethod')" align="center" />
          <el-table-column :label="$t('contractDetailHisRoomFee.paymentPeriod')" align="center">
            <template #default="{ row }">
              {{ dateFormat(row.startTime) }}~<br>
              {{ dateFormat(row.endTime) }}
            </template>
          </el-table-column>
          <el-table-column prop="createTime" :label="$t('contractDetailHisRoomFee.paymentTime')" align="center" />
          <el-table-column prop="cashierName" :label="$t('contractDetailHisRoomFee.cashier')" align="center">
            <template #default="{ row }">
              {{ row.cashierName || '-' }}
            </template>
          </el-table-column>
          <el-table-column prop="stateName" :label="$t('contractDetailHisRoomFee.status')" align="center" />
          <el-table-column prop="remark" :label="$t('contractDetailHisRoomFee.remark')" align="center" />
          <el-table-column :label="$t('contractDetailHisRoomFee.operation')" align="center">
            <template #default="{ row }">
              <el-button v-if="row.state == '1400' || row.state == '1200' || row.state == ''" type="text" size="small"
                @click="_toRefundFee(row)">
                {{ $t('contractDetailHisRoomFee.detail') }}
              </el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination class="pagination" layout="total, sizes, prev, pager, next, jumper"
          :total="contractDetailHisRoomFeeInfo.total" :page-size="pageSize" @current-change="handleCurrentChange"
          @size-change="handleSizeChange" />
      </div>
    </div>
  </template>
  
  <script>
  import { queryFeeDetail } from '@/api/contract/contractDetailHisRoomFeeApi'
  import { getCommunityId } from '@/api/community/communityApi'
  
  export default {
    name: 'ContractDetailHisRoomFee',
    data() {
      return {
        contractDetailHisRoomFeeInfo: {
          total: 0,
          records: 1,
          feeDetails: [],
          ownerId: ''
        },
        pageSize: 10,
        currentPage: 1,
        communityId: ''
      }
    },
    created() {
      this.communityId = getCommunityId()
    },
    methods: {
      open(data) {
        this.contractDetailHisRoomFeeInfo.ownerId = data.ownerId
        this._listContractDetailHisRoomFeeDetails()
      },
      dateFormat(date) {
        return this.$moment(date).format('YYYY-MM-DD')
      },
      handleCurrentChange(val) {
        this.currentPage = val
        this._listContractDetailHisRoomFeeDetails()
      },
      handleSizeChange(val) {
        this.pageSize = val
        this._listContractDetailHisRoomFeeDetails()
      },
      _listContractDetailHisRoomFeeDetails() {
        const params = {
          page: this.currentPage,
          row: this.pageSize,
          communityId: this.communityId,
          ownerId: this.contractDetailHisRoomFeeInfo.ownerId,
          payerObjType: '3333'
        }
  
        queryFeeDetail(params).then(response => {
          this.contractDetailHisRoomFeeInfo.total = response.total
          this.contractDetailHisRoomFeeInfo.records = response.records
          this.contractDetailHisRoomFeeInfo.feeDetails = response.feeDetails
        }).catch(error => {
          console.error('请求失败:', error)
        })
      },
      clearContractDetailHisRoomFeeInfo() {
        this.contractDetailHisRoomFeeInfo = {
          total: 0,
          records: 1,
          feeDetails: [],
          ownerId: ''
        }
      },
      _toRefundFee(detail) {
        this.$router.push(`/pages/property/propertyFee?feeId=${detail.feeId}`)
      },
      switch(param) {
        this.clearContractDetailHisRoomFeeInfo()
        if (param.ownerId === '') {
          return
        }
        Object.assign(this.contractDetailHisRoomFeeInfo, param)
        this._listContractDetailHisRoomFeeDetails()
      },
      notify() {
        this._listContractDetailHisRoomFeeDetails()
      }
    }
  }
  </script>
  
  <style scoped>
  .margin-top {
    margin-top: 20px;
  }
  
  .pagination {
    margin-top: 20px;
    text-align: right;
  }
  </style>