handpos-client 1.0.0 → 1.0.2
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/CHANGELOG.md +9 -9
- package/README.md +3 -3
- package/build/dev-android.js +80 -82
- package/build/dev-server.js +0 -7
- package/build/webpack.base.conf.js +6 -6
- package/build/webpack.baseandroid.conf.js +87 -83
- package/index.html +1 -1
- package/oa.iml +9 -0
- package/package.json +7 -4
- package/src/App.vue +0 -2
- package/src/aotePos-android.js +49 -0
- package/src/aotePos.js +66 -70
- package/src/bootstrap/less/navs.less +1 -1
- package/src/components/Init.vue +114 -108
- package/src/components/Main.vue +81 -80
- package/src/components/css/garbage.less +80 -0
- package/src/components/css/style.less +119 -51
- package/src/components/garbage/GarbageInfo.vue +212 -0
- package/src/components/garbage/GarbagePayWay.vue +199 -0
- package/src/components/garbage/GarbageScanNative.vue +87 -0
- package/src/components/image/Payway.png +0 -0
- package/src/components/image/cardSale.png +0 -0
- package/src/components/image/ccbpay.png +0 -0
- package/src/components/image/code.jpg +0 -0
- package/src/components/image/guangda190603.jpg +0 -0
- package/src/components/image/machineSale.png +0 -0
- package/src/components/image/select.png +0 -0
- package/src/components/image/xxxk.png +0 -0
- package/src/components/main/CardMain.vue +47 -0
- package/src/components/main/MachineMain.vue +143 -0
- package/src/components/pay/PayWay.vue +173 -0
- package/src/components/pay/ScanNative.vue +87 -0
- package/src/components/pay/WriteCard.vue +141 -0
- package/src/components/public/BuyGas.vue +306 -0
- package/src/components/public/HistorySellList.vue +65 -0
- package/src/components/public/WritecardInfo.vue +114 -0
- package/src/components/sellgas/CardSellGas.vue +437 -0
- package/src/components/sellgas/IotSellGas.vue +155 -0
- package/src/components/sellgas/MachineSellGasGas.vue +145 -0
- package/src/components/sellgas/MachineSellGasMoney.vue +174 -0
- package/src/components/userinfo/UserInfo.vue +145 -0
- package/src/main.js +18 -23
- package/src/plugin/AndroidPlugin-/346/274/224/347/244/272/347/263/273/347/273/237.js +102 -0
- package/src/plugin/AndroidPlugin.js +107 -0
- package/src/plugin/DateUtil.js +32 -0
- package/src/plugin/HttpReset.js +124 -0
- package/src/plugin/Httputil.js +39 -0
- package/src/{Plugin → plugin}/PosUtil.js +21 -19
- package/src/service/CheckCard.js +103 -0
- package/src/service/GarbagePayWay.js +101 -0
- package/src/service/GarbageScanNative.js +116 -0
- package/src/service/GetCardInfo.js +88 -0
- package/src/service/PayWay.js +121 -0
- package/src/service/ScanNative.js +118 -0
- package/src/service/WriteCard.js +262 -0
- package/src/Plugin/AndroidPlugin.js +0 -141
- package/src/components/charge/card/CardInfo.vue +0 -43
- package/src/components/charge/card/ReadCardInter.vue +0 -176
- package/src/components/charge/card/ReadCardToBuy.vue +0 -174
- package/src/components/charge/machine/MachineSearch.Vue +0 -124
- package/src/components/charge/payment/OrderInfo.vue +0 -283
- package/src/components/charge/payment/ScanNative.vue +0 -162
- package/src/components/charge/sellgas/CardSellGas.vue +0 -365
- package/src/components/charge/sellgas/ChoosePayWay.vue +0 -275
- package/src/components/charge/sellgas/GudingPrice.vue +0 -38
- package/src/components/charge/sellgas/JietiPrice.vue +0 -54
- package/src/components/charge/sellgas/ScanQrcode.vue +0 -171
- package/src/components/charge/sellgas/WriteCard.vue +0 -283
- package/src/components/charge/userinfo/ChangeMeterList.vue +0 -43
- package/src/components/charge/userinfo/FillGasList.vue +0 -43
- package/src/components/charge/userinfo/HistorySellList.vue +0 -93
- package/src/components/charge/userinfo/OtherList.vue +0 -43
- package/src/components/charge/userinfo/SellList.vue +0 -43
- package/src/components/charge/userinfo/TransList.vue +0 -43
- package/src/components/charge/userinfo/UserInfo.vue +0 -201
- package/src/components/charge/userinfo/WritecardInfo.vue +0 -44
- package/src/components/ztprint.js +0 -26
- /package/src/components/image/{card.gif → readCard.gif} +0 -0
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<div>
|
|
4
|
-
<div class="mhead">
|
|
5
|
-
<ul>
|
|
6
|
-
<li>
|
|
7
|
-
<!-- <a href="#" class="back" @click="isback()"> </a>
|
|
8
|
-
<a href="#" class="tomain" @click="istomain()"></a> -->
|
|
9
|
-
</li>
|
|
10
|
-
</ul>
|
|
11
|
-
</div>
|
|
12
|
-
<div class="loadview">
|
|
13
|
-
<div>
|
|
14
|
-
<img src="../../image/loading_lg.gif" width="66" height="66" border-color ="white" border-style = "solid" alt="" />
|
|
15
|
-
<h3>{{prompt + loadingstrs[loadingindex]}}</h3>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
<!--<card-sell-gas v-if="ischeked" :userinfo="userinfo" :cardInfo="cardInfo"> <card-sell-gas>-->
|
|
20
|
-
</div>
|
|
21
|
-
</template>
|
|
22
|
-
<script>
|
|
23
|
-
let checkValObj
|
|
24
|
-
let cycleValObj
|
|
25
|
-
export default {
|
|
26
|
-
title: '购气读卡页',
|
|
27
|
-
data () {
|
|
28
|
-
return {
|
|
29
|
-
// ischeked: false,
|
|
30
|
-
checkindex: 0,
|
|
31
|
-
prompt: '正在检查卡槽是否有卡',
|
|
32
|
-
loadingindex: 0,
|
|
33
|
-
loadingstrs: ['', '.', '..', '...']
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
props: ['userinfo', 'cardInfo'],
|
|
37
|
-
methods: {
|
|
38
|
-
toback(str){
|
|
39
|
-
this.$back(str)
|
|
40
|
-
},
|
|
41
|
-
back () {
|
|
42
|
-
window.clearInterval(checkValObj)
|
|
43
|
-
window.clearInterval(cycleValObj)
|
|
44
|
-
this.$back('tomain')
|
|
45
|
-
// HostApp.backHome()
|
|
46
|
-
},
|
|
47
|
-
cycle () {
|
|
48
|
-
console.log(this.checkindex)
|
|
49
|
-
if (this.loadingindex === this.loadingstrs.length - 1) {
|
|
50
|
-
this.loadingindex = 0
|
|
51
|
-
} else {
|
|
52
|
-
this.loadingindex += 1
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
readCard () {
|
|
56
|
-
cycleValObj = window.setInterval(this.cycle, 1000)
|
|
57
|
-
this.prompt = '正在读卡,请稍后'
|
|
58
|
-
// 清空cardInfo缓存
|
|
59
|
-
this.cardInfo = {}
|
|
60
|
-
var jo = this.$AndroidPlugin.read()
|
|
61
|
-
// var jo = {code: 500, msg: '读卡错'}
|
|
62
|
-
if (jo.code === 200) {
|
|
63
|
-
this.cardInfo = jo.msg
|
|
64
|
-
this.check()
|
|
65
|
-
} else if (jo.code === 500) {
|
|
66
|
-
this.errorInfo(jo.msg + ',请检查卡是否插好!')
|
|
67
|
-
} else {
|
|
68
|
-
this.errorInfo('调用读卡器失败,请联系管理员!')
|
|
69
|
-
}
|
|
70
|
-
// // ceshi
|
|
71
|
-
// this.cardInfo.CardID = '1099993187'
|
|
72
|
-
// this.cardInfo.Factory = 'TaiPengYeJing'
|
|
73
|
-
// this.cardInfo.Gas = 0
|
|
74
|
-
// this.cardInfo.Money = 0
|
|
75
|
-
// this.cardInfo.RenewTimes = 0
|
|
76
|
-
// this.cardInfo.Times = 3
|
|
77
|
-
// this.cardInfo.WscKmm = '000000000000000000000000000000000000000000000000'
|
|
78
|
-
// this.cardInfo.Yhh = ''
|
|
79
|
-
// this.check()
|
|
80
|
-
},
|
|
81
|
-
check () {
|
|
82
|
-
this.prompt = '正在校验档案信息,请稍后'
|
|
83
|
-
if (this.cardInfo.CardID === this.userinfo.f_card_id && this.cardInfo.Factory === this.userinfo.f_alias) {
|
|
84
|
-
if (this.cardInfo.Gas !== 0 && this.cardInfo.Gas !== '0') {
|
|
85
|
-
this.errorInfo('卡上气量为' + this.cardInfo.Gas + '方不能购气,请先接表再重新读卡!')
|
|
86
|
-
} else if (this.cardInfo.Money !== 0 && this.cardInfo.Money !== '0'){
|
|
87
|
-
this.errorInfo('卡上有钱不能购气! ')
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
window.clearInterval(cycleValObj)
|
|
91
|
-
// this.ischeked = true
|
|
92
|
-
this.$goto('card-sell-gas',{userinfo:this.userinfo,cardInfo:this.cardInfo},'self',this.toback)
|
|
93
|
-
}
|
|
94
|
-
} else {
|
|
95
|
-
this.errorInfo('当前卡信息与档案信息不符,请确保插入为正确的燃气卡!')
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
errorInfo (msg) {
|
|
99
|
-
window.clearInterval(cycleValObj)
|
|
100
|
-
this.checkindex = 0
|
|
101
|
-
this.$showMessage(msg + '(点击\'确定\'重新开始读卡)', ['confirm', 'cancel'])
|
|
102
|
-
.then((res) => {
|
|
103
|
-
if (res === 'confirm') {
|
|
104
|
-
checkValObj = window.setInterval(this.checkCard, 1000)
|
|
105
|
-
} else {
|
|
106
|
-
this.back()
|
|
107
|
-
}
|
|
108
|
-
})
|
|
109
|
-
},
|
|
110
|
-
checkCard () {
|
|
111
|
-
this.cycle()
|
|
112
|
-
// console.log(1111)
|
|
113
|
-
if (this.checkindex === 0) {
|
|
114
|
-
this.prompt = '正在检查卡槽是否有卡'
|
|
115
|
-
}
|
|
116
|
-
if (this.checkindex % 10 === 0 && this.checkindex !== 0) {
|
|
117
|
-
window.clearInterval(checkValObj)
|
|
118
|
-
this.errorInfo('未检测到卡,请检查卡槽是否有卡或异物')
|
|
119
|
-
} else if (this.checkindex % 2 === 0) {
|
|
120
|
-
var ret = HostApp.hasCard().data
|
|
121
|
-
// var ret
|
|
122
|
-
// if (this.checkindex === 4) {
|
|
123
|
-
// ret = true
|
|
124
|
-
// }
|
|
125
|
-
if (ret) {
|
|
126
|
-
window.clearInterval(checkValObj)
|
|
127
|
-
this.readCard()
|
|
128
|
-
}
|
|
129
|
-
this.checkindex += 1
|
|
130
|
-
} else {
|
|
131
|
-
this.checkindex += 1
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
// nocard () {
|
|
135
|
-
// this.checkindex = 0
|
|
136
|
-
// this.$showMessage('未检测到卡,请检查卡槽是否有卡或异物!(点击\'确定\'返回)', ['confirm', 'cancel'])
|
|
137
|
-
// .then((res) => {
|
|
138
|
-
// if (res === 'confirm') {
|
|
139
|
-
// this.back()
|
|
140
|
-
// } else {
|
|
141
|
-
// checkValObj = window.setInterval(this.checkCard, 1000)
|
|
142
|
-
// }
|
|
143
|
-
// })
|
|
144
|
-
// },
|
|
145
|
-
// isback () {
|
|
146
|
-
// window.clearInterval(checkValObj)
|
|
147
|
-
// this.$showMessage('确定要返回吗?(点击\'确定\'返回)', ['confirm', 'cancel'])
|
|
148
|
-
// .then((res) => {
|
|
149
|
-
// if (res === 'confirm') {
|
|
150
|
-
// this.back()
|
|
151
|
-
// } else {
|
|
152
|
-
// checkValObj = window.setInterval(this.checkCard, 1000)
|
|
153
|
-
// }
|
|
154
|
-
// })
|
|
155
|
-
// },
|
|
156
|
-
// istomain () {
|
|
157
|
-
// window.clearInterval(checkValObj)
|
|
158
|
-
// this.$showMessage('确定要退出吗?(点击\'确定\'返回)', ['confirm', 'cancel'])
|
|
159
|
-
// .then((res) => {
|
|
160
|
-
// if (res === 'confirm') {
|
|
161
|
-
// this.tomain()
|
|
162
|
-
// } else {
|
|
163
|
-
// checkValObj = window.setInterval(this.checkCard, 1000)
|
|
164
|
-
// }
|
|
165
|
-
// })
|
|
166
|
-
// },
|
|
167
|
-
},
|
|
168
|
-
ready () {
|
|
169
|
-
this.cardInfo = {}
|
|
170
|
-
checkValObj = window.setInterval(this.checkCard, 1000)
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
</script>
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<div v-if="!isaffrim">
|
|
4
|
-
<div class="mhead">
|
|
5
|
-
<ul>
|
|
6
|
-
<li>
|
|
7
|
-
<a href="#" class="back" @click="back()"> </a>
|
|
8
|
-
<a href="#" class="tomain" @click="tomain()"></a>
|
|
9
|
-
</li>
|
|
10
|
-
</ul>
|
|
11
|
-
</div>
|
|
12
|
-
<div class="searchview auto">
|
|
13
|
-
<criteria-paged :model="model" v-ref:paged style="font-size:12px;height:99%;">
|
|
14
|
-
<criteria partial='criteria' v-ref:pp @condition-changed='search' >
|
|
15
|
-
<div novalidate class="form-horizontal bloack" partial style="margin-bottom:2%;">
|
|
16
|
-
|
|
17
|
-
<div class="form-group" >
|
|
18
|
-
<div class="col-xs-12" style="margin-top:10px;">
|
|
19
|
-
<label class="col-xs-4 control-label" style="font-size:18px" ><nobr>用户编号</nobr></label>
|
|
20
|
-
<div class="col-xs-5">
|
|
21
|
-
<input type="number" class="form-control" v-model="model.f_userinfo_id"
|
|
22
|
-
condition="f_userinfo_id = {} " />
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
<div class="form-group" >
|
|
27
|
-
<div class="col-xs-12" >
|
|
28
|
-
<div class="col-xs-4 col-xs-offset-4" style="text-align: center">
|
|
29
|
-
<button type="button" class="btn btn-lg btn-primary" @click="search()"> 查询 </button>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
</criteria>
|
|
35
|
-
<data-grid :model="model" partial='list' v-ref:grid class="col-md-12 auto" style="margin-top:15px;margin-bottom:0px;margin-left: 1%; margin-right:1%;">
|
|
36
|
-
<template partial='head' >
|
|
37
|
-
<tr>
|
|
38
|
-
<th style="text-align:center;"><nobr>用户名称</nobr></th>
|
|
39
|
-
<th style="text-align:center;"><nobr>用户地址</nobr></th>
|
|
40
|
-
<th style="text-align:center;"><nobr></nobr></th>
|
|
41
|
-
</tr>
|
|
42
|
-
</template>
|
|
43
|
-
<template partial='body'>
|
|
44
|
-
<td style="text-align:center;"><p class="name">{{row.f_user_name}}</p></td>
|
|
45
|
-
<td style="text-align:center;"><p class="address">{{row.f_address}}</p></td>
|
|
46
|
-
<td style="text-align:center;">
|
|
47
|
-
<button type="button" v-show='isSelected(row)'class="btn btn-primary btn-sm" @click='$parent.$parent.$parent.affrim(row)'>确认</button>
|
|
48
|
-
</td>
|
|
49
|
-
</template>
|
|
50
|
-
</data-grid>
|
|
51
|
-
</criteria-paged>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
<user-info v-if="isaffrim" :userinfo="userInfo" :cardinfo="cardInfo"></user-info>
|
|
55
|
-
</div>
|
|
56
|
-
</template>
|
|
57
|
-
<script>
|
|
58
|
-
import { PagedList } from 'vue-client'
|
|
59
|
-
import co from 'co'
|
|
60
|
-
import Vue from 'vue'
|
|
61
|
-
|
|
62
|
-
let getInfoGen = function * (self,row) {
|
|
63
|
-
let condition
|
|
64
|
-
condition = 'f_user_id =\'' + row.f_user_id + '\''
|
|
65
|
-
try {
|
|
66
|
-
let ret = yield self.$resetpost(Vue.ProxyUrl + 'rs/logic/getUserfile', {data: {condition: condition}}, {resolveMsg: null, rejectMsg: null})
|
|
67
|
-
self.userInfo = ret.data.userInfo
|
|
68
|
-
self.isaffrim = true
|
|
69
|
-
} catch (ret) {
|
|
70
|
-
var msg = ''
|
|
71
|
-
if (ret.status === 404) {
|
|
72
|
-
msg = '连接后台服务失败,请检查网络连接或联系管理员!'
|
|
73
|
-
} else if (ret.status === 501) {
|
|
74
|
-
msg = ret.data + '请确认用户信息是否正确!'
|
|
75
|
-
} else {
|
|
76
|
-
msg = '查询用户档案出错,请联系管理员!'
|
|
77
|
-
}
|
|
78
|
-
self.$showAlert(msg, 'warning', 3000)
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
export default {
|
|
82
|
-
title: '机表用户查询',
|
|
83
|
-
data () {
|
|
84
|
-
return {
|
|
85
|
-
model: new PagedList(Vue.ProxyUrl + 'rs/sql/getUsers', 7),
|
|
86
|
-
isaffrim: false,
|
|
87
|
-
userInfo: {},
|
|
88
|
-
cardInfo: {}
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
methods: {
|
|
92
|
-
back () {
|
|
93
|
-
this.$dispatch('tomain')
|
|
94
|
-
// HostApp.backHome()
|
|
95
|
-
},
|
|
96
|
-
tomain () {
|
|
97
|
-
this.$dispatch('tomain')
|
|
98
|
-
// HostApp.backHome()
|
|
99
|
-
},
|
|
100
|
-
affrim (row) {
|
|
101
|
-
let getInfo = getInfoGen(this,row)
|
|
102
|
-
return co(getInfo)
|
|
103
|
-
},
|
|
104
|
-
doSearch () {
|
|
105
|
-
// console.log(this.$refs.paged.$refs.pp.model.f_userinfo_id)
|
|
106
|
-
if (this.$refs.paged.$refs.pp.model.f_userinfo_id.trim() === '' && this.$refs.paged.$refs.pp.model.f_user_name.trim() === '') {
|
|
107
|
-
this.$showAlert('请先输入查询条件', 'warning', 1500)
|
|
108
|
-
} else {
|
|
109
|
-
this.model.search('1=1',{})
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
events: {
|
|
114
|
-
'back' () {
|
|
115
|
-
this.userInfo = {}
|
|
116
|
-
this.isaffrim = false
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
ready () {
|
|
120
|
-
// this.model.search('1=1',{})
|
|
121
|
-
// this.$showAlert('请先输入查询条件', 'warning', 1500)
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
</script>
|
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<div class="container-fluid toppanel auto">
|
|
4
|
-
<div class="container">
|
|
5
|
-
<div class="row margin15">
|
|
6
|
-
<div class="col-md-6"><img :src="logo()" class="img-responsive" alt=""/></div>
|
|
7
|
-
<div class="col-md-6 text-right titlebtn">
|
|
8
|
-
</div>
|
|
9
|
-
</div>
|
|
10
|
-
</div>
|
|
11
|
-
</div>
|
|
12
|
-
<div class="container contentpanel auto">
|
|
13
|
-
<div class="row qrpanel" v-if='hasCard'>
|
|
14
|
-
<h4 style="text-align:left;"><span><img src="../../image/gqxx.png" width="32" height="32" alt=""/></span>写卡</h4>
|
|
15
|
-
<dl class="writecard">
|
|
16
|
-
<dt>
|
|
17
|
-
<img :src="imgArray[index]" id="imgResult" width="128" height="128" alt=""/>
|
|
18
|
-
<span id="info">{{message}}</span>
|
|
19
|
-
<br/>
|
|
20
|
-
<span v-if="isdone && isfail && !printFail&& failCount < writeRetryTime" style="color:red;">{{msg}}</span>
|
|
21
|
-
|
|
22
|
-
</dt>
|
|
23
|
-
<dd v-if="isdone && printFail">
|
|
24
|
-
<button type="button" class="btn btn-lg btn-info" @click="toPrint()">重新打印</button>
|
|
25
|
-
<!--<button type="button" class="btn btn-lg btn-info" @click="back('tomain')">不打印退出</button>-->
|
|
26
|
-
</dd>
|
|
27
|
-
<dd v-if="isdone && isfail && !printFail && (failCount < writeRetryTime)">
|
|
28
|
-
<button type="button" class="btn btn-lg btn-info" @click="writeCard()">重新写卡</button>
|
|
29
|
-
<!--<button type="button" class="btn btn-lg btn-info" @click="PrintAsFile()">打印凭条退出</button>-->
|
|
30
|
-
</dd>
|
|
31
|
-
<dd v-if="isdone && isbackerro">
|
|
32
|
-
<button type="button" class="btn btn-lg btn-info" @click="toReback()">重新保存</button>
|
|
33
|
-
</dd>
|
|
34
|
-
|
|
35
|
-
</dl>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
</template>
|
|
40
|
-
<script>
|
|
41
|
-
import co from 'co'
|
|
42
|
-
import Vue from 'vue'
|
|
43
|
-
import androidUtil from '../../../Plugin/AndroidPlugin'
|
|
44
|
-
let writecardGen = function * (self) {
|
|
45
|
-
console.log("writecardGen中this",self)
|
|
46
|
-
let data = {
|
|
47
|
-
id: Number(self.stairPrice.id),
|
|
48
|
-
f_user_id: self.userInfo.f_user_id
|
|
49
|
-
}
|
|
50
|
-
self.isdone = false
|
|
51
|
-
self.isfail = false
|
|
52
|
-
self.index = 0
|
|
53
|
-
let cardParams, writeRes
|
|
54
|
-
try {
|
|
55
|
-
cardParams =yield co(getParamGen(self))
|
|
56
|
-
console.log("cardParams==",cardParams)
|
|
57
|
-
if (!cardParams) {
|
|
58
|
-
self.index = 1
|
|
59
|
-
self.message = '获取写卡参数失败,请重新写卡或联系工作人员!'
|
|
60
|
-
self.isWrited = '写卡失败'
|
|
61
|
-
self.isdone = true
|
|
62
|
-
self.isfail = true
|
|
63
|
-
if (self.failCount >= self.writeRetryTime) {
|
|
64
|
-
co(writeBackGen())
|
|
65
|
-
}
|
|
66
|
-
return
|
|
67
|
-
}
|
|
68
|
-
let params = Vue.PosUtil.writeCardParams(cardParams, self)
|
|
69
|
-
console.log('写卡参数',params)
|
|
70
|
-
self.message = '正在校验卡号...'
|
|
71
|
-
let readinfo = Vue.AndroidPlugin.read()
|
|
72
|
-
console.log("readinfo==",readinfo)
|
|
73
|
-
console.log("self.cardInfo.CardID==",self.cardInfo.CardID)
|
|
74
|
-
if (readinfo.code !== 200 || readinfo.msg.CardID !== self.cardInfo.CardID) {
|
|
75
|
-
self.index = 1
|
|
76
|
-
self.message = '卡号校验失败,请使用正确的燃气卡重新写卡'
|
|
77
|
-
self.isWrited = '写卡失败'
|
|
78
|
-
self.isdone = true
|
|
79
|
-
self.isfail = true
|
|
80
|
-
if (self.failCount >= self.writeRetryTime) {
|
|
81
|
-
co(writeBackGen())
|
|
82
|
-
}
|
|
83
|
-
return
|
|
84
|
-
}
|
|
85
|
-
console.log("卡号校验成功!正在写卡self.message",self.message)
|
|
86
|
-
self.message = '卡号校验成功!正在写卡...'
|
|
87
|
-
console.log("self.message",self.message)
|
|
88
|
-
writeRes = Vue.AndroidPlugin.sell(params)
|
|
89
|
-
self.backData = Object.assign({}, writeRes.msg, self.backData)
|
|
90
|
-
if (writeRes.code === 200) {
|
|
91
|
-
self.message = '写卡完成,正在更新写卡状态...'
|
|
92
|
-
self.isWrited = '已写卡'
|
|
93
|
-
self.isdone = true
|
|
94
|
-
self.isfail = false
|
|
95
|
-
co(writeBackGen())
|
|
96
|
-
return
|
|
97
|
-
} else {
|
|
98
|
-
self.index = 1
|
|
99
|
-
var errorMsg = writeRes.msg ? (!writeRes.msg.Err ? writeRes.msg.Exception : writeRes.msg.Err) : '写卡未知错误!'
|
|
100
|
-
self.message = errorMsg + ' 写卡失败!请重新写卡或联系工作人员!'
|
|
101
|
-
self.isWrited = '写卡失败'
|
|
102
|
-
self.isdone = true
|
|
103
|
-
self.isfail = true
|
|
104
|
-
if (self.failCount >= self.writeRetryTime) {
|
|
105
|
-
co(writeBackGen())
|
|
106
|
-
}
|
|
107
|
-
return
|
|
108
|
-
}
|
|
109
|
-
} catch (error) {
|
|
110
|
-
self.index = 1
|
|
111
|
-
self.message = '写卡异常!请重新写卡或联系工作人员!'
|
|
112
|
-
self.isWrited = '写卡失败'
|
|
113
|
-
self.isdone = true
|
|
114
|
-
self.isfail = true
|
|
115
|
-
if (self.failCount >= self.writeRetryTime){
|
|
116
|
-
co(writeBackGen())
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
//获取参数
|
|
121
|
-
let getParamGen= function* (self) {
|
|
122
|
-
return self.$resetpost(Vue.ProxyUrl + '/rs/logic/'+Vue.PosUtil.posParam.revenue+'stairCard', {
|
|
123
|
-
data: {f_card_id: self.cardInfo.CardID, f_alias: self.cardInfo.Factory}
|
|
124
|
-
}, {resolveMsg: null, rejectMsg: '获取写卡参数失败'})
|
|
125
|
-
}
|
|
126
|
-
// 写卡返回
|
|
127
|
-
let writeBackGen = function * (self){
|
|
128
|
-
let writebackret
|
|
129
|
-
try {
|
|
130
|
-
writebackret = yield co(writeBack(self))
|
|
131
|
-
console.log("写卡结果保存完成writebackret==",writebackret)
|
|
132
|
-
if(!writebackret) {
|
|
133
|
-
self.message = '保存写卡结果失败,请检查网络连接正常再点击重新保存按钮'
|
|
134
|
-
self.isbackerro = true
|
|
135
|
-
return
|
|
136
|
-
}
|
|
137
|
-
co(printGen(self))
|
|
138
|
-
}catch (error){
|
|
139
|
-
console.log(error)
|
|
140
|
-
if(!writebackret){
|
|
141
|
-
self.message = '保存写卡结果失败,请检查网络连接正常再点击重新保存按钮'
|
|
142
|
-
self.isbackerro = true
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
// 保存写卡结果
|
|
147
|
-
let writeBack = function * (self){
|
|
148
|
-
console.log("保存写卡结果self.backData", self.backData)
|
|
149
|
-
self.backData.f_write_card = self.isWrited
|
|
150
|
-
self.message = '正在保存写卡结果'
|
|
151
|
-
return self.$resetpost(Vue.ProxyUrl + '/rs/logic/'+Vue.PosUtil.posParam.revenue+'writeBack', {data: self.backData}, {resolveMsg: null, rejectMsg: null})
|
|
152
|
-
}
|
|
153
|
-
// 打印售气记录
|
|
154
|
-
let printGen = function * (self) {
|
|
155
|
-
self.message = '正在打印凭据,请稍等!'
|
|
156
|
-
let pres = self.print()
|
|
157
|
-
console.log('打印',pres)
|
|
158
|
-
if (pres.code === 200) {
|
|
159
|
-
self.message = '打印成功!返回首页!!'
|
|
160
|
-
self.back('tomain')
|
|
161
|
-
} else {
|
|
162
|
-
self.message = '打印异常!请确保小票打印纸正常(无缺纸或无卡纸现象)和POS机电量充足(电量不足可直接插上电源)后,点击“重新打印”!'
|
|
163
|
-
self.printFail = true
|
|
164
|
-
return
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export default {
|
|
169
|
-
title: '写卡页面',
|
|
170
|
-
data() {
|
|
171
|
-
return {
|
|
172
|
-
// userInfo: {},
|
|
173
|
-
// stairPrice: {},
|
|
174
|
-
// status: 0,
|
|
175
|
-
message: '正在初始化,请等待...',
|
|
176
|
-
// cardInfo: {},
|
|
177
|
-
tips:'',
|
|
178
|
-
failCount: 0,
|
|
179
|
-
msg: '请重新插牢燃气卡片,确保芯片面朝上,确认后,点击“重新写卡”按钮!',
|
|
180
|
-
// writeErro: '请重新插牢燃气卡片,确保芯片面朝上,确认后,点击“重新写卡”按钮!',
|
|
181
|
-
imgArray: [
|
|
182
|
-
require('../../image/ok.png'),
|
|
183
|
-
require('../../image/nok.png')
|
|
184
|
-
],
|
|
185
|
-
isWrited: '未写卡',
|
|
186
|
-
backData:{},
|
|
187
|
-
index: 0,
|
|
188
|
-
isbackerro:false,
|
|
189
|
-
printFail: false,
|
|
190
|
-
isdone: false,
|
|
191
|
-
isfail: false,
|
|
192
|
-
writeRetryTime: 0,
|
|
193
|
-
hasCard: true,
|
|
194
|
-
resolve: undefined,
|
|
195
|
-
reject: undefined,
|
|
196
|
-
obj: undefined
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
props: ['userInfo', 'cardInfo','stairPrice','status'],
|
|
200
|
-
methods: {
|
|
201
|
-
logo() {
|
|
202
|
-
return Vue.ProxyUrl + '/res/'+this.$PosUtil.posParam.imgpath+'/sublogo.png'
|
|
203
|
-
},
|
|
204
|
-
back(para) {
|
|
205
|
-
this.$back(para)
|
|
206
|
-
},
|
|
207
|
-
writeCard() {
|
|
208
|
-
this.failCount = this.failCount + 1
|
|
209
|
-
this.writeCard()
|
|
210
|
-
},
|
|
211
|
-
toReback() {
|
|
212
|
-
this.toReback()
|
|
213
|
-
},
|
|
214
|
-
//打印小票
|
|
215
|
-
toPrint() {
|
|
216
|
-
this.toPrint()
|
|
217
|
-
},
|
|
218
|
-
print () {
|
|
219
|
-
// 清空打印内容
|
|
220
|
-
var printcontent = []
|
|
221
|
-
// 抬头
|
|
222
|
-
var comName = Vue.PosUtil.posParam.companyName
|
|
223
|
-
|
|
224
|
-
printcontent.push({type: 3, text: comName, fontsize: 3, isbold: true, align: 'center'
|
|
225
|
-
})
|
|
226
|
-
|
|
227
|
-
printcontent.push({type: 3, text: '自 助 购 气 凭 证', fontsize: 3, isbold: true, align: 'center'})
|
|
228
|
-
printcontent.push({type: 3, text: '----------------------------', fontsize: 3, isbold: true, align: 'center'})
|
|
229
|
-
// 小票信息
|
|
230
|
-
printcontent.push({type: 3, text: '用户编号:' + this.userInfo.f_userinfo_code, fontsize: 2, isbold: true, align: 'left'})
|
|
231
|
-
if (this.self.userInfo.f_meter_type!=='机表' && this.userInfo.f_meter_type!=='物联网表') {
|
|
232
|
-
printcontent.push({type: 3, text: '用户卡号:' + this.cardInfo.CardID, fontsize: 2, isbold: true, align: 'left'})
|
|
233
|
-
}
|
|
234
|
-
printcontent.push({type: 3, text: '用户姓名:' + this.userInfo.f_user_name, fontsize: 2, isbold: true, align: 'left'})
|
|
235
|
-
printcontent.push({type: 3, text: '用户地址:' + this.userInfo.f_address, fontsize: 2, isbold: true, align: 'left'})
|
|
236
|
-
|
|
237
|
-
printcontent.push({type: 3, text: '购 气 量:' + this.stairPrice.f_pregas + '方', fontsize: 2, isbold: true, align: 'left'})
|
|
238
|
-
printcontent.push({type: 3, text: '本次缴费:' + this.stairPrice.f_collection + '元', fontsize: 2, isbold: true, align: 'left'})
|
|
239
|
-
printcontent.push({type: 3, text: '大 写:' + Vue.PosUtil.convertCurrency(this.self.stairPrice.f_collection), fontsize: 2, isbold: true, align: 'left'})
|
|
240
|
-
printcontent.push({type: 3, text: '购气日期:' + Vue.PosUtil.getNowDate('yyyy-MM-dd'), fontsize: 2, isbold: true, align: 'left'})
|
|
241
|
-
printcontent.push({type: 3, text: '终 端 号:' + Vue.PosUtil.Sn, fontsize: 2, isbold: true, align: 'left'})
|
|
242
|
-
printcontent.push({type: 3, text: '流 水 号:' + this.stairPrice.id, fontsize: 2, isbold: true, align: 'left'})
|
|
243
|
-
printcontent.push({type: 3, text: '写卡结果:' + this.isWrited, fontsize: 2, isbold: true, align: 'left'})
|
|
244
|
-
printcontent.push({type: 3, text: '----------------------------', fontsize: 3, isbold: true, align: 'center'})
|
|
245
|
-
|
|
246
|
-
printcontent.push({type: 3, text: '', fontsize: 3, isbold: true, align: 'center'})
|
|
247
|
-
// 走纸
|
|
248
|
-
printcontent.push({type: 4, value: 5, unit: 'pixel'})
|
|
249
|
-
return Vue.AndroidPlugin.print(printcontent)
|
|
250
|
-
}
|
|
251
|
-
},
|
|
252
|
-
ready() {
|
|
253
|
-
// this.userInfo = this.userInfo
|
|
254
|
-
// this.stairPrice = this.stairPrice
|
|
255
|
-
// this.cardInfo = this.cardInfo
|
|
256
|
-
// this.status = this.status
|
|
257
|
-
console.log("userInfo, cardInfo, stairPrice, status",this.userInfo, this.cardInfo, this.stairPrice, this.status)
|
|
258
|
-
this.backData.id = this.stairPrice.id
|
|
259
|
-
this.backData.f_user_id = this.userInfo.f_user_id
|
|
260
|
-
this.writeRetryTime = this.$PosUtil.posParam.writeCardRetry
|
|
261
|
-
if (this.userInfo.f_meter_type!=='机表' && this.userInfo.f_meter_type!=='物联网表') {
|
|
262
|
-
this.tips = '写卡'
|
|
263
|
-
this.message = '支付成功!正在获取写卡参数.....'
|
|
264
|
-
} else {
|
|
265
|
-
this.tips = '交易完成'
|
|
266
|
-
}
|
|
267
|
-
// this.obj = this.obj
|
|
268
|
-
// this.obj.setComponents(this)
|
|
269
|
-
if(this.status === 1){
|
|
270
|
-
console.log('未写卡记录写卡')
|
|
271
|
-
this.writeCard()
|
|
272
|
-
} else if (this.status === 2) {
|
|
273
|
-
console.log('银联app支付写卡')
|
|
274
|
-
this.last.resolve(true)
|
|
275
|
-
} else {
|
|
276
|
-
console.log('扫码写卡',this.obj)
|
|
277
|
-
co(writecardGen(this))
|
|
278
|
-
}
|
|
279
|
-
console.log('stair3',this.stairPrice)
|
|
280
|
-
// this.obj.writeCard()
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
</script>
|