sale-client 4.2.105 → 4.2.107

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 (54) hide show
  1. package/.gradle/5.2.1/fileChanges/last-build.bin +0 -0
  2. package/.gradle/5.2.1/fileHashes/fileHashes.lock +0 -0
  3. package/.gradle/5.2.1/gc.properties +0 -0
  4. package/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  5. package/.gradle/buildOutputCleanup/cache.properties +2 -0
  6. package/.gradle/vcs-1/gc.properties +0 -0
  7. package/build/dev-server.js +36 -58
  8. package/businessNew.json +201 -0
  9. package/index.html +2 -7
  10. package/package.json +1 -1
  11. package/src/App.vue +1 -1
  12. package/src/components/revenue/HandManager/MeterBookUser.vue +726 -726
  13. package/src/components/revenue/comprehen/ComprehenOperation/QrPay/QrPaymentDetailed.vue +423 -423
  14. package/src/components/revenue/comprehen/Maintenance/hand/handOperate.vue +469 -469
  15. package/src/components/revenue/machineHandManage/ArrearsQuery.vue +938 -938
  16. package/src/filiale/alashan/eticket/EticketRecordList.vue +428 -428
  17. package/src/filiale/bayan/ChargeList.vue +1010 -1010
  18. package/src/filiale/bayan/StockListmain.vue +543 -543
  19. package/src/filiale/bazhong/UserInfoDetailManageNew.vue +245 -245
  20. package/src/filiale/bazhong/ic_detail/ChangeMeterQueryUser.vue +370 -370
  21. package/src/filiale/bazhong/sale.js +8 -8
  22. package/src/filiale/beifangshiye/OtherChargeNew.vue +625 -625
  23. package/src/filiale/lixianV3/ArrearsQuery.vue +938 -938
  24. package/src/filiale/lixianV3/InsuranceChargesDetails.vue +425 -425
  25. package/src/filiale/meihekou/common/userinfo_detail/ic_detail/MachineRecordQuery.vue +281 -281
  26. package/src/filiale/ronghao/ArrearsQuery.vue +974 -974
  27. package/src/filiale/ronghao/CardService.js +2144 -2144
  28. package/src/filiale/ronghao/ChargeOper.vue +8 -8
  29. package/src/filiale/ronghao/HistoryHandQueryUser.vue +363 -0
  30. package/src/filiale/ronghao/InsuranceManage.vue +58 -58
  31. package/src/filiale/ronghao/MachineChargeService.js +149 -149
  32. package/src/filiale/ronghao/PaymentCode.vue +174 -174
  33. package/src/filiale/ronghao/PriceChangeCompensation/CompensationManage.vue +26 -26
  34. package/src/filiale/ronghao/PriceChangeCompensation/IotCompensation.vue +319 -318
  35. package/src/filiale/ronghao/PriceChangeCompensation/JbCompensation.vue +343 -343
  36. package/src/filiale/ronghao/PriceChangeCompensation/SurplusRecordDetail.vue +74 -74
  37. package/src/filiale/ronghao/ReplaceCardManage.vue +415 -415
  38. package/src/filiale/ronghao/Upload.vue +654 -654
  39. package/src/filiale/ronghao/UserInfoDetailManageNew.vue +5 -0
  40. package/src/filiale/ronghao/cardDown.vue +1141 -1141
  41. package/src/filiale/ronghao/changemeterOperate.vue +315 -315
  42. package/src/filiale/ronghao/fillgasSpecific.vue +313 -313
  43. package/src/filiale/ronghao/ic_detail/ChargeRecordQuery.vue +106 -106
  44. package/src/filiale/ronghao/ic_detail/WatchCollection.vue +115 -115
  45. package/src/filiale/ronghao/ic_detail/WebHandQueryUser.vue +411 -411
  46. package/src/filiale/ronghao/machineDown.vue +1176 -1176
  47. package/src/filiale/ronghao/replacementSingleInfoOperation.vue +315 -315
  48. package/src/filiale/ronghao/specificInformation.vue +537 -537
  49. package/src/filiale/yangchun/ChargeList.vue +954 -954
  50. package/src/filiale/yangchun/OtherChargeNew.vue +2 -2
  51. package/src/filiale/yuncheng/changemeterListMaintain.vue +504 -504
  52. package/src/filiale/zhongsheng/BlackListList.vue +293 -293
  53. package/src/filiale/zhongyi/HandQueryUser.vue +389 -389
  54. package/src/main.js +3 -3
@@ -1,149 +1,149 @@
1
- import Vue from 'vue'
2
-
3
- let MachineChargeService = {
4
- install (Vue, options) {
5
- // 给vue增添对话框显示方法
6
- Vue.MachineChargeService = Vue.prototype.$MachineChargeService = MachineChargeService
7
- },
8
-
9
- // 按表收费
10
- async marchineCharge (model, model2, row, floor) {
11
- console.log('保存收费。。。', model, model2, row)
12
- let f_serial_number = ''
13
- if (model.f_serial_number) {
14
- f_serial_number = model.f_serial_number
15
- }
16
- let f_serial_id = ''
17
- if (model2 && model2.f_serial_id) {
18
- f_serial_id = model2.f_serial_id
19
- }
20
- if (!model2 || !model2.garbage_number) {
21
- model2 = {
22
- // garbage_number: 0,
23
- // garbage_money: 0
24
- }
25
- }
26
- let param = {
27
- garbage_number: model2.garbage_number,
28
- garbage_money: model2.garbage_money,
29
- f_serial_id: f_serial_id,
30
- f_userinfo_id: row.f_userinfo_id,
31
- f_user_id: row.f_user_id,
32
- handids: model.handids,
33
- f_serial_number: f_serial_number,
34
- f_balance: row.f_balance,
35
- f_overdue: model.f_overdue,
36
- userinfo_version: row.userinfo_version,
37
- version: row.version,
38
- f_collection: model.f_collection - model.f_garbage_fee,
39
- f_preamount: model.f_totalcost,
40
- f_payment: model.f_payment[0],
41
- f_print: model.f_print[0],
42
- f_comments: model.f_comments,
43
- // 优惠金额
44
- f_privilege_money: model.f_privilege_money,
45
- f_after_discount: model.f_after_discount,
46
- isBreakOverdue: model.isBreakOverdue,
47
- floor: floor,
48
- operInfo: {
49
- f_operator: model.f_operator ? model.f_operator : Vue.$login.f.name,
50
- f_operatorid: Vue.$login.f.id,
51
- f_orgid: Vue.$login.f.orgid,
52
- f_orgname: Vue.$login.f.orgs,
53
- f_depid: Vue.$login.f.depids,
54
- f_depname: Vue.$login.f.deps,
55
- f_zoneid: Vue.$login.f.zoneid,
56
- f_zones: Vue.$login.f.zones
57
- },
58
- other: {
59
- f_grade_type: row.f_grade_fee,
60
- f_collection: model.f_garbage_fee,
61
- f_comments: model.f_comments,
62
- f_payment: model.f_payment[0],
63
- f_voucher_number: '',
64
- f_print: model.f_print[0],
65
- f_service_person: Vue.$login.f.name,
66
- t_userfees: '',
67
- f_fee_type: ['0'],
68
- f_fee_time: ['12'],
69
- otherdetail: [{f_brand_spec: ['生活垃圾'], f_unitprice: '5', f_number: model.f_garbage_fee / 5}]
70
- }
71
- }
72
- if (model.selectedids) {
73
- param.selectedids = model.selectedids
74
- }
75
- if (model.f_serial_id) {
76
- param.f_serial_id = model.f_serial_id
77
- }
78
- if (model.isBreakOverdue) {
79
- param.breakOverdue = model.breakOverdue
80
- }
81
- // if (model.f_collection - model.f_garbage_fee <= 0 && (model.f_totalcost - (model.f_collection + row.f_balance)) >= 0) {
82
- // param.f_collection = 0
83
- // }
84
- try {
85
- return await Vue.resetpost('api/af-revenue/logic/machineChargePay', {data: param}, {resolveMsg: '机表收费成功', rejectMsg: '收费失败'})
86
- } catch (error) {
87
- console.log('这里进来了吗?', param)
88
- if (param.f_payment.indexOf('扫码枪支付') > -1) {
89
- Vue.resetpost('weixin2/rs/pay/jsApiRefund', {
90
- data: {
91
- out_trade_no: param.f_serial_id,
92
- f_total_fee: param.f_collection,
93
- flag: 'microPayRongHaoJsbc'
94
- }
95
- }, {resolveMsg: null, rejectMsg: '调用银行退费接口失败'})
96
- }
97
- throw error
98
- }
99
- },
100
- // 保存预存收费
101
- async depositCharge (model, row, floor) {
102
- console.log('保存收费。。。', model, row)
103
- let param = {
104
- f_serial_id: model.f_serial_id,
105
- f_userinfo_id: row.f_userinfo_id,
106
- f_userfiles_id: row.f_userfiles_id,
107
- f_balance: row.f_balance,
108
- f_meter_type: row.f_meter_type,
109
- f_overdue: model.f_overdue,
110
- f_collection: model.f_collection - model.f_garbage_fee,
111
- f_preamount: model.f_totalcost,
112
- f_payment: model.f_payment[0],
113
- f_print: model.f_print[0],
114
- f_comments: model.f_comments,
115
- // 优惠金额
116
- f_privilege_money: model.f_privilege_money,
117
- f_after_discount: model.f_after_discount,
118
- isBreakOverdue: model.isBreakOverdue,
119
- f_serial_number: model.f_serial_number,
120
- floor: floor,
121
- operInfo: {
122
- f_operator: Vue.$login.f.name,
123
- f_operatorid: Vue.$login.f.id,
124
- f_orgid: Vue.$login.f.orgid,
125
- f_orgname: Vue.$login.f.orgs,
126
- f_depid: Vue.$login.f.depids,
127
- f_depname: Vue.$login.f.deps,
128
- f_zoneid: Vue.$login.f.zoneid,
129
- f_zones: Vue.$login.f.zones
130
- }
131
- }
132
- try {
133
- return await Vue.resetpost('api/af-revenue/logic/depositCharge', {data: param}, {resolveMsg: '预存收费成功', rejectMsg: '预存收费失败'})
134
- } catch (error) {
135
- if (param.f_payment.indexOf('扫码枪支付') > -1) {
136
- Vue.resetpost('weixin2/rs/pay/jsApiRefund', {
137
- data: {
138
- out_trade_no: param.f_serial_id,
139
- f_total_fee: param.f_collection,
140
- flag: 'microPayRongHaoJsbc'
141
- }
142
- }, {resolveMsg: null, rejectMsg: '调用银行退费接口失败'})
143
- }
144
- throw error
145
- }
146
- }
147
- }
148
-
149
- export default MachineChargeService
1
+ import Vue from 'vue'
2
+
3
+ let MachineChargeService = {
4
+ install (Vue, options) {
5
+ // 给vue增添对话框显示方法
6
+ Vue.MachineChargeService = Vue.prototype.$MachineChargeService = MachineChargeService
7
+ },
8
+
9
+ // 按表收费
10
+ async marchineCharge (model, model2, row, floor) {
11
+ console.log('保存收费。。。', model, model2, row)
12
+ let f_serial_number = ''
13
+ if (model.f_serial_number) {
14
+ f_serial_number = model.f_serial_number
15
+ }
16
+ let f_serial_id = ''
17
+ if (model2 && model2.f_serial_id) {
18
+ f_serial_id = model2.f_serial_id
19
+ }
20
+ if (!model2 || !model2.garbage_number) {
21
+ model2 = {
22
+ // garbage_number: 0,
23
+ // garbage_money: 0
24
+ }
25
+ }
26
+ let param = {
27
+ garbage_number: model2.garbage_number,
28
+ garbage_money: model2.garbage_money,
29
+ f_serial_id: f_serial_id,
30
+ f_userinfo_id: row.f_userinfo_id,
31
+ f_user_id: row.f_user_id,
32
+ handids: model.handids,
33
+ f_serial_number: f_serial_number,
34
+ f_balance: row.f_balance,
35
+ f_overdue: model.f_overdue,
36
+ userinfo_version: row.userinfo_version,
37
+ version: row.version,
38
+ f_collection: model.f_collection - model.f_garbage_fee,
39
+ f_preamount: model.f_totalcost,
40
+ f_payment: model.f_payment[0],
41
+ f_print: model.f_print[0],
42
+ f_comments: model.f_comments,
43
+ // 优惠金额
44
+ f_privilege_money: model.f_privilege_money,
45
+ f_after_discount: model.f_after_discount,
46
+ isBreakOverdue: model.isBreakOverdue,
47
+ floor: floor,
48
+ operInfo: {
49
+ f_operator: model.f_operator ? model.f_operator : Vue.$login.f.name,
50
+ f_operatorid: Vue.$login.f.id,
51
+ f_orgid: Vue.$login.f.orgid,
52
+ f_orgname: Vue.$login.f.orgs,
53
+ f_depid: Vue.$login.f.depids,
54
+ f_depname: Vue.$login.f.deps,
55
+ f_zoneid: Vue.$login.f.zoneid,
56
+ f_zones: Vue.$login.f.zones
57
+ },
58
+ other: {
59
+ f_grade_type: row.f_grade_fee,
60
+ f_collection: model.f_garbage_fee,
61
+ f_comments: model.f_comments,
62
+ f_payment: model.f_payment[0],
63
+ f_voucher_number: '',
64
+ f_print: model.f_print[0],
65
+ f_service_person: Vue.$login.f.name,
66
+ t_userfees: '',
67
+ f_fee_type: ['0'],
68
+ f_fee_time: ['12'],
69
+ otherdetail: [{f_brand_spec: ['生活垃圾'], f_unitprice: '5', f_number: model.f_garbage_fee / 5}]
70
+ }
71
+ }
72
+ if (model.selectedids) {
73
+ param.selectedids = model.selectedids
74
+ }
75
+ if (model.f_serial_id) {
76
+ param.f_serial_id = model.f_serial_id
77
+ }
78
+ if (model.isBreakOverdue) {
79
+ param.breakOverdue = model.breakOverdue
80
+ }
81
+ // if (model.f_collection - model.f_garbage_fee <= 0 && (model.f_totalcost - (model.f_collection + row.f_balance)) >= 0) {
82
+ // param.f_collection = 0
83
+ // }
84
+ try {
85
+ return await Vue.resetpost('api/af-revenue/logic/machineChargePay', {data: param}, {resolveMsg: '机表收费成功', rejectMsg: '收费失败'})
86
+ } catch (error) {
87
+ console.log('这里进来了吗?', param)
88
+ if (param.f_payment.indexOf('扫码枪支付') > -1) {
89
+ Vue.resetpost('weixin2/rs/pay/jsApiRefund', {
90
+ data: {
91
+ out_trade_no: param.f_serial_id,
92
+ f_total_fee: param.f_collection,
93
+ flag: 'microPayRongHaoJsbc'
94
+ }
95
+ }, {resolveMsg: null, rejectMsg: '调用银行退费接口失败'})
96
+ }
97
+ throw error
98
+ }
99
+ },
100
+ // 保存预存收费
101
+ async depositCharge (model, row, floor) {
102
+ console.log('保存收费。。。', model, row)
103
+ let param = {
104
+ f_serial_id: model.f_serial_id,
105
+ f_userinfo_id: row.f_userinfo_id,
106
+ f_userfiles_id: row.f_userfiles_id,
107
+ f_balance: row.f_balance,
108
+ f_meter_type: row.f_meter_type,
109
+ f_overdue: model.f_overdue,
110
+ f_collection: model.f_collection - model.f_garbage_fee,
111
+ f_preamount: model.f_totalcost,
112
+ f_payment: model.f_payment[0],
113
+ f_print: model.f_print[0],
114
+ f_comments: model.f_comments,
115
+ // 优惠金额
116
+ f_privilege_money: model.f_privilege_money,
117
+ f_after_discount: model.f_after_discount,
118
+ isBreakOverdue: model.isBreakOverdue,
119
+ f_serial_number: model.f_serial_number,
120
+ floor: floor,
121
+ operInfo: {
122
+ f_operator: Vue.$login.f.name,
123
+ f_operatorid: Vue.$login.f.id,
124
+ f_orgid: Vue.$login.f.orgid,
125
+ f_orgname: Vue.$login.f.orgs,
126
+ f_depid: Vue.$login.f.depids,
127
+ f_depname: Vue.$login.f.deps,
128
+ f_zoneid: Vue.$login.f.zoneid,
129
+ f_zones: Vue.$login.f.zones
130
+ }
131
+ }
132
+ try {
133
+ return await Vue.resetpost('api/af-revenue/logic/depositCharge', {data: param}, {resolveMsg: '预存收费成功', rejectMsg: '预存收费失败'})
134
+ } catch (error) {
135
+ if (param.f_payment.indexOf('扫码枪支付') > -1) {
136
+ Vue.resetpost('weixin2/rs/pay/jsApiRefund', {
137
+ data: {
138
+ out_trade_no: param.f_serial_id,
139
+ f_total_fee: param.f_collection,
140
+ flag: 'microPayRongHaoJsbc'
141
+ }
142
+ }, {resolveMsg: null, rejectMsg: '调用银行退费接口失败'})
143
+ }
144
+ throw error
145
+ }
146
+ }
147
+ }
148
+
149
+ export default MachineChargeService
@@ -1,174 +1,174 @@
1
- <template>
2
- <div id='PaymentCode'>
3
- <modal :show.sync="paymentCodeShow" backdrop="false">
4
- <header slot="modal-header" class="modal-header">
5
- <h4 class="modal-title">请扫描用户付款码</h4>
6
- </header>
7
- <article slot="modal-body" class="modal-body">
8
- <div class="form-horizontal">
9
- <div class="form-group">
10
- <input type="text" class="form-control" @keyup.enter="ConfirmCode" @blur="paycodefocus"
11
- v-model="paymentCode" placeholder="请扫描用户付款码" v-el:paycode>
12
- </div>
13
- </div>
14
- </article>
15
- <footer slot="modal-footer" class="modal-footer">
16
- <button type="button" class="btn btn-default" @click='closeCode'>取消</button>
17
- </footer>
18
- </modal>
19
- </div>
20
- </template>
21
-
22
- <script>
23
- export default {
24
- name: 'PaymentCode',
25
- props: {
26
- // 付款方式
27
- payment: {},
28
- // 用户信息
29
- row: {},
30
- type: {
31
- type: String,
32
- default: '燃气收费'
33
- },
34
- // 付款金额
35
- money: {}
36
- },
37
- data () {
38
- return {
39
- ip:null,
40
- // 付款码弹框显示
41
- paymentCodeShow: false,
42
- // 付款码值
43
- paymentCode: null,
44
- // 付款码流程控制
45
- paycoderesolve: null,
46
- // 付款码返回数据
47
- paymentCodeReturnData: {},
48
- // 定时器
49
- timer: null,
50
- // 收费成功id
51
- sellinggasId: null
52
- }
53
- },
54
- created () {
55
- },
56
- ready () {
57
- console.log(this.$login.f)
58
- },
59
- methods: {
60
- // 返回结果为true意味着可以通行
61
- flowPath () {
62
- return new Promise((resolve) => {
63
- this.paycoderesolve = resolve
64
- // 如果是付款码支付则显示界面扫用户付款码收钱
65
- if (this.payment.toString().indexOf('扫码枪支付') !== -1) {
66
- this.paymentCodeShow = true
67
- this.paycodefocus()
68
- } else {
69
- this.paycoderesolve({msg: '不是扫码枪支付', result: true})
70
- }
71
- })
72
- },
73
- // 付款码框获得焦点
74
- paycodefocus () {
75
- this.$nextTick(() => {
76
- this.$els.paycode.focus()
77
- })
78
- },
79
- // 付款码支付流程
80
- async ConfirmCode () {
81
- // 付款码支付之前取本机mac号对应的柜台号进行下单
82
- let equipment = await this.$resetpost('api/af-system/sql/equipmentQuery',
83
- {data: {condition: `f_equipment_type = 'PC' and f_state = '正常' and f_orgid = '${this.$login.f.orgid}' and f_user_operatorid = '${this.$login.f.id}'`}},
84
- {resolveMsg: null, rejectMsg: '获取柜台号失败'})
85
- // console.log('柜台号: ', equipment.data)
86
- if (equipment.data.length != 1) {
87
- this.$showMessage(equipment.data.length ? `获取到多个设备, 请核实! ` : `当前设备没有对应的柜台号, 请核实!}`)
88
- return
89
- }
90
- let data = {
91
- filiale: this.$login.f.dir,
92
- flag: 'microPayRongHaoJsbc',
93
- auth_code: this.paymentCode,
94
- money: this.money,
95
- posid: equipment.data[0].f_mac_outlets,
96
- proinfo: `${this.type}(${this.row.f_userinfo_id})`,
97
- f_userinfo_id: this.row ? this.row.f_userinfo_id : null,
98
- f_user_id: this.row ? this.row.f_user_id : null,
99
- f_userfiles_id: this.row ? this.row.f_userfiles_id : null
100
- }
101
- let res = await this.$resetpost('weixin2/rs/pay/jsApiPay', data, {resolveMsg: null, rejectMsg: '服务器内部出错,'})
102
- this.paymentCodeReturnData = res = res.data
103
- if (res.result_msg == '支付确认成功') {
104
- this.paycoderesolve({msg: '支付完成', result: true})
105
- this.$closeAlert()
106
- } else if (res.result_msg == '支付确认未知') {
107
- // 支付结果未知, 根据商户订单号继续查询
108
- this.$showAlert(`正在查询用户付款状态,请勿进行任何操作,耐心等待,如长时间未响应可手动取消`, 'warning')
109
- let self = this
110
- // 启动定时器之前先关闭定时器,防止之前的定时器未关闭
111
- if (this.timer) {
112
- this.closeTimer()
113
- }
114
- let times = 1
115
- this.timer = setInterval(async () => {
116
- times++
117
- res.filiale = this.$login.f.dir
118
- res.flag = 'microPayRongHaoJsbc'
119
- let res1 = await self.$resetpost('weixin2/rs/pay/microPayOrderStatus', res, {resolveMsg: null, rejectMsg: '付款码支付查询出错,'})
120
- this.paymentCodeReturnData = res1.data
121
- res1 = res1.data
122
- // 支付成功关闭定时器
123
- if (res1.trade_state == '已支付') {
124
- self.paycoderesolve({msg: '支付完成', result: true})
125
- self.closeTimer()
126
- return
127
- }
128
- if (res1.result_msg == '扣款失败') {
129
- this.$showAlert(`支付失败, 请提醒用户重新付款`, 'danger')
130
- this.closeTimer()
131
- this.paymentCodeShow = false
132
- return
133
- }
134
- if (times > 24) {
135
- self.$showAlert(`多次查询未成功,请重新扫描用户付款码`, 'danger')
136
- self.closeTimer()
137
- }
138
- }, 9000)
139
- } else {
140
- this.$showAlert(`${res.result_msg}, 请重新扫描用户付款码`, 'danger')
141
- }
142
- // 清空付款码
143
- this.paymentCode = ''
144
- },
145
- // 付款成功更新收费记录订单号
146
- async updateSellinggas () {
147
- if (this.payment.toString().indexOf('&') !== -1) {
148
- let sqldata = `update t_sellinggas set f_serial_id = '${this.paymentCodeReturnData.f_out_trade_no}' where id = '${this.sellinggasId}'`
149
- await this.$resetpost('api/af-revenue/logic/runSQL', {data: {sql: sqldata}}, {resolveMsg: null, rejectMsg: '更新收费记录订单号失败'})
150
- }
151
- },
152
- // 关闭定时器
153
- closeTimer () {
154
- console.log('关闭定时器')
155
- clearInterval(this.timer)
156
- this.timer = null
157
- },
158
- closeCode () {
159
- this.$showMessage('取消后无法继续收款,确定取消吗?', ['confirm', 'cancel']).then((res) => {
160
- if (res == 'confirm') {
161
- this.paymentCodeShow = false
162
- this.$closeAlert()
163
- this.paycoderesolve({msg: '支付取消', result: false})
164
- this.closeTimer()
165
- }
166
- })
167
- }
168
- }
169
- }
170
- </script>
171
-
172
- <style lang="less">
173
-
174
- </style>
1
+ <template>
2
+ <div id='PaymentCode'>
3
+ <modal :show.sync="paymentCodeShow" backdrop="false">
4
+ <header slot="modal-header" class="modal-header">
5
+ <h4 class="modal-title">请扫描用户付款码</h4>
6
+ </header>
7
+ <article slot="modal-body" class="modal-body">
8
+ <div class="form-horizontal">
9
+ <div class="form-group">
10
+ <input type="text" class="form-control" @keyup.enter="ConfirmCode" @blur="paycodefocus"
11
+ v-model="paymentCode" placeholder="请扫描用户付款码" v-el:paycode>
12
+ </div>
13
+ </div>
14
+ </article>
15
+ <footer slot="modal-footer" class="modal-footer">
16
+ <button type="button" class="btn btn-default" @click='closeCode'>取消</button>
17
+ </footer>
18
+ </modal>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ export default {
24
+ name: 'PaymentCode',
25
+ props: {
26
+ // 付款方式
27
+ payment: {},
28
+ // 用户信息
29
+ row: {},
30
+ type: {
31
+ type: String,
32
+ default: '燃气收费'
33
+ },
34
+ // 付款金额
35
+ money: {}
36
+ },
37
+ data () {
38
+ return {
39
+ ip:null,
40
+ // 付款码弹框显示
41
+ paymentCodeShow: false,
42
+ // 付款码值
43
+ paymentCode: null,
44
+ // 付款码流程控制
45
+ paycoderesolve: null,
46
+ // 付款码返回数据
47
+ paymentCodeReturnData: {},
48
+ // 定时器
49
+ timer: null,
50
+ // 收费成功id
51
+ sellinggasId: null
52
+ }
53
+ },
54
+ created () {
55
+ },
56
+ ready () {
57
+ console.log(this.$login.f)
58
+ },
59
+ methods: {
60
+ // 返回结果为true意味着可以通行
61
+ flowPath () {
62
+ return new Promise((resolve) => {
63
+ this.paycoderesolve = resolve
64
+ // 如果是付款码支付则显示界面扫用户付款码收钱
65
+ if (this.payment.toString().indexOf('扫码枪支付') !== -1) {
66
+ this.paymentCodeShow = true
67
+ this.paycodefocus()
68
+ } else {
69
+ this.paycoderesolve({msg: '不是扫码枪支付', result: true})
70
+ }
71
+ })
72
+ },
73
+ // 付款码框获得焦点
74
+ paycodefocus () {
75
+ this.$nextTick(() => {
76
+ this.$els.paycode.focus()
77
+ })
78
+ },
79
+ // 付款码支付流程
80
+ async ConfirmCode () {
81
+ // 付款码支付之前取本机mac号对应的柜台号进行下单
82
+ let equipment = await this.$resetpost('api/af-system/sql/equipmentQuery',
83
+ {data: {condition: `f_equipment_type = 'PC' and f_state = '正常' and f_orgid = '${this.$login.f.orgid}' and f_user_operatorid = '${this.$login.f.id}'`}},
84
+ {resolveMsg: null, rejectMsg: '获取柜台号失败'})
85
+ // console.log('柜台号: ', equipment.data)
86
+ if (equipment.data.length != 1) {
87
+ this.$showMessage(equipment.data.length ? `获取到多个设备, 请核实! ` : `当前设备没有对应的柜台号, 请核实!}`)
88
+ return
89
+ }
90
+ let data = {
91
+ filiale: this.$login.f.dir,
92
+ flag: 'microPayRongHaoJsbc',
93
+ auth_code: this.paymentCode,
94
+ money: this.money,
95
+ posid: equipment.data[0].f_mac_outlets,
96
+ proinfo: `${this.type}(${this.row.f_userinfo_id})`,
97
+ f_userinfo_id: this.row ? this.row.f_userinfo_id : null,
98
+ f_user_id: this.row ? this.row.f_user_id : null,
99
+ f_userfiles_id: this.row ? this.row.f_userfiles_id : null
100
+ }
101
+ let res = await this.$resetpost('weixin2/rs/pay/jsApiPay', data, {resolveMsg: null, rejectMsg: '服务器内部出错,'})
102
+ this.paymentCodeReturnData = res = res.data
103
+ if (res.result_msg == '支付确认成功') {
104
+ this.paycoderesolve({msg: '支付完成', result: true})
105
+ this.$closeAlert()
106
+ } else if (res.result_msg == '支付确认未知') {
107
+ // 支付结果未知, 根据商户订单号继续查询
108
+ this.$showAlert(`正在查询用户付款状态,请勿进行任何操作,耐心等待,如长时间未响应可手动取消`, 'warning')
109
+ let self = this
110
+ // 启动定时器之前先关闭定时器,防止之前的定时器未关闭
111
+ if (this.timer) {
112
+ this.closeTimer()
113
+ }
114
+ let times = 1
115
+ this.timer = setInterval(async () => {
116
+ times++
117
+ res.filiale = this.$login.f.dir
118
+ res.flag = 'microPayRongHaoJsbc'
119
+ let res1 = await self.$resetpost('weixin2/rs/pay/microPayOrderStatus', res, {resolveMsg: null, rejectMsg: '付款码支付查询出错,'})
120
+ this.paymentCodeReturnData = res1.data
121
+ res1 = res1.data
122
+ // 支付成功关闭定时器
123
+ if (res1.trade_state == '已支付') {
124
+ self.paycoderesolve({msg: '支付完成', result: true})
125
+ self.closeTimer()
126
+ return
127
+ }
128
+ if (res1.result_msg == '扣款失败') {
129
+ this.$showAlert(`支付失败, 请提醒用户重新付款`, 'danger')
130
+ this.closeTimer()
131
+ this.paymentCodeShow = false
132
+ return
133
+ }
134
+ if (times > 24) {
135
+ self.$showAlert(`多次查询未成功,请重新扫描用户付款码`, 'danger')
136
+ self.closeTimer()
137
+ }
138
+ }, 9000)
139
+ } else {
140
+ this.$showAlert(`${res.result_msg}, 请重新扫描用户付款码`, 'danger')
141
+ }
142
+ // 清空付款码
143
+ this.paymentCode = ''
144
+ },
145
+ // 付款成功更新收费记录订单号
146
+ async updateSellinggas () {
147
+ if (this.payment.toString().indexOf('&') !== -1) {
148
+ let sqldata = `update t_sellinggas set f_serial_id = '${this.paymentCodeReturnData.f_out_trade_no}' where id = '${this.sellinggasId}'`
149
+ await this.$resetpost('api/af-revenue/logic/runSQL', {data: {sql: sqldata}}, {resolveMsg: null, rejectMsg: '更新收费记录订单号失败'})
150
+ }
151
+ },
152
+ // 关闭定时器
153
+ closeTimer () {
154
+ console.log('关闭定时器')
155
+ clearInterval(this.timer)
156
+ this.timer = null
157
+ },
158
+ closeCode () {
159
+ this.$showMessage('取消后无法继续收款,确定取消吗?', ['confirm', 'cancel']).then((res) => {
160
+ if (res == 'confirm') {
161
+ this.paymentCodeShow = false
162
+ this.$closeAlert()
163
+ this.paycoderesolve({msg: '支付取消', result: false})
164
+ this.closeTimer()
165
+ }
166
+ })
167
+ }
168
+ }
169
+ }
170
+ </script>
171
+
172
+ <style lang="less">
173
+
174
+ </style>