telephone-clients 4.0.0-1-60 → 4.0.0-1-62

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,637 +1,637 @@
1
- <template>
2
- <div style="height: auto;width: 100%;padding: 10px">
3
- <div partial>
4
- <div class="row app-row">
5
- <div class="col-xs-4">
6
- <img src="../../../assets/购气缴费.png" style="width: 20px;margin-bottom: 5px" alt="">
7
- <label class="font text-left">预购气量:</label>
8
- </div><div class="col-xs-8">
9
- <input type="number" class ="input_search input_ys" placeholder="请输入预存气量..." readonly v-model="model.f_pregas"></div>
10
- </div>
11
- <div class="row app-row">
12
- <div class="col-xs-4">
13
- <img src="../../../assets/购气缴费.png" style="width: 20px;margin-bottom: 5px" alt="">
14
- <label class="font text-left">预购金额:</label>
15
- </div><div class="col-xs-8">
16
- <input type="number" class ="input_search input_ys" placeholder="请输入预购金额..." readonly v-model="model.f_preamount"></div>
17
- </div>
18
- <div class="row app-row" v-if="hasLimit">
19
- <div class="col-xs-4">
20
- <img src="../../../assets/购气缴费.png" style="width: 20px;margin-bottom: 5px" alt="">
21
- <label class="font text-left">购气上限:</label>
22
- </div><div class="col-xs-8">
23
- <input type="number" class ="input_search input_ys" placeholder="请输入购气上限..." readonly v-model="maxgas"></div>
24
- </div>
25
- <div class="row app-row">
26
- <div class="col-xs-4">
27
- <img src="../../../assets/购气缴费.png" style="width: 20px;margin-bottom: 5px" alt="">
28
- <label class="font text-left" style="color: #a51212">本次缴费:</label>
29
- </div><div class="col-xs-8">
30
- <!--<input type="text" class ="input_search input_ys" placeholder="请输入缴费金额..."
31
- @blur="preamount()"
32
- v-model="model.f_totalcost"></div>-->
33
- <input type="number" class ="input_search input_ys" placeholder="请输入缴费金额..." readonly
34
- v-model="model.f_totalcost"></div>
35
- </div>
36
- <div class="row app-row">
37
- <div class="col-xs-4">
38
- <img src="../../../assets/购气缴费.png" style="width: 20px;margin-bottom: 5px" alt="">
39
- <label class="font text-left">付款方式:</label>
40
- </div>
41
- <div class="col-xs-8">
42
- <!--<input type="text" class ="input_search input_ys" placeholder="请选择付款方式..." readonly v-model="model.f_payment"></div>-->
43
- <v-select
44
- :value.sync="model.f_payment"
45
- :options='Paytypes'
46
- placeholder='请选择付款方式...'
47
- close-on-select
48
- :search="false"
49
- value-single
50
- style="margin-bottom: 10px;"
51
- width="78%"
52
- v-model="model.f_payment"
53
- ></v-select>
54
- </div>
55
- </div>
56
- <div class="row app-row">
57
- <div class="col-xs-4">
58
- <img src="../../../assets/购气缴费.png" style="width: 20px;margin-bottom: 5px" alt="">
59
- <label class="font text-left">打印格式:</label>
60
- </div>
61
- <div class="col-xs-8">
62
- <!--<input type="text" class ="input_search input_ys" placeholder="请输入打印格式..." readonly v-model="model.f_print"></div>-->
63
- <v-select
64
- :value.sync="model.f_print"
65
- :options='Printtypes'
66
- placeholder='请输入打印格式...'
67
- close-on-select
68
- value-single
69
- style="margin-bottom: 10px;"
70
- width="78%"
71
- v-model="model.f_print"
72
- ></v-select>
73
- </div>
74
- </div>
75
-
76
- <div class="row app-row" v-if="model.f_payment[0].includes('POS')">
77
- <div class="col-xs-4">
78
- <img src="../../../assets/购气缴费.png" style="width: 20px;margin-bottom: 5px" alt="">
79
- <label class="font text-left">&nbsp;&nbsp;凭证号:</label>
80
- </div><div class="col-xs-8">
81
- <input type="text" class ="input_search input_ys" placeholder="请输入缴费金额..."
82
- v-model="model.f_voucher_number"></div>
83
- </div>
84
-
85
- <div class="row" style="margin-top: 10px;">
86
- <label class="font_normal_body"><b>&nbsp;&nbsp;&nbsp;选择{{matertype2}}&nbsp;&nbsp;&nbsp;</b></label>
87
- </div>
88
- <div class="row" style="text-align: center">
89
- <button class="button_btn" @click="selectmoney(btnmoney)" v-for=" btnmoney in btnmoneys"> {{btnmoney}}{{matertype}}</button>
90
- </div>
91
- <div class="row app-row" style="padding-top: 0.5em;">
92
- <div class="col-sm-12">
93
- <label for="f_comments" class="font_normal_body">&nbsp;&nbsp;&nbsp;备注&nbsp;&nbsp;&nbsp;</label>
94
- <input class="input_search input_ys" style="width:60%" v-model="model.f_comments" rows="1" placeholder="备注">
95
- </div>
96
- </div>
97
- <div style="text-align:right; height: 20%;margin-top: 15px;">
98
- <strong v-show="!isMax" style="font-size: large" >计算公式:{{calculatedetail ? calculatedetail : ' 暂无'}}</strong><br/>
99
- <strong v-show="isMax" style="font-size: large;color: #d9534f" >已经达到购气上限</strong><br/>
100
-
101
- </div>
102
- <div class="row text-center" style="margin-top: 25px;">
103
- <button class="btn btn-lg btn-font btn-color" style="width: 28%;" type="button" @click="confirm()" :disabled="clickConfirm" >确认</button>
104
- <!--<button class="btn btn-lg btn-font btn-color" @click="clean()" style="font-size: 15px;">取消</button>-->
105
- </div>
106
- </div>
107
- </div>
108
- </template>
109
- <script>
110
- /**
111
- *综合业务
112
- *收费组件
113
- */
114
-
115
- import {HttpResetClass} from 'vue-client'
116
- import Vue from 'vue'
117
- import * as Util from '../../../components/Util'
118
-
119
-
120
- export default {
121
- title: '物联网表收费',
122
- data() {
123
- return {
124
- config: {
125
- showupload:false, //默认不显示附件上传组件
126
- hasPrint : false, //默认打票
127
- hasBillManage : false, //默认不启用发票管理
128
- billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
129
- printType: '普通收据', // 收据/电子票/专用发票/国税发票
130
- payment: '现金缴费'
131
- },
132
- isMax:false,
133
- model: {
134
- f_userfiles_id: '', // 表编号 方式一: 针对微信查询
135
- f_userinfo_code: '', // 用户编号 卡表标识
136
- f_filialeids: '', // 用户分公司
137
- f_overdue: 0, // 机表滞纳金减免
138
- f_card_id: '', // 卡表缴费标识 卡号
139
- f_user_id: '', // 卡表缴费标识 用户id
140
- f_serial_id: '', // 流水号
141
- f_pregas: 0, // 预购气量 购气量
142
- f_preamount: 0, // 预购金额 购气金额
143
- f_totalcost: 0, // 本次缴费金额 应交气费
144
- f_collection: 0, // 收款
145
- // f_terminal_num: 'POS设备号', // 这个不能传 终端号/设备号
146
- f_payment: '', // 付款方式
147
- f_bank_name :'',
148
- f_print: '普通收据', // 打印格式
149
- f_unit: 'yuan', // yuan/fen,如果不传按分处理
150
- f_operate_date: '', //操作时间
151
- f_operator: '', // 第三方渠道(微信,支付宝,等)
152
- writeCard_fee: '', // 写卡金额
153
- writeCard_gas: '' // 写卡气量
154
- },
155
- btnmoneys: [50,100,200,300,500,1000], // 默认气量或者金额
156
- // 下拉框值
157
- // Paytypes: this.$appdata.getParam('POS支付方式'),
158
- Paytypes: [],
159
- Printtypes: [{label: "普通收据", value: "普通收据"}],
160
- calculatedetail: '', // 计算公式
161
-
162
- mulPrint: false,
163
- clickConfirm: false, // 控制确认按钮只能点击一次
164
- // 下拉框值
165
- printstyle: this.$appdata.getParam('打印格式'),
166
- privilegeList: [{label: '无优惠', value: '0'}],
167
- matertype: '元',
168
- matertype2: '金额'
169
-
170
- }
171
- },
172
- props: ['row'],
173
- ready() {
174
- //tag
175
- this.Paytypes = this.$appdata.getParam('支付方式')
176
- //tag)
177
- //tag)
178
- this.matertype = this.row.f_meter_type.includes('卡表') ? '方' : '元'
179
- this.matertype2 = this.row.f_meter_type.includes('卡表') ? '气量' : '金额'
180
- this.model.f_userfiles_id = this.row.f_userfiles_id
181
- this.model.f_userinfo_code = this.row.f_userinfo_code
182
- this.model.f_user_id = this.row.f_user_id
183
- this.model.f_card_id = this.row.f_card_id
184
- this.model.cardNumber = this.row.f_card_id
185
- this.model.f_total_gas = this.row.f_total_gas
186
-
187
- // this.model.f_operator= "手机测试"
188
- // this.model.f_operatorid= "42118"
189
- // this.model.f_orgid= "21142"
190
- // this.model.f_orgname= "测试公司(一)"
191
- // this.model.f_depid= "21160"
192
- // this.model.f_depname= "安检部"
193
-
194
- this.model.f_operator = Vue.user.name
195
- this.model.f_operatorid = Vue.user.id
196
- this.model.f_orgid = Vue.user.orgid
197
- this.model.f_orgname = Vue.user.orgs
198
- this.model.f_depid = Vue.user.depids
199
- this.model.f_depname = Vue.user.deps
200
- // this.getcardid()
201
-
202
- },
203
- watch: {
204
- 'model.f_preamount' () {
205
- //tag
206
- if (!this.row.f_meter_type.includes('卡表')) {
207
- this.countprice()
208
- }else {
209
- //tag
210
- }
211
-
212
- },
213
- 'model.f_pregas' () {
214
- //tag
215
- if (this.row.f_meter_type.includes('卡表')) {
216
- this.countprice()
217
- }else {
218
- //tag
219
- }
220
- }
221
- },
222
- methods: {
223
- selectmoney (money) {
224
- //tag
225
- //tag
226
- if (!this.row.f_meter_type.includes('卡表')) {
227
- this.model.f_preamount = money
228
- }else {
229
- this.model.f_pregas = money
230
- }
231
- },
232
- isLimit(gas,fee){
233
- if (this.hasLimit) {
234
- if (this.limitDetial.f_limit_type ==='气量'){
235
- if (gas > this.maxgas){
236
- this.$showAlert(`预购气量大于购气气量上限,上限为:${this.maxgas}`, 'warning', 5000)
237
- return false
238
- }
239
- }else {
240
- if (fee > this.maxgas){
241
- this.$showAlert(`预购气量大于购气金额上限,上限为:${this.maxgas}`, 'warning', 5000)
242
- return false
243
- }
244
- }
245
- return true
246
- }
247
- return true
248
- },
249
- // 化价
250
- async countprice () {
251
- //tag
252
- let parameter = {
253
- model: {
254
- f_userfiles_id: this.row.f_userfiles_id,
255
- f_card_id: this.row.f_card_id,
256
- f_meternumber: this.row.f_meternumber // 表编号
257
- },
258
- value: !this.row.f_meter_type.includes('卡表') ? this.model.f_preamount : this.model.f_pregas, // 传入气量或者金额
259
- isGasValue: !this.row.f_meter_type.includes('卡表') ? 1 : 0 // 0表示气量,1表示金额
260
- }
261
- try {
262
- //tag)
263
- let http = new HttpResetClass()
264
- // let gasParams = await http.load('POST',`/api/af-revenue/logic/commonCal`, {data: parameter}, {})
265
- let gasParams = await http.load('POST',`${this.$androidUtil.getProxyUrl()}/api/af-revenue/logic/commonCal`, {data: parameter}, {})
266
- //tag)
267
- if (gasParams.data) {
268
- // 本次缴费 = 预存金额
269
- this.model.f_totalcost = this.model.f_preamount = gasParams.data.chargenum
270
- // 预存气量
271
- this.model.f_pregas = gasParams.data.oughtamount
272
- }
273
- } catch (e) {
274
- //tag)
275
- this.$showMessage('获取化价信息错误!')
276
- }
277
-
278
- },
279
- myverify () {
280
- let flag = false
281
- if (!this.model.f_totalcost || this.model.f_totalcost < 0 ) {
282
- this.$showMessage('本次缴费金额异常')
283
- return flag
284
- }
285
- if (!this.model.f_pregas || this.model.f_pregas < 0 ) {
286
- this.$showMessage('预购气量异常')
287
- return flag
288
- }
289
- if (!this.model.f_preamount || this.model.f_preamount < 0 ) {
290
- this.$showMessage('预购金额异常')
291
- return flag
292
- }
293
- if (!this.model.f_payment) {
294
- this.$showMessage('请选择支付方式')
295
- return flag
296
- }
297
- flag = true
298
- return flag
299
- },
300
- async confirm() {
301
- //tag
302
- this.$showMessage(`确定对客户${this.row.f_user_name}进行缴费吗?`, ['confirm', 'cancel']).then(async (res) => {
303
- if (res === 'confirm') {
304
- //tag
305
- // 校验
306
- if (this.myverify()) {
307
- this.clickConfirm = true
308
- //tag
309
- // 1.调用收款接口
310
- if (this.model.f_payment == '微信支付') {
311
- //tag
312
- // 去支付界面
313
- let _this = this
314
- let pardate = {
315
- _this:this,
316
- title:'二维码收款',
317
- safe:true
318
- }
319
- _this.$dispatch('gotoson',pardate)
320
- //tag
321
- let parameter = {
322
- money: this.model.f_totalcost
323
- }
324
- _this.$goto('create_qrcode', {row: parameter}, 'self',_this.payback)
325
-
326
- }else if (this.model.f_payment == '现金支付') {
327
- //tag
328
- //tag
329
- this.saveCharges()
330
-
331
- }else {
332
- //tag
333
- this.$showMessage('此功能正在维护中!')
334
- return
335
- }
336
- }
337
-
338
- }
339
- })
340
-
341
-
342
- },
343
- payback (msg) {
344
- if (msg) {
345
- //tag)
346
- this.model.f_serial_id = msg
347
- //tag
348
- this.saveCharges()
349
- }else {
350
- //tag
351
- this.$showMessage('支付失败!')
352
- }
353
- },
354
- async saveCharges() {
355
- //tag
356
- // 操作时间
357
- this.model.f_operate_date = Util.toStandardTimeString()
358
- // 收款等于本次缴费
359
- this.model.f_collection = this.model.f_totalcost
360
- //tag)
361
- let http1 = new HttpResetClass()
362
- let resp = ''
363
- if (this.row.f_meter_type.includes('物联网表')) {
364
- // resp = await http1.load('POST',`/af-telephone/rs/logic/iotPay`, {data: this.model},{
365
- resp = await http1.load('POST',`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/iotPay`, {data: this.model},{
366
- resolveMsg: '物联网收费成功!!',
367
- rejectMsg: '物联网收费出错!!!'
368
- })
369
- }else if (this.row.f_meter_type.includes('机表')) {
370
- // resp = await http1.load('POST',`/af-telephone/rs/logic/machinePay`, {data: this.model},{
371
- resp = await http1.load('POST',`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/machinePay`, {data: this.model},{
372
- resolveMsg: '物联网收费成功!!',
373
- rejectMsg: '物联网收费出错!!!'
374
- })
375
-
376
- }else if (this.row.f_meter_type.includes('卡表')) {
377
- // resp = await http1.load('POST',`/af-telephone/rs/logic/thirdPay`, {data: this.model},{
378
- resp = await http1.load('POST',`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/thirdPay`, {data: this.model},{
379
- resolveMsg: '物联网收费成功!!',
380
- rejectMsg: '物联网收费出错!!!'
381
- })
382
- }
383
-
384
- //tag)
385
- /*{"data":{"id":"175860728"}}*/
386
- if (resp.data) {
387
- this.$showMessage('缴费成功!')
388
- //tag
389
- // 判断是否是手机
390
- //tag)
391
- if (Vue.config.telephone.ApproveConfig.ispos) {
392
- //tag
393
- if (this.row.f_meter_type.includes('卡表')) {
394
- //tag
395
- this.$showMessage('是否现在现在进行写卡?', ['confirm', 'cancel']).then((res) => {
396
- if (res === 'confirm') {
397
- //tag
398
- this.writeCard()
399
- }
400
- })
401
- }else {
402
- // 打印收据
403
- //tag
404
- this.$showMessage('是否打印收据?', ['confirm', 'cancel']).then((res) => {
405
- if (res === 'confirm') {
406
- //tag
407
- this.PrintReceipt()
408
- }
409
- })
410
- }
411
- }else {
412
- this.$showMessage('该设备暂不支持打印小票!')
413
- }
414
-
415
- }else {
416
- this.$showMessage('保存收费记录失败!')
417
- //tag
418
- }
419
-
420
- },
421
- clean() {
422
- this.$info('取消操作')
423
- },
424
- PrintReceipt() {
425
- //tag
426
- // 清空打印内容
427
- let printContent = []
428
- // 抬头
429
- var comName = '梅河口天然气'
430
- printContent.push({type: 3, text: comName, fontsize: 3, isbold: true, align: 'center'})
431
- printContent.push({type: 3, text: '自 助 购 气 凭 证', fontsize: 3, isbold: true, align: 'center'})
432
- printContent.push({type: 3, text: '----------------------------', fontsize: 3, isbold: true, align: 'center'})
433
- // 小票信息
434
- printContent.push({type: 3, text: '用户编号:' + this.model.f_userinfo_code, fontsize: 2, isbold: true, align: 'left'})
435
- // 卡表用户显示卡号
436
- if (this.row.f_meter_type !== '机表' && this.row.f_meter_type !== '物联网表') {
437
- printContent.push({type: 3, text: '用户卡号:' + this.model.f_card_id, fontsize: 2, isbold: true, align: 'left'})
438
- }
439
- printContent.push({type: 3, text: '用户姓名:' + this.row.f_user_name, fontsize: 2, isbold: true, align: 'left'})
440
- printContent.push({type: 3, text: '用户地址:' + this.row.f_address, fontsize: 2, isbold: true, align: 'left'})
441
- // 机表物联网表显示购买金额
442
- // if (this.row.f_meter_type.includes('卡表')) {
443
- printContent.push({type: 3, text: '购 气 量:' + this.model.f_pregas + '方', fontsize: 2, isbold: true, align: 'left'})
444
- // }
445
- printContent.push({type: 3, text: '本次缴费:' + this.model.f_collection + '元', fontsize: 2, isbold: true, align: 'left'})
446
- printContent.push({type: 3, text: '大 写:' + Vue.PosUtil.convertCurrency(this.model.f_collection), fontsize: 2, isbold: true, align: 'left'})
447
- printContent.push({type: 3, text: '购气日期:' + Vue.PosUtil.getNowDate('yyyy-MM-dd'), fontsize: 2, isbold: true, align: 'left'})
448
- printContent.push({type: 3, text: '支付流水号:' + this.model.f_serial_id, fontsize: 2, isbold: true, align: 'left'})
449
- if (this.row.f_meter_type !== '机表' && this.row.f_meter_type !== '物联网表') {
450
- printContent.push({type: 3, text: '写卡结果:' + this.self.isWrited, fontsize: 2, isbold: true, align: 'left'})
451
- }
452
- printContent.push({type: 3, text: '----------------------------', fontsize: 3, isbold: true, align: 'center'})
453
- printContent.push({type: 3, text: '', fontsize: 3, isbold: true, align: 'center'})
454
- // 走纸
455
- printContent.push({type: 4, value: 5, unit: 'pixel'})
456
- // 打印
457
- let print = HostApp.print(JSON.stringify(printContent))
458
- if (print.code === 200) {
459
- this.$showMessage('打印成功!是否返回上一层?', ['confirm', 'cancel']).then((res) => {
460
- if (res === 'confirm') {
461
- //tag
462
- this.$dispatch('confirm')
463
- }
464
- })
465
-
466
- }else {
467
- this.$showMessage('打印失败!请检查POS纸张、电量等,确认无误点击确认再次打印', ['confirm', 'cancel']).then((res) => {
468
- if (res === 'confirm') {
469
- //tag
470
- let print2 = HostApp.print(JSON.stringify(printContent))
471
- if (print2.code === 200) {
472
- this.$showMessage('打印成功!')
473
- }else {
474
- this.$showMessage('打印失败!')
475
- }
476
- }
477
- })
478
- }
479
- },
480
- async getcardid () {
481
- //tag
482
- let http = new HttpResetClass()
483
- let row = await http.load('POST',`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/getCardNumber`, {data: {id: this.row.brand_id}}, {
484
- // this.$resetpost(`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/getCardNumber`, {data: {id: this.row.brand_id}}, {
485
- resolveMsg: '获取卡号成功!!',
486
- rejectMsg: '获取卡号出错!!!'
487
- })
488
- //tag)
489
- let cardId = row.data.cardNumber + ''
490
- console.log('cardId=', cardId)
491
- this.row.f_card_id = this.model.cardNumber = cardId.substring(0, cardId.length - 8) + this.row.f_userinfo_code
492
- console.log('this.row.f_card_id=', this.row.f_card_id)
493
- //tag)
494
- //tag)
495
- },
496
- async writeCard() {
497
- //tag
498
- let params = {
499
- AREA:'JiaoCheng', // 分公司
500
- ulen: 0, // 判断版本
501
- factory: this.row.f_alias,
502
- kmm: '0', // 2019-12-22 查旭说的。给一个0 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
503
- kzt: '0', // 卡状态,0开户卡,1用户卡(0新开户,1补卡)
504
- kh: this.model.cardNumber, // 卡号
505
- yhh: this.row.f_meterid ? this.row.f_meterid : 0, // 用户号,档案中自己输
506
- ql: this.model.writeCard_gas ? this.model.writeCard_gas : this.model.f_pregas, // 预购气量
507
- csql: '0', // 上次购气量,新开户为0
508
- ccsql: '0', // 上上次购气量,新开户为0
509
- cs: this.row.Times ? this.row.Times + 1 : '1', // 求购气次数,先开户为1
510
- ljgql: this.model.f_total_gas, // 当前累计购气量
511
- bkcs: '0', // 新开户卡,为0
512
- ljyql: '0', // 累积用气量,有些表要累加原来用气量,新开户卡,为0
513
- bjql: this.row.f_police_gas, // 报警气量,t_gasbrand表中
514
- czsx: this.row.f_topup_ceil, // 充值上线,t_gasbrand表中
515
- tzed: this.row.f_overdr_lines, // 透支额度,t_gasbrand表中
516
- cssqrq: '0', // 上次售气日期,格式为YYYYMMDD
517
- meterid: this.row.f_meternumber, // 表号
518
- money: this.model.writeCard_fee ? this.model.writeCard_fee : this.model.f_preamount, // 购气金额
519
- dqdm: this.row.f_area_code, // 精益工业地区代码
520
- klx: this.row.f_coding
521
- }
522
- // 获取写卡参数
523
- let data = {
524
- f_card_id: this.row.f_card_id + '',
525
- f_alias: this.row.alias,
526
- f_user_id: this.row.f_user_id,
527
- f_userfiles_id: this.row.f_userfiles_id
528
- }
529
- //tag)
530
- let http = new HttpResetClass()
531
- let cardParams = await http.load('POST',`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/stairCard`, {data: data}, {resolveMsg: null, rejectMsg: '获取写卡参数失败'})
532
- //tag)
533
- // 拼接参数
534
- params = await Object.assign({}, await this.writeCardParams(cardParams), params)
535
- console.log('params=', JSON.stringify(params))
536
- //tag)
537
- let writres = await HostApp.issue(JSON.stringify(params))
538
- console.log('writres=', JSON.stringify(writres))
539
- //tag)
540
- if(writres.code =='200') {
541
- this.$showMessage('写卡成功!打印小票!')
542
- // 写卡成功,调用打票
543
- this.PrintReceipt()
544
- // this.$dispatch('confirm')
545
- }else {
546
- this.$showMessage('写卡失败!!!')
547
- }
548
- },
549
- writeCardParams (cardParams) {
550
- //tag)
551
- let result = {
552
- csql: cardParams.data.sc,
553
- lastmoney: cardParams.data.scje,
554
- ccsql: cardParams.data.ssc,
555
- lastlastmoney: cardParams.data.sscje,
556
- ljgql: cardParams.data.f_pregas,
557
- ljyql: cardParams.data.f_pregasall,
558
- yhh: cardParams.data.f_meterid,
559
- sxrq: cardParams.data.f_perform_date,
560
- totalmoney: cardParams.data.f_collection,
561
- stairversion: cardParams.data.f_stairversion,
562
- pricedate: cardParams.data.pricedate,
563
- pricetype: cardParams.data.pricetype
564
- }
565
-
566
- // 对阶梯进行处理
567
- if (cardParams.data.stairprice.includes(';') && cardParams.data.stairamount.includes(';')) {
568
- let gases = cardParams.data.stairamount.split(';')
569
- let prices = cardParams.data.stairprice.split(';')
570
- if (gases.length >= 2) {
571
- result.stairgas1 = gases[0] !== '' ? gases[0] : 0
572
- result.stairgas2 = gases[1] !== '' ? gases[1] : 0
573
- result.stairgas3 = '99999999'
574
- }
575
- if (prices.length >= 2) {
576
- result.stairprice1 = prices[0] !== '' ? prices[0] : 0
577
- result.stairprice2 = prices[1] !== '' ? prices[1] : 0
578
- result.stairprice3 = prices[2] !== '' ? prices[2] : 0
579
- }
580
- } else {
581
- // 从固定气价的表换金额表的时候,气量随便写,金额用之前的固定单价
582
- result.stairgas1 = '77777777'
583
- result.stairgas2 = '88888888'
584
- result.stairgas3 = '99999999'
585
-
586
- result.stairprice1 = cardParams.data.stairprice
587
- result.stairprice2 = cardParams.data.stairprice
588
- result.stairprice3 = cardParams.data.stairprice
589
- }
590
-
591
- return result
592
- }
593
- },
594
- computed: {
595
-
596
- }
597
- }
598
- </script>
599
-
600
- <style scoped>
601
- .app-row {
602
- background-color: white;
603
- padding: 10px 10px 0 10px;
604
- border-bottom: 1px solid rgba(235, 235, 235, 0.7);
605
- }
606
- .input_ys {
607
- /*border: 1px solid #93B2D3 !important;*/
608
- border: none !important;
609
- width: 220px;
610
- height: 35px;
611
- text-align: center;
612
- }
613
- .button_btn {
614
- width: 27%;
615
- height: 45px;
616
- background-color: #4b93da;
617
- border-radius: 6px;
618
- border: none;
619
- font-family: PingFang;
620
- font-size: 18px;
621
- color: #ffffff;
622
- margin: 3% 2%;
623
- }
624
- .font_normal_body {
625
- font-size: 16px !important;
626
- line-height: 10px;
627
- }
628
- .btn-color{
629
- background-color: #FFFFFF;
630
- border-radius: 10px ;
631
- border: 1px solid #499EDF;
632
- }
633
- .btn-font{
634
- font:600 16px PingFang-SC-Bold;
635
- color: #499EDF;
636
- }
637
- </style>
1
+ <template>
2
+ <div style="height: auto;width: 100%;padding: 10px">
3
+ <div partial>
4
+ <div class="row app-row">
5
+ <div class="col-xs-4">
6
+ <img src="../../../assets/购气缴费.png" style="width: 20px;margin-bottom: 5px" alt="">
7
+ <label class="font text-left">预购气量:</label>
8
+ </div><div class="col-xs-8">
9
+ <input type="number" class ="input_search input_ys" placeholder="请输入预存气量..." readonly v-model="model.f_pregas"></div>
10
+ </div>
11
+ <div class="row app-row">
12
+ <div class="col-xs-4">
13
+ <img src="../../../assets/购气缴费.png" style="width: 20px;margin-bottom: 5px" alt="">
14
+ <label class="font text-left">预购金额:</label>
15
+ </div><div class="col-xs-8">
16
+ <input type="number" class ="input_search input_ys" placeholder="请输入预购金额..." readonly v-model="model.f_preamount"></div>
17
+ </div>
18
+ <div class="row app-row" v-if="hasLimit">
19
+ <div class="col-xs-4">
20
+ <img src="../../../assets/购气缴费.png" style="width: 20px;margin-bottom: 5px" alt="">
21
+ <label class="font text-left">购气上限:</label>
22
+ </div><div class="col-xs-8">
23
+ <input type="number" class ="input_search input_ys" placeholder="请输入购气上限..." readonly v-model="maxgas"></div>
24
+ </div>
25
+ <div class="row app-row">
26
+ <div class="col-xs-4">
27
+ <img src="../../../assets/购气缴费.png" style="width: 20px;margin-bottom: 5px" alt="">
28
+ <label class="font text-left" style="color: #a51212">本次缴费:</label>
29
+ </div><div class="col-xs-8">
30
+ <!--<input type="text" class ="input_search input_ys" placeholder="请输入缴费金额..."
31
+ @blur="preamount()"
32
+ v-model="model.f_totalcost"></div>-->
33
+ <input type="number" class ="input_search input_ys" placeholder="请输入缴费金额..." readonly
34
+ v-model="model.f_totalcost"></div>
35
+ </div>
36
+ <div class="row app-row">
37
+ <div class="col-xs-4">
38
+ <img src="../../../assets/购气缴费.png" style="width: 20px;margin-bottom: 5px" alt="">
39
+ <label class="font text-left">付款方式:</label>
40
+ </div>
41
+ <div class="col-xs-8">
42
+ <!--<input type="text" class ="input_search input_ys" placeholder="请选择付款方式..." readonly v-model="model.f_payment"></div>-->
43
+ <v-select
44
+ :value.sync="model.f_payment"
45
+ :options='Paytypes'
46
+ placeholder='请选择付款方式...'
47
+ close-on-select
48
+ :search="false"
49
+ value-single
50
+ style="margin-bottom: 10px;"
51
+ width="78%"
52
+ v-model="model.f_payment"
53
+ ></v-select>
54
+ </div>
55
+ </div>
56
+ <div class="row app-row">
57
+ <div class="col-xs-4">
58
+ <img src="../../../assets/购气缴费.png" style="width: 20px;margin-bottom: 5px" alt="">
59
+ <label class="font text-left">打印格式:</label>
60
+ </div>
61
+ <div class="col-xs-8">
62
+ <!--<input type="text" class ="input_search input_ys" placeholder="请输入打印格式..." readonly v-model="model.f_print"></div>-->
63
+ <v-select
64
+ :value.sync="model.f_print"
65
+ :options='Printtypes'
66
+ placeholder='请输入打印格式...'
67
+ close-on-select
68
+ value-single
69
+ style="margin-bottom: 10px;"
70
+ width="78%"
71
+ v-model="model.f_print"
72
+ ></v-select>
73
+ </div>
74
+ </div>
75
+
76
+ <div class="row app-row" v-if="model.f_payment[0].includes('POS')">
77
+ <div class="col-xs-4">
78
+ <img src="../../../assets/购气缴费.png" style="width: 20px;margin-bottom: 5px" alt="">
79
+ <label class="font text-left">&nbsp;&nbsp;凭证号:</label>
80
+ </div><div class="col-xs-8">
81
+ <input type="text" class ="input_search input_ys" placeholder="请输入缴费金额..."
82
+ v-model="model.f_voucher_number"></div>
83
+ </div>
84
+
85
+ <div class="row" style="margin-top: 10px;">
86
+ <label class="font_normal_body"><b>&nbsp;&nbsp;&nbsp;选择{{matertype2}}&nbsp;&nbsp;&nbsp;</b></label>
87
+ </div>
88
+ <div class="row" style="text-align: center">
89
+ <button class="button_btn" @click="selectmoney(btnmoney)" v-for=" btnmoney in btnmoneys"> {{btnmoney}}{{matertype}}</button>
90
+ </div>
91
+ <div class="row app-row" style="padding-top: 0.5em;">
92
+ <div class="col-sm-12">
93
+ <label for="f_comments" class="font_normal_body">&nbsp;&nbsp;&nbsp;备注&nbsp;&nbsp;&nbsp;</label>
94
+ <input class="input_search input_ys" style="width:60%" v-model="model.f_comments" rows="1" placeholder="备注">
95
+ </div>
96
+ </div>
97
+ <div style="text-align:right; height: 20%;margin-top: 15px;">
98
+ <strong v-show="!isMax" style="font-size: large" >计算公式:{{calculatedetail ? calculatedetail : ' 暂无'}}</strong><br/>
99
+ <strong v-show="isMax" style="font-size: large;color: #d9534f" >已经达到购气上限</strong><br/>
100
+
101
+ </div>
102
+ <div class="row text-center" style="margin-top: 25px;">
103
+ <button class="btn btn-lg btn-font btn-color" style="width: 28%;" type="button" @click="confirm()" :disabled="clickConfirm" >确认</button>
104
+ <!--<button class="btn btn-lg btn-font btn-color" @click="clean()" style="font-size: 15px;">取消</button>-->
105
+ </div>
106
+ </div>
107
+ </div>
108
+ </template>
109
+ <script>
110
+ /**
111
+ *综合业务
112
+ *收费组件
113
+ */
114
+
115
+ import {HttpResetClass} from 'vue-client'
116
+ import Vue from 'vue'
117
+ import * as Util from '../../../components/Util'
118
+
119
+
120
+ export default {
121
+ title: '物联网表收费',
122
+ data() {
123
+ return {
124
+ config: {
125
+ showupload:false, //默认不显示附件上传组件
126
+ hasPrint : false, //默认打票
127
+ hasBillManage : false, //默认不启用发票管理
128
+ billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
129
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
130
+ payment: '现金缴费'
131
+ },
132
+ isMax:false,
133
+ model: {
134
+ f_userfiles_id: '', // 表编号 方式一: 针对微信查询
135
+ f_userinfo_code: '', // 用户编号 卡表标识
136
+ f_filialeids: '', // 用户分公司
137
+ f_overdue: 0, // 机表滞纳金减免
138
+ f_card_id: '', // 卡表缴费标识 卡号
139
+ f_user_id: '', // 卡表缴费标识 用户id
140
+ f_serial_id: '', // 流水号
141
+ f_pregas: 0, // 预购气量 购气量
142
+ f_preamount: 0, // 预购金额 购气金额
143
+ f_totalcost: 0, // 本次缴费金额 应交气费
144
+ f_collection: 0, // 收款
145
+ // f_terminal_num: 'POS设备号', // 这个不能传 终端号/设备号
146
+ f_payment: '', // 付款方式
147
+ f_bank_name :'',
148
+ f_print: '普通收据', // 打印格式
149
+ f_unit: 'yuan', // yuan/fen,如果不传按分处理
150
+ f_operate_date: '', //操作时间
151
+ f_operator: '', // 第三方渠道(微信,支付宝,等)
152
+ writeCard_fee: '', // 写卡金额
153
+ writeCard_gas: '' // 写卡气量
154
+ },
155
+ btnmoneys: [50,100,200,300,500,1000], // 默认气量或者金额
156
+ // 下拉框值
157
+ // Paytypes: this.$appdata.getParam('POS支付方式'),
158
+ Paytypes: [],
159
+ Printtypes: [{label: "普通收据", value: "普通收据"}],
160
+ calculatedetail: '', // 计算公式
161
+
162
+ mulPrint: false,
163
+ clickConfirm: false, // 控制确认按钮只能点击一次
164
+ // 下拉框值
165
+ printstyle: this.$appdata.getParam('打印格式'),
166
+ privilegeList: [{label: '无优惠', value: '0'}],
167
+ matertype: '元',
168
+ matertype2: '金额'
169
+
170
+ }
171
+ },
172
+ props: ['row'],
173
+ ready() {
174
+ //tag
175
+ this.Paytypes = this.$appdata.getParam('支付方式')
176
+ //tag)
177
+ //tag)
178
+ this.matertype = this.row.f_meter_type.includes('卡表') ? '方' : '元'
179
+ this.matertype2 = this.row.f_meter_type.includes('卡表') ? '气量' : '金额'
180
+ this.model.f_userfiles_id = this.row.f_userfiles_id
181
+ this.model.f_userinfo_code = this.row.f_userinfo_code
182
+ this.model.f_user_id = this.row.f_user_id
183
+ this.model.f_card_id = this.row.f_card_id
184
+ this.model.cardNumber = this.row.f_card_id
185
+ this.model.f_total_gas = this.row.f_total_gas
186
+
187
+ // this.model.f_operator= "手机测试"
188
+ // this.model.f_operatorid= "42118"
189
+ // this.model.f_orgid= "21142"
190
+ // this.model.f_orgname= "测试公司(一)"
191
+ // this.model.f_depid= "21160"
192
+ // this.model.f_depname= "安检部"
193
+
194
+ this.model.f_operator = Vue.user.name
195
+ this.model.f_operatorid = Vue.user.id
196
+ this.model.f_orgid = Vue.user.orgid
197
+ this.model.f_orgname = Vue.user.orgs
198
+ this.model.f_depid = Vue.user.depids
199
+ this.model.f_depname = Vue.user.deps
200
+ // this.getcardid()
201
+
202
+ },
203
+ watch: {
204
+ 'model.f_preamount' () {
205
+ //tag
206
+ if (!this.row.f_meter_type.includes('卡表')) {
207
+ this.countprice()
208
+ }else {
209
+ //tag
210
+ }
211
+
212
+ },
213
+ 'model.f_pregas' () {
214
+ //tag
215
+ if (this.row.f_meter_type.includes('卡表')) {
216
+ this.countprice()
217
+ }else {
218
+ //tag
219
+ }
220
+ }
221
+ },
222
+ methods: {
223
+ selectmoney (money) {
224
+ //tag
225
+ //tag
226
+ if (!this.row.f_meter_type.includes('卡表')) {
227
+ this.model.f_preamount = money
228
+ }else {
229
+ this.model.f_pregas = money
230
+ }
231
+ },
232
+ isLimit(gas,fee){
233
+ if (this.hasLimit) {
234
+ if (this.limitDetial.f_limit_type ==='气量'){
235
+ if (gas > this.maxgas){
236
+ this.$showAlert(`预购气量大于购气气量上限,上限为:${this.maxgas}`, 'warning', 5000)
237
+ return false
238
+ }
239
+ }else {
240
+ if (fee > this.maxgas){
241
+ this.$showAlert(`预购气量大于购气金额上限,上限为:${this.maxgas}`, 'warning', 5000)
242
+ return false
243
+ }
244
+ }
245
+ return true
246
+ }
247
+ return true
248
+ },
249
+ // 化价
250
+ async countprice () {
251
+ //tag
252
+ let parameter = {
253
+ model: {
254
+ f_userfiles_id: this.row.f_userfiles_id,
255
+ f_card_id: this.row.f_card_id,
256
+ f_meternumber: this.row.f_meternumber // 表编号
257
+ },
258
+ value: !this.row.f_meter_type.includes('卡表') ? this.model.f_preamount : this.model.f_pregas, // 传入气量或者金额
259
+ isGasValue: !this.row.f_meter_type.includes('卡表') ? 1 : 0 // 0表示气量,1表示金额
260
+ }
261
+ try {
262
+ //tag)
263
+ let http = new HttpResetClass()
264
+ // let gasParams = await http.load('POST',`/api/af-revenue/logic/commonCal`, {data: parameter}, {})
265
+ let gasParams = await http.load('POST',`${this.$androidUtil.getProxyUrl()}/api/af-revenue/logic/commonCal`, {data: parameter}, {})
266
+ //tag)
267
+ if (gasParams.data) {
268
+ // 本次缴费 = 预存金额
269
+ this.model.f_totalcost = this.model.f_preamount = gasParams.data.chargenum
270
+ // 预存气量
271
+ this.model.f_pregas = gasParams.data.oughtamount
272
+ }
273
+ } catch (e) {
274
+ //tag)
275
+ this.$showMessage('获取化价信息错误!')
276
+ }
277
+
278
+ },
279
+ myverify () {
280
+ let flag = false
281
+ if (!this.model.f_totalcost || this.model.f_totalcost < 0 ) {
282
+ this.$showMessage('本次缴费金额异常')
283
+ return flag
284
+ }
285
+ if (!this.model.f_pregas || this.model.f_pregas < 0 ) {
286
+ this.$showMessage('预购气量异常')
287
+ return flag
288
+ }
289
+ if (!this.model.f_preamount || this.model.f_preamount < 0 ) {
290
+ this.$showMessage('预购金额异常')
291
+ return flag
292
+ }
293
+ if (!this.model.f_payment) {
294
+ this.$showMessage('请选择支付方式')
295
+ return flag
296
+ }
297
+ flag = true
298
+ return flag
299
+ },
300
+ async confirm() {
301
+ //tag
302
+ this.$showMessage(`确定对客户${this.row.f_user_name}进行缴费吗?`, ['confirm', 'cancel']).then(async (res) => {
303
+ if (res === 'confirm') {
304
+ //tag
305
+ // 校验
306
+ if (this.myverify()) {
307
+ this.clickConfirm = true
308
+ //tag
309
+ // 1.调用收款接口
310
+ if (this.model.f_payment == '微信支付') {
311
+ //tag
312
+ // 去支付界面
313
+ let _this = this
314
+ let pardate = {
315
+ _this:this,
316
+ title:'二维码收款',
317
+ safe:true
318
+ }
319
+ _this.$dispatch('gotoson',pardate)
320
+ //tag
321
+ let parameter = {
322
+ money: this.model.f_totalcost
323
+ }
324
+ _this.$goto('create_qrcode', {row: parameter}, 'self',_this.payback)
325
+
326
+ }else if (this.model.f_payment == '现金支付') {
327
+ //tag
328
+ //tag
329
+ this.saveCharges()
330
+
331
+ }else {
332
+ //tag
333
+ this.$showMessage('此功能正在维护中!')
334
+ return
335
+ }
336
+ }
337
+
338
+ }
339
+ })
340
+
341
+
342
+ },
343
+ payback (msg) {
344
+ if (msg) {
345
+ //tag)
346
+ this.model.f_serial_id = msg
347
+ //tag
348
+ this.saveCharges()
349
+ }else {
350
+ //tag
351
+ this.$showMessage('支付失败!')
352
+ }
353
+ },
354
+ async saveCharges() {
355
+ //tag
356
+ // 操作时间
357
+ this.model.f_operate_date = Util.toStandardTimeString()
358
+ // 收款等于本次缴费
359
+ this.model.f_collection = this.model.f_totalcost
360
+ //tag)
361
+ let http1 = new HttpResetClass()
362
+ let resp = ''
363
+ if (this.row.f_meter_type.includes('物联网表')) {
364
+ // resp = await http1.load('POST',`/af-telephone/rs/logic/iotPay`, {data: this.model},{
365
+ resp = await http1.load('POST',`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/iotPay`, {data: this.model},{
366
+ resolveMsg: '物联网收费成功!!',
367
+ rejectMsg: '物联网收费出错!!!'
368
+ })
369
+ }else if (this.row.f_meter_type.includes('机表')) {
370
+ // resp = await http1.load('POST',`/af-telephone/rs/logic/machinePay`, {data: this.model},{
371
+ resp = await http1.load('POST',`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/machinePay`, {data: this.model},{
372
+ resolveMsg: '物联网收费成功!!',
373
+ rejectMsg: '物联网收费出错!!!'
374
+ })
375
+
376
+ }else if (this.row.f_meter_type.includes('卡表')) {
377
+ // resp = await http1.load('POST',`/af-telephone/rs/logic/thirdPay`, {data: this.model},{
378
+ resp = await http1.load('POST',`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/thirdPay`, {data: this.model},{
379
+ resolveMsg: '物联网收费成功!!',
380
+ rejectMsg: '物联网收费出错!!!'
381
+ })
382
+ }
383
+
384
+ //tag)
385
+ /*{"data":{"id":"175860728"}}*/
386
+ if (resp.data) {
387
+ this.$showMessage('缴费成功!')
388
+ //tag
389
+ // 判断是否是手机
390
+ //tag)
391
+ if (Vue.config.telephone.ApproveConfig.ispos) {
392
+ //tag
393
+ if (this.row.f_meter_type.includes('卡表')) {
394
+ //tag
395
+ this.$showMessage('是否现在现在进行写卡?', ['confirm', 'cancel']).then((res) => {
396
+ if (res === 'confirm') {
397
+ //tag
398
+ this.writeCard()
399
+ }
400
+ })
401
+ }else {
402
+ // 打印收据
403
+ //tag
404
+ this.$showMessage('是否打印收据?', ['confirm', 'cancel']).then((res) => {
405
+ if (res === 'confirm') {
406
+ //tag
407
+ this.PrintReceipt()
408
+ }
409
+ })
410
+ }
411
+ }else {
412
+ this.$showMessage('该设备暂不支持打印小票!')
413
+ }
414
+
415
+ }else {
416
+ this.$showMessage('保存收费记录失败!')
417
+ //tag
418
+ }
419
+
420
+ },
421
+ clean() {
422
+ this.$info('取消操作')
423
+ },
424
+ PrintReceipt() {
425
+ //tag
426
+ // 清空打印内容
427
+ let printContent = []
428
+ // 抬头
429
+ var comName = '梅河口天然气'
430
+ printContent.push({type: 3, text: comName, fontsize: 3, isbold: true, align: 'center'})
431
+ printContent.push({type: 3, text: '自 助 购 气 凭 证', fontsize: 3, isbold: true, align: 'center'})
432
+ printContent.push({type: 3, text: '----------------------------', fontsize: 3, isbold: true, align: 'center'})
433
+ // 小票信息
434
+ printContent.push({type: 3, text: '用户编号:' + this.model.f_userinfo_code, fontsize: 2, isbold: true, align: 'left'})
435
+ // 卡表用户显示卡号
436
+ if (this.row.f_meter_type !== '机表' && this.row.f_meter_type !== '物联网表') {
437
+ printContent.push({type: 3, text: '用户卡号:' + this.model.f_card_id, fontsize: 2, isbold: true, align: 'left'})
438
+ }
439
+ printContent.push({type: 3, text: '用户姓名:' + this.row.f_user_name, fontsize: 2, isbold: true, align: 'left'})
440
+ printContent.push({type: 3, text: '用户地址:' + this.row.f_address, fontsize: 2, isbold: true, align: 'left'})
441
+ // 机表物联网表显示购买金额
442
+ // if (this.row.f_meter_type.includes('卡表')) {
443
+ printContent.push({type: 3, text: '购 气 量:' + this.model.f_pregas + '方', fontsize: 2, isbold: true, align: 'left'})
444
+ // }
445
+ printContent.push({type: 3, text: '本次缴费:' + this.model.f_collection + '元', fontsize: 2, isbold: true, align: 'left'})
446
+ printContent.push({type: 3, text: '大 写:' + Vue.PosUtil.convertCurrency(this.model.f_collection), fontsize: 2, isbold: true, align: 'left'})
447
+ printContent.push({type: 3, text: '购气日期:' + Vue.PosUtil.getNowDate('yyyy-MM-dd'), fontsize: 2, isbold: true, align: 'left'})
448
+ printContent.push({type: 3, text: '支付流水号:' + this.model.f_serial_id, fontsize: 2, isbold: true, align: 'left'})
449
+ if (this.row.f_meter_type !== '机表' && this.row.f_meter_type !== '物联网表') {
450
+ printContent.push({type: 3, text: '写卡结果:' + this.self.isWrited, fontsize: 2, isbold: true, align: 'left'})
451
+ }
452
+ printContent.push({type: 3, text: '----------------------------', fontsize: 3, isbold: true, align: 'center'})
453
+ printContent.push({type: 3, text: '', fontsize: 3, isbold: true, align: 'center'})
454
+ // 走纸
455
+ printContent.push({type: 4, value: 5, unit: 'pixel'})
456
+ // 打印
457
+ let print = HostApp.print(JSON.stringify(printContent))
458
+ if (print.code === 200) {
459
+ this.$showMessage('打印成功!是否返回上一层?', ['confirm', 'cancel']).then((res) => {
460
+ if (res === 'confirm') {
461
+ //tag
462
+ this.$dispatch('confirm')
463
+ }
464
+ })
465
+
466
+ }else {
467
+ this.$showMessage('打印失败!请检查POS纸张、电量等,确认无误点击确认再次打印', ['confirm', 'cancel']).then((res) => {
468
+ if (res === 'confirm') {
469
+ //tag
470
+ let print2 = HostApp.print(JSON.stringify(printContent))
471
+ if (print2.code === 200) {
472
+ this.$showMessage('打印成功!')
473
+ }else {
474
+ this.$showMessage('打印失败!')
475
+ }
476
+ }
477
+ })
478
+ }
479
+ },
480
+ async getcardid () {
481
+ //tag
482
+ let http = new HttpResetClass()
483
+ let row = await http.load('POST',`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/getCardNumber`, {data: {id: this.row.brand_id}}, {
484
+ // this.$resetpost(`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/getCardNumber`, {data: {id: this.row.brand_id}}, {
485
+ resolveMsg: '获取卡号成功!!',
486
+ rejectMsg: '获取卡号出错!!!'
487
+ })
488
+ //tag)
489
+ let cardId = row.data.cardNumber + ''
490
+ console.log('cardId=', cardId)
491
+ this.row.f_card_id = this.model.cardNumber = cardId.substring(0, cardId.length - 8) + this.row.f_userinfo_code
492
+ console.log('this.row.f_card_id=', this.row.f_card_id)
493
+ //tag)
494
+ //tag)
495
+ },
496
+ async writeCard() {
497
+ //tag
498
+ let params = {
499
+ AREA:'JiaoCheng', // 分公司
500
+ ulen: 0, // 判断版本
501
+ factory: this.row.f_alias,
502
+ kmm: '0', // 2019-12-22 查旭说的。给一个0 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
503
+ kzt: '0', // 卡状态,0开户卡,1用户卡(0新开户,1补卡)
504
+ kh: this.model.cardNumber, // 卡号
505
+ yhh: this.row.f_meterid ? this.row.f_meterid : 0, // 用户号,档案中自己输
506
+ ql: this.model.writeCard_gas ? this.model.writeCard_gas : this.model.f_pregas, // 预购气量
507
+ csql: '0', // 上次购气量,新开户为0
508
+ ccsql: '0', // 上上次购气量,新开户为0
509
+ cs: this.row.Times ? this.row.Times + 1 : '1', // 求购气次数,先开户为1
510
+ ljgql: this.model.f_total_gas, // 当前累计购气量
511
+ bkcs: '0', // 新开户卡,为0
512
+ ljyql: '0', // 累积用气量,有些表要累加原来用气量,新开户卡,为0
513
+ bjql: this.row.f_police_gas, // 报警气量,t_gasbrand表中
514
+ czsx: this.row.f_topup_ceil, // 充值上线,t_gasbrand表中
515
+ tzed: this.row.f_overdr_lines, // 透支额度,t_gasbrand表中
516
+ cssqrq: '0', // 上次售气日期,格式为YYYYMMDD
517
+ meterid: this.row.f_meternumber, // 表号
518
+ money: this.model.writeCard_fee ? this.model.writeCard_fee : this.model.f_preamount, // 购气金额
519
+ dqdm: this.row.f_area_code, // 精益工业地区代码
520
+ klx: this.row.f_coding
521
+ }
522
+ // 获取写卡参数
523
+ let data = {
524
+ f_card_id: this.row.f_card_id + '',
525
+ f_alias: this.row.alias,
526
+ f_user_id: this.row.f_user_id,
527
+ f_userfiles_id: this.row.f_userfiles_id
528
+ }
529
+ //tag)
530
+ let http = new HttpResetClass()
531
+ let cardParams = await http.load('POST',`${this.$androidUtil.getProxyUrl()}/api/af-revenue/logic/stairCard`, {data: data}, {resolveMsg: null, rejectMsg: '获取写卡参数失败'})
532
+ //tag)
533
+ // 拼接参数
534
+ params = await Object.assign({}, await this.writeCardParams(cardParams), params)
535
+ console.log('params=', JSON.stringify(params))
536
+ //tag)
537
+ let writres = await HostApp.issue(JSON.stringify(params))
538
+ console.log('writres=', JSON.stringify(writres))
539
+ //tag)
540
+ if(writres.code =='200') {
541
+ this.$showMessage('写卡成功!打印小票!')
542
+ // 写卡成功,调用打票
543
+ this.PrintReceipt()
544
+ // this.$dispatch('confirm')
545
+ }else {
546
+ this.$showMessage('写卡失败!!!')
547
+ }
548
+ },
549
+ writeCardParams (cardParams) {
550
+ //tag)
551
+ let result = {
552
+ csql: cardParams.data.sc,
553
+ lastmoney: cardParams.data.scje,
554
+ ccsql: cardParams.data.ssc,
555
+ lastlastmoney: cardParams.data.sscje,
556
+ ljgql: cardParams.data.f_pregas,
557
+ ljyql: cardParams.data.f_pregasall,
558
+ yhh: cardParams.data.f_meterid,
559
+ sxrq: cardParams.data.f_perform_date,
560
+ totalmoney: cardParams.data.f_collection,
561
+ stairversion: cardParams.data.f_stairversion,
562
+ pricedate: cardParams.data.pricedate,
563
+ pricetype: cardParams.data.pricetype
564
+ }
565
+
566
+ // 对阶梯进行处理
567
+ if (cardParams.data.stairprice.includes(';') && cardParams.data.stairamount.includes(';')) {
568
+ let gases = cardParams.data.stairamount.split(';')
569
+ let prices = cardParams.data.stairprice.split(';')
570
+ if (gases.length >= 2) {
571
+ result.stairgas1 = gases[0] !== '' ? gases[0] : 0
572
+ result.stairgas2 = gases[1] !== '' ? gases[1] : 0
573
+ result.stairgas3 = '99999999'
574
+ }
575
+ if (prices.length >= 2) {
576
+ result.stairprice1 = prices[0] !== '' ? prices[0] : 0
577
+ result.stairprice2 = prices[1] !== '' ? prices[1] : 0
578
+ result.stairprice3 = prices[2] !== '' ? prices[2] : 0
579
+ }
580
+ } else {
581
+ // 从固定气价的表换金额表的时候,气量随便写,金额用之前的固定单价
582
+ result.stairgas1 = '77777777'
583
+ result.stairgas2 = '88888888'
584
+ result.stairgas3 = '99999999'
585
+
586
+ result.stairprice1 = cardParams.data.stairprice
587
+ result.stairprice2 = cardParams.data.stairprice
588
+ result.stairprice3 = cardParams.data.stairprice
589
+ }
590
+
591
+ return result
592
+ }
593
+ },
594
+ computed: {
595
+
596
+ }
597
+ }
598
+ </script>
599
+
600
+ <style scoped>
601
+ .app-row {
602
+ background-color: white;
603
+ padding: 10px 10px 0 10px;
604
+ border-bottom: 1px solid rgba(235, 235, 235, 0.7);
605
+ }
606
+ .input_ys {
607
+ /*border: 1px solid #93B2D3 !important;*/
608
+ border: none !important;
609
+ width: 220px;
610
+ height: 35px;
611
+ text-align: center;
612
+ }
613
+ .button_btn {
614
+ width: 27%;
615
+ height: 45px;
616
+ background-color: #4b93da;
617
+ border-radius: 6px;
618
+ border: none;
619
+ font-family: PingFang;
620
+ font-size: 18px;
621
+ color: #ffffff;
622
+ margin: 3% 2%;
623
+ }
624
+ .font_normal_body {
625
+ font-size: 16px !important;
626
+ line-height: 10px;
627
+ }
628
+ .btn-color{
629
+ background-color: #FFFFFF;
630
+ border-radius: 10px ;
631
+ border: 1px solid #499EDF;
632
+ }
633
+ .btn-font{
634
+ font:600 16px PingFang-SC-Bold;
635
+ color: #499EDF;
636
+ }
637
+ </style>