apply-clients 5.0.35-ezhou-25-18 → 5.0.35-ezhou-25-20

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