apply-clients 3.5.4-95 → 3.5.4-96

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.
Files changed (52) hide show
  1. package/build/dev-server.js +11 -6
  2. package/package.json +1 -1
  3. package/src/apply.js +139 -139
  4. package/src/components/android/AppCheckTakePic.vue +168 -168
  5. package/src/components/android/AppTakePic.vue +182 -182
  6. package/src/components/android/Process/AppServiceControl.vue +1755 -1755
  7. package/src/components/product/Material/MaterialDetailed.vue +268 -268
  8. package/src/components/product/PcZhihuanManagement.vue +160 -160
  9. package/src/components/product/Print/BuildOrder/buildOrderList.vue +339 -339
  10. package/src/components/product/Process/Processes/selectApply.vue +251 -251
  11. package/src/components/product/Process/Processes/selectBcakApply.vue +250 -250
  12. package/src/filiale/fugou/android/AppAddMaterialScience.vue +440 -440
  13. package/src/filiale/fugou/android/AppAddReplacement.vue +341 -341
  14. package/src/filiale/fugou/android/AppChargeManagement.vue +739 -739
  15. package/src/filiale/fugou/android/AppDevicesManagement.vue +519 -519
  16. package/src/filiale/fugou/android/AppInstallationDetails.vue +541 -541
  17. package/src/filiale/fugou/android/AppServiceControl.vue +1845 -1845
  18. package/src/filiale/fugou/android/AppZhihuanManagement.vue +230 -230
  19. package/src/filiale/fugou/android/printCharge.vue +162 -162
  20. package/src/filiale/fugou/android.js +16 -16
  21. package/src/filiale/fugou/pc/AddReplacement.vue +340 -340
  22. package/src/filiale/fugou/pc/ApplyChargeList.vue +480 -480
  23. package/src/filiale/fugou/pc/ExplorationSelect.vue +525 -525
  24. package/src/filiale/fugou/pc/ServiceControl.vue +1705 -1705
  25. package/src/filiale/fugou/pc/ServiceView.vue +941 -941
  26. package/src/filiale/fugou/pc/addMaterialScience.vue +481 -481
  27. package/src/filiale/fugou/pc/addressAndUserinfoManagement.vue +216 -216
  28. package/src/filiale/fugou/pc/chargeReport.vue +143 -143
  29. package/src/filiale/fugou/pc/devicesManagement.vue +483 -483
  30. package/src/filiale/fugou/pc/printChargepc.vue +148 -148
  31. package/src/filiale/fugou/pc.js +16 -16
  32. package/src/filiale/gongyi/android/AppAddMaterialScience.vue +493 -493
  33. package/src/filiale/qianneng/android/AppChargeManagement.vue +686 -686
  34. package/src/filiale/qianneng/android/AppServiceView.vue +795 -795
  35. package/src/filiale/qianneng/android.js +15 -15
  36. package/src/filiale/qianneng/pc/ApplyMaterialDetailed.vue +261 -261
  37. package/src/filiale/qianneng/pc/Applydetail.vue +378 -378
  38. package/src/filiale/qianneng/pc/InstallFunction.vue +188 -188
  39. package/src/filiale/qianneng/pc.js +29 -29
  40. package/src/filiale/yangchunboneng/android/AppChargeManagement.vue +520 -520
  41. package/src/filiale/yangchunboneng/android/AppDevicesManagement.vue +645 -645
  42. package/src/filiale/yangchunboneng/android/AppServiceControl.vue +1703 -1703
  43. package/src/filiale/yangchunboneng/pc/ExplorationSelect.vue +547 -547
  44. package/src/filiale/yangchunboneng/pc/ServiceControl.vue +2112 -2112
  45. package/src/filiale/yangchunboneng/pc/SupervisoryList.vue +605 -605
  46. package/src/filiale/yangchunboneng/pc/SupervisoryListNew.vue +683 -683
  47. package/src/filiale/yangchunboneng/pc/chargeManagement.vue +1052 -1052
  48. package/src/filiale/yangchunboneng/pc/devicesManagement.vue +574 -574
  49. package/src/main.js +4 -3
  50. package/src/test/SessionTestServlet.java +0 -69
  51. package/webapp/WEB-INF/web.xml +0 -52
  52. package/webapp/session-test.jsp +0 -59
@@ -1,686 +1,686 @@
1
- <template>
2
- <div>
3
- <div class="col-sm-12 col-xs-12 form-group app-btn">
4
- <button class="btn btn-info" @click.prevent="showChargeModal()">收费</button>
5
- </div>
6
- <!--<div class="col-sm-12 col-xs-12">
7
- <list :model="charge.payment_terms" partial='list'>
8
- <div partial class="auto app-text panel">
9
- <div class="panel-body panel-self">
10
- <div class="row">
11
- <p class="col-xs-4 text-left font"><b>收费项目</b></p>
12
- <p class="col-xs-8 text-left input-font">{{ row.f_payment_term }}</p>
13
- </div>
14
- <div class="row">
15
- <p class="col-xs-4 text-left font"><b>收费金额</b></p>
16
- <p class="col-xs-8 text-left input-font">{{ row.f_charge_money }}</p>
17
- </div>
18
- <div class="row">
19
- <p class="col-xs-4 text-left font"><b>金额大写</b></p>
20
- <p class="col-xs-8 text-left input-font">{{ row.f_amount_words }}</p>
21
- </div>
22
- <div class="row">
23
- <p class="col-xs-4 text-left font"><b>收费状态</b></p>
24
- <p class="col-xs-8 text-left input-font">未缴费</p>
25
- </div>
26
- </div>
27
- </div>
28
- </list>
29
- </div>-->
30
- <div class="col-sm-12 col-xs-12">
31
- <list :model="model" partial='list'>
32
- <div partial class="auto app-text panel">
33
- <div class="panel-body panel-self">
34
- <div class="row" v-if="selectdata.f_apply_type !== '开发商集体报建'">
35
- <p class="col-xs-4 text-left font"><b>地址</b></p>
36
- <p class="col-xs-8 text-left input-font">{{ row.f_useraddres }}</p>
37
- </div>
38
- <div class="row">
39
- <p class="col-xs-4 text-left font"><b>缴费编号</b></p>
40
- <p class="col-xs-8 text-left input-font">{{ row.f_charge_number }}</p>
41
- </div>
42
- <div class="row">
43
- <p class="col-xs-4 text-left font"><b>收费金额</b></p>
44
- <p class="col-xs-8 text-left input-font">{{ row.f_charge_money }}</p>
45
- </div>
46
- <div class="row">
47
- <p class="col-xs-4 text-left font"><b>金额大写</b></p>
48
- <p class="col-xs-8 text-left input-font">{{ row.f_amount_words }}</p>
49
- </div>
50
- <div class="row">
51
- <p class="col-xs-4 text-left font"><b>收费项目</b></p>
52
- <p class="col-xs-8 text-left input-font">{{ row.f_payment_term }}</p>
53
- </div>
54
- <div class="row">
55
- <p class="col-xs-4 text-left font"><b>付款方式</b></p>
56
- <p class="col-xs-8 text-left input-font">{{ row.f_payment_method }}</p>
57
- </div>
58
- <div class="row" v-if="row.f_payment_method === '银行转账'">
59
- <p class="col-xs-4 text-left font"><b>付款方名称</b></p>
60
- <p class="col-xs-8 text-left input-font">{{ row.f_payer_name }}</p>
61
- </div>
62
- <div class="row" v-if="row.f_payment_method === '银行转账'">
63
- <p class="col-xs-4 text-left font"><b>付款方账号</b></p>
64
- <p class="col-xs-8 text-left input-font">{{ row.f_payer_account }}</p>
65
- </div>
66
- <div class="row" v-if="row.f_payment_method === '银行转账'">
67
- <p class="col-xs-4 text-left font"><b>付款流水号</b></p>
68
- <p class="col-xs-8 text-left input-font">{{ row.f_payer_number }}</p>
69
- </div>
70
- <div class="row">
71
- <p class="col-xs-4 text-left font"><b>收费人员</b></p>
72
- <p class="col-xs-8 text-left input-font">{{ row.f_charge_collectors }}</p>
73
- </div>
74
- <div class="row">
75
- <p class="col-xs-4 text-left font"><b>收费日期</b></p>
76
- <p class="col-xs-8 text-left input-font">{{ row.f_charge_date }}</p>
77
- </div>
78
- <div class="row">
79
- <p class="col-xs-4 text-left font"><b>备注</b></p>
80
- <p class="col-xs-8 text-left input-font">{{ row.f_charge_remarks }}</p>
81
- </div>
82
- </div>
83
- </div>
84
- </list>
85
- </div>
86
-
87
- <modal v-if="showCharge" :show.sync="showCharge" v-ref:modal :large="true" :backdrop="false" title="收费明细">
88
- <header slot="modal-header" class="modal-header">
89
- <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
90
- <h4 class="modal-title">收费明细</h4>
91
- </header>
92
- <article slot="modal-body" class="modal-body clearfix">
93
- <div v-for="(index,payment) in charge.payment_terms">
94
- <div class="form-group row vertical-center" :class="payment.f_payment_term ? '':'has-error'">
95
- <label class="col-xs-4 control-label">收费项目:</label>
96
- <div class="col-xs-8">
97
- <input-select class="select select_list"
98
- v-model="payment.f_payment_term"
99
- :value.sync="payment.f_payment_term"
100
- :options='paymentTerm'
101
- :value-single="true"
102
- close-on-select ></input-select>
103
- </div>
104
- </div>
105
- <div class="form-group row vertical-center" :class="payment.f_charge_money ? '':'has-error'">
106
- <label class="col-xs-4 control-label">收费金额:</label>
107
- <div class="col-xs-8">
108
- <input class="form-control input_view" style="" type="number"
109
- v-model="payment.f_charge_money"
110
- @keyup="handleInput(index)"
111
- @change="moneyChange(index)"
112
- :readonly="false"/>
113
- </div>
114
- </div>
115
- <div class="form-group row vertical-center">
116
- <label class="col-xs-4 control-label">金额大写:</label>
117
- <div class="col-xs-8">
118
- <input class="form-control input_view" style=""
119
- v-model="payment.f_amount_words"
120
- :value="smalltoBIG(0)"
121
- :readonly="true"/>
122
- </div>
123
- </div>
124
- </div>
125
- <div class="row" style="display: flex"> <button type="button" style="margin: 0 auto;" class="btn btn-primary" @click.prevent="addPaymentTerms()">增加收费项目</button> </div>
126
- <div class="form-group row vertical-center">
127
- <label class="col-xs-4 control-label">应交总金额:</label>
128
- <div class="col-xs-8">
129
- <input class="form-control input_view" style=""
130
- v-model="selectdata.f_due_money"
131
- :readonly="true"/>
132
- </div>
133
- </div>
134
- <div class="form-group row vertical-center">
135
- <label class="col-xs-4 control-label">缴费总金额:</label>
136
- <div class="col-xs-8">
137
- <input class="form-control input_view" style=""
138
- v-model="selectdata.f_cumulative_payment_money"
139
- :readonly="true"/>
140
- </div>
141
- </div>
142
- <div class="form-group row vertical-center">
143
- <label class="col-xs-4 control-label">未结总金额:</label>
144
- <div class="col-xs-8">
145
- <input class="form-control input_view" style=""
146
- v-model="selectdata.f_surplus_money"
147
- :readonly="true"/>
148
- </div>
149
- </div>
150
- </article>
151
- <footer slot="modal-footer" class="modal-footer">
152
- <button type="button" class="btn btn-primary" @click.prevent="openQrCode()">确认</button>
153
- </footer>
154
- </modal>
155
-
156
- <modal :show.sync="showQrCode" v-ref:qrcodemodal :large="true" :backdrop="false" style="height: 100%">
157
- <header slot="modal-header" class="modal-header">
158
- <h4 class="modal-title">微信扫码支付</h4>
159
- </header>
160
- <article slot="modal-body" class="modal-body clearfix">
161
- <div class="text-center">
162
- <p><b>收费金额:{{ getTotalAmount() }}¥</b></p>
163
- <p><b>收费项目:{{ getPaymentTerm() }}</b></p>
164
- <div id="qrcode" class="qrcode" v-ref:qrcode></div>
165
- <p v-if="Vue.user.orgid = '22721'">
166
- 等待支付,剩余&ensp;<span style="color: #ff791a">{{timeLeft}}</span>&ensp;秒
167
- </p>
168
- <button type="button" @click="closeQRCode">取消支付</button>
169
- </div>
170
- </article>
171
- <footer slot="modal-footer"></footer>
172
- </modal>
173
- </div>
174
- </template>
175
- <script>
176
- import {getNowDate,isEmpty} from '../../../components/Util'
177
- import {PagedList} from 'vue-client'
178
- import {HttpResetClass} from 'vue-client'
179
- import QRCode from 'qrcodejs2'
180
- import Vue from "vue";
181
-
182
- export default {
183
- title: '收费管理',
184
- props: {
185
- selectdata: {
186
- type: Object
187
- },
188
- mark: {
189
- type: Number,
190
- default: 0
191
- }
192
- },
193
- data () {
194
- return {
195
- showCharge: false, // 收费明细
196
- showQrCode : false, // 二维码
197
- model: {
198
- rows: null
199
- }, // 记录
200
- useraddresList: [], // 地址列表
201
- /*charge: {
202
-
203
- },*/
204
- charge: {
205
- payment_terms:[{f_payment_term: '',f_charge_money: '',f_amount_words:'',f_payment_method : '二维码支付'}]
206
- },
207
- order: null,
208
- timeLeft: 120,
209
- paymentInterval: null,
210
- orderInterval: null,
211
- filiale:"",
212
- config: {
213
-
214
- },
215
- userfiles: {}
216
- }
217
- },
218
- ready () {
219
- let http = new HttpResetClass()
220
- let data = {
221
- tablename: 't_userfiles',
222
- condition: `f_table_state in ('正常','停用','待开通') and f_userinfo_id = '${this.selectdata.f_userinfo_id}' `
223
- }
224
- http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
225
- resolveMsg: null,
226
- rejectMsg: '获取数据失败'
227
- }).then(res=>{
228
- this.userfiles = res.data[0]
229
- })
230
- this.search()
231
- },
232
- methods: {
233
- addPaymentTerms(){
234
- this.charge.payment_terms.push({f_payment_term: '',f_charge_money: '',f_payment_method : '二维码支付'})
235
- },
236
- // 新增收费
237
- async saveCharge() {
238
- let http = new HttpResetClass()
239
- let data = {
240
- apply: this.selectdata,
241
- charge: this.charge,
242
- user: Vue.user,
243
- f_out_trade_no:this.order.f_out_trade_no
244
- }
245
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/appaddApplyChargeRecord`, {data:data}, {
246
- resolveMsg: null,
247
- rejectMsg: '缴费失败!!!'
248
- })
249
- this.selectdata = res.data
250
-
251
- this.$dispatch('breakControl')
252
- },
253
- // 获取订单信息
254
- async getOrderInformation () {
255
- // 查询订单信息
256
- console.log('查询订单信息!!!')
257
- // let data = {
258
- // out_trade_no: this.order.out_trade_no,
259
- // filiale: this.config[Vue.user.number]
260
- // }
261
- // 查询订单状态
262
-
263
- let http = new HttpResetClass()
264
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {
265
- data: {
266
- items: "id",
267
- tablename: "t_weixinreturnxml",
268
- condition: ` f_out_trade_no = '${this.order.f_out_trade_no}' and f_bill_state = 1 `,
269
- orderitem: "id"
270
- }
271
- }, {
272
- resolveMsg: null,
273
- rejectMsg: '订单查询失败!!!'
274
- })
275
- console.log('8888888888')
276
- console.log(this.order.f_out_trade_no)
277
- console.log(JSON.stringify(res))
278
- // 支付成功
279
- if (res.data.length > 0) {
280
- this.$showMessage('支付成功!!!')
281
- clearTimeout(this.paymentInterval)
282
- clearTimeout(this.orderInterval)
283
- this.timeLeft = 10
284
- // 清除二维码
285
- this.clearQrCode()
286
- this.showQrCode = false
287
-
288
- this.saveCharge()
289
- }
290
- },
291
- checkApplyModel(){
292
- console.log(this.charge.payment_terms)
293
- if (Number(this.getTotalAmount()) != Number(this.selectdata.f_surplus_money)) {
294
- this.$showAlert('本次收费金额必须和未交总金额一致!!!', 'warning', 3000)
295
- //this.charge.f_charge_money = null
296
- return
297
- }
298
-
299
- for(let row = 0;row<this.charge.payment_terms.length; row++){
300
- console.log(this.charge.payment_terms[row])
301
- if (isEmpty(this.charge.payment_terms[row].f_payment_term)) {
302
- console.log(1111)
303
- this.$showAlert('请选择收费项目!!!', 'warning', 3000)
304
- return
305
- }else if (isEmpty(this.charge.payment_terms[row].f_charge_money)) {
306
- console.log(2222)
307
- this.$showAlert('请输入收费金额!!!', 'warning', 3000)
308
- return
309
- }
310
- }
311
- this.showCharge=false
312
- this.$dispatch('changeShowfei','待付款')
313
- },
314
- // 打开二维码
315
- async openQrCode () {
316
- console.log(this.charge.payment_terms)
317
- if (Number(this.getTotalAmount()) != Number(this.selectdata.f_surplus_money)) {
318
- this.$showAlert('本次收费金额必须和未交总金额一致!!!', 'warning', 3000)
319
- //this.charge.f_charge_money = null
320
- return
321
- }
322
-
323
- for(let row = 0;row<this.charge.payment_terms.length; row++){
324
- console.log(this.charge.payment_terms[row])
325
- if (isEmpty(this.charge.payment_terms[row].f_payment_term)) {
326
- console.log(1111)
327
- this.$showAlert('请选择收费项目!!!', 'warning', 3000)
328
- return
329
- }else if (isEmpty(this.charge.payment_terms[row].f_charge_money)) {
330
- console.log(2222)
331
- this.$showAlert('请输入收费金额!!!', 'warning', 3000)
332
- return
333
- }
334
- }
335
- this.showCharge=false
336
- let http = new HttpResetClass()
337
- // 正定分公司河北银行支付接口
338
- if (Vue.user.orgid = '22721'){
339
- let data = {
340
- f_userinfo_id: this.selectdata.f_userinfo_id,
341
- type: '燃气费',
342
- f_user_id: this.userfiles.f_user_id,
343
- f_userfiles_id: this.userfiles.f_userfiles_id,
344
- money: this.getTotalAmount(),
345
- f_payment: '二维码支付',
346
- auth_code: '',
347
- filiale: Vue.user.orgid,
348
- body: Vue.user.orgs,
349
- f_operatorid: Vue.user.id,
350
- f_operator: Vue.user.name,
351
- f_orgname: Vue.user.orgs,
352
- }
353
- let res = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/api/af-revenue/logic/v4WeiXinPay`, data, {resolveMsg: null, rejectMsg: '服务器内部出错,'})
354
- res.data.data.f_payment = '二维码支付'
355
- res.data.data.f_orgname = Vue.user.orgs
356
- console.log('正定二维码返回结果---',res.data)
357
- if (res.data.code === 200){
358
- try {
359
- this.order.f_out_trade_no = res.data.data.f_out_trade_no
360
- this.order.url = res.data.data.payUrl
361
- let info = {
362
- apply: this.selectdata,
363
- charge: this.charge,
364
- user: Vue.user,
365
- f_out_trade_no:res.data.data.f_out_trade_no
366
- }
367
- http.load('POST',`${this.$androidUtil.getProxyUrl()}/rs/logic/beforeAddChargeRecord`,{data:info},{
368
- resolveMsg: null,
369
- rejectMsg: null
370
- }).then(ress=>{
371
- if(ress.data.code == '200'){
372
- this.showQrCode = true
373
- this.$nextTick(()=>{
374
- this.qrcode()
375
- })
376
- if (res.data.data.f_out_trade_no) {
377
- this.$showAlert(`正在查询用户付款状态,请勿进行任何操作,耐心等待,如长时间未响应可手动取消`, 'warning',3000)
378
- let self = this
379
- let times = 1
380
- this.timeLeft = 120
381
- // 剩余支付时间
382
- this.paymentInterval = setInterval(() => {
383
- this.timeLeft = this.timeLeft - 1
384
- },1000)
385
- this.orderInterval = window.setInterval(async () => {
386
- times++
387
- let res1 = await self.$resetpost(`${this.$androidUtil.getProxyUrl()}/api/af-revenue/logic/V4WeiXinPayStatus`, res.data.data, {resolveMsg: null, rejectMsg: '付款码支付查询出错,'})
388
- res1 = res1.data.data
389
- // 支付成功关闭定时器
390
- if (res1.result_msg == '支付确认成功') {
391
- this.closeQRCode()
392
- this.saveCharge()
393
- return
394
- }
395
- if (res1.result_msg == '支付失败') {
396
- this.$showAlert(`支付失败, 请提醒用户重新付款`, 'warning',3000)
397
- this.closeQRCode()
398
- return
399
- }
400
- if (times > 24) {
401
- self.$showAlert(`多次查询未成功,请提醒用户重新付款`, 'warning',3000)
402
- this.closeQRCode()
403
- }
404
-
405
- }, 5000)
406
- }
407
- }else{
408
- this.$showMessage('订单生成失败')
409
- }
410
- })
411
- } catch (e) {
412
- this.$showMessage('创建订单失败!')
413
- }
414
- }
415
- }else {
416
- // 接口金额 单位为:分
417
- let data = {
418
- money: this.accMul(this.getTotalAmount() ,100),
419
- attach: {
420
- "f_type": '报建收费',
421
- "f_user": Vue.user.id
422
- },
423
- str: this.getPaymentTerm(),
424
- config: this.filiale,
425
- f_revenue: "productV3"
426
- }
427
- console.log('下单信息')
428
- console.log(JSON.stringify(data))
429
- // 下订单
430
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/ICBCGetCode`, data, {
431
- resolveMsg: null,
432
- rejectMsg: '订单生成失败!!!'
433
- })
434
- console.log('=================================')
435
- console.log(JSON.stringify(res.data))
436
- this.order = res.data
437
- let info = {
438
- apply: this.selectdata,
439
- charge: this.charge,
440
- user: Vue.user,
441
- f_out_trade_no:this.order.f_out_trade_no
442
- }
443
- http.load('POST',`${this.$androidUtil.getProxyUrl()}/rs/logic/beforeAddChargeRecord`,{data:info},{
444
- resolveMsg: null,
445
- rejectMsg: null
446
- }).then(ress=>{
447
- console.log('ress',ress)
448
- if(ress.data.code == '200'){
449
- this.showQrCode = true
450
- this.$nextTick(()=>{
451
- this.qrcode()
452
- })
453
- // 剩余支付时间
454
- this.paymentInterval = setInterval(() => {
455
- this.timeLeft = this.timeLeft - 1
456
- },1000)
457
-
458
- // 3秒查询一次订单支付信息
459
- this.orderInterval = setInterval(() => {
460
- this.getOrderInformation()
461
- },3000)
462
- }else{
463
- this.$showMessage('订单生成失败')
464
- }
465
- })
466
- }
467
- },
468
- accMul(arg1,arg2) {
469
- let m = 0, s1 = arg1.toString(), s2 = arg2.toString();
470
- try {
471
- m += s1.split(".")[1].length
472
- } catch (e) {
473
- }
474
- try {
475
- m += s2.split(".")[1].length
476
- } catch (e) {
477
- }
478
- return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
479
- },
480
- getTotalAmount(){
481
- let money=0
482
- this.charge.payment_terms.forEach((row)=>{
483
- money = Math.floor((Number(money)+Number(row.f_charge_money)) * 100) / 100
484
- })
485
- return money
486
- },
487
- getPaymentTerm(){
488
- let term=''
489
- this.charge.payment_terms.forEach((row)=>{
490
- term += `${row.f_payment_term} `
491
- })
492
- return term
493
- },
494
- qrcode () {
495
- let qrcode = new QRCode('qrcode',{
496
- text: this.order.url, // 设置二维码内容或跳转地址
497
- width: 200, // 设置宽度,单位像素
498
- height: 200, // 设置高度,单位像素
499
- correctLevel: QRCode.CorrectLevel.L //容错率,L/M/Hs
500
- })
501
- },
502
- clearQrCode () {
503
- document.getElementById('qrcode').innerHTML = ''
504
- },
505
- moneyChange (index) {
506
- console.log(`当前下标----${index}`)
507
- if (isEmpty(this.charge.payment_terms[index].f_charge_money) || Number(this.charge.payment_terms[index].f_charge_money) === 0) {
508
- this.$showAlert('单笔收费不能为0元!!!', 'warning', 3000)
509
- this.charge.payment_terms[index].f_charge_money = null
510
- return
511
- }
512
-
513
- },
514
- /*moneyChange () {
515
- if (isEmpty(this.charge.f_charge_money) || Number(this.charge.f_charge_money) === 0) {
516
- this.$showAlert('单笔收费不能为0元!!!', 'warning', 3000)
517
- this.charge.f_charge_money = null
518
- return
519
- }
520
- if (this.selectdata.f_apply_type === '散户集体报建' && Number(this.charge.f_charge_money) > Number(this.charge.f_outstanding_amount)) {
521
- this.$showAlert('单笔收费不能超过未交金额!!!', 'warning', 3000)
522
- this.charge.f_charge_money = null
523
- return
524
- }
525
- if (Number(this.charge.f_charge_money) > Number(this.selectdata.f_surplus_money)) {
526
- this.$showAlert('单笔收费不能超过未交总金额!!!', 'warning', 3000)
527
- this.charge.f_charge_money = null
528
- return
529
- }
530
- },*/
531
- // 金额转大写
532
- handleInput(index) {
533
- // 通过正则过滤小数点后两位
534
- console.log('-----------------------')
535
- this.charge.payment_terms[index].f_charge_money = (this.charge.payment_terms[index].f_charge_money.match(/^\d*(\.?\d{0,2})/g)[0]) || null
536
- this.charge.payment_terms[index].f_amount_words = this.smalltoBIG( this.charge.payment_terms[index].f_charge_money)
537
- },
538
- // 金额转大写
539
- smalltoBIG(n) {
540
- let fraction = ['角', '分'];
541
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
542
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
543
- let head = n < 0 ? '欠' : '';
544
- n = Math.abs(n);
545
-
546
- let s = '';
547
-
548
- for (var i = 0; i < fraction.length; i++) {
549
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
550
- }
551
- s = s || '整';
552
- n = Math.floor(n);
553
-
554
- for (var i = 0; i < unit[0].length && n > 0; i++) {
555
- let p = '';
556
- for (var j = 0; j < unit[1].length && n > 0; j++) {
557
- p = digit[n % 10] + unit[1][j] + p;
558
- n = Math.floor(n / 10);
559
- }
560
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
561
- }
562
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
563
- },
564
- async getUserAddress() {
565
- let http = new HttpResetClass()
566
- let data = {}
567
- let url = null
568
- if (this.selectdata.f_apply_type === '改管报建' || this.selectdata.f_apply_type === '增容报建' || this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建') {
569
- data = {
570
- condition: `ui.f_userinfo_id = ${this.selectdata.f_userinfo_id}`
571
- }
572
- url = `${this.$androidUtil.getProxyUrl()}/rs/sql/applyGetUserinfos`
573
- } else {
574
- data = {
575
- condition: this.selectdata.f_apply_type === '散户集体报建' ? `nvl(cr.f_cumulative_payment_money, 0) < ${this.selectdata.f_price}` : '1=1',
576
- f_process_id: this.selectdata.f_process_id
577
- }
578
- url = `${this.$androidUtil.getProxyUrl()}/rs/sql/getAddresAndCumulativePayment`
579
- }
580
- let res = await http.load('POST', url, {data:data}, {
581
- resolveMsg: null,
582
- rejectMsg: '用户获取失败!!!'
583
- })
584
-
585
- if (res.data.length <= 0) {
586
- this.$showAlert('暂无需要缴费用户!!!', 'warning', 3000)
587
- }
588
-
589
- this.useraddresList = res.data.map(item => {
590
- return {
591
- // 有用户姓名地址后拼接姓名
592
- label: `${item.f_address} ${isEmpty(item.f_user_name) ? '' : '--- ' + item.f_user_name}`,
593
- value: item
594
- }
595
- })
596
-
597
- },
598
- async showChargeModal() {
599
- this.getUserAddress()
600
-
601
- this.charge.f_payment_method = '二维码支付'
602
-
603
- this.showCharge = true
604
- },
605
- async search () {
606
- let http = new HttpResetClass()
607
- let data = {
608
- f_process_id: this.selectdata.f_process_id
609
- }
610
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/getApplyChargeRecord`, {data:data}, {
611
- resolveMsg: null,
612
- rejectMsg: '收费记录查询失败!!!'
613
- })
614
- this.model.rows = res.data
615
- },
616
- // 关闭对话框
617
- closeModal () {
618
- this.showCharge = false
619
- this.showInvalid = false
620
- this.showPrint = false
621
- this.charge = {
622
- payment_terms:[{f_payment_term: '',f_charge_money: '',f_amount_words:'',f_payment_method : '二维码支付'}]
623
- }
624
- this.search()
625
- },
626
- closeQRCode(){
627
- clearTimeout(this.paymentInterval)
628
- clearTimeout(this.orderInterval)
629
- // 清除二维码
630
- this.clearQrCode()
631
- window.clearInterval(this.timer1)
632
- this.showQrCode = false
633
- }
634
- },
635
- events: {
636
- },
637
- computed: {
638
- paymentMethod() {
639
- return this.$appdata.getParam("付款方式")
640
- },
641
- paymentTerm() {
642
- return this.$appdata.getParam("收费项目")
643
- }
644
- },
645
- watch: {
646
- timeLeft () {
647
- if (this.timeLeft <= 0) {
648
- clearTimeout(this.paymentInterval)
649
- clearTimeout(this.orderInterval)
650
-
651
- this.timeLeft = 120
652
-
653
- // 清除二维码
654
- this.clearQrCode()
655
-
656
- this.showQrCode = false
657
-
658
- this.$showMessage('订单支付超时!!!')
659
- }
660
- }
661
- }
662
- }
663
- </script>
664
- <style scoped lang="less">
665
- .qrcode {
666
- display: inline-block !important;
667
- margin: 10px 0px;
668
- }
669
- .panel-self{
670
- border-radius: 10px;
671
- border:1px solid #499EDF;
672
- background-color: #F8F8F8;
673
- }
674
- .vertical-center {
675
- display: flex;
676
- align-items: center;
677
- text-align: center;
678
- }
679
- /*清除model中的浮动*/
680
- .clearfix:after,.clearfix:before{
681
- display: table;
682
- }
683
- .clearfix:after{
684
- clear: both;
685
- }
686
- </style>
1
+ <template>
2
+ <div>
3
+ <div class="col-sm-12 col-xs-12 form-group app-btn">
4
+ <button class="btn btn-info" @click.prevent="showChargeModal()">收费</button>
5
+ </div>
6
+ <!--<div class="col-sm-12 col-xs-12">
7
+ <list :model="charge.payment_terms" partial='list'>
8
+ <div partial class="auto app-text panel">
9
+ <div class="panel-body panel-self">
10
+ <div class="row">
11
+ <p class="col-xs-4 text-left font"><b>收费项目</b></p>
12
+ <p class="col-xs-8 text-left input-font">{{ row.f_payment_term }}</p>
13
+ </div>
14
+ <div class="row">
15
+ <p class="col-xs-4 text-left font"><b>收费金额</b></p>
16
+ <p class="col-xs-8 text-left input-font">{{ row.f_charge_money }}</p>
17
+ </div>
18
+ <div class="row">
19
+ <p class="col-xs-4 text-left font"><b>金额大写</b></p>
20
+ <p class="col-xs-8 text-left input-font">{{ row.f_amount_words }}</p>
21
+ </div>
22
+ <div class="row">
23
+ <p class="col-xs-4 text-left font"><b>收费状态</b></p>
24
+ <p class="col-xs-8 text-left input-font">未缴费</p>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ </list>
29
+ </div>-->
30
+ <div class="col-sm-12 col-xs-12">
31
+ <list :model="model" partial='list'>
32
+ <div partial class="auto app-text panel">
33
+ <div class="panel-body panel-self">
34
+ <div class="row" v-if="selectdata.f_apply_type !== '开发商集体报建'">
35
+ <p class="col-xs-4 text-left font"><b>地址</b></p>
36
+ <p class="col-xs-8 text-left input-font">{{ row.f_useraddres }}</p>
37
+ </div>
38
+ <div class="row">
39
+ <p class="col-xs-4 text-left font"><b>缴费编号</b></p>
40
+ <p class="col-xs-8 text-left input-font">{{ row.f_charge_number }}</p>
41
+ </div>
42
+ <div class="row">
43
+ <p class="col-xs-4 text-left font"><b>收费金额</b></p>
44
+ <p class="col-xs-8 text-left input-font">{{ row.f_charge_money }}</p>
45
+ </div>
46
+ <div class="row">
47
+ <p class="col-xs-4 text-left font"><b>金额大写</b></p>
48
+ <p class="col-xs-8 text-left input-font">{{ row.f_amount_words }}</p>
49
+ </div>
50
+ <div class="row">
51
+ <p class="col-xs-4 text-left font"><b>收费项目</b></p>
52
+ <p class="col-xs-8 text-left input-font">{{ row.f_payment_term }}</p>
53
+ </div>
54
+ <div class="row">
55
+ <p class="col-xs-4 text-left font"><b>付款方式</b></p>
56
+ <p class="col-xs-8 text-left input-font">{{ row.f_payment_method }}</p>
57
+ </div>
58
+ <div class="row" v-if="row.f_payment_method === '银行转账'">
59
+ <p class="col-xs-4 text-left font"><b>付款方名称</b></p>
60
+ <p class="col-xs-8 text-left input-font">{{ row.f_payer_name }}</p>
61
+ </div>
62
+ <div class="row" v-if="row.f_payment_method === '银行转账'">
63
+ <p class="col-xs-4 text-left font"><b>付款方账号</b></p>
64
+ <p class="col-xs-8 text-left input-font">{{ row.f_payer_account }}</p>
65
+ </div>
66
+ <div class="row" v-if="row.f_payment_method === '银行转账'">
67
+ <p class="col-xs-4 text-left font"><b>付款流水号</b></p>
68
+ <p class="col-xs-8 text-left input-font">{{ row.f_payer_number }}</p>
69
+ </div>
70
+ <div class="row">
71
+ <p class="col-xs-4 text-left font"><b>收费人员</b></p>
72
+ <p class="col-xs-8 text-left input-font">{{ row.f_charge_collectors }}</p>
73
+ </div>
74
+ <div class="row">
75
+ <p class="col-xs-4 text-left font"><b>收费日期</b></p>
76
+ <p class="col-xs-8 text-left input-font">{{ row.f_charge_date }}</p>
77
+ </div>
78
+ <div class="row">
79
+ <p class="col-xs-4 text-left font"><b>备注</b></p>
80
+ <p class="col-xs-8 text-left input-font">{{ row.f_charge_remarks }}</p>
81
+ </div>
82
+ </div>
83
+ </div>
84
+ </list>
85
+ </div>
86
+
87
+ <modal v-if="showCharge" :show.sync="showCharge" v-ref:modal :large="true" :backdrop="false" title="收费明细">
88
+ <header slot="modal-header" class="modal-header">
89
+ <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
90
+ <h4 class="modal-title">收费明细</h4>
91
+ </header>
92
+ <article slot="modal-body" class="modal-body clearfix">
93
+ <div v-for="(index,payment) in charge.payment_terms">
94
+ <div class="form-group row vertical-center" :class="payment.f_payment_term ? '':'has-error'">
95
+ <label class="col-xs-4 control-label">收费项目:</label>
96
+ <div class="col-xs-8">
97
+ <input-select class="select select_list"
98
+ v-model="payment.f_payment_term"
99
+ :value.sync="payment.f_payment_term"
100
+ :options='paymentTerm'
101
+ :value-single="true"
102
+ close-on-select ></input-select>
103
+ </div>
104
+ </div>
105
+ <div class="form-group row vertical-center" :class="payment.f_charge_money ? '':'has-error'">
106
+ <label class="col-xs-4 control-label">收费金额:</label>
107
+ <div class="col-xs-8">
108
+ <input class="form-control input_view" style="" type="number"
109
+ v-model="payment.f_charge_money"
110
+ @keyup="handleInput(index)"
111
+ @change="moneyChange(index)"
112
+ :readonly="false"/>
113
+ </div>
114
+ </div>
115
+ <div class="form-group row vertical-center">
116
+ <label class="col-xs-4 control-label">金额大写:</label>
117
+ <div class="col-xs-8">
118
+ <input class="form-control input_view" style=""
119
+ v-model="payment.f_amount_words"
120
+ :value="smalltoBIG(0)"
121
+ :readonly="true"/>
122
+ </div>
123
+ </div>
124
+ </div>
125
+ <div class="row" style="display: flex"> <button type="button" style="margin: 0 auto;" class="btn btn-primary" @click.prevent="addPaymentTerms()">增加收费项目</button> </div>
126
+ <div class="form-group row vertical-center">
127
+ <label class="col-xs-4 control-label">应交总金额:</label>
128
+ <div class="col-xs-8">
129
+ <input class="form-control input_view" style=""
130
+ v-model="selectdata.f_due_money"
131
+ :readonly="true"/>
132
+ </div>
133
+ </div>
134
+ <div class="form-group row vertical-center">
135
+ <label class="col-xs-4 control-label">缴费总金额:</label>
136
+ <div class="col-xs-8">
137
+ <input class="form-control input_view" style=""
138
+ v-model="selectdata.f_cumulative_payment_money"
139
+ :readonly="true"/>
140
+ </div>
141
+ </div>
142
+ <div class="form-group row vertical-center">
143
+ <label class="col-xs-4 control-label">未结总金额:</label>
144
+ <div class="col-xs-8">
145
+ <input class="form-control input_view" style=""
146
+ v-model="selectdata.f_surplus_money"
147
+ :readonly="true"/>
148
+ </div>
149
+ </div>
150
+ </article>
151
+ <footer slot="modal-footer" class="modal-footer">
152
+ <button type="button" class="btn btn-primary" @click.prevent="openQrCode()">确认</button>
153
+ </footer>
154
+ </modal>
155
+
156
+ <modal :show.sync="showQrCode" v-ref:qrcodemodal :large="true" :backdrop="false" style="height: 100%">
157
+ <header slot="modal-header" class="modal-header">
158
+ <h4 class="modal-title">微信扫码支付</h4>
159
+ </header>
160
+ <article slot="modal-body" class="modal-body clearfix">
161
+ <div class="text-center">
162
+ <p><b>收费金额:{{ getTotalAmount() }}¥</b></p>
163
+ <p><b>收费项目:{{ getPaymentTerm() }}</b></p>
164
+ <div id="qrcode" class="qrcode" v-ref:qrcode></div>
165
+ <p v-if="Vue.user.orgid = '22721'">
166
+ 等待支付,剩余&ensp;<span style="color: #ff791a">{{timeLeft}}</span>&ensp;秒
167
+ </p>
168
+ <button type="button" @click="closeQRCode">取消支付</button>
169
+ </div>
170
+ </article>
171
+ <footer slot="modal-footer"></footer>
172
+ </modal>
173
+ </div>
174
+ </template>
175
+ <script>
176
+ import {getNowDate,isEmpty} from '../../../components/Util'
177
+ import {PagedList} from 'vue-client'
178
+ import {HttpResetClass} from 'vue-client'
179
+ import QRCode from 'qrcodejs2'
180
+ import Vue from "vue";
181
+
182
+ export default {
183
+ title: '收费管理',
184
+ props: {
185
+ selectdata: {
186
+ type: Object
187
+ },
188
+ mark: {
189
+ type: Number,
190
+ default: 0
191
+ }
192
+ },
193
+ data () {
194
+ return {
195
+ showCharge: false, // 收费明细
196
+ showQrCode : false, // 二维码
197
+ model: {
198
+ rows: null
199
+ }, // 记录
200
+ useraddresList: [], // 地址列表
201
+ /*charge: {
202
+
203
+ },*/
204
+ charge: {
205
+ payment_terms:[{f_payment_term: '',f_charge_money: '',f_amount_words:'',f_payment_method : '二维码支付'}]
206
+ },
207
+ order: null,
208
+ timeLeft: 120,
209
+ paymentInterval: null,
210
+ orderInterval: null,
211
+ filiale:"",
212
+ config: {
213
+
214
+ },
215
+ userfiles: {}
216
+ }
217
+ },
218
+ ready () {
219
+ let http = new HttpResetClass()
220
+ let data = {
221
+ tablename: 't_userfiles',
222
+ condition: `f_table_state in ('正常','停用','待开通') and f_userinfo_id = '${this.selectdata.f_userinfo_id}' `
223
+ }
224
+ http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
225
+ resolveMsg: null,
226
+ rejectMsg: '获取数据失败'
227
+ }).then(res=>{
228
+ this.userfiles = res.data[0]
229
+ })
230
+ this.search()
231
+ },
232
+ methods: {
233
+ addPaymentTerms(){
234
+ this.charge.payment_terms.push({f_payment_term: '',f_charge_money: '',f_payment_method : '二维码支付'})
235
+ },
236
+ // 新增收费
237
+ async saveCharge() {
238
+ let http = new HttpResetClass()
239
+ let data = {
240
+ apply: this.selectdata,
241
+ charge: this.charge,
242
+ user: Vue.user,
243
+ f_out_trade_no:this.order.f_out_trade_no
244
+ }
245
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/appaddApplyChargeRecord`, {data:data}, {
246
+ resolveMsg: null,
247
+ rejectMsg: '缴费失败!!!'
248
+ })
249
+ this.selectdata = res.data
250
+
251
+ this.$dispatch('breakControl')
252
+ },
253
+ // 获取订单信息
254
+ async getOrderInformation () {
255
+ // 查询订单信息
256
+ console.log('查询订单信息!!!')
257
+ // let data = {
258
+ // out_trade_no: this.order.out_trade_no,
259
+ // filiale: this.config[Vue.user.number]
260
+ // }
261
+ // 查询订单状态
262
+
263
+ let http = new HttpResetClass()
264
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {
265
+ data: {
266
+ items: "id",
267
+ tablename: "t_weixinreturnxml",
268
+ condition: ` f_out_trade_no = '${this.order.f_out_trade_no}' and f_bill_state = 1 `,
269
+ orderitem: "id"
270
+ }
271
+ }, {
272
+ resolveMsg: null,
273
+ rejectMsg: '订单查询失败!!!'
274
+ })
275
+ console.log('8888888888')
276
+ console.log(this.order.f_out_trade_no)
277
+ console.log(JSON.stringify(res))
278
+ // 支付成功
279
+ if (res.data.length > 0) {
280
+ this.$showMessage('支付成功!!!')
281
+ clearTimeout(this.paymentInterval)
282
+ clearTimeout(this.orderInterval)
283
+ this.timeLeft = 10
284
+ // 清除二维码
285
+ this.clearQrCode()
286
+ this.showQrCode = false
287
+
288
+ this.saveCharge()
289
+ }
290
+ },
291
+ checkApplyModel(){
292
+ console.log(this.charge.payment_terms)
293
+ if (Number(this.getTotalAmount()) != Number(this.selectdata.f_surplus_money)) {
294
+ this.$showAlert('本次收费金额必须和未交总金额一致!!!', 'warning', 3000)
295
+ //this.charge.f_charge_money = null
296
+ return
297
+ }
298
+
299
+ for(let row = 0;row<this.charge.payment_terms.length; row++){
300
+ console.log(this.charge.payment_terms[row])
301
+ if (isEmpty(this.charge.payment_terms[row].f_payment_term)) {
302
+ console.log(1111)
303
+ this.$showAlert('请选择收费项目!!!', 'warning', 3000)
304
+ return
305
+ }else if (isEmpty(this.charge.payment_terms[row].f_charge_money)) {
306
+ console.log(2222)
307
+ this.$showAlert('请输入收费金额!!!', 'warning', 3000)
308
+ return
309
+ }
310
+ }
311
+ this.showCharge=false
312
+ this.$dispatch('changeShowfei','待付款')
313
+ },
314
+ // 打开二维码
315
+ async openQrCode () {
316
+ console.log(this.charge.payment_terms)
317
+ if (Number(this.getTotalAmount()) != Number(this.selectdata.f_surplus_money)) {
318
+ this.$showAlert('本次收费金额必须和未交总金额一致!!!', 'warning', 3000)
319
+ //this.charge.f_charge_money = null
320
+ return
321
+ }
322
+
323
+ for(let row = 0;row<this.charge.payment_terms.length; row++){
324
+ console.log(this.charge.payment_terms[row])
325
+ if (isEmpty(this.charge.payment_terms[row].f_payment_term)) {
326
+ console.log(1111)
327
+ this.$showAlert('请选择收费项目!!!', 'warning', 3000)
328
+ return
329
+ }else if (isEmpty(this.charge.payment_terms[row].f_charge_money)) {
330
+ console.log(2222)
331
+ this.$showAlert('请输入收费金额!!!', 'warning', 3000)
332
+ return
333
+ }
334
+ }
335
+ this.showCharge=false
336
+ let http = new HttpResetClass()
337
+ // 正定分公司河北银行支付接口
338
+ if (Vue.user.orgid = '22721'){
339
+ let data = {
340
+ f_userinfo_id: this.selectdata.f_userinfo_id,
341
+ type: '燃气费',
342
+ f_user_id: this.userfiles.f_user_id,
343
+ f_userfiles_id: this.userfiles.f_userfiles_id,
344
+ money: this.getTotalAmount(),
345
+ f_payment: '二维码支付',
346
+ auth_code: '',
347
+ filiale: Vue.user.orgid,
348
+ body: Vue.user.orgs,
349
+ f_operatorid: Vue.user.id,
350
+ f_operator: Vue.user.name,
351
+ f_orgname: Vue.user.orgs,
352
+ }
353
+ let res = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/api/af-revenue/logic/v4WeiXinPay`, data, {resolveMsg: null, rejectMsg: '服务器内部出错,'})
354
+ res.data.data.f_payment = '二维码支付'
355
+ res.data.data.f_orgname = Vue.user.orgs
356
+ console.log('正定二维码返回结果---',res.data)
357
+ if (res.data.code === 200){
358
+ try {
359
+ this.order.f_out_trade_no = res.data.data.f_out_trade_no
360
+ this.order.url = res.data.data.payUrl
361
+ let info = {
362
+ apply: this.selectdata,
363
+ charge: this.charge,
364
+ user: Vue.user,
365
+ f_out_trade_no:res.data.data.f_out_trade_no
366
+ }
367
+ http.load('POST',`${this.$androidUtil.getProxyUrl()}/rs/logic/beforeAddChargeRecord`,{data:info},{
368
+ resolveMsg: null,
369
+ rejectMsg: null
370
+ }).then(ress=>{
371
+ if(ress.data.code == '200'){
372
+ this.showQrCode = true
373
+ this.$nextTick(()=>{
374
+ this.qrcode()
375
+ })
376
+ if (res.data.data.f_out_trade_no) {
377
+ this.$showAlert(`正在查询用户付款状态,请勿进行任何操作,耐心等待,如长时间未响应可手动取消`, 'warning',3000)
378
+ let self = this
379
+ let times = 1
380
+ this.timeLeft = 120
381
+ // 剩余支付时间
382
+ this.paymentInterval = setInterval(() => {
383
+ this.timeLeft = this.timeLeft - 1
384
+ },1000)
385
+ this.orderInterval = window.setInterval(async () => {
386
+ times++
387
+ let res1 = await self.$resetpost(`${this.$androidUtil.getProxyUrl()}/api/af-revenue/logic/V4WeiXinPayStatus`, res.data.data, {resolveMsg: null, rejectMsg: '付款码支付查询出错,'})
388
+ res1 = res1.data.data
389
+ // 支付成功关闭定时器
390
+ if (res1.result_msg == '支付确认成功') {
391
+ this.closeQRCode()
392
+ this.saveCharge()
393
+ return
394
+ }
395
+ if (res1.result_msg == '支付失败') {
396
+ this.$showAlert(`支付失败, 请提醒用户重新付款`, 'warning',3000)
397
+ this.closeQRCode()
398
+ return
399
+ }
400
+ if (times > 24) {
401
+ self.$showAlert(`多次查询未成功,请提醒用户重新付款`, 'warning',3000)
402
+ this.closeQRCode()
403
+ }
404
+
405
+ }, 5000)
406
+ }
407
+ }else{
408
+ this.$showMessage('订单生成失败')
409
+ }
410
+ })
411
+ } catch (e) {
412
+ this.$showMessage('创建订单失败!')
413
+ }
414
+ }
415
+ }else {
416
+ // 接口金额 单位为:分
417
+ let data = {
418
+ money: this.accMul(this.getTotalAmount() ,100),
419
+ attach: {
420
+ "f_type": '报建收费',
421
+ "f_user": Vue.user.id
422
+ },
423
+ str: this.getPaymentTerm(),
424
+ config: this.filiale,
425
+ f_revenue: "productV3"
426
+ }
427
+ console.log('下单信息')
428
+ console.log(JSON.stringify(data))
429
+ // 下订单
430
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/ICBCGetCode`, data, {
431
+ resolveMsg: null,
432
+ rejectMsg: '订单生成失败!!!'
433
+ })
434
+ console.log('=================================')
435
+ console.log(JSON.stringify(res.data))
436
+ this.order = res.data
437
+ let info = {
438
+ apply: this.selectdata,
439
+ charge: this.charge,
440
+ user: Vue.user,
441
+ f_out_trade_no:this.order.f_out_trade_no
442
+ }
443
+ http.load('POST',`${this.$androidUtil.getProxyUrl()}/rs/logic/beforeAddChargeRecord`,{data:info},{
444
+ resolveMsg: null,
445
+ rejectMsg: null
446
+ }).then(ress=>{
447
+ console.log('ress',ress)
448
+ if(ress.data.code == '200'){
449
+ this.showQrCode = true
450
+ this.$nextTick(()=>{
451
+ this.qrcode()
452
+ })
453
+ // 剩余支付时间
454
+ this.paymentInterval = setInterval(() => {
455
+ this.timeLeft = this.timeLeft - 1
456
+ },1000)
457
+
458
+ // 3秒查询一次订单支付信息
459
+ this.orderInterval = setInterval(() => {
460
+ this.getOrderInformation()
461
+ },3000)
462
+ }else{
463
+ this.$showMessage('订单生成失败')
464
+ }
465
+ })
466
+ }
467
+ },
468
+ accMul(arg1,arg2) {
469
+ let m = 0, s1 = arg1.toString(), s2 = arg2.toString();
470
+ try {
471
+ m += s1.split(".")[1].length
472
+ } catch (e) {
473
+ }
474
+ try {
475
+ m += s2.split(".")[1].length
476
+ } catch (e) {
477
+ }
478
+ return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
479
+ },
480
+ getTotalAmount(){
481
+ let money=0
482
+ this.charge.payment_terms.forEach((row)=>{
483
+ money = Math.floor((Number(money)+Number(row.f_charge_money)) * 100) / 100
484
+ })
485
+ return money
486
+ },
487
+ getPaymentTerm(){
488
+ let term=''
489
+ this.charge.payment_terms.forEach((row)=>{
490
+ term += `${row.f_payment_term} `
491
+ })
492
+ return term
493
+ },
494
+ qrcode () {
495
+ let qrcode = new QRCode('qrcode',{
496
+ text: this.order.url, // 设置二维码内容或跳转地址
497
+ width: 200, // 设置宽度,单位像素
498
+ height: 200, // 设置高度,单位像素
499
+ correctLevel: QRCode.CorrectLevel.L //容错率,L/M/Hs
500
+ })
501
+ },
502
+ clearQrCode () {
503
+ document.getElementById('qrcode').innerHTML = ''
504
+ },
505
+ moneyChange (index) {
506
+ console.log(`当前下标----${index}`)
507
+ if (isEmpty(this.charge.payment_terms[index].f_charge_money) || Number(this.charge.payment_terms[index].f_charge_money) === 0) {
508
+ this.$showAlert('单笔收费不能为0元!!!', 'warning', 3000)
509
+ this.charge.payment_terms[index].f_charge_money = null
510
+ return
511
+ }
512
+
513
+ },
514
+ /*moneyChange () {
515
+ if (isEmpty(this.charge.f_charge_money) || Number(this.charge.f_charge_money) === 0) {
516
+ this.$showAlert('单笔收费不能为0元!!!', 'warning', 3000)
517
+ this.charge.f_charge_money = null
518
+ return
519
+ }
520
+ if (this.selectdata.f_apply_type === '散户集体报建' && Number(this.charge.f_charge_money) > Number(this.charge.f_outstanding_amount)) {
521
+ this.$showAlert('单笔收费不能超过未交金额!!!', 'warning', 3000)
522
+ this.charge.f_charge_money = null
523
+ return
524
+ }
525
+ if (Number(this.charge.f_charge_money) > Number(this.selectdata.f_surplus_money)) {
526
+ this.$showAlert('单笔收费不能超过未交总金额!!!', 'warning', 3000)
527
+ this.charge.f_charge_money = null
528
+ return
529
+ }
530
+ },*/
531
+ // 金额转大写
532
+ handleInput(index) {
533
+ // 通过正则过滤小数点后两位
534
+ console.log('-----------------------')
535
+ this.charge.payment_terms[index].f_charge_money = (this.charge.payment_terms[index].f_charge_money.match(/^\d*(\.?\d{0,2})/g)[0]) || null
536
+ this.charge.payment_terms[index].f_amount_words = this.smalltoBIG( this.charge.payment_terms[index].f_charge_money)
537
+ },
538
+ // 金额转大写
539
+ smalltoBIG(n) {
540
+ let fraction = ['角', '分'];
541
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
542
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
543
+ let head = n < 0 ? '欠' : '';
544
+ n = Math.abs(n);
545
+
546
+ let s = '';
547
+
548
+ for (var i = 0; i < fraction.length; i++) {
549
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
550
+ }
551
+ s = s || '整';
552
+ n = Math.floor(n);
553
+
554
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
555
+ let p = '';
556
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
557
+ p = digit[n % 10] + unit[1][j] + p;
558
+ n = Math.floor(n / 10);
559
+ }
560
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
561
+ }
562
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
563
+ },
564
+ async getUserAddress() {
565
+ let http = new HttpResetClass()
566
+ let data = {}
567
+ let url = null
568
+ if (this.selectdata.f_apply_type === '改管报建' || this.selectdata.f_apply_type === '增容报建' || this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建') {
569
+ data = {
570
+ condition: `ui.f_userinfo_id = ${this.selectdata.f_userinfo_id}`
571
+ }
572
+ url = `${this.$androidUtil.getProxyUrl()}/rs/sql/applyGetUserinfos`
573
+ } else {
574
+ data = {
575
+ condition: this.selectdata.f_apply_type === '散户集体报建' ? `nvl(cr.f_cumulative_payment_money, 0) < ${this.selectdata.f_price}` : '1=1',
576
+ f_process_id: this.selectdata.f_process_id
577
+ }
578
+ url = `${this.$androidUtil.getProxyUrl()}/rs/sql/getAddresAndCumulativePayment`
579
+ }
580
+ let res = await http.load('POST', url, {data:data}, {
581
+ resolveMsg: null,
582
+ rejectMsg: '用户获取失败!!!'
583
+ })
584
+
585
+ if (res.data.length <= 0) {
586
+ this.$showAlert('暂无需要缴费用户!!!', 'warning', 3000)
587
+ }
588
+
589
+ this.useraddresList = res.data.map(item => {
590
+ return {
591
+ // 有用户姓名地址后拼接姓名
592
+ label: `${item.f_address} ${isEmpty(item.f_user_name) ? '' : '--- ' + item.f_user_name}`,
593
+ value: item
594
+ }
595
+ })
596
+
597
+ },
598
+ async showChargeModal() {
599
+ this.getUserAddress()
600
+
601
+ this.charge.f_payment_method = '二维码支付'
602
+
603
+ this.showCharge = true
604
+ },
605
+ async search () {
606
+ let http = new HttpResetClass()
607
+ let data = {
608
+ f_process_id: this.selectdata.f_process_id
609
+ }
610
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/getApplyChargeRecord`, {data:data}, {
611
+ resolveMsg: null,
612
+ rejectMsg: '收费记录查询失败!!!'
613
+ })
614
+ this.model.rows = res.data
615
+ },
616
+ // 关闭对话框
617
+ closeModal () {
618
+ this.showCharge = false
619
+ this.showInvalid = false
620
+ this.showPrint = false
621
+ this.charge = {
622
+ payment_terms:[{f_payment_term: '',f_charge_money: '',f_amount_words:'',f_payment_method : '二维码支付'}]
623
+ }
624
+ this.search()
625
+ },
626
+ closeQRCode(){
627
+ clearTimeout(this.paymentInterval)
628
+ clearTimeout(this.orderInterval)
629
+ // 清除二维码
630
+ this.clearQrCode()
631
+ window.clearInterval(this.timer1)
632
+ this.showQrCode = false
633
+ }
634
+ },
635
+ events: {
636
+ },
637
+ computed: {
638
+ paymentMethod() {
639
+ return this.$appdata.getParam("付款方式")
640
+ },
641
+ paymentTerm() {
642
+ return this.$appdata.getParam("收费项目")
643
+ }
644
+ },
645
+ watch: {
646
+ timeLeft () {
647
+ if (this.timeLeft <= 0) {
648
+ clearTimeout(this.paymentInterval)
649
+ clearTimeout(this.orderInterval)
650
+
651
+ this.timeLeft = 120
652
+
653
+ // 清除二维码
654
+ this.clearQrCode()
655
+
656
+ this.showQrCode = false
657
+
658
+ this.$showMessage('订单支付超时!!!')
659
+ }
660
+ }
661
+ }
662
+ }
663
+ </script>
664
+ <style scoped lang="less">
665
+ .qrcode {
666
+ display: inline-block !important;
667
+ margin: 10px 0px;
668
+ }
669
+ .panel-self{
670
+ border-radius: 10px;
671
+ border:1px solid #499EDF;
672
+ background-color: #F8F8F8;
673
+ }
674
+ .vertical-center {
675
+ display: flex;
676
+ align-items: center;
677
+ text-align: center;
678
+ }
679
+ /*清除model中的浮动*/
680
+ .clearfix:after,.clearfix:before{
681
+ display: table;
682
+ }
683
+ .clearfix:after{
684
+ clear: both;
685
+ }
686
+ </style>