Blame view

src/components/simplify/simplifyCarFee.vue 11 KB
0a41b92e   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
  <template>
    <div>
      <el-row class="margin-top">
        <el-col :span="4">
          <el-select v-model="simplifyCarFeeInfo.carId" @change="changeSimplifyCar">
            <el-option
              v-for="(item,index) in simplifyCarFeeInfo.ownerCars"
              :key="index"
              :label="item.carNum"
              :value="item.carId">
            </el-option>
          </el-select>
        </el-col>
        <el-col :span="16"></el-col>
        <el-col :span="4" v-if="simplifyCarFeeInfo.carId">
          <el-button type="primary" size="small" @click="_toBuyCarMonthCard">
            {{ $t('simplifyCarFee.buyMonthCard') }}
          </el-button>
          <el-button type="primary" size="small" @click="_openBatchPayCarFeeModal">
            {{ $t('simplifyCarFee.batchPayment') }}
          </el-button>
          <el-button type="primary" size="small" @click="_openSimplifyCarCreateFeeAddModal">
            {{ $t('simplifyCarFee.createFee') }}
          </el-button>
        </el-col>
      </el-row>
  
      <el-table
        :data="simplifyCarFeeInfo.fees"
        style="width: 100%; margin-top: 10px"
        border>
        <el-table-column prop="feeName" :label="$t('simplifyCarFee.feeItem')" align="center">
          <template #default="{row}">
            <span class="hand" @click="_viewCarFeeConfig(row)">{{row.feeName}}
              <i class="el-icon-info"></i>
            </span>
          </template>
        </el-table-column>
        <el-table-column prop="feeFlagName" :label="$t('simplifyCarFee.feeFlag')" align="center"></el-table-column>
        <el-table-column prop="feeTypeCdName" :label="$t('simplifyCarFee.feeType')" align="center"></el-table-column>
        <el-table-column prop="amountOwed" :label="$t('simplifyCarFee.amountReceivable')" align="center"></el-table-column>
        <el-table-column prop="startTime" :label="$t('simplifyCarFee.accountingTime')" align="center"></el-table-column>
        <el-table-column :label="$t('simplifyCarFee.receivablePeriod')" align="center">
          <template #default="{row}">
            {{_getEndTime(row)}}~<br />{{_getDeadlineTime(row)}}
          </template>
        </el-table-column>
        <el-table-column :label="$t('simplifyCarFee.description')" align="center" width="150">
          <template #default="{row}">
            <div v-if="row.feeTypeCd == '888800010015' || row.feeTypeCd == '888800010016'">
              <div>{{ $t('simplifyCarFee.lastDegree') }}:{{row.preDegrees}}</div>
              <div>{{ $t('simplifyCarFee.currentDegree') }}:{{row.curDegrees}}</div>
              <div>{{ $t('simplifyCarFee.unitPrice') }}:{{row.squarePrice}}</div>
              <div>{{ $t('simplifyCarFee.additionalFee') }}:{{row.additionalAmount}}</div>
            </div>
            <div v-else-if="row.feeTypeCd == '888800010017'">
              <div>{{ $t('simplifyCarFee.algorithm') }}:{{_getAttrValue(row.feeAttrs,'390005')}}</div>
              <div>{{ $t('simplifyCarFee.usage') }}:{{_getAttrValue(row.feeAttrs,'390003')}}</div>
            </div>
            <div v-else>
              <div>{{ $t('simplifyCarFee.unitPrice') }}:{{row.squarePrice}}</div>
              <div>{{ $t('simplifyCarFee.fixedFee') }}:{{row.additionalAmount}}</div>
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="stateName" :label="$t('simplifyCarFee.status')" align="center"></el-table-column>
        <el-table-column :label="$t('simplifyCarFee.operation')" align="center">
          <template #default="{row}">
            <el-button type="text" v-if="row.state != '2009001' && hasPrivilege('502020082314267912')" @click="_simplifyCarPayFee(row)">
              {{ $t('simplifyCarFee.payment') }}
            </el-button>
            <el-button type="text" @click="_simplifyCarPayFeeHis(row)">
              {{ $t('simplifyCarFee.paymentHistory') }}
            </el-button>
            <el-dropdown>
              <el-button type="text">
                {{ $t('simplifyCarFee.moreOperations') }}<i class="el-icon-arrow-down el-icon--right"></i>
              </el-button>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item v-if="row.isDefault == 'F' && hasPrivilege('502020090604200029')" @click.native="_simplifyCarDeleteFee(row)">
                  {{ $t('simplifyCarFee.cancelFee') }}
                </el-dropdown-item>
                <el-dropdown-item v-if="hasPrivilege('502021070488970005')" @click.native="_simplifyCarFinishFee(row)">
                  {{ $t('simplifyCarFee.manualFinish') }}
                </el-dropdown-item>
                <el-dropdown-item v-if="row.state != '2009001' && hasPrivilege('502020090427190001')" @click.native="_simplifyCarEditFee(row)">
                  {{ $t('simplifyCarFee.feeChange') }}
                </el-dropdown-item>
                <el-dropdown-item>
f80ea09a   wuxw   加入费用详情
90
                  <a target="_blank" :href="'/#/views/fee/feeDetail?feeId='+row.feeId">
0a41b92e   wuxw   开发完成业务受理页面
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
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
191
192
193
194
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
                    {{ $t('simplifyCarFee.details') }}
                  </a>
                </el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column>
      </el-table>
  
      <el-row>
        <el-col :span="12">
          <div>{{ $t('simplifyCarFee.note1') }}</div>
          <div>{{ $t('simplifyCarFee.note2') }}</div>
        </el-col>
        <el-col :span="6">
          <span>{{ $t('simplifyCarFee.arrearsSubtotal') }}:{{simplifyCarFeeInfo.totalAmount}}</span>
        </el-col>
        <el-col :span="6">
          <el-pagination
            @current-change="handleCurrentChange"
            :current-page="currentPage"
            :page-size="pageSize"
            layout="total, prev, pager, next"
            :total="total">
          </el-pagination>
        </el-col>
      </el-row>
    </div>
  </template>
  
  <script>
  import { getCommunityId } from '@/api/community/communityApi'
  import { listFee, queryOwnerCars } from '@/api/simplify/simplifyCarFeeApi'
  
  export default {
    name: 'SimplifyCarFee',
    data() {
      return {
        simplifyCarFeeInfo: {
          fees: [],
          ownerCars: [],
          ownerId: '',
          name: '',
          carNum: '',
          carId: '',
          total: 0,
          records: 1,
          areaNum: '',
          num: '',
          parkingName: '',
          totalAmount: 0.0
        },
        currentPage: 1,
        pageSize: 10,
        total: 0
      }
    },
    created() {
      this.communityId = getCommunityId()
      this.initEvents()
    },
    methods: {
      initEvents() {
        this.$on('switch', this.handleSwitch)
        this.$on('notify', this.handleNotify)
      },
      handleSwitch(param) {
        if (param.ownerId == '') return
        this.clearSimplifyCarFeeInfo()
        Object.assign(this.simplifyCarFeeInfo, param)
        this.listOwnerCar()
          .then(() => {
            this.listSimplifyCarFee(this.currentPage, this.pageSize)
          })
          .catch(err => {
            this.$message.error(err)
          })
      },
      handleNotify() {
        this.listSimplifyCarFee(this.currentPage, this.pageSize)
      },
      handleCurrentChange(val) {
        this.currentPage = val
        this.listSimplifyCarFee(val, this.pageSize)
      },
      listSimplifyCarFee(page, row) {
        if (!this.simplifyCarFeeInfo.carId) return
        
        const params = {
          page,
          row,
          communityId: this.communityId,
          payerObjId: this.simplifyCarFeeInfo.carId
        }
        
        listFee(params).then(res => {
          this.simplifyCarFeeInfo.fees = res.data.fees
          this.total = res.data.records
          let totalAmount = 0.0
          res.data.fees.forEach(item => {
            totalAmount += parseFloat(item.amountOwed)
          })
          this.simplifyCarFeeInfo.totalAmount = totalAmount
        })
      },
      listOwnerCar() {
        return new Promise((resolve, reject) => {
          const params = {
            page: 1,
            row: 50,
            ownerId: this.simplifyCarFeeInfo.ownerId,
            carTypeCd: '1001',
            communityId: this.communityId
          }
          
          queryOwnerCars(params).then(res => {
            this.simplifyCarFeeInfo.ownerCars = res.data
            if (res.data.length > 0) {
              this.simplifyCarFeeInfo.carId = res.data[0].carId
              this.simplifyCarFeeInfo.carNum = res.data[0].carNum
              this.simplifyCarFeeInfo.num = res.data[0].num
              this.simplifyCarFeeInfo.parkingName = `${res.data[0].areaNum}${this.$t('simplifyCarFee.parkingLot')}${res.data[0].num}${this.$t('simplifyCarFee.parkingSpace')}`
              resolve(res.data)
            } else {
              reject(this.$t('simplifyCarFee.noParkingSpace'))
            }
          }).catch(err => {
            reject(err)
          })
        })
      },
      changeSimplifyCar() {
        const car = this.simplifyCarFeeInfo.ownerCars.find(item => item.carId === this.simplifyCarFeeInfo.carId)
        if (!car) return
        
        this.simplifyCarFeeInfo.carNum = car.carNum
        this.simplifyCarFeeInfo.num = car.num
        this.simplifyCarFeeInfo.parkingName = `${car.areaNum}${this.$t('simplifyCarFee.parkingLot')}${car.num}${this.$t('simplifyCarFee.parkingSpace')}`
        this.listSimplifyCarFee(this.currentPage, this.pageSize)
      },
      clearSimplifyCarFeeInfo() {
        this.simplifyCarFeeInfo = {
          fees: [],
          ownerCars: [],
          ownerId: '',
          name: '',
          carNum: '',
          carId: '',
          total: 0,
          records: 1,
          areaNum: '',
          num: '',
          parkingName: '',
          totalAmount: 0.0
        }
      },
      _getEndTime(fee) {
        return fee.state == '2009001' ? '-' : fee.endTime
      },
      _getDeadlineTime(fee) {
        if (fee.amountOwed == 0 && fee.endTime == fee.deadlineTime) return '-'
        if (fee.state == '2009001') return '-'
        return fee.deadlineTime
      },
      _getAttrValue(attrs, code) {
        const attr = attrs.find(item => item.specCd === code)
        return attr ? attr.value : ''
      },
      _simplifyCarGetFeeOwnerInfo(attrs) {
        const ownerName = this._getAttrValue(attrs, '390008')
        const ownerLink = this._getAttrValue(attrs, '390009')
        return `${this.$t('simplifyCarFee.owner')}:${ownerName},${this.$t('simplifyCarFee.phone')}:${ownerLink}`
      },
      _simplifyCarPayFee(fee) {
1a0bdbe0   wuxw   优化缴费页面
265
        this.$router.push(`/views/fee/payFeeOrderfeeId=${fee.feeId}`)
0a41b92e   wuxw   开发完成业务受理页面
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
      },
      _simplifyCarPayFeeHis(fee) {
        this.$router.push(`/pages/property/propertyFee?${this.objToGetParam(fee)}`)
      },
      _simplifyCarEditFee(fee) {
        this.$emit('editFee', fee)
      },
      _simplifyCarDeleteFee(fee) {
        this.$emit('deleteFee', {
          communityId: this.communityId,
          feeId: fee.feeId
        })
      },
      _openSimplifyCarCreateFeeAddModal() {
        this.$emit('carCreateFeeAdd', {
          isMore: false,
          car: this.simplifyCarFeeInfo
        })
      },
      _simplifyCarFinishFee(fee) {
        this.$emit('finishFee', {
          communityId: this.communityId,
          feeId: fee.feeId
        })
      },
      _toBuyCarMonthCard() {
        this.$router.push(`/pages/fee/buyCarMonthCard?carNum=${this.simplifyCarFeeInfo.carNum}`)
      },
      _openBatchPayCarFeeModal() {
        this.$router.push(`/pages/property/batchPayFeeOrder?ownerId=${this.simplifyCarFeeInfo.ownerId}&payerObjType=6666`)
      },
      _viewCarFeeConfig(fee) {
        // Implement view fee config logic
        console.log(fee)
      }
    }
  }
  </script>
  
  <style scoped>
  .hand {
    cursor: pointer;
  }
  .margin-top {
    margin-top: 10px;
  }
  </style>