apply-clients 4.1.73 → 4.1.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,539 +1,540 @@
1
- <template>
2
- <div class="col-sm-12" style="margin: 20px 0px;">
3
- <data-grid :model="model" v-ref:grid class="list_area table_sy" style="padding: 0px">
4
- <template partial='head'>
5
- <tr>
6
- <th class="textNoLineBreak">序号</th>
7
- <th class="textNoLineBreak" v-if="$parent.$parent.selectdata.f_apply_type !== '开发商集体报建'">地址</th>
8
- <th class="textNoLineBreak">缴费编号</th>
9
- <th class="textNoLineBreak">收费金额</th>
10
- <th class="textNoLineBreak">金额大写</th>
11
- <th class="textNoLineBreak">付款方式</th>
12
- <th class="textNoLineBreak">收费人员</th>
13
- <th class="textNoLineBreak">收费日期</th>
14
- <th class="textNoLineBreak">备注</th>
15
- <th class="textNoLineBreak">缴费状态</th>
16
- <th class="textNoLineBreak">作废人员</th>
17
- <th class="textNoLineBreak">作废时间</th>
18
- <th class="textNoLineBreak">作废原因</th>
19
- <th class="textNoLineBreak">
20
- <button
21
- type="button"
22
- class="btn btn-info head-but"
23
- @click="$parent.$parent.showChargeModal()"
24
- >新增收费</button>
25
- </th>
26
- </tr>
27
- </template>
28
- <template partial='body'>
29
- <tr>
30
- <td style="text-align: center;">
31
- <nobr>{{$index+1}}</nobr>
32
- </td>
33
- <td style="text-align: center;" v-if="$parent.$parent.selectdata.f_apply_type !== '开发商集体报建'">
34
- <nobr>{{row.f_useraddress}}</nobr>
35
- </td>
36
- <td style="text-align: center;">
37
- <nobr>{{row.f_charge_number}}</nobr>
38
- </td>
39
- <td style="text-align: center;">
40
- <nobr>{{row.f_charge_money}}</nobr>
41
- </td>
42
- <td style="text-align: center;">
43
- <nobr>{{row.f_amount_words}}</nobr>
44
- </td>
45
- <td style="text-align: center;">
46
- <nobr>{{row.f_payment_method}}</nobr>
47
- </td>
48
- <td style="text-align: center;">
49
- <nobr>{{row.f_charge_collectors}}</nobr>
50
- </td>
51
- <td style="text-align: center;">
52
- <nobr>{{row.f_charge_date}}</nobr>
53
- </td>
54
- <td style="text-align: center;">
55
- <nobr>{{row.f_charge_remarks}}</nobr>
56
- </td>
57
- <td style="text-align: center;">
58
- <nobr>{{row.f_charge_status}}</nobr>
59
- </td>
60
- <td style="text-align: center;">
61
- <nobr>{{row.f_void_staff}}</nobr>
62
- </td>
63
- <td style="text-align: center;">
64
- <nobr>{{row.f_void_date}}</nobr>
65
- </td>
66
- <td style="text-align: center;">
67
- <nobr>{{row.f_void_remarks}}</nobr>
68
- </td>
69
- <td style="text-align: center;">
70
- <nobr>
71
- <button
72
- type="button"
73
- name="button"
74
- class="btn btn-link"
75
- :disabled="$parent.$parent.mark === 1 || row.f_charging_status === '作废'"
76
- @click="$parent.$parent.showInvalidModal(row)"
77
- >作废</button>
78
-
79
- <!-- <button-->
80
- <!-- type="button"-->
81
- <!-- name="button"-->
82
- <!-- class="btn btn-link"-->
83
- <!-- @click="$parent.$parent.showPrintModal(row)"-->
84
- <!-- >打印预览</button>-->
85
- </nobr>
86
- </td>
87
- </tr>
88
- </template>
89
- </data-grid>
90
-
91
- <modal v-if="showCharge" :show.sync="showCharge" v-ref:modal :large="true" :backdrop="false" title="收费明细">
92
- <header slot="modal-header" class="modal-header">
93
- <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
94
- <h4 class="modal-title">收费明细</h4>
95
- </header>
96
- <article slot="modal-body" class="modal-body clearfix">
97
- <!-- <div class="form-group col-sm-12" :class="chargeUseraddress ? '':'has-error'" v-if="selectdata.f_apply_type == '散户报建'">-->
98
- <!-- <label class="col-sm-2 control-label">缴费地址:</label>-->
99
- <!-- <div class="col-sm-10">-->
100
- <!-- <input-select-->
101
- <!-- v-model="chargeUseraddress"-->
102
- <!-- placeholder='请选择'-->
103
- <!-- :value.sync="chargeUseraddress"-->
104
- <!-- :options='useraddressList'-->
105
- <!-- @change="changeUseraddress()"-->
106
- <!-- class="select select_list"-->
107
- <!-- :value-single="true"-->
108
- <!-- width="100%"-->
109
- <!-- close-on-select ></input-select>-->
110
- <!-- </div>-->
111
- <!-- </div>-->
112
- <div class="form-group col-sm-12" :class="charge.f_charge_money ? '':'has-error'">
113
- <label class="col-sm-2 control-label">收费金额:</label>
114
- <div class="col-sm-10">
115
- <input type="number"
116
- class="form-control input_view"
117
- style="width: 100%"
118
- placeholder="0.00"
119
- @keyup="handleInput"
120
- v-model="charge.f_charge_money" />
121
- </div>
122
- </div>
123
- <div class="form-group col-sm-12" :class="charge.f_payment_method ? '':'has-error'">
124
- <label class="col-sm-2 control-label">付款方式:</label>
125
- <div class="col-sm-10">
126
- <input-select
127
- v-model="charge.f_payment_method"
128
- placeholder='请选择'
129
- :value.sync="charge.f_payment_method"
130
- :options='paymentMethod'
131
- class="select select_list"
132
- :value-single="true"
133
- width="100%"
134
- close-on-select ></input-select>
135
- </div>
136
- </div>
137
- <div class="form-group col-sm-12">
138
- <label class="col-sm-2 control-label">金额大写:</label>
139
- <div class="col-sm-10">
140
- <input type="text"
141
- class="form-control input_view"
142
- style="width: 100%"
143
- :value="smalltoBIG(0)"
144
- readonly
145
- v-model.sync="charge.f_amount_words" />
146
- </div>
147
- </div>
148
- <div class="form-group col-sm-12"
149
- v-if="selectdata.f_apply_type === '散户集体报建'"
150
- >
151
- <label class="col-sm-2 control-label">单价(户):</label>
152
- <div class="col-sm-10">
153
- <input type="text"
154
- class="form-control input_view"
155
- style="width: 100%"
156
- readonly
157
- v-model="selectdata.f_price" />
158
- </div>
159
- </div>
160
- <div class="form-group col-sm-12"
161
- v-if="selectdata.f_apply_type === '散户集体报建'"
162
- >
163
- <label class="col-sm-2 control-label">累计缴费金额:</label>
164
- <div class="col-sm-10">
165
- <input type="text"
166
- class="form-control input_view"
167
- style="width: 100%"
168
- readonly
169
- :value="cumulativePaymentMoney" />
170
- </div>
171
- </div>
172
- <div class="form-group col-sm-12"
173
- v-if="selectdata.f_apply_type === '散户集体报建'"
174
- >
175
- <label class="col-sm-2 control-label">未结金额:</label>
176
- <div class="col-sm-10">
177
- <input type="text"
178
- class="form-control input_view"
179
- style="width: 100%"
180
- readonly
181
- :value="outstandingAmount" />
182
- </div>
183
- </div>
184
- <div class="form-group col-sm-12">
185
- <label class="col-sm-2 control-label">应交总金额:</label>
186
- <div class="col-sm-10">
187
- <input type="text"
188
- class="form-control input_view"
189
- style="width: 100%"
190
- readonly
191
- v-model="selectdata.f_due_money" />
192
- </div>
193
- </div>
194
- <div class="form-group col-sm-12">
195
- <label class="col-sm-2 control-label">累计缴费总金额:</label>
196
- <div class="col-sm-10">
197
- <input type="text"
198
- class="form-control input_view"
199
- style="width: 100%"
200
- readonly
201
- v-model="selectdata.f_cumulative_payment_money" />
202
- </div>
203
- </div>
204
- <div class="form-group col-sm-12">
205
- <label class="col-sm-2 control-label">未结总金额:</label>
206
- <div class="col-sm-10">
207
- <input type="text"
208
- class="form-control input_view"
209
- style="width: 100%"
210
- readonly
211
- v-model="selectdata.f_surplus_money" />
212
- </div>
213
- </div>
214
- <div class="form-group col-sm-12">
215
- <label class="col-sm-2 control-label">备注:</label>
216
- <div class="col-sm-10">
217
- <input type="text"
218
- class="form-control input_view"
219
- style="width: 100%"
220
- v-model="charge.f_charge_remarks" />
221
- </div>
222
- </div>
223
- </article>
224
- <footer slot="modal-footer" class="modal-footer">
225
- <button type="button" class="btn btn-primary" @click="saveCharge()">新增收费</button>
226
- </footer>
227
- </modal>
228
-
229
- <modal v-if="showInvalid" :show.sync="showInvalid" v-ref:modal :large="true" :backdrop="false" title="作废收费">
230
- <header slot="modal-header" class="modal-header">
231
- <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
232
- <h4 class="modal-title">作废收费</h4>
233
- </header>
234
- <article slot="modal-body" class="modal-body clearfix">
235
- <div class="form-group col-sm-12">
236
- <label class="col-sm-2 control-label">收费金额:</label>
237
- <div class="col-sm-10">
238
- <input type="text"
239
- class="form-control input_view"
240
- style="width: 100%"
241
- readonly
242
- v-model="charge.f_charge_money" />
243
- </div>
244
- </div>
245
- <div class="form-group col-sm-12">
246
- <label class="col-sm-2 control-label">付款方式:</label>
247
- <div class="col-sm-10">
248
- <input type="text"
249
- class="form-control input_view"
250
- style="width: 100%"
251
- readonly
252
- v-model="charge.f_payment_method" />
253
- </div>
254
- </div>
255
- <div class="form-group col-sm-12">
256
- <label class="col-sm-2 control-label">金额大写:</label>
257
- <div class="col-sm-10">
258
- <input type="text"
259
- class="form-control input_view"
260
- style="width: 100%"
261
- readonly
262
- v-model="charge.f_amount_words" />
263
- </div>
264
- </div>
265
- <div class="form-group col-sm-12">
266
- <label class="col-sm-2 control-label">收费人员:</label>
267
- <div class="col-sm-10">
268
- <input type="text"
269
- class="form-control input_view"
270
- style="width: 100%"
271
- readonly
272
- v-model="charge.f_charge_collectors" />
273
- </div>
274
- </div>
275
- <div class="form-group col-sm-12" :class="charge.f_void_remarks ? '':'has-error'">
276
- <label class="col-sm-2 control-label">作废原因:</label>
277
- <div class="col-sm-10">
278
- <input type="text"
279
- class="form-control input_view"
280
- style="width: 100%"
281
- v-model="charge.f_void_remarks" />
282
- </div>
283
- </div>
284
- </article>
285
- <footer slot="modal-footer" class="modal-footer">
286
- <button type="button" class="btn btn-primary" @click="invalidApplyCharge()">确认作废</button>
287
- </footer>
288
- </modal>
289
-
290
- <modal v-if="showPrint" :show.sync="showPrint" v-ref:modal :large="true" :backdrop="false" title="打印预览">
291
- <header slot="modal-header" class="modal-header">
292
- <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
293
- <h4 class="modal-title">打印预览</h4>
294
- </header>
295
- <article slot="modal-body" class="modal-body clearfix">
296
- <apply-print-charge :selectdata="selectdata" :charge="charge" v-ref:print></apply-print-charge>
297
- </article>
298
- <footer slot="modal-footer" class="modal-footer">
299
- <button type="button" class="btn btn-primary" @click="print()">打印</button>
300
- </footer>
301
- </modal>
302
- </div>
303
- </template>
304
- <script>
305
- import {getNowDate,isEmpty} from '../../../Util'
306
- import {PagedList} from 'vue-client'
307
- import {HttpResetClass} from 'vue-client'
308
-
309
- export default {
310
- title: '收费管理',
311
- props: {
312
- selectdata: {
313
- type: Object
314
- },
315
- mark: {
316
- type: Number,
317
- default: 0
318
- }
319
- },
320
- data () {
321
- return {
322
- showCharge: false,
323
- showInvalid: false,
324
- showPrint: false,
325
- model: {
326
- data: null
327
- },
328
- charge: {
329
-
330
- },
331
- useraddressList: [],
332
- chargeUseraddress: null
333
- }
334
- },
335
- ready () {
336
- this.search()
337
- },
338
- methods: {
339
- print () {
340
- this.$refs.print.$refs.print.PrintTable()
341
- },
342
- showPrintModal(row) {
343
- this.charge = row
344
- this.showPrint = true
345
- },
346
- changeUseraddress() {
347
- this.charge.f_useraddress_id = this.chargeUseraddress.id
348
- },
349
- async invalidApplyCharge() {
350
- if (isEmpty(this.charge.f_void_remarks)) {
351
- this.$showAlert('请输入作废本次收费原因!!!', 'warning', 3000)
352
- return
353
- }
354
-
355
- let http = new HttpResetClass()
356
- let data = {
357
- apply: this.selectdata,
358
- user: this.$login.f,
359
- charge: this.charge
360
- }
361
- try {
362
- let res = await http.load('POST', 'rs/logic/invalidApplyCharge', {data:data}, {
363
- resolveMsg: null,
364
- rejectMsg: null
365
- })
366
- this.selectdata = res.data
367
- } catch (e) {
368
- this.$showAlert(e.data, 'danger', 3000)
369
- }
370
-
371
-
372
- this.$dispatch('breakControl', this.selectdata)
373
- },
374
- showInvalidModal(row) {
375
- this.charge = row
376
- this.showInvalid = true
377
- },
378
- handleInput(e) {
379
- // 通过正则过滤小数点后两位
380
- e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
381
- this.charge.f_amount_words = this.smalltoBIG(e.target.value)
382
- },
383
- async saveCharge() {
384
- // if (isEmpty(this.charge.f_useraddress_id) && this.selectdata.f_apply_type == '散户报建') {
385
- // this.$showAlert('请选择缴费的地址信息!!!', 'warning', 3000)
386
- // return
387
- // }
388
- if (Number(this.charge.f_charge_money) === 0 || isEmpty(this.charge.f_charge_money)) {
389
- this.$showAlert('单笔收费不能为0元!!!', 'warning', 3000)
390
- return
391
- }
392
- if (Number(this.charge.f_charge_money) > Number(this.selectdata.f_surplus_money)) {
393
- this.$showAlert('单笔收费不能超过未交总金额!!!', 'warning', 3000)
394
- return
395
- }
396
- if (this.selectdata.f_apply_type === '散户集体报建' || this.selectdata.f_apply_type === '散户报建') {
397
- if (Number(this.charge.f_charge_money) > Number(this.selectdata.f_price)) {
398
- this.$showAlert('单笔收费不能超过单价!!!', 'warning', 3000)
399
- return
400
- }
401
- if (Number(this.charge.f_charge_money) > Number(this.outstandingAmount)) {
402
- this.$showAlert('单笔收费不能超过当前用户未结金额!!!', 'warning', 3000)
403
- return
404
- }
405
- }
406
- if (isEmpty(this.charge.f_payment_method)) {
407
- this.$showAlert('请选择付款方式!!!', 'warning', 3000)
408
- return
409
- }
410
- let http = new HttpResetClass()
411
- let data = {
412
- apply: this.selectdata,
413
- user: this.$login.f,
414
- charge: this.charge
415
- }
416
- try {
417
- let res = await http.load('POST', 'rs/logic/addApplyChargeRecord', {data:data}, {
418
- resolveMsg: null,
419
- rejectMsg: null
420
- })
421
- this.selectdata = res.data
422
- } catch (e) {
423
- this.$showAlert(e.data, 'danger', 3000)
424
- }
425
- this.$dispatch('breakControl', this.selectdata)
426
- },
427
- // 金额转大写
428
- smalltoBIG(n) {
429
- let fraction = ['角', '分'];
430
- let digit = ['', '', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
431
- let unit = [['', '', '亿'], ['', '', '', '']];
432
- let head = n < 0 ? '' : '';
433
- n = Math.abs(n);
434
-
435
- let s = '';
436
-
437
- for (var i = 0; i < fraction.length; i++) {
438
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
439
- }
440
- s = s || '整';
441
- n = Math.floor(n);
442
-
443
- for (var i = 0; i < unit[0].length && n > 0; i++) {
444
- let p = '';
445
- for (var j = 0; j < unit[1].length && n > 0; j++) {
446
- p = digit[n % 10] + unit[1][j] + p;
447
- n = Math.floor(n / 10);
448
- }
449
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
450
- }
451
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
452
- },
453
- async getUserAddress() {
454
- let http = new HttpResetClass()
455
- let data = {
456
- condition: '1=1',
457
- f_process_id: this.selectdata.f_process_id
458
- }
459
- let res = await http.load('POST', 'rs/sql/getAddresAndCumulativePayment', {data:data}, {
460
- resolveMsg: null,
461
- rejectMsg: null
462
- })
463
-
464
- this.useraddressList = res.data
465
- if (this.selectdata.f_apply_type === '开发商集体报建' || this.selectdata.f_apply_type === '散户报建') {
466
- // 去除累计缴费金额大于等于单价的用户地址
467
- this.useraddressList = res.data.filter(item => {
468
- let f_cumulative_payment_money = isEmpty(item.f_cumulative_payment_money) ? 0 : item.f_cumulative_payment_money
469
- return Number(f_cumulative_payment_money) < Number(isEmpty(this.selectdata.f_price) ? 0 : this.selectdata.f_price)
470
- })
471
- }
472
-
473
- if (this.useraddressList.length > 0) {
474
- this.useraddressList = this.useraddressList.map(item => {
475
- return {
476
- // 有用户姓名地址后拼接姓名
477
- label: `${item.f_address} ${isEmpty(item.f_user_name) ? '' : '--- ' + item.f_user_name}`,
478
- value: item
479
- }
480
- })
481
- }
482
-
483
- },
484
- async showChargeModal() {
485
- this.getUserAddress()
486
-
487
- this.showCharge = true
488
- },
489
- async search () {
490
- let http = new HttpResetClass()
491
- let data = {
492
- f_process_id: this.selectdata.f_process_id
493
- }
494
- let res = await http.load('POST', 'rs/sql/getApplyChargeRecord', {data:data}, {
495
- resolveMsg: null,
496
- rejectMsg: null
497
- })
498
- this.model.data = res.data
499
- },
500
- // 关闭对话框
501
- closeModal() {
502
- this.showCharge = false
503
- this.showInvalid = false
504
- this.showPrint = false
505
- this.charge = {}
506
- this.chargeUseraddress = null
507
- this.search()
508
- }
509
- },
510
- events: {
511
- },
512
- computed: {
513
- paymentMethod() {
514
- return this.$appdata.getParam("付款方式")
515
- },
516
- cumulativePaymentMoney() {
517
- return isEmpty(this.chargeUseraddress.f_cumulative_payment_money) ? 0 : this.chargeUseraddress.f_cumulative_payment_money
518
- },
519
- outstandingAmount() {
520
- return this.selectdata.f_price - this.cumulativePaymentMoney
521
- }
522
- },
523
- watch: {
524
- }
525
- }
526
- </script>
527
- <style scoped>
528
- .textNoLineBreak {
529
- white-space: nowrap;
530
- }
531
- .head-but{
532
- margin-left: 5px;
533
- height: 34px;
534
- /*background-color: #6aa6e2;*/
535
- border-radius: 4px;
536
- font-family: PingFang;
537
- color: #ffffff;
538
- }
539
- </style>
1
+ <template>
2
+ <div class="col-sm-12" style="margin: 20px 0px;">
3
+ <data-grid :model="model" v-ref:grid class="list_area table_sy" style="padding: 0px">
4
+ <template partial='head'>
5
+ <tr>
6
+ <th class="textNoLineBreak">序号</th>
7
+ <th class="textNoLineBreak" v-if="$parent.$parent.selectdata.f_apply_type !== '开发商集体报建'">地址</th>
8
+ <th class="textNoLineBreak">缴费编号</th>
9
+ <th class="textNoLineBreak">收费金额</th>
10
+ <th class="textNoLineBreak">金额大写</th>
11
+ <th class="textNoLineBreak">付款方式</th>
12
+ <th class="textNoLineBreak">收费人员</th>
13
+ <th class="textNoLineBreak">收费日期</th>
14
+ <th class="textNoLineBreak">备注</th>
15
+ <th class="textNoLineBreak">缴费状态</th>
16
+ <th class="textNoLineBreak">作废人员</th>
17
+ <th class="textNoLineBreak">作废时间</th>
18
+ <th class="textNoLineBreak">作废原因</th>
19
+ <th class="textNoLineBreak">
20
+ <button
21
+ type="button"
22
+ class="btn btn-info head-but"
23
+ v-if="$parent.$parent.mark !== 1"
24
+ @click="$parent.$parent.showChargeModal()"
25
+ >新增收费</button>
26
+ </th>
27
+ </tr>
28
+ </template>
29
+ <template partial='body'>
30
+ <tr>
31
+ <td style="text-align: center;">
32
+ <nobr>{{$index+1}}</nobr>
33
+ </td>
34
+ <td style="text-align: center;" v-if="$parent.$parent.selectdata.f_apply_type !== '开发商集体报建'">
35
+ <nobr>{{row.f_useraddress}}</nobr>
36
+ </td>
37
+ <td style="text-align: center;">
38
+ <nobr>{{row.f_charge_number}}</nobr>
39
+ </td>
40
+ <td style="text-align: center;">
41
+ <nobr>{{row.f_charge_money}}</nobr>
42
+ </td>
43
+ <td style="text-align: center;">
44
+ <nobr>{{row.f_amount_words}}</nobr>
45
+ </td>
46
+ <td style="text-align: center;">
47
+ <nobr>{{row.f_payment_method}}</nobr>
48
+ </td>
49
+ <td style="text-align: center;">
50
+ <nobr>{{row.f_charge_collectors}}</nobr>
51
+ </td>
52
+ <td style="text-align: center;">
53
+ <nobr>{{row.f_charge_date}}</nobr>
54
+ </td>
55
+ <td style="text-align: center;">
56
+ <nobr>{{row.f_charge_remarks}}</nobr>
57
+ </td>
58
+ <td style="text-align: center;">
59
+ <nobr>{{row.f_charge_status}}</nobr>
60
+ </td>
61
+ <td style="text-align: center;">
62
+ <nobr>{{row.f_void_staff}}</nobr>
63
+ </td>
64
+ <td style="text-align: center;">
65
+ <nobr>{{row.f_void_date}}</nobr>
66
+ </td>
67
+ <td style="text-align: center;">
68
+ <nobr>{{row.f_void_remarks}}</nobr>
69
+ </td>
70
+ <td style="text-align: center;">
71
+ <nobr>
72
+ <button
73
+ type="button"
74
+ name="button"
75
+ class="btn btn-link"
76
+ :disabled="$parent.$parent.mark === 1 || row.f_charging_status === '作废'"
77
+ @click="$parent.$parent.showInvalidModal(row)"
78
+ >作废</button>
79
+
80
+ <!-- <button-->
81
+ <!-- type="button"-->
82
+ <!-- name="button"-->
83
+ <!-- class="btn btn-link"-->
84
+ <!-- @click="$parent.$parent.showPrintModal(row)"-->
85
+ <!-- >打印预览</button>-->
86
+ </nobr>
87
+ </td>
88
+ </tr>
89
+ </template>
90
+ </data-grid>
91
+
92
+ <modal v-if="showCharge" :show.sync="showCharge" v-ref:modal :large="true" :backdrop="false" title="收费明细">
93
+ <header slot="modal-header" class="modal-header">
94
+ <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
95
+ <h4 class="modal-title">收费明细</h4>
96
+ </header>
97
+ <article slot="modal-body" class="modal-body clearfix">
98
+ <!-- <div class="form-group col-sm-12" :class="chargeUseraddress ? '':'has-error'" v-if="selectdata.f_apply_type == '散户报建'">-->
99
+ <!-- <label class="col-sm-2 control-label">缴费地址:</label>-->
100
+ <!-- <div class="col-sm-10">-->
101
+ <!-- <input-select-->
102
+ <!-- v-model="chargeUseraddress"-->
103
+ <!-- placeholder='请选择'-->
104
+ <!-- :value.sync="chargeUseraddress"-->
105
+ <!-- :options='useraddressList'-->
106
+ <!-- @change="changeUseraddress()"-->
107
+ <!-- class="select select_list"-->
108
+ <!-- :value-single="true"-->
109
+ <!-- width="100%"-->
110
+ <!-- close-on-select ></input-select>-->
111
+ <!-- </div>-->
112
+ <!-- </div>-->
113
+ <div class="form-group col-sm-12" :class="charge.f_charge_money ? '':'has-error'">
114
+ <label class="col-sm-2 control-label">收费金额:</label>
115
+ <div class="col-sm-10">
116
+ <input type="number"
117
+ class="form-control input_view"
118
+ style="width: 100%"
119
+ placeholder="0.00"
120
+ @keyup="handleInput"
121
+ v-model="charge.f_charge_money" />
122
+ </div>
123
+ </div>
124
+ <div class="form-group col-sm-12" :class="charge.f_payment_method ? '':'has-error'">
125
+ <label class="col-sm-2 control-label">付款方式:</label>
126
+ <div class="col-sm-10">
127
+ <input-select
128
+ v-model="charge.f_payment_method"
129
+ placeholder='请选择'
130
+ :value.sync="charge.f_payment_method"
131
+ :options='paymentMethod'
132
+ class="select select_list"
133
+ :value-single="true"
134
+ width="100%"
135
+ close-on-select ></input-select>
136
+ </div>
137
+ </div>
138
+ <div class="form-group col-sm-12">
139
+ <label class="col-sm-2 control-label">金额大写:</label>
140
+ <div class="col-sm-10">
141
+ <input type="text"
142
+ class="form-control input_view"
143
+ style="width: 100%"
144
+ :value="smalltoBIG(0)"
145
+ readonly
146
+ v-model.sync="charge.f_amount_words" />
147
+ </div>
148
+ </div>
149
+ <div class="form-group col-sm-12"
150
+ v-if="selectdata.f_apply_type === '散户集体报建'"
151
+ >
152
+ <label class="col-sm-2 control-label">单价(户):</label>
153
+ <div class="col-sm-10">
154
+ <input type="text"
155
+ class="form-control input_view"
156
+ style="width: 100%"
157
+ readonly
158
+ v-model="selectdata.f_price" />
159
+ </div>
160
+ </div>
161
+ <div class="form-group col-sm-12"
162
+ v-if="selectdata.f_apply_type === '散户集体报建'"
163
+ >
164
+ <label class="col-sm-2 control-label">累计缴费金额:</label>
165
+ <div class="col-sm-10">
166
+ <input type="text"
167
+ class="form-control input_view"
168
+ style="width: 100%"
169
+ readonly
170
+ :value="cumulativePaymentMoney" />
171
+ </div>
172
+ </div>
173
+ <div class="form-group col-sm-12"
174
+ v-if="selectdata.f_apply_type === '散户集体报建'"
175
+ >
176
+ <label class="col-sm-2 control-label">未结金额:</label>
177
+ <div class="col-sm-10">
178
+ <input type="text"
179
+ class="form-control input_view"
180
+ style="width: 100%"
181
+ readonly
182
+ :value="outstandingAmount" />
183
+ </div>
184
+ </div>
185
+ <div class="form-group col-sm-12">
186
+ <label class="col-sm-2 control-label">应交总金额:</label>
187
+ <div class="col-sm-10">
188
+ <input type="text"
189
+ class="form-control input_view"
190
+ style="width: 100%"
191
+ readonly
192
+ v-model="selectdata.f_due_money" />
193
+ </div>
194
+ </div>
195
+ <div class="form-group col-sm-12">
196
+ <label class="col-sm-2 control-label">累计缴费总金额:</label>
197
+ <div class="col-sm-10">
198
+ <input type="text"
199
+ class="form-control input_view"
200
+ style="width: 100%"
201
+ readonly
202
+ v-model="selectdata.f_cumulative_payment_money" />
203
+ </div>
204
+ </div>
205
+ <div class="form-group col-sm-12">
206
+ <label class="col-sm-2 control-label">未结总金额:</label>
207
+ <div class="col-sm-10">
208
+ <input type="text"
209
+ class="form-control input_view"
210
+ style="width: 100%"
211
+ readonly
212
+ v-model="selectdata.f_surplus_money" />
213
+ </div>
214
+ </div>
215
+ <div class="form-group col-sm-12">
216
+ <label class="col-sm-2 control-label">备注:</label>
217
+ <div class="col-sm-10">
218
+ <input type="text"
219
+ class="form-control input_view"
220
+ style="width: 100%"
221
+ v-model="charge.f_charge_remarks" />
222
+ </div>
223
+ </div>
224
+ </article>
225
+ <footer slot="modal-footer" class="modal-footer">
226
+ <button type="button" class="btn btn-primary" @click="saveCharge()">新增收费</button>
227
+ </footer>
228
+ </modal>
229
+
230
+ <modal v-if="showInvalid" :show.sync="showInvalid" v-ref:modal :large="true" :backdrop="false" title="作废收费">
231
+ <header slot="modal-header" class="modal-header">
232
+ <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
233
+ <h4 class="modal-title">作废收费</h4>
234
+ </header>
235
+ <article slot="modal-body" class="modal-body clearfix">
236
+ <div class="form-group col-sm-12">
237
+ <label class="col-sm-2 control-label">收费金额:</label>
238
+ <div class="col-sm-10">
239
+ <input type="text"
240
+ class="form-control input_view"
241
+ style="width: 100%"
242
+ readonly
243
+ v-model="charge.f_charge_money" />
244
+ </div>
245
+ </div>
246
+ <div class="form-group col-sm-12">
247
+ <label class="col-sm-2 control-label">付款方式:</label>
248
+ <div class="col-sm-10">
249
+ <input type="text"
250
+ class="form-control input_view"
251
+ style="width: 100%"
252
+ readonly
253
+ v-model="charge.f_payment_method" />
254
+ </div>
255
+ </div>
256
+ <div class="form-group col-sm-12">
257
+ <label class="col-sm-2 control-label">金额大写:</label>
258
+ <div class="col-sm-10">
259
+ <input type="text"
260
+ class="form-control input_view"
261
+ style="width: 100%"
262
+ readonly
263
+ v-model="charge.f_amount_words" />
264
+ </div>
265
+ </div>
266
+ <div class="form-group col-sm-12">
267
+ <label class="col-sm-2 control-label">收费人员:</label>
268
+ <div class="col-sm-10">
269
+ <input type="text"
270
+ class="form-control input_view"
271
+ style="width: 100%"
272
+ readonly
273
+ v-model="charge.f_charge_collectors" />
274
+ </div>
275
+ </div>
276
+ <div class="form-group col-sm-12" :class="charge.f_void_remarks ? '':'has-error'">
277
+ <label class="col-sm-2 control-label">作废原因:</label>
278
+ <div class="col-sm-10">
279
+ <input type="text"
280
+ class="form-control input_view"
281
+ style="width: 100%"
282
+ v-model="charge.f_void_remarks" />
283
+ </div>
284
+ </div>
285
+ </article>
286
+ <footer slot="modal-footer" class="modal-footer">
287
+ <button type="button" class="btn btn-primary" @click="invalidApplyCharge()">确认作废</button>
288
+ </footer>
289
+ </modal>
290
+
291
+ <modal v-if="showPrint" :show.sync="showPrint" v-ref:modal :large="true" :backdrop="false" title="打印预览">
292
+ <header slot="modal-header" class="modal-header">
293
+ <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
294
+ <h4 class="modal-title">打印预览</h4>
295
+ </header>
296
+ <article slot="modal-body" class="modal-body clearfix">
297
+ <apply-print-charge :selectdata="selectdata" :charge="charge" v-ref:print></apply-print-charge>
298
+ </article>
299
+ <footer slot="modal-footer" class="modal-footer">
300
+ <button type="button" class="btn btn-primary" @click="print()">打印</button>
301
+ </footer>
302
+ </modal>
303
+ </div>
304
+ </template>
305
+ <script>
306
+ import {getNowDate,isEmpty} from '../../../Util'
307
+ import {PagedList} from 'vue-client'
308
+ import {HttpResetClass} from 'vue-client'
309
+
310
+ export default {
311
+ title: '收费管理',
312
+ props: {
313
+ selectdata: {
314
+ type: Object
315
+ },
316
+ mark: {
317
+ type: Number,
318
+ default: 0
319
+ }
320
+ },
321
+ data () {
322
+ return {
323
+ showCharge: false,
324
+ showInvalid: false,
325
+ showPrint: false,
326
+ model: {
327
+ data: null
328
+ },
329
+ charge: {
330
+
331
+ },
332
+ useraddressList: [],
333
+ chargeUseraddress: null
334
+ }
335
+ },
336
+ ready () {
337
+ this.search()
338
+ },
339
+ methods: {
340
+ print () {
341
+ this.$refs.print.$refs.print.PrintTable()
342
+ },
343
+ showPrintModal(row) {
344
+ this.charge = row
345
+ this.showPrint = true
346
+ },
347
+ changeUseraddress() {
348
+ this.charge.f_useraddress_id = this.chargeUseraddress.id
349
+ },
350
+ async invalidApplyCharge() {
351
+ if (isEmpty(this.charge.f_void_remarks)) {
352
+ this.$showAlert('请输入作废本次收费原因!!!', 'warning', 3000)
353
+ return
354
+ }
355
+
356
+ let http = new HttpResetClass()
357
+ let data = {
358
+ apply: this.selectdata,
359
+ user: this.$login.f,
360
+ charge: this.charge
361
+ }
362
+ try {
363
+ let res = await http.load('POST', 'rs/logic/invalidApplyCharge', {data:data}, {
364
+ resolveMsg: null,
365
+ rejectMsg: null
366
+ })
367
+ this.selectdata = res.data
368
+ } catch (e) {
369
+ this.$showAlert(e.data, 'danger', 3000)
370
+ }
371
+
372
+
373
+ this.$dispatch('breakControl', this.selectdata)
374
+ },
375
+ showInvalidModal(row) {
376
+ this.charge = row
377
+ this.showInvalid = true
378
+ },
379
+ handleInput(e) {
380
+ // 通过正则过滤小数点后两位
381
+ e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
382
+ this.charge.f_amount_words = this.smalltoBIG(e.target.value)
383
+ },
384
+ async saveCharge() {
385
+ // if (isEmpty(this.charge.f_useraddress_id) && this.selectdata.f_apply_type == '散户报建') {
386
+ // this.$showAlert('请选择缴费的地址信息!!!', 'warning', 3000)
387
+ // return
388
+ // }
389
+ if (Number(this.charge.f_charge_money) === 0 || isEmpty(this.charge.f_charge_money)) {
390
+ this.$showAlert('单笔收费不能为0元!!!', 'warning', 3000)
391
+ return
392
+ }
393
+ if (Number(this.charge.f_charge_money) > Number(this.selectdata.f_surplus_money)) {
394
+ this.$showAlert('单笔收费不能超过未交总金额!!!', 'warning', 3000)
395
+ return
396
+ }
397
+ if (this.selectdata.f_apply_type === '散户集体报建' || this.selectdata.f_apply_type === '散户报建') {
398
+ if (Number(this.charge.f_charge_money) > Number(this.selectdata.f_price)) {
399
+ this.$showAlert('单笔收费不能超过单价!!!', 'warning', 3000)
400
+ return
401
+ }
402
+ if (Number(this.charge.f_charge_money) > Number(this.outstandingAmount)) {
403
+ this.$showAlert('单笔收费不能超过当前用户未结金额!!!', 'warning', 3000)
404
+ return
405
+ }
406
+ }
407
+ if (isEmpty(this.charge.f_payment_method)) {
408
+ this.$showAlert('请选择付款方式!!!', 'warning', 3000)
409
+ return
410
+ }
411
+ let http = new HttpResetClass()
412
+ let data = {
413
+ apply: this.selectdata,
414
+ user: this.$login.f,
415
+ charge: this.charge
416
+ }
417
+ try {
418
+ let res = await http.load('POST', 'rs/logic/addApplyChargeRecord', {data:data}, {
419
+ resolveMsg: null,
420
+ rejectMsg: null
421
+ })
422
+ this.selectdata = res.data
423
+ } catch (e) {
424
+ this.$showAlert(e.data, 'danger', 3000)
425
+ }
426
+ this.$dispatch('breakControl', this.selectdata)
427
+ },
428
+ // 金额转大写
429
+ smalltoBIG(n) {
430
+ let fraction = ['', ''];
431
+ let digit = ['', '', '', '', '', '', '', '柒', '捌', '玖'];
432
+ let unit = [['元', '万', '亿'], ['', '', '佰', '']];
433
+ let head = n < 0 ? '欠' : '';
434
+ n = Math.abs(n);
435
+
436
+ let s = '';
437
+
438
+ for (var i = 0; i < fraction.length; i++) {
439
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
440
+ }
441
+ s = s || '整';
442
+ n = Math.floor(n);
443
+
444
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
445
+ let p = '';
446
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
447
+ p = digit[n % 10] + unit[1][j] + p;
448
+ n = Math.floor(n / 10);
449
+ }
450
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
451
+ }
452
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
453
+ },
454
+ async getUserAddress() {
455
+ let http = new HttpResetClass()
456
+ let data = {
457
+ condition: '1=1',
458
+ f_process_id: this.selectdata.f_process_id
459
+ }
460
+ let res = await http.load('POST', 'rs/sql/getAddresAndCumulativePayment', {data:data}, {
461
+ resolveMsg: null,
462
+ rejectMsg: null
463
+ })
464
+
465
+ this.useraddressList = res.data
466
+ if (this.selectdata.f_apply_type === '开发商集体报建' || this.selectdata.f_apply_type === '散户报建') {
467
+ // 去除累计缴费金额大于等于单价的用户地址
468
+ this.useraddressList = res.data.filter(item => {
469
+ let f_cumulative_payment_money = isEmpty(item.f_cumulative_payment_money) ? 0 : item.f_cumulative_payment_money
470
+ return Number(f_cumulative_payment_money) < Number(isEmpty(this.selectdata.f_price) ? 0 : this.selectdata.f_price)
471
+ })
472
+ }
473
+
474
+ if (this.useraddressList.length > 0) {
475
+ this.useraddressList = this.useraddressList.map(item => {
476
+ return {
477
+ // 有用户姓名地址后拼接姓名
478
+ label: `${item.f_address} ${isEmpty(item.f_user_name) ? '' : '--- ' + item.f_user_name}`,
479
+ value: item
480
+ }
481
+ })
482
+ }
483
+
484
+ },
485
+ async showChargeModal() {
486
+ this.getUserAddress()
487
+
488
+ this.showCharge = true
489
+ },
490
+ async search () {
491
+ let http = new HttpResetClass()
492
+ let data = {
493
+ f_process_id: this.selectdata.f_process_id
494
+ }
495
+ let res = await http.load('POST', 'rs/sql/getApplyChargeRecord', {data:data}, {
496
+ resolveMsg: null,
497
+ rejectMsg: null
498
+ })
499
+ this.model.data = res.data
500
+ },
501
+ // 关闭对话框
502
+ closeModal() {
503
+ this.showCharge = false
504
+ this.showInvalid = false
505
+ this.showPrint = false
506
+ this.charge = {}
507
+ this.chargeUseraddress = null
508
+ this.search()
509
+ }
510
+ },
511
+ events: {
512
+ },
513
+ computed: {
514
+ paymentMethod() {
515
+ return this.$appdata.getParam("付款方式")
516
+ },
517
+ cumulativePaymentMoney() {
518
+ return isEmpty(this.chargeUseraddress.f_cumulative_payment_money) ? 0 : this.chargeUseraddress.f_cumulative_payment_money
519
+ },
520
+ outstandingAmount() {
521
+ return this.selectdata.f_price - this.cumulativePaymentMoney
522
+ }
523
+ },
524
+ watch: {
525
+ }
526
+ }
527
+ </script>
528
+ <style scoped>
529
+ .textNoLineBreak {
530
+ white-space: nowrap;
531
+ }
532
+ .head-but{
533
+ margin-left: 5px;
534
+ height: 34px;
535
+ /*background-color: #6aa6e2;*/
536
+ border-radius: 4px;
537
+ font-family: PingFang;
538
+ color: #ffffff;
539
+ }
540
+ </style>