Blame view

src/views/fee/listCarFeeList.vue 9.63 KB
2e0fd29c   wuxw   开发报修
1
2
3
4
5
6
7
  <template>
    <div>
      <el-card class="box-card margin">
        <div slot="header" class="flex justify-between">
          <div>{{ listCarFeeInfo.carNum }}
            <span>{{ $t('listCarFee.fee') }}</span>({{ listCarFeeInfo.parkingName }})
          </div>
06ec2cd7   wuxw   水电抄表测试完成
8
          <div class="" style="top:10px;">
2e0fd29c   wuxw   开发报修
9
10
11
12
13
14
15
16
17
18
            <el-button type="primary" size="small" style="margin-left:10px" @click="_openCarCreateFeeAddModal">
              <i class="el-icon-plus"></i>
              <span>{{ $t('listCarFee.createFee') }}</span>
            </el-button>
            <el-button type="primary" size="small" style="margin-left:10px" @click="_goBack">
              <i class="el-icon-close"></i>
              <span>{{ $t('common.back') }}</span>
            </el-button>
          </div>
        </div>
06ec2cd7   wuxw   水电抄表测试完成
19
        <div class="">
2e0fd29c   wuxw   开发报修
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
          <el-table :data="listCarFeeInfo.fees" border style="width: 100%">
            <el-table-column prop="feeName" :label="$t('listCarFee.feeItem')" align="center">
              <template slot-scope="scope">
                <span class="hand" @click="_viewCarFeeConfig(scope.row)">{{ scope.row.feeName }}
                  <i class="el-icon-info"></i>
                </span>
              </template>
            </el-table-column>
            <el-table-column prop="feeFlagName" :label="$t('listCarFee.feeFlag')" align="center"></el-table-column>
            <el-table-column prop="feeTypeCdName" :label="$t('listCarFee.feeType')" align="center"></el-table-column>
            <el-table-column prop="amountOwed" :label="$t('listCarFee.amountOwed')" align="center"></el-table-column>
            <el-table-column prop="startTime" :label="$t('listCarFee.startTime')" align="center"></el-table-column>
            <el-table-column :label="$t('listCarFee.endTime')" align="center">
              <template slot-scope="scope">
                {{ _getEndTime(scope.row) }}~<br />{{ _getDeadlineTime(scope.row) }}
              </template>
            </el-table-column>
            <el-table-column :label="$t('listCarFee.remark')" align="center" width="150">
              <template slot-scope="scope">
                <div v-if="scope.row.feeTypeCd == '888800010015' || scope.row.feeTypeCd == '888800010016'">
                  <div>
                    <span>{{ $t('listCarFee.preDegrees') }}:</span>{{ scope.row.preDegrees }}
                  </div>
                  <div>
                    <span>{{ $t('listCarFee.curDegrees') }}:</span>{{ scope.row.curDegrees }}
                  </div>
                  <div>
                    <span>{{ $t('listCarFee.price') }}:</span>{{ scope.row.mwPrice ? scope.row.mwPrice :
                      scope.row.squarePrice
                    }}
                  </div>
                  <div>
                    <span>{{ $t('listCarFee.additionalAmount') }}:</span>{{ scope.row.additionalAmount }}
                  </div>
                </div>
                <div v-else-if="scope.row.feeTypeCd == '888800010017'">
                  <div>
                    <span>{{ $t('listCarFee.algorithm') }}:</span>{{ _getAttrValue(scope.row.feeAttrs, '390005') }}
                  </div>
                  <div>
                    <span>{{ $t('listCarFee.usage') }}:</span>{{ _getAttrValue(scope.row.feeAttrs, '390003') }}
                  </div>
                </div>
                <div v-else>
                  <div>
                    <span>{{ $t('listCarFee.price') }}:</span>{{ scope.row.squarePrice }}
                  </div>
                  <div>
                    <span>{{ $t('listCarFee.additionalAmount') }}:</span>{{ scope.row.additionalAmount }}
                  </div>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="stateName" :label="$t('listCarFee.state')" align="center"></el-table-column>
            <el-table-column :label="$t('listCarFee.operation')" align="center">
              <template slot-scope="scope">
                <el-button type="text" v-if="scope.row.state != '2009001' && hasPrivilege('502020082314267912')"
                  @click="_payFee(scope.row)">{{ $t('listCarFee.pay') }}</el-button>
                <el-button type="text" @click="_payFeeHis(scope.row)">{{ $t('listCarFee.history') }}</el-button>
                <el-button type="text" v-if="hasPrivilege('502020090604200029')" @click="_deleteFee(scope.row)">{{
                  $t('listCarFee.cancel') }}</el-button>
                <el-button type="text" v-if="scope.row.state != '2009001' && hasPrivilege('502020090427190001')"
                  @click="_editFee(scope.row)">{{ $t('listCarFee.change') }}</el-button>
                <el-button type="text" v-if="scope.row.feeFlag == '4012024' && scope.row.state == '2008001'"
                  @click="_splitPayFee(scope.row)">{{ $t('listCarFee.split') }}</el-button>
                <el-button type="text" @click="_viewCarFee(scope.row)">{{ $t('listCarFee.detail') }}</el-button>
              </template>
            </el-table-column>
          </el-table>
          <el-row>
06ec2cd7   wuxw   水电抄表测试完成
90
            <el-col :span="12" class="table-desc">
2e0fd29c   wuxw   开发报修
91
92
93
94
95
96
97
98
99
100
101
102
103
104
              <div> {{ $t('listCarFee.note1') }}</div>
              <div> {{ $t('listCarFee.note2') }}</div>
            </el-col>
            <el-col :span="12">
              <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
                :current-page="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size"
                layout="total, sizes, prev, pager, next, jumper" :total="page.total">
              </el-pagination>
            </el-col>
          </el-row>
        </div>
      </el-card>
  
      <!-- 子组件 -->
06ec2cd7   wuxw   水电抄表测试完成
105
106
107
      <delete-fee ref="deleteFee" @success="handleSuccess"></delete-fee>
      <edit-fee ref="editFee" @success="handleSuccess"></edit-fee>
      <split-fee ref="splitFee" @success="handleSuccess"></split-fee>
2e0fd29c   wuxw   开发报修
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
      <car-create-fee-add ref="carCreateFeeAdd" @success="handleSuccess"></car-create-fee-add>
      <!-- <add-meter-water ref="addMeterWater"></add-meter-water> -->
    </div>
  </template>
  
  <script>
  import { listFee } from '@/api/fee/listCarFeeApi'
  import DeleteFee from '@/components/fee/deleteFee'
  import EditFee from '@/components/fee/editFee'
  import SplitFee from '@/components/fee/splitFee'
  import CarCreateFeeAdd from '@/components/fee/carCreateFeeAdd'
  //import AddMeterWater from '@/components/fee/addMeterWater'
  import { getCommunityId } from '@/api/community/communityApi'
  import {dateFormat} from '@/utils/dateUtil'
  
  export default {
    name: 'ListCarFee',
    components: {
      DeleteFee,
      EditFee,
      SplitFee,
      CarCreateFeeAdd,
      // AddMeterWater
    },
    data() {
      return {
        listCarFeeInfo: {
          fees: [],
          carNum: '',
          carId: '',
          total: 0,
          records: 1,
          areaNum: '',
          num: '',
          parkingName: ''
        },
        page: {
          current: 1,
          size: 10,
          total: 0
        },
        communityId: ''
      }
    },
    created() {
      this.communityId = getCommunityId()
      if (this.$route.query.carNum) {
        this.listCarFeeInfo.carNum = this.$route.query.carNum
        this.listCarFeeInfo.carId = this.$route.query.carId
        this.listCarFeeInfo.areaNum = this.$route.query.areaNum
        this.listCarFeeInfo.num = this.$route.query.num
      }
      let parkingName = this.listCarFeeInfo.areaNum ? `${this.listCarFeeInfo.areaNum}停车场${this.listCarFeeInfo.num}车位` : '无车位'
      this.listCarFeeInfo.parkingName = parkingName
      this._loadlistCarFeeInfo(1, 10)
    },
    methods: {
      handleSuccess() {
        this._loadlistCarFeeInfo(1, 10)
      },
      async _loadlistCarFeeInfo(page, row) {
        const params = {
          page: page,
          row: row,
          communityId: this.communityId,
          payerObjId: this.listCarFeeInfo.carId
        }
        const { fees,total,records } = await listFee(params)
        this.listCarFeeInfo.fees = fees
        this.page.total = total
        this.page.records = records
  
      },
      handleSizeChange(val) {
        this.page.size = val
        this._loadlistCarFeeInfo(this.page.current, val)
      },
      handleCurrentChange(val) {
        this.page.current = val
        this._loadlistCarFeeInfo(val, this.page.size)
      },
      _payFee(fee) {
        fee.roomName = this.listCarFeeInfo.carNum
1a0bdbe0   wuxw   优化缴费页面
191
        this.$router.push({ path: '/views/fee/payFeeOrder', query: { feeId: fee.feeId } })
2e0fd29c   wuxw   开发报修
192
193
      },
      _payFeeHis(fee) {
6d21390a   wuxw   开发车辆详情页面
194
        this.$router.push({ path: '/views/fee/propertyFee', query: fee })
2e0fd29c   wuxw   开发报修
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
      },
      _editFee(fee) {
        this.$refs.editFee.open(fee)
      },
      _deleteFee(fee) {
        this.$refs.deleteFee.open({
          communityId: this.communityId,
          feeId: fee.feeId
        })
      },
      _openCarCreateFeeAddModal() {
        this.$refs.carCreateFeeAdd.open({
          isMore: false,
          car: this.listCarFeeInfo
        })
      },
      _openAddMeterWaterModal() {
        this.$refs.addMeterWater.open({
          roomId: this.listCarFeeInfo.carId,
          roomName: this.listCarFeeInfo.carNum,
          ownerName: this.listCarFeeInfo.parkingName,
          objType: '6666'
        })
      },
      _goBack() {
        this.$router.go(-1)
      },
      _getDeadlineTime(fee) {
        if (fee.amountOwed == 0 && fee.endTime == fee.deadlineTime) {
          return "-"
        }
        if (fee.state == '2009001') {
          return "-"
        }
        return dateFormat(fee.deadlineTime) || fee.deadlineTime
      },
      _getEndTime(fee) {
        if (fee.state == '2009001') {
          return "-"
        }
        return dateFormat(fee.endTime) || fee.endTime
      },
      _viewCarFeeConfig(fee) {
        // 查看费用项配置逻辑
        console.log(fee)
      },
      _viewCarFee(fee) {
        // 查看费用详情逻辑
6d21390a   wuxw   开发车辆详情页面
243
        window.open(`/#/views/fee/feeDetail?feeId=${fee.feeId}`)
2e0fd29c   wuxw   开发报修
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
  
      },
      _splitPayFee(fee) {
        this.$refs.splitFee.open(fee)
      },
      _getAttrValue(attrs, specCd) {
        const attr = attrs.find(item => item.specCd === specCd)
        return attr ? attr.value : ''
      },
    }
  }
  </script>
  
  <style scoped>
  .hand {
    cursor: pointer;
  }
  </style>