apply-clients 5.0.35-43 → 5.0.35-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.
@@ -1,1121 +1,1122 @@
1
- <template>
2
- <div class="col-sm-12 auto select-overspread">
3
- <div class="auto select-overspread">
4
- <div class="panel panel-info">
5
- <div class="panel-heading auto">
6
- <div class="col-sm-12 recordTable" style="height: 200px">
7
- <partial-view v-ref:single-load v-if="!isSingleUser">
8
- <data-grid :model="model" v-ref:grid>
9
- <template partial='head'>
10
- <tr>
11
- <th>
12
- <nobr>序号</nobr>
13
- </th>
14
- <th>
15
- <nobr>用户</nobr>
16
- </th>
17
- <th>
18
- <nobr>地址</nobr>
19
- </th>
20
- <th>
21
- <nobr>收费金额(元)</nobr>
22
- </th>
23
- <th>
24
- <nobr>收费人员</nobr>
25
- </th>
26
- <th>
27
- <nobr>日期</nobr>
28
- </th>
29
- <th>
30
- <nobr>备注</nobr>
31
- </th>
32
- <th>
33
- <nobr>操作</nobr>
34
- </th>
35
- </tr>
36
- </template>
37
- <template partial='body'>
38
- <td style="text-align: center">{{$index+1}}</td>
39
- <td style="text-align: center">{{row.f_charge_user}}</td>
40
- <td style="text-align: center">{{row.f_charge_address}}</td>
41
- <td style="text-align: center">{{row.f_charge_money}}</td>
42
- <td style="text-align: center">{{row.f_charge_collectors}}</td>
43
- <td style="text-align: center">{{row.f_charge_date}}</td>
44
- <td style="text-align: center">{{row.f_charge_remarks}}</td>
45
- <td style="text-align: center">
46
- <button class="btn btn-default" @click="$parent.$parent.$parent.tovoid($index)">冲正</button>
47
- </td>
48
- </template>
49
- </data-grid>
50
- </partial-view>
51
- <partial-view v-ref:single-user v-if="isSingleUser">
52
- <data-grid :model="userinfoRow" v-ref:grid>
53
- <template partial='head'>
54
- <tr>
55
- <th>
56
- <nobr>序号</nobr>
57
- </th>
58
- <th>
59
- <nobr>用户名</nobr>
60
- </th>
61
- <th>
62
- <nobr>用户电话</nobr>
63
- </th>
64
- <th>
65
- <nobr>地址</nobr>
66
- </th>
67
- <th>
68
- <nobr>操作</nobr>
69
- </th>
70
- </tr>
71
- </template>
72
- <template partial='body'>
73
- <td style="text-align: center">{{$index+1}}</td>
74
- <td style="text-align: center">{{row.f_user_name}}</td>
75
- <td style="text-align: center">{{row.f_user_phone}}</td>
76
- <td style="text-align: center">{{row.address}}</td>
77
- <button type="button" name="button" class="btn btn-link"
78
- @click.stop="$parent.$parent.$parent.getUserinfo($index)">收费
79
- </button>
80
- </template>
81
- </data-grid>
82
- </partial-view>
83
- <form novalidate class="form-horizontal">
84
- <p class="bg-info text-center" style="padding: 10px;"></p>
85
- <p class="bg-info text-center" style="padding: 10px;">收费信息</p>
86
- <div class="row" style="margin-top:10px;">
87
- <div class="form-input-group col-sm-3">
88
- <label for="f_user_name" class="control-label col-sm-2 ">用户名称</label>
89
- <div class="col-sm-2">
90
- <input type="text" class="form-control" @blur="getUserinfo" v-model="model.f_user_name">
91
- </div>
92
- </div>
93
- <div class="form-input-group col-sm-3">
94
- <label for="f_phone" class="control-label col-sm-2 ">联系电话</label>
95
- <div class="col-sm-2">
96
- <input type="text" class="form-control" @blur="getUserinfo" v-model="model.f_phone" readonly>
97
-
98
- </div>
99
- </div>
100
- <div class="form-input-group col-sm-6">
101
- <label for="f_address" class="control-label col-sm-2 ">地址</label>
102
- <div class="col-sm-2">
103
- <input type="text" class="form-control" @blur="getUserinfo" v-model="model.f_address" readonly>
104
- </div>
105
- </div>
106
- </div>
107
- <div class="row" style="margin-top:10px;">
108
- <div class="form-input-group col-sm-3">
109
- <label for="f_brand_spec" class="control-label col-sm-2 ">应交金额(元)</label>
110
- <div class="col-sm-2">
111
- <input type="text" class="form-control" v-model="model.f_total_cost" readonly>
112
- </div>
113
- </div>
114
- <div class="form-input-group col-sm-3">
115
- <label for="f_brand_spec" class="control-label col-sm-2 ">累计缴费金额(元)</label>
116
- <div class="col-sm-2">
117
- <input type="text" class="form-control" v-model="model.f_cumulative_money" readonly>
118
- </div>
119
- </div>
120
- <div class="form-input-group col-sm-3">
121
- <label for="f_brand_spec" class="control-label col-sm-2 ">未结总金额(元)</label>
122
- <div class="col-sm-2">
123
- <input type="text" class="form-control" v-model="model.f_unaccounts_money" readonly>
124
- </div>
125
- </div>
126
- <div class="form-input-group col-sm-3">
127
- <label for="f_brand_spec" class="control-label col-sm-2 ">金额(元)</label>
128
- <div class="col-sm-2">
129
- <input type="text" class="form-control" :placeholder="0" v-model="model.f_charge_money"
130
- disabled="true">
131
- </div>
132
- </div>
133
- </div>
134
- <div class="row" style="margin-top:10px;">
135
- <div class="form-input-group col-sm-3">
136
- <label for="f_isone" class="control-label col-sm-2">单户打印:</label>
137
- <div class="col-sm-2">
138
- <v-select id="isone" width="100%"
139
- v-model="f_isone"
140
- placeholder='请选择'
141
- :value.sync="model.f_isone"
142
- :options='isOne'
143
- close-on-select clear-button>
144
- </v-select>
145
- </div>
146
- </div>
147
- <div class="form-input-group col-sm-3">
148
- <label for="f_paytype" class="control-label col-sm-2">付款方式:</label>
149
- <div class="col-sm-2">
150
- <v-select id="f_payment" width="100%"
151
- v-model="f_payment"
152
- placeholder='请选择'
153
- :value.sync="model.f_payment"
154
- :options='paymenttypes'
155
- close-on-select clear-button>
156
- </v-select>
157
- </div>
158
- </div>
159
- <div class="form-input-group col-sm-3">
160
-
161
- <label for="f_print" class="control-label col-sm-2">打印格式:</label>
162
- <div class="col-sm-2">
163
- <v-select id="print" width="100%"
164
- v-model="f_print"
165
- placeholder='请选择'
166
- :value.sync="model.f_print"
167
- :options='printstyle'
168
- close-on-select clear-button>
169
- </v-select>
170
- </div>
171
- </div>
172
- <div class="form-input-group col-sm-3">
173
- <label for="f_brand_spec" class="control-label col-sm-2 ">金额大写(元)</label>
174
- <div class="col-sm-2">
175
- <input type="text" class="form-control" v-model="getCapital" readonly>
176
- </div>
177
- </div>
178
- </div>
179
- <div class="row" style="margin-top:10px;" v-for="(index,row) in charges">
180
- <div class="form-input-group col-sm-12">
181
- <div class="form-input-group col-sm-3">
182
- <label for="f_charge_item" class="control-label col-sm-2">
183
- <button class="glyphicon glyphicon-minus btn-danger" v-if="$index>0"
184
- @click.stop="delItems($index)"></button>&nbsp;&nbsp;&nbsp;
185
- <button class="glyphicon glyphicon-plus btn-success" @click.stop="addItems()"></button>
186
- </label>
187
- <div class="col-sm-2">
188
- <v-select id="f_charge_item" +$index
189
- v-model="f_project_item" width="100%"
190
- placeholder='收费项目'
191
- :value.sync="row.f_project_item"
192
- :options='chargeitems'
193
- close-on-select clear-button>
194
- </v-select>
195
- </div>
196
- </div>
197
- <div class="form-input-group col-sm-3">
198
- <label for="f_amount" class="control-label col-sm-2">数量:</label>
199
- <div class="col-sm-2">
200
- <input class="form-control" style="background-color: white" type="number" v-model="row.f_amount"
201
- :disabled="isDisable"
202
- placeholder="数量" :blur="calcmoney(index)">
203
- </div>
204
- </div>
205
- <div class="form-input-group col-sm-3">
206
- <label for="f_price" class="control-label col-sm-2">单价:</label>
207
- <div class="col-sm-2">
208
- <input class="form-control" style="background-color: white" type="number" v-model="row.f_price"
209
- :disabled="isDisable"
210
- placeholder="单价" :blur="calcmoney(index)">
211
- </div>
212
- </div>
213
- <div class="form-input-group col-sm-3">
214
- <label for="f_money" class="control-label col-sm-2">金额:</label>
215
- <div class="col-sm-2">
216
- <input class="form-control" style="background-color: white" type="number" v-model="row.f_money"
217
- :disabled="true"
218
- placeholder="金额">
219
- </div>
220
- </div>
221
- </div>
222
- </div>
223
- <div class="row" style="margin-top:10px;">
224
- <div class="form-input-group col-sm-8">
225
- <label for="f_paytype" class="control-label col-sm-2">备注:</label>
226
- <input type="text" class="form-control" v-model="model.f_charge_remarks">
227
- </div>
228
- </div>
229
- <apply-validate-bill v-if="hasValidateBill" :show="refresh" :data="model"
230
- @validate-bill="validateBill"></apply-validate-bill>
231
- <printbill :show="print" :data='model' :selfclean="selfclean" :bill-config='config' :bill-data='billData'
232
- v-on:toggle="close" :selfsearch="load" @printok="printok" v-ref:printbill></printbill>
233
- <printbill :show="printat" :data='model' :selfclean="selfclean" :bill-config='config' :bill-data='billDataantai'
234
- v-on:toggle="close" :selfsearch="load" @printok="printok" v-ref:printbill></printbill>
235
- <bjpaper-ticket-bill :show="paperticket" :data='ids' @toggle="closeticket"></bjpaper-ticket-bill>
236
- <printbill :show="delprint" :data='model' :selfclean="selfclean" :bill-config='config2'
237
- :bill-data='billData' v-on:toggle="close" :selfsearch="load" @printok="printok"
238
- v-ref:printbill></printbill>
239
- <printbill :show="delprintat" :data='model' :selfclean="selfclean" :bill-config='config2'
240
- :bill-data='billDataantai' v-on:toggle="close" :selfsearch="load" @printok="printok"
241
- v-ref:printbill></printbill>
242
- <div class="row" style="text-align:right;">
243
- <button :readonly="!validateOk" type="button" class="btn btn-success" style="" @click='confirm'>确认
244
- </button>
245
- </div>
246
- </form>
247
- </div>
248
- </div>
249
- </div>
250
- </div>
251
- </div>
252
- <modal :show.sync="papershow" v-ref:modal large backdrop="false">
253
- <header slot="modal-header" class="modal-header">
254
- <h3 style="color:black" class="modal-title">购货方信息</h3>
255
- </header>
256
- <article slot="modal-body" class="modal-body">
257
-
258
- <validator name='v'>
259
- <form class="form-horizontal select-overspread">
260
- <div class="row" style="display: flex;justify-content: center;" id='normal-bill'>
261
- <div class="form-group col-sm-6">
262
- <label class=" col-sm-2 control-label">购买方名称:</label>
263
- <input type="text" class="form-control" v-model="paperinfo.f_buy_name" style="width:60%"
264
- :value.sync="paperinfo.f_buy_name" placeholder="购买方名称"
265
- >
266
- </div>
267
- <div class="form-group col-sm-6">
268
- <label class=" col-sm-2 control-label">纳税人识别号:</label>
269
- <input type="text" class="form-control" v-model="paperinfo.f_pay_id" style="width:60%"
270
- placeholder="纳税人识别号" :value.sync="paperinfo.f_pay_id"
271
- >
272
- </div>
273
- </div>
274
- <div class="row">
275
- <div class="form-group col-sm-6">
276
- <label class=" col-sm-2 control-label">购买方地址电话:</label>
277
- <input type="text" class="form-control" v-model="paperinfo.f_buy_address" style="width:60%"
278
- placeholder="购买方地址" :value.sync="paperinfo.f_buy_address"
279
- >
280
- </div>
281
- <div class="form-group col-sm-6">
282
- <label class=" col-sm-2 control-label">购买方开户行及账号:</label>
283
- <input type="text" class="form-control" v-model="paperinfo.f_buy_openbank" style="width:60%"
284
- placeholder="购买方开户行及账号" :value.sync="paperinfo.f_buy_openbank"
285
- >
286
- </div>
287
- <div class="form-group col-sm-6">
288
- <label class=" col-sm-2 control-label">邮箱:</label>
289
- <input type="text" class="form-control" v-model="paperinfo.f_email_push" style="width:60%"
290
- placeholder="邮箱" :value.sync="paperinfo.f_email_push"
291
- >
292
- </div>
293
- </div>
294
-
295
-
296
- </form>
297
- </validator>
298
- </article>
299
- <footer slot="modal-footer" class="modal-footer">
300
- <button type="button" class="btn btn-default" @click='papaercom()'>确认</button>
301
- </footer>
302
- </modal>
303
- </template>
304
- <script>
305
- import {HttpResetClass} from 'vue-client'
306
- import InputAndSelect from "vue-client/src/vue-strap/src/InputAndSelect";
307
- import {DataModel} from 'vue-client'
308
- import commonService from "../../../../plugins/commonService.js";
309
-
310
- let gen = function* (self, val) {
311
- val.f_actualfee_type = val.f_actualfee_type[0]
312
- yield self.$resetpost('rs/logic/saveentity', {data: {tablename: 't_apply', parameters: val}})
313
- delete val.id
314
- self.$resetpost('rs/logic/saveentity', {data: {tablename: 't_record', parameters: val}})
315
- .then(() => {
316
- self.reset()
317
- })
318
- }
319
- export default {
320
-
321
- components: {InputAndSelect},
322
- title: '报装收费',
323
- data() {
324
- return {
325
- billtype: {
326
- name: "收费发票"
327
- },
328
- isSingleUser: false,
329
- isOne: [{label: '是', value: '是'}, {label: '否', value: '否'}],
330
- printUserInfo: {
331
- f_user_name: '',
332
- f_phone: '',
333
- f_address: ''
334
- },
335
- refresh: false,
336
- ifsearch: false,
337
- showpay: false, // 新增收费模态框开关
338
- showbuyerinfo: false, // 新增收费模态框开关
339
- selectsellid: null, //需要打票收费id
340
- buyerinfo: {
341
- id: '',
342
- f_buyer_name: '',
343
- f_buyer_identify: '',
344
- f_buyer_addphone: '',
345
- f_buyer_bank: '',
346
- f_buyer_email: '',
347
- rows: [] // 购货方信息
348
- },
349
- model: {
350
- f_isone: ['否'],
351
- chargeid: '',
352
- f_print: ['普通收据'],
353
- f_bill_type: '普通收据',
354
- f_bill_style: '普通发票',
355
- f_use_type: '报建费用',
356
- f_payment: ['现金缴费'],
357
- f_charge_money: 0,
358
- f_apply_num: '',//报建编号
359
- f_process_id: '',//流程ID
360
- f_payments: '',//首付
361
- f_pro_payment: '',//进度款
362
- f_end_payment: '',//尾款
363
- f_additional_payment: '',//追加款
364
- f_jmhj_cost: '',//减免金额
365
- subcost: 0, // 剩余付款
366
- f_total_cost: 0, // 总费用
367
- f_payfee_operator: '',//操作人
368
- f_payfee_department: '',//操作部门
369
- f_filiale: '',//分公司
370
- f_payfee_date: '',//操作日期
371
- f_contract_number: '',//合同编号
372
- f_cumulative_money: '',//累计缴费金额
373
- f_budget_money: '',//应交金额
374
- f_contract_money: '',//合同金额
375
- f_unaccounts_money: '',//未结总金额
376
- f_cumulative_invoicing: '',//--累计开票金额--
377
- f_residual_invoicing: '',//剩余开票金额
378
- f_main_contract_num: 0,//主合同编号
379
- rows: [], // 付费数据数组
380
- f_user_name: "",
381
- f_phone: "",
382
- f_address: "",
383
- f_userinfo_id: ""
384
- },
385
- billmodel: {
386
- f_user_name: "",
387
- f_phone: "",
388
- f_address: "",
389
- f_userinfo_id: ""
390
- },
391
- chargemoney: 0,
392
- chargeitems: this.$appdata.getParam('收费项目'),
393
- billstyles: this.$appdata.getParam('票据类型'),
394
- paymenttypes: this.$appdata.getParam('付款方式'),
395
- printstyle: this.$appdata.getParam('打印格式'),
396
- print: false,
397
- printat: false,
398
- delprint: false,
399
- delprintat:false,
400
- taxprint: false,
401
- billData: {
402
- url: 'rs/report/applyCharge_bill',
403
- bill: ''
404
- },
405
- billDataantai: {
406
- url: 'rs/report/applyChargeAT_bill',
407
- bill: ''
408
- },
409
- config: {
410
- hasPrint: true, //默认打票
411
- hasBillManage: true, //默认不启用发票管理
412
- billType: '报建收费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
413
- printType: '普通收据', // 收据/电子票/专用发票/国税发票
414
- payment: '现金缴费', // 付款方式
415
- brandspec: '材料费', // 收费类型
416
- billtype: "收费发票"
417
- },
418
- config2: {
419
- hasPrint: true, //默认打票
420
- hasBillManage: true, //默认不启用发票管理
421
- billType: '报建收费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
422
- printType: '普通收据', // 收据/电子票/专用发票/国税发票
423
- payment: '现金缴费', // 付款方式
424
- brandspec: '材料费', // 收费类型
425
- billtype: "冲正发票"
426
- },
427
- addItem: {
428
- f_charge_money: 0,
429
- f_amount_words: '',
430
- f_payment_type: '',
431
- f_charge_collectors: this.$login.f.name,
432
- f_charge_date: '',
433
- f_charge_remarks: '',
434
- f_filiale: '',
435
- f_process_id: '',
436
- f_apply_num: '',
437
- f_payment_method: '',
438
- f_charging_status: '有效',
439
- f_is_correct: '否',
440
- f_bill_style: ''
441
- },
442
- charges: [{f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0}],
443
- // 启用发票管理需要对票号进行验证
444
- hasValidateBill: false,
445
- validateOk: false,
446
- userinfoRow: {
447
- rows: []
448
- },
449
- oldInfo: {},
450
- bill: '', // 票数据
451
- paperticket: false,
452
- ids: {},
453
- paperinfo: {
454
- f_buy_name : '',
455
- f_pay_id : '',
456
- f_buy_address : '',
457
- f_buy_openbank : '',
458
- f_email_push:''
459
- },
460
- param: {},
461
- papershow: false
462
- }
463
- },
464
- props: ['infee', 'showfee'],
465
- ready() {
466
- this.load() // 初始化数据
467
-
468
- },
469
-
470
- methods: {
471
- async papaercom() {
472
- this.papershow = false
473
- console.log("this.paperinfo.",this.paperinfo)
474
- this.param.paperinfo=this.paperinfo
475
- // this.param.paperinfo.f_buy_name = this.paperinfo.f_buy_name ? this.paperinfo.f_buy_name : ''
476
- // this.param.paperinfo.f_pay_id = this.paperinfo.f_pay_id ? this.paperinfo.f_pay_id : ''
477
- // this.param.paperinfo.f_buy_address = this.paperinfo.f_buy_address ? this.paperinfo.f_buy_address : ''
478
- // this.param.paperinfo.f_buy_openbank = this.paperinfo.f_buy_openbank ? this.paperinfo.f_buy_openbank : ''
479
- if (this.param.f_print === '电子发票') {
480
- let temp = await this.$commonService.openEticket(this.param, '报装收费')
481
- console.log("temp", temp.data.f_bill_url)
482
- this.f_bill_url = temp.data.f_bill_url
483
- window.open(this.f_bill_url)
484
- this.param = {}
485
- this.$dispatch('success')
486
- } else if (this.param.f_print === '纸质专票') {
487
- await this.$commonService.openEticket(this.param, '报装收费')
488
- this.ids.id = this.param.id
489
- this.param = {}
490
- this.paperticket = true
491
- } else if (this.param.f_print === '纸质普票') {
492
- await this.$commonService.openEticket(this.param, '报装收费')
493
- this.ids.id = this.param.id
494
- this.param = {}
495
- this.paperticket = true
496
- }
497
- this.paperinfo.f_buy_name = ''
498
- this.paperinfo.f_pay_id = ''
499
- this.paperinfo.f_buy_address = ''
500
- this.paperinfo.f_buy_openbank = ''
501
- this.paperinfo.f_email_push=''
502
- },
503
- closeticket() {
504
- this.paperticket = false
505
- this.$dispatch('success')
506
- },
507
- //冲正
508
- deleteChargeRecord(index) {
509
- console.log(JSON.stringify(this.model.rows[index]))
510
- if (this.config.hasPrint) {
511
- if (this.model.f_print[0] === '普通收据') {
512
- if (this.config.hasBillManage) {
513
-
514
- this.model.f_bill_type = this.model.f_print[0]
515
- this.model.f_bill_style = this.model.f_print[0]
516
- this.print = true
517
-
518
- console.log('f_bill_style' + this.model.f_bill_style)
519
-
520
- } else {
521
- this.print = true
522
- }
523
- } else if (this.model.f_print[0] === '国税发票') {
524
- // TODO
525
- this.$dispatch('success')
526
- } else if (this.model.f_print[0] === '电子发票') {
527
- // TODO
528
- this.$dispatch('success')
529
- }
530
- } else {
531
- this.$dispatch('success')
532
- }
533
- this.$showMessage('是否冲正此条记录?', ['confirm', 'cancel']).then((res) => {
534
- if (res === 'confirm') {
535
- let param = {
536
- row: this.model.rows[index]
537
- }
538
- this.$resetpost('rs/logic/restChargeRecord', {data: param}, {resolveMsg: null, rejectMsg: "冲正失败!"})
539
- .then((res) => {
540
- this.$showAlert('冲正成功!', 'success', 5000)
541
- this.load()
542
- })
543
- } else {
544
- this.load()
545
- }
546
- })
547
- },
548
- getUserinfo(index) {
549
- console.log(index)
550
- console.log("a")
551
- this.model.f_user_name = this.userinfoRow.rows[index].f_user_name;
552
- this.model.f_process_id = this.userinfoRow.rows[index].f_process_id;
553
- this.model.f_phone = this.userinfoRow.rows[index].f_user_phone;
554
- this.model.f_address = this.userinfoRow.rows[index].address;
555
- this.model.f_userinfo_id = this.userinfoRow.rows[index].f_userinfo_id;
556
- this.billmodel.f_user_name = this.userinfoRow.rows[index].f_user_name;
557
- this.billmodel.f_phone = this.userinfoRow.rows[index].f_user_phone;
558
- this.billmodel.f_address = this.userinfoRow.rows[index].address;
559
- this.billmodel.f_userinfo_id = this.userinfoRow.rows[index].f_userinfo_id;
560
-
561
- },
562
- calcmoney(index) {
563
- console.log("开始计算");
564
- this.charges[index].f_money = this.charges[index].f_price * this.charges[index].f_amount
565
- let allmoney = 0;
566
- for (let i = 0; i < this.charges.length; i++) {
567
- allmoney += parseFloat(this.charges[i].f_money)
568
- }
569
- this.model.f_charge_money = allmoney
570
- // row.f_money = parseFloat(row.f_amount)*parseFloat(row.f_price);
571
- },
572
- addItems() {
573
- this.charges.push({f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0})
574
- },
575
- delItems(index) {
576
- console.log('index==', index);
577
- if (this.charges.length > 1) {
578
- this.charges.splice(index, 1)
579
- }
580
- },
581
- selfclean() {
582
- console.log("清空输入框")
583
- this.model.f_charge_money = 0
584
- this.model.f_amount_words = ''
585
- this.model.f_charge_remarks = ''
586
- },
587
- clean() {
588
- this.addItem = {
589
- f_charge_money: 0,
590
- f_amount_words: '',
591
- f_payment_type: '',
592
- f_charge_collectors: this.$login.f.name,
593
- f_charge_date: '',
594
- f_charge_remarks: '',
595
- f_filiale: '',
596
- f_process_id: '',
597
- f_apply_num: '',
598
- f_charging_status: '有效',
599
- f_is_correct: '否',
600
- f_bill_style: ''
601
- }
602
-
603
- // this.$dispatch('refresh', this.model)
604
- },
605
- close() {
606
- console.log("关闭打印框")
607
- this.taxprint = false
608
- this.print = false
609
- this.printat = false
610
- this.delprint = false
611
- this.delprintat = false
612
- this.clean()
613
- },
614
- printok() {
615
- console.log("successs............")
616
- this.$dispatch('success')
617
- },
618
- validateBill(val) {
619
- this.validateOk = !val.isOk
620
- this.billData.bill = val.bill
621
- },
622
-
623
- confirmbuyerinfo(args) {
624
- let drawbilldata = {
625
- sellid: this.selectsellid,
626
- buyerid: args.id,
627
- operator: this.$login.f.name
628
- }
629
- this.closebuyerinfo()
630
- this.$resetpost('rs/logic/applyDrawBill', {data: drawbilldata}, {resolveMsg: null, rejectMsg: "开发票失败"})
631
- .then((res) => {
632
- if (res.data.status === 200) {
633
- this.$showAlert('申请开具增值税电子发票成功,请稍后到报建功能中【报建收费】中查看电子发票', 'success', 5000)
634
-
635
- } else {
636
- this.$showAlert('电子发票开票失败,失败代码为:' + res.data.status, 'warning', 3000)
637
- }
638
- })
639
- },
640
- // 输入金额校验
641
- check() {
642
- console.log('check')
643
- let re = /^[+-]?\d+(\.\d+)?$/ //判断字符串是否为数字
644
- if (!this.model.f_charge_money) {//判断缴费金额是否为空
645
- console.log('check1')
646
- this.model.f_charge_money = 0
647
- } else {
648
- if (!re.test(this.model.f_charge_money)) {
649
- this.$showMessage("请输入数字")
650
- this.model.f_charge_money = ''
651
- return false
652
- }
653
- }
654
-
655
-
656
- return true
657
- },
658
-
659
- // 小写转换大写
660
- smalltoBIG(n) {
661
- let fraction = ['角', '分'];
662
- let digit = ['', '', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
663
- let unit = [['', '', '亿'], ['', '', '', '']];
664
- let head = n < 0 ? '' : '';
665
- n = Math.abs(n);
666
-
667
- let s = '';
668
-
669
- for (var i = 0; i < fraction.length; i++) {
670
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
671
- }
672
- s = s || '整';
673
- n = Math.floor(n);
674
-
675
- for (var i = 0; i < unit[0].length && n > 0; i++) {
676
- let p = '';
677
- for (var j = 0; j < unit[1].length && n > 0; j++) {
678
- p = digit[n % 10] + unit[1][j] + p;
679
- n = Math.floor(n / 10);
680
- }
681
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
682
- }
683
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
684
- },
685
-
686
- // 模态框确定按钮保存数据
687
-
688
- //
689
- // f_cumulative_money: 0,//累计缴费金额
690
- // f_unaccounts_money: '',//未结总金额
691
- // f_cumulative_invoicing: '',//--累计开票金额--
692
- // f_residual_invoicing: '',//剩余开票金额
693
- async confirm() {
694
- if (this.validateOk) {
695
- this.$showMessage("当前未分配发票号,请联系管理员!!");
696
- return;
697
- }
698
- Object.assign(this.model, this.model, this.billmodel);
699
-
700
- let flag = this.check()
701
- if (!flag) {
702
- return
703
- }
704
- if (Number(this.model.f_charge_money) > Number(this.model.f_unaccounts_money)) {
705
- this.$showMessage("缴费金额不能大于剩余金额")
706
- this.model.f_charge_money = 0
707
- this.model.f_amount_words = ''
708
- } else if (this.model.f_charge_money == 0 || this.model.f_charge_money == "" || this.model.f_charge_money == null) {
709
- this.$showMessage("不能缴费0")
710
- this.model.f_charge_money = 0
711
- this.model.f_amount_words = ''
712
- } else {
713
- //获取购货方信息
714
- http = new HttpResetClass()
715
- data = {
716
- tablename: 't_buyer_info',
717
- condition: `f_process_id = '${this.infee.f_process_id}' and f_apply_num = '${this.infee.f_apply_num}' `
718
- }
719
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
720
- resolveMsg: null,
721
- rejectMsg: '获取购货方信息失败'
722
- })
723
- this.buyerinfo.rows = res.data
724
- if (this.buyerinfo.rows.length < 1 && this.model.f_print[0] === '增值税电子发票' && this.$appdata.getSingleValue('默认打印票据') === '是') {
725
- this.$showAlert('未找到购买方信息,请去报建功能"购买方信息"中完善购买方信息后再收费', 'info', 2000)
726
- return
727
- }
728
-
729
- // 累计缴费金额
730
- let flag1 = this.accAdd(Number(this.model.f_charge_money), Number(this.model.f_cumulative_money))
731
- // 未结金额
732
- let flag2 = this.accSub(Number(this.model.f_unaccounts_money), Number(this.model.f_charge_money))
733
-
734
-
735
- let http = new HttpResetClass()
736
- console.log('f_charge_money' + Number(this.model.f_charge_money))
737
- console.log('f_unaccounts_money' + Number(this.model.f_unaccounts_money))
738
- this.addItem.f_charge_money = this.model.f_charge_money
739
- this.addItem.f_amount_words = this.model.f_amount_words
740
- console.log('f_payment' + this.model.f_payment)
741
- this.addItem.f_payment_method = this.model.f_payment[0]
742
- this.addItem.f_charge_collectors = this.$login.f.name
743
- this.addItem.f_charge_date = this.model.f_charge_date
744
- this.addItem.f_charge_remarks = this.model.f_charge_remarks
745
- this.addItem.f_filiale = this.model.f_payment_account =='安泰' ? '欣泰集团.安泰天然气' : '欣泰天然气'
746
- this.addItem.f_process_id = this.infee.f_process_id
747
- this.addItem.f_apply_num = this.infee.f_apply_num
748
- this.model.rows.push(this.addItem)
749
- let chargemoney = this.addItem.f_charge_money
750
- let chargeitem = this.addItem.f_f_charge_item
751
- let chargeremarks = this.addItem.f_charge_remarks ? this.addItem.f_charge_remarks : ''
752
- let chargebillstyle = this.model.f_print[0]
753
- this.chargemoney = this.addItem.f_charge_money
754
- this.addItem.f_bill_style = this.model.f_print[0]
755
- this.addItem.f_userinfo_id = this.model.f_userinfo_id
756
- this.addItem.f_charge_state = '已收费'
757
- if (this.model.f_user_name == "") {
758
-
759
- this.addItem.f_charge_user = this.oldInfo.f_user_name;
760
- } else {
761
- this.addItem.f_charge_user = this.model.f_user_name;
762
- }
763
- if (this.model.f_user_name == "") {
764
- this.addItem.f_charge_address = this.oldInfo.f_address;
765
- } else {
766
- this.addItem.f_charge_address = this.model.f_address;
767
- }
768
- console.log("==>" + JSON.stringify(this.oldInfo))
769
- let data = {
770
- tablename: 't_charge_record',
771
- parameters: this.addItem
772
- }
773
- // 生成收费记录的id
774
- let sellid = ''
775
- let ret = await http.load('POST', 'rs/logic/saveentity', {data: data})
776
- this.model.chargeid = ret.data.id
777
- console.log('ret==', ret)
778
- data = {
779
- f_cumulative_money: flag1,
780
- f_unaccounts_money: flag2,
781
- f_apply_num: this.infee.f_apply_num
782
- }
783
- //开始收费
784
- for (let i = 0; i < this.charges.length; i++) {
785
- let saveen = this.charges[i]
786
- saveen.f_project_item = this.charges[i].f_project_item[0]
787
- saveen.f_charge_record_id = parseFloat(ret.data.id);
788
- await http.load('POST', 'rs/logic/saveentity', {
789
- data: {
790
- tablename: 't_charge_record_item',
791
- parameters: saveen
792
- }
793
- }, {resolveMsg: null, rejectMsg: "失败"})
794
- }
795
-
796
- await http.load('POST', 'rs/logic/updatechargemoney', {data: data}, {resolveMsg: null, rejectMsg: "添加累计金额失败"})
797
- .then((res) => {
798
- this.charges = [{f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0}],
799
- this.close()
800
- this.load()
801
- })
802
- if (this.config.hasPrint) {
803
- if (this.model.f_print[0] === '普通收据') {
804
- if (this.config.hasBillManage) {
805
-
806
- this.model.f_bill_type = this.model.f_print[0]
807
- this.model.f_bill_style = this.model.f_print[0]
808
- debugger
809
- console.log('打印this.model.f_print[0]',this.model.f_print[0])
810
- debugger
811
- if(this.model.f_payment_account==='欣泰'){
812
- this.print = true
813
- }else{
814
- this.printat = true
815
- }
816
-
817
-
818
- console.log('f_bill_style' + this.model.f_bill_style)
819
-
820
- } else {
821
- debugger
822
- if(this.model.f_payment_account==='欣泰'){
823
- this.print = true
824
- }else{
825
- this.printat = true
826
- }
827
- }
828
- } else if (this.model.f_print[0] === '纸质普票') {
829
- this.param.f_print = this.model.f_print[0],
830
- this.param.id = ret.data.id,
831
- this.param.bz = this.model.f_charge_remarks
832
- this.papershow = true
833
- } else if (this.model.f_print[0] === '纸质专票') {
834
- // TODO
835
- this.param.f_print = this.model.f_print[0]
836
- this.param.id = ret.data.id
837
- this.param.bz = this.model.f_charge_remarks
838
- this.papershow = true
839
-
840
- } else if (this.model.f_print[0] === '电子发票') {
841
- // TODO
842
- this.param.f_print = this.model.f_print[0],
843
- this.param.id = ret.data.id,
844
- this.param.bz = this.model.f_charge_remarks
845
- this.papershow = true
846
-
847
-
848
- }
849
- } else {
850
- this.$dispatch('success')
851
- }
852
-
853
- }
854
- this.model.f_amount_words = ''
855
- this.model.f_charge_money = 0
856
- },
857
- async invoice(val) {
858
- console.log('打印票据')
859
- if (val.f_bill_style === '增值税电子发票') {
860
- this.selectsellid = val.id
861
- this.showbuyerinfo = true
862
- }
863
- },
864
-
865
- goback() {
866
- this.$dispatch('hiddenbtn')
867
- this.showview = false
868
- },
869
- async tovoid(index) {
870
- console.log(index)
871
- console.log(JSON.stringify(this.model.rows))
872
- this.model.rows[index].f_amount_words = "负" + this.model.rows[index].f_amount_words;
873
- this.model.rows[index].f_charge_money = -this.model.rows[index].f_charge_money;
874
- var val = this.model.rows[index];
875
- this.model.chargeid = val.id;
876
- this.delprint = false;
877
- this.charges = [{f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0}],
878
- console.log(JSON.stringify(val))
879
- // this.charges =[{f_project_item:'合同总额', f_amount: 0, f_price: 0,f_money:0}],
880
- if (val.f_is_correct === '' || val.f_charging_status !== '有效' || val.f_is_correct === '冲正中') {
881
- this.$showMessage('已冲正或正在冲正,不能操作!')
882
- } else {
883
- let param = {
884
- sellid: val.id,
885
- operator: this.$login.f.name
886
- }
887
- this.$resetpost('rs/logic/applyCancelDrawBill', {data: param}, {
888
- resolveMsg: null,
889
- rejectMsg: '冲正失败'
890
- }).then((res) => {
891
- if (res.data.status === 200) {
892
- this.model.chargeid = res.data.charge_id;
893
- if (val.f_bill_style === '增值税电子发票') {
894
- this.$showAlert('申请增值税电子发票冲正成功,请稍后到报建功能中【报建收费】中查看电子发票', 'success', 5000)
895
- if(this.model.f_payment_account==='欣泰'){
896
- this.delprint = true;
897
- }else{
898
- this.delprintat = true
899
- }
900
-
901
- } else {
902
- this.$showAlert('冲正成功', 'success', 2000)
903
- if(this.model.f_payment_account==='欣泰'){
904
- this.delprint = true;
905
- }else{
906
- this.delprintat = true
907
- }
908
- }
909
- if(this.model.f_payment_account==='欣泰'){
910
- this.delprint = true;
911
- }else{
912
- this.delprintat = true
913
- }
914
- this.load()
915
- } else {
916
- this.$showAlert('冲正失败', 'warning', 5000)
917
- }
918
- })
919
-
920
-
921
- }
922
- },
923
- tomakeup(val) {
924
- if (val.f_invoice_num) {
925
- this.$showMessage('此记录有票据,不能操作!')
926
- } else {
927
- this.invoice(val)
928
- }
929
- },
930
- //根据票据流水号查看票据
931
- async seeeticket(val) {
932
- console.log('该票据流水号为:', val.f_fpqqlsh)
933
- var eticketData = await this.$resetpost('rs/sql/querySingleTable', {
934
- data: {
935
- items: 'f_bill_url,f_url_code',
936
- tablename: 't_eticket',
937
- condition: `f_serial_number=${val.f_fpqqlsh}`
938
- }
939
- }, {resolveMsg: null, rejectMsg: null})
940
- console.log('eticketData:', eticketData)
941
- var data = eticketData.data[0]
942
- if (data.f_bill_url && data.f_bill_url != '') {
943
- console.log(data)
944
- var auth = data.f_bill_url.split("/")
945
- console.log("截取", auth)
946
- var authCode = auth[auth.length - 1]
947
- var url = `https://${auth[2]}/ent-views/fpExtract/get_fapiao.html?pwd=${data.f_url_code}&authCode=${authCode}`
948
- this.$showAlert('开票成功!', 'success', 500)
949
- window.open(url)
950
- return 'success'
951
- }
952
- return 'fail'
953
- },
954
- accSub(arg1, arg2) {
955
- var r1, r2, m, n;
956
- try {
957
- r1 = arg1.toString().split(".")[1].length
958
- } catch (e) {
959
- r1 = 0
960
- }
961
- try {
962
- r2 = arg2.toString().split(".")[1].length
963
- } catch (e) {
964
- r2 = 0
965
- }
966
- m = Math.pow(10, Math.max(r1, r2));
967
- //last modify by deeka
968
- //动态控制精度长度
969
- n = (r1 >= r2) ? r1 : r2;
970
- return ((arg1 * m - arg2 * m) / m).toFixed(n);
971
- },
972
- reset() {
973
- this.$dispatch('close')
974
- this.$dispatch('selfsearch')
975
- },
976
- accAdd(arg1, arg2) {
977
- var r1, r2, m;
978
- try {
979
- r1 = arg1.toString().split(".")[1].length
980
- } catch (e) {
981
- r1 = 0
982
- }
983
- try {
984
- r2 = arg2.toString().split(".")[1].length
985
- } catch (e) {
986
- r2 = 0
987
- }
988
- m = Math.pow(10, Math.max(r1, r2))
989
- return (arg1 * m + arg2 * m) / m
990
- },
991
-
992
- // 获取数据
993
- async load() {
994
- console.log('load被重新调用111')
995
- this.refresh = !this.refresh
996
- console.log("刷新validate,重新加载" + this.refresh)
997
- // this.ifsearch = !this.ifsearch
998
- let http = new HttpResetClass()
999
- let data = {
1000
- tablename: 't_apply',
1001
- condition: `f_process_id = '${this.infee.f_process_id}'`
1002
- //
1003
- }
1004
- //获取报建信息
1005
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取报建信息失败'})
1006
- Object.assign(this.model, this.model, res.data[0])
1007
- data = {
1008
- tablename: 't_charge_record',
1009
- condition: `f_process_id = '${this.infee.f_process_id}' and f_charging_status='有效' and f_is_correct='否'`
1010
- }
1011
- //获取付款详情信息
1012
- res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取付款数据失败'})
1013
- // 去除付款时间的时分秒
1014
- for (var i = 0; i < res.data.length; i++) {
1015
- res.data[i].f_charge_date = res.data[i].f_charge_date.substring(0, 11)
1016
- }
1017
- this.model.rows = res.data
1018
- this.model.f_cumulative_money = 0;
1019
- for (let i = 0; i < res.data.length; i++) {
1020
- this.model.f_cumulative_money =parseFloat(parseFloat(this.model.f_cumulative_money) + parseFloat(res.data[i].f_charge_money)).toFixed(2) ;
1021
- }
1022
-
1023
-
1024
- //获取购货方信息
1025
- data = {
1026
- tablename: 't_buyer_info',
1027
- condition: `f_process_id = '${this.infee.f_process_id}' and f_apply_num = '${this.infee.f_apply_num}' `
1028
- }
1029
- res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取购货方信息失败'})
1030
- this.buyerinfo.rows = res.data
1031
-
1032
- //获取用户信息
1033
- data = {
1034
- condition: this.infee.f_process_id
1035
- }
1036
- let userinfores = await http.load('POST', 'rs/sql/getBillUserinfo', {data: data}, {
1037
- resolveMsg: null,
1038
- rejectMsg: '获取用户信息失败!'
1039
- })
1040
- this.userinfoRow.rows = userinfores.data;
1041
-
1042
- this.oldInfo.f_user_name = this.model.f_user_name;
1043
- this.oldInfo.f_phone = this.model.f_phone;
1044
- this.oldInfo.f_address = this.model.f_address;
1045
- this.model.f_isone = ['否'];
1046
- this.charges = [{f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0}];
1047
- this.hasValidateBill=true
1048
- console.log('load被重新调用222')
1049
- }
1050
- },
1051
- computed: {
1052
-
1053
- // 计算大写
1054
- getCapital() {
1055
- if (this.model.f_charge_money) {
1056
- this.model.f_amount_words = this.smalltoBIG(Number(this.model.f_charge_money))
1057
- }
1058
-
1059
- return this.model.f_amount_words
1060
- },
1061
- subcost() {
1062
- let temp = Number(this.model.f_total_cost)
1063
- let temp2 = 0
1064
- for (var i = 0; i < this.model.rows.length; i++) {
1065
- temp2 += Number(this.model.rows[i].f_fee)
1066
- }
1067
- this.model.f_cumulative_money = Math.round(temp2 * 100) / 100
1068
- this.model.subcost = Math.round((temp - temp2) * 100) / 100
1069
- if (this.model.f_cumulative_money && this.model.f_jmhj_cost) {
1070
- temp = Math.round((temp - Number(this.model.f_jmhj_cost)) * 100) / 100
1071
- }
1072
- this.model.subcost = Math.round((temp - temp2) * 100) / 100
1073
- return this.model.subcost
1074
- },
1075
- // totalcost () {
1076
- // this.model.f_total_cost = Number(this.model.f_construction_cost) + Number(this.model.f_material_cost)
1077
- // + Number(this.model.f_labor_cost) + Number(this.model.f_change_pipeline_cost)
1078
- // + Number(this.model.f_sbaz_cost) - Number(this.model.f_jmhj_cost)
1079
- // return this.model.f_total_cost
1080
- // },
1081
- aaa() {
1082
- this.model.f_jmhj_cost = Number(this.model.f_total_cost) - Number(this.model.f_actualfee)
1083
- return this.model.f_jmhj_cost
1084
- },
1085
- feeoptions() {
1086
- return this.$appdata.getParam('费用类型')
1087
- },
1088
- dayin() {
1089
- return this.$appdata.getParam('打印格式')
1090
- },
1091
- jiaofei() {
1092
- return this.$appdata.getParam('付款方式')
1093
- // return [{label: '全部', value: ''}, ...AppData.getParam('缴费类型')]
1094
- }
1095
- },
1096
- watch: {
1097
- 'model.f_isone'(val) {
1098
- console.log('111111111is one', val, val[0] == '是')
1099
- if (val[0] == '是') {
1100
- this.isSingleUser = true
1101
- this.model.f_user_name = ""
1102
- this.model.f_phone = ""
1103
- this.model.f_address = ""
1104
- this.model.f_userinfo_id = "";
1105
- } else {
1106
- this.isSingleUser = false
1107
- this.model.f_user_name = this.oldInfo.f_user_name
1108
- this.model.f_phone = this.oldInfo.f_phone
1109
- this.model.f_address = this.oldInfo.f_address
1110
- this.model.f_userinfo_id = "";
1111
- }
1112
- },
1113
- 'infee'(val) {
1114
- this.load()
1115
- },
1116
- 'print'(val) {
1117
- this.load()
1118
- }
1119
- },
1120
- }
1121
- </script>
1
+ <template>
2
+ <div class="col-sm-12 auto select-overspread">
3
+ <div class="auto select-overspread">
4
+ <div class="panel panel-info">
5
+ <div class="panel-heading auto">
6
+ <div class="col-sm-12 recordTable" style="height: 200px">
7
+ <partial-view v-ref:single-load v-if="!isSingleUser">
8
+ <data-grid :model="model" v-ref:grid>
9
+ <template partial='head'>
10
+ <tr>
11
+ <th>
12
+ <nobr>序号</nobr>
13
+ </th>
14
+ <th>
15
+ <nobr>用户</nobr>
16
+ </th>
17
+ <th>
18
+ <nobr>地址</nobr>
19
+ </th>
20
+ <th>
21
+ <nobr>收费金额(元)</nobr>
22
+ </th>
23
+ <th>
24
+ <nobr>收费人员</nobr>
25
+ </th>
26
+ <th>
27
+ <nobr>日期</nobr>
28
+ </th>
29
+ <th>
30
+ <nobr>备注</nobr>
31
+ </th>
32
+ <th>
33
+ <nobr>操作</nobr>
34
+ </th>
35
+ </tr>
36
+ </template>
37
+ <template partial='body'>
38
+ <td style="text-align: center">{{$index+1}}</td>
39
+ <td style="text-align: center">{{row.f_charge_user}}</td>
40
+ <td style="text-align: center">{{row.f_charge_address}}</td>
41
+ <td style="text-align: center">{{row.f_charge_money}}</td>
42
+ <td style="text-align: center">{{row.f_charge_collectors}}</td>
43
+ <td style="text-align: center">{{row.f_charge_date}}</td>
44
+ <td style="text-align: center">{{row.f_charge_remarks}}</td>
45
+ <td style="text-align: center">
46
+ <button class="btn btn-default" @click="$parent.$parent.$parent.tovoid($index)">冲正</button>
47
+ </td>
48
+ </template>
49
+ </data-grid>
50
+ </partial-view>
51
+ <partial-view v-ref:single-user v-if="isSingleUser">
52
+ <data-grid :model="userinfoRow" v-ref:grid>
53
+ <template partial='head'>
54
+ <tr>
55
+ <th>
56
+ <nobr>序号</nobr>
57
+ </th>
58
+ <th>
59
+ <nobr>用户名</nobr>
60
+ </th>
61
+ <th>
62
+ <nobr>用户电话</nobr>
63
+ </th>
64
+ <th>
65
+ <nobr>地址</nobr>
66
+ </th>
67
+ <th>
68
+ <nobr>操作</nobr>
69
+ </th>
70
+ </tr>
71
+ </template>
72
+ <template partial='body'>
73
+ <td style="text-align: center">{{$index+1}}</td>
74
+ <td style="text-align: center">{{row.f_user_name}}</td>
75
+ <td style="text-align: center">{{row.f_user_phone}}</td>
76
+ <td style="text-align: center">{{row.address}}</td>
77
+ <button type="button" name="button" class="btn btn-link"
78
+ @click.stop="$parent.$parent.$parent.getUserinfo($index)">收费
79
+ </button>
80
+ </template>
81
+ </data-grid>
82
+ </partial-view>
83
+ <form novalidate class="form-horizontal">
84
+ <p class="bg-info text-center" style="padding: 10px;"></p>
85
+ <p class="bg-info text-center" style="padding: 10px;">收费信息</p>
86
+ <div class="row" style="margin-top:10px;">
87
+ <div class="form-input-group col-sm-3">
88
+ <label for="f_user_name" class="control-label col-sm-2 ">用户名称</label>
89
+ <div class="col-sm-2">
90
+ <input type="text" class="form-control" @blur="getUserinfo" v-model="model.f_user_name">
91
+ </div>
92
+ </div>
93
+ <div class="form-input-group col-sm-3">
94
+ <label for="f_phone" class="control-label col-sm-2 ">联系电话</label>
95
+ <div class="col-sm-2">
96
+ <input type="text" class="form-control" @blur="getUserinfo" v-model="model.f_phone" readonly>
97
+
98
+ </div>
99
+ </div>
100
+ <div class="form-input-group col-sm-6">
101
+ <label for="f_address" class="control-label col-sm-2 ">地址</label>
102
+ <div class="col-sm-2">
103
+ <input type="text" class="form-control" @blur="getUserinfo" v-model="model.f_address" readonly>
104
+ </div>
105
+ </div>
106
+ </div>
107
+ <div class="row" style="margin-top:10px;">
108
+ <div class="form-input-group col-sm-3">
109
+ <label for="f_brand_spec" class="control-label col-sm-2 ">应交金额(元)</label>
110
+ <div class="col-sm-2">
111
+ <input type="text" class="form-control" v-model="model.f_total_cost" readonly>
112
+ </div>
113
+ </div>
114
+ <div class="form-input-group col-sm-3">
115
+ <label for="f_brand_spec" class="control-label col-sm-2 ">累计缴费金额(元)</label>
116
+ <div class="col-sm-2">
117
+ <input type="text" class="form-control" v-model="model.f_cumulative_money" readonly>
118
+ </div>
119
+ </div>
120
+ <div class="form-input-group col-sm-3">
121
+ <label for="f_brand_spec" class="control-label col-sm-2 ">未结总金额(元)</label>
122
+ <div class="col-sm-2">
123
+ <input type="text" class="form-control" v-model="model.f_unaccounts_money" readonly>
124
+ </div>
125
+ </div>
126
+ <div class="form-input-group col-sm-3">
127
+ <label for="f_brand_spec" class="control-label col-sm-2 ">金额(元)</label>
128
+ <div class="col-sm-2">
129
+ <input type="text" class="form-control" :placeholder="0" v-model="model.f_charge_money"
130
+ disabled="true">
131
+ </div>
132
+ </div>
133
+ </div>
134
+ <div class="row" style="margin-top:10px;">
135
+ <div class="form-input-group col-sm-3">
136
+ <label for="f_isone" class="control-label col-sm-2">单户打印:</label>
137
+ <div class="col-sm-2">
138
+ <v-select id="isone" width="100%"
139
+ v-model="f_isone"
140
+ placeholder='请选择'
141
+ :value.sync="model.f_isone"
142
+ :options='isOne'
143
+ close-on-select clear-button>
144
+ </v-select>
145
+ </div>
146
+ </div>
147
+ <div class="form-input-group col-sm-3">
148
+ <label for="f_paytype" class="control-label col-sm-2">付款方式:</label>
149
+ <div class="col-sm-2">
150
+ <v-select id="f_payment" width="100%"
151
+ v-model="f_payment"
152
+ placeholder='请选择'
153
+ :value.sync="model.f_payment"
154
+ :options='paymenttypes'
155
+ close-on-select clear-button>
156
+ </v-select>
157
+ </div>
158
+ </div>
159
+ <div class="form-input-group col-sm-3">
160
+
161
+ <label for="f_print" class="control-label col-sm-2">打印格式:</label>
162
+ <div class="col-sm-2">
163
+ <v-select id="print" width="100%"
164
+ v-model="f_print"
165
+ placeholder='请选择'
166
+ :value.sync="model.f_print"
167
+ :options='printstyle'
168
+ close-on-select clear-button>
169
+ </v-select>
170
+ </div>
171
+ </div>
172
+ <div class="form-input-group col-sm-3">
173
+ <label for="f_brand_spec" class="control-label col-sm-2 ">金额大写(元)</label>
174
+ <div class="col-sm-2">
175
+ <input type="text" class="form-control" v-model="getCapital" readonly>
176
+ </div>
177
+ </div>
178
+ </div>
179
+ <div class="row" style="margin-top:10px;" v-for="(index,row) in charges">
180
+ <div class="form-input-group col-sm-12">
181
+ <div class="form-input-group col-sm-3">
182
+ <label for="f_charge_item" class="control-label col-sm-2">
183
+ <button class="glyphicon glyphicon-minus btn-danger" v-if="$index>0"
184
+ @click.stop="delItems($index)"></button>&nbsp;&nbsp;&nbsp;
185
+ <button class="glyphicon glyphicon-plus btn-success" @click.stop="addItems()"></button>
186
+ </label>
187
+ <div class="col-sm-2">
188
+ <v-select id="f_charge_item" +$index
189
+ v-model="f_project_item" width="100%"
190
+ placeholder='收费项目'
191
+ :value.sync="row.f_project_item"
192
+ :options='chargeitems'
193
+ close-on-select clear-button>
194
+ </v-select>
195
+ </div>
196
+ </div>
197
+ <div class="form-input-group col-sm-3">
198
+ <label for="f_amount" class="control-label col-sm-2">数量:</label>
199
+ <div class="col-sm-2">
200
+ <input class="form-control" style="background-color: white" type="number" v-model="row.f_amount"
201
+ :disabled="isDisable"
202
+ placeholder="数量" :blur="calcmoney(index)">
203
+ </div>
204
+ </div>
205
+ <div class="form-input-group col-sm-3">
206
+ <label for="f_price" class="control-label col-sm-2">单价:</label>
207
+ <div class="col-sm-2">
208
+ <input class="form-control" style="background-color: white" type="number" v-model="row.f_price"
209
+ :disabled="isDisable"
210
+ placeholder="单价" :blur="calcmoney(index)">
211
+ </div>
212
+ </div>
213
+ <div class="form-input-group col-sm-3">
214
+ <label for="f_money" class="control-label col-sm-2">金额:</label>
215
+ <div class="col-sm-2">
216
+ <input class="form-control" style="background-color: white" type="number" v-model="row.f_money"
217
+ :disabled="true"
218
+ placeholder="金额">
219
+ </div>
220
+ </div>
221
+ </div>
222
+ </div>
223
+ <div class="row" style="margin-top:10px;">
224
+ <div class="form-input-group col-sm-8">
225
+ <label for="f_paytype" class="control-label col-sm-2">备注:</label>
226
+ <input type="text" class="form-control" v-model="model.f_charge_remarks">
227
+ </div>
228
+ </div>
229
+ <apply-validate-bill v-if="hasValidateBill" :show="refresh" :data="model"
230
+ @validate-bill="validateBill"></apply-validate-bill>
231
+ <printbill :show="print" :data='model' :selfclean="selfclean" :bill-config='config' :bill-data='billData'
232
+ v-on:toggle="close" :selfsearch="load" @printok="printok" v-ref:printbill></printbill>
233
+ <printbill :show="printat" :data='model' :selfclean="selfclean" :bill-config='config' :bill-data='billDataantai'
234
+ v-on:toggle="close" :selfsearch="load" @printok="printok" v-ref:printbill></printbill>
235
+ <bjpaper-ticket-bill :show="paperticket" :data='ids' @toggle="closeticket"></bjpaper-ticket-bill>
236
+ <printbill :show="delprint" :data='model' :selfclean="selfclean" :bill-config='config2'
237
+ :bill-data='billData' v-on:toggle="close" :selfsearch="load" @printok="printok"
238
+ v-ref:printbill></printbill>
239
+ <printbill :show="delprintat" :data='model' :selfclean="selfclean" :bill-config='config2'
240
+ :bill-data='billDataantai' v-on:toggle="close" :selfsearch="load" @printok="printok"
241
+ v-ref:printbill></printbill>
242
+ <div class="row" style="text-align:right;">
243
+ <button :readonly="!validateOk" type="button" class="btn btn-success" style="" @click='confirm'>确认
244
+ </button>
245
+ </div>
246
+ </form>
247
+ </div>
248
+ </div>
249
+ </div>
250
+ </div>
251
+ </div>
252
+ <modal :show.sync="papershow" v-ref:modal large backdrop="false">
253
+ <header slot="modal-header" class="modal-header">
254
+ <h3 style="color:black" class="modal-title">购货方信息</h3>
255
+ </header>
256
+ <article slot="modal-body" class="modal-body">
257
+
258
+ <validator name='v'>
259
+ <form class="form-horizontal select-overspread">
260
+ <div class="row" style="display: flex;justify-content: center;" id='normal-bill'>
261
+ <div class="form-group col-sm-6">
262
+ <label class=" col-sm-2 control-label">购买方名称:</label>
263
+ <input type="text" class="form-control" v-model="paperinfo.f_buy_name" style="width:60%"
264
+ :value.sync="paperinfo.f_buy_name" placeholder="购买方名称"
265
+ >
266
+ </div>
267
+ <div class="form-group col-sm-6">
268
+ <label class=" col-sm-2 control-label">纳税人识别号:</label>
269
+ <input type="text" class="form-control" v-model="paperinfo.f_pay_id" style="width:60%"
270
+ placeholder="纳税人识别号" :value.sync="paperinfo.f_pay_id"
271
+ >
272
+ </div>
273
+ </div>
274
+ <div class="row">
275
+ <div class="form-group col-sm-6">
276
+ <label class=" col-sm-2 control-label">购买方地址电话:</label>
277
+ <input type="text" class="form-control" v-model="paperinfo.f_buy_address" style="width:60%"
278
+ placeholder="购买方地址" :value.sync="paperinfo.f_buy_address"
279
+ >
280
+ </div>
281
+ <div class="form-group col-sm-6">
282
+ <label class=" col-sm-2 control-label">购买方开户行及账号:</label>
283
+ <input type="text" class="form-control" v-model="paperinfo.f_buy_openbank" style="width:60%"
284
+ placeholder="购买方开户行及账号" :value.sync="paperinfo.f_buy_openbank"
285
+ >
286
+ </div>
287
+ <div class="form-group col-sm-6">
288
+ <label class=" col-sm-2 control-label">邮箱:</label>
289
+ <input type="text" class="form-control" v-model="paperinfo.f_email_push" style="width:60%"
290
+ placeholder="邮箱" :value.sync="paperinfo.f_email_push"
291
+ >
292
+ </div>
293
+ </div>
294
+
295
+
296
+ </form>
297
+ </validator>
298
+ </article>
299
+ <footer slot="modal-footer" class="modal-footer">
300
+ <button type="button" class="btn btn-default" @click='papaercom()'>确认</button>
301
+ </footer>
302
+ </modal>
303
+ </template>
304
+ <script>
305
+ import {HttpResetClass} from 'vue-client'
306
+ import InputAndSelect from "vue-client/src/vue-strap/src/InputAndSelect";
307
+ import {DataModel} from 'vue-client'
308
+ import commonService from "../../../../plugins/commonService.js";
309
+
310
+ let gen = function* (self, val) {
311
+ val.f_actualfee_type = val.f_actualfee_type[0]
312
+ yield self.$resetpost('rs/logic/saveentity', {data: {tablename: 't_apply', parameters: val}})
313
+ delete val.id
314
+ self.$resetpost('rs/logic/saveentity', {data: {tablename: 't_record', parameters: val}})
315
+ .then(() => {
316
+ self.reset()
317
+ })
318
+ }
319
+ export default {
320
+
321
+ components: {InputAndSelect},
322
+ title: '报装收费',
323
+ data() {
324
+ return {
325
+ billtype: {
326
+ name: "收费发票"
327
+ },
328
+ isSingleUser: false,
329
+ isOne: [{label: '是', value: '是'}, {label: '否', value: '否'}],
330
+ printUserInfo: {
331
+ f_user_name: '',
332
+ f_phone: '',
333
+ f_address: ''
334
+ },
335
+ refresh: false,
336
+ ifsearch: false,
337
+ showpay: false, // 新增收费模态框开关
338
+ showbuyerinfo: false, // 新增收费模态框开关
339
+ selectsellid: null, //需要打票收费id
340
+ buyerinfo: {
341
+ id: '',
342
+ f_buyer_name: '',
343
+ f_buyer_identify: '',
344
+ f_buyer_addphone: '',
345
+ f_buyer_bank: '',
346
+ f_buyer_email: '',
347
+ rows: [] // 购货方信息
348
+ },
349
+ model: {
350
+ f_isone: ['否'],
351
+ chargeid: '',
352
+ f_print: ['普通收据'],
353
+ f_bill_type: '普通收据',
354
+ f_bill_style: '普通发票',
355
+ f_use_type: '报建费用',
356
+ f_payment: ['现金缴费'],
357
+ f_charge_money: 0,
358
+ f_apply_num: '',//报建编号
359
+ f_process_id: '',//流程ID
360
+ f_payments: '',//首付
361
+ f_pro_payment: '',//进度款
362
+ f_end_payment: '',//尾款
363
+ f_additional_payment: '',//追加款
364
+ f_jmhj_cost: '',//减免金额
365
+ subcost: 0, // 剩余付款
366
+ f_total_cost: 0, // 总费用
367
+ f_payfee_operator: '',//操作人
368
+ f_payfee_department: '',//操作部门
369
+ f_filiale: '',//分公司
370
+ f_payfee_date: '',//操作日期
371
+ f_contract_number: '',//合同编号
372
+ f_cumulative_money: '',//累计缴费金额
373
+ f_budget_money: '',//应交金额
374
+ f_contract_money: '',//合同金额
375
+ f_unaccounts_money: '',//未结总金额
376
+ f_cumulative_invoicing: '',//--累计开票金额--
377
+ f_residual_invoicing: '',//剩余开票金额
378
+ f_main_contract_num: 0,//主合同编号
379
+ rows: [], // 付费数据数组
380
+ f_user_name: "",
381
+ f_phone: "",
382
+ f_address: "",
383
+ f_userinfo_id: ""
384
+ },
385
+ billmodel: {
386
+ f_user_name: "",
387
+ f_phone: "",
388
+ f_address: "",
389
+ f_userinfo_id: ""
390
+ },
391
+ chargemoney: 0,
392
+ chargeitems: this.$appdata.getParam('收费项目'),
393
+ billstyles: this.$appdata.getParam('票据类型'),
394
+ paymenttypes: this.$appdata.getParam('付款方式'),
395
+ printstyle: this.$appdata.getParam('打印格式'),
396
+ print: false,
397
+ printat: false,
398
+ delprint: false,
399
+ delprintat:false,
400
+ taxprint: false,
401
+ billData: {
402
+ url: 'rs/report/applyCharge_bill',
403
+ bill: ''
404
+ },
405
+ billDataantai: {
406
+ url: 'rs/report/applyChargeAT_bill',
407
+ bill: ''
408
+ },
409
+ config: {
410
+ hasPrint: true, //默认打票
411
+ hasBillManage: true, //默认不启用发票管理
412
+ billType: '报建收费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
413
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
414
+ payment: '现金缴费', // 付款方式
415
+ brandspec: '材料费', // 收费类型
416
+ billtype: "收费发票"
417
+ },
418
+ config2: {
419
+ hasPrint: true, //默认打票
420
+ hasBillManage: true, //默认不启用发票管理
421
+ billType: '报建收费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
422
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
423
+ payment: '现金缴费', // 付款方式
424
+ brandspec: '材料费', // 收费类型
425
+ billtype: "冲正发票"
426
+ },
427
+ addItem: {
428
+ f_charge_money: 0,
429
+ f_amount_words: '',
430
+ f_payment_type: '',
431
+ f_charge_collectors: this.$login.f.name,
432
+ f_charge_date: '',
433
+ f_charge_remarks: '',
434
+ f_filiale: '',
435
+ f_process_id: '',
436
+ f_apply_num: '',
437
+ f_payment_method: '',
438
+ f_charging_status: '有效',
439
+ f_is_correct: '否',
440
+ f_bill_style: ''
441
+ },
442
+ charges: [{f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0}],
443
+ // 启用发票管理需要对票号进行验证
444
+ hasValidateBill: false,
445
+ validateOk: false,
446
+ userinfoRow: {
447
+ rows: []
448
+ },
449
+ oldInfo: {},
450
+ bill: '', // 票数据
451
+ paperticket: false,
452
+ ids: {},
453
+ paperinfo: {
454
+ f_buy_name : '',
455
+ f_pay_id : '',
456
+ f_buy_address : '',
457
+ f_buy_openbank : '',
458
+ f_email_push:''
459
+ },
460
+ param: {},
461
+ papershow: false
462
+ }
463
+ },
464
+ props: ['infee', 'showfee'],
465
+ ready() {
466
+ this.load() // 初始化数据
467
+
468
+ },
469
+
470
+ methods: {
471
+ async papaercom() {
472
+ this.papershow = false
473
+ console.log("this.paperinfo.",this.paperinfo)
474
+ this.param.paperinfo=this.paperinfo
475
+ // this.param.paperinfo.f_buy_name = this.paperinfo.f_buy_name ? this.paperinfo.f_buy_name : ''
476
+ // this.param.paperinfo.f_pay_id = this.paperinfo.f_pay_id ? this.paperinfo.f_pay_id : ''
477
+ // this.param.paperinfo.f_buy_address = this.paperinfo.f_buy_address ? this.paperinfo.f_buy_address : ''
478
+ // this.param.paperinfo.f_buy_openbank = this.paperinfo.f_buy_openbank ? this.paperinfo.f_buy_openbank : ''
479
+ if (this.param.f_print === '电子发票') {
480
+ let temp = await this.$commonService.openEticket(this.param, '报装收费')
481
+ console.log("temp", temp.data.f_bill_url)
482
+ this.f_bill_url = temp.data.f_bill_url
483
+ window.open(this.f_bill_url)
484
+ this.param = {}
485
+ this.$dispatch('success')
486
+ } else if (this.param.f_print === '纸质专票') {
487
+ await this.$commonService.openEticket(this.param, '报装收费')
488
+ this.ids.id = this.param.id
489
+ this.param = {}
490
+ this.paperticket = true
491
+ } else if (this.param.f_print === '纸质普票') {
492
+ await this.$commonService.openEticket(this.param, '报装收费')
493
+ this.ids.id = this.param.id
494
+ this.param = {}
495
+ this.paperticket = true
496
+ }
497
+ this.paperinfo.f_buy_name = ''
498
+ this.paperinfo.f_pay_id = ''
499
+ this.paperinfo.f_buy_address = ''
500
+ this.paperinfo.f_buy_openbank = ''
501
+ this.paperinfo.f_email_push=''
502
+ },
503
+ closeticket() {
504
+ this.paperticket = false
505
+ this.$dispatch('success')
506
+ },
507
+ //冲正
508
+ deleteChargeRecord(index) {
509
+ console.log(JSON.stringify(this.model.rows[index]))
510
+ if (this.config.hasPrint) {
511
+ if (this.model.f_print[0] === '普通收据') {
512
+ if (this.config.hasBillManage) {
513
+
514
+ this.model.f_bill_type = this.model.f_print[0]
515
+ this.model.f_bill_style = this.model.f_print[0]
516
+ this.print = true
517
+
518
+ console.log('f_bill_style' + this.model.f_bill_style)
519
+
520
+ } else {
521
+ this.print = true
522
+ }
523
+ } else if (this.model.f_print[0] === '国税发票') {
524
+ // TODO
525
+ this.$dispatch('success')
526
+ } else if (this.model.f_print[0] === '电子发票') {
527
+ // TODO
528
+ this.$dispatch('success')
529
+ }
530
+ } else {
531
+ this.$dispatch('success')
532
+ }
533
+ this.$showMessage('是否冲正此条记录?', ['confirm', 'cancel']).then((res) => {
534
+ if (res === 'confirm') {
535
+ let param = {
536
+ row: this.model.rows[index]
537
+ }
538
+ this.$resetpost('rs/logic/restChargeRecord', {data: param}, {resolveMsg: null, rejectMsg: "冲正失败!"})
539
+ .then((res) => {
540
+ this.$showAlert('冲正成功!', 'success', 5000)
541
+ this.load()
542
+ })
543
+ } else {
544
+ this.load()
545
+ }
546
+ })
547
+ },
548
+ getUserinfo(index) {
549
+ console.log(index)
550
+ console.log("a")
551
+ this.model.f_user_name = this.userinfoRow.rows[index].f_user_name;
552
+ this.model.f_process_id = this.userinfoRow.rows[index].f_process_id;
553
+ this.model.f_phone = this.userinfoRow.rows[index].f_user_phone;
554
+ this.model.f_address = this.userinfoRow.rows[index].address;
555
+ this.model.f_userinfo_id = this.userinfoRow.rows[index].f_userinfo_id;
556
+ this.billmodel.f_user_name = this.userinfoRow.rows[index].f_user_name;
557
+ this.billmodel.f_phone = this.userinfoRow.rows[index].f_user_phone;
558
+ this.billmodel.f_address = this.userinfoRow.rows[index].address;
559
+ this.billmodel.f_userinfo_id = this.userinfoRow.rows[index].f_userinfo_id;
560
+
561
+ },
562
+ calcmoney(index) {
563
+ console.log("开始计算");
564
+ this.charges[index].f_money = this.charges[index].f_price * this.charges[index].f_amount
565
+ let allmoney = 0;
566
+ for (let i = 0; i < this.charges.length; i++) {
567
+ allmoney += parseFloat(this.charges[i].f_money)
568
+ }
569
+ this.model.f_charge_money = allmoney
570
+ // row.f_money = parseFloat(row.f_amount)*parseFloat(row.f_price);
571
+ },
572
+ addItems() {
573
+ this.charges.push({f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0})
574
+ },
575
+ delItems(index) {
576
+ console.log('index==', index);
577
+ if (this.charges.length > 1) {
578
+ this.charges.splice(index, 1)
579
+ }
580
+ },
581
+ selfclean() {
582
+ console.log("清空输入框")
583
+ this.model.f_charge_money = 0
584
+ this.model.f_amount_words = ''
585
+ this.model.f_charge_remarks = ''
586
+ },
587
+ clean() {
588
+ this.addItem = {
589
+ f_charge_money: 0,
590
+ f_amount_words: '',
591
+ f_payment_type: '',
592
+ f_charge_collectors: this.$login.f.name,
593
+ f_charge_date: '',
594
+ f_charge_remarks: '',
595
+ f_filiale: '',
596
+ f_process_id: '',
597
+ f_apply_num: '',
598
+ f_charging_status: '有效',
599
+ f_is_correct: '否',
600
+ f_bill_style: ''
601
+ }
602
+
603
+ // this.$dispatch('refresh', this.model)
604
+ },
605
+ close() {
606
+ console.log("关闭打印框")
607
+ this.taxprint = false
608
+ this.print = false
609
+ this.printat = false
610
+ this.delprint = false
611
+ this.delprintat = false
612
+ this.clean()
613
+ },
614
+ printok() {
615
+ console.log("successs............")
616
+ this.$dispatch('success')
617
+ },
618
+ validateBill(val) {
619
+ this.validateOk = !val.isOk
620
+ this.billData.bill = val.bill
621
+ this.billDataantai.bill = val.bill
622
+ },
623
+
624
+ confirmbuyerinfo(args) {
625
+ let drawbilldata = {
626
+ sellid: this.selectsellid,
627
+ buyerid: args.id,
628
+ operator: this.$login.f.name
629
+ }
630
+ this.closebuyerinfo()
631
+ this.$resetpost('rs/logic/applyDrawBill', {data: drawbilldata}, {resolveMsg: null, rejectMsg: "开发票失败"})
632
+ .then((res) => {
633
+ if (res.data.status === 200) {
634
+ this.$showAlert('申请开具增值税电子发票成功,请稍后到报建功能中【报建收费】中查看电子发票', 'success', 5000)
635
+
636
+ } else {
637
+ this.$showAlert('电子发票开票失败,失败代码为:' + res.data.status, 'warning', 3000)
638
+ }
639
+ })
640
+ },
641
+ // 输入金额校验
642
+ check() {
643
+ console.log('check')
644
+ let re = /^[+-]?\d+(\.\d+)?$/ //判断字符串是否为数字
645
+ if (!this.model.f_charge_money) {//判断缴费金额是否为空
646
+ console.log('check1')
647
+ this.model.f_charge_money = 0
648
+ } else {
649
+ if (!re.test(this.model.f_charge_money)) {
650
+ this.$showMessage("请输入数字")
651
+ this.model.f_charge_money = ''
652
+ return false
653
+ }
654
+ }
655
+
656
+
657
+ return true
658
+ },
659
+
660
+ // 小写转换大写
661
+ smalltoBIG(n) {
662
+ let fraction = ['', ''];
663
+ let digit = ['', '', '', '', '', '', '', '柒', '捌', '玖'];
664
+ let unit = [['元', '万', '亿'], ['', '', '佰', '']];
665
+ let head = n < 0 ? '欠' : '';
666
+ n = Math.abs(n);
667
+
668
+ let s = '';
669
+
670
+ for (var i = 0; i < fraction.length; i++) {
671
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
672
+ }
673
+ s = s || '整';
674
+ n = Math.floor(n);
675
+
676
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
677
+ let p = '';
678
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
679
+ p = digit[n % 10] + unit[1][j] + p;
680
+ n = Math.floor(n / 10);
681
+ }
682
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
683
+ }
684
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
685
+ },
686
+
687
+ // 模态框确定按钮保存数据
688
+
689
+ //
690
+ // f_cumulative_money: 0,//累计缴费金额
691
+ // f_unaccounts_money: '',//未结总金额
692
+ // f_cumulative_invoicing: '',//--累计开票金额--
693
+ // f_residual_invoicing: '',//剩余开票金额
694
+ async confirm() {
695
+ if (this.validateOk) {
696
+ this.$showMessage("当前未分配发票号,请联系管理员!!");
697
+ return;
698
+ }
699
+ Object.assign(this.model, this.model, this.billmodel);
700
+
701
+ let flag = this.check()
702
+ if (!flag) {
703
+ return
704
+ }
705
+ if (Number(this.model.f_charge_money) > Number(this.model.f_unaccounts_money)) {
706
+ this.$showMessage("缴费金额不能大于剩余金额")
707
+ this.model.f_charge_money = 0
708
+ this.model.f_amount_words = ''
709
+ } else if (this.model.f_charge_money == 0 || this.model.f_charge_money == "" || this.model.f_charge_money == null) {
710
+ this.$showMessage("不能缴费0元")
711
+ this.model.f_charge_money = 0
712
+ this.model.f_amount_words = ''
713
+ } else {
714
+ //获取购货方信息
715
+ http = new HttpResetClass()
716
+ data = {
717
+ tablename: 't_buyer_info',
718
+ condition: `f_process_id = '${this.infee.f_process_id}' and f_apply_num = '${this.infee.f_apply_num}' `
719
+ }
720
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
721
+ resolveMsg: null,
722
+ rejectMsg: '获取购货方信息失败'
723
+ })
724
+ this.buyerinfo.rows = res.data
725
+ if (this.buyerinfo.rows.length < 1 && this.model.f_print[0] === '增值税电子发票' && this.$appdata.getSingleValue('默认打印票据') === '') {
726
+ this.$showAlert('未找到购买方信息,请去报建功能"购买方信息"中完善购买方信息后再收费', 'info', 2000)
727
+ return
728
+ }
729
+
730
+ // 累计缴费金额
731
+ let flag1 = this.accAdd(Number(this.model.f_charge_money), Number(this.model.f_cumulative_money))
732
+ // 未结金额
733
+ let flag2 = this.accSub(Number(this.model.f_unaccounts_money), Number(this.model.f_charge_money))
734
+
735
+
736
+ let http = new HttpResetClass()
737
+ console.log('f_charge_money' + Number(this.model.f_charge_money))
738
+ console.log('f_unaccounts_money' + Number(this.model.f_unaccounts_money))
739
+ this.addItem.f_charge_money = this.model.f_charge_money
740
+ this.addItem.f_amount_words = this.model.f_amount_words
741
+ console.log('f_payment' + this.model.f_payment)
742
+ this.addItem.f_payment_method = this.model.f_payment[0]
743
+ this.addItem.f_charge_collectors = this.$login.f.name
744
+ this.addItem.f_charge_date = this.model.f_charge_date
745
+ this.addItem.f_charge_remarks = this.model.f_charge_remarks
746
+ this.addItem.f_filiale = this.model.f_payment_account =='安泰' ? '欣泰集团.安泰天然气' : '欣泰天然气'
747
+ this.addItem.f_process_id = this.infee.f_process_id
748
+ this.addItem.f_apply_num = this.infee.f_apply_num
749
+ this.model.rows.push(this.addItem)
750
+ let chargemoney = this.addItem.f_charge_money
751
+ let chargeitem = this.addItem.f_f_charge_item
752
+ let chargeremarks = this.addItem.f_charge_remarks ? this.addItem.f_charge_remarks : ''
753
+ let chargebillstyle = this.model.f_print[0]
754
+ this.chargemoney = this.addItem.f_charge_money
755
+ this.addItem.f_bill_style = this.model.f_print[0]
756
+ this.addItem.f_userinfo_id = this.model.f_userinfo_id
757
+ this.addItem.f_charge_state = '已收费'
758
+ if (this.model.f_user_name == "") {
759
+
760
+ this.addItem.f_charge_user = this.oldInfo.f_user_name;
761
+ } else {
762
+ this.addItem.f_charge_user = this.model.f_user_name;
763
+ }
764
+ if (this.model.f_user_name == "") {
765
+ this.addItem.f_charge_address = this.oldInfo.f_address;
766
+ } else {
767
+ this.addItem.f_charge_address = this.model.f_address;
768
+ }
769
+ console.log("==>" + JSON.stringify(this.oldInfo))
770
+ let data = {
771
+ tablename: 't_charge_record',
772
+ parameters: this.addItem
773
+ }
774
+ // 生成收费记录的id
775
+ let sellid = ''
776
+ let ret = await http.load('POST', 'rs/logic/saveentity', {data: data})
777
+ this.model.chargeid = ret.data.id
778
+ console.log('ret==', ret)
779
+ data = {
780
+ f_cumulative_money: flag1,
781
+ f_unaccounts_money: flag2,
782
+ f_apply_num: this.infee.f_apply_num
783
+ }
784
+ //开始收费
785
+ for (let i = 0; i < this.charges.length; i++) {
786
+ let saveen = this.charges[i]
787
+ saveen.f_project_item = this.charges[i].f_project_item[0]
788
+ saveen.f_charge_record_id = parseFloat(ret.data.id);
789
+ await http.load('POST', 'rs/logic/saveentity', {
790
+ data: {
791
+ tablename: 't_charge_record_item',
792
+ parameters: saveen
793
+ }
794
+ }, {resolveMsg: null, rejectMsg: "失败"})
795
+ }
796
+
797
+ await http.load('POST', 'rs/logic/updatechargemoney', {data: data}, {resolveMsg: null, rejectMsg: "添加累计金额失败"})
798
+ .then((res) => {
799
+ this.charges = [{f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0}],
800
+ this.close()
801
+ this.load()
802
+ })
803
+ if (this.config.hasPrint) {
804
+ if (this.model.f_print[0] === '普通收据') {
805
+ if (this.config.hasBillManage) {
806
+
807
+ this.model.f_bill_type = this.model.f_print[0]
808
+ this.model.f_bill_style = this.model.f_print[0]
809
+ debugger
810
+ console.log('打印this.model.f_print[0]',this.model.f_print[0])
811
+ debugger
812
+ if(this.model.f_payment_account==='欣泰'){
813
+ this.print = true
814
+ }else{
815
+ this.printat = true
816
+ }
817
+
818
+
819
+ console.log('f_bill_style' + this.model.f_bill_style)
820
+
821
+ } else {
822
+ debugger
823
+ if(this.model.f_payment_account==='欣泰'){
824
+ this.print = true
825
+ }else{
826
+ this.printat = true
827
+ }
828
+ }
829
+ } else if (this.model.f_print[0] === '纸质普票') {
830
+ this.param.f_print = this.model.f_print[0],
831
+ this.param.id = ret.data.id,
832
+ this.param.bz = this.model.f_charge_remarks
833
+ this.papershow = true
834
+ } else if (this.model.f_print[0] === '纸质专票') {
835
+ // TODO
836
+ this.param.f_print = this.model.f_print[0]
837
+ this.param.id = ret.data.id
838
+ this.param.bz = this.model.f_charge_remarks
839
+ this.papershow = true
840
+
841
+ } else if (this.model.f_print[0] === '电子发票') {
842
+ // TODO
843
+ this.param.f_print = this.model.f_print[0],
844
+ this.param.id = ret.data.id,
845
+ this.param.bz = this.model.f_charge_remarks
846
+ this.papershow = true
847
+
848
+
849
+ }
850
+ } else {
851
+ this.$dispatch('success')
852
+ }
853
+
854
+ }
855
+ this.model.f_amount_words = ''
856
+ this.model.f_charge_money = 0
857
+ },
858
+ async invoice(val) {
859
+ console.log('打印票据')
860
+ if (val.f_bill_style === '增值税电子发票') {
861
+ this.selectsellid = val.id
862
+ this.showbuyerinfo = true
863
+ }
864
+ },
865
+
866
+ goback() {
867
+ this.$dispatch('hiddenbtn')
868
+ this.showview = false
869
+ },
870
+ async tovoid(index) {
871
+ console.log(index)
872
+ console.log(JSON.stringify(this.model.rows))
873
+ this.model.rows[index].f_amount_words = "负" + this.model.rows[index].f_amount_words;
874
+ this.model.rows[index].f_charge_money = -this.model.rows[index].f_charge_money;
875
+ var val = this.model.rows[index];
876
+ this.model.chargeid = val.id;
877
+ this.delprint = false;
878
+ this.charges = [{f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0}],
879
+ console.log(JSON.stringify(val))
880
+ // this.charges =[{f_project_item:'合同总额', f_amount: 0, f_price: 0,f_money:0}],
881
+ if (val.f_is_correct === '' || val.f_charging_status !== '有效' || val.f_is_correct === '冲正中') {
882
+ this.$showMessage('已冲正或正在冲正,不能操作!')
883
+ } else {
884
+ let param = {
885
+ sellid: val.id,
886
+ operator: this.$login.f.name
887
+ }
888
+ this.$resetpost('rs/logic/applyCancelDrawBill', {data: param}, {
889
+ resolveMsg: null,
890
+ rejectMsg: '冲正失败'
891
+ }).then((res) => {
892
+ if (res.data.status === 200) {
893
+ this.model.chargeid = res.data.charge_id;
894
+ if (val.f_bill_style === '增值税电子发票') {
895
+ this.$showAlert('申请增值税电子发票冲正成功,请稍后到报建功能中【报建收费】中查看电子发票', 'success', 5000)
896
+ if(this.model.f_payment_account==='欣泰'){
897
+ this.delprint = true;
898
+ }else{
899
+ this.delprintat = true
900
+ }
901
+
902
+ } else {
903
+ this.$showAlert('冲正成功', 'success', 2000)
904
+ if(this.model.f_payment_account==='欣泰'){
905
+ this.delprint = true;
906
+ }else{
907
+ this.delprintat = true
908
+ }
909
+ }
910
+ if(this.model.f_payment_account==='欣泰'){
911
+ this.delprint = true;
912
+ }else{
913
+ this.delprintat = true
914
+ }
915
+ this.load()
916
+ } else {
917
+ this.$showAlert('冲正失败', 'warning', 5000)
918
+ }
919
+ })
920
+
921
+
922
+ }
923
+ },
924
+ tomakeup(val) {
925
+ if (val.f_invoice_num) {
926
+ this.$showMessage('此记录有票据,不能操作!')
927
+ } else {
928
+ this.invoice(val)
929
+ }
930
+ },
931
+ //根据票据流水号查看票据
932
+ async seeeticket(val) {
933
+ console.log('该票据流水号为:', val.f_fpqqlsh)
934
+ var eticketData = await this.$resetpost('rs/sql/querySingleTable', {
935
+ data: {
936
+ items: 'f_bill_url,f_url_code',
937
+ tablename: 't_eticket',
938
+ condition: `f_serial_number=${val.f_fpqqlsh}`
939
+ }
940
+ }, {resolveMsg: null, rejectMsg: null})
941
+ console.log('eticketData:', eticketData)
942
+ var data = eticketData.data[0]
943
+ if (data.f_bill_url && data.f_bill_url != '') {
944
+ console.log(data)
945
+ var auth = data.f_bill_url.split("/")
946
+ console.log("截取", auth)
947
+ var authCode = auth[auth.length - 1]
948
+ var url = `https://${auth[2]}/ent-views/fpExtract/get_fapiao.html?pwd=${data.f_url_code}&authCode=${authCode}`
949
+ this.$showAlert('开票成功!', 'success', 500)
950
+ window.open(url)
951
+ return 'success'
952
+ }
953
+ return 'fail'
954
+ },
955
+ accSub(arg1, arg2) {
956
+ var r1, r2, m, n;
957
+ try {
958
+ r1 = arg1.toString().split(".")[1].length
959
+ } catch (e) {
960
+ r1 = 0
961
+ }
962
+ try {
963
+ r2 = arg2.toString().split(".")[1].length
964
+ } catch (e) {
965
+ r2 = 0
966
+ }
967
+ m = Math.pow(10, Math.max(r1, r2));
968
+ //last modify by deeka
969
+ //动态控制精度长度
970
+ n = (r1 >= r2) ? r1 : r2;
971
+ return ((arg1 * m - arg2 * m) / m).toFixed(n);
972
+ },
973
+ reset() {
974
+ this.$dispatch('close')
975
+ this.$dispatch('selfsearch')
976
+ },
977
+ accAdd(arg1, arg2) {
978
+ var r1, r2, m;
979
+ try {
980
+ r1 = arg1.toString().split(".")[1].length
981
+ } catch (e) {
982
+ r1 = 0
983
+ }
984
+ try {
985
+ r2 = arg2.toString().split(".")[1].length
986
+ } catch (e) {
987
+ r2 = 0
988
+ }
989
+ m = Math.pow(10, Math.max(r1, r2))
990
+ return (arg1 * m + arg2 * m) / m
991
+ },
992
+
993
+ // 获取数据
994
+ async load() {
995
+ console.log('load被重新调用111')
996
+ this.refresh = !this.refresh
997
+ console.log("刷新validate,重新加载" + this.refresh)
998
+ // this.ifsearch = !this.ifsearch
999
+ let http = new HttpResetClass()
1000
+ let data = {
1001
+ tablename: 't_apply',
1002
+ condition: `f_process_id = '${this.infee.f_process_id}'`
1003
+ //
1004
+ }
1005
+ //获取报建信息
1006
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取报建信息失败'})
1007
+ Object.assign(this.model, this.model, res.data[0])
1008
+ data = {
1009
+ tablename: 't_charge_record',
1010
+ condition: `f_process_id = '${this.infee.f_process_id}' and f_charging_status='有效' and f_is_correct='否'`
1011
+ }
1012
+ //获取付款详情信息
1013
+ res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取付款数据失败'})
1014
+ // 去除付款时间的时分秒
1015
+ for (var i = 0; i < res.data.length; i++) {
1016
+ res.data[i].f_charge_date = res.data[i].f_charge_date.substring(0, 11)
1017
+ }
1018
+ this.model.rows = res.data
1019
+ this.model.f_cumulative_money = 0;
1020
+ for (let i = 0; i < res.data.length; i++) {
1021
+ this.model.f_cumulative_money =parseFloat(parseFloat(this.model.f_cumulative_money) + parseFloat(res.data[i].f_charge_money)).toFixed(2) ;
1022
+ }
1023
+
1024
+
1025
+ //获取购货方信息
1026
+ data = {
1027
+ tablename: 't_buyer_info',
1028
+ condition: `f_process_id = '${this.infee.f_process_id}' and f_apply_num = '${this.infee.f_apply_num}' `
1029
+ }
1030
+ res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取购货方信息失败'})
1031
+ this.buyerinfo.rows = res.data
1032
+
1033
+ //获取用户信息
1034
+ data = {
1035
+ condition: this.infee.f_process_id
1036
+ }
1037
+ let userinfores = await http.load('POST', 'rs/sql/getBillUserinfo', {data: data}, {
1038
+ resolveMsg: null,
1039
+ rejectMsg: '获取用户信息失败!'
1040
+ })
1041
+ this.userinfoRow.rows = userinfores.data;
1042
+
1043
+ this.oldInfo.f_user_name = this.model.f_user_name;
1044
+ this.oldInfo.f_phone = this.model.f_phone;
1045
+ this.oldInfo.f_address = this.model.f_address;
1046
+ this.model.f_isone = [''];
1047
+ this.charges = [{f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0}];
1048
+ this.hasValidateBill=true
1049
+ console.log('load被重新调用222')
1050
+ }
1051
+ },
1052
+ computed: {
1053
+
1054
+ // 计算大写
1055
+ getCapital() {
1056
+ if (this.model.f_charge_money) {
1057
+ this.model.f_amount_words = this.smalltoBIG(Number(this.model.f_charge_money))
1058
+ }
1059
+
1060
+ return this.model.f_amount_words
1061
+ },
1062
+ subcost() {
1063
+ let temp = Number(this.model.f_total_cost)
1064
+ let temp2 = 0
1065
+ for (var i = 0; i < this.model.rows.length; i++) {
1066
+ temp2 += Number(this.model.rows[i].f_fee)
1067
+ }
1068
+ this.model.f_cumulative_money = Math.round(temp2 * 100) / 100
1069
+ this.model.subcost = Math.round((temp - temp2) * 100) / 100
1070
+ if (this.model.f_cumulative_money && this.model.f_jmhj_cost) {
1071
+ temp = Math.round((temp - Number(this.model.f_jmhj_cost)) * 100) / 100
1072
+ }
1073
+ this.model.subcost = Math.round((temp - temp2) * 100) / 100
1074
+ return this.model.subcost
1075
+ },
1076
+ // totalcost () {
1077
+ // this.model.f_total_cost = Number(this.model.f_construction_cost) + Number(this.model.f_material_cost)
1078
+ // + Number(this.model.f_labor_cost) + Number(this.model.f_change_pipeline_cost)
1079
+ // + Number(this.model.f_sbaz_cost) - Number(this.model.f_jmhj_cost)
1080
+ // return this.model.f_total_cost
1081
+ // },
1082
+ aaa() {
1083
+ this.model.f_jmhj_cost = Number(this.model.f_total_cost) - Number(this.model.f_actualfee)
1084
+ return this.model.f_jmhj_cost
1085
+ },
1086
+ feeoptions() {
1087
+ return this.$appdata.getParam('费用类型')
1088
+ },
1089
+ dayin() {
1090
+ return this.$appdata.getParam('打印格式')
1091
+ },
1092
+ jiaofei() {
1093
+ return this.$appdata.getParam('付款方式')
1094
+ // return [{label: '全部', value: ''}, ...AppData.getParam('缴费类型')]
1095
+ }
1096
+ },
1097
+ watch: {
1098
+ 'model.f_isone'(val) {
1099
+ console.log('111111111is one', val, val[0] == '是')
1100
+ if (val[0] == '是') {
1101
+ this.isSingleUser = true
1102
+ this.model.f_user_name = ""
1103
+ this.model.f_phone = ""
1104
+ this.model.f_address = ""
1105
+ this.model.f_userinfo_id = "";
1106
+ } else {
1107
+ this.isSingleUser = false
1108
+ this.model.f_user_name = this.oldInfo.f_user_name
1109
+ this.model.f_phone = this.oldInfo.f_phone
1110
+ this.model.f_address = this.oldInfo.f_address
1111
+ this.model.f_userinfo_id = "";
1112
+ }
1113
+ },
1114
+ 'infee'(val) {
1115
+ this.load()
1116
+ },
1117
+ 'print'(val) {
1118
+ this.load()
1119
+ }
1120
+ },
1121
+ }
1122
+ </script>