apply-clients 7.1.36-yuchuan-61 → 7.1.36-yuchuan-63

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,714 +1,716 @@
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_charge_money}}</nobr>
36
- </td>
37
- <td style="text-align: center;">
38
- <nobr>{{row.f_amount_words}}</nobr>
39
- </td>
40
- <td style="text-align: center;">
41
- <nobr>{{row.f_payment_method}}</nobr>
42
- </td>
43
- <td style="text-align: center;">
44
- <nobr>{{row.f_charge_collectors}}</nobr>
45
- </td>
46
- <td style="text-align: center;">
47
- <nobr>{{row.f_charge_date}}</nobr>
48
- </td>
49
- <td style="text-align: center;">
50
- <nobr>{{row.f_charge_remarks}}</nobr>
51
- </td>
52
- <td style="text-align: center;">
53
- <nobr>{{row.f_charge_status}}</nobr>
54
- </td>
55
- <td style="text-align: center;">
56
- <nobr>{{row.f_void_staff}}</nobr>
57
- </td>
58
- <td style="text-align: center;">
59
- <nobr>{{row.f_void_date}}</nobr>
60
- </td>
61
- <td style="text-align: center;">
62
- <nobr>{{row.f_void_remarks}}</nobr>
63
- </td>
64
- <td style="text-align: center;">
65
- <nobr>{{row.f_bill_style}}</nobr>
66
- </td>
67
- <td style="text-align: center;">
68
- <nobr>{{row.f_bill_state}}</nobr>
69
- </td>
70
- <td style="text-align: center;">
71
- <nobr v-if="row.f_charge_status !== '退款'">
72
- <button
73
- type="button"
74
- name="button"
75
- class="btn btn-link"
76
- v-if = false
77
- :disabled="$parent.$parent.mark === 1 || row.f_charge_status === '作废'"
78
- @click="$parent.$parent.showInvalidModal(row)"
79
- >作废</button>
80
-
81
- <button
82
- type="button" name="button" class="btn btn-link"
83
- v-if="row.f_bill_state !== '开票成功' && row.f_charge_status !== '作废'"
84
- @click="$parent.$parent.openBill(row)"
85
- >开票</button>
86
-
87
- <button
88
- type="button" name="button" class="btn btn-link"
89
- v-if = "row.f_bill_state === '开票成功'"
90
- @click="$parent.$parent.showPrintModal(row)"
91
- >查看发票</button>
92
- </nobr>
93
- </td>
94
- </tr>
95
- </template>
96
- </data-grid>
97
-
98
- <validator name="v">
99
- <modal v-if="showCharge" :show.sync="showCharge" v-ref:modal :large="true" :backdrop="false" title="收费明细">
100
- <header slot="modal-header" class="modal-header">
101
- <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
102
- <h4 class="modal-title">收费明细</h4>
103
- </header>
104
- <article slot="modal-body" class="modal-body clearfix">
105
- <div class="form-group col-sm-6" :class="[$v.f_charge_money.required ? 'has-error' : '']">
106
- <label class="col-sm-4 control-label">收费金额:</label>
107
- <div class="col-sm-8">
108
- <input type="text"
109
- class="form-control input_view"
110
- style="width: 100%"
111
- placeholder="0.00"
112
- @keyup="handleInput"
113
- @change="moneyChange"
114
- :readonly="selectdata.f_apply_type == '民用报建'"
115
- v-validate:f_charge_money = "['required']"
116
- v-model="charge.f_charge_money" />
117
- </div>
118
- </div>
119
- <div class="form-group col-sm-6" :class="[$v.f_feecount.required ? 'has-error' : '']">
120
- <label class="col-sm-4 control-label">缴费户数:</label>
121
- <div class="col-sm-8">
122
- <input type="text"
123
- class="form-control input_view"
124
- style="width: 100%"
125
- v-validate:f_feecount = "['required']"
126
- v-model="charge.f_feecount"
127
- @blur="feecountchange"
128
- :value="selectdata.f_install_count"
129
- />
130
- </div>
131
- </div>
132
- <div class="form-group col-sm-6">
133
- <label class="col-sm-4 control-label">金额大写:</label>
134
- <div class="col-sm-8">
135
- <input type="text" class="form-control input_view" style="width: 100%" readonly
136
- v-model.sync="charge.f_amount_words"/>
137
- </div>
138
- </div>
139
- <div class="form-group col-sm-6" :class="[$v.f_payment_method.required ? 'has-error' : '']">
140
- <label class="col-sm-4 control-label">付款方式:</label>
141
- <div class="col-sm-8">
142
- <input type="text" v-show="false" v-model="charge.f_payment_method" v-validate:f_payment_method = "['required']" >
143
- <input-select
144
- placeholder='请选择' width="100%"
145
- v-model="charge.f_payment_method"
146
- :value.sync="charge.f_payment_method"
147
- :options='paymentMethod'
148
- class="select select_list"
149
- :value-single="true"
150
- close-on-select ></input-select>
151
- </div>
152
- </div>
153
- <div class="form-group col-sm-6" :class="[$v.f_bill_style.required ? 'has-error' : '']">
154
- <label class="col-sm-4 control-label">票据类型:</label>
155
- <div class="col-sm-8">
156
- <input type="text" v-show="false" v-model="charge.f_bill_style" :value.sync="selectdata.f_paper_type" v-validate:f_bill_style = "['required']" >
157
- <input-select
158
- placeholder='请选择' width="100%"
159
- v-model="charge.f_bill_style"
160
- :value.sync="selectdata.f_paper_type"
161
- :options='billStyleList'
162
- class="select select_list"
163
- :value-single="true"
164
- close-on-select ></input-select>
165
- </div>
166
- </div>
167
- <div class="form-group col-sm-6">
168
- <label class="col-sm-4 control-label">应交总金额:</label>
169
- <div class="col-sm-8">
170
- <input type="text" class="form-control input_view" style="width: 100%" readonly
171
- v-model="selectdata.f_due_money" />
172
- </div>
173
- </div>
174
- <div class="form-group col-sm-6">
175
- <label class="col-sm-4 control-label">未结总金额:</label>
176
- <div class="col-sm-8">
177
- <input type="text" class="form-control input_view" style="width: 100%" readonly
178
- v-model="selectdata.f_surplus_money" />
179
- </div>
180
- </div>
181
- <div class="form-group col-sm-6">
182
- <label class="col-sm-4 control-label">累计缴费总金额:</label>
183
- <div class="col-sm-8">
184
- <input type="text" class="form-control input_view" style="width: 100%" readonly
185
- v-model="selectdata.f_cumulative_payment_money" />
186
- </div>
187
- </div>
188
- <div class="form-group col-sm-12">
189
- <label class="col-sm-2 control-label">备注:</label>
190
- <div class="col-sm-10">
191
- <input type="text" class="form-control input_view" style="width: 100%"
192
- v-model="charge.f_charge_remarks" />
193
- </div>
194
- </div>
195
- <div class="form-group col-sm-6">
196
- <label class="col-sm-4 control-label">购货单位识别号:</label>
197
- <div class="col-sm-8">
198
- <input type="text" class="form-control input_view" style="width: 100%"
199
- v-model="charge.f_taxpayer_id" :value="selectdata.f_taxpayer_id" />
200
- </div>
201
- </div>
202
- <div class="form-group col-sm-6" :class="[$v.f_paper_name.required ? 'has-error' : '']">
203
- <label class="col-sm-4 control-label">购货单位名称:</label>
204
- <div class="col-sm-8">
205
- <input type="text" class="form-control input_view" style="width: 100%"
206
- v-validate:f_paper_name = "['required']"
207
- v-model="charge.f_paper_name" :value="selectdata.f_paper_name" />
208
- </div>
209
- </div>
210
- <div class="form-group col-sm-6">
211
- <label class="col-sm-4 control-label">购货单位银行账号:</label>
212
- <div class="col-sm-8">
213
- <input type="text" class="form-control input_view" style="width: 100%"
214
- v-model="charge.f_paper_account" :value="selectdata.f_paper_account" />
215
- </div>
216
- </div>
217
- <div class="form-group col-sm-6">
218
- <label class="col-sm-4 control-label">购货单位地址电话:</label>
219
- <div class="col-sm-8">
220
- <input type="text" class="form-control input_view" style="width: 100%"
221
- v-model="charge.f_address_phone" :value="selectdata.f_address_phone" />
222
- </div>
223
- </div>
224
- <div class="form-group col-sm-12">
225
- <label class="col-sm-2 control-label">发票备注:</label>
226
- <div class="col-sm-10">
227
- <input type="text" class="form-control input_view" style="width: 100%"
228
- v-model="charge.f_bill_remarks" :value="selectdata.f_paper_remarks"/>
229
- </div>
230
- </div>
231
- </article>
232
- <footer slot="modal-footer" class="modal-footer">
233
- <button type="button" class="btn btn-primary" :disabled='!$v.valid' @click="saveCharge()">新增收费</button>
234
- </footer>
235
- </modal>
236
- </validator>
237
-
238
- <modal v-if="showInvalid" :show.sync="showInvalid" v-ref:modal :backdrop="false" title="作废收费">
239
- <header slot="modal-header" class="modal-header">
240
- <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
241
- <h4 class="modal-title">作废收费</h4>
242
- </header>
243
- <article slot="modal-body" class="modal-body clearfix">
244
- <div class="form-group col-sm-12" v-if="false">
245
- <label class="col-sm-2 control-label">缴费地址:</label>
246
- <div class="col-sm-10">
247
- <input type="text"
248
- class="form-control input_view"
249
- style="width: 100%"
250
- readonly
251
- v-model="charge.f_useraddres" />
252
- </div>
253
- </div>
254
- <div class="form-group col-sm-12">
255
- <label class="col-sm-2 control-label">收费金额:</label>
256
- <div class="col-sm-10">
257
- <input type="text"
258
- class="form-control input_view"
259
- style="width: 100%"
260
- readonly
261
- v-model="charge.f_charge_money" />
262
- </div>
263
- </div>
264
- <div class="form-group col-sm-12">
265
- <label class="col-sm-2 control-label">付款方式:</label>
266
- <div class="col-sm-10">
267
- <input type="text"
268
- class="form-control input_view"
269
- style="width: 100%"
270
- readonly
271
- v-model="charge.f_payment_method" />
272
- </div>
273
- </div>
274
- <div class="form-group col-sm-12">
275
- <label class="col-sm-2 control-label">金额大写:</label>
276
- <div class="col-sm-10">
277
- <input type="text"
278
- class="form-control input_view"
279
- style="width: 100%"
280
- readonly
281
- v-model="charge.f_amount_words" />
282
- </div>
283
- </div>
284
- <div class="form-group col-sm-12">
285
- <label class="col-sm-2 control-label">收费人员:</label>
286
- <div class="col-sm-10">
287
- <input type="text"
288
- class="form-control input_view"
289
- style="width: 100%"
290
- readonly
291
- v-model="charge.f_charge_collectors" />
292
- </div>
293
- </div>
294
- <div class="form-group col-sm-12" :class="charge.f_void_remarks ? '':'has-error'">
295
- <label class="col-sm-2 control-label">作废原因:</label>
296
- <div class="col-sm-10">
297
- <input type="text"
298
- class="form-control input_view"
299
- style="width: 100%"
300
- v-model="charge.f_void_remarks" />
301
- </div>
302
- </div>
303
- </article>
304
- <footer slot="modal-footer" class="modal-footer">
305
- <button type="button" class="btn btn-primary" :disabled="!charge.f_void_remarks" @click="invalidApplyCharge()">确认作废</button>
306
- </footer>
307
- </modal>
308
-
309
- <modal v-if="showPrint" :show.sync="showPrint" v-ref:modal :large="true" :backdrop="false">
310
- <header slot="modal-header" class="modal-header">
311
- <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
312
- <h4 class="modal-title">票据信息</h4>
313
- </header>
314
- <article slot="modal-body" class="modal-body clearfix">
315
- <iframe width="100%" height="500px" :src="charge.f_bill_link" v-if="charge.f_bill_link"></iframe>
316
- </article>
317
- <footer slot="modal-footer" class="modal-footer">
318
- </footer>
319
- </modal>
320
- </div>
321
- </template>
322
- <script>
323
- import {PagedList} from 'vue-client'
324
- import {HttpResetClass} from 'vue-client'
325
- import Vue from 'vue'
326
- import {isEmpty} from '../../../Util'
327
-
328
- export default {
329
- title: '收费管理',
330
- props: {
331
- selectdata: {
332
- type: Object
333
- },
334
- mark: {
335
- type: Number,
336
- default: 0
337
- }
338
- },
339
- data () {
340
- return {
341
- showCharge: false, // 收费明细
342
- showInvalid: false, // 作废
343
- showPrint: false, // 打印
344
- model: {
345
- data: null
346
- }, // 记录
347
- charge: {
348
- f_amount_words:'',
349
- f_charge_money:''
350
- }
351
- }
352
- },
353
- ready () {
354
- this.search()
355
- },
356
- methods: {
357
-
358
- async invalidApplyCharge() {
359
-
360
- let http = new HttpResetClass()
361
- let data = {
362
- apply: this.selectdata,
363
- user: this.$login.f,
364
- charge: this.charge
365
- }
366
- let res = await http.load('POST', 'rs/logic/invalidApplyCharge', {data:data}, {
367
- resolveMsg: null,
368
- rejectMsg: '作废失败!!!'
369
- })
370
- this.selectdata = res.data
371
- this.showInvalid=false
372
- this.charge = {}
373
- this.$dispatch('breakControl', this.selectdata)
374
- },
375
- // 打开作废收费
376
- showInvalidModal(row) {
377
- this.charge = row
378
- this.showInvalid = true
379
- },
380
- // 查看发票
381
- showPrintModal(row, type) {
382
- this.charge = row
383
- if (!this.charge.f_bill_link && this.charge.f_filepath){
384
- let date = new Date(this.charge.f_charge_date)
385
- let year = date.getFullYear()
386
- let month = date.getMonth() + 1
387
- let month2 = month <= 9 ? '0' + month : month
388
- let day = date.getDate()
389
- let day2 = day <= 9 ? '0' + day : day
390
- let chargedate = year + '-' + month2 + '-' + day2
391
- this.charge.f_bill_link = `http://193.168.1.6:8082/eticket/` + chargedate + '/' + this.charge.f_filepath + '.pdf'
392
- }else if(!this.charge.f_bill_link){
393
- this.charge.f_bill_link = this.charge.f_bill_url
394
- }
395
- this.showPrint = true
396
- },
397
- // 开票组织数据
398
- async openBill (charge) {
399
- this.charge = charge
400
- let data = null
401
- let res = null
402
-
403
- let http = new HttpResetClass()
404
-
405
- if (isEmpty(this.charge.f_bill_id)) {
406
- try {
407
- data = {
408
- id: this.charge.id,
409
- charge_type: '报装收费',
410
- f_user_name: this.selectdata.f_user_name
411
- }
412
- if (this.selectdata.f_apply_type === '改线业务'){
413
- data.charge_type = '整改收费'
414
- }
415
- res = await http.load('POST', 'rs/logic/bjEticketCharge', {data:data}, {
416
- resolveMsg: null,
417
- rejectMsg: '开票组织数据失败!!!'
418
- }).then((res) => {
419
- this.charge.f_bill_id = res.data
420
- this.outBill()
421
- })
422
- }catch (e){
423
- console.error("错误信息",e)
424
- this.charge.f_bill_state = '开票失败'
425
-
426
- data = {
427
- f_bill_id: '',
428
- id: this.charge.id,
429
- apply: this.selectdata,
430
- user: this.$login.f
431
- }
432
- res = await http.load('POST', 'rs/logic/updateChargeBill', {data: data}, {
433
- resolveMsg: null,
434
- rejectMsg: '收费信息更新失败!!!'
435
- })
436
- this.$showMessage(`开票信息组织失败!!`, ['confirm']).then(async (res) => {
437
- if (res === 'confirm') {
438
- this.$dispatch('loadPage')
439
- }else {
440
- this.$dispatch('loadPage')
441
- }
442
- })
443
- }
444
- }else {
445
- await this.outBill()
446
- }
447
- },
448
- //开票
449
- async outBill () {
450
-
451
- let data = null
452
- let res = null
453
- let http = new HttpResetClass()
454
- if (this.charge.f_bill_style === '电子票') {
455
- data = {
456
- id: this.charge.f_bill_id,
457
- f_sell_id: this.charge.id
458
- }
459
- try {
460
- res = await http.load('POST', 'rs/logic/bjOpenEticket', {data: data}, {
461
- resolveMsg: null,
462
- rejectMsg: '开票失败!!!'
463
- })
464
-
465
- // res.data.f_bill_url = 'https://dlj.51fapiao.cn/dlj/v7/de4c9b985021111ef1c722c2914e34d9273291'
466
-
467
- if (res.data.f_bill_state !== '开票成功') {
468
- throw '开票失败!!!'
469
- } else {
470
- this.charge.f_bill_state = res.data.f_bill_state
471
- this.charge.f_bill_url = res.data.f_bill_url
472
- let date = new Date(this.charge.f_charge_date)
473
- let year = date.getFullYear()
474
- let month = date.getMonth() + 1
475
- let month2 = month <= 9 ? '0' + month : month
476
- let day = date.getDate()
477
- let day2 = day <= 9 ? '0' + day : day
478
- let chargedate = year + '-' + month2 + '-' + day2
479
- this.charge.f_bill_link = `http://193.168.1.6:8082/eticket/` + chargedate + '/' + res.data.f_filepath + '.pdf'
480
- this.showPrint = true
481
- let pram = {
482
- f_bill_link: this.charge.f_bill_link,
483
- f_sell_id: this.charge.id,
484
- apply: this.selectdata,
485
- user: this.$login.f
486
- }
487
- await http.load('POST', 'rs/logic/updataChargeRecord', {data: pram}, {
488
- resolveMsg: null,
489
- rejectMsg: null
490
- })
491
- }
492
- } catch (e) {
493
- console.error(e)
494
- this.charge.f_bill_state = '开票失败'
495
-
496
- data = {
497
- f_bill_id: this.charge.f_bill_id,
498
- id: this.charge.id,
499
- apply: this.selectdata,
500
- user: this.$login.f
501
- }
502
- res = await http.load('POST', 'rs/logic/updateChargeBill', {data: data}, {
503
- resolveMsg: null,
504
- rejectMsg: '收费信息更新失败!!!'
505
- })
506
- this.$showMessage(`开票失败!!`, ['confirm']).then(async (res) => {
507
- if (res === 'confirm') {
508
- this.$dispatch('loadPage')
509
- }else {
510
- this.$dispatch('loadPage')
511
- }
512
- })
513
- }
514
- } else if (this.charge.f_bill_style === '专票') {
515
- data = {
516
- id: this.charge.f_bill_id
517
- }
518
- res = await http.load('POST', 'rs/sql/getEticketData', {data: data}, {
519
- resolveMsg: null,
520
- rejectMsg: '开票数据查询失败!!!'
521
- })
522
- let openBillData = JSON.parse(res.data[0].f_bill_data)
523
- openBillData.kpzdbs = this.$login.f.taxnum
524
- const nowDate = new Date()
525
- let year = nowDate.getFullYear()
526
- let mouth = nowDate.getMonth() + 1
527
- let day = nowDate.getDate()
528
- openBillData.f_operate_date = year + '-' + mouth + '-' + day
529
- openBillData.f_operator = this.$login.f.name
530
- openBillData.outlets = this.$login.f.f_department_name
531
- openBillData.hjse = ''
532
- openBillData.jshh = ''
533
- openBillData.tzdbh = ''
534
- openBillData.yfpdm = ''
535
- openBillData.yfphm = ''
536
- console.log('返回开票信息。。 ', openBillData)
537
- let billInfo = await this.$resetpost('http://127.0.0.1:8003/Goldtax', openBillData, {
538
- resolveMsg: null,
539
- rejectMsg: '专用发票开具失败!'
540
- })
541
- console.log('返回票据信息。。 ', JSON.parse(billInfo.data))//保存发票明细
542
- if (!JSON.parse(billInfo.data).fphm) {
543
- this.charge.f_bill_state = '开票失败'
544
- data = {
545
- f_bill_id: this.charge.f_bill_id,
546
- id: this.charge.id,
547
- apply: this.selectdata,
548
- user: this.$login.f
549
- }
550
- res = await http.load('POST', 'rs/logic/updateChargeBill', {data: data}, {
551
- resolveMsg: null,
552
- rejectMsg: '收费信息更新失败!!!'
553
- })
554
- this.$showMessage(`开票失败!!`, ['confirm']).then(async (res) => {
555
- if (res === 'confirm') {
556
- this.$dispatch('loadPage')
557
- }else {
558
- this.$dispatch('loadPage')
559
- }
560
- })
561
- } else {
562
- data = {
563
- id: this.charge.f_bill_id,
564
- f_bill_number: JSON.parse(billInfo.data).fphm,
565
- f_bill_code: JSON.parse(billInfo.data).fpdm,
566
- f_filepath: JSON.parse(billInfo.data).dzpkex ? JSON.parse(billInfo.data).dzpkex : '',
567
- charge_id: this.charge.id,
568
- apply: this.selectdata,
569
- user: this.$login.f
570
- }
571
- res = await http.load('POST', 'rs/logic/updateEticketBill', {data: data}, {
572
- resolveMsg: null,
573
- rejectMsg: '开票信息更新失败!!!'
574
- })
575
-
576
- this.charge.f_bill_state = '开票成功'
577
- this.charge.f_bill_url = ''
578
- this.charge.f_bill_link = ''
579
- }
580
- }
581
- },
582
- // 新增收费
583
- async saveCharge() {
584
- let http = new HttpResetClass()
585
- let data = {
586
- apply: this.selectdata,
587
- user: this.$login.f,
588
- charge: this.charge
589
- }
590
-
591
- let res = await http.load('POST', 'rs/logic/addApplyChargeRecord', {data:data}, {
592
- resolveMsg: null,
593
- rejectMsg: '缴费失败!!!'
594
- }).then((res) => {
595
- this.charge = res.data.charge
596
- this.selectdata = res.data.apply
597
-
598
- this.showCharge = false
599
- try {
600
- if (this.charge.id) {
601
- this.openBill(this.charge)
602
- }
603
- } catch (e) {
604
- this.$dispatch('breakControl', this.selectdata)
605
- }
606
- })
607
- },
608
- moneyChange () {
609
- if (isEmpty(this.charge.f_charge_money) || Number(this.charge.f_charge_money) === 0) {
610
- this.$showAlert('单笔收费不能为0元!!!', 'warning', 3000)
611
- this.charge.f_charge_money = null
612
- return
613
- }
614
- if (Number(this.charge.f_charge_money) > Number(this.selectdata.f_surplus_money)) {
615
- this.$showAlert('单笔收费不能超过未交总金额!!!', 'warning', 3000)
616
- this.charge.f_charge_money = null
617
- return
618
- }
619
- },
620
- // 金额转大写
621
- handleInput(e) {
622
- // 通过正则过滤小数点后两位
623
- e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
624
- this.charge.f_amount_words = this.smalltoBIG(e.target.value)
625
- },
626
- // 金额转大写
627
- smalltoBIG(n) {
628
- let fraction = ['角', '分'];
629
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
630
- let unit = [['', '', '亿'], ['', '拾', '佰', '仟']];
631
- let head = n < 0 ? '' : '';
632
- n = Math.abs(n);
633
-
634
- let s = '';
635
-
636
- for (var i = 0; i < fraction.length; i++) {
637
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
638
- }
639
- s = s || '';
640
- n = Math.floor(n);
641
-
642
- for (var i = 0; i < unit[0].length && n > 0; i++) {
643
- let p = '';
644
- for (var j = 0; j < unit[1].length && n > 0; j++) {
645
- p = digit[n % 10] + unit[1][j] + p;
646
- n = Math.floor(n / 10);
647
- }
648
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
649
- }
650
- return head + s.replace(/(零.)*零元/, '').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
651
- },
652
- async showChargeModal() {
653
- this.feecountchange()
654
- this.showCharge = true
655
- },
656
- async search () {
657
- let http = new HttpResetClass()
658
- let data = {
659
- f_process_id: this.selectdata.f_process_id
660
- }
661
- let res = await http.load('POST', 'rs/sql/getApplyChargeRecord', {data:data}, {
662
- resolveMsg: null,
663
- rejectMsg: '收费记录查询失败!!!'
664
- })
665
- this.model.data = res.data
666
- },
667
- // 关闭对话框
668
- closeModal() {
669
- this.showCharge = false
670
- this.showInvalid = false
671
- this.showPrint = false
672
- this.charge = {}
673
- this.search()
674
- },
675
- feecountchange(){
676
- if(this.selectdata.f_apply_type == '民用报建'){
677
- this.charge.f_charge_money = Number(this.selectdata.f_price) * Number(this.charge.f_feecount || this.selectdata.f_install_count)
678
- this.charge.f_amount_words = this.smalltoBIG(this.charge.f_charge_money)
679
- }
680
- }
681
- },
682
- events: {
683
- },
684
- computed: {
685
- billStyleList () {
686
- return this.$appdata.getParam("打印格式")
687
- },
688
- paymentMethod() {
689
- return this.$appdata.getParam("付款方式")
690
- },
691
- paymentTerm() {
692
- return this.$appdata.getParam("收费项目")
693
- }
694
- },
695
- watch: {
696
- }
697
- }
698
- </script>
699
- <style scoped>
700
- .textNoLineBreak {
701
- white-space: nowrap;
702
- }
703
- .head-but{
704
- margin-left: 5px;
705
- height: 34px;
706
- /*background-color: #6aa6e2;*/
707
- border-radius: 4px;
708
- font-family: PingFang;
709
- color: #ffffff;
710
- }
711
- .form-control{
712
- padding: 8px 12px;
713
- }
714
- </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_charge_money}}</nobr>
36
+ </td>
37
+ <td style="text-align: center;">
38
+ <nobr>{{row.f_amount_words}}</nobr>
39
+ </td>
40
+ <td style="text-align: center;">
41
+ <nobr>{{row.f_payment_method}}</nobr>
42
+ </td>
43
+ <td style="text-align: center;">
44
+ <nobr>{{row.f_charge_collectors}}</nobr>
45
+ </td>
46
+ <td style="text-align: center;">
47
+ <nobr>{{row.f_charge_date}}</nobr>
48
+ </td>
49
+ <td style="text-align: center;">
50
+ <nobr>{{row.f_charge_remarks}}</nobr>
51
+ </td>
52
+ <td style="text-align: center;">
53
+ <nobr>{{row.f_charge_status}}</nobr>
54
+ </td>
55
+ <td style="text-align: center;">
56
+ <nobr>{{row.f_void_staff}}</nobr>
57
+ </td>
58
+ <td style="text-align: center;">
59
+ <nobr>{{row.f_void_date}}</nobr>
60
+ </td>
61
+ <td style="text-align: center;">
62
+ <nobr>{{row.f_void_remarks}}</nobr>
63
+ </td>
64
+ <td style="text-align: center;">
65
+ <nobr>{{row.f_bill_style}}</nobr>
66
+ </td>
67
+ <td style="text-align: center;">
68
+ <nobr>{{row.f_bill_state}}</nobr>
69
+ </td>
70
+ <td style="text-align: center;">
71
+ <nobr v-if="row.f_charge_status !== '退款'">
72
+ <button
73
+ type="button"
74
+ name="button"
75
+ class="btn btn-link"
76
+ v-if = false
77
+ :disabled="$parent.$parent.mark === 1 || row.f_charge_status === '作废'"
78
+ @click="$parent.$parent.showInvalidModal(row)"
79
+ >作废</button>
80
+
81
+ <button
82
+ type="button" name="button" class="btn btn-link"
83
+ v-if="row.f_bill_state !== '开票成功' && row.f_charge_status !== '作废'"
84
+ @click="$parent.$parent.openBill(row)"
85
+ >开票</button>
86
+
87
+ <button
88
+ type="button" name="button" class="btn btn-link"
89
+ v-if = "row.f_bill_state === '开票成功'"
90
+ @click="$parent.$parent.showPrintModal(row)"
91
+ >查看发票</button>
92
+ </nobr>
93
+ </td>
94
+ </tr>
95
+ </template>
96
+ </data-grid>
97
+
98
+ <validator name="v">
99
+ <modal v-if="showCharge" :show.sync="showCharge" v-ref:modal :large="true" :backdrop="false" title="收费明细">
100
+ <header slot="modal-header" class="modal-header">
101
+ <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
102
+ <h4 class="modal-title">收费明细</h4>
103
+ </header>
104
+ <article slot="modal-body" class="modal-body clearfix">
105
+ <div class="form-group col-sm-6" :class="[$v.f_charge_money.required ? 'has-error' : '']">
106
+ <label class="col-sm-4 control-label">收费金额:</label>
107
+ <div class="col-sm-8">
108
+ <input type="text"
109
+ class="form-control input_view"
110
+ style="width: 100%"
111
+ placeholder="0.00"
112
+ @keyup="handleInput"
113
+ @change="moneyChange"
114
+ :readonly="selectdata.f_apply_type == '民用报建'"
115
+ v-validate:f_charge_money = "['required']"
116
+ v-model="charge.f_charge_money" />
117
+ </div>
118
+ </div>
119
+ <div class="form-group col-sm-6" :class="[$v.f_feecount.required ? 'has-error' : '']">
120
+ <label class="col-sm-4 control-label">缴费户数:</label>
121
+ <div class="col-sm-8">
122
+ <input type="text"
123
+ class="form-control input_view"
124
+ style="width: 100%"
125
+ v-validate:f_feecount = "['required']"
126
+ v-model="charge.f_feecount"
127
+ @blur="feecountchange"
128
+ :value="selectdata.f_install_count"
129
+ />
130
+ </div>
131
+ </div>
132
+ <div class="form-group col-sm-6">
133
+ <label class="col-sm-4 control-label">金额大写:</label>
134
+ <div class="col-sm-8">
135
+ <input type="text" class="form-control input_view" style="width: 100%" readonly
136
+ v-model.sync="charge.f_amount_words"/>
137
+ </div>
138
+ </div>
139
+ <div class="form-group col-sm-6" :class="[$v.f_payment_method.required ? 'has-error' : '']">
140
+ <label class="col-sm-4 control-label">付款方式:</label>
141
+ <div class="col-sm-8">
142
+ <input type="text" v-show="false" v-model="charge.f_payment_method" v-validate:f_payment_method = "['required']" >
143
+ <input-select
144
+ placeholder='请选择' width="100%"
145
+ v-model="charge.f_payment_method"
146
+ :value.sync="charge.f_payment_method"
147
+ :options='paymentMethod'
148
+ class="select select_list"
149
+ :value-single="true"
150
+ close-on-select ></input-select>
151
+ </div>
152
+ </div>
153
+ <div class="form-group col-sm-6" :class="[$v.f_bill_style.required ? 'has-error' : '']">
154
+ <label class="col-sm-4 control-label">票据类型:</label>
155
+ <div class="col-sm-8">
156
+ <input type="text" v-show="false" v-model="charge.f_bill_style" :value.sync="selectdata.f_paper_type" v-validate:f_bill_style = "['required']" >
157
+ <input-select
158
+ placeholder='请选择' width="100%"
159
+ v-model="charge.f_bill_style"
160
+ :value.sync="selectdata.f_paper_type"
161
+ :options='billStyleList'
162
+ class="select select_list"
163
+ :value-single="true"
164
+ close-on-select ></input-select>
165
+ </div>
166
+ </div>
167
+ <div class="form-group col-sm-6">
168
+ <label class="col-sm-4 control-label">应交总金额:</label>
169
+ <div class="col-sm-8">
170
+ <input type="text" class="form-control input_view" style="width: 100%" readonly
171
+ v-model="selectdata.f_due_money" />
172
+ </div>
173
+ </div>
174
+ <div class="form-group col-sm-6">
175
+ <label class="col-sm-4 control-label">未结总金额:</label>
176
+ <div class="col-sm-8">
177
+ <input type="text" class="form-control input_view" style="width: 100%" readonly
178
+ v-model="selectdata.f_surplus_money" />
179
+ </div>
180
+ </div>
181
+ <div class="form-group col-sm-6">
182
+ <label class="col-sm-4 control-label">累计缴费总金额:</label>
183
+ <div class="col-sm-8">
184
+ <input type="text" class="form-control input_view" style="width: 100%" readonly
185
+ v-model="selectdata.f_cumulative_payment_money" />
186
+ </div>
187
+ </div>
188
+ <div class="form-group col-sm-12">
189
+ <label class="col-sm-2 control-label">备注:</label>
190
+ <div class="col-sm-10">
191
+ <input type="text" class="form-control input_view" style="width: 100%"
192
+ v-model="charge.f_charge_remarks" />
193
+ </div>
194
+ </div>
195
+ <div class="form-group col-sm-6">
196
+ <label class="col-sm-4 control-label">购货单位识别号:</label>
197
+ <div class="col-sm-8">
198
+ <input type="text" class="form-control input_view" style="width: 100%"
199
+ v-model="charge.f_taxpayer_id" :value="selectdata.f_taxpayer_id" />
200
+ </div>
201
+ </div>
202
+ <div class="form-group col-sm-6" :class="[$v.f_paper_name.required ? 'has-error' : '']">
203
+ <label class="col-sm-4 control-label">购货单位名称:</label>
204
+ <div class="col-sm-8">
205
+ <input type="text" class="form-control input_view" style="width: 100%"
206
+ v-validate:f_paper_name = "['required']"
207
+ v-model="charge.f_paper_name" :value="selectdata.f_paper_name" />
208
+ </div>
209
+ </div>
210
+ <div class="form-group col-sm-6">
211
+ <label class="col-sm-4 control-label">购货单位银行账号:</label>
212
+ <div class="col-sm-8">
213
+ <input type="text" class="form-control input_view" style="width: 100%"
214
+ v-model="charge.f_paper_account" :value="selectdata.f_paper_account" />
215
+ </div>
216
+ </div>
217
+ <div class="form-group col-sm-6">
218
+ <label class="col-sm-4 control-label">购货单位地址电话:</label>
219
+ <div class="col-sm-8">
220
+ <input type="text" class="form-control input_view" style="width: 100%"
221
+ v-model="charge.f_address_phone" :value="selectdata.f_address_phone" />
222
+ </div>
223
+ </div>
224
+ <div class="form-group col-sm-12">
225
+ <label class="col-sm-2 control-label">发票备注:</label>
226
+ <div class="col-sm-10">
227
+ <input type="text" class="form-control input_view" style="width: 100%"
228
+ v-model="charge.f_bill_remarks" :value="selectdata.f_paper_remarks"/>
229
+ </div>
230
+ </div>
231
+ </article>
232
+ <footer slot="modal-footer" class="modal-footer">
233
+ <button type="button" class="btn btn-primary" :disabled='!$v.valid' @click="saveCharge()">新增收费</button>
234
+ </footer>
235
+ </modal>
236
+ </validator>
237
+
238
+ <modal v-if="showInvalid" :show.sync="showInvalid" v-ref:modal :backdrop="false" title="作废收费">
239
+ <header slot="modal-header" class="modal-header">
240
+ <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
241
+ <h4 class="modal-title">作废收费</h4>
242
+ </header>
243
+ <article slot="modal-body" class="modal-body clearfix">
244
+ <div class="form-group col-sm-12" v-if="false">
245
+ <label class="col-sm-2 control-label">缴费地址:</label>
246
+ <div class="col-sm-10">
247
+ <input type="text"
248
+ class="form-control input_view"
249
+ style="width: 100%"
250
+ readonly
251
+ v-model="charge.f_useraddres" />
252
+ </div>
253
+ </div>
254
+ <div class="form-group col-sm-12">
255
+ <label class="col-sm-2 control-label">收费金额:</label>
256
+ <div class="col-sm-10">
257
+ <input type="text"
258
+ class="form-control input_view"
259
+ style="width: 100%"
260
+ readonly
261
+ v-model="charge.f_charge_money" />
262
+ </div>
263
+ </div>
264
+ <div class="form-group col-sm-12">
265
+ <label class="col-sm-2 control-label">付款方式:</label>
266
+ <div class="col-sm-10">
267
+ <input type="text"
268
+ class="form-control input_view"
269
+ style="width: 100%"
270
+ readonly
271
+ v-model="charge.f_payment_method" />
272
+ </div>
273
+ </div>
274
+ <div class="form-group col-sm-12">
275
+ <label class="col-sm-2 control-label">金额大写:</label>
276
+ <div class="col-sm-10">
277
+ <input type="text"
278
+ class="form-control input_view"
279
+ style="width: 100%"
280
+ readonly
281
+ v-model="charge.f_amount_words" />
282
+ </div>
283
+ </div>
284
+ <div class="form-group col-sm-12">
285
+ <label class="col-sm-2 control-label">收费人员:</label>
286
+ <div class="col-sm-10">
287
+ <input type="text"
288
+ class="form-control input_view"
289
+ style="width: 100%"
290
+ readonly
291
+ v-model="charge.f_charge_collectors" />
292
+ </div>
293
+ </div>
294
+ <div class="form-group col-sm-12" :class="charge.f_void_remarks ? '':'has-error'">
295
+ <label class="col-sm-2 control-label">作废原因:</label>
296
+ <div class="col-sm-10">
297
+ <input type="text"
298
+ class="form-control input_view"
299
+ style="width: 100%"
300
+ v-model="charge.f_void_remarks" />
301
+ </div>
302
+ </div>
303
+ </article>
304
+ <footer slot="modal-footer" class="modal-footer">
305
+ <button type="button" class="btn btn-primary" :disabled="!charge.f_void_remarks" @click="invalidApplyCharge()">确认作废</button>
306
+ </footer>
307
+ </modal>
308
+
309
+ <modal v-if="showPrint" :show.sync="showPrint" v-ref:modal :large="true" :backdrop="false">
310
+ <header slot="modal-header" class="modal-header">
311
+ <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
312
+ <h4 class="modal-title">票据信息</h4>
313
+ </header>
314
+ <article slot="modal-body" class="modal-body clearfix">
315
+ <iframe width="100%" height="500px" :src="charge.f_bill_link" v-if="charge.f_bill_link"></iframe>
316
+ </article>
317
+ <footer slot="modal-footer" class="modal-footer">
318
+ </footer>
319
+ </modal>
320
+ </div>
321
+ </template>
322
+ <script>
323
+ import {PagedList} from 'vue-client'
324
+ import {HttpResetClass} from 'vue-client'
325
+ import Vue from 'vue'
326
+ import {isEmpty} from '../../../Util'
327
+
328
+ export default {
329
+ title: '收费管理',
330
+ props: {
331
+ selectdata: {
332
+ type: Object
333
+ },
334
+ mark: {
335
+ type: Number,
336
+ default: 0
337
+ }
338
+ },
339
+ data () {
340
+ return {
341
+ showCharge: false, // 收费明细
342
+ showInvalid: false, // 作废
343
+ showPrint: false, // 打印
344
+ model: {
345
+ data: null
346
+ }, // 记录
347
+ charge: {
348
+ f_amount_words:'',
349
+ f_charge_money:''
350
+ }
351
+ }
352
+ },
353
+ ready () {
354
+ this.search()
355
+ },
356
+ methods: {
357
+
358
+ async invalidApplyCharge() {
359
+
360
+ let http = new HttpResetClass()
361
+ let data = {
362
+ apply: this.selectdata,
363
+ user: this.$login.f,
364
+ charge: this.charge
365
+ }
366
+ let res = await http.load('POST', 'rs/logic/invalidApplyCharge', {data:data}, {
367
+ resolveMsg: null,
368
+ rejectMsg: '作废失败!!!'
369
+ })
370
+ this.selectdata = res.data
371
+ this.showInvalid=false
372
+ this.charge = {}
373
+ this.$dispatch('breakControl', this.selectdata)
374
+ },
375
+ // 打开作废收费
376
+ showInvalidModal(row) {
377
+ this.charge = row
378
+ this.showInvalid = true
379
+ },
380
+ // 查看发票
381
+ showPrintModal(row, type) {
382
+ this.charge = row
383
+ if (!this.charge.f_bill_link && this.charge.f_filepath){
384
+ let date = new Date(this.charge.f_charge_date)
385
+ let year = date.getFullYear()
386
+ let month = date.getMonth() + 1
387
+ let month2 = month <= 9 ? '0' + month : month
388
+ let day = date.getDate()
389
+ let day2 = day <= 9 ? '0' + day : day
390
+ let chargedate = year + '-' + month2 + '-' + day2
391
+ this.charge.f_bill_link = `http://193.168.1.6:8082/eticket/` + chargedate + '/' + this.charge.f_filepath + '.pdf'
392
+ }else if(!this.charge.f_bill_link){
393
+ this.charge.f_bill_link = this.charge.f_bill_url
394
+ }
395
+ this.showPrint = true
396
+ },
397
+ // 开票组织数据
398
+ async openBill (charge) {
399
+ this.$showMessage("请稍后查询,发票开具中.....")
400
+ /*this.charge = charge
401
+ let data = null
402
+ let res = null
403
+
404
+ let http = new HttpResetClass()
405
+
406
+ if (isEmpty(this.charge.f_bill_id)) {
407
+ try {
408
+ data = {
409
+ id: this.charge.id,
410
+ charge_type: '报装收费',
411
+ f_user_name: this.selectdata.f_user_name
412
+ }
413
+ if (this.selectdata.f_apply_type === '改线业务'){
414
+ data.charge_type = '整改收费'
415
+ }
416
+ res = await http.load('POST', 'rs/logic/bjEticketCharge', {data:data}, {
417
+ resolveMsg: null,
418
+ rejectMsg: '开票组织数据失败!!!'
419
+ }).then((res) => {
420
+ this.charge.f_bill_id = res.data
421
+ this.outBill()
422
+ })
423
+ }catch (e){
424
+ console.error("错误信息",e)
425
+ this.charge.f_bill_state = '开票失败'
426
+
427
+ data = {
428
+ f_bill_id: '',
429
+ id: this.charge.id,
430
+ apply: this.selectdata,
431
+ user: this.$login.f
432
+ }
433
+ res = await http.load('POST', 'rs/logic/updateChargeBill', {data: data}, {
434
+ resolveMsg: null,
435
+ rejectMsg: '收费信息更新失败!!!'
436
+ })
437
+ this.$showMessage(`开票信息组织失败!!`, ['confirm']).then(async (res) => {
438
+ if (res === 'confirm') {
439
+ this.$dispatch('loadPage')
440
+ }else {
441
+ this.$dispatch('loadPage')
442
+ }
443
+ })
444
+ }
445
+ }else {
446
+ await this.outBill()
447
+ }*/
448
+ },
449
+ //开票
450
+ async outBill () {
451
+
452
+ let data = null
453
+ let res = null
454
+ let http = new HttpResetClass()
455
+ if (this.charge.f_bill_style === '电子票') {
456
+ data = {
457
+ id: this.charge.f_bill_id,
458
+ f_sell_id: this.charge.id
459
+ }
460
+ try {
461
+ res = await http.load('POST', 'rs/logic/bjOpenEticket', {data: data}, {
462
+ resolveMsg: null,
463
+ rejectMsg: '开票失败!!!'
464
+ })
465
+
466
+ // res.data.f_bill_url = 'https://dlj.51fapiao.cn/dlj/v7/de4c9b985021111ef1c722c2914e34d9273291'
467
+
468
+ if (res.data.f_bill_state !== '开票成功') {
469
+ throw '开票失败!!!'
470
+ } else {
471
+ this.charge.f_bill_state = res.data.f_bill_state
472
+ this.charge.f_bill_url = res.data.f_bill_url
473
+ let date = new Date(this.charge.f_charge_date)
474
+ let year = date.getFullYear()
475
+ let month = date.getMonth() + 1
476
+ let month2 = month <= 9 ? '0' + month : month
477
+ let day = date.getDate()
478
+ let day2 = day <= 9 ? '0' + day : day
479
+ let chargedate = year + '-' + month2 + '-' + day2
480
+ this.charge.f_bill_link = `http://193.168.1.6:8082/eticket/` + chargedate + '/' + res.data.f_filepath + '.pdf'
481
+ this.showPrint = true
482
+ let pram = {
483
+ f_bill_link: this.charge.f_bill_link,
484
+ f_sell_id: this.charge.id,
485
+ apply: this.selectdata,
486
+ user: this.$login.f
487
+ }
488
+ await http.load('POST', 'rs/logic/updataChargeRecord', {data: pram}, {
489
+ resolveMsg: null,
490
+ rejectMsg: null
491
+ })
492
+ }
493
+ } catch (e) {
494
+ console.error(e)
495
+ this.charge.f_bill_state = '开票失败'
496
+
497
+ data = {
498
+ f_bill_id: this.charge.f_bill_id,
499
+ id: this.charge.id,
500
+ apply: this.selectdata,
501
+ user: this.$login.f
502
+ }
503
+ res = await http.load('POST', 'rs/logic/updateChargeBill', {data: data}, {
504
+ resolveMsg: null,
505
+ rejectMsg: '收费信息更新失败!!!'
506
+ })
507
+ this.$showMessage(`开票失败!!`, ['confirm']).then(async (res) => {
508
+ if (res === 'confirm') {
509
+ this.$dispatch('loadPage')
510
+ }else {
511
+ this.$dispatch('loadPage')
512
+ }
513
+ })
514
+ }
515
+ } else if (this.charge.f_bill_style === '专票') {
516
+ data = {
517
+ id: this.charge.f_bill_id
518
+ }
519
+ res = await http.load('POST', 'rs/sql/getEticketData', {data: data}, {
520
+ resolveMsg: null,
521
+ rejectMsg: '开票数据查询失败!!!'
522
+ })
523
+ let openBillData = JSON.parse(res.data[0].f_bill_data)
524
+ openBillData.kpzdbs = this.$login.f.taxnum
525
+ const nowDate = new Date()
526
+ let year = nowDate.getFullYear()
527
+ let mouth = nowDate.getMonth() + 1
528
+ let day = nowDate.getDate()
529
+ openBillData.f_operate_date = year + '-' + mouth + '-' + day
530
+ openBillData.f_operator = this.$login.f.name
531
+ openBillData.outlets = this.$login.f.f_department_name
532
+ openBillData.hjse = ''
533
+ openBillData.jshh = ''
534
+ openBillData.tzdbh = ''
535
+ openBillData.yfpdm = ''
536
+ openBillData.yfphm = ''
537
+ console.log('返回开票信息。。 ', openBillData)
538
+ let billInfo = await this.$resetpost('http://127.0.0.1:8003/Goldtax', openBillData, {
539
+ resolveMsg: null,
540
+ rejectMsg: '专用发票开具失败!'
541
+ })
542
+ console.log('返回票据信息。。 ', JSON.parse(billInfo.data))//保存发票明细
543
+ if (!JSON.parse(billInfo.data).fphm) {
544
+ this.charge.f_bill_state = '开票失败'
545
+ data = {
546
+ f_bill_id: this.charge.f_bill_id,
547
+ id: this.charge.id,
548
+ apply: this.selectdata,
549
+ user: this.$login.f
550
+ }
551
+ res = await http.load('POST', 'rs/logic/updateChargeBill', {data: data}, {
552
+ resolveMsg: null,
553
+ rejectMsg: '收费信息更新失败!!!'
554
+ })
555
+ this.$showMessage(`开票失败!!`, ['confirm']).then(async (res) => {
556
+ if (res === 'confirm') {
557
+ this.$dispatch('loadPage')
558
+ }else {
559
+ this.$dispatch('loadPage')
560
+ }
561
+ })
562
+ } else {
563
+ data = {
564
+ id: this.charge.f_bill_id,
565
+ f_bill_number: JSON.parse(billInfo.data).fphm,
566
+ f_bill_code: JSON.parse(billInfo.data).fpdm,
567
+ f_filepath: JSON.parse(billInfo.data).dzpkex ? JSON.parse(billInfo.data).dzpkex : '',
568
+ charge_id: this.charge.id,
569
+ apply: this.selectdata,
570
+ user: this.$login.f
571
+ }
572
+ res = await http.load('POST', 'rs/logic/updateEticketBill', {data: data}, {
573
+ resolveMsg: null,
574
+ rejectMsg: '开票信息更新失败!!!'
575
+ })
576
+
577
+ this.charge.f_bill_state = '开票成功'
578
+ this.charge.f_bill_url = ''
579
+ this.charge.f_bill_link = ''
580
+ }
581
+ }
582
+ },
583
+ // 新增收费
584
+ async saveCharge() {
585
+ let http = new HttpResetClass()
586
+ let data = {
587
+ apply: this.selectdata,
588
+ user: this.$login.f,
589
+ charge: this.charge
590
+ }
591
+
592
+ let res = await http.load('POST', 'rs/logic/addApplyChargeRecord', {data:data}, {
593
+ resolveMsg: null,
594
+ rejectMsg: '缴费失败!!!'
595
+ }).then((res) => {
596
+ this.charge = res.data.charge
597
+ this.selectdata = res.data.apply
598
+
599
+ this.showCharge = false
600
+ this.$dispatch('loadPage')
601
+ /*try {
602
+ if (this.charge.id) {
603
+ this.openBill(this.charge)
604
+ }
605
+ } catch (e) {
606
+ this.$dispatch('breakControl', this.selectdata)
607
+ }*/
608
+ })
609
+ },
610
+ moneyChange () {
611
+ if (isEmpty(this.charge.f_charge_money) || Number(this.charge.f_charge_money) === 0) {
612
+ this.$showAlert('单笔收费不能为0元!!!', 'warning', 3000)
613
+ this.charge.f_charge_money = null
614
+ return
615
+ }
616
+ if (Number(this.charge.f_charge_money) > Number(this.selectdata.f_surplus_money)) {
617
+ this.$showAlert('单笔收费不能超过未交总金额!!!', 'warning', 3000)
618
+ this.charge.f_charge_money = null
619
+ return
620
+ }
621
+ },
622
+ // 金额转大写
623
+ handleInput(e) {
624
+ // 通过正则过滤小数点后两位
625
+ e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
626
+ this.charge.f_amount_words = this.smalltoBIG(e.target.value)
627
+ },
628
+ // 金额转大写
629
+ smalltoBIG(n) {
630
+ let fraction = ['', ''];
631
+ let digit = ['零', '壹', '贰', '叁', '', '伍', '', '柒', '捌', '玖'];
632
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
633
+ let head = n < 0 ? '欠' : '';
634
+ n = Math.abs(n);
635
+
636
+ let s = '';
637
+
638
+ for (var i = 0; i < fraction.length; i++) {
639
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
640
+ }
641
+ s = s || '整';
642
+ n = Math.floor(n);
643
+
644
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
645
+ let p = '';
646
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
647
+ p = digit[n % 10] + unit[1][j] + p;
648
+ n = Math.floor(n / 10);
649
+ }
650
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
651
+ }
652
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
653
+ },
654
+ async showChargeModal() {
655
+ this.feecountchange()
656
+ this.showCharge = true
657
+ },
658
+ async search () {
659
+ let http = new HttpResetClass()
660
+ let data = {
661
+ f_process_id: this.selectdata.f_process_id
662
+ }
663
+ let res = await http.load('POST', 'rs/sql/getApplyChargeRecord', {data:data}, {
664
+ resolveMsg: null,
665
+ rejectMsg: '收费记录查询失败!!!'
666
+ })
667
+ this.model.data = res.data
668
+ },
669
+ // 关闭对话框
670
+ closeModal() {
671
+ this.showCharge = false
672
+ this.showInvalid = false
673
+ this.showPrint = false
674
+ this.charge = {}
675
+ this.search()
676
+ },
677
+ feecountchange(){
678
+ if(this.selectdata.f_apply_type == '民用报建'){
679
+ this.charge.f_charge_money = Number(this.selectdata.f_price) * Number(this.charge.f_feecount || this.selectdata.f_install_count)
680
+ this.charge.f_amount_words = this.smalltoBIG(this.charge.f_charge_money)
681
+ }
682
+ }
683
+ },
684
+ events: {
685
+ },
686
+ computed: {
687
+ billStyleList () {
688
+ return this.$appdata.getParam("打印格式")
689
+ },
690
+ paymentMethod() {
691
+ return this.$appdata.getParam("付款方式")
692
+ },
693
+ paymentTerm() {
694
+ return this.$appdata.getParam("收费项目")
695
+ }
696
+ },
697
+ watch: {
698
+ }
699
+ }
700
+ </script>
701
+ <style scoped>
702
+ .textNoLineBreak {
703
+ white-space: nowrap;
704
+ }
705
+ .head-but{
706
+ margin-left: 5px;
707
+ height: 34px;
708
+ /*background-color: #6aa6e2;*/
709
+ border-radius: 4px;
710
+ font-family: PingFang;
711
+ color: #ffffff;
712
+ }
713
+ .form-control{
714
+ padding: 8px 12px;
715
+ }
716
+ </style>