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,727 +1,727 @@
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
- <div class="row app-row" style="padding-top: 0.5em;">
85
- <div class="col-sm-12">
86
- <label class="font_normal_body">自定义{{matertype2}}</label>
87
- <input class="input_search input_ys" style="width:60%" v-model="CustomGas" rows="1">
88
- </div>
89
- </div>
90
- <div class="row app-row" style="padding-top: 0.5em;">
91
- <div class="col-sm-12">
92
- <label for="f_comments" class="font_normal_body">&nbsp;&nbsp;&nbsp;备注&nbsp;&nbsp;&nbsp;</label>
93
- <input class="input_search input_ys" style="width:60%" v-model="model.f_comments" rows="1" placeholder="备注">
94
- </div>
95
- </div>
96
-
97
- <div class="row" style="margin-top: 10px;">
98
- <label class="font_normal_body"><b>&nbsp;&nbsp;&nbsp;选择{{matertype2}}&nbsp;&nbsp;&nbsp;</b></label>
99
- </div>
100
- <div class="row" style="text-align: center">
101
- <button class="button_btn" @click="selectmoney(btnmoney)" v-for=" btnmoney in btnmoneys"> {{btnmoney}}{{matertype}}</button>
102
- </div>
103
- <!--<div style="text-align:right; height: 20%;margin-top: 15px;">
104
- <strong v-show="!isMax" style="font-size: large" >计算公式:{{calculatedetail ? calculatedetail : ' 暂无'}}</strong><br/>
105
- <strong v-show="isMax" style="font-size: large;color: #d9534f" >已经达到购气上限</strong><br/>
106
-
107
- </div>-->
108
- <div class="row text-center" style="margin-top: 10px;">
109
- <button class="btn btn-lg btn-font btn-color" style="width: 30%;" type="button" @click="confirm()" :disabled="clickConfirm" >确认</button>
110
- <!--<button class="btn btn-lg btn-font btn-color" @click="clean()" style="font-size: 15px;">取消</button>-->
111
- </div>
112
- </div>
113
- </div>
114
- <work-busy :is-busy="isworking"></work-busy>
115
- </template>
116
- <script>
117
- /**
118
- *综合业务
119
- *收费组件
120
- */
121
-
122
- import {HttpResetClass} from 'vue-client'
123
- import Vue from 'vue'
124
- import * as Util from '../../../components/Util'
125
-
126
-
127
- export default {
128
- title: '物联网表收费',
129
- data() {
130
- return {
131
- config: {
132
- showupload:false, //默认不显示附件上传组件
133
- hasPrint : false, //默认打票
134
- hasBillManage : false, //默认不启用发票管理
135
- billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
136
- printType: '普通收据', // 收据/电子票/专用发票/国税发票
137
- payment: '现金缴费'
138
- },
139
- isMax:false,
140
- model: {
141
- f_userfiles_id: '', // 表编号 方式一: 针对微信查询
142
- f_userinfo_code: '', // 用户编号 卡表标识
143
- f_filialeids: '', // 用户分公司
144
- f_overdue: 0, // 机表滞纳金减免
145
- f_card_id: '', // 卡表缴费标识 卡号
146
- f_user_id: '', // 卡表缴费标识 用户id
147
- f_serial_id: '', // 流水号
148
- f_pregas: 0, // 预购气量 购气量
149
- f_preamount: 0, // 预购金额 购气金额
150
- f_totalcost: 0, // 本次缴费金额 应交气费
151
- f_collection: 0, // 收款
152
- // f_terminal_num: 'POS设备号', // 这个不能传 终端号/设备号
153
- f_payment: '建行支付', // 付款方式
154
- f_bank_name :'',
155
- f_print: '普通收据', // 打印格式
156
- f_unit: 'yuan', // yuan/fen,如果不传按分处理
157
- f_operate_date: '', //操作时间
158
- f_operator: '', // 第三方渠道(微信,支付宝,等)
159
- writeCard_fee: '', // 写卡金额
160
- writeCard_gas: '' // 写卡气量
161
- },
162
- btnmoneys: [50,100,200,300,500,'自定义 '], // 默认气量或者金额
163
- // 下拉框值
164
- // Paytypes: this.$appdata.getParam('POS支付方式'),
165
- Paytypes: [],
166
- Printtypes: [{label: "普通收据", value: "普通收据"}],
167
- calculatedetail: '', // 计算公式
168
-
169
- mulPrint: false,
170
- clickConfirm: false, // 控制确认按钮只能点击一次
171
- // 下拉框值
172
- printstyle: this.$appdata.getParam('打印格式'),
173
- privilegeList: [{label: '无优惠', value: '0'}],
174
- matertype: '元',
175
- matertype2: '金额',
176
- CustomGas: '',// 自定义金额/气量
177
- isWrited: '未写卡',
178
- sellinggasId: '',
179
- isworking: false,
180
- timer:null,
181
- timer2:null,
182
- writeparams: {}
183
-
184
- }
185
- },
186
- props: ['row'],
187
- ready() {
188
- //tag
189
- this.Paytypes = this.$appdata.getParam('支付方式')
190
- //tag)
191
- //tag)
192
- this.matertype = this.row.f_meter_type.includes('卡表') ? '方' : '元'
193
- this.matertype2 = this.row.f_meter_type.includes('卡表') ? '气量' : '金额'
194
- this.model.f_userfiles_id = this.row.f_userfiles_id
195
- this.model.f_userinfo_code = this.row.f_userinfo_code
196
- this.model.f_filialeids = `('${this.row.f_filialeid}')`
197
- this.model.f_user_id = this.row.f_user_id
198
- this.model.f_card_id = this.row.f_card_id
199
- this.model.f_total_gas = this.row.f_total_gas
200
-
201
- // this.model.f_operator= "手机测试"
202
- // this.model.f_operatorid= "42118"
203
- // this.model.f_orgid= "21142"
204
- // this.model.f_orgname= "测试公司(一)"
205
- // this.model.f_depid= "21160"
206
- // this.model.f_depname= "安检部"
207
-
208
- this.model.f_operator = Vue.user.name
209
- this.model.f_operatorid = Vue.user.id
210
- this.model.f_orgid = Vue.user.orgid
211
- this.model.f_orgname = Vue.user.orgs
212
- this.model.f_depid = Vue.user.depids
213
- this.model.f_depname = Vue.user.deps
214
- /*if (this.row.f_meter_type.includes('卡表')) {
215
- this.getcardid()
216
- }*/
217
-
218
- },
219
- watch: {
220
- 'model.f_preamount' (val) {
221
- if(val) {
222
- //tag
223
- if (!this.row.f_meter_type.includes('卡表')) {
224
- this.countprice()
225
- }else {
226
- //tag
227
- }
228
- }
229
- },
230
- 'model.f_pregas' (val) {
231
- if(val) {
232
- //tag
233
- if (this.row.f_meter_type.includes('卡表')) {
234
- this.countprice()
235
- }else {
236
- //tag
237
- }
238
- }
239
- },
240
- 'CustomGas' (val) {
241
- //tag)
242
- if (val) {
243
- this.btnmoneys.splice(this.btnmoneys.length - 1, 1, val);
244
- }
245
- }
246
- },
247
- methods: {
248
- selectmoney (money) {
249
- //tag
250
- //tag
251
- //tag
252
- if (money != '自定义 ') {
253
- if (!this.row.f_meter_type.includes('卡表')) {
254
- this.model.f_preamount = money
255
- }else {
256
- this.model.f_pregas = money
257
- }
258
- }else {
259
- //tag
260
- this.$showMessage('输入错误!')
261
- }
262
-
263
- },
264
- isLimit(gas,fee){
265
- if (this.hasLimit) {
266
- if (this.limitDetial.f_limit_type ==='气量'){
267
- if (gas > this.maxgas){
268
- this.$showAlert(`预购气量大于购气气量上限,上限为:${this.maxgas}`, 'warning', 5000)
269
- return false
270
- }
271
- }else {
272
- if (fee > this.maxgas){
273
- this.$showAlert(`预购气量大于购气金额上限,上限为:${this.maxgas}`, 'warning', 5000)
274
- return false
275
- }
276
- }
277
- return true
278
- }
279
- return true
280
- },
281
- // 化价
282
- async countprice () {
283
- //tag
284
- let parameter = {
285
- model: {
286
- f_userfiles_id: this.row.f_userfiles_id,
287
- f_card_id: this.row.f_card_id,
288
- f_meternumber: this.row.f_meternumber // 表编号
289
- },
290
- value: !this.row.f_meter_type.includes('卡表') ? this.model.f_preamount : this.model.f_pregas, // 传入气量或者金额
291
- isGasValue: !this.row.f_meter_type.includes('卡表') ? 1 : 0 // 0表示气量,1表示金额
292
- }
293
- try {
294
- //tag)
295
- let http = new HttpResetClass()
296
- // let gasParams = await http.load('POST',`/api/af-revenue/logic/commonCal`, {data: parameter}, {})
297
- let gasParams = await http.load('POST',`${this.$androidUtil.getProxyUrl()}/api/af-revenue/logic/commonCal`, {data: parameter}, {})
298
- //tag)
299
- if (gasParams.data) {
300
- if(this.row.f_meter_type.includes('卡表')) {
301
- // 本次缴费 = 预存金额
302
- this.model.writeCard_fee = this.model.f_totalcost = this.model.f_preamount = gasParams.data.chargenum
303
- this.model.writeCard_gas = this.model.f_pregas
304
- }else {
305
- this.model.writeCard_fee = this.model.f_totalcost = this.model.f_preamount
306
- // 预存气量
307
- this.model.writeCard_gas = this.model.f_pregas = gasParams.data.oughtamount
308
- }
309
-
310
-
311
- }
312
- } catch (e) {
313
- //tag)
314
- this.$showMessage('获取化价信息错误!')
315
- }
316
-
317
- },
318
- myverify () {
319
- let flag = false
320
- if (!this.model.f_totalcost || this.model.f_totalcost < 0 ) {
321
- this.$showMessage('本次缴费金额异常')
322
- return flag
323
- }
324
- if (!this.model.f_pregas || this.model.f_pregas < 0 ) {
325
- this.$showMessage('预购气量异常')
326
- return flag
327
- }
328
- if (!this.model.f_preamount || this.model.f_preamount < 0 ) {
329
- this.$showMessage('预购金额异常')
330
- return flag
331
- }
332
- if (!this.model.f_payment) {
333
- this.$showMessage('请选择支付方式')
334
- return flag
335
- }
336
- flag = true
337
- return flag
338
- },
339
- async confirm() {
340
- //tag
341
- this.$showMessage(`确定对客户${this.row.f_user_name}进行缴费吗?`, ['confirm', 'cancel']).then(async (res) => {
342
- if (res === 'confirm') {
343
- //tag
344
- // 校验
345
- if (this.myverify()) {
346
- this.clickConfirm = true
347
- //tag
348
- // 1.调用收款接口
349
- if (this.model.f_payment == '建行支付') {
350
- //tag
351
- // 去支付界面
352
- let _this = this
353
- let pardate = {
354
- _this:this,
355
- title:'二维码收款',
356
- safe:true
357
- }
358
- _this.$dispatch('gotoson',pardate)
359
- //tag
360
- let parameter = {
361
- model:this.model,
362
- money: this.model.f_totalcost
363
- }
364
- _this.$goto('create_qrcode', {row: parameter}, 'self',_this.payback)
365
-
366
- }else if (this.model.f_payment == '现金支付') {
367
- //tag
368
- //tag
369
- this.saveCharges()
370
-
371
- }else {
372
- //tag
373
- this.$showMessage('此功能正在维护中!')
374
- return
375
- }
376
- }
377
-
378
- }
379
- })
380
-
381
-
382
- },
383
- payback (msg) {
384
- if (msg) {
385
- //tag)
386
- this.model.f_serial_id = msg
387
- //tag
388
- this.saveCharges()
389
- }else {
390
- //tag
391
- this.$showMessage('支付失败!')
392
- }
393
- },
394
- async saveCharges() {
395
- if (Vue.config.telephone.ApproveConfig.ispos) {
396
- if (this.row.f_meter_type.includes('卡表')) {
397
- this.$showMessage('售气成功!是否现在现在进行写卡?', ['confirm', 'cancel']).then((res) => {
398
- if (res === 'confirm') {
399
- this.writeCard()
400
- }else {
401
- this.updatewritecard('未写卡')
402
- }
403
- })
404
- }else {
405
- this.$showMessage('售气成功!是否打印收据?', ['confirm', 'cancel']).then((res) => {
406
- if (res === 'confirm') {
407
- this.PrintReceipt()
408
- }
409
- })
410
- }
411
- }else {
412
- this.$showMessage('该设备暂不支持打印小票!')
413
- }
414
- },
415
- aa() {
416
- //tag
417
- this.isworking = false
418
- clearTimeout(this.timer);
419
- clearTimeout(this.timer2);
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.isWrited, fontsize: 2, isbold: true, align: 'left'})
451
- }
452
- printContent.push({type: 3, text: '操作员:' + Vue.user.name, fontsize: 2, isbold: true, align: 'left'})
453
- printContent.push({type: 3, text: '----------------------------', fontsize: 3, isbold: true, align: 'center'})
454
- printContent.push({type: 3, text: '', fontsize: 3, isbold: true, align: 'center'})
455
- // 走纸
456
- printContent.push({type: 4, value: 5, unit: 'pixel'})
457
- // 打印
458
- let print = HostApp.print(JSON.stringify(printContent))
459
- if (print.code === 200) {
460
- this.$showMessage('打印成功!是否二次打印?', ['confirm', 'cancel']).then((res) => {
461
- if (res === 'confirm') {
462
- //tag
463
- let print2 = HostApp.print(JSON.stringify(printContent))
464
- if (print2.code === 200) {
465
- this.$showMessage('打印成功!是否返回上一层?', ['confirm', 'cancel']).then((res) => {
466
- if (res === 'confirm') {
467
- //tag
468
- this.$dispatch('confirm')
469
- }
470
- })
471
- }else {
472
- this.$showMessage('打印失败!请检查POS纸张、电量等,确认无误点击确认再次打印', ['confirm', 'cancel']).then((res) => {
473
- if (res === 'confirm') {
474
- //tag
475
- let print2 = HostApp.print(JSON.stringify(printContent))
476
- if (print2.code === 200) {
477
- this.$showMessage('打印成功!是否返回上一层?', ['confirm', 'cancel']).then((res) => {
478
- if (res === 'confirm') {
479
- //tag
480
- this.$dispatch('confirm')
481
- }
482
- })
483
- }else {
484
- this.$showMessage('打印失败!')
485
- }
486
- }
487
- })
488
- }
489
- }
490
- })
491
- }else {
492
- this.$showMessage('打印失败!请检查POS纸张、电量等,确认无误点击确认再次打印', ['confirm', 'cancel']).then((res) => {
493
- if (res === 'confirm') {
494
- //tag
495
- let print2 = HostApp.print(JSON.stringify(printContent))
496
- if (print2.code === 200) {
497
- this.$showMessage('打印成功!是否二次打印?', ['confirm', 'cancel']).then((res) => {
498
- if (res === 'confirm') {
499
- //tag
500
- let print2 = HostApp.print(JSON.stringify(printContent))
501
- if (print2.code === 200) {
502
- this.$showMessage('打印成功!是否返回上一层?', ['confirm', 'cancel']).then((res) => {
503
- if (res === 'confirm') {
504
- //tag
505
- this.$dispatch('confirm')
506
- }
507
- })
508
- }else {
509
- this.$showMessage('打印失败!请检查POS纸张、电池电量!')
510
- }
511
- }
512
- })
513
- }else {
514
- this.$showMessage('打印失败!')
515
- }
516
- }
517
- })
518
- }
519
- },
520
- async getcardid () {
521
- //tag
522
- let http = new HttpResetClass()
523
- let row = await http.load('POST',`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/getCardNumber`, {data: {id: this.row.brand_id}}, {
524
- // this.$resetpost(`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/getCardNumber`, {data: {id: this.row.brand_id}}, {
525
- resolveMsg: '获取卡号成功!!',
526
- rejectMsg: '获取卡号出错!!!'
527
- })
528
- //tag)
529
- let cardId = row.data.cardNumber + ''
530
- this.row.f_card_id = this.model.cardNumber = cardId.substring(0, cardId.length - 8) + this.row.f_userinfo_code
531
- //tag)
532
- //tag)
533
- },
534
- async writeCard() {
535
- //tag
536
-
537
- let fengongsi = this.$appdata.getSingleValue('分公司')
538
- if (!fengongsi) {
539
- this.$showMessage('分公司获取失败!')
540
- return
541
- }
542
- let posinfo2 = HostApp.read(fengongsi)
543
- //tag)
544
- let cardNumber = ''
545
- let Times = 1
546
- if(posinfo2.code == 200){
547
- //tag
548
- cardNumber = posinfo2.msg.CardID
549
- Times = posinfo2.msg.Times
550
- // this.$showMessage('写卡次数+++' + (Times + 1))
551
- }else {
552
- this.$showMessage('读卡失败!')
553
- }
554
- if (!cardNumber || cardNumber == '') {
555
- this.$showMessage('卡号异常!写卡失败!')
556
- return
557
- }
558
- let params = {
559
- AREA:'MeiHeKou', // 分公司
560
- ulen: 0, // 判断版本
561
- factory: this.row.f_alias,
562
- kmm: '0', // 2019-12-22 查旭说的。给一个0 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
563
- kzt: '0', // 卡状态,0开户卡,1用户卡(0新开户,1补卡)
564
- kh: cardNumber, // 卡号
565
- yhh: this.row.f_meterid ? this.row.f_meterid : 0, // 用户号,档案中自己输
566
- ql: this.model.writeCard_gas ? this.model.writeCard_gas : this.model.f_pregas, // 预购气量
567
- csql: '0', // 上次购气量,新开户为0
568
- ccsql: '0', // 上上次购气量,新开户为0
569
- cs: Times ? Times + 1 : '1', // 求购气次数,先开户为1
570
- ljgql: this.model.f_total_gas + this.model.f_pregas, // 当前累计购气量
571
- bkcs: '0', // 新开户卡,为0
572
- ljyql: '0', // 累积用气量,有些表要累加原来用气量,新开户卡,为0
573
- bjql: this.row.f_police_gas, // 报警气量,t_gasbrand表中
574
- czsx: this.row.f_topup_ceil, // 充值上线,t_gasbrand表中
575
- tzed: this.row.f_overdr_lines, // 透支额度,t_gasbrand表中
576
- cssqrq: '0', // 上次售气日期,格式为YYYYMMDD
577
- meterid: this.row.f_meternumber, // 表号
578
- money: this.model.writeCard_fee ? this.model.writeCard_fee : this.model.f_preamount, // 购气金额
579
- dqdm: this.row.f_area_code, // 精益工业地区代码
580
- klx: this.row.f_coding
581
- }
582
- // 获取写卡参数
583
- let data = {
584
- f_card_id: this.row.f_card_id + '',
585
- f_alias: this.row.alias,
586
- f_user_id: this.row.f_user_id,
587
- f_userfiles_id: this.row.f_userfiles_id
588
- }
589
- //tag)
590
- let http = new HttpResetClass()
591
- let cardParams = await http.load('POST',`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/stairCard`, {data: data}, {resolveMsg: null, rejectMsg: '获取写卡参数失败'})
592
- //tag)
593
- // 拼接参数
594
- params = await Object.assign({}, await this.writeCardParams(cardParams), params)
595
- //tag)
596
- this.writeparams = params
597
- this.isworking = true
598
- // 写卡定时器
599
- this.timer = setTimeout(this.aa,"5000")
600
- this.timer2 = setTimeout(this.writecard2,"2000")
601
-
602
- },
603
- async writecard2() {
604
- let params = this.writeparams
605
- //tag)
606
- let writres = await HostApp.sell(JSON.stringify(params))
607
- //tag)
608
- this.isworking = false
609
- let msg = '写卡失败'
610
- if(writres.code =='200') {
611
- this.isWrited = '已写卡'
612
- // 写卡成功,修改状态 已写卡 调用打票
613
- await this.updatewritecard('已写卡')
614
- this.$showMessage('写卡成功!是否打印小票?', ['confirm', 'cancel']).then((res) => {
615
- if (res === 'confirm') {
616
- //tag
617
- this.PrintReceipt()
618
- }
619
- })
620
- }else {
621
- this.isWrited = '未写卡'
622
- await this.updatewritecard('未写卡')
623
- this.$showMessage('写卡失败!是否打印小票?', ['confirm', 'cancel']).then((res) => {
624
- if (res === 'confirm') {
625
- //tag
626
- this.PrintReceipt()
627
- }
628
- })
629
- }
630
- },
631
- writeCardParams (cardParams) {
632
- //tag)
633
- let result = {
634
- csql: cardParams.data.sc,
635
- lastmoney: cardParams.data.scje,
636
- ccsql: cardParams.data.ssc,
637
- lastlastmoney: cardParams.data.sscje,
638
- ljgql: cardParams.data.f_pregas,
639
- ljyql: cardParams.data.f_pregasall,
640
- yhh: cardParams.data.f_meterid,
641
- sxrq: cardParams.data.f_perform_date,
642
- totalmoney: cardParams.data.f_collection,
643
- stairversion: cardParams.data.f_stairversion,
644
- pricedate: cardParams.data.pricedate,
645
- pricetype: cardParams.data.pricetype
646
- }
647
-
648
- // 对阶梯进行处理
649
- if (cardParams.data.stairprice.includes(';') && cardParams.data.stairamount.includes(';')) {
650
- let gases = cardParams.data.stairamount.split(';')
651
- let prices = cardParams.data.stairprice.split(';')
652
- if (gases.length >= 2) {
653
- result.stairgas1 = gases[0] !== '' ? gases[0] : 0
654
- result.stairgas2 = gases[1] !== '' ? gases[1] : 0
655
- result.stairgas3 = '99999999'
656
- }
657
- if (prices.length >= 2) {
658
- result.stairprice1 = prices[0] !== '' ? prices[0] : 0
659
- result.stairprice2 = prices[1] !== '' ? prices[1] : 0
660
- result.stairprice3 = prices[2] !== '' ? prices[2] : 0
661
- }
662
- } else {
663
- // 从固定气价的表换金额表的时候,气量随便写,金额用之前的固定单价
664
- result.stairgas1 = '77777777'
665
- result.stairgas2 = '88888888'
666
- result.stairgas3 = '99999999'
667
-
668
- result.stairprice1 = cardParams.data.stairprice
669
- result.stairprice2 = cardParams.data.stairprice
670
- result.stairprice3 = cardParams.data.stairprice
671
- }
672
-
673
- return result
674
- },
675
- updatewritecard(msg) {
676
- //tag)
677
- let http11 = new HttpResetClass()
678
- let sqldata = `update t_sellinggas set f_write_card = '${msg}' where id = '${this.sellinggasId}'`
679
- //tag)
680
- http11.load('POST',`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/runSQL`, {data:{sql:sqldata}}, {resolveMsg: null, rejectMsg: null})
681
-
682
- }
683
- },
684
- computed: {
685
-
686
- }
687
- }
688
- </script>
689
-
690
- <style scoped>
691
- .app-row {
692
- background-color: white;
693
- padding: 10px 10px 0 10px;
694
- border-bottom: 1px solid rgba(235, 235, 235, 0.7);
695
- }
696
- .input_ys {
697
- /*border: 1px solid #93B2D3 !important;*/
698
- border: none !important;
699
- width: 220px;
700
- height: 35px;
701
- text-align: center;
702
- }
703
- .button_btn {
704
- width: 27%;
705
- height: 45px;
706
- background-color: #4b93da;
707
- border-radius: 6px;
708
- border: none;
709
- font-family: PingFang;
710
- font-size: 18px;
711
- color: #ffffff;
712
- margin: 3% 2%;
713
- }
714
- .font_normal_body {
715
- font-size: 16px !important;
716
- line-height: 10px;
717
- }
718
- .btn-color{
719
- background-color: #FFFFFF;
720
- border-radius: 10px ;
721
- border: 1px solid #499EDF;
722
- }
723
- .btn-font{
724
- font:600 16px PingFang-SC-Bold;
725
- color: #499EDF;
726
- }
727
- </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
+ <div class="row app-row" style="padding-top: 0.5em;">
85
+ <div class="col-sm-12">
86
+ <label class="font_normal_body">自定义{{matertype2}}</label>
87
+ <input class="input_search input_ys" style="width:60%" v-model="CustomGas" rows="1">
88
+ </div>
89
+ </div>
90
+ <div class="row app-row" style="padding-top: 0.5em;">
91
+ <div class="col-sm-12">
92
+ <label for="f_comments" class="font_normal_body">&nbsp;&nbsp;&nbsp;备注&nbsp;&nbsp;&nbsp;</label>
93
+ <input class="input_search input_ys" style="width:60%" v-model="model.f_comments" rows="1" placeholder="备注">
94
+ </div>
95
+ </div>
96
+
97
+ <div class="row" style="margin-top: 10px;">
98
+ <label class="font_normal_body"><b>&nbsp;&nbsp;&nbsp;选择{{matertype2}}&nbsp;&nbsp;&nbsp;</b></label>
99
+ </div>
100
+ <div class="row" style="text-align: center">
101
+ <button class="button_btn" @click="selectmoney(btnmoney)" v-for=" btnmoney in btnmoneys"> {{btnmoney}}{{matertype}}</button>
102
+ </div>
103
+ <!--<div style="text-align:right; height: 20%;margin-top: 15px;">
104
+ <strong v-show="!isMax" style="font-size: large" >计算公式:{{calculatedetail ? calculatedetail : ' 暂无'}}</strong><br/>
105
+ <strong v-show="isMax" style="font-size: large;color: #d9534f" >已经达到购气上限</strong><br/>
106
+
107
+ </div>-->
108
+ <div class="row text-center" style="margin-top: 10px;">
109
+ <button class="btn btn-lg btn-font btn-color" style="width: 30%;" type="button" @click="confirm()" :disabled="clickConfirm" >确认</button>
110
+ <!--<button class="btn btn-lg btn-font btn-color" @click="clean()" style="font-size: 15px;">取消</button>-->
111
+ </div>
112
+ </div>
113
+ </div>
114
+ <work-busy :is-busy="isworking"></work-busy>
115
+ </template>
116
+ <script>
117
+ /**
118
+ *综合业务
119
+ *收费组件
120
+ */
121
+
122
+ import {HttpResetClass} from 'vue-client'
123
+ import Vue from 'vue'
124
+ import * as Util from '../../../components/Util'
125
+
126
+
127
+ export default {
128
+ title: '物联网表收费',
129
+ data() {
130
+ return {
131
+ config: {
132
+ showupload:false, //默认不显示附件上传组件
133
+ hasPrint : false, //默认打票
134
+ hasBillManage : false, //默认不启用发票管理
135
+ billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
136
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
137
+ payment: '现金缴费'
138
+ },
139
+ isMax:false,
140
+ model: {
141
+ f_userfiles_id: '', // 表编号 方式一: 针对微信查询
142
+ f_userinfo_code: '', // 用户编号 卡表标识
143
+ f_filialeids: '', // 用户分公司
144
+ f_overdue: 0, // 机表滞纳金减免
145
+ f_card_id: '', // 卡表缴费标识 卡号
146
+ f_user_id: '', // 卡表缴费标识 用户id
147
+ f_serial_id: '', // 流水号
148
+ f_pregas: 0, // 预购气量 购气量
149
+ f_preamount: 0, // 预购金额 购气金额
150
+ f_totalcost: 0, // 本次缴费金额 应交气费
151
+ f_collection: 0, // 收款
152
+ // f_terminal_num: 'POS设备号', // 这个不能传 终端号/设备号
153
+ f_payment: '建行支付', // 付款方式
154
+ f_bank_name :'',
155
+ f_print: '普通收据', // 打印格式
156
+ f_unit: 'yuan', // yuan/fen,如果不传按分处理
157
+ f_operate_date: '', //操作时间
158
+ f_operator: '', // 第三方渠道(微信,支付宝,等)
159
+ writeCard_fee: '', // 写卡金额
160
+ writeCard_gas: '' // 写卡气量
161
+ },
162
+ btnmoneys: [50,100,200,300,500,'自定义 '], // 默认气量或者金额
163
+ // 下拉框值
164
+ // Paytypes: this.$appdata.getParam('POS支付方式'),
165
+ Paytypes: [],
166
+ Printtypes: [{label: "普通收据", value: "普通收据"}],
167
+ calculatedetail: '', // 计算公式
168
+
169
+ mulPrint: false,
170
+ clickConfirm: false, // 控制确认按钮只能点击一次
171
+ // 下拉框值
172
+ printstyle: this.$appdata.getParam('打印格式'),
173
+ privilegeList: [{label: '无优惠', value: '0'}],
174
+ matertype: '元',
175
+ matertype2: '金额',
176
+ CustomGas: '',// 自定义金额/气量
177
+ isWrited: '未写卡',
178
+ sellinggasId: '',
179
+ isworking: false,
180
+ timer:null,
181
+ timer2:null,
182
+ writeparams: {}
183
+
184
+ }
185
+ },
186
+ props: ['row'],
187
+ ready() {
188
+ //tag
189
+ this.Paytypes = this.$appdata.getParam('支付方式')
190
+ //tag)
191
+ //tag)
192
+ this.matertype = this.row.f_meter_type.includes('卡表') ? '方' : '元'
193
+ this.matertype2 = this.row.f_meter_type.includes('卡表') ? '气量' : '金额'
194
+ this.model.f_userfiles_id = this.row.f_userfiles_id
195
+ this.model.f_userinfo_code = this.row.f_userinfo_code
196
+ this.model.f_filialeids = `('${this.row.f_filialeid}')`
197
+ this.model.f_user_id = this.row.f_user_id
198
+ this.model.f_card_id = this.row.f_card_id
199
+ this.model.f_total_gas = this.row.f_total_gas
200
+
201
+ // this.model.f_operator= "手机测试"
202
+ // this.model.f_operatorid= "42118"
203
+ // this.model.f_orgid= "21142"
204
+ // this.model.f_orgname= "测试公司(一)"
205
+ // this.model.f_depid= "21160"
206
+ // this.model.f_depname= "安检部"
207
+
208
+ this.model.f_operator = Vue.user.name
209
+ this.model.f_operatorid = Vue.user.id
210
+ this.model.f_orgid = Vue.user.orgid
211
+ this.model.f_orgname = Vue.user.orgs
212
+ this.model.f_depid = Vue.user.depids
213
+ this.model.f_depname = Vue.user.deps
214
+ /*if (this.row.f_meter_type.includes('卡表')) {
215
+ this.getcardid()
216
+ }*/
217
+
218
+ },
219
+ watch: {
220
+ 'model.f_preamount' (val) {
221
+ if(val) {
222
+ //tag
223
+ if (!this.row.f_meter_type.includes('卡表')) {
224
+ this.countprice()
225
+ }else {
226
+ //tag
227
+ }
228
+ }
229
+ },
230
+ 'model.f_pregas' (val) {
231
+ if(val) {
232
+ //tag
233
+ if (this.row.f_meter_type.includes('卡表')) {
234
+ this.countprice()
235
+ }else {
236
+ //tag
237
+ }
238
+ }
239
+ },
240
+ 'CustomGas' (val) {
241
+ //tag)
242
+ if (val) {
243
+ this.btnmoneys.splice(this.btnmoneys.length - 1, 1, val);
244
+ }
245
+ }
246
+ },
247
+ methods: {
248
+ selectmoney (money) {
249
+ //tag
250
+ //tag
251
+ //tag
252
+ if (money != '自定义 ') {
253
+ if (!this.row.f_meter_type.includes('卡表')) {
254
+ this.model.f_preamount = money
255
+ }else {
256
+ this.model.f_pregas = money
257
+ }
258
+ }else {
259
+ //tag
260
+ this.$showMessage('输入错误!')
261
+ }
262
+
263
+ },
264
+ isLimit(gas,fee){
265
+ if (this.hasLimit) {
266
+ if (this.limitDetial.f_limit_type ==='气量'){
267
+ if (gas > this.maxgas){
268
+ this.$showAlert(`预购气量大于购气气量上限,上限为:${this.maxgas}`, 'warning', 5000)
269
+ return false
270
+ }
271
+ }else {
272
+ if (fee > this.maxgas){
273
+ this.$showAlert(`预购气量大于购气金额上限,上限为:${this.maxgas}`, 'warning', 5000)
274
+ return false
275
+ }
276
+ }
277
+ return true
278
+ }
279
+ return true
280
+ },
281
+ // 化价
282
+ async countprice () {
283
+ //tag
284
+ let parameter = {
285
+ model: {
286
+ f_userfiles_id: this.row.f_userfiles_id,
287
+ f_card_id: this.row.f_card_id,
288
+ f_meternumber: this.row.f_meternumber // 表编号
289
+ },
290
+ value: !this.row.f_meter_type.includes('卡表') ? this.model.f_preamount : this.model.f_pregas, // 传入气量或者金额
291
+ isGasValue: !this.row.f_meter_type.includes('卡表') ? 1 : 0 // 0表示气量,1表示金额
292
+ }
293
+ try {
294
+ //tag)
295
+ let http = new HttpResetClass()
296
+ // let gasParams = await http.load('POST',`/api/af-revenue/logic/commonCal`, {data: parameter}, {})
297
+ let gasParams = await http.load('POST',`${this.$androidUtil.getProxyUrl()}/api/af-revenue/logic/commonCal`, {data: parameter}, {})
298
+ //tag)
299
+ if (gasParams.data) {
300
+ if(this.row.f_meter_type.includes('卡表')) {
301
+ // 本次缴费 = 预存金额
302
+ this.model.writeCard_fee = this.model.f_totalcost = this.model.f_preamount = gasParams.data.chargenum
303
+ this.model.writeCard_gas = this.model.f_pregas
304
+ }else {
305
+ this.model.writeCard_fee = this.model.f_totalcost = this.model.f_preamount
306
+ // 预存气量
307
+ this.model.writeCard_gas = this.model.f_pregas = gasParams.data.oughtamount
308
+ }
309
+
310
+
311
+ }
312
+ } catch (e) {
313
+ //tag)
314
+ this.$showMessage('获取化价信息错误!')
315
+ }
316
+
317
+ },
318
+ myverify () {
319
+ let flag = false
320
+ if (!this.model.f_totalcost || this.model.f_totalcost < 0 ) {
321
+ this.$showMessage('本次缴费金额异常')
322
+ return flag
323
+ }
324
+ if (!this.model.f_pregas || this.model.f_pregas < 0 ) {
325
+ this.$showMessage('预购气量异常')
326
+ return flag
327
+ }
328
+ if (!this.model.f_preamount || this.model.f_preamount < 0 ) {
329
+ this.$showMessage('预购金额异常')
330
+ return flag
331
+ }
332
+ if (!this.model.f_payment) {
333
+ this.$showMessage('请选择支付方式')
334
+ return flag
335
+ }
336
+ flag = true
337
+ return flag
338
+ },
339
+ async confirm() {
340
+ //tag
341
+ this.$showMessage(`确定对客户${this.row.f_user_name}进行缴费吗?`, ['confirm', 'cancel']).then(async (res) => {
342
+ if (res === 'confirm') {
343
+ //tag
344
+ // 校验
345
+ if (this.myverify()) {
346
+ this.clickConfirm = true
347
+ //tag
348
+ // 1.调用收款接口
349
+ if (this.model.f_payment == '建行支付') {
350
+ //tag
351
+ // 去支付界面
352
+ let _this = this
353
+ let pardate = {
354
+ _this:this,
355
+ title:'二维码收款',
356
+ safe:true
357
+ }
358
+ _this.$dispatch('gotoson',pardate)
359
+ //tag
360
+ let parameter = {
361
+ model:this.model,
362
+ money: this.model.f_totalcost
363
+ }
364
+ _this.$goto('create_qrcode', {row: parameter}, 'self',_this.payback)
365
+
366
+ }else if (this.model.f_payment == '现金支付') {
367
+ //tag
368
+ //tag
369
+ this.saveCharges()
370
+
371
+ }else {
372
+ //tag
373
+ this.$showMessage('此功能正在维护中!')
374
+ return
375
+ }
376
+ }
377
+
378
+ }
379
+ })
380
+
381
+
382
+ },
383
+ payback (msg) {
384
+ if (msg) {
385
+ //tag)
386
+ this.model.f_serial_id = msg
387
+ //tag
388
+ this.saveCharges()
389
+ }else {
390
+ //tag
391
+ this.$showMessage('支付失败!')
392
+ }
393
+ },
394
+ async saveCharges() {
395
+ if (Vue.config.telephone.ApproveConfig.ispos) {
396
+ if (this.row.f_meter_type.includes('卡表')) {
397
+ this.$showMessage('售气成功!是否现在现在进行写卡?', ['confirm', 'cancel']).then((res) => {
398
+ if (res === 'confirm') {
399
+ this.writeCard()
400
+ }else {
401
+ this.updatewritecard('未写卡')
402
+ }
403
+ })
404
+ }else {
405
+ this.$showMessage('售气成功!是否打印收据?', ['confirm', 'cancel']).then((res) => {
406
+ if (res === 'confirm') {
407
+ this.PrintReceipt()
408
+ }
409
+ })
410
+ }
411
+ }else {
412
+ this.$showMessage('该设备暂不支持打印小票!')
413
+ }
414
+ },
415
+ aa() {
416
+ //tag
417
+ this.isworking = false
418
+ clearTimeout(this.timer);
419
+ clearTimeout(this.timer2);
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.isWrited, fontsize: 2, isbold: true, align: 'left'})
451
+ }
452
+ printContent.push({type: 3, text: '操作员:' + Vue.user.name, fontsize: 2, isbold: true, align: 'left'})
453
+ printContent.push({type: 3, text: '----------------------------', fontsize: 3, isbold: true, align: 'center'})
454
+ printContent.push({type: 3, text: '', fontsize: 3, isbold: true, align: 'center'})
455
+ // 走纸
456
+ printContent.push({type: 4, value: 5, unit: 'pixel'})
457
+ // 打印
458
+ let print = HostApp.print(JSON.stringify(printContent))
459
+ if (print.code === 200) {
460
+ this.$showMessage('打印成功!是否二次打印?', ['confirm', 'cancel']).then((res) => {
461
+ if (res === 'confirm') {
462
+ //tag
463
+ let print2 = HostApp.print(JSON.stringify(printContent))
464
+ if (print2.code === 200) {
465
+ this.$showMessage('打印成功!是否返回上一层?', ['confirm', 'cancel']).then((res) => {
466
+ if (res === 'confirm') {
467
+ //tag
468
+ this.$dispatch('confirm')
469
+ }
470
+ })
471
+ }else {
472
+ this.$showMessage('打印失败!请检查POS纸张、电量等,确认无误点击确认再次打印', ['confirm', 'cancel']).then((res) => {
473
+ if (res === 'confirm') {
474
+ //tag
475
+ let print2 = HostApp.print(JSON.stringify(printContent))
476
+ if (print2.code === 200) {
477
+ this.$showMessage('打印成功!是否返回上一层?', ['confirm', 'cancel']).then((res) => {
478
+ if (res === 'confirm') {
479
+ //tag
480
+ this.$dispatch('confirm')
481
+ }
482
+ })
483
+ }else {
484
+ this.$showMessage('打印失败!')
485
+ }
486
+ }
487
+ })
488
+ }
489
+ }
490
+ })
491
+ }else {
492
+ this.$showMessage('打印失败!请检查POS纸张、电量等,确认无误点击确认再次打印', ['confirm', 'cancel']).then((res) => {
493
+ if (res === 'confirm') {
494
+ //tag
495
+ let print2 = HostApp.print(JSON.stringify(printContent))
496
+ if (print2.code === 200) {
497
+ this.$showMessage('打印成功!是否二次打印?', ['confirm', 'cancel']).then((res) => {
498
+ if (res === 'confirm') {
499
+ //tag
500
+ let print2 = HostApp.print(JSON.stringify(printContent))
501
+ if (print2.code === 200) {
502
+ this.$showMessage('打印成功!是否返回上一层?', ['confirm', 'cancel']).then((res) => {
503
+ if (res === 'confirm') {
504
+ //tag
505
+ this.$dispatch('confirm')
506
+ }
507
+ })
508
+ }else {
509
+ this.$showMessage('打印失败!请检查POS纸张、电池电量!')
510
+ }
511
+ }
512
+ })
513
+ }else {
514
+ this.$showMessage('打印失败!')
515
+ }
516
+ }
517
+ })
518
+ }
519
+ },
520
+ async getcardid () {
521
+ //tag
522
+ let http = new HttpResetClass()
523
+ let row = await http.load('POST',`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/getCardNumber`, {data: {id: this.row.brand_id}}, {
524
+ // this.$resetpost(`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/getCardNumber`, {data: {id: this.row.brand_id}}, {
525
+ resolveMsg: '获取卡号成功!!',
526
+ rejectMsg: '获取卡号出错!!!'
527
+ })
528
+ //tag)
529
+ let cardId = row.data.cardNumber + ''
530
+ this.row.f_card_id = this.model.cardNumber = cardId.substring(0, cardId.length - 8) + this.row.f_userinfo_code
531
+ //tag)
532
+ //tag)
533
+ },
534
+ async writeCard() {
535
+ //tag
536
+
537
+ let fengongsi = this.$appdata.getSingleValue('分公司')
538
+ if (!fengongsi) {
539
+ this.$showMessage('分公司获取失败!')
540
+ return
541
+ }
542
+ let posinfo2 = HostApp.read(fengongsi)
543
+ //tag)
544
+ let cardNumber = ''
545
+ let Times = 1
546
+ if(posinfo2.code == 200){
547
+ //tag
548
+ cardNumber = posinfo2.msg.CardID
549
+ Times = posinfo2.msg.Times
550
+ // this.$showMessage('写卡次数+++' + (Times + 1))
551
+ }else {
552
+ this.$showMessage('读卡失败!')
553
+ }
554
+ if (!cardNumber || cardNumber == '') {
555
+ this.$showMessage('卡号异常!写卡失败!')
556
+ return
557
+ }
558
+ let params = {
559
+ AREA:'MeiHeKou', // 分公司
560
+ ulen: 0, // 判断版本
561
+ factory: this.row.f_alias,
562
+ kmm: '0', // 2019-12-22 查旭说的。给一个0 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
563
+ kzt: '0', // 卡状态,0开户卡,1用户卡(0新开户,1补卡)
564
+ kh: cardNumber, // 卡号
565
+ yhh: this.row.f_meterid ? this.row.f_meterid : 0, // 用户号,档案中自己输
566
+ ql: this.model.writeCard_gas ? this.model.writeCard_gas : this.model.f_pregas, // 预购气量
567
+ csql: '0', // 上次购气量,新开户为0
568
+ ccsql: '0', // 上上次购气量,新开户为0
569
+ cs: Times ? Times + 1 : '1', // 求购气次数,先开户为1
570
+ ljgql: this.model.f_total_gas + this.model.f_pregas, // 当前累计购气量
571
+ bkcs: '0', // 新开户卡,为0
572
+ ljyql: '0', // 累积用气量,有些表要累加原来用气量,新开户卡,为0
573
+ bjql: this.row.f_police_gas, // 报警气量,t_gasbrand表中
574
+ czsx: this.row.f_topup_ceil, // 充值上线,t_gasbrand表中
575
+ tzed: this.row.f_overdr_lines, // 透支额度,t_gasbrand表中
576
+ cssqrq: '0', // 上次售气日期,格式为YYYYMMDD
577
+ meterid: this.row.f_meternumber, // 表号
578
+ money: this.model.writeCard_fee ? this.model.writeCard_fee : this.model.f_preamount, // 购气金额
579
+ dqdm: this.row.f_area_code, // 精益工业地区代码
580
+ klx: this.row.f_coding
581
+ }
582
+ // 获取写卡参数
583
+ let data = {
584
+ f_card_id: this.row.f_card_id + '',
585
+ f_alias: this.row.alias,
586
+ f_user_id: this.row.f_user_id,
587
+ f_userfiles_id: this.row.f_userfiles_id
588
+ }
589
+ //tag)
590
+ let http = new HttpResetClass()
591
+ let cardParams = await http.load('POST',`${this.$androidUtil.getProxyUrl()}/api/af-revenue/logic/stairCard`, {data: data}, {resolveMsg: null, rejectMsg: '获取写卡参数失败'})
592
+ //tag)
593
+ // 拼接参数
594
+ params = await Object.assign({}, await this.writeCardParams(cardParams), params)
595
+ //tag)
596
+ this.writeparams = params
597
+ this.isworking = true
598
+ // 写卡定时器
599
+ this.timer = setTimeout(this.aa,"5000")
600
+ this.timer2 = setTimeout(this.writecard2,"2000")
601
+
602
+ },
603
+ async writecard2() {
604
+ let params = this.writeparams
605
+ //tag)
606
+ let writres = await HostApp.sell(JSON.stringify(params))
607
+ //tag)
608
+ this.isworking = false
609
+ let msg = '写卡失败'
610
+ if(writres.code =='200') {
611
+ this.isWrited = '已写卡'
612
+ // 写卡成功,修改状态 已写卡 调用打票
613
+ await this.updatewritecard('已写卡')
614
+ this.$showMessage('写卡成功!是否打印小票?', ['confirm', 'cancel']).then((res) => {
615
+ if (res === 'confirm') {
616
+ //tag
617
+ this.PrintReceipt()
618
+ }
619
+ })
620
+ }else {
621
+ this.isWrited = '未写卡'
622
+ await this.updatewritecard('未写卡')
623
+ this.$showMessage('写卡失败!是否打印小票?', ['confirm', 'cancel']).then((res) => {
624
+ if (res === 'confirm') {
625
+ //tag
626
+ this.PrintReceipt()
627
+ }
628
+ })
629
+ }
630
+ },
631
+ writeCardParams (cardParams) {
632
+ //tag)
633
+ let result = {
634
+ csql: cardParams.data.sc,
635
+ lastmoney: cardParams.data.scje,
636
+ ccsql: cardParams.data.ssc,
637
+ lastlastmoney: cardParams.data.sscje,
638
+ ljgql: cardParams.data.f_pregas,
639
+ ljyql: cardParams.data.f_pregasall,
640
+ yhh: cardParams.data.f_meterid,
641
+ sxrq: cardParams.data.f_perform_date,
642
+ totalmoney: cardParams.data.f_collection,
643
+ stairversion: cardParams.data.f_stairversion,
644
+ pricedate: cardParams.data.pricedate,
645
+ pricetype: cardParams.data.pricetype
646
+ }
647
+
648
+ // 对阶梯进行处理
649
+ if (cardParams.data.stairprice.includes(';') && cardParams.data.stairamount.includes(';')) {
650
+ let gases = cardParams.data.stairamount.split(';')
651
+ let prices = cardParams.data.stairprice.split(';')
652
+ if (gases.length >= 2) {
653
+ result.stairgas1 = gases[0] !== '' ? gases[0] : 0
654
+ result.stairgas2 = gases[1] !== '' ? gases[1] : 0
655
+ result.stairgas3 = '99999999'
656
+ }
657
+ if (prices.length >= 2) {
658
+ result.stairprice1 = prices[0] !== '' ? prices[0] : 0
659
+ result.stairprice2 = prices[1] !== '' ? prices[1] : 0
660
+ result.stairprice3 = prices[2] !== '' ? prices[2] : 0
661
+ }
662
+ } else {
663
+ // 从固定气价的表换金额表的时候,气量随便写,金额用之前的固定单价
664
+ result.stairgas1 = '77777777'
665
+ result.stairgas2 = '88888888'
666
+ result.stairgas3 = '99999999'
667
+
668
+ result.stairprice1 = cardParams.data.stairprice
669
+ result.stairprice2 = cardParams.data.stairprice
670
+ result.stairprice3 = cardParams.data.stairprice
671
+ }
672
+
673
+ return result
674
+ },
675
+ updatewritecard(msg) {
676
+ //tag)
677
+ let http11 = new HttpResetClass()
678
+ let sqldata = `update t_sellinggas set f_write_card = '${msg}' where id = '${this.sellinggasId}'`
679
+ //tag)
680
+ http11.load('POST',`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/runSQL`, {data:{sql:sqldata}}, {resolveMsg: null, rejectMsg: null})
681
+
682
+ }
683
+ },
684
+ computed: {
685
+
686
+ }
687
+ }
688
+ </script>
689
+
690
+ <style scoped>
691
+ .app-row {
692
+ background-color: white;
693
+ padding: 10px 10px 0 10px;
694
+ border-bottom: 1px solid rgba(235, 235, 235, 0.7);
695
+ }
696
+ .input_ys {
697
+ /*border: 1px solid #93B2D3 !important;*/
698
+ border: none !important;
699
+ width: 220px;
700
+ height: 35px;
701
+ text-align: center;
702
+ }
703
+ .button_btn {
704
+ width: 27%;
705
+ height: 45px;
706
+ background-color: #4b93da;
707
+ border-radius: 6px;
708
+ border: none;
709
+ font-family: PingFang;
710
+ font-size: 18px;
711
+ color: #ffffff;
712
+ margin: 3% 2%;
713
+ }
714
+ .font_normal_body {
715
+ font-size: 16px !important;
716
+ line-height: 10px;
717
+ }
718
+ .btn-color{
719
+ background-color: #FFFFFF;
720
+ border-radius: 10px ;
721
+ border: 1px solid #499EDF;
722
+ }
723
+ .btn-font{
724
+ font:600 16px PingFang-SC-Bold;
725
+ color: #499EDF;
726
+ }
727
+ </style>