apply-clients 5.0.35-64 → 5.0.35-67

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,1144 +1,1144 @@
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-bill2'>
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="model.f_user_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="model.adressphone"
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
- adressphone:'',
351
- f_isone: ['否'],
352
- chargeid: '',
353
- f_print: ['普通收据'],
354
- f_bill_type: '普通收据',
355
- f_bill_style: '普通发票',
356
- f_use_type: '报建费用',
357
- f_payment: ['现金缴费'],
358
- f_charge_money: 0,
359
- f_apply_num: '',//报建编号
360
- f_process_id: '',//流程ID
361
- f_payments: '',//首付
362
- f_pro_payment: '',//进度款
363
- f_end_payment: '',//尾款
364
- f_additional_payment: '',//追加款
365
- f_jmhj_cost: '',//减免金额
366
- subcost: 0, // 剩余付款
367
- f_total_cost: 0, // 总费用
368
- f_payfee_operator: '',//操作人
369
- f_payfee_department: '',//操作部门
370
- f_filiale: '',//分公司
371
- f_payfee_date: '',//操作日期
372
- f_contract_number: '',//合同编号
373
- f_cumulative_money: '',//累计缴费金额
374
- f_budget_money: '',//应交金额
375
- f_contract_money: '',//合同金额
376
- f_unaccounts_money: '',//未结总金额
377
- f_cumulative_invoicing: '',//--累计开票金额--
378
- f_residual_invoicing: '',//剩余开票金额
379
- f_main_contract_num: 0,//主合同编号
380
- rows: [], // 付费数据数组
381
- f_user_name: "",
382
- f_phone: "",
383
- f_address: "",
384
- f_userinfo_id: ""
385
- },
386
- billmodel: {
387
- f_user_name: "",
388
- f_phone: "",
389
- f_address: "",
390
- f_userinfo_id: ""
391
- },
392
- chargemoney: 0,
393
- chargeitems: this.$appdata.getParam('收费项目'),
394
- billstyles: this.$appdata.getParam('票据类型'),
395
- paymenttypes: this.$appdata.getParam('付款方式'),
396
- printstyle: this.$appdata.getParam('打印格式'),
397
- print: false,
398
- printat: false,
399
- delprint: false,
400
- delprintat:false,
401
- taxprint: false,
402
- billData: {
403
- url: 'rs/report/applyCharge_bill',
404
- bill: ''
405
- },
406
- billDataantai: {
407
- url: 'rs/report/applyChargeAT_bill',
408
- bill: ''
409
- },
410
- config: {
411
- hasPrint: true, //默认打票
412
- hasBillManage: true, //默认不启用发票管理
413
- billType: '报建收费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
414
- printType: '普通收据', // 收据/电子票/专用发票/国税发票
415
- payment: '现金缴费', // 付款方式
416
- brandspec: '材料费', // 收费类型
417
- billtype: "收费发票"
418
- },
419
- config2: {
420
- hasPrint: true, //默认打票
421
- hasBillManage: true, //默认不启用发票管理
422
- billType: '报建收费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
423
- printType: '普通收据', // 收据/电子票/专用发票/国税发票
424
- payment: '现金缴费', // 付款方式
425
- brandspec: '材料费', // 收费类型
426
- billtype: "冲正发票"
427
- },
428
- addItem: {
429
- f_charge_money: 0,
430
- f_amount_words: '',
431
- f_payment_type: '',
432
- f_charge_collectors: this.$login.f.name,
433
- f_charge_date: '',
434
- f_charge_remarks: '',
435
- f_filiale: '',
436
- f_process_id: '',
437
- f_apply_num: '',
438
- f_payment_method: '',
439
- f_charging_status: '有效',
440
- f_is_correct: '否',
441
- f_bill_style: ''
442
- },
443
- charges: [{f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0}],
444
- // 启用发票管理需要对票号进行验证
445
- hasValidateBill: false,
446
- validateOk: false,
447
- userinfoRow: {
448
- rows: []
449
- },
450
- oldInfo: {},
451
- bill: '', // 票数据
452
- paperticket: false,
453
- ids: {},
454
- paperinfo: {
455
- f_buy_name : '',
456
- f_pay_id : '',
457
- f_buy_address : '',
458
- f_buy_openbank : '',
459
- f_email_push:''
460
- },
461
- param: {},
462
- papershow: false
463
- }
464
- },
465
- props: ['infee', 'showfee'],
466
- ready() {
467
- this.load() // 初始化数据
468
-
469
- },
470
-
471
- methods: {
472
- async papaercom() {
473
- this.papershow = false
474
- console.log("this.paperinfo.",this.paperinfo)
475
- this.param.paperinfo=this.paperinfo
476
- // this.param.paperinfo.f_buy_name = this.paperinfo.f_buy_name ? this.paperinfo.f_buy_name : ''
477
- // this.param.paperinfo.f_pay_id = this.paperinfo.f_pay_id ? this.paperinfo.f_pay_id : ''
478
- // this.param.paperinfo.f_buy_address = this.paperinfo.f_buy_address ? this.paperinfo.f_buy_address : ''
479
- // this.param.paperinfo.f_buy_openbank = this.paperinfo.f_buy_openbank ? this.paperinfo.f_buy_openbank : ''
480
- if (this.param.f_print === '电子发票') {
481
- let temp = await this.$commonService.openEticket(this.param, '报装收费')
482
- console.log("temp", temp.data.f_bill_url)
483
- this.f_bill_url = temp.data.f_bill_url
484
- window.open(this.f_bill_url)
485
- this.param = {}
486
- this.$dispatch('success')
487
- } else if (this.param.f_print === '纸质专票') {
488
- await this.$commonService.openEticket(this.param, '报装收费')
489
- this.ids.id = this.param.id
490
- this.param = {}
491
- this.paperticket = true
492
- } else if (this.param.f_print === '纸质普票') {
493
- await this.$commonService.openEticket(this.param, '报装收费')
494
- this.ids.id = this.param.id
495
- this.param = {}
496
- this.paperticket = true
497
- }
498
- this.paperinfo.f_buy_name = ''
499
- this.paperinfo.f_pay_id = ''
500
- this.paperinfo.f_buy_address = ''
501
- this.paperinfo.f_buy_openbank = ''
502
- this.paperinfo.f_email_push=''
503
- },
504
- closeticket() {
505
- this.paperticket = false
506
- this.$dispatch('success')
507
- },
508
- //冲正
509
- deleteChargeRecord(index) {
510
- console.log(JSON.stringify(this.model.rows[index]))
511
- if (this.config.hasPrint) {
512
- if (this.model.f_print[0] === '普通收据') {
513
- if (this.config.hasBillManage) {
514
-
515
- this.model.f_bill_type = this.model.f_print[0]
516
- this.model.f_bill_style = this.model.f_print[0]
517
- this.print = true
518
-
519
- console.log('f_bill_style' + this.model.f_bill_style)
520
-
521
- } else {
522
- this.print = true
523
- }
524
- } else if (this.model.f_print[0] === '国税发票') {
525
- // TODO
526
- this.$dispatch('success')
527
- } else if (this.model.f_print[0] === '电子发票') {
528
- // TODO
529
- this.$dispatch('success')
530
- }
531
- } else {
532
- this.$dispatch('success')
533
- }
534
- this.$showMessage('是否冲正此条记录?', ['confirm', 'cancel']).then((res) => {
535
- debugger
536
- if (res === 'confirm') {
537
- let param = {
538
- row: this.model.rows[index]
539
- }
540
- this.$resetpost('rs/logic/restChargeRecord', {data: param}, {resolveMsg: null, rejectMsg: "冲正失败!"})
541
- .then((res) => {
542
- this.$showAlert('冲正成功!', 'success', 5000)
543
- this.load()
544
- })
545
- } else {
546
- this.load()
547
- }
548
- })
549
- },
550
- getUserinfo(index) {
551
- console.log(index)
552
- console.log("a")
553
- this.model.f_user_name = this.userinfoRow.rows[index].f_user_name;
554
- this.model.f_process_id = this.userinfoRow.rows[index].f_process_id;
555
- this.model.f_phone = this.userinfoRow.rows[index].f_user_phone;
556
- this.model.f_address = this.userinfoRow.rows[index].address;
557
- this.model.f_userinfo_id = this.userinfoRow.rows[index].f_userinfo_id;
558
- this.billmodel.f_user_name = this.userinfoRow.rows[index].f_user_name;
559
- this.billmodel.f_phone = this.userinfoRow.rows[index].f_user_phone;
560
- this.billmodel.f_address = this.userinfoRow.rows[index].address;
561
- this.billmodel.f_userinfo_id = this.userinfoRow.rows[index].f_userinfo_id;
562
-
563
- },
564
- calcmoney(index) {
565
- console.log("开始计算");
566
- this.charges[index].f_money = this.charges[index].f_price * this.charges[index].f_amount
567
- let allmoney = 0;
568
- for (let i = 0; i < this.charges.length; i++) {
569
- allmoney += parseFloat(this.charges[i].f_money)
570
- }
571
- this.model.f_charge_money = allmoney
572
- // row.f_money = parseFloat(row.f_amount)*parseFloat(row.f_price);
573
- },
574
- addItems() {
575
- this.charges.push({f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0})
576
- },
577
- delItems(index) {
578
- console.log('index==', index);
579
- if (this.charges.length > 1) {
580
- this.charges.splice(index, 1)
581
- }
582
- },
583
- selfclean() {
584
- console.log("清空输入框")
585
- this.model.f_charge_money = 0
586
- this.model.f_amount_words = ''
587
- this.model.f_charge_remarks = ''
588
- },
589
- clean() {
590
- this.addItem = {
591
- f_charge_money: 0,
592
- f_amount_words: '',
593
- f_payment_type: '',
594
- f_charge_collectors: this.$login.f.name,
595
- f_charge_date: '',
596
- f_charge_remarks: '',
597
- f_filiale: '',
598
- f_process_id: '',
599
- f_apply_num: '',
600
- f_charging_status: '有效',
601
- f_is_correct: '否',
602
- f_bill_style: ''
603
- }
604
-
605
- // this.$dispatch('refresh', this.model)
606
- },
607
- close() {
608
- console.log("关闭打印框")
609
- this.taxprint = false
610
- this.print = false
611
- this.printat = false
612
- this.delprint = false
613
- this.delprintat = false
614
- this.clean()
615
- },
616
- printok() {
617
- console.log("successs............")
618
- this.$dispatch('success')
619
- },
620
- validateBill(val) {
621
- this.validateOk = !val.isOk
622
- this.billData.bill = val.bill
623
- this.billDataantai.bill = val.bill
624
- },
625
-
626
- confirmbuyerinfo(args) {
627
- let drawbilldata = {
628
- sellid: this.selectsellid,
629
- buyerid: args.id,
630
- operator: this.$login.f.name
631
- }
632
- this.closebuyerinfo()
633
- this.$resetpost('rs/logic/applyDrawBill', {data: drawbilldata}, {resolveMsg: null, rejectMsg: "开发票失败"})
634
- .then((res) => {
635
- if (res.data.status === 200) {
636
- this.$showAlert('申请开具增值税电子发票成功,请稍后到报建功能中【报建收费】中查看电子发票', 'success', 5000)
637
-
638
- } else {
639
- this.$showAlert('电子发票开票失败,失败代码为:' + res.data.status, 'warning', 3000)
640
- }
641
- })
642
- },
643
- // 输入金额校验
644
- check() {
645
- console.log('check')
646
- let re = /^[+-]?\d+(\.\d+)?$/ //判断字符串是否为数字
647
- if (!this.model.f_charge_money) {//判断缴费金额是否为空
648
- console.log('check1')
649
- this.model.f_charge_money = 0
650
- } else {
651
- if (!re.test(this.model.f_charge_money)) {
652
- this.$showMessage("请输入数字")
653
- this.model.f_charge_money = ''
654
- return false
655
- }
656
- }
657
-
658
-
659
- return true
660
- },
661
-
662
- // 小写转换大写
663
- smalltoBIG(n) {
664
- let fraction = ['角', '分'];
665
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
666
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
667
- let head = n < 0 ? '欠' : '';
668
- n = Math.abs(n);
669
-
670
- let s = '';
671
-
672
- for (var i = 0; i < fraction.length; i++) {
673
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
674
- }
675
- s = s || '整';
676
- n = Math.floor(n);
677
-
678
- for (var i = 0; i < unit[0].length && n > 0; i++) {
679
- let p = '';
680
- for (var j = 0; j < unit[1].length && n > 0; j++) {
681
- p = digit[n % 10] + unit[1][j] + p;
682
- n = Math.floor(n / 10);
683
- }
684
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
685
- }
686
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
687
- },
688
-
689
- // 模态框确定按钮保存数据
690
-
691
- //
692
- // f_cumulative_money: 0,//累计缴费金额
693
- // f_unaccounts_money: '',//未结总金额
694
- // f_cumulative_invoicing: '',//--累计开票金额--
695
- // f_residual_invoicing: '',//剩余开票金额
696
- async confirm() {
697
- if (this.validateOk) {
698
- this.$showMessage("当前未分配发票号,请联系管理员!!");
699
- return;
700
- }
701
- Object.assign(this.model, this.model, this.billmodel);
702
-
703
- let flag = this.check()
704
- if (!flag) {
705
- return
706
- }
707
- if (Number(this.model.f_charge_money) > Number(this.model.f_unaccounts_money)) {
708
- this.$showMessage("缴费金额不能大于剩余金额")
709
- this.model.f_charge_money = 0
710
- this.model.f_amount_words = ''
711
- } else if (this.model.f_charge_money == 0 || this.model.f_charge_money == "" || this.model.f_charge_money == null) {
712
- this.$showMessage("不能缴费0元")
713
- this.model.f_charge_money = 0
714
- this.model.f_amount_words = ''
715
- } else {
716
- debugger
717
- //获取购货方信息
718
- http = new HttpResetClass()
719
- data = {
720
- tablename: 't_buyer_info',
721
- condition: `f_process_id = '${this.infee.f_process_id}' and f_apply_num = '${this.infee.f_apply_num}' `
722
- }
723
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
724
- resolveMsg: null,
725
- rejectMsg: '获取购货方信息失败'
726
- })
727
- this.buyerinfo.rows = res.data
728
- if (this.buyerinfo.rows.length < 1 && this.model.f_print[0] === '增值税电子发票' && this.$appdata.getSingleValue('默认打印票据') === '是') {
729
- this.$showAlert('未找到购买方信息,请去报建功能"购买方信息"中完善购买方信息后再收费', 'info', 2000)
730
- return
731
- }
732
-
733
- // 累计缴费金额
734
- let flag1 = this.accAdd(Number(this.model.f_charge_money), Number(this.model.f_cumulative_money))
735
- // 未结金额
736
- let flag2 = this.accSub(Number(this.model.f_unaccounts_money), Number(this.model.f_charge_money))
737
-
738
-
739
- let http = new HttpResetClass()
740
- console.log('f_charge_money' + Number(this.model.f_charge_money))
741
- console.log('f_unaccounts_money' + Number(this.model.f_unaccounts_money))
742
- this.addItem.f_charge_money = this.model.f_charge_money
743
- this.addItem.f_amount_words = this.model.f_amount_words
744
- console.log('f_payment' + this.model.f_payment)
745
- this.addItem.f_payment_method = this.model.f_payment[0]
746
- this.addItem.f_charge_collectors = this.$login.f.name
747
- this.addItem.f_charge_date = this.model.f_charge_date
748
- this.addItem.f_charge_remarks = this.model.f_charge_remarks
749
- this.addItem.f_filiale = this.model.f_payment_account =='安泰' ? '欣泰集团.安泰天然气' : '欣泰天然气'
750
- this.addItem.f_process_id = this.infee.f_process_id
751
- this.addItem.f_apply_num = this.infee.f_apply_num
752
- this.model.rows.push(this.addItem)
753
- let chargemoney = this.addItem.f_charge_money
754
- let chargeitem = this.addItem.f_f_charge_item
755
- let chargeremarks = this.addItem.f_charge_remarks ? this.addItem.f_charge_remarks : ''
756
- let chargebillstyle = this.model.f_print[0]
757
- this.chargemoney = this.addItem.f_charge_money
758
- this.addItem.f_bill_style = this.model.f_print[0]
759
- this.addItem.f_userinfo_id = this.model.f_userinfo_id
760
- this.addItem.f_charge_state = '已收费'
761
- if (this.model.f_user_name == "") {
762
-
763
- this.addItem.f_charge_user = this.oldInfo.f_user_name;
764
- } else {
765
- this.addItem.f_charge_user = this.model.f_user_name;
766
- }
767
- if (this.model.f_user_name == "") {
768
- this.addItem.f_charge_address = this.oldInfo.f_address;
769
- } else {
770
- this.addItem.f_charge_address = this.model.f_address;
771
- }
772
- console.log("==>" + JSON.stringify(this.oldInfo))
773
- let data = {
774
- tablename: 't_charge_record',
775
- parameters: this.addItem
776
- }
777
- // 生成收费记录的id
778
- debugger
779
- let sellid = ''
780
- let ret = await http.load('POST', 'rs/logic/saveentity', {data: data})
781
- this.model.chargeid = ret.data.id
782
- console.log('ret==', ret)
783
- data = {
784
- f_cumulative_money: flag1,
785
- f_unaccounts_money: flag2,
786
- f_apply_num: this.infee.f_apply_num
787
- }
788
- //开始收费 正
789
- debugger
790
- for (let i = 0; i < this.charges.length; i++) {
791
- let saveen = this.charges[i]
792
- saveen.f_project_item = this.charges[i].f_project_item[0]
793
- saveen.f_charge_record_id = parseFloat(ret.data.id);
794
- await http.load('POST', 'rs/logic/saveentity', {
795
- data: {
796
- tablename: 't_charge_record_item',
797
- parameters: saveen
798
- }
799
- }, {resolveMsg: null, rejectMsg: "失败"})
800
- }
801
- // debugger
802
- // for (let i = 0; i < this.charges.length; i++) {
803
- // let saveen = this.charges[i]
804
- // debugger
805
- // saveen.f_money= 0 - saveen.f_money
806
- // saveen.f_project_item = this.charges[i].f_project_item[0]
807
- // saveen.f_charge_record_id = parseFloat(ret.data.id);
808
- // await http.load('POST', 'rs/logic/saveentity', {
809
- // data: {
810
- // tablename: 't_charge_record_item',
811
- // parameters: saveen
812
- // }
813
- // }, {resolveMsg: null, rejectMsg: "失败"})
814
- // }
815
-
816
- await http.load('POST', 'rs/logic/updatechargemoney', {data: data}, {resolveMsg: null, rejectMsg: "添加累计金额失败"})
817
- .then((res) => {
818
- this.charges = [{f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0}],
819
- this.close()
820
- this.load()
821
- })
822
- if (this.config.hasPrint) {
823
- if (this.model.f_print[0] === '普通收据') {
824
- if (this.config.hasBillManage) {
825
-
826
- this.model.f_bill_type = this.model.f_print[0]
827
- this.model.f_bill_style = this.model.f_print[0]
828
- debugger
829
- console.log('打印this.model.f_print[0]',this.model.f_print[0])
830
- debugger
831
- if(this.model.f_payment_account==='欣泰'){
832
- this.print = true
833
- }else{
834
- this.printat = true
835
- }
836
-
837
-
838
- console.log('f_bill_style' + this.model.f_bill_style)
839
-
840
- } else {
841
- debugger
842
- if(this.model.f_payment_account==='欣泰'){
843
- this.print = true
844
- }else{
845
- this.printat = true
846
- }
847
- }
848
- } else if (this.model.f_print[0] === '纸质普票') {
849
- this.param.f_print = this.model.f_print[0],
850
- this.param.id = ret.data.id,
851
- this.param.bz = this.model.f_charge_remarks
852
- this.papershow = true
853
- } else if (this.model.f_print[0] === '纸质专票') {
854
- // TODO
855
- this.param.f_print = this.model.f_print[0]
856
- this.param.id = ret.data.id
857
- this.param.bz = this.model.f_charge_remarks
858
- this.papershow = true
859
-
860
- } else if (this.model.f_print[0] === '电子发票') {
861
- // TODO
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
-
867
-
868
- }
869
- } else {
870
- this.$dispatch('success')
871
- }
872
-
873
- }
874
- this.model.f_amount_words = ''
875
- this.model.f_charge_money = 0
876
- },
877
- async invoice(val) {
878
- console.log('打印票据')
879
- if (val.f_bill_style === '增值税电子发票') {
880
- this.selectsellid = val.id
881
- this.showbuyerinfo = true
882
- }
883
- },
884
-
885
- goback() {
886
- this.$dispatch('hiddenbtn')
887
- this.showview = false
888
- },
889
- async tovoid(index) {
890
- debugger
891
- console.log(index)
892
- console.log(JSON.stringify(this.model.rows))
893
- this.model.rows[index].f_amount_words = "负" + this.model.rows[index].f_amount_words;
894
- this.model.rows[index].f_charge_money = -this.model.rows[index].f_charge_money;
895
- var val = this.model.rows[index];
896
- this.model.chargeid = val.id;
897
- this.delprint = false;
898
- this.charges = [{f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0}],
899
- console.log(JSON.stringify(val))
900
- // this.charges =[{f_project_item:'合同总额', f_amount: 0, f_price: 0,f_money:0}],
901
- debugger
902
- if (val.f_is_correct === '是' || val.f_charging_status !== '有效' || val.f_is_correct === '冲正中') {
903
- this.$showMessage('已冲正或正在冲正,不能操作!')
904
- } else {
905
- let param = {
906
- sellid: val.id,
907
- operator: this.$login.f.name
908
- }
909
- this.$resetpost('rs/logic/applyCancelDrawBill', {data: param}, {
910
- resolveMsg: null,
911
- rejectMsg: '冲正失败'
912
- }).then((res) => {
913
- if (res.data.status === 200) {
914
- this.model.chargeid = res.data.charge_id;
915
- if (val.f_bill_style === '增值税电子发票') {
916
- this.$showAlert('申请增值税电子发票冲正成功,请稍后到报建功能中【报建收费】中查看电子发票', 'success', 5000)
917
- if(this.model.f_payment_account==='欣泰'){
918
- this.delprint = true;
919
- }else{
920
- this.delprintat = true
921
- }
922
-
923
- } else {
924
- this.$showAlert('冲正成功', 'success', 2000)
925
- if(this.model.f_payment_account==='欣泰'){
926
- this.delprint = true;
927
- }else{
928
- this.delprintat = true
929
- }
930
- }
931
- if(this.model.f_payment_account==='欣泰'){
932
- this.delprint = true;
933
- }else{
934
- this.delprintat = true
935
- }
936
- this.load()
937
- } else {
938
- this.$showAlert('冲正失败', 'warning', 5000)
939
- }
940
- })
941
-
942
-
943
- }
944
- },
945
- tomakeup(val) {
946
- if (val.f_invoice_num) {
947
- this.$showMessage('此记录有票据,不能操作!')
948
- } else {
949
- this.invoice(val)
950
- }
951
- },
952
- //根据票据流水号查看票据
953
- async seeeticket(val) {
954
- console.log('该票据流水号为:', val.f_fpqqlsh)
955
- var eticketData = await this.$resetpost('rs/sql/querySingleTable', {
956
- data: {
957
- items: 'f_bill_url,f_url_code',
958
- tablename: 't_eticket',
959
- condition: `f_serial_number=${val.f_fpqqlsh}`
960
- }
961
- }, {resolveMsg: null, rejectMsg: null})
962
- console.log('eticketData:', eticketData)
963
- var data = eticketData.data[0]
964
- if (data.f_bill_url && data.f_bill_url != '') {
965
- console.log(data)
966
- var auth = data.f_bill_url.split("/")
967
- console.log("截取", auth)
968
- var authCode = auth[auth.length - 1]
969
- var url = `https://${auth[2]}/ent-views/fpExtract/get_fapiao.html?pwd=${data.f_url_code}&authCode=${authCode}`
970
- this.$showAlert('开票成功!', 'success', 500)
971
- window.open(url)
972
- return 'success'
973
- }
974
- return 'fail'
975
- },
976
- accSub(arg1, arg2) {
977
- var r1, r2, m, n;
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
- //last modify by deeka
990
- //动态控制精度长度
991
- n = (r1 >= r2) ? r1 : r2;
992
- return ((arg1 * m - arg2 * m) / m).toFixed(n);
993
- },
994
- reset() {
995
- this.$dispatch('close')
996
- this.$dispatch('selfsearch')
997
- },
998
- accAdd(arg1, arg2) {
999
- var r1, r2, m;
1000
- try {
1001
- r1 = arg1.toString().split(".")[1].length
1002
- } catch (e) {
1003
- r1 = 0
1004
- }
1005
- try {
1006
- r2 = arg2.toString().split(".")[1].length
1007
- } catch (e) {
1008
- r2 = 0
1009
- }
1010
- m = Math.pow(10, Math.max(r1, r2))
1011
- return (arg1 * m + arg2 * m) / m
1012
- },
1013
-
1014
- // 获取数据
1015
- async load() {
1016
- console.log('load被重新调用111')
1017
- this.refresh = !this.refresh
1018
- console.log("刷新validate,重新加载" + this.refresh)
1019
- // this.ifsearch = !this.ifsearch
1020
- let http = new HttpResetClass()
1021
- let data = {
1022
- tablename: 't_apply',
1023
- condition: `f_process_id = '${this.infee.f_process_id}'`
1024
- //
1025
- }
1026
- //获取报建信息
1027
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取报建信息失败'})
1028
- Object.assign(this.model, this.model, res.data[0])
1029
- data = {
1030
- tablename: 't_charge_record',
1031
- condition: `f_process_id = '${this.infee.f_process_id}' and f_charging_status='有效' and f_is_correct='否'`
1032
- }
1033
- //获取付款详情信息
1034
- res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取付款数据失败'})
1035
- // 去除付款时间的时分秒
1036
- for (var i = 0; i < res.data.length; i++) {
1037
- res.data[i].f_charge_date = res.data[i].f_charge_date.substring(0, 11)
1038
- }
1039
- this.model.rows = res.data
1040
- this.model.f_cumulative_money = 0;
1041
- for (let i = 0; i < res.data.length; i++) {
1042
- this.model.f_cumulative_money =parseFloat(parseFloat(this.model.f_cumulative_money) + parseFloat(res.data[i].f_charge_money)).toFixed(2) ;
1043
- }
1044
-
1045
-
1046
- //获取购货方信息
1047
- data = {
1048
- tablename: 't_buyer_info',
1049
- condition: `f_process_id = '${this.infee.f_process_id}' and f_apply_num = '${this.infee.f_apply_num}' `
1050
- }
1051
- res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取购货方信息失败'})
1052
- this.buyerinfo.rows = res.data
1053
-
1054
- //获取用户信息
1055
- data = {
1056
- condition: this.infee.f_process_id
1057
- }
1058
- let userinfores = await http.load('POST', 'rs/sql/getBillUserinfo', {data: data}, {
1059
- resolveMsg: null,
1060
- rejectMsg: '获取用户信息失败!'
1061
- })
1062
- this.userinfoRow.rows = userinfores.data;
1063
-
1064
- this.oldInfo.f_user_name = this.model.f_user_name;
1065
- this.oldInfo.f_phone = this.model.f_phone;
1066
- this.oldInfo.f_address = this.model.f_address;
1067
- this.model.f_isone = ['否'];
1068
- this.model.adressphone = this.model.f_address + ' ' + this.model.f_phone;
1069
- this.charges = [{f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0}];
1070
- this.hasValidateBill=true
1071
- console.log('load被重新调用222')
1072
- }
1073
- },
1074
- computed: {
1075
-
1076
- // 计算大写
1077
- getCapital() {
1078
- if (this.model.f_charge_money) {
1079
- this.model.f_amount_words = this.smalltoBIG(Number(this.model.f_charge_money))
1080
- }
1081
-
1082
- return this.model.f_amount_words
1083
- },
1084
- subcost() {
1085
- let temp = Number(this.model.f_total_cost)
1086
- let temp2 = 0
1087
- for (var i = 0; i < this.model.rows.length; i++) {
1088
- temp2 += Number(this.model.rows[i].f_fee)
1089
- }
1090
- this.model.f_cumulative_money = Math.round(temp2 * 100) / 100
1091
- this.model.subcost = Math.round((temp - temp2) * 100) / 100
1092
- if (this.model.f_cumulative_money && this.model.f_jmhj_cost) {
1093
- temp = Math.round((temp - Number(this.model.f_jmhj_cost)) * 100) / 100
1094
- }
1095
- this.model.subcost = Math.round((temp - temp2) * 100) / 100
1096
- return this.model.subcost
1097
- },
1098
- // totalcost () {
1099
- // this.model.f_total_cost = Number(this.model.f_construction_cost) + Number(this.model.f_material_cost)
1100
- // + Number(this.model.f_labor_cost) + Number(this.model.f_change_pipeline_cost)
1101
- // + Number(this.model.f_sbaz_cost) - Number(this.model.f_jmhj_cost)
1102
- // return this.model.f_total_cost
1103
- // },
1104
- aaa() {
1105
- this.model.f_jmhj_cost = Number(this.model.f_total_cost) - Number(this.model.f_actualfee)
1106
- return this.model.f_jmhj_cost
1107
- },
1108
- feeoptions() {
1109
- return this.$appdata.getParam('费用类型')
1110
- },
1111
- dayin() {
1112
- return this.$appdata.getParam('打印格式')
1113
- },
1114
- jiaofei() {
1115
- return this.$appdata.getParam('付款方式')
1116
- // return [{label: '全部', value: ''}, ...AppData.getParam('缴费类型')]
1117
- }
1118
- },
1119
- watch: {
1120
- 'model.f_isone'(val) {
1121
- console.log('111111111is one', val, val[0] == '是')
1122
- if (val[0] == '是') {
1123
- this.isSingleUser = true
1124
- this.model.f_user_name = ""
1125
- this.model.f_phone = ""
1126
- this.model.f_address = ""
1127
- this.model.f_userinfo_id = "";
1128
- } else {
1129
- this.isSingleUser = false
1130
- this.model.f_user_name = this.oldInfo.f_user_name
1131
- this.model.f_phone = this.oldInfo.f_phone
1132
- this.model.f_address = this.oldInfo.f_address
1133
- this.model.f_userinfo_id = "";
1134
- }
1135
- },
1136
- 'infee'(val) {
1137
- this.load()
1138
- },
1139
- 'print'(val) {
1140
- this.load()
1141
- }
1142
- },
1143
- }
1144
- </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" type="button" v-if="$index>0"
184
+ @click.stop="delItems($index)"></button>&nbsp;&nbsp;&nbsp;
185
+ <button class="glyphicon glyphicon-plus btn-success" type="button" @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-bill2'>
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="model.f_user_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="model.adressphone"
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
+ adressphone:'',
351
+ f_isone: ['否'],
352
+ chargeid: '',
353
+ f_print: ['普通收据'],
354
+ f_bill_type: '普通收据',
355
+ f_bill_style: '普通发票',
356
+ f_use_type: '报建费用',
357
+ f_payment: ['现金缴费'],
358
+ f_charge_money: 0,
359
+ f_apply_num: '',//报建编号
360
+ f_process_id: '',//流程ID
361
+ f_payments: '',//首付
362
+ f_pro_payment: '',//进度款
363
+ f_end_payment: '',//尾款
364
+ f_additional_payment: '',//追加款
365
+ f_jmhj_cost: '',//减免金额
366
+ subcost: 0, // 剩余付款
367
+ f_total_cost: 0, // 总费用
368
+ f_payfee_operator: '',//操作人
369
+ f_payfee_department: '',//操作部门
370
+ f_filiale: '',//分公司
371
+ f_payfee_date: '',//操作日期
372
+ f_contract_number: '',//合同编号
373
+ f_cumulative_money: '',//累计缴费金额
374
+ f_budget_money: '',//应交金额
375
+ f_contract_money: '',//合同金额
376
+ f_unaccounts_money: '',//未结总金额
377
+ f_cumulative_invoicing: '',//--累计开票金额--
378
+ f_residual_invoicing: '',//剩余开票金额
379
+ f_main_contract_num: 0,//主合同编号
380
+ rows: [], // 付费数据数组
381
+ f_user_name: "",
382
+ f_phone: "",
383
+ f_address: "",
384
+ f_userinfo_id: ""
385
+ },
386
+ billmodel: {
387
+ f_user_name: "",
388
+ f_phone: "",
389
+ f_address: "",
390
+ f_userinfo_id: ""
391
+ },
392
+ chargemoney: 0,
393
+ chargeitems: this.$appdata.getParam('收费项目'),
394
+ billstyles: this.$appdata.getParam('票据类型'),
395
+ paymenttypes: this.$appdata.getParam('付款方式'),
396
+ printstyle: this.$appdata.getParam('打印格式'),
397
+ print: false,
398
+ printat: false,
399
+ delprint: false,
400
+ delprintat:false,
401
+ taxprint: false,
402
+ billData: {
403
+ url: 'rs/report/applyCharge_bill',
404
+ bill: ''
405
+ },
406
+ billDataantai: {
407
+ url: 'rs/report/applyChargeAT_bill',
408
+ bill: ''
409
+ },
410
+ config: {
411
+ hasPrint: true, //默认打票
412
+ hasBillManage: true, //默认不启用发票管理
413
+ billType: '报建收费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
414
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
415
+ payment: '现金缴费', // 付款方式
416
+ brandspec: '材料费', // 收费类型
417
+ billtype: "收费发票"
418
+ },
419
+ config2: {
420
+ hasPrint: true, //默认打票
421
+ hasBillManage: true, //默认不启用发票管理
422
+ billType: '报建收费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
423
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
424
+ payment: '现金缴费', // 付款方式
425
+ brandspec: '材料费', // 收费类型
426
+ billtype: "冲正发票"
427
+ },
428
+ addItem: {
429
+ f_charge_money: 0,
430
+ f_amount_words: '',
431
+ f_payment_type: '',
432
+ f_charge_collectors: this.$login.f.name,
433
+ f_charge_date: '',
434
+ f_charge_remarks: '',
435
+ f_filiale: '',
436
+ f_process_id: '',
437
+ f_apply_num: '',
438
+ f_payment_method: '',
439
+ f_charging_status: '有效',
440
+ f_is_correct: '否',
441
+ f_bill_style: ''
442
+ },
443
+ charges: [{f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0}],
444
+ // 启用发票管理需要对票号进行验证
445
+ hasValidateBill: false,
446
+ validateOk: false,
447
+ userinfoRow: {
448
+ rows: []
449
+ },
450
+ oldInfo: {},
451
+ bill: '', // 票数据
452
+ paperticket: false,
453
+ ids: {},
454
+ paperinfo: {
455
+ f_buy_name : '',
456
+ f_pay_id : '',
457
+ f_buy_address : '',
458
+ f_buy_openbank : '',
459
+ f_email_push:''
460
+ },
461
+ param: {},
462
+ papershow: false
463
+ }
464
+ },
465
+ props: ['infee', 'showfee'],
466
+ ready() {
467
+ this.load() // 初始化数据
468
+
469
+ },
470
+
471
+ methods: {
472
+ async papaercom() {
473
+ this.papershow = false
474
+ console.log("this.paperinfo.",this.paperinfo)
475
+ this.param.paperinfo=this.paperinfo
476
+ // this.param.paperinfo.f_buy_name = this.paperinfo.f_buy_name ? this.paperinfo.f_buy_name : ''
477
+ // this.param.paperinfo.f_pay_id = this.paperinfo.f_pay_id ? this.paperinfo.f_pay_id : ''
478
+ // this.param.paperinfo.f_buy_address = this.paperinfo.f_buy_address ? this.paperinfo.f_buy_address : ''
479
+ // this.param.paperinfo.f_buy_openbank = this.paperinfo.f_buy_openbank ? this.paperinfo.f_buy_openbank : ''
480
+ if (this.param.f_print === '电子发票') {
481
+ let temp = await this.$commonService.openEticket(this.param, '报装收费')
482
+ console.log("temp", temp.data.f_bill_url)
483
+ this.f_bill_url = temp.data.f_bill_url
484
+ window.open(this.f_bill_url)
485
+ this.param = {}
486
+ this.$dispatch('success')
487
+ } else if (this.param.f_print === '纸质专票') {
488
+ await this.$commonService.openEticket(this.param, '报装收费')
489
+ this.ids.id = this.param.id
490
+ this.param = {}
491
+ this.paperticket = true
492
+ } else if (this.param.f_print === '纸质普票') {
493
+ await this.$commonService.openEticket(this.param, '报装收费')
494
+ this.ids.id = this.param.id
495
+ this.param = {}
496
+ this.paperticket = true
497
+ }
498
+ this.paperinfo.f_buy_name = ''
499
+ this.paperinfo.f_pay_id = ''
500
+ this.paperinfo.f_buy_address = ''
501
+ this.paperinfo.f_buy_openbank = ''
502
+ this.paperinfo.f_email_push=''
503
+ },
504
+ closeticket() {
505
+ this.paperticket = false
506
+ this.$dispatch('success')
507
+ },
508
+ //冲正
509
+ deleteChargeRecord(index) {
510
+ console.log(JSON.stringify(this.model.rows[index]))
511
+ if (this.config.hasPrint) {
512
+ if (this.model.f_print[0] === '普通收据') {
513
+ if (this.config.hasBillManage) {
514
+
515
+ this.model.f_bill_type = this.model.f_print[0]
516
+ this.model.f_bill_style = this.model.f_print[0]
517
+ this.print = true
518
+
519
+ console.log('f_bill_style' + this.model.f_bill_style)
520
+
521
+ } else {
522
+ this.print = true
523
+ }
524
+ } else if (this.model.f_print[0] === '国税发票') {
525
+ // TODO
526
+ this.$dispatch('success')
527
+ } else if (this.model.f_print[0] === '电子发票') {
528
+ // TODO
529
+ this.$dispatch('success')
530
+ }
531
+ } else {
532
+ this.$dispatch('success')
533
+ }
534
+ this.$showMessage('是否冲正此条记录?', ['confirm', 'cancel']).then((res) => {
535
+ debugger
536
+ if (res === 'confirm') {
537
+ let param = {
538
+ row: this.model.rows[index]
539
+ }
540
+ this.$resetpost('rs/logic/restChargeRecord', {data: param}, {resolveMsg: null, rejectMsg: "冲正失败!"})
541
+ .then((res) => {
542
+ this.$showAlert('冲正成功!', 'success', 5000)
543
+ this.load()
544
+ })
545
+ } else {
546
+ this.load()
547
+ }
548
+ })
549
+ },
550
+ getUserinfo(index) {
551
+ console.log(index)
552
+ console.log("a")
553
+ this.model.f_user_name = this.userinfoRow.rows[index].f_user_name;
554
+ this.model.f_process_id = this.userinfoRow.rows[index].f_process_id;
555
+ this.model.f_phone = this.userinfoRow.rows[index].f_user_phone;
556
+ this.model.f_address = this.userinfoRow.rows[index].address;
557
+ this.model.f_userinfo_id = this.userinfoRow.rows[index].f_userinfo_id;
558
+ this.billmodel.f_user_name = this.userinfoRow.rows[index].f_user_name;
559
+ this.billmodel.f_phone = this.userinfoRow.rows[index].f_user_phone;
560
+ this.billmodel.f_address = this.userinfoRow.rows[index].address;
561
+ this.billmodel.f_userinfo_id = this.userinfoRow.rows[index].f_userinfo_id;
562
+
563
+ },
564
+ calcmoney(index) {
565
+ console.log("开始计算");
566
+ this.charges[index].f_money = this.charges[index].f_price * this.charges[index].f_amount
567
+ let allmoney = 0;
568
+ for (let i = 0; i < this.charges.length; i++) {
569
+ allmoney += parseFloat(this.charges[i].f_money)
570
+ }
571
+ this.model.f_charge_money = allmoney
572
+ // row.f_money = parseFloat(row.f_amount)*parseFloat(row.f_price);
573
+ },
574
+ addItems() {
575
+ this.charges.push({f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0})
576
+ },
577
+ delItems(index) {
578
+ console.log('index==', index);
579
+ if (this.charges.length > 1) {
580
+ this.charges.splice(index, 1)
581
+ }
582
+ },
583
+ selfclean() {
584
+ console.log("清空输入框")
585
+ this.model.f_charge_money = 0
586
+ this.model.f_amount_words = ''
587
+ this.model.f_charge_remarks = ''
588
+ },
589
+ clean() {
590
+ this.addItem = {
591
+ f_charge_money: 0,
592
+ f_amount_words: '',
593
+ f_payment_type: '',
594
+ f_charge_collectors: this.$login.f.name,
595
+ f_charge_date: '',
596
+ f_charge_remarks: '',
597
+ f_filiale: '',
598
+ f_process_id: '',
599
+ f_apply_num: '',
600
+ f_charging_status: '有效',
601
+ f_is_correct: '否',
602
+ f_bill_style: ''
603
+ }
604
+
605
+ // this.$dispatch('refresh', this.model)
606
+ },
607
+ close() {
608
+ console.log("关闭打印框")
609
+ this.taxprint = false
610
+ this.print = false
611
+ this.printat = false
612
+ this.delprint = false
613
+ this.delprintat = false
614
+ this.clean()
615
+ },
616
+ printok() {
617
+ console.log("successs............")
618
+ this.$dispatch('success')
619
+ },
620
+ validateBill(val) {
621
+ this.validateOk = !val.isOk
622
+ this.billData.bill = val.bill
623
+ this.billDataantai.bill = val.bill
624
+ },
625
+
626
+ confirmbuyerinfo(args) {
627
+ let drawbilldata = {
628
+ sellid: this.selectsellid,
629
+ buyerid: args.id,
630
+ operator: this.$login.f.name
631
+ }
632
+ this.closebuyerinfo()
633
+ this.$resetpost('rs/logic/applyDrawBill', {data: drawbilldata}, {resolveMsg: null, rejectMsg: "开发票失败"})
634
+ .then((res) => {
635
+ if (res.data.status === 200) {
636
+ this.$showAlert('申请开具增值税电子发票成功,请稍后到报建功能中【报建收费】中查看电子发票', 'success', 5000)
637
+
638
+ } else {
639
+ this.$showAlert('电子发票开票失败,失败代码为:' + res.data.status, 'warning', 3000)
640
+ }
641
+ })
642
+ },
643
+ // 输入金额校验
644
+ check() {
645
+ console.log('check')
646
+ let re = /^[+-]?\d+(\.\d+)?$/ //判断字符串是否为数字
647
+ if (!this.model.f_charge_money) {//判断缴费金额是否为空
648
+ console.log('check1')
649
+ this.model.f_charge_money = 0
650
+ } else {
651
+ if (!re.test(this.model.f_charge_money)) {
652
+ this.$showMessage("请输入数字")
653
+ this.model.f_charge_money = ''
654
+ return false
655
+ }
656
+ }
657
+
658
+
659
+ return true
660
+ },
661
+
662
+ // 小写转换大写
663
+ smalltoBIG(n) {
664
+ let fraction = ['角', '分'];
665
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
666
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
667
+ let head = n < 0 ? '欠' : '';
668
+ n = Math.abs(n);
669
+
670
+ let s = '';
671
+
672
+ for (var i = 0; i < fraction.length; i++) {
673
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
674
+ }
675
+ s = s || '整';
676
+ n = Math.floor(n);
677
+
678
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
679
+ let p = '';
680
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
681
+ p = digit[n % 10] + unit[1][j] + p;
682
+ n = Math.floor(n / 10);
683
+ }
684
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
685
+ }
686
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
687
+ },
688
+
689
+ // 模态框确定按钮保存数据
690
+
691
+ //
692
+ // f_cumulative_money: 0,//累计缴费金额
693
+ // f_unaccounts_money: '',//未结总金额
694
+ // f_cumulative_invoicing: '',//--累计开票金额--
695
+ // f_residual_invoicing: '',//剩余开票金额
696
+ async confirm() {
697
+ if (this.validateOk) {
698
+ this.$showMessage("当前未分配发票号,请联系管理员!!");
699
+ return;
700
+ }
701
+ Object.assign(this.model, this.model, this.billmodel);
702
+
703
+ let flag = this.check()
704
+ if (!flag) {
705
+ return
706
+ }
707
+ if (Number(this.model.f_charge_money) > Number(this.model.f_unaccounts_money)) {
708
+ this.$showMessage("缴费金额不能大于剩余金额")
709
+ this.model.f_charge_money = 0
710
+ this.model.f_amount_words = ''
711
+ } else if (this.model.f_charge_money == 0 || this.model.f_charge_money == "" || this.model.f_charge_money == null) {
712
+ this.$showMessage("不能缴费0元")
713
+ this.model.f_charge_money = 0
714
+ this.model.f_amount_words = ''
715
+ } else {
716
+ debugger
717
+ //获取购货方信息
718
+ http = new HttpResetClass()
719
+ data = {
720
+ tablename: 't_buyer_info',
721
+ condition: `f_process_id = '${this.infee.f_process_id}' and f_apply_num = '${this.infee.f_apply_num}' `
722
+ }
723
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
724
+ resolveMsg: null,
725
+ rejectMsg: '获取购货方信息失败'
726
+ })
727
+ this.buyerinfo.rows = res.data
728
+ if (this.buyerinfo.rows.length < 1 && this.model.f_print[0] === '增值税电子发票' && this.$appdata.getSingleValue('默认打印票据') === '是') {
729
+ this.$showAlert('未找到购买方信息,请去报建功能"购买方信息"中完善购买方信息后再收费', 'info', 2000)
730
+ return
731
+ }
732
+
733
+ // 累计缴费金额
734
+ let flag1 = this.accAdd(Number(this.model.f_charge_money), Number(this.model.f_cumulative_money))
735
+ // 未结金额
736
+ let flag2 = this.accSub(Number(this.model.f_unaccounts_money), Number(this.model.f_charge_money))
737
+
738
+
739
+ let http = new HttpResetClass()
740
+ console.log('f_charge_money' + Number(this.model.f_charge_money))
741
+ console.log('f_unaccounts_money' + Number(this.model.f_unaccounts_money))
742
+ this.addItem.f_charge_money = this.model.f_charge_money
743
+ this.addItem.f_amount_words = this.model.f_amount_words
744
+ console.log('f_payment' + this.model.f_payment)
745
+ this.addItem.f_payment_method = this.model.f_payment[0]
746
+ this.addItem.f_charge_collectors = this.$login.f.name
747
+ this.addItem.f_charge_date = this.model.f_charge_date
748
+ this.addItem.f_charge_remarks = this.model.f_charge_remarks
749
+ this.addItem.f_filiale = this.model.f_payment_account =='安泰' ? '欣泰集团.安泰天然气' : '欣泰天然气'
750
+ this.addItem.f_process_id = this.infee.f_process_id
751
+ this.addItem.f_apply_num = this.infee.f_apply_num
752
+ this.model.rows.push(this.addItem)
753
+ let chargemoney = this.addItem.f_charge_money
754
+ let chargeitem = this.addItem.f_f_charge_item
755
+ let chargeremarks = this.addItem.f_charge_remarks ? this.addItem.f_charge_remarks : ''
756
+ let chargebillstyle = this.model.f_print[0]
757
+ this.chargemoney = this.addItem.f_charge_money
758
+ this.addItem.f_bill_style = this.model.f_print[0]
759
+ this.addItem.f_userinfo_id = this.model.f_userinfo_id
760
+ this.addItem.f_charge_state = '已收费'
761
+ if (this.model.f_user_name == "") {
762
+
763
+ this.addItem.f_charge_user = this.oldInfo.f_user_name;
764
+ } else {
765
+ this.addItem.f_charge_user = this.model.f_user_name;
766
+ }
767
+ if (this.model.f_user_name == "") {
768
+ this.addItem.f_charge_address = this.oldInfo.f_address;
769
+ } else {
770
+ this.addItem.f_charge_address = this.model.f_address;
771
+ }
772
+ console.log("==>" + JSON.stringify(this.oldInfo))
773
+ let data = {
774
+ tablename: 't_charge_record',
775
+ parameters: this.addItem
776
+ }
777
+ // 生成收费记录的id
778
+ debugger
779
+ let sellid = ''
780
+ let ret = await http.load('POST', 'rs/logic/saveentity', {data: data})
781
+ this.model.chargeid = ret.data.id
782
+ console.log('ret==', ret)
783
+ data = {
784
+ f_cumulative_money: flag1,
785
+ f_unaccounts_money: flag2,
786
+ f_apply_num: this.infee.f_apply_num
787
+ }
788
+ //开始收费 正
789
+ debugger
790
+ for (let i = 0; i < this.charges.length; i++) {
791
+ let saveen = this.charges[i]
792
+ saveen.f_project_item = this.charges[i].f_project_item[0]
793
+ saveen.f_charge_record_id = parseFloat(ret.data.id);
794
+ await http.load('POST', 'rs/logic/saveentity', {
795
+ data: {
796
+ tablename: 't_charge_record_item',
797
+ parameters: saveen
798
+ }
799
+ }, {resolveMsg: null, rejectMsg: "失败"})
800
+ }
801
+ // debugger
802
+ // for (let i = 0; i < this.charges.length; i++) {
803
+ // let saveen = this.charges[i]
804
+ // debugger
805
+ // saveen.f_money= 0 - saveen.f_money
806
+ // saveen.f_project_item = this.charges[i].f_project_item[0]
807
+ // saveen.f_charge_record_id = parseFloat(ret.data.id);
808
+ // await http.load('POST', 'rs/logic/saveentity', {
809
+ // data: {
810
+ // tablename: 't_charge_record_item',
811
+ // parameters: saveen
812
+ // }
813
+ // }, {resolveMsg: null, rejectMsg: "失败"})
814
+ // }
815
+
816
+ await http.load('POST', 'rs/logic/updatechargemoney', {data: data}, {resolveMsg: null, rejectMsg: "添加累计金额失败"})
817
+ .then((res) => {
818
+ this.charges = [{f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0}],
819
+ this.close()
820
+ this.load()
821
+ })
822
+ if (this.config.hasPrint) {
823
+ if (this.model.f_print[0] === '普通收据') {
824
+ if (this.config.hasBillManage) {
825
+
826
+ this.model.f_bill_type = this.model.f_print[0]
827
+ this.model.f_bill_style = this.model.f_print[0]
828
+ debugger
829
+ console.log('打印this.model.f_print[0]',this.model.f_print[0])
830
+ debugger
831
+ if(this.model.f_payment_account==='欣泰'){
832
+ this.print = true
833
+ }else{
834
+ this.printat = true
835
+ }
836
+
837
+
838
+ console.log('f_bill_style' + this.model.f_bill_style)
839
+
840
+ } else {
841
+ debugger
842
+ if(this.model.f_payment_account==='欣泰'){
843
+ this.print = true
844
+ }else{
845
+ this.printat = true
846
+ }
847
+ }
848
+ } else if (this.model.f_print[0] === '纸质普票') {
849
+ this.param.f_print = this.model.f_print[0],
850
+ this.param.id = ret.data.id,
851
+ this.param.bz = this.model.f_charge_remarks
852
+ this.papershow = true
853
+ } else if (this.model.f_print[0] === '纸质专票') {
854
+ // TODO
855
+ this.param.f_print = this.model.f_print[0]
856
+ this.param.id = ret.data.id
857
+ this.param.bz = this.model.f_charge_remarks
858
+ this.papershow = true
859
+
860
+ } else if (this.model.f_print[0] === '电子发票') {
861
+ // TODO
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
+
867
+
868
+ }
869
+ } else {
870
+ this.$dispatch('success')
871
+ }
872
+
873
+ }
874
+ this.model.f_amount_words = ''
875
+ this.model.f_charge_money = 0
876
+ },
877
+ async invoice(val) {
878
+ console.log('打印票据')
879
+ if (val.f_bill_style === '增值税电子发票') {
880
+ this.selectsellid = val.id
881
+ this.showbuyerinfo = true
882
+ }
883
+ },
884
+
885
+ goback() {
886
+ this.$dispatch('hiddenbtn')
887
+ this.showview = false
888
+ },
889
+ async tovoid(index) {
890
+ debugger
891
+ console.log(index)
892
+ console.log(JSON.stringify(this.model.rows))
893
+ this.model.rows[index].f_amount_words = "负" + this.model.rows[index].f_amount_words;
894
+ this.model.rows[index].f_charge_money = -this.model.rows[index].f_charge_money;
895
+ var val = this.model.rows[index];
896
+ this.model.chargeid = val.id;
897
+ this.delprint = false;
898
+ this.charges = [{f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0}],
899
+ console.log(JSON.stringify(val))
900
+ // this.charges =[{f_project_item:'合同总额', f_amount: 0, f_price: 0,f_money:0}],
901
+ debugger
902
+ if (val.f_is_correct === '是' || val.f_charging_status !== '有效' || val.f_is_correct === '冲正中') {
903
+ this.$showMessage('已冲正或正在冲正,不能操作!')
904
+ } else {
905
+ let param = {
906
+ sellid: val.id,
907
+ operator: this.$login.f.name
908
+ }
909
+ this.$resetpost('rs/logic/applyCancelDrawBill', {data: param}, {
910
+ resolveMsg: null,
911
+ rejectMsg: '冲正失败'
912
+ }).then((res) => {
913
+ if (res.data.status === 200) {
914
+ this.model.chargeid = res.data.charge_id;
915
+ if (val.f_bill_style === '增值税电子发票') {
916
+ this.$showAlert('申请增值税电子发票冲正成功,请稍后到报建功能中【报建收费】中查看电子发票', 'success', 5000)
917
+ if(this.model.f_payment_account==='欣泰'){
918
+ this.delprint = true;
919
+ }else{
920
+ this.delprintat = true
921
+ }
922
+
923
+ } else {
924
+ this.$showAlert('冲正成功', 'success', 2000)
925
+ if(this.model.f_payment_account==='欣泰'){
926
+ this.delprint = true;
927
+ }else{
928
+ this.delprintat = true
929
+ }
930
+ }
931
+ if(this.model.f_payment_account==='欣泰'){
932
+ this.delprint = true;
933
+ }else{
934
+ this.delprintat = true
935
+ }
936
+ this.load()
937
+ } else {
938
+ this.$showAlert('冲正失败', 'warning', 5000)
939
+ }
940
+ })
941
+
942
+
943
+ }
944
+ },
945
+ tomakeup(val) {
946
+ if (val.f_invoice_num) {
947
+ this.$showMessage('此记录有票据,不能操作!')
948
+ } else {
949
+ this.invoice(val)
950
+ }
951
+ },
952
+ //根据票据流水号查看票据
953
+ async seeeticket(val) {
954
+ console.log('该票据流水号为:', val.f_fpqqlsh)
955
+ var eticketData = await this.$resetpost('rs/sql/querySingleTable', {
956
+ data: {
957
+ items: 'f_bill_url,f_url_code',
958
+ tablename: 't_eticket',
959
+ condition: `f_serial_number=${val.f_fpqqlsh}`
960
+ }
961
+ }, {resolveMsg: null, rejectMsg: null})
962
+ console.log('eticketData:', eticketData)
963
+ var data = eticketData.data[0]
964
+ if (data.f_bill_url && data.f_bill_url != '') {
965
+ console.log(data)
966
+ var auth = data.f_bill_url.split("/")
967
+ console.log("截取", auth)
968
+ var authCode = auth[auth.length - 1]
969
+ var url = `https://${auth[2]}/ent-views/fpExtract/get_fapiao.html?pwd=${data.f_url_code}&authCode=${authCode}`
970
+ this.$showAlert('开票成功!', 'success', 500)
971
+ window.open(url)
972
+ return 'success'
973
+ }
974
+ return 'fail'
975
+ },
976
+ accSub(arg1, arg2) {
977
+ var r1, r2, m, n;
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
+ //last modify by deeka
990
+ //动态控制精度长度
991
+ n = (r1 >= r2) ? r1 : r2;
992
+ return ((arg1 * m - arg2 * m) / m).toFixed(n);
993
+ },
994
+ reset() {
995
+ this.$dispatch('close')
996
+ this.$dispatch('selfsearch')
997
+ },
998
+ accAdd(arg1, arg2) {
999
+ var r1, r2, m;
1000
+ try {
1001
+ r1 = arg1.toString().split(".")[1].length
1002
+ } catch (e) {
1003
+ r1 = 0
1004
+ }
1005
+ try {
1006
+ r2 = arg2.toString().split(".")[1].length
1007
+ } catch (e) {
1008
+ r2 = 0
1009
+ }
1010
+ m = Math.pow(10, Math.max(r1, r2))
1011
+ return (arg1 * m + arg2 * m) / m
1012
+ },
1013
+
1014
+ // 获取数据
1015
+ async load() {
1016
+ console.log('load被重新调用111')
1017
+ this.refresh = !this.refresh
1018
+ console.log("刷新validate,重新加载" + this.refresh)
1019
+ // this.ifsearch = !this.ifsearch
1020
+ let http = new HttpResetClass()
1021
+ let data = {
1022
+ tablename: 't_apply',
1023
+ condition: `f_process_id = '${this.infee.f_process_id}'`
1024
+ //
1025
+ }
1026
+ //获取报建信息
1027
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取报建信息失败'})
1028
+ Object.assign(this.model, this.model, res.data[0])
1029
+ data = {
1030
+ tablename: 't_charge_record',
1031
+ condition: `f_process_id = '${this.infee.f_process_id}' and f_charging_status='有效' and f_is_correct='否'`
1032
+ }
1033
+ //获取付款详情信息
1034
+ res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取付款数据失败'})
1035
+ // 去除付款时间的时分秒
1036
+ for (var i = 0; i < res.data.length; i++) {
1037
+ res.data[i].f_charge_date = res.data[i].f_charge_date.substring(0, 11)
1038
+ }
1039
+ this.model.rows = res.data
1040
+ this.model.f_cumulative_money = 0;
1041
+ for (let i = 0; i < res.data.length; i++) {
1042
+ this.model.f_cumulative_money =parseFloat(parseFloat(this.model.f_cumulative_money) + parseFloat(res.data[i].f_charge_money)).toFixed(2) ;
1043
+ }
1044
+
1045
+
1046
+ //获取购货方信息
1047
+ data = {
1048
+ tablename: 't_buyer_info',
1049
+ condition: `f_process_id = '${this.infee.f_process_id}' and f_apply_num = '${this.infee.f_apply_num}' `
1050
+ }
1051
+ res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取购货方信息失败'})
1052
+ this.buyerinfo.rows = res.data
1053
+
1054
+ //获取用户信息
1055
+ data = {
1056
+ condition: this.infee.f_process_id
1057
+ }
1058
+ let userinfores = await http.load('POST', 'rs/sql/getBillUserinfo', {data: data}, {
1059
+ resolveMsg: null,
1060
+ rejectMsg: '获取用户信息失败!'
1061
+ })
1062
+ this.userinfoRow.rows = userinfores.data;
1063
+
1064
+ this.oldInfo.f_user_name = this.model.f_user_name;
1065
+ this.oldInfo.f_phone = this.model.f_phone;
1066
+ this.oldInfo.f_address = this.model.f_address;
1067
+ this.model.f_isone = ['否'];
1068
+ this.model.adressphone = this.model.f_address + ' ' + this.model.f_phone;
1069
+ this.charges = [{f_project_item: '合同总额', f_amount: 0, f_price: 0, f_money: 0}];
1070
+ this.hasValidateBill=true
1071
+ console.log('load被重新调用222')
1072
+ }
1073
+ },
1074
+ computed: {
1075
+
1076
+ // 计算大写
1077
+ getCapital() {
1078
+ if (this.model.f_charge_money) {
1079
+ this.model.f_amount_words = this.smalltoBIG(Number(this.model.f_charge_money))
1080
+ }
1081
+
1082
+ return this.model.f_amount_words
1083
+ },
1084
+ subcost() {
1085
+ let temp = Number(this.model.f_total_cost)
1086
+ let temp2 = 0
1087
+ for (var i = 0; i < this.model.rows.length; i++) {
1088
+ temp2 += Number(this.model.rows[i].f_fee)
1089
+ }
1090
+ this.model.f_cumulative_money = Math.round(temp2 * 100) / 100
1091
+ this.model.subcost = Math.round((temp - temp2) * 100) / 100
1092
+ if (this.model.f_cumulative_money && this.model.f_jmhj_cost) {
1093
+ temp = Math.round((temp - Number(this.model.f_jmhj_cost)) * 100) / 100
1094
+ }
1095
+ this.model.subcost = Math.round((temp - temp2) * 100) / 100
1096
+ return this.model.subcost
1097
+ },
1098
+ // totalcost () {
1099
+ // this.model.f_total_cost = Number(this.model.f_construction_cost) + Number(this.model.f_material_cost)
1100
+ // + Number(this.model.f_labor_cost) + Number(this.model.f_change_pipeline_cost)
1101
+ // + Number(this.model.f_sbaz_cost) - Number(this.model.f_jmhj_cost)
1102
+ // return this.model.f_total_cost
1103
+ // },
1104
+ aaa() {
1105
+ this.model.f_jmhj_cost = Number(this.model.f_total_cost) - Number(this.model.f_actualfee)
1106
+ return this.model.f_jmhj_cost
1107
+ },
1108
+ feeoptions() {
1109
+ return this.$appdata.getParam('费用类型')
1110
+ },
1111
+ dayin() {
1112
+ return this.$appdata.getParam('打印格式')
1113
+ },
1114
+ jiaofei() {
1115
+ return this.$appdata.getParam('付款方式')
1116
+ // return [{label: '全部', value: ''}, ...AppData.getParam('缴费类型')]
1117
+ }
1118
+ },
1119
+ watch: {
1120
+ 'model.f_isone'(val) {
1121
+ console.log('111111111is one', val, val[0] == '是')
1122
+ if (val[0] == '是') {
1123
+ this.isSingleUser = true
1124
+ this.model.f_user_name = ""
1125
+ this.model.f_phone = ""
1126
+ this.model.f_address = ""
1127
+ this.model.f_userinfo_id = "";
1128
+ } else {
1129
+ this.isSingleUser = false
1130
+ this.model.f_user_name = this.oldInfo.f_user_name
1131
+ this.model.f_phone = this.oldInfo.f_phone
1132
+ this.model.f_address = this.oldInfo.f_address
1133
+ this.model.f_userinfo_id = "";
1134
+ }
1135
+ },
1136
+ 'infee'(val) {
1137
+ this.load()
1138
+ },
1139
+ 'print'(val) {
1140
+ this.load()
1141
+ }
1142
+ },
1143
+ }
1144
+ </script>