sale-client 3.6.19 → 3.6.21
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.
- package/build/dev-server.js +85 -85
- package/package.json +1 -1
- package/src/components/charge/saletab.vue +68 -68
- package/src/components/common/userinfo_detail/UserInfoDetailManageNew.vue +203 -203
- package/src/components/common/userinfo_detail/iot_detail/QueryInstruct.vue +333 -304
- package/src/components/revenue/machineHandManage/machineHand.vue +2068 -2068
- package/src/filiale/haile/FilesManage/MeterinfoTest.vue +986 -0
- package/src/filiale/haile/FilesManage/UserEssentialInfoTest.vue +336 -0
- package/src/filiale/haile/MachineMeterCenter.vue +20 -3
- package/src/filiale/haile/sale.js +5 -0
- package/src/plugins/CardService.js +2110 -2068
|
@@ -1,2068 +1,2110 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
import co from 'co'
|
|
3
|
-
|
|
4
|
-
let CardService = {
|
|
5
|
-
install (Vue, options) {
|
|
6
|
-
// 给vue增添对话框显示方法
|
|
7
|
-
Vue.CardService = Vue.prototype.$CardService = CardService
|
|
8
|
-
},
|
|
9
|
-
// 判断是否插卡
|
|
10
|
-
hasCard () {
|
|
11
|
-
let has = hasCardGen()
|
|
12
|
-
return co(has)
|
|
13
|
-
},
|
|
14
|
-
// 读卡
|
|
15
|
-
readCard () {
|
|
16
|
-
let read = readCard()
|
|
17
|
-
return co(read)
|
|
18
|
-
},
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
let
|
|
523
|
-
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
//
|
|
550
|
-
//
|
|
551
|
-
// getCardNumber.data
|
|
552
|
-
//
|
|
553
|
-
//
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
} else
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
//
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
//
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
}
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
//
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
//
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
|
-
let
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
param.
|
|
1420
|
-
param.cs = 1
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
//
|
|
1446
|
-
//
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
//
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
console.log('
|
|
1707
|
-
cardparam = JSON.stringify(
|
|
1708
|
-
cardpost = '
|
|
1709
|
-
cardRes = await Vue.resetpost('http://127.0.0.1:8003/
|
|
1710
|
-
} else {
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
}
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
//
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
console.log('
|
|
1903
|
-
cardparam = JSON.stringify(
|
|
1904
|
-
cardpost = '
|
|
1905
|
-
cardRes = await Vue.resetpost('http://127.0.0.1:8003/
|
|
1906
|
-
} else {
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
}
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
}
|
|
2068
|
-
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import co from 'co'
|
|
3
|
+
|
|
4
|
+
let CardService = {
|
|
5
|
+
install (Vue, options) {
|
|
6
|
+
// 给vue增添对话框显示方法
|
|
7
|
+
Vue.CardService = Vue.prototype.$CardService = CardService
|
|
8
|
+
},
|
|
9
|
+
// 判断是否插卡
|
|
10
|
+
hasCard () {
|
|
11
|
+
let has = hasCardGen()
|
|
12
|
+
return co(has)
|
|
13
|
+
},
|
|
14
|
+
// 读卡
|
|
15
|
+
readCard () {
|
|
16
|
+
let read = readCard()
|
|
17
|
+
return co(read)
|
|
18
|
+
},
|
|
19
|
+
// 指令写卡
|
|
20
|
+
// 目前支持 承德海力物联网表
|
|
21
|
+
instructWriteCard (row) {
|
|
22
|
+
let read = instructWriteCardGen(row)
|
|
23
|
+
return co(read)
|
|
24
|
+
},
|
|
25
|
+
// 开户发卡
|
|
26
|
+
initCard (model, row, allot) {
|
|
27
|
+
// let init = initCardGen(model, row, allot ? this.getallotdata(allot, row, '发卡售气') : null)
|
|
28
|
+
// return co(init)
|
|
29
|
+
|
|
30
|
+
let f_serial_number = ''
|
|
31
|
+
let f_price = ''
|
|
32
|
+
let inputprice = '0'
|
|
33
|
+
if (model.f_serial_number) {
|
|
34
|
+
f_serial_number = model.f_serial_number
|
|
35
|
+
}
|
|
36
|
+
if (model.f_price && (model.f_price - 0) > 0) {
|
|
37
|
+
f_price = model.f_price
|
|
38
|
+
inputprice = '1'
|
|
39
|
+
}
|
|
40
|
+
let f_privilege_gas = 0
|
|
41
|
+
if (model.f_privilege_gas) {
|
|
42
|
+
f_privilege_gas = model.f_privilege_gas
|
|
43
|
+
}
|
|
44
|
+
let param = {
|
|
45
|
+
garbage_number: model.garbage_number,
|
|
46
|
+
garbage_money: model.garbage_money,
|
|
47
|
+
f_serial_id: model.f_serial_id,
|
|
48
|
+
f_userinfo_id: row.f_userinfo_id,
|
|
49
|
+
f_serial_number: f_serial_number,
|
|
50
|
+
f_user_id: row.f_user_id,
|
|
51
|
+
f_price: f_price,
|
|
52
|
+
inputprice: inputprice,
|
|
53
|
+
f_userfiles_id: row.f_userfiles_id,
|
|
54
|
+
f_pregas: model.f_pregas,
|
|
55
|
+
f_preamount: model.f_preamount,
|
|
56
|
+
f_balance: row.f_balance,
|
|
57
|
+
f_meter_type: row.f_meter_type,
|
|
58
|
+
f_calculation: row.f_calculation,
|
|
59
|
+
f_collection_type: row.f_collection_type,
|
|
60
|
+
f_total_gas: (row.f_total_gas - 0) + (model.f_pregas - 0),
|
|
61
|
+
f_write_money: model.xiekamoney,
|
|
62
|
+
f_write_totalgas: (row.f_write_totalgas - 0) + (model.f_pregas - 0),
|
|
63
|
+
f_write_totalfee: (row.f_write_totalfee - 0) + (model.xiekamoney - 0),
|
|
64
|
+
f_total_fee: (row.f_total_fee - 0) + (model.f_preamount - 0),
|
|
65
|
+
f_open_fee: model.f_open_fee,
|
|
66
|
+
f_collection: model.f_collection,
|
|
67
|
+
f_payment: model.f_payment.toString(),
|
|
68
|
+
payments: model.payments,
|
|
69
|
+
f_print: model.f_print.toString(),
|
|
70
|
+
f_voucher_number: model.f_voucher_number,
|
|
71
|
+
userinfo_version: row.userinfo_version,
|
|
72
|
+
version: row.version,
|
|
73
|
+
// 优惠金额
|
|
74
|
+
f_privilege_money: model.f_privilege_money,
|
|
75
|
+
f_privilege_gas: f_privilege_gas,
|
|
76
|
+
f_after_discount: model.f_after_discount,
|
|
77
|
+
|
|
78
|
+
f_operator: Vue.$login.f.name,
|
|
79
|
+
f_operatorid: Vue.$login.f.id,
|
|
80
|
+
f_orgid: Vue.$login.f.orgid,
|
|
81
|
+
f_orgname: Vue.$login.f.orgs,
|
|
82
|
+
f_depid: Vue.$login.f.depids,
|
|
83
|
+
f_depname: Vue.$login.f.deps,
|
|
84
|
+
f_zoneid: Vue.$login.f.zoneid,
|
|
85
|
+
f_zones: Vue.$login.f.zones,
|
|
86
|
+
f_comments: model.f_comments
|
|
87
|
+
}
|
|
88
|
+
console.log('发卡售气前参数', row)
|
|
89
|
+
return sendCardSaleGasGen(param, row)
|
|
90
|
+
},
|
|
91
|
+
resetinitCard (model, row) {
|
|
92
|
+
let f_serial_number = ''
|
|
93
|
+
let f_price = ''
|
|
94
|
+
let inputprice = '0'
|
|
95
|
+
if (model.f_serial_number) {
|
|
96
|
+
f_serial_number = model.f_serial_number
|
|
97
|
+
}
|
|
98
|
+
if (model.f_price && (model.f_price - 0) > 0) {
|
|
99
|
+
f_price = model.f_price
|
|
100
|
+
inputprice = '1'
|
|
101
|
+
}
|
|
102
|
+
let f_privilege_gas = 0
|
|
103
|
+
if (model.f_privilege_gas) {
|
|
104
|
+
f_privilege_gas = model.f_privilege_gas
|
|
105
|
+
}
|
|
106
|
+
let param = {
|
|
107
|
+
f_serial_id: model.f_serial_id,
|
|
108
|
+
f_userinfo_id: row.f_userinfo_id,
|
|
109
|
+
f_user_name: row.f_user_name,
|
|
110
|
+
f_serial_number: f_serial_number,
|
|
111
|
+
f_user_id: row.f_user_id,
|
|
112
|
+
f_price: f_price,
|
|
113
|
+
inputprice: inputprice,
|
|
114
|
+
f_userfiles_id: row.f_userfiles_id,
|
|
115
|
+
f_pregas: model.f_pregas,
|
|
116
|
+
f_preamount: model.f_preamount,
|
|
117
|
+
f_balance: row.f_balance,
|
|
118
|
+
f_meter_type: row.f_meter_type,
|
|
119
|
+
f_calculation: row.f_calculation,
|
|
120
|
+
f_collection_type: row.f_collection_type,
|
|
121
|
+
f_total_gas: (row.f_total_gas - 0) + (model.f_pregas - 0),
|
|
122
|
+
f_write_totalgas: (row.f_write_totalgas - 0) + (model.f_pregas - 0),
|
|
123
|
+
f_write_totalfee: (row.f_write_totalfee - 0) + (model.f_preamount - 0),
|
|
124
|
+
f_total_fee: (row.f_total_fee - 0) + (model.f_preamount - 0),
|
|
125
|
+
f_open_fee: model.f_open_fee,
|
|
126
|
+
f_collection: model.f_collection,
|
|
127
|
+
// f_print: model.f_print.toString(),
|
|
128
|
+
f_user_type: row.f_user_type,
|
|
129
|
+
f_gasproperties: row.f_gasproperties,
|
|
130
|
+
f_address: row.f_address,
|
|
131
|
+
f_meter_brand: row.f_meter_brand,
|
|
132
|
+
f_voucher_number: model.f_voucher_number,
|
|
133
|
+
userinfo_version: row.userinfo_version,
|
|
134
|
+
version: row.version,
|
|
135
|
+
|
|
136
|
+
f_operator: Vue.$login.f.name,
|
|
137
|
+
f_operatorid: Vue.$login.f.id,
|
|
138
|
+
f_orgid: Vue.$login.f.orgid,
|
|
139
|
+
f_orgname: Vue.$login.f.orgs,
|
|
140
|
+
f_depid: Vue.$login.f.depids,
|
|
141
|
+
f_depname: Vue.$login.f.deps,
|
|
142
|
+
f_zoneid: Vue.$login.f.zoneid,
|
|
143
|
+
f_zones: Vue.$login.f.zones,
|
|
144
|
+
f_comments: model.f_comments
|
|
145
|
+
}
|
|
146
|
+
console.log('重发卡售气前参数', row)
|
|
147
|
+
return resetsendCardSaleGasGen(param, row)
|
|
148
|
+
},
|
|
149
|
+
// 补气开户发卡
|
|
150
|
+
remanentinitCard (model, row, allot) {
|
|
151
|
+
let param = {
|
|
152
|
+
f_share_times: row.f_share_times,
|
|
153
|
+
f_hascard: row.f_hascard,
|
|
154
|
+
f_open_way: row.f_open_type,
|
|
155
|
+
f_serial_id: model.f_serial_id,
|
|
156
|
+
f_userinfo_id: row.f_userinfo_id,
|
|
157
|
+
f_user_id: row.f_user_id,
|
|
158
|
+
// 补气量
|
|
159
|
+
f_fill_gas: model.f_fill_gas,
|
|
160
|
+
f_fill_money: model.f_fill_money,
|
|
161
|
+
f_remanent_gas: row.f_remanent_gas === 0 ? model.f_fill_gas : row.f_remanent_gas,
|
|
162
|
+
f_remanent_price: row.f_remanent_price,
|
|
163
|
+
f_remanent_money: row.f_remanent_money === 0 ? model.f_fill_money : row.f_remanent_money,
|
|
164
|
+
f_remanent_type: row.f_remanent_type,
|
|
165
|
+
f_userfiles_id: row.f_userfiles_id,
|
|
166
|
+
f_user_name: row.f_user_name,
|
|
167
|
+
f_user_type: row.f_user_type,
|
|
168
|
+
f_gasproperties: row.f_gasproperties,
|
|
169
|
+
f_address: row.f_address,
|
|
170
|
+
f_meter_brand: row.f_meter_brand,
|
|
171
|
+
f_meter_type: row.f_meter_type,
|
|
172
|
+
f_collection_type: row.f_collection_type,
|
|
173
|
+
// 购气量
|
|
174
|
+
f_pregas: (model.f_pregas - 0) === 0 ? model.f_fill_gas : (model.f_pregas - 0),
|
|
175
|
+
f_preamount: (model.f_preamount - 0) === 0 ? model.f_fill_money : (model.f_preamount - 0),
|
|
176
|
+
f_totalcost: model.f_totalcost - 0,
|
|
177
|
+
f_balance: row.f_balance,
|
|
178
|
+
f_open_fee: model.f_open_fee,
|
|
179
|
+
f_collection: model.f_collection,
|
|
180
|
+
f_payment: model.f_payment.toString(),
|
|
181
|
+
payments: model.payments,
|
|
182
|
+
f_print: model.f_print.toString(),
|
|
183
|
+
f_voucher_number: model.f_voucher_number,
|
|
184
|
+
userinfo_version: row.userinfo_version,
|
|
185
|
+
version: row.version,
|
|
186
|
+
f_operator: Vue.$login.f.name,
|
|
187
|
+
f_operatorid: Vue.$login.f.id,
|
|
188
|
+
f_orgid: Vue.$login.f.orgid,
|
|
189
|
+
f_orgname: Vue.$login.f.orgs,
|
|
190
|
+
f_depid: Vue.$login.f.depids,
|
|
191
|
+
f_depname: Vue.$login.f.deps,
|
|
192
|
+
f_zoneid: Vue.$login.f.zoneid,
|
|
193
|
+
f_zones: Vue.$login.f.zones,
|
|
194
|
+
f_comments: model.f_comments
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (row.f_remanent_type === 1) {
|
|
198
|
+
param.f_total_gas = (row.f_total_gas - 0) + (model.f_pregas - 0)
|
|
199
|
+
param.f_total_fee = (row.f_total_fee - 0) + (model.f_preamount - 0)
|
|
200
|
+
} else {
|
|
201
|
+
if ((model.f_pregas - 0) > (model.f_fill_gas - 0)) {
|
|
202
|
+
param.f_total_gas = (row.f_total_gas - 0) + ((model.f_pregas - 0) - (model.f_fill_gas - 0))
|
|
203
|
+
param.f_total_fee = (row.f_total_fee - 0) + (model.f_preamount - 0)
|
|
204
|
+
} else {
|
|
205
|
+
param.f_total_gas = (row.f_total_gas - 0)
|
|
206
|
+
param.f_total_fee = (row.f_total_fee - 0)
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
param.f_write_totalgas = (row.f_write_totalgas - 0) + (model.f_pregas - 0)
|
|
210
|
+
param.f_write_totalfee = (row.f_write_totalfee - 0) + (model.f_preamount - 0)
|
|
211
|
+
return sendCardSaleGasGenremanent(param, row)
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
offlineWrite (row) {
|
|
215
|
+
return offlineWriteGen(row)
|
|
216
|
+
},
|
|
217
|
+
// 余量补差
|
|
218
|
+
margin (model, row) {
|
|
219
|
+
let f_serial_number = ''
|
|
220
|
+
let f_price = ''
|
|
221
|
+
let inputprice = '0'
|
|
222
|
+
let f_privilege_gas = 0
|
|
223
|
+
if (model.f_serial_number) {
|
|
224
|
+
f_serial_number = model.f_serial_number
|
|
225
|
+
}
|
|
226
|
+
if (model.f_price && (model.f_price - 0) > 0) {
|
|
227
|
+
f_price = model.f_price
|
|
228
|
+
inputprice = '1'
|
|
229
|
+
}
|
|
230
|
+
if (model.f_privilege_gas) {
|
|
231
|
+
f_privilege_gas = model.f_privilege_gas
|
|
232
|
+
}
|
|
233
|
+
let param = {
|
|
234
|
+
garbage_number: model.garbage_number,
|
|
235
|
+
garbage_money: model.garbage_money,
|
|
236
|
+
f_serial_id: model.f_serial_id,
|
|
237
|
+
f_userinfo_id: row.f_userinfo_id,
|
|
238
|
+
f_serial_number: f_serial_number,
|
|
239
|
+
f_write_money: model.xiekamoney,
|
|
240
|
+
f_price: f_price,
|
|
241
|
+
inputprice: inputprice,
|
|
242
|
+
// 补气量
|
|
243
|
+
f_remanent_gas: row.f_remanent_gas,
|
|
244
|
+
f_remanent_price: row.f_remanent_price,
|
|
245
|
+
f_user_id: row.f_user_id,
|
|
246
|
+
f_calculation: row.f_calculation,
|
|
247
|
+
f_collection_type: row.f_collection_type,
|
|
248
|
+
f_userfiles_id: row.f_userfiles_id,
|
|
249
|
+
f_pregas: model.f_pregas,
|
|
250
|
+
f_totalcost: model.f_totalcost,
|
|
251
|
+
f_balance: row.f_balance,
|
|
252
|
+
f_meter_type: row.f_meter_type,
|
|
253
|
+
f_preamount: model.f_preamount,
|
|
254
|
+
f_total_gas: (row.f_total_gas - 0) + (model.f_pregas - 0),
|
|
255
|
+
f_write_totalgas: (row.f_write_totalgas - 0) + (model.f_pregas - 0),
|
|
256
|
+
f_write_totalfee: (row.f_write_totalfee - 0) + (model.xiekamoney - 0),
|
|
257
|
+
f_total_fee: (row.f_total_fee - 0) + (model.f_preamount - 0),
|
|
258
|
+
f_collection: model.f_collection,
|
|
259
|
+
// 优惠金额
|
|
260
|
+
f_privilege_money: model.f_privilege_money,
|
|
261
|
+
f_privilege_gas: f_privilege_gas,
|
|
262
|
+
f_after_discount: model.f_after_discount,
|
|
263
|
+
f_payment: model.f_payment.toString(),
|
|
264
|
+
payments: model.payments,
|
|
265
|
+
f_print: model.f_print.toString(),
|
|
266
|
+
f_voucher_number: model.f_voucher_number,
|
|
267
|
+
userinfo_version: row.userinfo_version,
|
|
268
|
+
version: row.version,
|
|
269
|
+
f_meter_base: row.f_meter_base,
|
|
270
|
+
f_operator: Vue.$login.f.name,
|
|
271
|
+
f_operatorid: Vue.$login.f.id,
|
|
272
|
+
f_orgid: Vue.$login.f.orgid,
|
|
273
|
+
f_orgname: Vue.$login.f.orgs,
|
|
274
|
+
f_depid: Vue.$login.f.depids,
|
|
275
|
+
f_depname: Vue.$login.f.deps,
|
|
276
|
+
f_zoneid: Vue.$login.f.zoneid,
|
|
277
|
+
f_zones: Vue.$login.f.zones,
|
|
278
|
+
f_comments: model.f_comments,
|
|
279
|
+
f_sys_balance: model.f_sys_balance
|
|
280
|
+
}
|
|
281
|
+
return marginGen(param, row)
|
|
282
|
+
},
|
|
283
|
+
// 卡表收费
|
|
284
|
+
sellgas (model, row) {
|
|
285
|
+
let f_serial_number = ''
|
|
286
|
+
let f_price = ''
|
|
287
|
+
let inputprice = '0'
|
|
288
|
+
let f_privilege_gas = 0
|
|
289
|
+
if (model.f_serial_number) {
|
|
290
|
+
f_serial_number = model.f_serial_number
|
|
291
|
+
}
|
|
292
|
+
if (model.f_price && (model.f_price - 0) > 0) {
|
|
293
|
+
f_price = model.f_price
|
|
294
|
+
inputprice = '1'
|
|
295
|
+
}
|
|
296
|
+
if (model.f_privilege_gas) {
|
|
297
|
+
f_privilege_gas = model.f_privilege_gas
|
|
298
|
+
}
|
|
299
|
+
let param = {
|
|
300
|
+
garbage_number: model.garbage_number,
|
|
301
|
+
garbage_money: model.garbage_money,
|
|
302
|
+
f_serial_id: model.f_serial_id,
|
|
303
|
+
f_userinfo_id: row.f_userinfo_id,
|
|
304
|
+
f_serial_number: f_serial_number,
|
|
305
|
+
f_write_money: model.xiekamoney,
|
|
306
|
+
f_price: f_price,
|
|
307
|
+
inputprice: inputprice,
|
|
308
|
+
// 补气量
|
|
309
|
+
f_remanent_gas: row.f_remanent_gas,
|
|
310
|
+
f_remanent_price: row.f_remanent_price,
|
|
311
|
+
f_user_id: row.f_user_id,
|
|
312
|
+
f_calculation: row.f_calculation,
|
|
313
|
+
f_collection_type: row.f_collection_type,
|
|
314
|
+
f_userfiles_id: row.f_userfiles_id,
|
|
315
|
+
f_pregas: model.f_pregas,
|
|
316
|
+
f_totalcost: model.f_totalcost,
|
|
317
|
+
f_balance: row.f_balance,
|
|
318
|
+
f_meter_type: row.f_meter_type,
|
|
319
|
+
f_preamount: model.f_preamount,
|
|
320
|
+
f_total_gas: (row.f_total_gas - 0) + (model.f_pregas - 0),
|
|
321
|
+
f_write_totalgas: (row.f_write_totalgas - 0) + (model.f_pregas - 0),
|
|
322
|
+
f_write_totalfee: (row.f_write_totalfee - 0) + (model.xiekamoney - 0),
|
|
323
|
+
f_total_fee: (row.f_total_fee - 0) + (model.f_preamount - 0),
|
|
324
|
+
f_collection: model.f_collection,
|
|
325
|
+
// 优惠金额
|
|
326
|
+
f_privilege_money: model.f_privilege_money,
|
|
327
|
+
f_privilege_gas: f_privilege_gas,
|
|
328
|
+
f_after_discount: model.f_after_discount,
|
|
329
|
+
f_payment: model.f_payment.toString(),
|
|
330
|
+
payments: model.payments,
|
|
331
|
+
f_print: model.f_print.toString(),
|
|
332
|
+
f_voucher_number: model.f_voucher_number,
|
|
333
|
+
userinfo_version: row.userinfo_version,
|
|
334
|
+
version: row.version,
|
|
335
|
+
f_meter_base: row.f_meter_base,
|
|
336
|
+
f_operator: Vue.$login.f.name,
|
|
337
|
+
f_operatorid: Vue.$login.f.id,
|
|
338
|
+
f_orgid: Vue.$login.f.orgid,
|
|
339
|
+
f_orgname: Vue.$login.f.orgs,
|
|
340
|
+
f_depid: Vue.$login.f.depids,
|
|
341
|
+
f_depname: Vue.$login.f.deps,
|
|
342
|
+
f_zoneid: Vue.$login.f.zoneid,
|
|
343
|
+
f_zones: Vue.$login.f.zones,
|
|
344
|
+
f_comments: model.f_comments,
|
|
345
|
+
f_sys_balance: model.f_sys_balance
|
|
346
|
+
}
|
|
347
|
+
return sellgasGen(param, row)
|
|
348
|
+
},
|
|
349
|
+
|
|
350
|
+
// 补气卡表收费
|
|
351
|
+
remanentsellgas (model, row) {
|
|
352
|
+
let param = {
|
|
353
|
+
f_user_name: row.f_user_name,
|
|
354
|
+
f_user_type: row.f_user_type,
|
|
355
|
+
f_gasproperties: row.f_gasproperties,
|
|
356
|
+
f_userinfo_id: row.f_userinfo_id,
|
|
357
|
+
f_address: row.f_address,
|
|
358
|
+
f_meter_brand: row.f_meter_brand,
|
|
359
|
+
f_meter_type: row.f_meter_type,
|
|
360
|
+
f_collection_type: row.f_collection_type,
|
|
361
|
+
f_card_id: row.f_card_id,
|
|
362
|
+
f_write_money: model.xiekamoney,
|
|
363
|
+
// 补气信息
|
|
364
|
+
f_fill_gas: model.f_fill_gas,
|
|
365
|
+
f_fill_money: model.f_fill_money,
|
|
366
|
+
|
|
367
|
+
f_remanent_gas: row.f_remanent_gas,
|
|
368
|
+
f_remanent_price: row.f_remanent_price,
|
|
369
|
+
f_remanent_type: row.f_remanent_type,
|
|
370
|
+
f_user_id: row.f_user_id,
|
|
371
|
+
f_userfiles_id: row.f_userfiles_id,
|
|
372
|
+
f_pregas: model.f_pregas,
|
|
373
|
+
f_balance: row.f_balance,
|
|
374
|
+
f_preamount: model.f_preamount,
|
|
375
|
+
f_totalcost: model.f_totalcost,
|
|
376
|
+
f_collection: model.f_collection,
|
|
377
|
+
f_payment: model.f_payment.toString(),
|
|
378
|
+
payments: model.payments,
|
|
379
|
+
f_print: model.f_print.toString(),
|
|
380
|
+
f_voucher_number: model.f_voucher_number,
|
|
381
|
+
userinfo_version: row.userinfo_version,
|
|
382
|
+
version: row.version,
|
|
383
|
+
f_operator: Vue.$login.f.name,
|
|
384
|
+
f_operatorid: Vue.$login.f.id,
|
|
385
|
+
f_orgid: Vue.$login.f.orgid,
|
|
386
|
+
f_orgname: Vue.$login.f.orgs,
|
|
387
|
+
f_depid: Vue.$login.f.depids,
|
|
388
|
+
f_depname: Vue.$login.f.deps,
|
|
389
|
+
f_zoneid: Vue.$login.f.zoneid,
|
|
390
|
+
f_zones: Vue.$login.f.zones,
|
|
391
|
+
f_comments: model.f_comments
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// 0:代表清零补气, 累购量不加 1:代表换表补气 累购量加
|
|
395
|
+
if (row.f_remanent_type === 1) {
|
|
396
|
+
param.f_total_gas = (row.f_total_gas - 0) + (model.f_pregas - 0)
|
|
397
|
+
param.f_total_fee = (row.f_total_fee - 0) + (model.f_preamount - 0)
|
|
398
|
+
} else {
|
|
399
|
+
if (model.f_pregas > row.f_remanent_gas) {
|
|
400
|
+
param.f_total_gas = (row.f_total_gas - 0) + (model.f_pregas - row.f_remanent_gas)
|
|
401
|
+
param.f_total_fee = (row.f_total_fee - 0) + (model.f_preamount - 0)
|
|
402
|
+
} else {
|
|
403
|
+
param.f_total_gas = (row.f_total_gas - 0)
|
|
404
|
+
param.f_total_fee = (row.f_total_fee - 0)
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
param.f_write_totalgas = (row.f_write_totalgas - 0) + (model.f_pregas - 0)
|
|
408
|
+
param.f_write_totalfee = (row.f_write_totalfee - 0) + (model.xiekamoney - 0)
|
|
409
|
+
return sellgasRemanentGen(param, row)
|
|
410
|
+
},
|
|
411
|
+
// 数码表收费
|
|
412
|
+
DigtialSellGas (model, row) {
|
|
413
|
+
let f_serial_number = ''
|
|
414
|
+
if (model.f_serial_number) {
|
|
415
|
+
f_serial_number = model.f_serial_number
|
|
416
|
+
}
|
|
417
|
+
let param = {
|
|
418
|
+
f_userinfo_id: row.f_userinfo_id,
|
|
419
|
+
f_serial_number: f_serial_number,
|
|
420
|
+
f_user_id: row.f_user_id,
|
|
421
|
+
f_userfiles_id: row.f_userfiles_id,
|
|
422
|
+
f_pregas: model.f_pregas,
|
|
423
|
+
f_write_money: model.f_write_money,
|
|
424
|
+
f_balance: row.f_balance,
|
|
425
|
+
f_preamount: model.f_preamount,
|
|
426
|
+
f_total_gas: (row.f_total_gas - 0) + (model.f_pregas - 0),
|
|
427
|
+
f_write_totalgas: (row.f_write_totalgas - 0) + (model.f_pregas - 0),
|
|
428
|
+
f_write_totalfee: (row.f_write_totalfee - 0) + (model.f_write_money - 0),
|
|
429
|
+
f_total_fee: (row.f_total_fee - 0) + (model.f_preamount - 0),
|
|
430
|
+
f_collection: model.f_collection,
|
|
431
|
+
f_payment: model.f_payment.toString(),
|
|
432
|
+
payments: model.payments,
|
|
433
|
+
f_print: model.f_print.toString(),
|
|
434
|
+
f_voucher_number: model.f_voucher_number,
|
|
435
|
+
userinfo_version: row.userinfo_version,
|
|
436
|
+
version: row.version,
|
|
437
|
+
f_operator: Vue.$login.f.name,
|
|
438
|
+
f_operatorid: Vue.$login.f.id,
|
|
439
|
+
f_orgid: Vue.$login.f.orgid,
|
|
440
|
+
f_orgname: Vue.$login.f.orgs,
|
|
441
|
+
f_depid: Vue.$login.f.depids,
|
|
442
|
+
f_depname: Vue.$login.f.deps,
|
|
443
|
+
f_zoneid: Vue.$login.f.zoneid,
|
|
444
|
+
f_zones: Vue.$login.f.zones
|
|
445
|
+
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
return DigtialSellGasGen(param, row)
|
|
449
|
+
},
|
|
450
|
+
// 无卡收费
|
|
451
|
+
noCardSellGas (model, row) {
|
|
452
|
+
let f_serial_number = ''
|
|
453
|
+
if (model.f_serial_number) {
|
|
454
|
+
f_serial_number = model.f_serial_number
|
|
455
|
+
}
|
|
456
|
+
let f_write_card = ''
|
|
457
|
+
if (model.f_write_card) {
|
|
458
|
+
f_write_card = model.f_write_card
|
|
459
|
+
}
|
|
460
|
+
let param = {
|
|
461
|
+
f_userinfo_id: row.f_userinfo_id,
|
|
462
|
+
f_serial_number: f_serial_number,
|
|
463
|
+
f_user_id: row.f_user_id,
|
|
464
|
+
f_userfiles_id: row.f_userfiles_id,
|
|
465
|
+
f_pregas: model.f_pregas,
|
|
466
|
+
f_write_money: model.f_write_money,
|
|
467
|
+
f_balance: row.f_balance,
|
|
468
|
+
f_preamount: model.f_preamount,
|
|
469
|
+
f_total_gas: (row.f_total_gas - 0) + (model.f_pregas - 0),
|
|
470
|
+
f_write_totalgas: (row.f_write_totalgas - 0) + (model.f_pregas - 0),
|
|
471
|
+
f_write_totalfee: (row.f_write_totalfee - 0) + (model.f_write_money - 0),
|
|
472
|
+
f_total_fee: (row.f_total_fee - 0) + (model.f_preamount - 0),
|
|
473
|
+
f_collection: model.f_collection,
|
|
474
|
+
f_payment: model.f_payment.toString(),
|
|
475
|
+
payments: model.payments,
|
|
476
|
+
f_print: model.f_print.toString(),
|
|
477
|
+
f_voucher_number: model.f_voucher_number,
|
|
478
|
+
userinfo_version: row.userinfo_version,
|
|
479
|
+
version: row.version,
|
|
480
|
+
f_write_card: f_write_card === '不写卡' ? '不写卡' : '未写卡',
|
|
481
|
+
f_operator: Vue.$login.f.name,
|
|
482
|
+
f_operatorid: Vue.$login.f.id,
|
|
483
|
+
f_orgid: Vue.$login.f.orgid,
|
|
484
|
+
f_orgname: Vue.$login.f.orgs,
|
|
485
|
+
f_depid: Vue.$login.f.depids,
|
|
486
|
+
f_depname: Vue.$login.f.deps,
|
|
487
|
+
f_zoneid: Vue.$login.f.zoneid,
|
|
488
|
+
f_zones: Vue.$login.f.zones
|
|
489
|
+
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
return noCardSellGasGen(param, row)
|
|
493
|
+
},
|
|
494
|
+
|
|
495
|
+
// 补卡写卡
|
|
496
|
+
replaceCard (model, row, allot) {
|
|
497
|
+
// 磁条卡走了 replaceCiTiaoCard 不走这里
|
|
498
|
+
// if (row.f_meter_type.indexOf('卡表') === -1 && row.f_meter_type.indexOf('物联网表') === -1) {
|
|
499
|
+
// model.f_type = '补磁条卡'
|
|
500
|
+
// let replace = replaceCiTiaoCardGen(model, row)
|
|
501
|
+
// return co(replace)
|
|
502
|
+
// }
|
|
503
|
+
let replace = replaceCardGen(model, row, allot ? this.getallotdata(allot, row, '补卡') : null)
|
|
504
|
+
return co(replace)
|
|
505
|
+
},
|
|
506
|
+
// 磁条卡补卡写卡
|
|
507
|
+
replaceCiTiaoCard (model, row, allot) {
|
|
508
|
+
let replace = replaceCiTiaoCardGen(model, row)
|
|
509
|
+
return co(replace)
|
|
510
|
+
},
|
|
511
|
+
// 机表写卡
|
|
512
|
+
replaceCardJB (model, row) {
|
|
513
|
+
let replace = replaceCardGenJB(model, row)
|
|
514
|
+
return co(replace)
|
|
515
|
+
},
|
|
516
|
+
// 物联网写卡
|
|
517
|
+
replaceCardWeb (model, row) {
|
|
518
|
+
let replace = replaceCardGenWeb(model, row)
|
|
519
|
+
return co(replace)
|
|
520
|
+
},
|
|
521
|
+
replacecXq (model, row) {
|
|
522
|
+
let replace = replaceXq(model, row)
|
|
523
|
+
return co(replace)
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
// 判断是否有卡插入
|
|
528
|
+
let hasCardGen = async function () {
|
|
529
|
+
return await Vue.resetpost('http://127.0.0.1:8003/HasCard', {}, {resolveMsg: null, rejectMsg: null})
|
|
530
|
+
}
|
|
531
|
+
// 读卡
|
|
532
|
+
let readCard = async function () {
|
|
533
|
+
return await Vue.resetpost('http://127.0.0.1:8003/ReadCard', {data: {}}, {resolveMsg: null, rejectMsg: null})
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
let replaceCiTiaoCardGen = async function (model, row) {
|
|
537
|
+
// 1.存库 2.写卡
|
|
538
|
+
let result = null
|
|
539
|
+
let getCardNumber = {data: {cardNumber: null}}
|
|
540
|
+
try {
|
|
541
|
+
const OperatorInfo = {
|
|
542
|
+
f_operator: Vue.$login.f.name,
|
|
543
|
+
f_operatorid: Vue.$login.f.id,
|
|
544
|
+
f_orgid: Vue.$login.f.orgid,
|
|
545
|
+
f_orgname: Vue.$login.f.orgs,
|
|
546
|
+
f_depid: Vue.$login.f.depids,
|
|
547
|
+
f_depname: Vue.$login.f.deps
|
|
548
|
+
}
|
|
549
|
+
// 获取卡号
|
|
550
|
+
// if (!row.f_card_id) {
|
|
551
|
+
// getCardNumber = await Vue.resetpost('rs/logic/getCardNumber', {data: {id: row.brand_id}}, {
|
|
552
|
+
// resolveMsg: null,
|
|
553
|
+
// rejectMsg: '发卡售气获取卡号失败!!'
|
|
554
|
+
// })
|
|
555
|
+
// console.log('获取卡号、、', getCardNumber)
|
|
556
|
+
// } else {
|
|
557
|
+
// getCardNumber.data.cardNumber = row.f_card_id
|
|
558
|
+
// console.log('档案自带卡号、、', getCardNumber)
|
|
559
|
+
// }
|
|
560
|
+
if (row.f_userinfo_code) {
|
|
561
|
+
getCardNumber.data.cardNumber = row.f_card_id
|
|
562
|
+
}
|
|
563
|
+
result = await Vue.resetpost('rs/logic/sendCiTiaoCardRemanentGas', {
|
|
564
|
+
data: {
|
|
565
|
+
model,
|
|
566
|
+
getCardNumber,
|
|
567
|
+
row,
|
|
568
|
+
OperatorInfo
|
|
569
|
+
}
|
|
570
|
+
}, {resolveMsg: null, rejectMsg: '发卡售气存库失败'})
|
|
571
|
+
// 存库
|
|
572
|
+
console.log('换表发卡存库返回', result)
|
|
573
|
+
// 写卡
|
|
574
|
+
Vue.showAlert('请刷卡', 'warning', 50000)
|
|
575
|
+
// 组织写卡数据
|
|
576
|
+
let params = {
|
|
577
|
+
kh: result.data.cardnumber
|
|
578
|
+
}
|
|
579
|
+
let cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteCard_HEC', params, {
|
|
580
|
+
resolveMsg: null,
|
|
581
|
+
rejectMsg: '开户卡服务错误'
|
|
582
|
+
})
|
|
583
|
+
Vue.closeAlert()
|
|
584
|
+
if (!result || cardRes.data.Err || cardRes.data.Exception) {
|
|
585
|
+
// 写卡异常
|
|
586
|
+
await Vue.resetpost('rs/logic/sendCiTiaoCardRemanentGas', {
|
|
587
|
+
data: {
|
|
588
|
+
model,
|
|
589
|
+
getCardNumber,
|
|
590
|
+
row,
|
|
591
|
+
Chongzheng: true,
|
|
592
|
+
fill_id: result.data.id
|
|
593
|
+
}
|
|
594
|
+
}, {resolveMsg: null, rejectMsg: null})
|
|
595
|
+
throw new Error(`卡服务错误:${cardRes.data.Err}${cardRes.data.Exception},请联系开发人员处理!!`)
|
|
596
|
+
} else {
|
|
597
|
+
// 写卡成功
|
|
598
|
+
Vue.showAlert('写卡成功', 'success', 2000)
|
|
599
|
+
return result
|
|
600
|
+
}
|
|
601
|
+
} catch (error) {
|
|
602
|
+
console.log('换表发卡出错。。', error)
|
|
603
|
+
if (result) {
|
|
604
|
+
// 出错进行回滚
|
|
605
|
+
row.f_user_id = row.f_user_id + ''
|
|
606
|
+
if (result) {
|
|
607
|
+
await Vue.resetpost('rs/logic/sendCiTiaoCardRemanentGas', {
|
|
608
|
+
data: {
|
|
609
|
+
model,
|
|
610
|
+
getCardNumber,
|
|
611
|
+
row,
|
|
612
|
+
Chongzheng: true,
|
|
613
|
+
fill_id: result.data.id
|
|
614
|
+
}
|
|
615
|
+
}, {resolveMsg: null, rejectMsg: null})
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
if (error.data) {
|
|
619
|
+
throw new Error(error.data)
|
|
620
|
+
} else {
|
|
621
|
+
throw error
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
let sendCardSaleGasGenremanent = async function (model, row) {
|
|
627
|
+
// 1.存库 2.写卡
|
|
628
|
+
let result = null
|
|
629
|
+
try {
|
|
630
|
+
let cardState = await hasCardGen()
|
|
631
|
+
console.log('判卡函数返回:', cardState)
|
|
632
|
+
if (JSON.parse(cardState.data).state === 1) {
|
|
633
|
+
// 获取卡号
|
|
634
|
+
let getCardNumber = {data: {cardNumber: null}}
|
|
635
|
+
if (!row.f_card_id) {
|
|
636
|
+
getCardNumber = await Vue.resetpost('rs/logic/getCardNumber', {data: {id: row.brand_id}}, {resolveMsg: null, rejectMsg: '发卡售气获取卡号失败!!'})
|
|
637
|
+
console.log('获取卡号、、', getCardNumber)
|
|
638
|
+
} else {
|
|
639
|
+
getCardNumber.data.cardNumber = row.f_card_id
|
|
640
|
+
console.log('档案自带卡号、、', getCardNumber)
|
|
641
|
+
}
|
|
642
|
+
if (row.f_alias && row.f_alias.includes('SmartCard_TP')) {
|
|
643
|
+
model.cardNumber = row.f_meternumber
|
|
644
|
+
} else if (getCardNumber.data.cardNumber) {
|
|
645
|
+
model.cardNumber = getCardNumber.data.cardNumber + ''
|
|
646
|
+
} else {
|
|
647
|
+
throw new Error('获取卡号失败!请核实参数管理中的卡号重新换表发卡售气。')
|
|
648
|
+
}
|
|
649
|
+
result = await Vue.resetpost('rs/logic/sendCardRemanentGas', {data: model}, {resolveMsg: null, rejectMsg: '发卡售气存库失败'})
|
|
650
|
+
// 存库
|
|
651
|
+
console.log('换表发卡存库返回', result)
|
|
652
|
+
// 写卡
|
|
653
|
+
let cardParams = await getParamGen(result.data.cardnumber, row.f_alias, row.f_user_id, row.f_userfiles_id)
|
|
654
|
+
|
|
655
|
+
// 组织写卡数据
|
|
656
|
+
let params = {
|
|
657
|
+
factory: row.f_alias,
|
|
658
|
+
kmm: '0', // 2019-12-22 查旭说的。给一个0 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
|
|
659
|
+
kzt: '0', // 卡状态,0开户卡,1用户卡(0新开户,1补卡)
|
|
660
|
+
kh: result.data.cardnumber, // 卡号
|
|
661
|
+
yhh: row.f_meterid ? row.f_meterid : 0, // 用户号,档案中自己输
|
|
662
|
+
ql: model.f_pregas, // 预购气量
|
|
663
|
+
csql: '0', // 上次购气量,新开户为0
|
|
664
|
+
ccsql: '0', // 上上次购气量,新开户为0
|
|
665
|
+
cs: '1', // 求购气次数,先开户为1
|
|
666
|
+
ljgql: (row.f_total_gas - 0) + (model.f_pregas - 0), // 当前累计购气量
|
|
667
|
+
ljgqje: (row.f_total_fee - 0) + (model.f_preamount - 0), // 累计购气金额
|
|
668
|
+
bkcs: '0', // 新开户卡,为0
|
|
669
|
+
ljyql: '0', // 累积用气量,有些表要累加原来用气量,新开户卡,为0
|
|
670
|
+
bjql: row.f_police_gas, // 报警气量,t_gasbrand表中
|
|
671
|
+
czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
|
|
672
|
+
tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
|
|
673
|
+
cssqrq: '0', // 上次售气日期,格式为YYYYMMDD
|
|
674
|
+
meterid: row.f_meternumber, // 表号
|
|
675
|
+
money: model.f_preamount, // 购气金额
|
|
676
|
+
dqdm: row.f_area_code, // 精益工业地区代码
|
|
677
|
+
klx: row.f_coding
|
|
678
|
+
}
|
|
679
|
+
// 判断是否是累购表
|
|
680
|
+
if (row.f_support_purchase === '是') {
|
|
681
|
+
params.ljgql = (row.f_write_totalgas - 0) + (model.f_pregas - 0)
|
|
682
|
+
params.ljgqje = (row.f_write_totalfee - 0) + (model.f_preamount - 0)
|
|
683
|
+
}
|
|
684
|
+
params = Object.assign({}, Vue.CommonService.writeCardParams(cardParams), params)
|
|
685
|
+
console.log('换表发卡写卡参数', params)
|
|
686
|
+
let cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params, {
|
|
687
|
+
resolveMsg: null,
|
|
688
|
+
rejectMsg: '开户卡服务错误'
|
|
689
|
+
})
|
|
690
|
+
if (!cardParams || ((model.f_pregas > model.f_remanent_gas) && !result) || cardRes.data.Err || cardRes.data.Exception) {
|
|
691
|
+
// 写卡异常
|
|
692
|
+
// 数据回滚操作
|
|
693
|
+
// 由于数据太长,将f_user_id 更改为字符串
|
|
694
|
+
row.f_userfiles_id = row.f_userfiles_id + ''
|
|
695
|
+
|
|
696
|
+
await Vue.resetpost('rs/logic/remanentRollback', {data: {fillgasid: result.data.fillgasid, sellid: result.data.sellid, row: row}}, {
|
|
697
|
+
resolveMsg: null,
|
|
698
|
+
rejectMsg: '开户失败'
|
|
699
|
+
})
|
|
700
|
+
throw new Error(`卡服务错误:${cardRes.data.Err}${cardRes.data.Exception},请联系开发人员处理!!`)
|
|
701
|
+
} else {
|
|
702
|
+
// 写卡成功
|
|
703
|
+
// 更新卡密码
|
|
704
|
+
row.version = result.data.version - 1,
|
|
705
|
+
await Vue.CommonService.updatePassword(row, cardRes)
|
|
706
|
+
Vue.showAlert('补气购气成功', 'success', 2000)
|
|
707
|
+
return result
|
|
708
|
+
}
|
|
709
|
+
} else {
|
|
710
|
+
throw new Error(`请检查卡是否插好!!`)
|
|
711
|
+
}
|
|
712
|
+
} catch (error) {
|
|
713
|
+
console.log('换表发卡出错。。', error)
|
|
714
|
+
|
|
715
|
+
if (result) {
|
|
716
|
+
// 出错进行回滚
|
|
717
|
+
row.f_user_id = row.f_user_id + ''
|
|
718
|
+
if (result) {
|
|
719
|
+
await Vue.resetpost('rs/logic/remanentRollback', {data: {fillgasid: result.data.fillgasid, sellid: result.data.sellid, row: row}}, {
|
|
720
|
+
resolveMsg: null,
|
|
721
|
+
rejectMsg: '写卡失败,数据回滚失败,请联系技术人员处理!!'
|
|
722
|
+
})
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
if (error.data) {
|
|
727
|
+
throw new Error(error.data)
|
|
728
|
+
} else {
|
|
729
|
+
throw error
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
let resetsendCardSaleGasGen = async function (model, row) {
|
|
734
|
+
// 1.存库 2.写卡
|
|
735
|
+
let result = null
|
|
736
|
+
try {
|
|
737
|
+
let cardState = await hasCardGen()
|
|
738
|
+
console.log('判卡函数返回:', cardState)
|
|
739
|
+
if (JSON.parse(cardState.data).state === 1) {
|
|
740
|
+
// 获取卡号
|
|
741
|
+
let getCardNumber = await Vue.resetpost('rs/logic/getCardNumber', {data: {id: row.brand_id}}, {resolveMsg: null, rejectMsg: '重发卡售气获取卡号失败!!'})
|
|
742
|
+
console.log('获取卡号、、', getCardNumber)
|
|
743
|
+
if (getCardNumber.data.cardNumber) {
|
|
744
|
+
// 当卡的别名是泰鹏普通卡的时候卡号和表号一致
|
|
745
|
+
console.log('开始验证是不是泰鹏普通卡')
|
|
746
|
+
if (row.f_alias && row.f_alias.includes('SmartCard_TP')) {
|
|
747
|
+
model.cardNumber = row.f_meternumber
|
|
748
|
+
} else {
|
|
749
|
+
model.cardNumber = getCardNumber.data.cardNumber + ''
|
|
750
|
+
model.f_card_id = getCardNumber.data.cardNumber + ''
|
|
751
|
+
}
|
|
752
|
+
} else {
|
|
753
|
+
throw new Error('获取卡号失败!请核实参数管理中的卡号重新发卡售气。')
|
|
754
|
+
}
|
|
755
|
+
// 存库
|
|
756
|
+
result = await Vue.resetpost('rs/logic/sale_resetsendCardSaleGas_logic', {data: model}, {resolveMsg: null, rejectMsg: '重发卡售气存库失败'})
|
|
757
|
+
console.log('重发卡售气存库返回', result)
|
|
758
|
+
// 写卡
|
|
759
|
+
let cardParams = await getParamGen(result.data.cardnumber, row.f_alias, row.f_user_id, row.f_userfiles_id)
|
|
760
|
+
|
|
761
|
+
// 组织写卡数据
|
|
762
|
+
let params = {
|
|
763
|
+
factory: row.f_alias,
|
|
764
|
+
kmm: '0', // 2019-12-22 查旭说的。给一个0 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
|
|
765
|
+
kzt: '0', // 卡状态,0开户卡,1用户卡(0新开户,1补卡)
|
|
766
|
+
kh: result.data.cardnumber, // 卡号
|
|
767
|
+
yhh: row.f_meterid ? row.f_meterid : 0, // 用户号,档案中自己输
|
|
768
|
+
ql: model.f_pregas, // 预购气量
|
|
769
|
+
csql: '0', // 上次购气量,新开户为0
|
|
770
|
+
ccsql: '0', // 上上次购气量,新开户为0
|
|
771
|
+
cs: '1', // 求购气次数,先开户为1
|
|
772
|
+
// ljgql: model.f_pregas, // 当前累计购气量
|
|
773
|
+
bkcs: '0', // 新开户卡,为0
|
|
774
|
+
ljyql: '0', // 累积用气量,有些表要累加原来用气量,新开户卡,为0
|
|
775
|
+
bjql: row.f_police_gas, // 报警气量,t_gasbrand表中
|
|
776
|
+
czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
|
|
777
|
+
tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
|
|
778
|
+
cssqrq: '0', // 上次售气日期,格式为YYYYMMDD
|
|
779
|
+
meterid: row.f_meternumber, // 表号
|
|
780
|
+
money: model.f_preamount, // 购气金额
|
|
781
|
+
dqdm: row.f_area_code, // 精益工业地区代码
|
|
782
|
+
klx: row.f_coding,
|
|
783
|
+
ljgql: (row.f_total_gas - 0) + (model.f_pregas - 0), // 当前累计购气量
|
|
784
|
+
ljgqje: (row.f_total_fee - 0) + (model.f_preamount - 0) // 累计购气金额
|
|
785
|
+
}
|
|
786
|
+
// 判断是否是累购表
|
|
787
|
+
if (row.f_support_purchase === '是') {
|
|
788
|
+
params.ljgql = (row.f_write_totalgas - 0) + (model.f_pregas - 0)
|
|
789
|
+
params.ljgqje = (row.f_write_totalfee - 0) + (model.f_preamount - 0)
|
|
790
|
+
}
|
|
791
|
+
params = Object.assign({}, Vue.CommonService.writeCardParams(cardParams), params)
|
|
792
|
+
console.log('重发卡售气写卡参数', params)
|
|
793
|
+
let cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params, {
|
|
794
|
+
resolveMsg: null,
|
|
795
|
+
rejectMsg: '重开户卡服务错误'
|
|
796
|
+
})
|
|
797
|
+
if (!cardParams || !result || cardRes.data.Err || cardRes.data.Exception) {
|
|
798
|
+
// 写卡异常
|
|
799
|
+
// 数据回滚操作
|
|
800
|
+
throw `卡服务错误:${cardRes.data.Err}${cardRes.data.Exception},请联系开发人员处理!!`
|
|
801
|
+
} else {
|
|
802
|
+
// 写卡成功
|
|
803
|
+
// 更新卡密码
|
|
804
|
+
await Vue.CommonService.updatePassword(row, cardRes)
|
|
805
|
+
Vue.showAlert('初始化卡成功', 'success', 2000)
|
|
806
|
+
return result
|
|
807
|
+
}
|
|
808
|
+
} else {
|
|
809
|
+
throw new Error(`请检查卡是否插好!!`)
|
|
810
|
+
}
|
|
811
|
+
} catch (error) {
|
|
812
|
+
if (result) {
|
|
813
|
+
// 出错进行回滚
|
|
814
|
+
row.f_userfiles_id = row.f_userfiles_id + ''
|
|
815
|
+
if (result) {
|
|
816
|
+
await Vue.resetpost('rs/logic/salecardrollback', {data: {id: result.data.id, row: row}}, {
|
|
817
|
+
resolveMsg: null,
|
|
818
|
+
rejectMsg: '写卡失败,数据回滚失败,请联系技术人员处理!!'
|
|
819
|
+
})
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
if (error.data) {
|
|
823
|
+
throw new Error(error.data)
|
|
824
|
+
} else {
|
|
825
|
+
throw error
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
let sendCardSaleGasGen = async function (model, row) {
|
|
831
|
+
// 1.存库 2.写卡
|
|
832
|
+
let result = null
|
|
833
|
+
try {
|
|
834
|
+
let cardState = await hasCardGen()
|
|
835
|
+
console.log('判卡函数返回:', cardState)
|
|
836
|
+
if (JSON.parse(cardState.data).state === 1) {
|
|
837
|
+
// 获取卡号
|
|
838
|
+
let getCardNumber = {data: {cardNumber: null}}
|
|
839
|
+
if (!row.f_card_id) {
|
|
840
|
+
getCardNumber = await Vue.resetpost('rs/logic/getCardNumber', {data: {id: row.brand_id}}, {resolveMsg: null, rejectMsg: '发卡售气获取卡号失败!!'})
|
|
841
|
+
console.log('获取卡号、、', getCardNumber)
|
|
842
|
+
} else {
|
|
843
|
+
getCardNumber.data.cardNumber = row.f_card_id
|
|
844
|
+
console.log('档案自带卡号、、', getCardNumber)
|
|
845
|
+
}
|
|
846
|
+
if (getCardNumber.data.cardNumber) {
|
|
847
|
+
// 当卡的别名是泰鹏普通卡的时候卡号和表号一致
|
|
848
|
+
console.log('开始验证是不是泰鹏普通卡')
|
|
849
|
+
if (row.f_alias && row.f_alias.includes('SmartCard_TP')) {
|
|
850
|
+
model.cardNumber = row.f_meternumber
|
|
851
|
+
} else if (row.f_alias && row.f_alias.includes('LaiDeRF')) {
|
|
852
|
+
model.cardNumber = row.f_card_id
|
|
853
|
+
} else {
|
|
854
|
+
model.cardNumber = getCardNumber.data.cardNumber + ''
|
|
855
|
+
}
|
|
856
|
+
} else {
|
|
857
|
+
throw new Error('获取卡号失败!请核实参数管理中的卡号重新发卡售气。')
|
|
858
|
+
}
|
|
859
|
+
// 存库
|
|
860
|
+
result = await Vue.resetpost('rs/logic/sale_sendCardSaleGas_logic', {data: model}, {resolveMsg: null, rejectMsg: '发卡售气存库失败'})
|
|
861
|
+
console.log('发卡售气存库返回', result)
|
|
862
|
+
// 写卡
|
|
863
|
+
let cardParams = await getParamGen(result.data.cardnumber, row.f_alias, row.f_user_id, row.f_userfiles_id)
|
|
864
|
+
|
|
865
|
+
// 组织写卡数据
|
|
866
|
+
let params = {
|
|
867
|
+
factory: row.f_alias,
|
|
868
|
+
kmm: '0', // 2019-12-22 查旭说的。给一个0 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
|
|
869
|
+
kzt: '0', // 卡状态,0开户卡,1用户卡(0新开户,1补卡)
|
|
870
|
+
kh: result.data.cardnumber, // 卡号
|
|
871
|
+
yhh: row.f_meterid ? row.f_meterid : 0, // 用户号,档案中自己输
|
|
872
|
+
ql: model.f_pregas, // 预购气量
|
|
873
|
+
csql: '0', // 上次购气量,新开户为0
|
|
874
|
+
ccsql: '0', // 上上次购气量,新开户为0
|
|
875
|
+
cs: '1', // 求购气次数,先开户为1
|
|
876
|
+
// ljgql: model.f_pregas, // 当前累计购气量
|
|
877
|
+
bkcs: '0', // 新开户卡,为0
|
|
878
|
+
ljyql: '0', // 累积用气量,有些表要累加原来用气量,新开户卡,为0
|
|
879
|
+
bjql: row.f_police_gas, // 报警气量,t_gasbrand表中
|
|
880
|
+
czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
|
|
881
|
+
tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
|
|
882
|
+
cssqrq: '0', // 上次售气日期,格式为YYYYMMDD
|
|
883
|
+
meterid: row.f_meternumber, // 表号
|
|
884
|
+
money: model.f_write_money, // 购气金额
|
|
885
|
+
dqdm: row.f_area_code, // 精益工业地区代码
|
|
886
|
+
klx: row.f_coding,
|
|
887
|
+
ljgql: (row.f_write_totalgas - 0) + (model.f_pregas - 0), // 当前累计购气量
|
|
888
|
+
ljgqje: (row.f_write_totalfee - 0) + (model.f_write_money - 0) // 累计购气金额
|
|
889
|
+
}
|
|
890
|
+
// 天源表发卡售气时,cs默认给0
|
|
891
|
+
if (row.f_alias && row.f_alias.includes('TianYuan')) {
|
|
892
|
+
console.log('天源表发卡售气时,写卡次数给:', params.cs)
|
|
893
|
+
params.cs = '0'
|
|
894
|
+
}
|
|
895
|
+
// 判断是否是累购表
|
|
896
|
+
if (row.f_support_purchase === '是') {
|
|
897
|
+
params.ljgql = (row.f_write_totalgas - 0) + (model.f_pregas - 0)
|
|
898
|
+
params.ljgqje = (row.f_write_totalfee - 0) + (model.f_preamount - 0)
|
|
899
|
+
}
|
|
900
|
+
params = Object.assign({}, Vue.CommonService.writeCardParams(cardParams), params)
|
|
901
|
+
console.log('发卡售气写卡参数', params)
|
|
902
|
+
let cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params, {
|
|
903
|
+
resolveMsg: null,
|
|
904
|
+
rejectMsg: '开户卡服务错误'
|
|
905
|
+
})
|
|
906
|
+
if (!cardParams || !result || cardRes.data.Err || cardRes.data.Exception) {
|
|
907
|
+
// 写卡异常
|
|
908
|
+
// 数据回滚操作
|
|
909
|
+
throw `卡服务错误:${cardRes.data.Err}${cardRes.data.Exception},请联系开发人员处理!!`
|
|
910
|
+
} else {
|
|
911
|
+
// 写卡成功
|
|
912
|
+
// 更新卡密码
|
|
913
|
+
await Vue.CommonService.updatePassword(row, cardRes)
|
|
914
|
+
Vue.showAlert('发卡售气成功', 'success', 2000)
|
|
915
|
+
return result
|
|
916
|
+
}
|
|
917
|
+
} else {
|
|
918
|
+
throw new Error(`请检查卡是否插好!!`)
|
|
919
|
+
}
|
|
920
|
+
} catch (error) {
|
|
921
|
+
if (result) {
|
|
922
|
+
// 出错进行回滚
|
|
923
|
+
row.f_userfiles_id = row.f_userfiles_id + ''
|
|
924
|
+
if (result) {
|
|
925
|
+
await Vue.resetpost('rs/logic/salecardrollback', {data: {id: result.data.id, row: row}}, {
|
|
926
|
+
resolveMsg: null,
|
|
927
|
+
rejectMsg: '写卡失败,数据回滚失败,请联系技术人员处理!!'
|
|
928
|
+
})
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
if (error.data) {
|
|
932
|
+
throw new Error(error.data)
|
|
933
|
+
} else {
|
|
934
|
+
throw error
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
let replaceCardGen2 = function * (model, row, allot) {
|
|
940
|
+
let result = yield co(reissueCardGen(model, row))
|
|
941
|
+
let data = {
|
|
942
|
+
userfiles: {},
|
|
943
|
+
record: {
|
|
944
|
+
id: result.data.id,
|
|
945
|
+
f_state: '有效'
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
return yield Vue.resetpost('rs/logic/updatemark', {data: data}, {resolveMsg: '补卡成功', rejectMsg: '补卡修改状态失败'})
|
|
949
|
+
}
|
|
950
|
+
// 物联网表发卡管理
|
|
951
|
+
let replaceCardGenWeb = function * (model, row) {
|
|
952
|
+
let result = null
|
|
953
|
+
let allotback
|
|
954
|
+
try {
|
|
955
|
+
// 判断是否有卡
|
|
956
|
+
let cardState = yield co(hasCardGen())
|
|
957
|
+
if (JSON.parse(cardState.data).state === 1) {
|
|
958
|
+
let cardId = ''
|
|
959
|
+
if (row.f_card_id && row.f_card_id !== 'null') {
|
|
960
|
+
cardId = row.f_card_id
|
|
961
|
+
} else {
|
|
962
|
+
let getCardNumber = yield co(getCardNumberGen(row.f_gasbrand_id))
|
|
963
|
+
console.log('获取卡号、、', getCardNumber)
|
|
964
|
+
cardId = getCardNumber.data.cardNumber
|
|
965
|
+
}
|
|
966
|
+
if (row.f_tag) {
|
|
967
|
+
// 截取用户编号后四位
|
|
968
|
+
cardId = row.f_tag + row.f_card_id
|
|
969
|
+
}
|
|
970
|
+
model.f_card_id = cardId
|
|
971
|
+
// 存库
|
|
972
|
+
result = yield co(reissueCardGenJB(model, row))
|
|
973
|
+
// 获取气价和售气情况参数
|
|
974
|
+
let cardParams = yield co(getParamGen(cardId, row.f_alias, row.f_user_id, row.f_userfiles_id))
|
|
975
|
+
// 写卡
|
|
976
|
+
let params = {
|
|
977
|
+
factory: row.f_alias,
|
|
978
|
+
kh: cardId, // 卡号
|
|
979
|
+
kmm: row.f_card_password, // 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
|
|
980
|
+
bjql: row.f_police_gas, // 报警气量,t_gasbrand表中
|
|
981
|
+
czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
|
|
982
|
+
tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
|
|
983
|
+
ljgql: (row.f_total_gas - 0), // 当前累计购气量
|
|
984
|
+
ljgqje: (row.f_total_fee - 0), // 累计购气金额
|
|
985
|
+
kzt: '1', // 卡状态,0开户卡,1用户卡(0新开户,1补卡)
|
|
986
|
+
bkcs: row.f_fillcard_times + 1, // 补卡次数,从补卡表里通过表编号获得
|
|
987
|
+
cs: row.f_times, // 求购气次数,先开户为1
|
|
988
|
+
yhh: row.f_meterid ? row.f_meterid : 0, // 用户号
|
|
989
|
+
meterid: row.f_meternumber, // 表号
|
|
990
|
+
meternumber: row.f_meternumber,
|
|
991
|
+
dqdm: row.f_area_code, // 精益工业地区代码
|
|
992
|
+
money: 0, // 购气金额
|
|
993
|
+
klx: row.f_coding
|
|
994
|
+
}
|
|
995
|
+
// 判断是否是累购表
|
|
996
|
+
if (row.f_support_purchase === '是') {
|
|
997
|
+
params.ljgql = (row.f_write_totalgas - 0) + (model.f_pregas - 0)
|
|
998
|
+
params.ljgqje = (row.f_write_totalfee - 0) + (model.f_preamount - 0)
|
|
999
|
+
}
|
|
1000
|
+
params = Object.assign({}, Vue.CommonService.writeCardParams(cardParams), params)
|
|
1001
|
+
console.log('补卡是写的次数。。。。', params)
|
|
1002
|
+
let cardRes = yield co(Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params, {
|
|
1003
|
+
resolveMsg: null,
|
|
1004
|
+
rejectMsg: '补卡卡服务错误'
|
|
1005
|
+
}))
|
|
1006
|
+
// 卡服务写卡异常,业务逻辑回滚
|
|
1007
|
+
if (!cardParams || !result || cardRes.data.Err || cardRes.data.Exception) {
|
|
1008
|
+
Vue.$showAlert('物联网表补卡失败!!', 'danger', 0)
|
|
1009
|
+
let rollbackParam = {
|
|
1010
|
+
id: result.data.id,
|
|
1011
|
+
f_card_id: row.f_card_id,
|
|
1012
|
+
f_whether_hairpin: row.f_whether_hairpin,
|
|
1013
|
+
f_user_id: row.f_user_id
|
|
1014
|
+
}
|
|
1015
|
+
if (row.f_tag) {
|
|
1016
|
+
rollbackParam.f_tag = row.f_tag
|
|
1017
|
+
}
|
|
1018
|
+
yield Vue.resetpost('rs/logic/repairCardRoolBack', {data: rollbackParam}, {
|
|
1019
|
+
resolveMsg: null,
|
|
1020
|
+
rejectMsg: null
|
|
1021
|
+
})
|
|
1022
|
+
} else {
|
|
1023
|
+
// 如果成功修改标识(更新状态为有效)
|
|
1024
|
+
// 没有更新过表档案,这里版本号减一
|
|
1025
|
+
row.version = (row.version - 0) - 1
|
|
1026
|
+
yield co(Vue.CommonService.updatePassword(row, cardRes))
|
|
1027
|
+
let data = {
|
|
1028
|
+
userfiles: {
|
|
1029
|
+
f_card_id: row.f_card_id,
|
|
1030
|
+
f_whether_hairpin: '已发'
|
|
1031
|
+
},
|
|
1032
|
+
record: {
|
|
1033
|
+
id: result.data.id,
|
|
1034
|
+
f_state: '有效'
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
return yield Vue.resetpost('rs/logic/updatemark', {data: data}, {resolveMsg: '物联网表补卡成功', rejectMsg: '补卡修改状态失败'})
|
|
1038
|
+
}
|
|
1039
|
+
} else {
|
|
1040
|
+
Vue.showAlert('请检查卡是否插好!!', 'danger', 3000)
|
|
1041
|
+
}
|
|
1042
|
+
} catch (error) {
|
|
1043
|
+
let msg = ''
|
|
1044
|
+
if (error.status === 612) {
|
|
1045
|
+
msg = '请检查读卡器时候连接,或者卡服务是否启动!!'
|
|
1046
|
+
} else {
|
|
1047
|
+
msg = '补卡失败!!'
|
|
1048
|
+
|
|
1049
|
+
let rollbackParam = {
|
|
1050
|
+
id: result.data.id,
|
|
1051
|
+
f_card_id: null,
|
|
1052
|
+
f_whether_hairpin: row.f_whether_hairpin,
|
|
1053
|
+
f_user_id: row.f_user_id
|
|
1054
|
+
}
|
|
1055
|
+
if (row.f_tag) {
|
|
1056
|
+
rollbackParam.f_tag = row.f_tag
|
|
1057
|
+
}
|
|
1058
|
+
yield Vue.resetpost('rs/logic/repairCardRoolBack', {data: rollbackParam}, {
|
|
1059
|
+
resolveMsg: null,
|
|
1060
|
+
rejectMsg: '物联网表补卡失败!!'
|
|
1061
|
+
})
|
|
1062
|
+
}
|
|
1063
|
+
Vue.showAlert(msg, 'danger', 0)
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
// 机表补卡管理
|
|
1067
|
+
let replaceCardGenJB = function * (model, row) {
|
|
1068
|
+
let result = null
|
|
1069
|
+
let allotback
|
|
1070
|
+
try {
|
|
1071
|
+
// 判断是否有卡
|
|
1072
|
+
let cardState = yield co(hasCardGen())
|
|
1073
|
+
if (JSON.parse(cardState.data).state === 1) {
|
|
1074
|
+
let cardId = row.f_card_id
|
|
1075
|
+
if (row.f_tag) {
|
|
1076
|
+
// 截取用户编号后四位
|
|
1077
|
+
cardId = row.f_tag + row.f_card_id
|
|
1078
|
+
}
|
|
1079
|
+
model.f_card_id = cardId
|
|
1080
|
+
// 存库
|
|
1081
|
+
result = yield co(reissueCardGenJB(model, row))
|
|
1082
|
+
// 获取气价和售气情况参数
|
|
1083
|
+
let cardParams = yield co(getParamGen(cardId, row.f_alias, row.f_user_id, row.f_userfiles_id))
|
|
1084
|
+
// 写卡
|
|
1085
|
+
let params = {
|
|
1086
|
+
factory: row.f_alias,
|
|
1087
|
+
kh: cardId, // 卡号
|
|
1088
|
+
kmm: row.f_card_password, // 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
|
|
1089
|
+
bjql: row.f_police_gas, // 报警气量,t_gasbrand表中
|
|
1090
|
+
czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
|
|
1091
|
+
tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
|
|
1092
|
+
ljgql: (row.f_total_gas - 0) + (model.f_pregas - 0), // 当前累计购气量
|
|
1093
|
+
ljgqje: (row.f_total_fee - 0) + (model.f_preamount - 0), // 累计购气金额
|
|
1094
|
+
kzt: '1', // 卡状态,0开户卡,1用户卡(0新开户,1补卡)
|
|
1095
|
+
bkcs: row.f_fillcard_times + 1, // 补卡次数,从补卡表里通过表编号获得
|
|
1096
|
+
cs: row.f_times, // 求购气次数,先开户为1
|
|
1097
|
+
yhh: row.f_meterid ? row.f_meterid : 0, // 用户号
|
|
1098
|
+
meterid: row.f_meternumber, // 表号
|
|
1099
|
+
meternumber: row.f_meternumber,
|
|
1100
|
+
dqdm: row.f_area_code, // 精益工业地区代码
|
|
1101
|
+
money: 0, // 购气金额
|
|
1102
|
+
klx: row.f_coding
|
|
1103
|
+
}
|
|
1104
|
+
// 判断是否是累购表
|
|
1105
|
+
if (row.f_support_purchase === '是') {
|
|
1106
|
+
params.ljgql = (row.f_write_totalgas - 0) + (model.f_pregas - 0)
|
|
1107
|
+
params.ljgqje = (row.f_write_totalfee - 0) + (model.f_preamount - 0)
|
|
1108
|
+
}
|
|
1109
|
+
params = Object.assign({}, Vue.CommonService.writeCardParams(cardParams), params)
|
|
1110
|
+
console.log('补卡是写的次数。。。。', params)
|
|
1111
|
+
let cardRes = yield co(Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params, {
|
|
1112
|
+
resolveMsg: null,
|
|
1113
|
+
rejectMsg: '补卡卡服务错误'
|
|
1114
|
+
}))
|
|
1115
|
+
// 卡服务写卡异常,业务逻辑回滚
|
|
1116
|
+
if (!cardParams || !result || cardRes.data.Err || cardRes.data.Exception) {
|
|
1117
|
+
Vue.$showAlert('机表补卡失败!!', 'danger', 0)
|
|
1118
|
+
let rollbackParam = {
|
|
1119
|
+
id: result.data.id,
|
|
1120
|
+
f_card_id: row.f_card_id,
|
|
1121
|
+
f_whether_hairpin: row.f_whether_hairpin,
|
|
1122
|
+
f_user_id: row.f_user_id
|
|
1123
|
+
}
|
|
1124
|
+
if (row.f_tag) {
|
|
1125
|
+
rollbackParam.f_tag = row.f_tag
|
|
1126
|
+
}
|
|
1127
|
+
yield Vue.resetpost('rs/logic/repairCardRoolBack', {data: rollbackParam}, {
|
|
1128
|
+
resolveMsg: null,
|
|
1129
|
+
rejectMsg: null
|
|
1130
|
+
})
|
|
1131
|
+
} else {
|
|
1132
|
+
// 如果成功修改标识(更新状态为有效)
|
|
1133
|
+
// 没有更新过表档案,这里版本号减一
|
|
1134
|
+
row.version = (row.version - 0) - 1
|
|
1135
|
+
yield co(Vue.CommonService.updatePassword(row, cardRes))
|
|
1136
|
+
let data = {
|
|
1137
|
+
userfiles: {
|
|
1138
|
+
f_card_id: row.f_card_id,
|
|
1139
|
+
f_whether_hairpin: '已发'
|
|
1140
|
+
},
|
|
1141
|
+
record: {
|
|
1142
|
+
id: result.data.id,
|
|
1143
|
+
f_state: '有效'
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
return yield Vue.resetpost('rs/logic/updatemark', {data: data}, {resolveMsg: '机表补卡成功', rejectMsg: '补卡修改状态失败'})
|
|
1147
|
+
}
|
|
1148
|
+
} else {
|
|
1149
|
+
Vue.showAlert('请检查卡是否插好!!', 'danger', 3000)
|
|
1150
|
+
}
|
|
1151
|
+
} catch (error) {
|
|
1152
|
+
let msg = ''
|
|
1153
|
+
if (error.status === 612) {
|
|
1154
|
+
msg = '请检查读卡器时候连接,或者卡服务是否启动!!'
|
|
1155
|
+
} else {
|
|
1156
|
+
msg = '补卡失败!!'
|
|
1157
|
+
|
|
1158
|
+
let rollbackParam = {
|
|
1159
|
+
id: result.data.id,
|
|
1160
|
+
f_card_id: null,
|
|
1161
|
+
f_whether_hairpin: row.f_whether_hairpin,
|
|
1162
|
+
f_user_id: row.f_user_id
|
|
1163
|
+
}
|
|
1164
|
+
if (row.f_tag) {
|
|
1165
|
+
rollbackParam.f_tag = row.f_tag
|
|
1166
|
+
}
|
|
1167
|
+
yield Vue.resetpost('rs/logic/repairCardRoolBack', {data: rollbackParam}, {
|
|
1168
|
+
resolveMsg: null,
|
|
1169
|
+
rejectMsg: '机表补卡失败!!'
|
|
1170
|
+
})
|
|
1171
|
+
}
|
|
1172
|
+
Vue.showAlert(msg, 'danger', 0)
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
// 擦虚气
|
|
1176
|
+
let replaceXq = function * (model, row) {
|
|
1177
|
+
let result = null
|
|
1178
|
+
let cardState = yield co(hasCardGen())
|
|
1179
|
+
if (JSON.parse(cardState.data).state === 1) {
|
|
1180
|
+
let params = {
|
|
1181
|
+
factory: row.f_alias,
|
|
1182
|
+
kh: row.f_card_id, // 卡号
|
|
1183
|
+
kmm: row.f_card_password, // 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
|
|
1184
|
+
bjql: row.f_police_gas, // 报警气量,t_gasbrand表中
|
|
1185
|
+
czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
|
|
1186
|
+
tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
|
|
1187
|
+
ljgql: (row.f_total_gas - 0), // 当前累计购气量
|
|
1188
|
+
ljgqje: (row.f_total_fee - 0), // 累计购气金额
|
|
1189
|
+
kzt: '1', // 卡状态,0开户卡,1用户卡(0新开户,1补卡)
|
|
1190
|
+
bkcs: row.f_fillcard_times + 1, // 补卡次数,从补卡表里通过表编号获得
|
|
1191
|
+
cs: row.f_times, // 求购气次数,先开户为1
|
|
1192
|
+
yhh: row.f_meterid ? row.f_meterid : 0, // 用户号
|
|
1193
|
+
meterid: row.f_meternumber, // 表号
|
|
1194
|
+
meternumber: row.f_meternumber,
|
|
1195
|
+
dqdm: row.f_area_code, // 精益工业地区代码
|
|
1196
|
+
money: 0, // 购气金额
|
|
1197
|
+
klx: row.f_coding
|
|
1198
|
+
}
|
|
1199
|
+
let cardRes = yield co(Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params, {
|
|
1200
|
+
resolveMsg: null,
|
|
1201
|
+
rejectMsg: '擦虚气服务错误'
|
|
1202
|
+
}))
|
|
1203
|
+
if (cardRes.data.Err || cardRes.data.Exception) {
|
|
1204
|
+
return {status: 1}
|
|
1205
|
+
} else {
|
|
1206
|
+
return {status: 0}
|
|
1207
|
+
}
|
|
1208
|
+
} else {
|
|
1209
|
+
Vue.showAlert('请检查卡是否插好!!', 'danger', 3000)
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
// 补卡管理
|
|
1214
|
+
let replaceCardGen = function * (model, row, allot) {
|
|
1215
|
+
let result = null
|
|
1216
|
+
let allotback
|
|
1217
|
+
try {
|
|
1218
|
+
// 判断是否有卡
|
|
1219
|
+
let cardState = yield co(hasCardGen())
|
|
1220
|
+
if (JSON.parse(cardState.data).state === 1) {
|
|
1221
|
+
let cardId = row.f_card_id
|
|
1222
|
+
// 如果当前是物联网表,表未发卡,进行补需要获取卡号
|
|
1223
|
+
if (!(row.f_hascard == null) && !(row.f_share_times == null) && row.f_meter_type === '物联网表' && row.f_hascard === '是' && row.f_share_times === '是' && (row.f_card_id == null || row.f_card_id === '')) {
|
|
1224
|
+
let getCardNumber = yield Vue.resetpost('rs/logic/getCardNumber', {data: {id: row.brand_id}}, {resolveMsg: null, rejectMsg: '发卡售气获取卡号失败!!'})
|
|
1225
|
+
console.log('获取卡号、、', getCardNumber)
|
|
1226
|
+
if (getCardNumber.data.cardNumber) {
|
|
1227
|
+
cardId = getCardNumber.data.cardNumber
|
|
1228
|
+
} else {
|
|
1229
|
+
throw new Error('获取卡号失败!请核实参数管理中的卡号重新发卡售气。')
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
if (row.f_tag) {
|
|
1233
|
+
// 截取用户编号后四位
|
|
1234
|
+
cardId = row.f_tag + row.f_card_id
|
|
1235
|
+
}
|
|
1236
|
+
model.f_card_id = cardId
|
|
1237
|
+
// 存库
|
|
1238
|
+
result = yield co(reissueCardGen(model, row))
|
|
1239
|
+
if (allot) {
|
|
1240
|
+
allotback = yield Vue.resetpost('rs/logic/saveAllotData', {data: allot}, {
|
|
1241
|
+
resolveMsg: null,
|
|
1242
|
+
rejectMsg: '更新发卡信息失败'
|
|
1243
|
+
})
|
|
1244
|
+
}
|
|
1245
|
+
// 获取气价和售气情况参数
|
|
1246
|
+
let cardParams = yield co(getParamGen(cardId, row.f_alias, row.f_user_id, row.f_userfiles_id))
|
|
1247
|
+
console.log('补卡是写的次数111。。。。', row, model)
|
|
1248
|
+
// 写卡
|
|
1249
|
+
let params = {
|
|
1250
|
+
factory: row.f_alias,
|
|
1251
|
+
kh: cardId, // 卡号
|
|
1252
|
+
kmm: row.f_card_password, // 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
|
|
1253
|
+
bjql: row.f_police_gas, // 报警气量,t_gasbrand表中
|
|
1254
|
+
czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
|
|
1255
|
+
tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
|
|
1256
|
+
ljgql: (row.f_total_gas - 0), // 当前累计购气量
|
|
1257
|
+
ljgqje: (row.f_total_fee - 0), // 累计购气金额
|
|
1258
|
+
kzt: '1', // 卡状态,0开户卡,1用户卡(0新开户,1补卡)
|
|
1259
|
+
bkcs: row.f_fillcard_times + 1, // 补卡次数,从补卡表里通过表编号获得
|
|
1260
|
+
cs: row.f_times, // 求购气次数,先开户为1
|
|
1261
|
+
yhh: row.f_meterid ? row.f_meterid : 0, // 用户号
|
|
1262
|
+
meterid: row.f_meternumber, // 表号
|
|
1263
|
+
meternumber: row.f_meternumber,
|
|
1264
|
+
dqdm: row.f_area_code, // 精益工业地区代码
|
|
1265
|
+
money: 0, // 购气金额
|
|
1266
|
+
klx: row.f_coding
|
|
1267
|
+
}
|
|
1268
|
+
// 判断是否是累购表
|
|
1269
|
+
if (row.f_support_purchase === '是') {
|
|
1270
|
+
params.ljgql = (row.f_write_totalgas - 0)
|
|
1271
|
+
params.ljgqje = (row.f_write_totalfee - 0)
|
|
1272
|
+
}
|
|
1273
|
+
// 判断是否接表,如果未接表(次数减一)已过表(次数为档案里面的次数) 针对不补气的
|
|
1274
|
+
if (model.f_ispick_table) {
|
|
1275
|
+
params.cs = (model.f_ispick_table === '未过表' ? row.f_times - 1 : row.f_times)
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
params = Object.assign({}, Vue.CommonService.writeCardParams(cardParams), params)
|
|
1279
|
+
// if (row.f_alias === 'HaiLiJE' || row.f_alias === 'HaiLiQL' || row.f_alias === 'CangNanTY') {
|
|
1280
|
+
// params.klx = yield co(getmodelbrandGen(row))
|
|
1281
|
+
// params.klx = params.klx.data[0].f_coding
|
|
1282
|
+
// }
|
|
1283
|
+
console.log('补卡是写的次数。。。。', params)
|
|
1284
|
+
|
|
1285
|
+
let cardRes = yield co(Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params, {
|
|
1286
|
+
resolveMsg: null,
|
|
1287
|
+
rejectMsg: '补卡卡服务错误'
|
|
1288
|
+
}))
|
|
1289
|
+
// 卡服务写卡异常,业务逻辑回滚
|
|
1290
|
+
if (!cardParams || !result || cardRes.data.Err || cardRes.data.Exception) {
|
|
1291
|
+
Vue.$showAlert('补卡失败!!', 'danger', 0)
|
|
1292
|
+
let rollbackParam = {
|
|
1293
|
+
id: result.data.id,
|
|
1294
|
+
f_card_id: row.f_card_id,
|
|
1295
|
+
f_user_id: row.f_user_id
|
|
1296
|
+
}
|
|
1297
|
+
if (row.f_tag) {
|
|
1298
|
+
rollbackParam.f_tag = row.f_tag
|
|
1299
|
+
}
|
|
1300
|
+
yield Vue.resetpost('rs/logic/repairCardRoolBack', {data: rollbackParam}, {
|
|
1301
|
+
resolveMsg: null,
|
|
1302
|
+
rejectMsg: null
|
|
1303
|
+
})
|
|
1304
|
+
// 更新卡状态为作废
|
|
1305
|
+
if (allot) {
|
|
1306
|
+
yield Vue.resetpost('rs/logic/allotDataRollback', {data: allotback.data}, {resolveMsg: null, rejectMsg: null})
|
|
1307
|
+
}
|
|
1308
|
+
} else {
|
|
1309
|
+
// 如果成功修改标识(更新状态为有效)
|
|
1310
|
+
// 没有更新过表档案,这里版本号减一
|
|
1311
|
+
row.version = (row.version - 0) - 1
|
|
1312
|
+
yield co(Vue.CommonService.updatePassword(row, cardRes))
|
|
1313
|
+
let data = {
|
|
1314
|
+
userfiles: {},
|
|
1315
|
+
record: {
|
|
1316
|
+
id: result.data.id,
|
|
1317
|
+
f_state: '有效'
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
return yield Vue.resetpost('rs/logic/updatemark', {data: data}, {resolveMsg: '补卡成功', rejectMsg: '补卡修改状态失败'})
|
|
1321
|
+
}
|
|
1322
|
+
} else {
|
|
1323
|
+
Vue.showAlert('请检查卡是否插好!!', 'danger', 3000)
|
|
1324
|
+
}
|
|
1325
|
+
} catch (error) {
|
|
1326
|
+
let msg = ''
|
|
1327
|
+
if (error.status === 612) {
|
|
1328
|
+
msg = '请检查读卡器时候连接,或者卡服务是否启动!!'
|
|
1329
|
+
} else {
|
|
1330
|
+
msg = '补卡失败!!'
|
|
1331
|
+
|
|
1332
|
+
let rollbackParam = {
|
|
1333
|
+
id: result.data.id,
|
|
1334
|
+
f_card_id: row.f_card_id,
|
|
1335
|
+
f_user_id: row.f_user_id
|
|
1336
|
+
}
|
|
1337
|
+
if (row.f_tag) {
|
|
1338
|
+
rollbackParam.f_tag = row.f_tag
|
|
1339
|
+
}
|
|
1340
|
+
yield Vue.resetpost('rs/logic/repairCardRoolBack', {data: rollbackParam}, {
|
|
1341
|
+
resolveMsg: null,
|
|
1342
|
+
rejectMsg: '补卡失败!!'
|
|
1343
|
+
})
|
|
1344
|
+
}
|
|
1345
|
+
// 更新卡状态为作废
|
|
1346
|
+
if (allot) {
|
|
1347
|
+
yield Vue.resetpost('rs/logic/allotDataRollback', {data: allotback.data}, {resolveMsg: null, rejectMsg: null})
|
|
1348
|
+
}
|
|
1349
|
+
Vue.showAlert(msg, 'danger', 0)
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
let offlineWriteGen2 = async function (row) {
|
|
1354
|
+
let update = {
|
|
1355
|
+
id: row.unWriteSell[0].id,
|
|
1356
|
+
f_write_operator: Vue.$login.f.name,
|
|
1357
|
+
f_write_date: Vue.$login.toStandardTimeString()
|
|
1358
|
+
}
|
|
1359
|
+
await Vue.resetpost('rs/logic/offlineWrite', update, {resolveMsg: '写卡成功', rejectMsg: '写卡成功,更新数据失败'})
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
let offlineWriteGen = async function (row) {
|
|
1363
|
+
console.log('线下写卡', row)
|
|
1364
|
+
try {
|
|
1365
|
+
// 写卡前调用(该为特殊业务逻辑根据需要写到project工程) (有些第三方缴费柜台写卡,用户缴费之后,如果在规定时间内不写卡,就会进行退款。所以写卡前调用第三方锁定订单。写卡成功或失败调用对应的接口告知第三方)
|
|
1366
|
+
|
|
1367
|
+
let beforeParam = {
|
|
1368
|
+
id: row.unWriteSell[0].id,
|
|
1369
|
+
f_operatorid: Vue.$login.f.id,
|
|
1370
|
+
f_depid: Vue.$login.f.depids
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
await Vue.resetpost('rs/logic/sale_write_before', {data: beforeParam}, {resolveMsg: null, rejectMsg: '线下写卡前调用第三方失败!!'})
|
|
1374
|
+
|
|
1375
|
+
let cardState = await hasCardGen()
|
|
1376
|
+
if (JSON.parse(cardState.data).state === 1) {
|
|
1377
|
+
// 获取
|
|
1378
|
+
let result = await Vue.resetpost('rs/logic/sale_getLastOper', {data: {f_userfiles_id: row.f_userfiles_id}}, {resolveMsg: null, rejectMsg: '获取最后一次操作失败'})
|
|
1379
|
+
console.log('获取最后一次的操作。。', result)
|
|
1380
|
+
// 先把收费记录状态改成 已写卡在进行操作
|
|
1381
|
+
// 写卡成功 更新收费记录
|
|
1382
|
+
let update = {
|
|
1383
|
+
id: row.unWriteSell[0].id,
|
|
1384
|
+
f_write_comments: !row.f_write_comments ? '' : row.f_write_comments,
|
|
1385
|
+
f_write_operator: Vue.$login.f.name,
|
|
1386
|
+
f_write_date: Vue.$login.toStandardTimeString()
|
|
1387
|
+
}
|
|
1388
|
+
await Vue.resetpost('rs/logic/offlineWrite', update, {resolveMsg: '写卡成功', rejectMsg: '写卡成功,更新数据失败'})
|
|
1389
|
+
let cardid = row.f_card_id
|
|
1390
|
+
if (row.f_tag) {
|
|
1391
|
+
// 截取用户编号后四位
|
|
1392
|
+
cardid = row.f_tag + row.f_card_id
|
|
1393
|
+
}
|
|
1394
|
+
// 执行写卡操作
|
|
1395
|
+
let cardParams = await getParamGen(row.f_card_id, row.f_alias, row.f_user_id, row.f_userfiles_id)
|
|
1396
|
+
let param = {
|
|
1397
|
+
factory: row.f_alias,
|
|
1398
|
+
kh: cardid,
|
|
1399
|
+
cs: row.unWriteSell[0].f_times,
|
|
1400
|
+
yhh: row.cardInfo.Yhh ? row.cardInfo.Yhh : row.f_meterid,
|
|
1401
|
+
meterid: row.f_meternumber ? row.f_meternumber : 0,
|
|
1402
|
+
meternumber: row.f_meternumber ? row.f_meternumber : 0,
|
|
1403
|
+
kmm: row.f_card_password,
|
|
1404
|
+
ljgql: (row.f_write_totalgas - 0), // 当前累计购气量
|
|
1405
|
+
ljgqje: (row.f_write_totalfee - 0), // 累计购气金额
|
|
1406
|
+
bjql: row.f_police_gas,
|
|
1407
|
+
czsx: row.f_topup_ceil,
|
|
1408
|
+
tzed: row.f_overdr_lines,
|
|
1409
|
+
bkcs: row.f_fillcard_times,
|
|
1410
|
+
dqdm: row.f_area_code,
|
|
1411
|
+
klx: row.f_coding,
|
|
1412
|
+
ql: row.unWriteSell[0].f_pregas,
|
|
1413
|
+
money: row.unWriteSell[0].f_write_money
|
|
1414
|
+
}
|
|
1415
|
+
param = Object.assign({}, Vue.CommonService.writeCardParams(cardParams), param)
|
|
1416
|
+
let cardRes
|
|
1417
|
+
if (result.data.last_oper == null) result.data.last_oper = ''
|
|
1418
|
+
if (row.states === '补卡' || result.data.last_oper === '补卡') {
|
|
1419
|
+
param.kzt = result.data.ispick === '未过表' && result.data.lastsell_oper === '发卡售气' ? '0' : '1'
|
|
1420
|
+
param.cs = row.cardInfo.Times + 1
|
|
1421
|
+
param.bkcs = param.bkcs + 1
|
|
1422
|
+
cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', param, {resolveMsg: null, rejectMsg: '写卡失败'})
|
|
1423
|
+
} else if (row.states === '换表') {
|
|
1424
|
+
param.kzt = '0'
|
|
1425
|
+
param.bkcs = param.bkcs + 1
|
|
1426
|
+
param.cs = 1
|
|
1427
|
+
cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', param, {resolveMsg: null, rejectMsg: '写卡失败'})
|
|
1428
|
+
} else {
|
|
1429
|
+
cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', param, {resolveMsg: null, rejectMsg: '写卡失败'})
|
|
1430
|
+
}
|
|
1431
|
+
if (!cardParams || cardRes.data.Err || cardRes.data.Exception) {
|
|
1432
|
+
let sql = `update t_sellinggas set
|
|
1433
|
+
f_write_card = '未写卡'
|
|
1434
|
+
where id = '${row.unWriteSell[0].id}'`
|
|
1435
|
+
let data = {
|
|
1436
|
+
sql: sql
|
|
1437
|
+
}
|
|
1438
|
+
await Vue.resetpost('rs/logic/runSQL', data)
|
|
1439
|
+
throw new Error(`卡服务错误:${cardRes.data.Err}${cardRes.data.Exception},请联系开发人员处理!!`)
|
|
1440
|
+
}
|
|
1441
|
+
} else {
|
|
1442
|
+
Vue.showAlert('请检查卡是否插好!!', 'danger', 3000)
|
|
1443
|
+
}
|
|
1444
|
+
} catch (error) {
|
|
1445
|
+
// 考虑到这里报错可能是因为 写卡请求超时报的错,但是请求已经发到卡服务,可能已经写上卡,所以先不做处理
|
|
1446
|
+
// let sql = `update t_sellinggas set
|
|
1447
|
+
// f_write_card = '未写卡',
|
|
1448
|
+
// where id = '${row.unWriteSell[0].id}'`
|
|
1449
|
+
// let data = {
|
|
1450
|
+
// sql: sql
|
|
1451
|
+
// }
|
|
1452
|
+
// await this.$resetpost('rs/logic/runSQL', data)
|
|
1453
|
+
throw error
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
let DigtialSellGasGen = async function (model, row) {
|
|
1458
|
+
try {
|
|
1459
|
+
let result = await Vue.resetpost('rs/logic/sale_digtialCharge_logic', {data: model}, {resolveMsg: '收费成功', rejectMsg: '卡表收费存库失败'})
|
|
1460
|
+
return result.data.id
|
|
1461
|
+
} catch (error) {
|
|
1462
|
+
if (error.data) {
|
|
1463
|
+
throw new Error(error.data)
|
|
1464
|
+
} else {
|
|
1465
|
+
throw error
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
let noCardSellGasGen = async function (model, row) {
|
|
1470
|
+
try {
|
|
1471
|
+
let result = await Vue.resetpost('rs/logic/sale_cardCharge_logic', {data: model}, {resolveMsg: '收费成功', rejectMsg: '卡表收费存库失败'})
|
|
1472
|
+
return result.data.id
|
|
1473
|
+
} catch (error) {
|
|
1474
|
+
if (error.data) {
|
|
1475
|
+
throw new Error(error.data)
|
|
1476
|
+
} else {
|
|
1477
|
+
throw error
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
// 补气卡表收费
|
|
1483
|
+
let sellgasRemanentGen = async function (model, row) {
|
|
1484
|
+
let result = null
|
|
1485
|
+
try {
|
|
1486
|
+
let cardState = await hasCardGen()
|
|
1487
|
+
if (JSON.parse(cardState.data).state === 1) {
|
|
1488
|
+
// 将卡上次数写入数据库
|
|
1489
|
+
model.f_times = row.cardInfo.Times + 1
|
|
1490
|
+
// 将回写表号或者用户号
|
|
1491
|
+
model.f_meterid = row.cardInfo.Yhh ? row.cardInfo.Yhh : row.f_meterid
|
|
1492
|
+
|
|
1493
|
+
let cardid = row.f_card_id
|
|
1494
|
+
if (row.f_tag) {
|
|
1495
|
+
// 截取用户编号后四位
|
|
1496
|
+
cardid = model.f_card_id = row.f_tag + row.f_card_id
|
|
1497
|
+
}
|
|
1498
|
+
result = await Vue.resetpost('rs/logic/sellgasRemanentGas', {data: model}, {resolveMsg: null, rejectMsg: '卡表收费存库失败'})
|
|
1499
|
+
// 获取气价和售气情况参数
|
|
1500
|
+
let cardParams = await getParamGen(cardid, row.f_alias, row.f_user_id, row.f_userfiles_id)
|
|
1501
|
+
console.log('写卡次数和获取的写卡参数...', row.cardInfo.Times, cardParams)
|
|
1502
|
+
// 写卡
|
|
1503
|
+
let params = {
|
|
1504
|
+
factory: row.f_alias, // 气表厂家
|
|
1505
|
+
kh: cardid, // 卡号
|
|
1506
|
+
yhh: row.f_meterid ? row.f_meterid : 0, // 用户号,档案中自己输
|
|
1507
|
+
kmm: row.f_card_password, // 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
|
|
1508
|
+
bjql: row.f_police_gas, // 报警气量,t_gasbrand表中
|
|
1509
|
+
czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
|
|
1510
|
+
tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
|
|
1511
|
+
ljgql: (row.f_write_totalgas - 0) + (model.f_pregas - 0), // 当前累计购气量
|
|
1512
|
+
ljgqje: (row.f_write_totalfee - 0) + (model.f_write_money - 0), // 累计购气金额
|
|
1513
|
+
bkcs: row.f_fillcard_times, // 补卡次数,从补卡表里通过表编号获得
|
|
1514
|
+
ql: model.f_pregas, // 预购气量
|
|
1515
|
+
cs: row.cardInfo.Times + 1, // 求购气次数,先开户为1
|
|
1516
|
+
money: model.f_write_money, // 购气金额
|
|
1517
|
+
meterid: row.f_meternumber ? row.f_meternumber : 0, // 表号
|
|
1518
|
+
dqdm: row.f_area_code, // 精益工业地区代码
|
|
1519
|
+
klx: row.f_coding
|
|
1520
|
+
}
|
|
1521
|
+
params = Object.assign({}, Vue.CommonService.writeCardParams(cardParams), params)
|
|
1522
|
+
console.log('购气最后操作。。', result)
|
|
1523
|
+
let cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', params, {resolveMsg: null, rejectMsg: '卡表收费失败'})
|
|
1524
|
+
console.log('卡表收费返回写卡参数值', cardRes)
|
|
1525
|
+
// 卡服务写卡异常,业务逻辑回滚
|
|
1526
|
+
if (!cardParams || ((model.f_pregas > model.f_remanent_gas) && !result) || cardRes.data.Err || cardRes.data.Exception) {
|
|
1527
|
+
let data = {
|
|
1528
|
+
id: result.data.id,
|
|
1529
|
+
userinfo: {
|
|
1530
|
+
f_userinfo_id: row.f_userinfo_id,
|
|
1531
|
+
version: row.userinfo_version + 1,
|
|
1532
|
+
f_balance: row.f_balance,
|
|
1533
|
+
userfiles: {
|
|
1534
|
+
f_user_id: model.f_user_id,
|
|
1535
|
+
f_userfiles_id: model.f_userfiles_id,
|
|
1536
|
+
f_card_id: row.f_card_id,
|
|
1537
|
+
f_total_gas: row.f_total_gas,
|
|
1538
|
+
f_write_totalgas: row.f_write_totalgas,
|
|
1539
|
+
f_write_totalfee: row.f_write_totalfee,
|
|
1540
|
+
f_total_fee: row.f_total_fee,
|
|
1541
|
+
f_times: row.cardInfo.Times,
|
|
1542
|
+
version: row.version + 1
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
if (row.f_tag) {
|
|
1547
|
+
data.userinfo.userfiles.f_tag = row.f_tag
|
|
1548
|
+
}
|
|
1549
|
+
await Vue.resetpost('rs/logic/sellgasremanentRollback', {data: data}, {resolveMsg: null, rejectMsg: '卡表收费回滚出错!!'})
|
|
1550
|
+
throw new Error(`卡服务错误:${cardRes.data.Err}${cardRes.data.Exception},请联系开发人员处理!!`)
|
|
1551
|
+
} else {
|
|
1552
|
+
// 更新卡密码
|
|
1553
|
+
await Vue.CommonService.updatePassword(row, cardRes)
|
|
1554
|
+
Vue.showAlert('换表补气成功', 'success', 2000)
|
|
1555
|
+
return result
|
|
1556
|
+
}
|
|
1557
|
+
} else {
|
|
1558
|
+
throw new Error(`请检查卡是否插好!!`)
|
|
1559
|
+
}
|
|
1560
|
+
} catch (error) {
|
|
1561
|
+
if (result) {
|
|
1562
|
+
let data = {
|
|
1563
|
+
sellid: result.data.sellid,
|
|
1564
|
+
fillgasid: result.data.fillgasid,
|
|
1565
|
+
userinfo: {
|
|
1566
|
+
f_userinfo_id: row.f_userinfo_id,
|
|
1567
|
+
version: row.userinfo_version + 1,
|
|
1568
|
+
f_balance: row.f_balance,
|
|
1569
|
+
userfiles: {
|
|
1570
|
+
f_user_id: model.f_user_id,
|
|
1571
|
+
f_total_gas: row.f_total_gas,
|
|
1572
|
+
f_write_totalgas: row.f_write_totalgas,
|
|
1573
|
+
f_write_totalfee: row.f_write_totalfee,
|
|
1574
|
+
f_total_fee: row.f_total_fee,
|
|
1575
|
+
f_card_id: row.f_card_id,
|
|
1576
|
+
f_times: row.cardInfo.Times,
|
|
1577
|
+
version: row.version + 1
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
if (row.f_tag) {
|
|
1582
|
+
data.userinfo.userfiles.f_tag = row.f_tag
|
|
1583
|
+
}
|
|
1584
|
+
await Vue.resetpost('rs/logic/sellgasremanentRollback', {data: data}, {resolveMsg: '卡表收费失败', rejectMsg: '卡表收费失败'})
|
|
1585
|
+
}
|
|
1586
|
+
throw error
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
// 余量补差
|
|
1590
|
+
let marginGen = async function (model, row) {
|
|
1591
|
+
let result = null
|
|
1592
|
+
let cardparam
|
|
1593
|
+
let cardpost
|
|
1594
|
+
try {
|
|
1595
|
+
let cardState = await hasCardGen()
|
|
1596
|
+
if (JSON.parse(cardState.data).state === 1) {
|
|
1597
|
+
// 将卡上次数写入数据库
|
|
1598
|
+
if (!(row.f_hascard == null) && !(row.f_share_times == null) && row.f_hascard === '是' && row.f_share_times === '是') {
|
|
1599
|
+
model.f_times = row.f_times + 1
|
|
1600
|
+
} else {
|
|
1601
|
+
model.f_times = row.cardInfo.Times + 1
|
|
1602
|
+
}
|
|
1603
|
+
// 将回写表号或者用户号
|
|
1604
|
+
model.f_meterid = row.cardInfo.Yhh ? row.cardInfo.Yhh : row.f_meterid
|
|
1605
|
+
|
|
1606
|
+
let cardid = row.f_card_id
|
|
1607
|
+
if (row.f_tag) {
|
|
1608
|
+
// 截取用户编号后四位
|
|
1609
|
+
cardid = model.f_card_id = row.f_tag + row.f_card_id
|
|
1610
|
+
}
|
|
1611
|
+
// 存库
|
|
1612
|
+
result = await Vue.resetpost('rs/logic/marginCharge', {data: model}, {resolveMsg: null, rejectMsg: '卡表收费存库失败'})
|
|
1613
|
+
// 获取气价和售气情况参数
|
|
1614
|
+
let cardParams = await getParamGen(cardid, row.f_alias, row.f_user_id, row.f_userfiles_id)
|
|
1615
|
+
console.log('写卡次数和获取的写卡参数...', row.cardInfo.Times, cardParams)
|
|
1616
|
+
// 写卡
|
|
1617
|
+
let params = {
|
|
1618
|
+
factory: row.f_alias, // 气表厂家
|
|
1619
|
+
kh: cardid, // 卡号
|
|
1620
|
+
yhh: row.f_meterid ? row.f_meterid : 0, // 用户号,档案中自己输
|
|
1621
|
+
kmm: row.f_card_password, // 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
|
|
1622
|
+
bjql: row.f_police_gas,
|
|
1623
|
+
ljgql: (row.f_write_totalgas - 0) + (model.f_pregas - 0), // 当前累计购气量
|
|
1624
|
+
ljgqje: (row.f_write_totalfee - 0) + (model.f_write_money - 0), // 累计购气金额
|
|
1625
|
+
czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
|
|
1626
|
+
tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
|
|
1627
|
+
bkcs: row.f_fillcard_times, // 补卡次数,从补卡表里通过表编号获得
|
|
1628
|
+
ql: model.f_pregas, // 预购气量
|
|
1629
|
+
cs: row.cardInfo.Times + 1, // 求购气次数,先开户为1
|
|
1630
|
+
money: model.f_write_money, // 购气金额
|
|
1631
|
+
dqdm: row.f_area_code, // 精益工业地区代码
|
|
1632
|
+
klx: row.f_coding,
|
|
1633
|
+
meterid: row.f_meternumber ? row.f_meternumber : 0 // 表号
|
|
1634
|
+
}
|
|
1635
|
+
params = Object.assign({}, Vue.CommonService.writeCardParams(cardParams), params)
|
|
1636
|
+
// if (row.f_alias === 'HaiLiJE' || row.f_alias === 'HaiLiQL' || row.f_alias === 'CangNanTY') {
|
|
1637
|
+
// params.klx = yield co(getmodelbrandGen(row))
|
|
1638
|
+
// params.klx = params.klx.data[0].f_coding
|
|
1639
|
+
// }
|
|
1640
|
+
|
|
1641
|
+
let params2 = {
|
|
1642
|
+
factory: row.f_alias,
|
|
1643
|
+
kh: cardid, // 卡号
|
|
1644
|
+
kmm: row.f_card_password, // 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
|
|
1645
|
+
bjql: row.f_police_gas, // 报警气量,t_gasbrand表中
|
|
1646
|
+
czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
|
|
1647
|
+
tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
|
|
1648
|
+
ljgql: (row.f_write_totalgas - 0) + (model.f_pregas - 0), // 当前累计购气量
|
|
1649
|
+
ljgqje: (row.f_write_totalfee - 0) + (model.f_write_money - 0), // 累计购气金额
|
|
1650
|
+
kzt: '1', // 卡状态,0开户卡,1用户卡(0新开户,1补卡)
|
|
1651
|
+
bkcs: row.f_fillcard_times, // 补卡次数,从补卡表里通过表编号获得
|
|
1652
|
+
ql: model.f_pregas, // 预购气量
|
|
1653
|
+
cs: row.cardInfo.Times + 1, // 求购气次数,先开户为1
|
|
1654
|
+
sxrq: model.f_startdate, // 生效日期,价格管理中取
|
|
1655
|
+
meterid: row.f_meternumber ? row.f_meternumber : 0, // 表号
|
|
1656
|
+
// meternumber: row.f_meternumber ? row.f_meternumber : 0, // 海力金额表号
|
|
1657
|
+
dqdm: row.f_area_code, // 精益工业地区代码
|
|
1658
|
+
money: model.f_write_money, // 购气金额
|
|
1659
|
+
klx: row.f_coding
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
params2 = Object.assign({}, Vue.CommonService.writeCardParams(cardParams), params2)
|
|
1663
|
+
// if (row.f_alias === 'HaiLiJE' || row.f_alias === 'HaiLiQL' || row.f_alias === 'CangNanTY') {
|
|
1664
|
+
// params2.klx = yield co(getmodelbrandGen(row))
|
|
1665
|
+
// params2.klx = params2.klx.data[0].f_coding
|
|
1666
|
+
// }
|
|
1667
|
+
|
|
1668
|
+
let params3 = {
|
|
1669
|
+
factory: row.f_alias,
|
|
1670
|
+
kh: cardid, // 卡号
|
|
1671
|
+
kmm: row.f_card_password, // 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
|
|
1672
|
+
bjql: row.f_police_gas, // 报警气量,t_gasbrand表中
|
|
1673
|
+
czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
|
|
1674
|
+
tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
|
|
1675
|
+
ljgql: (row.f_write_totalgas - 0) + (model.f_pregas - 0), // 当前累计购气量
|
|
1676
|
+
ljgqje: (row.f_write_totalfee - 0) + (model.f_write_money - 0), // 累计购气金额
|
|
1677
|
+
kzt: '0', // 卡状态,0开户卡,1用户卡(0新开户,1补卡)
|
|
1678
|
+
bkcs: row.f_fillcard_times, // 补卡次数,从补卡表里通过表编号获得
|
|
1679
|
+
ql: model.f_pregas, // 预购气量
|
|
1680
|
+
cs: 1, // 求购气次数,先开户为1
|
|
1681
|
+
sxrq: model.f_startdate, // 生效日期,价格管理中取
|
|
1682
|
+
meterid: row.f_meternumber ? row.f_meternumber : 0, // 表号
|
|
1683
|
+
// meternumber: row.f_meternumber ? row.f_meternumber : 0, // 海力金额表号
|
|
1684
|
+
dqdm: row.f_area_code, // 精益工业地区代码
|
|
1685
|
+
money: model.f_write_money, // 购气金额
|
|
1686
|
+
klx: row.f_coding
|
|
1687
|
+
}
|
|
1688
|
+
params3 = Object.assign({}, Vue.CommonService.writeCardParams(cardParams), params3)
|
|
1689
|
+
// if (row.f_alias === 'HaiLiJE' || row.f_alias === 'HaiLiQL' || row.f_alias === 'CangNanTY') {
|
|
1690
|
+
// params3.klx = yield co(getmodelbrandGen(row))
|
|
1691
|
+
// params3.klx = params3.klx.data[0].f_coding
|
|
1692
|
+
// }
|
|
1693
|
+
console.log('购气最后操作。。', result)
|
|
1694
|
+
if (!(row.f_hascard == null) && !(row.f_share_times == null) && row.f_meter_type === '物联网表' && row.f_hascard === '是' && row.f_share_times === '是') {
|
|
1695
|
+
params.cs = row.f_times + 1
|
|
1696
|
+
params2.cs = row.f_times + 1
|
|
1697
|
+
}
|
|
1698
|
+
let cardRes
|
|
1699
|
+
if (result.data.last_oper === '补卡') {
|
|
1700
|
+
// 此次验证开户之后未过表补卡验证问题
|
|
1701
|
+
params2.kzt = result.data.ispick === '未过表' && result.data.lastsell_oper === '发卡售气' ? '0' : '1'
|
|
1702
|
+
cardparam = JSON.stringify(params2)
|
|
1703
|
+
cardpost = 'WriteNewCard'
|
|
1704
|
+
cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params2, {resolveMsg: null, rejectMsg: '卡表收费失败'})
|
|
1705
|
+
} else if (result.data.last_oper === '换表') {
|
|
1706
|
+
console.log('我走的是写新卡换表')
|
|
1707
|
+
cardparam = JSON.stringify(params3)
|
|
1708
|
+
cardpost = 'WriteNewCard'
|
|
1709
|
+
cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params3, {resolveMsg: null, rejectMsg: '卡表收费失败'})
|
|
1710
|
+
} else if (result.data.last_oper === '换表补气') {
|
|
1711
|
+
// 累购金额需要将上次购气金额加上
|
|
1712
|
+
console.log('我走的是正常的收费', params)
|
|
1713
|
+
cardparam = JSON.stringify(params)
|
|
1714
|
+
cardpost = 'WriteGasCard'
|
|
1715
|
+
cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', params, {resolveMsg: null, rejectMsg: '卡表收费失败'})
|
|
1716
|
+
} else {
|
|
1717
|
+
console.log('我走的是正常的收费', params)
|
|
1718
|
+
cardparam = JSON.stringify(params)
|
|
1719
|
+
cardpost = 'WriteGasCard'
|
|
1720
|
+
cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', params, {resolveMsg: null, rejectMsg: '卡表收费失败'})
|
|
1721
|
+
}
|
|
1722
|
+
console.log('卡表收费返回写卡参数值', cardRes)
|
|
1723
|
+
// 卡服务写卡异常,业务逻辑回滚
|
|
1724
|
+
if (!cardParams || !result || cardRes.data.Err || cardRes.data.Exception) {
|
|
1725
|
+
throw `卡服务错误:${cardRes.data.Err}${cardRes.data.Exception},请联系开发人员处理!!`
|
|
1726
|
+
} else {
|
|
1727
|
+
// 调用读卡进行校验
|
|
1728
|
+
let readCardInfo = await Vue.resetpost('http://127.0.0.1:8003/ReadCard', {kmm: row.f_card_password}, {resolveMsg: null, rejectMsg: '读卡失败!!'})
|
|
1729
|
+
if (readCardInfo.data && Vue.$login.r.includes('读卡2')) {
|
|
1730
|
+
console.log('读卡验证', readCardInfo.data, row)
|
|
1731
|
+
if (row.f_collection_type === '按金额') {
|
|
1732
|
+
if (readCardInfo.data.Money !== model.f_preamount || readCardInfo.data.Factory !== row.f_alias || readCardInfo.data.CardID !== row.f_card_id) {
|
|
1733
|
+
Vue.showAlert('读卡参数和缴费参数不一致,请核实!!', 'warning', 2000)
|
|
1734
|
+
return result.data.id
|
|
1735
|
+
}
|
|
1736
|
+
} else {
|
|
1737
|
+
if (readCardInfo.data.Gas !== Number((model.f_pregas - 0).toFixed(2)) || readCardInfo.data.Factory !== row.f_alias || readCardInfo.data.CardID !== row.f_card_id) {
|
|
1738
|
+
Vue.showAlert('读卡参数和缴费参数不一致,请核实!!', 'warning', 2000)
|
|
1739
|
+
return result.data.id
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
// 更新卡密码
|
|
1744
|
+
await Vue.CommonService.updatePassword(row, cardRes)
|
|
1745
|
+
Vue.showAlert('售气成功', 'success', 2000)
|
|
1746
|
+
return result.data.id
|
|
1747
|
+
}
|
|
1748
|
+
} else {
|
|
1749
|
+
throw new Error(`请检查卡是否插好!!`)
|
|
1750
|
+
}
|
|
1751
|
+
} catch (error) {
|
|
1752
|
+
if (result) {
|
|
1753
|
+
let data = {
|
|
1754
|
+
cardparam: cardparam,
|
|
1755
|
+
cardpost: cardpost,
|
|
1756
|
+
id: result.data.id,
|
|
1757
|
+
userinfo: {
|
|
1758
|
+
f_userinfo_id: row.f_userinfo_id,
|
|
1759
|
+
version: row.userinfo_version + 1,
|
|
1760
|
+
f_balance: row.f_balance,
|
|
1761
|
+
userfiles: {
|
|
1762
|
+
f_user_id: model.f_user_id,
|
|
1763
|
+
f_userfiles_id: row.f_userfiles_id,
|
|
1764
|
+
f_total_gas: row.f_total_gas,
|
|
1765
|
+
f_write_totalgas: row.f_write_totalgas,
|
|
1766
|
+
f_write_totalfee: row.f_write_totalfee,
|
|
1767
|
+
f_total_fee: row.f_total_fee,
|
|
1768
|
+
f_card_id: row.f_card_id,
|
|
1769
|
+
f_times: row.cardInfo.Times,
|
|
1770
|
+
version: row.version + 1
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
if (row.f_tag) {
|
|
1775
|
+
data.userinfo.userfiles.f_tag = row.f_tag
|
|
1776
|
+
}
|
|
1777
|
+
if (!(row.f_hascard == null) && !(row.f_share_times == null) && row.f_meter_type === '物联网表' && row.f_hascard === '是' && row.f_share_times === '是') {
|
|
1778
|
+
data.userinfo.userfiles.f_times = row.f_times
|
|
1779
|
+
}
|
|
1780
|
+
await Vue.resetpost('rs/logic/cardChargeRollback', {data: data}, {resolveMsg: '卡表收费失败', rejectMsg: '卡表收费失败'})
|
|
1781
|
+
}
|
|
1782
|
+
throw error
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
// 卡表收费
|
|
1786
|
+
let sellgasGen = async function (model, row) {
|
|
1787
|
+
let result = null
|
|
1788
|
+
let cardparam
|
|
1789
|
+
let cardpost
|
|
1790
|
+
try {
|
|
1791
|
+
let cardState = await hasCardGen()
|
|
1792
|
+
if (JSON.parse(cardState.data).state === 1) {
|
|
1793
|
+
// 将卡上次数写入数据库
|
|
1794
|
+
if (!(row.f_hascard == null) && !(row.f_share_times == null) && row.f_hascard === '是' && row.f_share_times === '是') {
|
|
1795
|
+
model.f_times = row.f_times + 1
|
|
1796
|
+
} else {
|
|
1797
|
+
model.f_times = row.cardInfo.Times + 1
|
|
1798
|
+
}
|
|
1799
|
+
// 将回写表号或者用户号
|
|
1800
|
+
model.f_meterid = row.cardInfo.Yhh ? row.cardInfo.Yhh : row.f_meterid
|
|
1801
|
+
|
|
1802
|
+
let cardid = row.f_card_id
|
|
1803
|
+
if (row.f_tag) {
|
|
1804
|
+
// 截取用户编号后四位
|
|
1805
|
+
cardid = model.f_card_id = row.f_tag + row.f_card_id
|
|
1806
|
+
}
|
|
1807
|
+
// 存库
|
|
1808
|
+
result = await Vue.resetpost('rs/logic/sale_cardCharge_logic', {data: model}, {resolveMsg: null, rejectMsg: '卡表收费存库失败'})
|
|
1809
|
+
// 获取气价和售气情况参数
|
|
1810
|
+
let cardParams = await getParamGen(cardid, row.f_alias, row.f_user_id, row.f_userfiles_id)
|
|
1811
|
+
console.log('写卡次数和获取的写卡参数...', row.cardInfo.Times, cardParams)
|
|
1812
|
+
// 写卡
|
|
1813
|
+
let params = {
|
|
1814
|
+
factory: row.f_alias, // 气表厂家
|
|
1815
|
+
kh: cardid, // 卡号
|
|
1816
|
+
yhh: row.f_meterid ? row.f_meterid : 0, // 用户号,档案中自己输
|
|
1817
|
+
kmm: row.f_card_password, // 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
|
|
1818
|
+
bjql: row.f_police_gas,
|
|
1819
|
+
ljgql: (row.f_write_totalgas - 0) + (model.f_pregas - 0), // 当前累计购气量
|
|
1820
|
+
ljgqje: (row.f_write_totalfee - 0) + (model.f_write_money - 0), // 累计购气金额
|
|
1821
|
+
czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
|
|
1822
|
+
tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
|
|
1823
|
+
bkcs: row.f_fillcard_times, // 补卡次数,从补卡表里通过表编号获得
|
|
1824
|
+
ql: model.f_pregas, // 预购气量
|
|
1825
|
+
cs: row.cardInfo.Times + 1, // 求购气次数,先开户为1
|
|
1826
|
+
money: model.f_write_money, // 购气金额
|
|
1827
|
+
dqdm: row.f_area_code, // 精益工业地区代码
|
|
1828
|
+
klx: row.f_coding,
|
|
1829
|
+
meterid: row.f_meternumber ? row.f_meternumber : 0 // 表号
|
|
1830
|
+
}
|
|
1831
|
+
params = Object.assign({}, Vue.CommonService.writeCardParams(cardParams), params)
|
|
1832
|
+
// if (row.f_alias === 'HaiLiJE' || row.f_alias === 'HaiLiQL' || row.f_alias === 'CangNanTY') {
|
|
1833
|
+
// params.klx = yield co(getmodelbrandGen(row))
|
|
1834
|
+
// params.klx = params.klx.data[0].f_coding
|
|
1835
|
+
// }
|
|
1836
|
+
|
|
1837
|
+
let params2 = {
|
|
1838
|
+
factory: row.f_alias,
|
|
1839
|
+
kh: cardid, // 卡号
|
|
1840
|
+
kmm: row.f_card_password, // 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
|
|
1841
|
+
bjql: row.f_police_gas, // 报警气量,t_gasbrand表中
|
|
1842
|
+
czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
|
|
1843
|
+
tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
|
|
1844
|
+
ljgql: (row.f_write_totalgas - 0) + (model.f_pregas - 0), // 当前累计购气量
|
|
1845
|
+
ljgqje: (row.f_write_totalfee - 0) + (model.f_write_money - 0), // 累计购气金额
|
|
1846
|
+
kzt: '1', // 卡状态,0开户卡,1用户卡(0新开户,1补卡)
|
|
1847
|
+
bkcs: row.f_fillcard_times, // 补卡次数,从补卡表里通过表编号获得
|
|
1848
|
+
ql: model.f_pregas, // 预购气量
|
|
1849
|
+
cs: row.cardInfo.Times + 1, // 求购气次数,先开户为1
|
|
1850
|
+
sxrq: model.f_startdate, // 生效日期,价格管理中取
|
|
1851
|
+
meterid: row.f_meternumber ? row.f_meternumber : 0, // 表号
|
|
1852
|
+
// meternumber: row.f_meternumber ? row.f_meternumber : 0, // 海力金额表号
|
|
1853
|
+
dqdm: row.f_area_code, // 精益工业地区代码
|
|
1854
|
+
money: model.f_write_money, // 购气金额
|
|
1855
|
+
klx: row.f_coding
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
params2 = Object.assign({}, Vue.CommonService.writeCardParams(cardParams), params2)
|
|
1859
|
+
// if (row.f_alias === 'HaiLiJE' || row.f_alias === 'HaiLiQL' || row.f_alias === 'CangNanTY') {
|
|
1860
|
+
// params2.klx = yield co(getmodelbrandGen(row))
|
|
1861
|
+
// params2.klx = params2.klx.data[0].f_coding
|
|
1862
|
+
// }
|
|
1863
|
+
|
|
1864
|
+
let params3 = {
|
|
1865
|
+
factory: row.f_alias,
|
|
1866
|
+
kh: cardid, // 卡号
|
|
1867
|
+
kmm: row.f_card_password, // 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
|
|
1868
|
+
bjql: row.f_police_gas, // 报警气量,t_gasbrand表中
|
|
1869
|
+
czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
|
|
1870
|
+
tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
|
|
1871
|
+
ljgql: (row.f_write_totalgas - 0) + (model.f_pregas - 0), // 当前累计购气量
|
|
1872
|
+
ljgqje: (row.f_write_totalfee - 0) + (model.f_write_money - 0), // 累计购气金额
|
|
1873
|
+
kzt: '0', // 卡状态,0开户卡,1用户卡(0新开户,1补卡)
|
|
1874
|
+
bkcs: row.f_fillcard_times, // 补卡次数,从补卡表里通过表编号获得
|
|
1875
|
+
ql: model.f_pregas, // 预购气量
|
|
1876
|
+
cs: 1, // 求购气次数,先开户为1
|
|
1877
|
+
sxrq: model.f_startdate, // 生效日期,价格管理中取
|
|
1878
|
+
meterid: row.f_meternumber ? row.f_meternumber : 0, // 表号
|
|
1879
|
+
// meternumber: row.f_meternumber ? row.f_meternumber : 0, // 海力金额表号
|
|
1880
|
+
dqdm: row.f_area_code, // 精益工业地区代码
|
|
1881
|
+
money: model.f_write_money, // 购气金额
|
|
1882
|
+
klx: row.f_coding
|
|
1883
|
+
}
|
|
1884
|
+
params3 = Object.assign({}, Vue.CommonService.writeCardParams(cardParams), params3)
|
|
1885
|
+
// if (row.f_alias === 'HaiLiJE' || row.f_alias === 'HaiLiQL' || row.f_alias === 'CangNanTY') {
|
|
1886
|
+
// params3.klx = yield co(getmodelbrandGen(row))
|
|
1887
|
+
// params3.klx = params3.klx.data[0].f_coding
|
|
1888
|
+
// }
|
|
1889
|
+
console.log('购气最后操作。。', result)
|
|
1890
|
+
if (!(row.f_hascard == null) && !(row.f_share_times == null) && row.f_meter_type === '物联网表' && row.f_hascard === '是' && row.f_share_times === '是') {
|
|
1891
|
+
params.cs = row.f_times + 1
|
|
1892
|
+
params2.cs = row.f_times + 1
|
|
1893
|
+
}
|
|
1894
|
+
let cardRes
|
|
1895
|
+
if (result.data.last_oper === '补卡') {
|
|
1896
|
+
// 此次验证开户之后未过表补卡验证问题
|
|
1897
|
+
params2.kzt = result.data.ispick === '未过表' && result.data.lastsell_oper === '发卡售气' ? '0' : '1'
|
|
1898
|
+
cardparam = JSON.stringify(params2)
|
|
1899
|
+
cardpost = 'WriteNewCard'
|
|
1900
|
+
cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params2, {resolveMsg: null, rejectMsg: '卡表收费失败'})
|
|
1901
|
+
} else if (result.data.last_oper === '换表') {
|
|
1902
|
+
console.log('我走的是写新卡换表')
|
|
1903
|
+
cardparam = JSON.stringify(params3)
|
|
1904
|
+
cardpost = 'WriteNewCard'
|
|
1905
|
+
cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params3, {resolveMsg: null, rejectMsg: '卡表收费失败'})
|
|
1906
|
+
} else if (result.data.last_oper === '换表补气') {
|
|
1907
|
+
// 累购金额需要将上次购气金额加上
|
|
1908
|
+
console.log('我走的是正常的收费', params)
|
|
1909
|
+
cardparam = JSON.stringify(params)
|
|
1910
|
+
cardpost = 'WriteGasCard'
|
|
1911
|
+
cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', params, {resolveMsg: null, rejectMsg: '卡表收费失败'})
|
|
1912
|
+
} else {
|
|
1913
|
+
console.log('我走的是正常的收费', params)
|
|
1914
|
+
cardparam = JSON.stringify(params)
|
|
1915
|
+
cardpost = 'WriteGasCard'
|
|
1916
|
+
cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', params, {resolveMsg: null, rejectMsg: '卡表收费失败'})
|
|
1917
|
+
}
|
|
1918
|
+
console.log('卡表收费返回写卡参数值', cardRes)
|
|
1919
|
+
// 卡服务写卡异常,业务逻辑回滚
|
|
1920
|
+
if (!cardParams || !result || cardRes.data.Err || cardRes.data.Exception) {
|
|
1921
|
+
throw `卡服务错误:${cardRes.data.Err}${cardRes.data.Exception},请联系开发人员处理!!`
|
|
1922
|
+
} else {
|
|
1923
|
+
// 调用读卡进行校验
|
|
1924
|
+
let readCardInfo = await Vue.resetpost('http://127.0.0.1:8003/ReadCard', {kmm: row.f_card_password}, {resolveMsg: null, rejectMsg: '读卡失败!!'})
|
|
1925
|
+
if (readCardInfo.data && Vue.$login.r.includes('读卡2')) {
|
|
1926
|
+
console.log('读卡验证', readCardInfo.data, row)
|
|
1927
|
+
if (row.f_collection_type === '按金额') {
|
|
1928
|
+
if (readCardInfo.data.Money !== model.f_preamount || readCardInfo.data.Factory !== row.f_alias || readCardInfo.data.CardID !== row.f_card_id) {
|
|
1929
|
+
Vue.showAlert('读卡参数和缴费参数不一致,请核实!!', 'warning', 2000)
|
|
1930
|
+
return result.data.id
|
|
1931
|
+
}
|
|
1932
|
+
} else {
|
|
1933
|
+
if (readCardInfo.data.Gas !== Number((model.f_pregas - 0).toFixed(2)) || readCardInfo.data.Factory !== row.f_alias || readCardInfo.data.CardID !== row.f_card_id) {
|
|
1934
|
+
Vue.showAlert('读卡参数和缴费参数不一致,请核实!!', 'warning', 2000)
|
|
1935
|
+
return result.data.id
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
// 更新卡密码
|
|
1940
|
+
await Vue.CommonService.updatePassword(row, cardRes)
|
|
1941
|
+
Vue.showAlert('售气成功', 'success', 2000)
|
|
1942
|
+
return result.data.id
|
|
1943
|
+
}
|
|
1944
|
+
} else {
|
|
1945
|
+
throw new Error(`请检查卡是否插好!!`)
|
|
1946
|
+
}
|
|
1947
|
+
} catch (error) {
|
|
1948
|
+
if (result) {
|
|
1949
|
+
let data = {
|
|
1950
|
+
cardparam: cardparam,
|
|
1951
|
+
cardpost: cardpost,
|
|
1952
|
+
id: result.data.id,
|
|
1953
|
+
userinfo: {
|
|
1954
|
+
f_userinfo_id: row.f_userinfo_id,
|
|
1955
|
+
version: row.userinfo_version + 1,
|
|
1956
|
+
f_balance: row.f_balance,
|
|
1957
|
+
userfiles: {
|
|
1958
|
+
f_user_id: model.f_user_id,
|
|
1959
|
+
f_userfiles_id: row.f_userfiles_id,
|
|
1960
|
+
f_total_gas: row.f_total_gas,
|
|
1961
|
+
f_write_totalgas: row.f_write_totalgas,
|
|
1962
|
+
f_write_totalfee: row.f_write_totalfee,
|
|
1963
|
+
f_total_fee: row.f_total_fee,
|
|
1964
|
+
f_card_id: row.f_card_id,
|
|
1965
|
+
f_times: row.cardInfo.Times,
|
|
1966
|
+
version: row.version + 1
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
if (row.f_tag) {
|
|
1971
|
+
data.userinfo.userfiles.f_tag = row.f_tag
|
|
1972
|
+
}
|
|
1973
|
+
if (!(row.f_hascard == null) && !(row.f_share_times == null) && row.f_meter_type === '物联网表' && row.f_hascard === '是' && row.f_share_times === '是') {
|
|
1974
|
+
data.userinfo.userfiles.f_times = row.f_times
|
|
1975
|
+
}
|
|
1976
|
+
await Vue.resetpost('rs/logic/cardChargeRollback', {data: data}, {resolveMsg: '卡表收费失败', rejectMsg: '卡表收费失败'})
|
|
1977
|
+
}
|
|
1978
|
+
throw error
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
let reissueCardGenJB = function * (model, row) {
|
|
1982
|
+
if (model.f_cardfees === '') {
|
|
1983
|
+
model.f_cardfees = 0
|
|
1984
|
+
}
|
|
1985
|
+
let data = {
|
|
1986
|
+
f_user_id: row.f_user_id,
|
|
1987
|
+
f_userfiles_id: row.f_userfiles_id,
|
|
1988
|
+
f_user_type: row.f_user_type,
|
|
1989
|
+
f_gasproperties: row.f_gasproperties,
|
|
1990
|
+
f_address: row.f_address,
|
|
1991
|
+
f_meter_brand: row.f_meter_brand,
|
|
1992
|
+
f_type: model.f_type,
|
|
1993
|
+
f_card_id: model.f_card_id,
|
|
1994
|
+
f_ispick_table: model.f_ispick_table,
|
|
1995
|
+
f_cardfees: model.f_cardfees,
|
|
1996
|
+
f_payment: model.f_payment[0],
|
|
1997
|
+
f_bill_style: model.f_print[0],
|
|
1998
|
+
f_comments: model.f_comments,
|
|
1999
|
+
record_userinfo: row.f_userinfo_id,
|
|
2000
|
+
f_userinfo_id: row.f_userinfo_id,
|
|
2001
|
+
f_user_name: row.f_user_name,
|
|
2002
|
+
f_operat_type: '补卡',
|
|
2003
|
+
f_describe: `${Vue.$login.f.name}对客户${row.f_user_name}进行${row.f_type}操作`,
|
|
2004
|
+
f_state: '有效',
|
|
2005
|
+
f_operator: Vue.$login.f.name,
|
|
2006
|
+
f_operatorid: Vue.$login.f.id,
|
|
2007
|
+
f_orgid: Vue.$login.f.orgid,
|
|
2008
|
+
f_orgname: Vue.$login.f.orgs,
|
|
2009
|
+
f_depid: Vue.$login.f.depids,
|
|
2010
|
+
f_depname: Vue.$login.f.deps,
|
|
2011
|
+
f_zoneid: Vue.$login.f.zoneid,
|
|
2012
|
+
f_zones: Vue.$login.f.zones,
|
|
2013
|
+
f_business_tracking_number: model.f_business_tracking_number
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
return Vue.resetpost('rs/logic/sale_fillCard', data, {resolveMsg: null, rejectMsg: '补卡存库失败'})
|
|
2017
|
+
}
|
|
2018
|
+
let reissueCardGen = function * (model, row) {
|
|
2019
|
+
if (model.f_cardfees === '') {
|
|
2020
|
+
model.f_cardfees = 0
|
|
2021
|
+
}
|
|
2022
|
+
if (!model.f_fill_type) {
|
|
2023
|
+
model.f_fill_type = ['']
|
|
2024
|
+
}
|
|
2025
|
+
let data = {
|
|
2026
|
+
f_serial_id: model.f_serial_id,
|
|
2027
|
+
f_user_id: row.f_user_id,
|
|
2028
|
+
f_userfiles_id: row.f_userfiles_id,
|
|
2029
|
+
f_user_type: row.f_user_type,
|
|
2030
|
+
f_gasproperties: row.f_gasproperties,
|
|
2031
|
+
f_address: row.f_address,
|
|
2032
|
+
f_meter_brand: row.f_meter_brand,
|
|
2033
|
+
f_type: model.f_type,
|
|
2034
|
+
f_card_id: model.f_card_id,
|
|
2035
|
+
f_ispick_table: model.f_ispick_table,
|
|
2036
|
+
f_cardfees: model.f_cardfees,
|
|
2037
|
+
f_payment: model.f_payment[0],
|
|
2038
|
+
f_bill_style: model.f_print[0],
|
|
2039
|
+
f_fill_type: model.f_fill_type[0],
|
|
2040
|
+
f_comments: model.f_comments,
|
|
2041
|
+
record_userinfo: row.f_userinfo_id,
|
|
2042
|
+
f_userinfo_id: row.f_userinfo_id,
|
|
2043
|
+
f_user_name: row.f_user_name,
|
|
2044
|
+
f_operat_type: '补卡',
|
|
2045
|
+
f_describe: `${Vue.$login.f.name}对客户${row.f_user_name}进行补卡操作`,
|
|
2046
|
+
f_state: '有效',
|
|
2047
|
+
f_operator: Vue.$login.f.name,
|
|
2048
|
+
f_operatorid: Vue.$login.f.id,
|
|
2049
|
+
f_orgid: Vue.$login.f.orgid,
|
|
2050
|
+
f_orgname: Vue.$login.f.orgs,
|
|
2051
|
+
f_depid: Vue.$login.f.depids,
|
|
2052
|
+
f_depname: Vue.$login.f.deps,
|
|
2053
|
+
f_zoneid: Vue.$login.f.zoneid,
|
|
2054
|
+
f_zones: Vue.$login.f.zones,
|
|
2055
|
+
f_business_tracking_number: model.f_business_tracking_number
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
return Vue.resetpost('rs/logic/sale_fillCard', data, {resolveMsg: null, rejectMsg: '补卡存库失败'})
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
let getParamGen = async function (cardid, alias, f_user_id, f_userfiles_id) {
|
|
2062
|
+
let data = {
|
|
2063
|
+
f_card_id: cardid + '',
|
|
2064
|
+
f_alias: alias,
|
|
2065
|
+
f_user_id: f_user_id,
|
|
2066
|
+
f_userfiles_id: f_userfiles_id
|
|
2067
|
+
}
|
|
2068
|
+
return Vue.resetpost('rs/logic/stairCard', {data: data}, {resolveMsg: null, rejectMsg: '获取写卡参数失败'})
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
let getCardNumberGen = async function (brand_id) {
|
|
2072
|
+
return Vue.resetpost('rs/logic/getCardNumber', {data: {id: brand_id}}, {resolveMsg: null, rejectMsg: '发卡售气获取卡号失败!!'})
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
// 指令写卡
|
|
2076
|
+
// 目前支持 承德海力物联网表
|
|
2077
|
+
let instructWriteCardGen = function * (row) {
|
|
2078
|
+
try {
|
|
2079
|
+
// 判断是否有卡
|
|
2080
|
+
let cardState = yield co(hasCardGen())
|
|
2081
|
+
if (JSON.parse(cardState.data).state === 1) {
|
|
2082
|
+
// 写卡
|
|
2083
|
+
let params = {
|
|
2084
|
+
kh: row.f_card_id,
|
|
2085
|
+
meterid: row.f_meternumber
|
|
2086
|
+
}
|
|
2087
|
+
let cardRes = yield co(Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params, {
|
|
2088
|
+
resolveMsg: null,
|
|
2089
|
+
rejectMsg: '补卡卡服务错误'
|
|
2090
|
+
}))
|
|
2091
|
+
// 卡服务写卡异常,业务逻辑回滚
|
|
2092
|
+
if (cardRes.data.Err || cardRes.data.Exception) {
|
|
2093
|
+
Vue.$showAlert('指令写卡失败!!', 'danger', 0)
|
|
2094
|
+
} else {
|
|
2095
|
+
return cardRes
|
|
2096
|
+
}
|
|
2097
|
+
} else {
|
|
2098
|
+
Vue.showAlert('请检查卡是否插好!!', 'danger', 3000)
|
|
2099
|
+
return 0
|
|
2100
|
+
}
|
|
2101
|
+
} catch (error) {
|
|
2102
|
+
let msg = ''
|
|
2103
|
+
if (error.status === 612) {
|
|
2104
|
+
msg = '请检查读卡器时候连接,或者卡服务是否启动!!'
|
|
2105
|
+
}
|
|
2106
|
+
Vue.showAlert(msg, 'danger', 0)
|
|
2107
|
+
return 0
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
export default CardService
|