Blame view

src/components/simplify/simplifyCarFee.vue 11.5 KB
0a41b92e   wuxw   开发完成业务受理页面
1
2
  <template>
    <div>
6f916870   wuxw   优化甘肃客户反馈bug
3
4
      <div class="margin-top flex justify-between">
        <div >
0a41b92e   wuxw   开发完成业务受理页面
5
6
7
8
9
10
11
12
          <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>
6f916870   wuxw   优化甘肃客户反馈bug
13
14
        </div>
        <div  v-if="simplifyCarFeeInfo.carId">
0a41b92e   wuxw   开发完成业务受理页面
15
16
17
18
19
20
21
22
23
          <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>
6f916870   wuxw   优化甘肃客户反馈bug
24
25
        </div>
      </div>
0a41b92e   wuxw   开发完成业务受理页面
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
  
      <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   加入费用详情
89
                  <a target="_blank" :href="'/#/views/fee/feeDetail?feeId='+row.feeId">
0a41b92e   wuxw   开发完成业务受理页面
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
                    {{ $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>
6f916870   wuxw   优化甘肃客户反馈bug
117
118
119
120
121
      <car-create-fee-add ref="carCreateFeeAdd" @success="handleNotify" />
      <delete-fee ref="deleteFee" @success="handleNotify"></delete-fee>
      <edit-fee ref="editFee" @success="handleNotify"></edit-fee>
      <finish-fee ref="finishFee" @success="handleNotify"></finish-fee>
  
0a41b92e   wuxw   开发完成业务受理页面
122
123
124
125
126
127
    </div>
  </template>
  
  <script>
  import { getCommunityId } from '@/api/community/communityApi'
  import { listFee, queryOwnerCars } from '@/api/simplify/simplifyCarFeeApi'
6f916870   wuxw   优化甘肃客户反馈bug
128
129
130
131
132
  import CarCreateFeeAdd from '@/components/fee/carCreateFeeAdd'
  import DeleteFee from '@/components/fee/deleteFee'
  import EditFee from '@/components/fee/editFee'
  import FinishFee from '@/components/fee/finishFee'
  
0a41b92e   wuxw   开发完成业务受理页面
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
  
  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
      }
    },
6f916870   wuxw   优化甘肃客户反馈bug
157
158
159
160
161
162
    components: {
      CarCreateFeeAdd,
      DeleteFee,
      EditFee,
      FinishFee
    },
0a41b92e   wuxw   开发完成业务受理页面
163
164
    created() {
      this.communityId = getCommunityId()
6f916870   wuxw   优化甘肃客户反馈bug
165
  
0a41b92e   wuxw   开发完成业务受理页面
166
167
    },
    methods: {
6f916870   wuxw   优化甘肃客户反馈bug
168
169
170
  
      open(param) {
        this.handleSwitch(param)
0a41b92e   wuxw   开发完成业务受理页面
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
      },
      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 => {
6f916870   wuxw   优化甘肃客户反馈bug
222
223
224
225
226
227
228
229
            let _json = res.data;
            this.simplifyCarFeeInfo.ownerCars = _json.data
            if (_json.data.length > 0) {
              this.simplifyCarFeeInfo.carId = _json.data[0].carId
              this.simplifyCarFeeInfo.carNum = _json.data[0].carNum
              this.simplifyCarFeeInfo.num = _json.data[0].num
              this.simplifyCarFeeInfo.parkingName = `${_json.data[0].areaNum}${this.$t('simplifyCarFee.parkingLot')}${_json.data[0].num}${this.$t('simplifyCarFee.parkingSpace')}`
              resolve(_json.data)
0a41b92e   wuxw   开发完成业务受理页面
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
            } 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) {
6f916870   wuxw   优化甘肃客户反馈bug
281
        this.$router.push(`/views/fee/payFeeOrder?feeId=${fee.feeId}`)
0a41b92e   wuxw   开发完成业务受理页面
282
283
      },
      _simplifyCarPayFeeHis(fee) {
6f916870   wuxw   优化甘肃客户反馈bug
284
285
286
287
288
  
        this.$router.push({
          path: '/views/fee/propertyFee',
          query: fee
        })
0a41b92e   wuxw   开发完成业务受理页面
289
290
      },
      _simplifyCarEditFee(fee) {
6f916870   wuxw   优化甘肃客户反馈bug
291
292
        fee.maxEndTime = this._getAttrValue(fee.feeAttrs, '390010')
        this.$refs.editFee.open(fee)
0a41b92e   wuxw   开发完成业务受理页面
293
294
      },
      _simplifyCarDeleteFee(fee) {
6f916870   wuxw   优化甘肃客户反馈bug
295
296
        this.$refs.deleteFee.open({
          communityId: getCommunityId(),
0a41b92e   wuxw   开发完成业务受理页面
297
298
299
300
          feeId: fee.feeId
        })
      },
      _openSimplifyCarCreateFeeAddModal() {
6f916870   wuxw   优化甘肃客户反馈bug
301
        this.$refs.carCreateFeeAdd.open({ isMore: false, car: this.simplifyCarFeeInfo })
0a41b92e   wuxw   开发完成业务受理页面
302
303
      },
      _simplifyCarFinishFee(fee) {
6f916870   wuxw   优化甘肃客户反馈bug
304
305
        this.$refs.finishFee.open({
          communityId: getCommunityId(),
0a41b92e   wuxw   开发完成业务受理页面
306
307
308
309
          feeId: fee.feeId
        })
      },
      _toBuyCarMonthCard() {
6f916870   wuxw   优化甘肃客户反馈bug
310
        this.$router.push(`/views/fee/buyCarMonthCard?carNum=${this.simplifyCarFeeInfo.carNum}`)
0a41b92e   wuxw   开发完成业务受理页面
311
312
      },
      _openBatchPayCarFeeModal() {
6f916870   wuxw   优化甘肃客户反馈bug
313
        this.$router.push(`/views/fee/batchPayFeeOrder?ownerId=${this.simplifyCarFeeInfo.ownerId}&payerObjType=6666`)
0a41b92e   wuxw   开发完成业务受理页面
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
      },
      _viewCarFeeConfig(fee) {
        // Implement view fee config logic
        console.log(fee)
      }
    }
  }
  </script>
  
  <style scoped>
  .hand {
    cursor: pointer;
  }
  .margin-top {
    margin-top: 10px;
  }
  </style>