apply-clients 7.1.41 → 7.1.44

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apply-clients",
3
- "version": "7.1.41",
3
+ "version": "7.1.44",
4
4
  "description": "报建前端模块",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -1,562 +1,563 @@
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">缴费单位</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
- :disabled="$parent.$parent.mark === 1 || ($parent.$parent.selectdata.f_cumulative_payment_money >= $parent.$parent.selectdata.f_due_money || $parent.$parent.selectdata.f_surplus_money === 0)"
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;">
35
- <nobr>{{row.f_payer}}</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_charge_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_payer ? '':'has-error'">
114
- <label class="col-sm-2 control-label">缴费单位:</label>
115
- <div class="col-sm-10">
116
- <input type="text"
117
- class="form-control input_view"
118
- style="width: 100%"
119
- placeholder="请输入"
120
- v-model="charge.f_payer" />
121
- </div>
122
- </div>
123
- <div class="form-group col-sm-12" :class="charge.f_charge_money ? '':'has-error'">
124
- <label class="col-sm-2 control-label">收费金额:</label>
125
- <div class="col-sm-10">
126
- <input type="number"
127
- class="form-control input_view"
128
- style="width: 100%"
129
- placeholder="0.00"
130
- @keyup="handleInput"
131
- v-model="charge.f_charge_money" />
132
- </div>
133
- </div>
134
- <div class="form-group col-sm-12" :class="charge.f_payment_method ? '':'has-error'">
135
- <label class="col-sm-2 control-label">付款方式:</label>
136
- <div class="col-sm-10">
137
- <input-select
138
- v-model="charge.f_payment_method"
139
- placeholder='请选择'
140
- :value.sync="charge.f_payment_method"
141
- :options='paymentMethod'
142
- class="select select_list"
143
- :value-single="true"
144
- width="100%"
145
- close-on-select ></input-select>
146
- </div>
147
- </div>
148
- <div class="form-group col-sm-12">
149
- <label class="col-sm-2 control-label">金额大写:</label>
150
- <div class="col-sm-10">
151
- <input type="text"
152
- class="form-control input_view"
153
- style="width: 100%"
154
- :value="smalltoBIG(0)"
155
- readonly
156
- v-model.sync="charge.f_amount_words" />
157
- </div>
158
- </div>
159
- <div class="form-group col-sm-12"
160
- v-if="selectdata.f_apply_type === '散户集体报建' || selectdata.f_apply_type === '煤改气报建'"
161
- >
162
- <label class="col-sm-2 control-label">单价(户):</label>
163
- <div class="col-sm-10">
164
- <input type="text"
165
- class="form-control input_view"
166
- style="width: 100%"
167
- readonly
168
- v-model="selectdata.f_price" />
169
- </div>
170
- </div>
171
- <div class="form-group col-sm-12"
172
- v-if="selectdata.f_apply_type === '散户集体报建' || selectdata.f_apply_type === '煤改气报建'"
173
- >
174
- <label class="col-sm-2 control-label">累计缴费金额:</label>
175
- <div class="col-sm-10">
176
- <input type="text"
177
- class="form-control input_view"
178
- style="width: 100%"
179
- readonly
180
- :value="cumulativePaymentMoney" />
181
- </div>
182
- </div>
183
- <div class="form-group col-sm-12"
184
- v-if="selectdata.f_apply_type === '散户集体报建' || selectdata.f_apply_type === '煤改气报建'"
185
- >
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
- :value="outstandingAmount" />
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_due_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_cumulative_payment_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
- readonly
222
- v-model="selectdata.f_surplus_money" />
223
- </div>
224
- </div>
225
- <div class="form-group col-sm-12">
226
- <label class="col-sm-2 control-label">备注:</label>
227
- <div class="col-sm-10">
228
- <input type="text"
229
- class="form-control input_view"
230
- style="width: 100%"
231
- v-model="charge.f_charge_remarks" />
232
- </div>
233
- </div>
234
- </article>
235
- <footer slot="modal-footer" class="modal-footer">
236
- <button type="button" class="btn btn-primary" @click="saveCharge()">新增收费</button>
237
- </footer>
238
- </modal>
239
-
240
- <modal v-if="showInvalid" :show.sync="showInvalid" v-ref:modal :large="true" :backdrop="false" title="作废收费">
241
- <header slot="modal-header" class="modal-header">
242
- <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
243
- <h4 class="modal-title">作废收费</h4>
244
- </header>
245
- <article slot="modal-body" class="modal-body clearfix">
246
- <div class="form-group col-sm-12" v-if="selectdata.f_apply_type !== '开发商集体报装'">
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_useraddress" />
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_charge_money" />
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_payment_method" />
274
- </div>
275
- </div>
276
- <div class="form-group col-sm-12">
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
- readonly
283
- v-model="charge.f_amount_words" />
284
- </div>
285
- </div>
286
- <div class="form-group col-sm-12">
287
- <label class="col-sm-2 control-label">收费人员:</label>
288
- <div class="col-sm-10">
289
- <input type="text"
290
- class="form-control input_view"
291
- style="width: 100%"
292
- readonly
293
- v-model="charge.f_charge_collectors" />
294
- </div>
295
- </div>
296
- <div class="form-group col-sm-12" :class="charge.f_void_remarks ? '':'has-error'">
297
- <label class="col-sm-2 control-label">作废原因:</label>
298
- <div class="col-sm-10">
299
- <input type="text"
300
- class="form-control input_view"
301
- style="width: 100%"
302
- v-model="charge.f_void_remarks" />
303
- </div>
304
- </div>
305
- </article>
306
- <footer slot="modal-footer" class="modal-footer">
307
- <button type="button" class="btn btn-primary" @click="invalidApplyCharge()">确认作废</button>
308
- </footer>
309
- </modal>
310
-
311
- <modal v-if="showPrint" :show.sync="showPrint" v-ref:modal :large="true" :backdrop="false" title="打印预览">
312
- <header slot="modal-header" class="modal-header">
313
- <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
314
- <h4 class="modal-title">打印预览</h4>
315
- </header>
316
- <article slot="modal-body" class="modal-body clearfix">
317
- <apply-print-charge :selectdata="selectdata" :charge="charge" v-ref:print></apply-print-charge>
318
- </article>
319
- <footer slot="modal-footer" class="modal-footer">
320
- <button type="button" class="btn btn-primary" @click="print()">打印</button>
321
- </footer>
322
- </modal>
323
- </div>
324
- </template>
325
- <script>
326
- import {getNowDate,isEmpty} from '../../../Util'
327
- import {PagedList} from 'vue-client'
328
- import {HttpResetClass} from 'vue-client'
329
-
330
- export default {
331
- title: '收费管理',
332
- props: {
333
- selectdata: {
334
- type: Object
335
- },
336
- mark: {
337
- type: Number,
338
- default: 0
339
- }
340
- },
341
- data () {
342
- return {
343
- showCharge: false,
344
- showInvalid: false,
345
- showPrint: false,
346
- model: {
347
- data: null
348
- },
349
- charge: {
350
-
351
- },
352
- useraddressList: [],
353
- chargeUseraddress: null
354
- }
355
- },
356
- ready () {
357
- this.search()
358
- },
359
- methods: {
360
- print () {
361
- this.$refs.print.$refs.print.PrintTable()
362
- },
363
- showPrintModal(row) {
364
- this.charge = row
365
- this.showPrint = true
366
- },
367
- changeUseraddress() {
368
- this.charge.f_useraddress_id = this.chargeUseraddress.f_userinfo_id
369
- },
370
- async invalidApplyCharge() {
371
- if (isEmpty(this.charge.f_void_remarks)) {
372
- this.$showAlert('请输入作废本次收费原因!!!', 'warning', 3000)
373
- return
374
- }
375
-
376
- let http = new HttpResetClass()
377
- let data = {
378
- apply: this.selectdata,
379
- user: this.$login.f,
380
- charge: this.charge
381
- }
382
- try {
383
- let res = await http.load('POST', 'rs/logic/invalidApplyCharge', {data:data}, {
384
- resolveMsg: null,
385
- rejectMsg: null
386
- })
387
- this.selectdata = res.data
388
- } catch (e) {
389
- this.$showAlert(e.data, 'danger', 3000)
390
- }
391
-
392
-
393
- this.$dispatch('breakControl', this.selectdata)
394
- },
395
- showInvalidModal(row) {
396
- this.charge = row
397
- this.showInvalid = true
398
- },
399
- handleInput(e) {
400
- // 通过正则过滤小数点后两位
401
- e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
402
- this.charge.f_amount_words = this.smalltoBIG(e.target.value)
403
- },
404
- async saveCharge() {
405
- if (isEmpty(this.charge.f_useraddress_id) && this.selectdata.f_apply_type == '报装') {
406
- this.$showAlert('请选择缴费的地址信息!!!', 'warning', 3000)
407
- return
408
- }
409
- if (Number(this.charge.f_charge_money) === 0 || isEmpty(this.charge.f_charge_money)) {
410
- this.$showAlert('单笔收费不能为0元!!!', 'warning', 3000)
411
- return
412
- }
413
- if ((Number(this.charge.f_charge_money) > Number(this.selectdata.f_surplus_money)) && this.selectdata.f_apply_type === '开发商集体报装') {
414
- this.$showAlert('单笔收费不能超过未交总金额!!!', 'warning', 3000)
415
- return
416
- }
417
- if (this.selectdata.f_apply_type === '散户集体报装' || this.selectdata.f_apply_type === '煤改气报装') {
418
- // if (Number(this.charge.f_charge_money) > Number(this.selectdata.f_price)) {
419
- // this.$showAlert('单笔收费不能超过单价!!!', 'warning', 3000)
420
- // return
421
- // }
422
- // if (Number(this.charge.f_charge_money) > Number(this.outstandingAmount)) {
423
- // this.$showAlert('单笔收费不能超过当前用户未结金额!!!', 'warning', 3000)
424
- // return
425
- // }
426
- }
427
- if (isEmpty(this.charge.f_payment_method)) {
428
- this.$showAlert('请选择付款方式!!!', 'warning', 3000)
429
- return
430
- }
431
- let http = new HttpResetClass()
432
- let data = {
433
- apply: this.selectdata,
434
- user: this.$login.f,
435
- charge: this.charge
436
- }
437
- try {
438
- let res = await http.load('POST', 'rs/logic/addApplyChargeRecord', {data:data}, {
439
- resolveMsg: null,
440
- rejectMsg: null
441
- })
442
- this.selectdata = res.data
443
- } catch (e) {
444
- this.$showAlert(e.data, 'danger', 3000)
445
- }
446
-
447
-
448
- this.$dispatch('breakControl', this.selectdata)
449
- },
450
- // 金额转大写
451
- smalltoBIG(n) {
452
- let fraction = ['角', '分'];
453
- let digit = ['', '', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
454
- let unit = [['', '', '亿'], ['', '', '', '']];
455
- let head = n < 0 ? '' : '';
456
- n = Math.abs(n);
457
-
458
- let s = '';
459
-
460
- for (var i = 0; i < fraction.length; i++) {
461
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
462
- }
463
- s = s || '整';
464
- n = Math.floor(n);
465
-
466
- for (var i = 0; i < unit[0].length && n > 0; i++) {
467
- let p = '';
468
- for (var j = 0; j < unit[1].length && n > 0; j++) {
469
- p = digit[n % 10] + unit[1][j] + p;
470
- n = Math.floor(n / 10);
471
- }
472
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
473
- }
474
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
475
- },
476
- async getUserAddress() {
477
- let http = new HttpResetClass()
478
- let data = {
479
- condition: '1=1',
480
- f_process_id: this.selectdata.f_process_id
481
- }
482
- let res = await http.load('POST', 'rs/sql/getAddresAndCumulativePayment', {data:data}, {
483
- resolveMsg: null,
484
- rejectMsg: null
485
- })
486
-
487
- this.useraddressList = res.data
488
- if (this.selectdata.f_apply_type === '散户集体报建' || this.selectdata.f_apply_type === '煤改气报建') {
489
- // 去除累计缴费金额大于等于单价的用户地址
490
- this.useraddressList = res.data.filter(item => {
491
- let f_cumulative_payment_money = isEmpty(item.f_cumulative_payment_money) ? 0 : item.f_cumulative_payment_money
492
- return Number(f_cumulative_payment_money) < Number(isEmpty(this.selectdata.f_price) ? 0 : this.selectdata.f_price)
493
- })
494
- }
495
-
496
- if (this.useraddressList.length > 0) {
497
- this.useraddressList = this.useraddressList.map(item => {
498
- return {
499
- // 有用户姓名地址后拼接姓名
500
- label: `${item.f_address} ${isEmpty(item.f_user_name) ? '' : '--- ' + item.f_user_name}`,
501
- value: item
502
- }
503
- })
504
- }
505
-
506
- },
507
- async showChargeModal() {
508
- this.getUserAddress()
509
-
510
- this.showCharge = true
511
- },
512
- async search () {
513
- let http = new HttpResetClass()
514
- let data = {
515
- f_process_id: this.selectdata.f_process_id
516
- }
517
- let res = await http.load('POST', 'rs/sql/getApplyChargeRecord', {data:data}, {
518
- resolveMsg: null,
519
- rejectMsg: null
520
- })
521
- this.model.data = res.data
522
- },
523
- // 关闭对话框
524
- closeModal() {
525
- this.showCharge = false
526
- this.showInvalid = false
527
- this.showPrint = false
528
- this.charge = {}
529
- this.chargeUseraddress = null
530
- this.search()
531
- }
532
- },
533
- events: {
534
- },
535
- computed: {
536
- paymentMethod() {
537
- return this.$appdata.getParam("付款方式")
538
- },
539
- cumulativePaymentMoney() {
540
- return isEmpty(this.chargeUseraddress.f_cumulative_payment_money) ? 0 : this.chargeUseraddress.f_cumulative_payment_money
541
- },
542
- outstandingAmount() {
543
- return this.selectdata.f_price - this.cumulativePaymentMoney
544
- }
545
- },
546
- watch: {
547
- }
548
- }
549
- </script>
550
- <style scoped>
551
- .textNoLineBreak {
552
- white-space: nowrap;
553
- }
554
- .head-but{
555
- margin-left: 5px;
556
- height: 34px;
557
- /*background-color: #6aa6e2;*/
558
- border-radius: 4px;
559
- font-family: PingFang;
560
- color: #ffffff;
561
- }
562
- </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">缴费单位</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
+ :disabled="$parent.$parent.mark === 1 || ($parent.$parent.selectdata.f_cumulative_payment_money >= $parent.$parent.selectdata.f_due_money || $parent.$parent.selectdata.f_surplus_money === 0)"
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;">
35
+ <nobr>{{row.f_payer}}</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_charge_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_payer ? '':'has-error'">
114
+ <label class="col-sm-2 control-label">缴费单位:</label>
115
+ <div class="col-sm-10">
116
+ <input type="text"
117
+ class="form-control input_view"
118
+ style="width: 100%"
119
+ placeholder="请输入"
120
+ :value="selectdata.f_entry_name"
121
+ v-model="charge.f_payer" />
122
+ </div>
123
+ </div>
124
+ <div class="form-group col-sm-12" :class="charge.f_charge_money ? '':'has-error'">
125
+ <label class="col-sm-2 control-label">收费金额:</label>
126
+ <div class="col-sm-10">
127
+ <input type="input"
128
+ class="form-control input_view"
129
+ style="width: 100%"
130
+ placeholder="0.00"
131
+ @keyup="handleInput"
132
+ v-model="charge.f_charge_money" />
133
+ </div>
134
+ </div>
135
+ <div class="form-group col-sm-12" :class="charge.f_payment_method ? '':'has-error'">
136
+ <label class="col-sm-2 control-label">付款方式:</label>
137
+ <div class="col-sm-10">
138
+ <input-select
139
+ v-model="charge.f_payment_method"
140
+ placeholder='请选择'
141
+ :value.sync="charge.f_payment_method"
142
+ :options='paymentMethod'
143
+ class="select select_list"
144
+ :value-single="true"
145
+ width="100%"
146
+ close-on-select ></input-select>
147
+ </div>
148
+ </div>
149
+ <div class="form-group col-sm-12">
150
+ <label class="col-sm-2 control-label">金额大写:</label>
151
+ <div class="col-sm-10">
152
+ <input type="text"
153
+ class="form-control input_view"
154
+ style="width: 100%"
155
+ :value="smalltoBIG(0)"
156
+ readonly
157
+ v-model.sync="charge.f_amount_words" />
158
+ </div>
159
+ </div>
160
+ <div class="form-group col-sm-12"
161
+ v-if="selectdata.f_apply_type === '散户集体报建' || 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
+ v-model="selectdata.f_price" />
170
+ </div>
171
+ </div>
172
+ <div class="form-group col-sm-12"
173
+ v-if="selectdata.f_apply_type === '散户集体报建' || 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="cumulativePaymentMoney" />
182
+ </div>
183
+ </div>
184
+ <div class="form-group col-sm-12"
185
+ v-if="selectdata.f_apply_type === '散户集体报建' || selectdata.f_apply_type === '煤改气报建'"
186
+ >
187
+ <label class="col-sm-2 control-label">未结金额:</label>
188
+ <div class="col-sm-10">
189
+ <input type="text"
190
+ class="form-control input_view"
191
+ style="width: 100%"
192
+ readonly
193
+ :value="outstandingAmount" />
194
+ </div>
195
+ </div>
196
+ <div class="form-group col-sm-12">
197
+ <label class="col-sm-2 control-label">应交总金额:</label>
198
+ <div class="col-sm-10">
199
+ <input type="text"
200
+ class="form-control input_view"
201
+ style="width: 100%"
202
+ readonly
203
+ v-model="selectdata.f_due_money" />
204
+ </div>
205
+ </div>
206
+ <div class="form-group col-sm-12">
207
+ <label class="col-sm-2 control-label">累计缴费总金额:</label>
208
+ <div class="col-sm-10">
209
+ <input type="text"
210
+ class="form-control input_view"
211
+ style="width: 100%"
212
+ readonly
213
+ v-model="selectdata.f_cumulative_payment_money" />
214
+ </div>
215
+ </div>
216
+ <div class="form-group col-sm-12">
217
+ <label class="col-sm-2 control-label">未结总金额:</label>
218
+ <div class="col-sm-10">
219
+ <input type="text"
220
+ class="form-control input_view"
221
+ style="width: 100%"
222
+ readonly
223
+ v-model="selectdata.f_surplus_money" />
224
+ </div>
225
+ </div>
226
+ <div class="form-group col-sm-12">
227
+ <label class="col-sm-2 control-label">备注:</label>
228
+ <div class="col-sm-10">
229
+ <input type="text"
230
+ class="form-control input_view"
231
+ style="width: 100%"
232
+ v-model="charge.f_charge_remarks" />
233
+ </div>
234
+ </div>
235
+ </article>
236
+ <footer slot="modal-footer" class="modal-footer">
237
+ <button type="button" class="btn btn-primary" @click="saveCharge()">新增收费</button>
238
+ </footer>
239
+ </modal>
240
+
241
+ <modal v-if="showInvalid" :show.sync="showInvalid" v-ref:modal :large="true" :backdrop="false" title="作废收费">
242
+ <header slot="modal-header" class="modal-header">
243
+ <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
244
+ <h4 class="modal-title">作废收费</h4>
245
+ </header>
246
+ <article slot="modal-body" class="modal-body clearfix">
247
+ <div class="form-group col-sm-12" v-if="selectdata.f_apply_type !== '开发商集体报装'">
248
+ <label class="col-sm-2 control-label">缴费地址:</label>
249
+ <div class="col-sm-10">
250
+ <input type="text"
251
+ class="form-control input_view"
252
+ style="width: 100%"
253
+ readonly
254
+ v-model="charge.f_useraddress" />
255
+ </div>
256
+ </div>
257
+ <div class="form-group col-sm-12">
258
+ <label class="col-sm-2 control-label">收费金额:</label>
259
+ <div class="col-sm-10">
260
+ <input type="text"
261
+ class="form-control input_view"
262
+ style="width: 100%"
263
+ readonly
264
+ v-model="charge.f_charge_money" />
265
+ </div>
266
+ </div>
267
+ <div class="form-group col-sm-12">
268
+ <label class="col-sm-2 control-label">付款方式:</label>
269
+ <div class="col-sm-10">
270
+ <input type="text"
271
+ class="form-control input_view"
272
+ style="width: 100%"
273
+ readonly
274
+ v-model="charge.f_payment_method" />
275
+ </div>
276
+ </div>
277
+ <div class="form-group col-sm-12">
278
+ <label class="col-sm-2 control-label">金额大写:</label>
279
+ <div class="col-sm-10">
280
+ <input type="text"
281
+ class="form-control input_view"
282
+ style="width: 100%"
283
+ readonly
284
+ v-model="charge.f_amount_words" />
285
+ </div>
286
+ </div>
287
+ <div class="form-group col-sm-12">
288
+ <label class="col-sm-2 control-label">收费人员:</label>
289
+ <div class="col-sm-10">
290
+ <input type="text"
291
+ class="form-control input_view"
292
+ style="width: 100%"
293
+ readonly
294
+ v-model="charge.f_charge_collectors" />
295
+ </div>
296
+ </div>
297
+ <div class="form-group col-sm-12" :class="charge.f_void_remarks ? '':'has-error'">
298
+ <label class="col-sm-2 control-label">作废原因:</label>
299
+ <div class="col-sm-10">
300
+ <input type="text"
301
+ class="form-control input_view"
302
+ style="width: 100%"
303
+ v-model="charge.f_void_remarks" />
304
+ </div>
305
+ </div>
306
+ </article>
307
+ <footer slot="modal-footer" class="modal-footer">
308
+ <button type="button" class="btn btn-primary" @click="invalidApplyCharge()">确认作废</button>
309
+ </footer>
310
+ </modal>
311
+
312
+ <modal v-if="showPrint" :show.sync="showPrint" v-ref:modal :large="true" :backdrop="false" title="打印预览">
313
+ <header slot="modal-header" class="modal-header">
314
+ <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
315
+ <h4 class="modal-title">打印预览</h4>
316
+ </header>
317
+ <article slot="modal-body" class="modal-body clearfix">
318
+ <apply-print-charge :selectdata="selectdata" :charge="charge" v-ref:print></apply-print-charge>
319
+ </article>
320
+ <footer slot="modal-footer" class="modal-footer">
321
+ <button type="button" class="btn btn-primary" @click="print()">打印</button>
322
+ </footer>
323
+ </modal>
324
+ </div>
325
+ </template>
326
+ <script>
327
+ import {getNowDate,isEmpty} from '../../../Util'
328
+ import {PagedList} from 'vue-client'
329
+ import {HttpResetClass} from 'vue-client'
330
+
331
+ export default {
332
+ title: '收费管理',
333
+ props: {
334
+ selectdata: {
335
+ type: Object
336
+ },
337
+ mark: {
338
+ type: Number,
339
+ default: 0
340
+ }
341
+ },
342
+ data () {
343
+ return {
344
+ showCharge: false,
345
+ showInvalid: false,
346
+ showPrint: false,
347
+ model: {
348
+ data: null
349
+ },
350
+ charge: {
351
+
352
+ },
353
+ useraddressList: [],
354
+ chargeUseraddress: null
355
+ }
356
+ },
357
+ ready () {
358
+ this.search()
359
+ },
360
+ methods: {
361
+ print () {
362
+ this.$refs.print.$refs.print.PrintTable()
363
+ },
364
+ showPrintModal(row) {
365
+ this.charge = row
366
+ this.showPrint = true
367
+ },
368
+ changeUseraddress() {
369
+ this.charge.f_useraddress_id = this.chargeUseraddress.f_userinfo_id
370
+ },
371
+ async invalidApplyCharge() {
372
+ if (isEmpty(this.charge.f_void_remarks)) {
373
+ this.$showAlert('请输入作废本次收费原因!!!', 'warning', 3000)
374
+ return
375
+ }
376
+
377
+ let http = new HttpResetClass()
378
+ let data = {
379
+ apply: this.selectdata,
380
+ user: this.$login.f,
381
+ charge: this.charge
382
+ }
383
+ try {
384
+ let res = await http.load('POST', 'rs/logic/invalidApplyCharge', {data:data}, {
385
+ resolveMsg: null,
386
+ rejectMsg: null
387
+ })
388
+ this.selectdata = res.data
389
+ } catch (e) {
390
+ this.$showAlert(e.data, 'danger', 3000)
391
+ }
392
+
393
+
394
+ this.$dispatch('breakControl', this.selectdata)
395
+ },
396
+ showInvalidModal(row) {
397
+ this.charge = row
398
+ this.showInvalid = true
399
+ },
400
+ handleInput(e) {
401
+ // 通过正则过滤小数点后两位
402
+ e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
403
+ this.charge.f_amount_words = this.smalltoBIG(e.target.value)
404
+ },
405
+ async saveCharge() {
406
+ if (isEmpty(this.charge.f_useraddress_id) && this.selectdata.f_apply_type == '报装') {
407
+ this.$showAlert('请选择缴费的地址信息!!!', 'warning', 3000)
408
+ return
409
+ }
410
+ if (Number(this.charge.f_charge_money) === 0 || isEmpty(this.charge.f_charge_money)) {
411
+ this.$showAlert('单笔收费不能为0元!!!', 'warning', 3000)
412
+ return
413
+ }
414
+ if ((Number(this.charge.f_charge_money) > Number(this.selectdata.f_surplus_money)) && this.selectdata.f_apply_type === '开发商集体报装') {
415
+ this.$showAlert('单笔收费不能超过未交总金额!!!', 'warning', 3000)
416
+ return
417
+ }
418
+ if (this.selectdata.f_apply_type === '散户集体报装' || this.selectdata.f_apply_type === '煤改气报装') {
419
+ // if (Number(this.charge.f_charge_money) > Number(this.selectdata.f_price)) {
420
+ // this.$showAlert('单笔收费不能超过单价!!!', 'warning', 3000)
421
+ // return
422
+ // }
423
+ // if (Number(this.charge.f_charge_money) > Number(this.outstandingAmount)) {
424
+ // this.$showAlert('单笔收费不能超过当前用户未结金额!!!', 'warning', 3000)
425
+ // return
426
+ // }
427
+ }
428
+ if (isEmpty(this.charge.f_payment_method)) {
429
+ this.$showAlert('请选择付款方式!!!', 'warning', 3000)
430
+ return
431
+ }
432
+ let http = new HttpResetClass()
433
+ let data = {
434
+ apply: this.selectdata,
435
+ user: this.$login.f,
436
+ charge: this.charge
437
+ }
438
+ try {
439
+ let res = await http.load('POST', 'rs/logic/addApplyChargeRecord', {data:data}, {
440
+ resolveMsg: null,
441
+ rejectMsg: null
442
+ })
443
+ this.selectdata = res.data
444
+ } catch (e) {
445
+ this.$showAlert(e.data, 'danger', 3000)
446
+ }
447
+
448
+
449
+ this.$dispatch('breakControl', this.selectdata)
450
+ },
451
+ // 金额转大写
452
+ smalltoBIG(n) {
453
+ let fraction = ['', ''];
454
+ let digit = ['', '', '', '', '', '', '', '柒', '捌', '玖'];
455
+ let unit = [['元', '万', '亿'], ['', '', '佰', '']];
456
+ let head = n < 0 ? '欠' : '';
457
+ n = Math.abs(n);
458
+
459
+ let s = '';
460
+
461
+ for (var i = 0; i < fraction.length; i++) {
462
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
463
+ }
464
+ s = s || '整';
465
+ n = Math.floor(n);
466
+
467
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
468
+ let p = '';
469
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
470
+ p = digit[n % 10] + unit[1][j] + p;
471
+ n = Math.floor(n / 10);
472
+ }
473
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
474
+ }
475
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
476
+ },
477
+ async getUserAddress() {
478
+ let http = new HttpResetClass()
479
+ let data = {
480
+ condition: '1=1',
481
+ f_process_id: this.selectdata.f_process_id
482
+ }
483
+ let res = await http.load('POST', 'rs/sql/getAddresAndCumulativePayment', {data:data}, {
484
+ resolveMsg: null,
485
+ rejectMsg: null
486
+ })
487
+
488
+ this.useraddressList = res.data
489
+ if (this.selectdata.f_apply_type === '散户集体报建' || this.selectdata.f_apply_type === '煤改气报建') {
490
+ // 去除累计缴费金额大于等于单价的用户地址
491
+ this.useraddressList = res.data.filter(item => {
492
+ let f_cumulative_payment_money = isEmpty(item.f_cumulative_payment_money) ? 0 : item.f_cumulative_payment_money
493
+ return Number(f_cumulative_payment_money) < Number(isEmpty(this.selectdata.f_price) ? 0 : this.selectdata.f_price)
494
+ })
495
+ }
496
+
497
+ if (this.useraddressList.length > 0) {
498
+ this.useraddressList = this.useraddressList.map(item => {
499
+ return {
500
+ // 有用户姓名地址后拼接姓名
501
+ label: `${item.f_address} ${isEmpty(item.f_user_name) ? '' : '--- ' + item.f_user_name}`,
502
+ value: item
503
+ }
504
+ })
505
+ }
506
+
507
+ },
508
+ async showChargeModal() {
509
+ this.getUserAddress()
510
+
511
+ this.showCharge = true
512
+ },
513
+ async search () {
514
+ let http = new HttpResetClass()
515
+ let data = {
516
+ f_process_id: this.selectdata.f_process_id
517
+ }
518
+ let res = await http.load('POST', 'rs/sql/getApplyChargeRecord', {data:data}, {
519
+ resolveMsg: null,
520
+ rejectMsg: null
521
+ })
522
+ this.model.data = res.data
523
+ },
524
+ // 关闭对话框
525
+ closeModal() {
526
+ this.showCharge = false
527
+ this.showInvalid = false
528
+ this.showPrint = false
529
+ this.charge = {}
530
+ this.chargeUseraddress = null
531
+ this.search()
532
+ }
533
+ },
534
+ events: {
535
+ },
536
+ computed: {
537
+ paymentMethod() {
538
+ return this.$appdata.getParam("付款方式")
539
+ },
540
+ cumulativePaymentMoney() {
541
+ return isEmpty(this.chargeUseraddress.f_cumulative_payment_money) ? 0 : this.chargeUseraddress.f_cumulative_payment_money
542
+ },
543
+ outstandingAmount() {
544
+ return this.selectdata.f_price - this.cumulativePaymentMoney
545
+ }
546
+ },
547
+ watch: {
548
+ }
549
+ }
550
+ </script>
551
+ <style scoped>
552
+ .textNoLineBreak {
553
+ white-space: nowrap;
554
+ }
555
+ .head-but{
556
+ margin-left: 5px;
557
+ height: 34px;
558
+ /*background-color: #6aa6e2;*/
559
+ border-radius: 4px;
560
+ font-family: PingFang;
561
+ color: #ffffff;
562
+ }
563
+ </style>