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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,476 +1,476 @@
1
- <template>
2
- <div class="auto">
3
- <work-busy :is-busy="isbusy"></work-busy>
4
- <criteria-paged :model="model" v-ref:paged :pager="false">
5
- <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:cri>
6
- <div partial>
7
- <form>
8
- <!-- <div class="row app-row">-->
9
- <!-- <div class="col-xs-4">-->
10
- <!-- <img src="../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">-->
11
- <!-- <label class="font text-left">用户编号:</label>-->
12
- <!-- </div>-->
13
- <!-- <div class="col-xs-8">-->
14
- <!-- <input class="search_input input-font" v-model=model.f_userinfo_code condition="f_userinfo_code = '{}'"-->
15
- <!-- placeholder="请输入用户编号" />-->
16
- <!-- </div>-->
17
- <!-- </div>-->
18
- <!-- <div class="row app-row">-->
19
- <!-- <div class="col-xs-4">-->
20
- <!-- <img src="../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">-->
21
- <!-- <label class="font text-left">表 &nbsp;&nbsp; &nbsp;&nbsp; 号:</label>-->
22
- <!-- </div>-->
23
- <!-- <div class="col-xs-8">-->
24
- <!-- <input class="search_input input-font" v-model=model.f_meternumber condition="f_meternumber = '{}'"-->
25
- <!-- placeholder="请输入表号" />-->
26
- <!-- </div>-->
27
- <!-- </div>-->
28
- <!-- <div class="row app-row">-->
29
- <!-- <div class="col-xs-4">-->
30
- <!-- <img src="../../assets/用户姓名.png" style="width: 20px;margin-bottom: 5px" alt="">-->
31
- <!-- <label class="font text-left">用户名称:</label>-->
32
- <!-- </div>-->
33
- <!-- <div class="col-xs-8">-->
34
- <!-- <input class="search_input input-font" v-model="model.f_user_name" condition="f_user_name like '%{}%'"-->
35
- <!-- placeholder="请输入用户名称(可模糊查询">-->
36
- <!-- </div>-->
37
- <!-- </div>-->
38
- <!-- <div class="row app-row">-->
39
- <!-- <div class="col-xs-4">-->
40
- <!-- <img src="../../assets/用户类型.png" style="width: 20px;margin-bottom: 5px" alt="">-->
41
- <!-- <label class="font text-left">用户类型:</label>-->
42
- <!-- </div>-->
43
- <!-- <div class="col-xs-8">-->
44
- <!-- <v-select :value.sync="$parent.$parent.model.f_user_type" class="input-font" condition="f_user_type = '{}'"-->
45
- <!-- :options='$parent.$parent.user_types' placeholder='请选择用户类型' :value-single="true"-->
46
- <!-- v-model="$parent.$parent.model.f_user_type" close-on-select clear-button></v-select>-->
47
- <!-- </div>-->
48
- <!-- </div>-->
49
- <!-- <div class="row app-row">-->
50
- <!-- <div class="col-xs-4">-->
51
- <!-- <img src="../../assets/小区.png" style="width: 20px;margin-bottom: 5px" alt="">-->
52
- <!-- <label class="font text-left">小区名称:</label>-->
53
- <!-- </div>-->
54
- <!-- <div class="col-xs-8">-->
55
- <!-- <input style="width: 100%" class="search_input input-font" v-model="model.f_districtname"-->
56
- <!-- placeholder="请输入用户小区(可模糊查询)">-->
57
- <!-- </div>-->
58
- <!-- </div>-->
59
- <!-- <div class="row app-row">-->
60
- <!-- <div class="col-xs-4">-->
61
- <!-- <img src="../../assets/小区.png" style="width: 20px;margin-bottom: 5px" alt="">-->
62
- <!-- <label class="font text-left">楼&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:</label>-->
63
- <!-- </div>-->
64
- <!-- <div class="col-xs-8">-->
65
- <!-- <input style="width: 100%" class="search_input input-font" v-model="model.f_building"-->
66
- <!-- placeholder="请输入用户楼号(可模糊查询)">-->
67
- <!-- </div>-->
68
- <!-- </div>-->
69
- <!-- <div class="row app-row">-->
70
- <!-- <div class="col-xs-4">-->
71
- <!-- <img src="../../assets/小区.png" style="width: 20px;margin-bottom: 5px" alt="">-->
72
- <!-- <label class="font text-left">单&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;元:</label>-->
73
- <!-- </div>-->
74
- <!-- <div class="col-xs-8">-->
75
- <!-- <input style="width: 100%" class="search_input input-font" v-model="model.f_unit"-->
76
- <!-- placeholder="请输入用户单元(可模糊查询)">-->
77
- <!-- </div>-->
78
- <!-- </div>-->
79
- <!-- <div class="row app-row">-->
80
- <!-- <div class="col-xs-4">-->
81
- <!-- <img src="../../assets/小区.png" style="width: 20px;margin-bottom: 5px" alt="">-->
82
- <!-- <label class="font text-left">用户地址:</label>-->
83
- <!-- </div>-->
84
- <!-- <div class="col-xs-8">-->
85
- <!-- <input style="width: 100%" class="search_input input-font" v-model="model.f_address" condition="f_address like '%{}%'"-->
86
- <!-- placeholder="请输入用户地址(可模糊查询)">-->
87
- <!-- </div>-->
88
- <!-- </div>-->
89
- <!-- <div class="row app-row">-->
90
- <!-- <div class="col-xs-4">-->
91
- <!-- <img src="../../assets/小区.png" style="width: 20px;margin-bottom: 5px" alt="">-->
92
- <!-- <label class="font text-left">卡号:</label>-->
93
- <!-- </div>-->
94
- <!-- <div class="col-xs-8">-->
95
- <!-- <input style="width: 40%" class="search_input input-font" v-model="model.f_card_id" condition="ts.f_card_id = '{}'"-->
96
- <!-- placeholder="">-->
97
- <!-- <button type="button" class="btn btn-lg btn-font btn-color" style="width: 100%;"-->
98
- <!-- @click="$parent.$parent.readCard">读卡</button>-->
99
- <!-- </div>-->
100
- <!-- </div>-->
101
- <div class="row text-center" style="margin-top: 20px;">
102
- <button type="button" class="btn btn-lg btn-font btn-color" style="width: 60%;"
103
- @click="$parent.$parent.readCard">读卡</button>
104
- </div>
105
- <div style="height:30px;"></div>
106
- </form>
107
- </div>
108
- </criteria>
109
-
110
- <list :model="model" partial='list'>
111
- <div partial>
112
- <div class="auto app-text" style="margin-top: 5px;">
113
- <div class="panel" style="padding: 10px 10px 5px 10px;">
114
- <div class="panel-body panel-self">
115
- <div class="row">
116
- <p class="panel-title col-xs-4 text-left font">用户名称</p>
117
- <p class="panel-title col-xs-8 text-left input-font">{{ row.f_user_name }}</p>
118
- </div>
119
- <div class="row">
120
- <p class="panel-title col-xs-4 text-left font">用户编号</p>
121
- <p class="panel-title col-xs-8 text-left input-font">{{ row.f_userinfo_code }}</p>
122
- </div>
123
- <div class="row">
124
- <p class="panel-title col-xs-4 text-left font">用户电话</p>
125
- <p class="panel-title col-xs-8 text-left input-font">{{ row.f_user_phone.slice(0,3)+'****'+row.f_user_phone.slice(7) }}</p>
126
- </div>
127
- <div class="row">
128
- <p class="panel-title col-xs-4 text-left font">用户地址</p>
129
- <p class="panel-title col-xs-8 text-left input-font">{{ row.f_address.substring(0,row.f_address.length /2) + '*'.repeat(row.f_address.length /2) }}</p>
130
- </div>
131
- <div class="row">
132
- <p class="panel-title col-xs-4 text-left font">支付方式</p>
133
- <p class="panel-title col-xs-8 text-left input-font">{{ row.f_payment }}</p>
134
- </div>
135
- <div class="row">
136
- <p class="panel-title col-xs-4 text-left font">预购气量</p>
137
- <p class="panel-title col-xs-8 text-left input-font">{{ row.f_pregas }}</p>
138
- </div>
139
- <div class="row">
140
- <p class="panel-title col-xs-4 text-left font">操作时间</p>
141
- <p class="panel-title col-xs-8 text-left input-font">{{ row.f_operate_date }}</p>
142
- </div>
143
- <!-- <div class="row">-->
144
- <!-- <p class="panel-title col-xs-4 text-left font">气表品牌</p>-->
145
- <!-- <p class="panel-title col-xs-8 text-left input-font">{{ row.f_meter_brand }}</p>-->
146
- <!-- </div>-->
147
- <div class="row">
148
- <button type="button" class="btn btn-lg btn-font btn-color" style="width: 45%;"
149
- @click="$parent.$parent.$parent.re_writeCard(row)">重新写卡</button>
150
- </div>
151
- </div>
152
- </div>
153
- </div>
154
- </div>
155
- </list>
156
- </criteria-paged>
157
- </div>
158
- </template>
159
-
160
- <script>
161
- import {HttpResetClass, PagedList} from 'vue-client'
162
- import Vue from 'vue'
163
-
164
- export default {
165
- title: '安检员B',
166
- data() {
167
- return {
168
- model: new PagedList(`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/sql/tel_singleTable_OrderBy`, 5,
169
- {
170
- items: '"ts.*,tu.f_userinfo_code,tu.f_user_phone"',
171
- tablename: '"t_sellinggas ts left join t_userinfo tu on ts.f_userinfo_id = tu.f_userinfo_id"',
172
- orderitem: '"ts.id desc"'
173
- }),
174
- showModal: false,
175
- user_types: [
176
- { label: '请选择用户类型', value: '' },
177
- { label: '民用', value: '民用' },
178
- { label: '非民用', value: '非民用' }
179
- ],
180
- isbusy:false,
181
- isWrited:''
182
- }
183
- },
184
- ready() {
185
-
186
- },
187
- computed: {
188
-
189
- },
190
- methods: {
191
- readCard(){
192
- this.isbusy = true
193
- try {
194
- let handpostData = this.handPosOrgData()
195
- if (!handpostData) {
196
- this.isbusy = false
197
- return
198
- }
199
- let senddata = { cloud_url: handpostData.domain }
200
- let posinfo2 = HostApp.read(handpostData.area, JSON.stringify(senddata))
201
- if (posinfo2.code == 200) {
202
- this.model.search(`f_write_card in ('未写卡','写卡失败') and f_state = '有效' and ts.f_card_id = '${posinfo2.msg.CardID}'`)
203
- this.isbusy = false
204
- } else {
205
- this.isbusy = false
206
- this.$showMessage('读卡失败!')
207
- }
208
- }catch (e) {
209
- console.log(e)
210
- }finally {
211
- this.isbusy = false
212
- }
213
- },
214
- selfSearch(args) {
215
- args.condition +=
216
- this.model.search(args.condition, args.model)
217
- },
218
- async re_writeCard(row) {
219
- let _this = this
220
- let http1 = new HttpResetClass()
221
- let parameter = {
222
- items: 'id,f_pregas',
223
- tablename: 't_sellinggas',
224
- condition: ` f_userinfo_id = ${row.f_userinfo_id} and f_write_card in ('未写卡','写卡失败') and f_state = '有效'`,
225
- orderitem: 'id'
226
- }
227
- let resp = await http1.load('POST', `${this.$androidUtil.getProxyUrl()}/af-telephone/rs/sql/tel_singleTable_OrderBy`, { data: parameter }, {
228
- resolveMsg: null,
229
- rejectMsg: null
230
- })
231
- if (resp.data.length > 0) {
232
- await this.$showMessage('此用户存在写卡失败和未写卡的记录,是否重新写卡!', ['confirm', 'cancel']).then(async (res) => {
233
- if (res !== 'confirm') {
234
- return
235
- }
236
- this.isbusy = true
237
- let param = {
238
- condition: `i.f_userinfo_id = '${row.f_userinfo_id}' `,
239
- orderitem: "f_userinfo_id DESC"
240
- }
241
- let resSale = await this.$resetpost(`${_this.$androidUtil.getProxyUrl()}/api/af-revenue/sql/sale_getUser`, { data: param }, {
242
- resolveMsg: null,
243
- rejectMsg: null
244
- })
245
- if (resSale.data.length > 0) {
246
- await this.writeCard(resSale.data[0], resp.data[0].id, resp.data[0].f_pregas)
247
- } else {
248
- this.isbusy = false
249
- this.$showMessage('用户参数异常,核对后重新尝试。')
250
- }
251
- })
252
- } else {
253
- this.$showMessage('此用户未存在写卡失败和未写卡的记录。')
254
- }
255
- },
256
- async writeCard(row, sellid, f_pregas) {
257
- try {
258
- let handpostData = this.handPosOrgData()
259
- console.log('进入获取分公司配置项方法')
260
- if (!handpostData) {
261
- this.isbusy = false
262
- return
263
- }
264
- let senddata = { cloud_url: handpostData.domain }
265
- let posinfo2 = HostApp.read(handpostData.area, JSON.stringify(senddata))
266
- console.log('拿到了配置项信息')
267
- console.log('读卡信息==' + JSON.stringify(posinfo2))
268
- console.log('拿到的信息为:' + JSON.stringify(posinfo2))
269
- let cardNumber = ''
270
- let Times = 1
271
- if (posinfo2.code == 200) {
272
- console.log('读卡成功!')
273
- cardNumber = posinfo2.msg.CardID
274
- Times = posinfo2.msg.Times
275
- } else {
276
- this.isbusy = false
277
- this.$showMessage('读卡失败!')
278
- }
279
- if (!cardNumber || cardNumber == '') {
280
- this.isbusy = false
281
- this.$showMessage('卡号异常!写卡失败!')
282
- return
283
- }
284
- let params = {
285
- AREA: handpostData.area, // 分公司
286
- ulen: 0, // 判断版本
287
- factory: row.f_alias,
288
- kmm: '0', // 2019-12-22 查旭说的。给一个0 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
289
- kzt: '0', // 卡状态,0开户卡,1用户卡(0新开户,1补卡)
290
- kh: cardNumber, // 卡号
291
- yhh: row.f_meterid ? row.f_meterid : 0, // 用户号,档案中自己输
292
- ql: f_pregas, // 预购气量
293
- csql: '0', // 上次购气量,新开户为0
294
- ccsql: '0', // 上上次购气量,新开户为0
295
- cs: Times ? Times + 1 : '1', // 求购气次数,先开户为1
296
- ljgql: row.f_total_gas_sell, // 当前累计购气量
297
- bkcs: '0', // 新开户卡,为0
298
- ljyql: '0', // 累积用气量,有些表要累加原来用气量,新开户卡,为0
299
- bjql: row.f_police_gas, // 报警气量,t_gasbrand表中
300
- czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
301
- tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
302
- cssqrq: '0', // 上次售气日期,格式为YYYYMMDD
303
- meterid: row.f_meternumber, // 表号
304
- money: row.f_preamount, // 购气金额
305
- dqdm: row.f_area_code, // 精益工业地区代码
306
- klx: row.f_coding
307
- }
308
- // 获取写卡参数
309
- let data = {
310
- f_card_id: row.f_card_id + '',
311
- f_alias: row.f_alias,
312
- f_user_id: row.f_user_id,
313
- f_userfiles_id: row.f_userfiles_id
314
- }
315
- console.log('获取写卡参数' + JSON.stringify(data))
316
- let http = new HttpResetClass()
317
- let cardParams = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/stairCard`, { data: data }, {
318
- resolveMsg: null,
319
- rejectMsg: '获取写卡参数失败'
320
- })
321
- console.log('cardParams===' + JSON.stringify(cardParams))
322
- // 拼接参数
323
- params = await Object.assign({}, this.writeCardParams(cardParams), params)
324
- params.cloud_url = handpostData.domain
325
- console.log('写卡参数++++++' + JSON.stringify(params))
326
- let writres = await HostApp.sell(JSON.stringify(params))
327
- console.log('写卡结果===' + JSON.stringify(writres))
328
- if (writres.code == '200') {
329
- this.isWrited = '已写卡'
330
- await this.updatewritecard('已写卡', sellid)
331
- this.isbusy = false
332
- this.$showMessage('写卡成功!')
333
- } else {
334
- this.isWrited = '未写卡'
335
- await this.updatewritecard('未写卡', sellid)
336
- let msg = typeof writres.msg == 'object' ? JSON.stringify(writres.msg) : writres.msg.toString()
337
- this.isbusy = false
338
- this.$showMessage('写卡失败!')
339
- }
340
- } catch (msg) {
341
- if (typeof msg == 'object' && msg.data) {
342
- this.isbusy = false
343
- this.$showMessage("写卡失败,请把截图发给管理员!" + msg.data)
344
- } else {
345
- this.isbusy = false
346
- this.$showMessage("写卡失败,请完全退出系统重新再试")
347
- }
348
- }
349
- },
350
- async updatewritecard(msg, id) {
351
- let http11 = new HttpResetClass()
352
- let sqldata = `update t_sellinggas set f_write_card = '${msg}' where id = '${id}'`
353
- console.log('修改条件===' + JSON.stringify(sqldata))
354
- http11.load('POST', `${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/runSQL`, {data: {sql: sqldata}}, {
355
- resolveMsg: null,
356
- rejectMsg: null
357
- })
358
- },
359
- handPosOrgData() {
360
- if (Vue.config.telephone != undefined) {
361
- if (Vue.config.telephone.HandPos != undefined) {
362
- if (Vue.config.telephone.HandPos.data[0]){
363
- return {
364
- domain: Vue.config.telephone.HandPos.data[0].domain,
365
- area: Vue.config.telephone.HandPos.data[0].area
366
- }
367
- }else {
368
- this.$showMessage("初始化获取POS参数失败")
369
- return null
370
- }
371
- } else {
372
- this.$showMessage("初始化获取POS参数失败")
373
- return null
374
- }
375
- }
376
- return null;
377
- },
378
-
379
- writeCardParams(cardParams) {
380
- console.log('common写卡参数,,,' + JSON.stringify(cardParams))
381
- let result = {
382
- csql: cardParams.data.sc,
383
- lastmoney: cardParams.data.scje,
384
- ccsql: cardParams.data.ssc,
385
- lastlastmoney: cardParams.data.sscje,
386
- ljgql: cardParams.data.f_pregas,
387
- ljyql: cardParams.data.f_pregasall,
388
- yhh: cardParams.data.f_meterid,
389
- sxrq: cardParams.data.f_perform_date,
390
- totalmoney: cardParams.data.f_collection,
391
- stairversion: cardParams.data.f_stairversion,
392
- pricedate: cardParams.data.pricedate,
393
- pricetype: cardParams.data.pricetype
394
- }
395
-
396
- // 对阶梯进行处理
397
- if (cardParams.data.stairprice.includes(';') && cardParams.data.stairamount.includes(';')) {
398
- let gases = cardParams.data.stairamount.split(';')
399
- let prices = cardParams.data.stairprice.split(';')
400
- if (gases.length >= 2) {
401
- result.stairgas1 = gases[0] !== '' ? gases[0] : 0
402
- result.stairgas2 = gases[1] !== '' ? gases[1] : 0
403
- result.stairgas3 = '99999999'
404
- }
405
- if (prices.length >= 2) {
406
- result.stairprice1 = prices[0] !== '' ? prices[0] : 0
407
- result.stairprice2 = prices[1] !== '' ? prices[1] : 0
408
- result.stairprice3 = prices[2] !== '' ? prices[2] : 0
409
- }
410
- } else {
411
- result.stairgas1 = '77777777'
412
- result.stairgas2 = '88888888'
413
- result.stairgas3 = '99999999'
414
- result.stairprice1 = cardParams.data.stairprice
415
- result.stairprice2 = cardParams.data.stairprice
416
- result.stairprice3 = cardParams.data.stairprice
417
- }
418
- return result
419
- },
420
- }
421
- }
422
- </script>
423
- <style>
424
- .app-row {
425
- background-color: white;
426
- padding: 10px 10px 0 10px;
427
- border-bottom: 1px solid rgba(235, 235, 235, 0.5);
428
- }
429
-
430
- .search_input {
431
- border: 0;
432
- outline: none;
433
- }
434
-
435
- .font {
436
- font: 15px PingFang-SC-Medium;
437
- color: #666666;
438
- }
439
-
440
- .input-font {
441
- font: 15px PingFang-SC-Medium;
442
- color: #333333;
443
- }
444
-
445
- .btn-font {
446
- font: 600 16px PingFang-SC-Bold;
447
- color: #499EDF;
448
- }
449
-
450
- .btn-color {
451
- background-color: #FFFFFF;
452
- border-radius: 10px;
453
- border: 1px solid #499EDF;
454
- }
455
-
456
- .app-text {
457
- font-size: 12px;
458
- }
459
-
460
- .panel-self {
461
- border-radius: 10px;
462
- border: 1px solid #499EDF;
463
- background-color: #F8F8F8;
464
- }
465
-
466
- .yybtn-color {
467
- border-radius: 4px;
468
- border: 1px solid #499EDF;
469
- }
470
-
471
- .qxbtn-color {
472
- background-color: #FFFFFF;
473
- border-radius: 4px;
474
- border: 1px solid #499EDF;
475
- }
476
- </style>
1
+ <template>
2
+ <div class="auto">
3
+ <work-busy :is-busy="isbusy"></work-busy>
4
+ <criteria-paged :model="model" v-ref:paged :pager="false">
5
+ <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:cri>
6
+ <div partial>
7
+ <form>
8
+ <!-- <div class="row app-row">-->
9
+ <!-- <div class="col-xs-4">-->
10
+ <!-- <img src="../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">-->
11
+ <!-- <label class="font text-left">用户编号:</label>-->
12
+ <!-- </div>-->
13
+ <!-- <div class="col-xs-8">-->
14
+ <!-- <input class="search_input input-font" v-model=model.f_userinfo_code condition="f_userinfo_code = '{}'"-->
15
+ <!-- placeholder="请输入用户编号" />-->
16
+ <!-- </div>-->
17
+ <!-- </div>-->
18
+ <!-- <div class="row app-row">-->
19
+ <!-- <div class="col-xs-4">-->
20
+ <!-- <img src="../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">-->
21
+ <!-- <label class="font text-left">表 &nbsp;&nbsp; &nbsp;&nbsp; 号:</label>-->
22
+ <!-- </div>-->
23
+ <!-- <div class="col-xs-8">-->
24
+ <!-- <input class="search_input input-font" v-model=model.f_meternumber condition="f_meternumber = '{}'"-->
25
+ <!-- placeholder="请输入表号" />-->
26
+ <!-- </div>-->
27
+ <!-- </div>-->
28
+ <!-- <div class="row app-row">-->
29
+ <!-- <div class="col-xs-4">-->
30
+ <!-- <img src="../../assets/用户姓名.png" style="width: 20px;margin-bottom: 5px" alt="">-->
31
+ <!-- <label class="font text-left">用户名称:</label>-->
32
+ <!-- </div>-->
33
+ <!-- <div class="col-xs-8">-->
34
+ <!-- <input class="search_input input-font" v-model="model.f_user_name" condition="f_user_name like '%{}%'"-->
35
+ <!-- placeholder="请输入用户名称(可模糊查询">-->
36
+ <!-- </div>-->
37
+ <!-- </div>-->
38
+ <!-- <div class="row app-row">-->
39
+ <!-- <div class="col-xs-4">-->
40
+ <!-- <img src="../../assets/用户类型.png" style="width: 20px;margin-bottom: 5px" alt="">-->
41
+ <!-- <label class="font text-left">用户类型:</label>-->
42
+ <!-- </div>-->
43
+ <!-- <div class="col-xs-8">-->
44
+ <!-- <v-select :value.sync="$parent.$parent.model.f_user_type" class="input-font" condition="f_user_type = '{}'"-->
45
+ <!-- :options='$parent.$parent.user_types' placeholder='请选择用户类型' :value-single="true"-->
46
+ <!-- v-model="$parent.$parent.model.f_user_type" close-on-select clear-button></v-select>-->
47
+ <!-- </div>-->
48
+ <!-- </div>-->
49
+ <!-- <div class="row app-row">-->
50
+ <!-- <div class="col-xs-4">-->
51
+ <!-- <img src="../../assets/小区.png" style="width: 20px;margin-bottom: 5px" alt="">-->
52
+ <!-- <label class="font text-left">小区名称:</label>-->
53
+ <!-- </div>-->
54
+ <!-- <div class="col-xs-8">-->
55
+ <!-- <input style="width: 100%" class="search_input input-font" v-model="model.f_districtname"-->
56
+ <!-- placeholder="请输入用户小区(可模糊查询)">-->
57
+ <!-- </div>-->
58
+ <!-- </div>-->
59
+ <!-- <div class="row app-row">-->
60
+ <!-- <div class="col-xs-4">-->
61
+ <!-- <img src="../../assets/小区.png" style="width: 20px;margin-bottom: 5px" alt="">-->
62
+ <!-- <label class="font text-left">楼&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:</label>-->
63
+ <!-- </div>-->
64
+ <!-- <div class="col-xs-8">-->
65
+ <!-- <input style="width: 100%" class="search_input input-font" v-model="model.f_building"-->
66
+ <!-- placeholder="请输入用户楼号(可模糊查询)">-->
67
+ <!-- </div>-->
68
+ <!-- </div>-->
69
+ <!-- <div class="row app-row">-->
70
+ <!-- <div class="col-xs-4">-->
71
+ <!-- <img src="../../assets/小区.png" style="width: 20px;margin-bottom: 5px" alt="">-->
72
+ <!-- <label class="font text-left">单&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;元:</label>-->
73
+ <!-- </div>-->
74
+ <!-- <div class="col-xs-8">-->
75
+ <!-- <input style="width: 100%" class="search_input input-font" v-model="model.f_unit"-->
76
+ <!-- placeholder="请输入用户单元(可模糊查询)">-->
77
+ <!-- </div>-->
78
+ <!-- </div>-->
79
+ <!-- <div class="row app-row">-->
80
+ <!-- <div class="col-xs-4">-->
81
+ <!-- <img src="../../assets/小区.png" style="width: 20px;margin-bottom: 5px" alt="">-->
82
+ <!-- <label class="font text-left">用户地址:</label>-->
83
+ <!-- </div>-->
84
+ <!-- <div class="col-xs-8">-->
85
+ <!-- <input style="width: 100%" class="search_input input-font" v-model="model.f_address" condition="f_address like '%{}%'"-->
86
+ <!-- placeholder="请输入用户地址(可模糊查询)">-->
87
+ <!-- </div>-->
88
+ <!-- </div>-->
89
+ <!-- <div class="row app-row">-->
90
+ <!-- <div class="col-xs-4">-->
91
+ <!-- <img src="../../assets/小区.png" style="width: 20px;margin-bottom: 5px" alt="">-->
92
+ <!-- <label class="font text-left">卡号:</label>-->
93
+ <!-- </div>-->
94
+ <!-- <div class="col-xs-8">-->
95
+ <!-- <input style="width: 40%" class="search_input input-font" v-model="model.f_card_id" condition="ts.f_card_id = '{}'"-->
96
+ <!-- placeholder="">-->
97
+ <!-- <button type="button" class="btn btn-lg btn-font btn-color" style="width: 100%;"-->
98
+ <!-- @click="$parent.$parent.readCard">读卡</button>-->
99
+ <!-- </div>-->
100
+ <!-- </div>-->
101
+ <div class="row text-center" style="margin-top: 20px;">
102
+ <button type="button" class="btn btn-lg btn-font btn-color" style="width: 60%;"
103
+ @click="$parent.$parent.readCard">读卡</button>
104
+ </div>
105
+ <div style="height:30px;"></div>
106
+ </form>
107
+ </div>
108
+ </criteria>
109
+
110
+ <list :model="model" partial='list'>
111
+ <div partial>
112
+ <div class="auto app-text" style="margin-top: 5px;">
113
+ <div class="panel" style="padding: 10px 10px 5px 10px;">
114
+ <div class="panel-body panel-self">
115
+ <div class="row">
116
+ <p class="panel-title col-xs-4 text-left font">用户名称</p>
117
+ <p class="panel-title col-xs-8 text-left input-font">{{ row.f_user_name }}</p>
118
+ </div>
119
+ <div class="row">
120
+ <p class="panel-title col-xs-4 text-left font">用户编号</p>
121
+ <p class="panel-title col-xs-8 text-left input-font">{{ row.f_userinfo_code }}</p>
122
+ </div>
123
+ <div class="row">
124
+ <p class="panel-title col-xs-4 text-left font">用户电话</p>
125
+ <p class="panel-title col-xs-8 text-left input-font">{{ row.f_user_phone.slice(0,3)+'****'+row.f_user_phone.slice(7) }}</p>
126
+ </div>
127
+ <div class="row">
128
+ <p class="panel-title col-xs-4 text-left font">用户地址</p>
129
+ <p class="panel-title col-xs-8 text-left input-font">{{ row.f_address.substring(0,row.f_address.length /2) + '*'.repeat(row.f_address.length /2) }}</p>
130
+ </div>
131
+ <div class="row">
132
+ <p class="panel-title col-xs-4 text-left font">支付方式</p>
133
+ <p class="panel-title col-xs-8 text-left input-font">{{ row.f_payment }}</p>
134
+ </div>
135
+ <div class="row">
136
+ <p class="panel-title col-xs-4 text-left font">预购气量</p>
137
+ <p class="panel-title col-xs-8 text-left input-font">{{ row.f_pregas }}</p>
138
+ </div>
139
+ <div class="row">
140
+ <p class="panel-title col-xs-4 text-left font">操作时间</p>
141
+ <p class="panel-title col-xs-8 text-left input-font">{{ row.f_operate_date }}</p>
142
+ </div>
143
+ <!-- <div class="row">-->
144
+ <!-- <p class="panel-title col-xs-4 text-left font">气表品牌</p>-->
145
+ <!-- <p class="panel-title col-xs-8 text-left input-font">{{ row.f_meter_brand }}</p>-->
146
+ <!-- </div>-->
147
+ <div class="row">
148
+ <button type="button" class="btn btn-lg btn-font btn-color" style="width: 45%;"
149
+ @click="$parent.$parent.$parent.re_writeCard(row)">重新写卡</button>
150
+ </div>
151
+ </div>
152
+ </div>
153
+ </div>
154
+ </div>
155
+ </list>
156
+ </criteria-paged>
157
+ </div>
158
+ </template>
159
+
160
+ <script>
161
+ import {HttpResetClass, PagedList} from 'vue-client'
162
+ import Vue from 'vue'
163
+
164
+ export default {
165
+ title: '安检员B',
166
+ data() {
167
+ return {
168
+ model: new PagedList(`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/sql/tel_singleTable_OrderBy`, 5,
169
+ {
170
+ items: '"ts.*,tu.f_userinfo_code,tu.f_user_phone"',
171
+ tablename: '"t_sellinggas ts left join t_userinfo tu on ts.f_userinfo_id = tu.f_userinfo_id"',
172
+ orderitem: '"ts.id desc"'
173
+ }),
174
+ showModal: false,
175
+ user_types: [
176
+ { label: '请选择用户类型', value: '' },
177
+ { label: '民用', value: '民用' },
178
+ { label: '非民用', value: '非民用' }
179
+ ],
180
+ isbusy:false,
181
+ isWrited:''
182
+ }
183
+ },
184
+ ready() {
185
+
186
+ },
187
+ computed: {
188
+
189
+ },
190
+ methods: {
191
+ readCard(){
192
+ this.isbusy = true
193
+ try {
194
+ let handpostData = this.handPosOrgData()
195
+ if (!handpostData) {
196
+ this.isbusy = false
197
+ return
198
+ }
199
+ let senddata = { cloud_url: handpostData.domain }
200
+ let posinfo2 = HostApp.read(handpostData.area, JSON.stringify(senddata))
201
+ if (posinfo2.code == 200) {
202
+ this.model.search(`f_write_card in ('未写卡','写卡失败') and f_state = '有效' and ts.f_card_id = '${posinfo2.msg.CardID}'`)
203
+ this.isbusy = false
204
+ } else {
205
+ this.isbusy = false
206
+ this.$showMessage('读卡失败!')
207
+ }
208
+ }catch (e) {
209
+ console.log(e)
210
+ }finally {
211
+ this.isbusy = false
212
+ }
213
+ },
214
+ selfSearch(args) {
215
+ args.condition +=
216
+ this.model.search(args.condition, args.model)
217
+ },
218
+ async re_writeCard(row) {
219
+ let _this = this
220
+ let http1 = new HttpResetClass()
221
+ let parameter = {
222
+ items: 'id,f_pregas',
223
+ tablename: 't_sellinggas',
224
+ condition: ` f_userinfo_id = ${row.f_userinfo_id} and f_write_card in ('未写卡','写卡失败') and f_state = '有效'`,
225
+ orderitem: 'id'
226
+ }
227
+ let resp = await http1.load('POST', `${this.$androidUtil.getProxyUrl()}/af-telephone/rs/sql/tel_singleTable_OrderBy`, { data: parameter }, {
228
+ resolveMsg: null,
229
+ rejectMsg: null
230
+ })
231
+ if (resp.data.length > 0) {
232
+ await this.$showMessage('此用户存在写卡失败和未写卡的记录,是否重新写卡!', ['confirm', 'cancel']).then(async (res) => {
233
+ if (res !== 'confirm') {
234
+ return
235
+ }
236
+ this.isbusy = true
237
+ let param = {
238
+ condition: `i.f_userinfo_id = '${row.f_userinfo_id}' `,
239
+ orderitem: "f_userinfo_id DESC"
240
+ }
241
+ let resSale = await this.$resetpost(`${_this.$androidUtil.getProxyUrl()}/api/af-revenue/sql/sale_getUser`, { data: param }, {
242
+ resolveMsg: null,
243
+ rejectMsg: null
244
+ })
245
+ if (resSale.data.length > 0) {
246
+ await this.writeCard(resSale.data[0], resp.data[0].id, resp.data[0].f_pregas)
247
+ } else {
248
+ this.isbusy = false
249
+ this.$showMessage('用户参数异常,核对后重新尝试。')
250
+ }
251
+ })
252
+ } else {
253
+ this.$showMessage('此用户未存在写卡失败和未写卡的记录。')
254
+ }
255
+ },
256
+ async writeCard(row, sellid, f_pregas) {
257
+ try {
258
+ let handpostData = this.handPosOrgData()
259
+ console.log('进入获取分公司配置项方法')
260
+ if (!handpostData) {
261
+ this.isbusy = false
262
+ return
263
+ }
264
+ let senddata = { cloud_url: handpostData.domain }
265
+ let posinfo2 = HostApp.read(handpostData.area, JSON.stringify(senddata))
266
+ console.log('拿到了配置项信息')
267
+ console.log('读卡信息==' + JSON.stringify(posinfo2))
268
+ console.log('拿到的信息为:' + JSON.stringify(posinfo2))
269
+ let cardNumber = ''
270
+ let Times = 1
271
+ if (posinfo2.code == 200) {
272
+ console.log('读卡成功!')
273
+ cardNumber = posinfo2.msg.CardID
274
+ Times = posinfo2.msg.Times
275
+ } else {
276
+ this.isbusy = false
277
+ this.$showMessage('读卡失败!')
278
+ }
279
+ if (!cardNumber || cardNumber == '') {
280
+ this.isbusy = false
281
+ this.$showMessage('卡号异常!写卡失败!')
282
+ return
283
+ }
284
+ let params = {
285
+ AREA: handpostData.area, // 分公司
286
+ ulen: 0, // 判断版本
287
+ factory: row.f_alias,
288
+ kmm: '0', // 2019-12-22 查旭说的。给一个0 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
289
+ kzt: '0', // 卡状态,0开户卡,1用户卡(0新开户,1补卡)
290
+ kh: cardNumber, // 卡号
291
+ yhh: row.f_meterid ? row.f_meterid : 0, // 用户号,档案中自己输
292
+ ql: f_pregas, // 预购气量
293
+ csql: '0', // 上次购气量,新开户为0
294
+ ccsql: '0', // 上上次购气量,新开户为0
295
+ cs: Times ? Times + 1 : '1', // 求购气次数,先开户为1
296
+ ljgql: row.f_total_gas_sell, // 当前累计购气量
297
+ bkcs: '0', // 新开户卡,为0
298
+ ljyql: '0', // 累积用气量,有些表要累加原来用气量,新开户卡,为0
299
+ bjql: row.f_police_gas, // 报警气量,t_gasbrand表中
300
+ czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
301
+ tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
302
+ cssqrq: '0', // 上次售气日期,格式为YYYYMMDD
303
+ meterid: row.f_meternumber, // 表号
304
+ money: row.f_preamount, // 购气金额
305
+ dqdm: row.f_area_code, // 精益工业地区代码
306
+ klx: row.f_coding
307
+ }
308
+ // 获取写卡参数
309
+ let data = {
310
+ f_card_id: row.f_card_id + '',
311
+ f_alias: row.f_alias,
312
+ f_user_id: row.f_user_id,
313
+ f_userfiles_id: row.f_userfiles_id
314
+ }
315
+ console.log('获取写卡参数' + JSON.stringify(data))
316
+ let http = new HttpResetClass()
317
+ let cardParams = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/api/af-revenue/logic/stairCard`, { data: data }, {
318
+ resolveMsg: null,
319
+ rejectMsg: '获取写卡参数失败'
320
+ })
321
+ console.log('cardParams===' + JSON.stringify(cardParams))
322
+ // 拼接参数
323
+ params = await Object.assign({}, this.writeCardParams(cardParams), params)
324
+ params.cloud_url = handpostData.domain
325
+ console.log('写卡参数++++++' + JSON.stringify(params))
326
+ let writres = await HostApp.sell(JSON.stringify(params))
327
+ console.log('写卡结果===' + JSON.stringify(writres))
328
+ if (writres.code == '200') {
329
+ this.isWrited = '已写卡'
330
+ await this.updatewritecard('已写卡', sellid)
331
+ this.isbusy = false
332
+ this.$showMessage('写卡成功!')
333
+ } else {
334
+ this.isWrited = '未写卡'
335
+ await this.updatewritecard('未写卡', sellid)
336
+ let msg = typeof writres.msg == 'object' ? JSON.stringify(writres.msg) : writres.msg.toString()
337
+ this.isbusy = false
338
+ this.$showMessage('写卡失败!')
339
+ }
340
+ } catch (msg) {
341
+ if (typeof msg == 'object' && msg.data) {
342
+ this.isbusy = false
343
+ this.$showMessage("写卡失败,请把截图发给管理员!" + msg.data)
344
+ } else {
345
+ this.isbusy = false
346
+ this.$showMessage("写卡失败,请完全退出系统重新再试")
347
+ }
348
+ }
349
+ },
350
+ async updatewritecard(msg, id) {
351
+ let http11 = new HttpResetClass()
352
+ let sqldata = `update t_sellinggas set f_write_card = '${msg}' where id = '${id}'`
353
+ console.log('修改条件===' + JSON.stringify(sqldata))
354
+ http11.load('POST', `${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/runSQL`, {data: {sql: sqldata}}, {
355
+ resolveMsg: null,
356
+ rejectMsg: null
357
+ })
358
+ },
359
+ handPosOrgData() {
360
+ if (Vue.config.telephone != undefined) {
361
+ if (Vue.config.telephone.HandPos != undefined) {
362
+ if (Vue.config.telephone.HandPos.data[0]){
363
+ return {
364
+ domain: Vue.config.telephone.HandPos.data[0].domain,
365
+ area: Vue.config.telephone.HandPos.data[0].area
366
+ }
367
+ }else {
368
+ this.$showMessage("初始化获取POS参数失败")
369
+ return null
370
+ }
371
+ } else {
372
+ this.$showMessage("初始化获取POS参数失败")
373
+ return null
374
+ }
375
+ }
376
+ return null;
377
+ },
378
+
379
+ writeCardParams(cardParams) {
380
+ console.log('common写卡参数,,,' + JSON.stringify(cardParams))
381
+ let result = {
382
+ csql: cardParams.data.sc,
383
+ lastmoney: cardParams.data.scje,
384
+ ccsql: cardParams.data.ssc,
385
+ lastlastmoney: cardParams.data.sscje,
386
+ ljgql: cardParams.data.f_pregas,
387
+ ljyql: cardParams.data.f_pregasall,
388
+ yhh: cardParams.data.f_meterid,
389
+ sxrq: cardParams.data.f_perform_date,
390
+ totalmoney: cardParams.data.f_collection,
391
+ stairversion: cardParams.data.f_stairversion,
392
+ pricedate: cardParams.data.pricedate,
393
+ pricetype: cardParams.data.pricetype
394
+ }
395
+
396
+ // 对阶梯进行处理
397
+ if (cardParams.data.stairprice.includes(';') && cardParams.data.stairamount.includes(';')) {
398
+ let gases = cardParams.data.stairamount.split(';')
399
+ let prices = cardParams.data.stairprice.split(';')
400
+ if (gases.length >= 2) {
401
+ result.stairgas1 = gases[0] !== '' ? gases[0] : 0
402
+ result.stairgas2 = gases[1] !== '' ? gases[1] : 0
403
+ result.stairgas3 = '99999999'
404
+ }
405
+ if (prices.length >= 2) {
406
+ result.stairprice1 = prices[0] !== '' ? prices[0] : 0
407
+ result.stairprice2 = prices[1] !== '' ? prices[1] : 0
408
+ result.stairprice3 = prices[2] !== '' ? prices[2] : 0
409
+ }
410
+ } else {
411
+ result.stairgas1 = '77777777'
412
+ result.stairgas2 = '88888888'
413
+ result.stairgas3 = '99999999'
414
+ result.stairprice1 = cardParams.data.stairprice
415
+ result.stairprice2 = cardParams.data.stairprice
416
+ result.stairprice3 = cardParams.data.stairprice
417
+ }
418
+ return result
419
+ },
420
+ }
421
+ }
422
+ </script>
423
+ <style>
424
+ .app-row {
425
+ background-color: white;
426
+ padding: 10px 10px 0 10px;
427
+ border-bottom: 1px solid rgba(235, 235, 235, 0.5);
428
+ }
429
+
430
+ .search_input {
431
+ border: 0;
432
+ outline: none;
433
+ }
434
+
435
+ .font {
436
+ font: 15px PingFang-SC-Medium;
437
+ color: #666666;
438
+ }
439
+
440
+ .input-font {
441
+ font: 15px PingFang-SC-Medium;
442
+ color: #333333;
443
+ }
444
+
445
+ .btn-font {
446
+ font: 600 16px PingFang-SC-Bold;
447
+ color: #499EDF;
448
+ }
449
+
450
+ .btn-color {
451
+ background-color: #FFFFFF;
452
+ border-radius: 10px;
453
+ border: 1px solid #499EDF;
454
+ }
455
+
456
+ .app-text {
457
+ font-size: 12px;
458
+ }
459
+
460
+ .panel-self {
461
+ border-radius: 10px;
462
+ border: 1px solid #499EDF;
463
+ background-color: #F8F8F8;
464
+ }
465
+
466
+ .yybtn-color {
467
+ border-radius: 4px;
468
+ border: 1px solid #499EDF;
469
+ }
470
+
471
+ .qxbtn-color {
472
+ background-color: #FFFFFF;
473
+ border-radius: 4px;
474
+ border: 1px solid #499EDF;
475
+ }
476
+ </style>