apply-clients 5.0.35-ezhou-1 → 5.0.35-ezhou-3

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