system-clients 3.2.43 → 3.2.45

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,580 +1,577 @@
1
- <template>
2
- <div class="ssoLoadingMain" v-if="!showlogin && isSso">
3
- <img class="ssoLoadingImg" src="../../../static/newStyle/login-do.gif">
4
- </div>
5
- <div class="syslogin" v-if="showlogin">
6
- <img style="position: fixed; left: 50px; top: 50px; height: 70px" src="../../../static/furuike/logo2.jpg">
7
- <div class="login-title" >
8
- <div class="row auto">
9
- <marquee style="width:80%;margin-top:25px"><span style="font-size: 1.8rem;color: white;">{{notice}}</span></marquee>
10
- <div class="login-title-chi" style="white-space: nowrap;margin-right:-5%">
11
- <div v-if="titleShow">
12
- <img src="../../../static/newStyle/login-info.png"/>
13
- <span @click="showus=true">关于我们</span>
14
- </div>
15
- </div>
16
- </div>
17
- </div>
18
-
19
- <modal :show.sync="showus" backdrop="true" width="50%" style="width:auto;">
20
- <article slot="modal-body" class="modal-body" >
21
- <img style="height:100%;width:100%" src="../../../static/newStyle/about-us.png"/>
22
- </article>
23
- <footer slot="modal-footer" class="modal-footer">
24
- </footer>
25
- </modal>
26
-
27
-
28
- <div class="logoew" v-if="logoandroid" >
29
- <div v-if="logoandroid" class="imglogo"></div>
30
- <p class="logocontent">燃气客服系统Android版</p>
31
- <p class="logofooter">(仅浏览器扫描)</p>
32
- </div>
33
- <!--输入框-->
34
- <div class="loginmain">
35
- <!-- <img src="../../../static/login_title1.png" alt="图片加载未完成" class="img-responsive" style="margin: 0 auto; padding-top: 150px;" /> -->
36
- <div class="loginmain-left">
37
- <img class="loginmain-left-img" src="../../../static/newStyle/login-left.png">
38
- </div>
39
- <div class="loginmain-right" style="padding-top: 1%">
40
-
41
- <div style="display: flex;align-items: center;gap: 10px;height: fit-content">
42
- <img style="height: 50px; width: 60px" src="../../../static/furuike/logo1.jpg">
43
- <p @click="theme()" style="white-space: nowrap">{{config.title}}</p>
44
- </div>
45
-
46
-
47
- <form v-show="!login">
48
- <!-- <input type="text" placeholder="用户名" v-model="model.ename" class="usericon">-->
49
- <div class="login-input">
50
- <img src="../../../static/newStyle/login-user.png"/>
51
- <input type="text" style="display: inline;background-color: white!important;" placeholder="用户名" v-model="model.ename"/>
52
- </div>
53
- <div class="login-input">
54
- <img src="../../../static/newStyle/login-pwd.png"/>
55
- <input type="password" placeholder="密码" style="display: inline;background-color: darkgray;" v-model="model.password"
56
- @keyup.enter="confirm('key')"/>
57
- </div>
58
- <div class="login-input-1" v-if="$login.Verification">
59
- <img src="../../../static/newStyle/login-check.png"/>
60
- <input class="login-check" type="text" placeholder="请输入验证码"
61
- v-model="picLyanzhengma" @keyup.enter="confirm('key')"/>
62
- </div>
63
- <div class="login-input-2" v-if="$login.Verification">
64
- <input class="login-check-1" style="display: inline;background-color:#eeeeee !important;"
65
- type="button" @click="createCode" v-model="checkCode"/>
66
- </div>
67
- <div class="login-bt" :style="{marginTop: $login.Verification ? '30%' : '10%'}">
68
- <button type="button" id="login-button" class="login-button" @click.prevent="confirm('click')">登录</button>
69
- </div>
70
- </form>
71
- <div v-show="login" class="login_load">
72
- <img src="../../../static/newStyle/login-do.gif">
73
- </div>
74
- </div>
75
- </div>
76
- <div class="login-foot" v-show="false">
77
- 技术支持:西安奥枫软件有限公司
78
- </div>
79
- <div class="login-foot" v-show="$login.BAinformation">
80
- {{{ $login.BAinformation }}}
81
- </div>
82
-
83
- <modal v-if="depPromptShow" :show.sync="depPromptShow" :backdrop="false" v-ref:modal >
84
- <header slot="modal-header" style="height: 8vh" class="modal-header">
85
- <!--<h4 class="modal-title">登录信息</h4>-->
86
- </header>
87
- <article slot="modal-body" class="modal-body">
88
- <form class="form-horizontal">
89
- <div class="row">
90
- <div class="col-sm-12 form-group">
91
- <label class="col-sm-5 ">当前登录人:</label>
92
- <label style="font-weight:normal">{{$login.f.name}}</label>
93
- </div>
94
- <!--<div class="col-sm-12 form-group" v-if="$login.f.number">-->
95
- <!--<label class="col-sm-5 ">组&nbsp;织&nbsp;编&nbsp;码:</label>-->
96
- <!--<label style="font-weight:normal">{{$login.f.number}}</label>-->
97
- <!-- <div class="col-sm-7">
98
- <span >{{$login.f.number}}</span>
99
- </div> -->
100
- <!--</div>-->
101
- <div class="col-sm-12 form-group">
102
- <label class="col-sm-5">所在销售点:</label>
103
- <label style="font-weight:normal">{{$login.f.deps}}</label>
104
- <!-- <div class="col-sm-7">
105
- <span >{{$login.f.deps}}</span>
106
- </div> -->
107
- </div>
108
- <div class="col-sm-12 " v-if="AppDaiBan !==''">
109
- <label class="col-sm-2">报装待办:</label>
110
- <span style="font-weight:normal">{{AppDaiBan}}</span>
111
- </div>
112
- <div class="col-sm-12 " v-if="OrderDaiBan !==''">
113
- <label class="col-sm-2">预约待办:</label>
114
- <span style="font-weight:normal">{{OrderDaiBan}}</span>
115
- </div>
116
- <div class="col-sm-12 " v-for="daibanitem in safecheckDaiBan">
117
- <label class="col-sm-2">{{daibanitem.oldData.title}}:</label>
118
- <span style="font-weight:normal">{{daibanitem.text}}</span>
119
- </div>
120
- </div>
121
- </form>
122
- </article>
123
- <footer slot="modal-footer" style="height: 8vh" class="modal-footer">
124
- <button class="button_search" @click="depPromptConfirm">确认</button>
125
- <button class="button_clear" @click="depPromptCancel">取消</button>
126
- </footer>
127
- </modal>
128
-
129
- <!-- 修改密码组件 -->
130
- <modify-pw :show.sync="modifyPwShow" v-if="modifyPwShow"></modify-pw>
131
- </div>
132
- </template>
133
-
134
- <script>
135
- import co from 'co'
136
- import $ from 'jquery'
137
- import Vue from 'vue'
138
- import {HttpResetClass} from 'vue-client'
139
-
140
- let daibanJson = require('../../util/Daiban.json')
141
-
142
-
143
- let saveGen = function *(self) {
144
- try {
145
- if(self.$login){
146
- // 账号ename,密码password,是否显示异地登陆
147
- yield self.$login.login(self.model.ename, self.model.password, true)
148
- }
149
- if(self.$appdata){
150
- yield self.$appdata.load()
151
-
152
- }
153
- if (Vue.$heatCompatibility) {
154
- try {
155
- if(self.$loginHeat){
156
- yield self.$loginHeat.login(self.model.ename, self.model.password)
157
- }
158
- if(self.$appdataHeat){
159
- yield self.$appdataHeat.load()
160
- }
161
- } catch (e) {
162
- console.log('热力系统登陆失败!')
163
- }
164
- }
165
- yield self.$getConfig(self, 'Login')
166
- console.log('登录配置', self.config)
167
- if (self.config.isMac) {
168
- // 获取该登录人分公司下的mac配置
169
- let getMacs = yield self.$resetpost('rs/sql/equipmentQuery', {data: {condition: `f_filialeids like '%${self.$login.f.f_orgids}%'`}}, {
170
- resolveMsg: null,
171
- rejectMsg: null
172
- }).catch(() => {
173
- throw new Error('获取mac配置失败')
174
- })
175
- console.log('MAC地址信息', getMacs)
176
- // 获取本地mac地址
177
- let getLocalMac = yield self.$resetget('http://127.0.0.1:8003/loadmac', {
178
- resolveMsg: null,
179
- rejectMsg: null
180
- }).catch(() => {
181
- throw new Error('获取本地mac配置失败')
182
- })
183
- console.log('本地MAC地址信息', getLocalMac)
184
- // 对Mac地址进行匹配
185
- let macValidate = false
186
- for (let i = 0; i < getLocalMac.data.mac.length; i++) {
187
- for (let j = 0; j < getMacs.data.length; j++) {
188
- if (getMacs.data[j].f_mac_number.toLocaleUpperCase() === getLocalMac.data.mac[i]) {
189
- macValidate = true
190
- }
191
- }
192
- }
193
- if (!macValidate) {
194
- throw new Error('Mac地址验证失败, 请联系管理员!!')
195
- }
196
- }
197
- console.log(self.$login.depPrompt)
198
- // 弱口令验证
199
- //跳转过来的不进行验证
200
- if ((!self.otherLogin) && self.config.weakPassword && !(/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/.test(self.model.password))) {
201
- self.$showMessage('登录系统: 此账户的密码过于简单,请修改密码后重新登陆!!!', ['confirm']).then((res) => {
202
- self.modifyPwShow = true
203
- })
204
- } else if ((!self.otherLogin) && self.$login.depPrompt) {
205
- self.depPromptShow = true
206
- if (self.$login.showDaiBan && self.$login.r.includes('展示预约信息')){
207
- // 获取待办
208
- self.getDaiBan()
209
-
210
- }
211
- if (self.$login.showDaiBan && self.$login.r.includes('登录预约信息')){
212
- // 获取待办 在util下有个Daiban.jsond 文件 ,在里面进行配置,在功能权限界面增加登录预约信息
213
- self.getDaiBanA()
214
- }
215
- } else {
216
- self.showlogin = false
217
- self.$goto('home-page', {functions: self.$login.f,config: self.config})
218
- // if (self.otherLogin){
219
- // window.history.pushState(null,null,'')
220
- // }
221
- if (self.$login) {
222
- console.log('登录信息', self.$login.f)
223
- global.login=self.$login.f
224
- console.log('登录信息', global.login)
225
- }
226
- }
227
-
228
- } catch (ret) {
229
- console.error('登录失败', ret)
230
- let msg
231
- if (ret instanceof Error) {
232
- msg = ret
233
- }
234
- if (ret.status === 0) {
235
- msg = '服务连接错误,请确认服务状态'
236
- } else if (ret.status === 401) {
237
- msg = ret.data
238
- } else if (ret.status === 710) {
239
- msg = ret.data
240
- }
241
- self.createCode()
242
- self.picLyanzhengma = ''
243
- yield self.$showMessage(msg)
244
- self.model.ename = ''
245
- self.model.password = ''
246
- self.login = false
247
- $('form').fadeIn(500)
248
- }
249
- }
250
- export default {
251
- title: '登录',
252
- async ready () {
253
- if (window.location.href.includes('ticket')) {
254
- this.isSso = true
255
- this.showlogin = false
256
- let url = window.location.href.split("?")[1]
257
- let obj = {}
258
- for (let params of url.split("&")) {
259
- let kv = params.split("=")
260
- obj[kv[0]] = kv[1]
261
- }
262
- let params = {
263
- st: obj.ticket,
264
- serviceKey: this.config.serviceKey
265
- }
266
- this.$resetpost('/sso/logic/serviceValidate', params,{resolveMsg: null, rejectMsg: null}).then((re) => {
267
- // this.$showMessage("re----" + JSON.stringify(re))
268
- if (re.data.code === 200) {
269
- this.showlogin = false
270
- let condition = `ename = '${re.data.data.userName}'`
271
- this.$resetpost('rs/sql/singleTable', {data: { items: '*', tablename: 't_user', condition: condition}}, {resolveMsg: null, rejectMsg: null}).then((res) => {
272
- if (res.data && res.data.length > 0) {
273
- this.model.ename = res.data[0].ename
274
- this.model.password = res.data[0].password
275
- // this.$showMessage("re----" + JSON.stringify(this.model))
276
- let gen = saveGen(this)
277
- return co(gen)
278
- }
279
- })
280
- } else {
281
- this.showlogin = true
282
- }
283
- this.isSso = false
284
- })
285
- } else {
286
- this.titleShow = this.$appdata.getSingleValue('关于我们')
287
- window.versionTime = window.versionTime ? window.versionTime : new Date().getTime()
288
- this.vTime = this.format(new Date(window.versionTime));
289
- try{
290
- let http = new HttpResetClass()
291
- let res = await http.load('POST', 'rs/sql/singleTable',
292
- {data:{
293
- tablename: 't_changedeclare',
294
- condition: ` f_type ='变更通知' `
295
- }
296
- }, {resolveMsg: null, rejectMsg: null})
297
- if(res.data.length>0){
298
- console.log("---------------获取通知",res.data[0].f_change_message)
299
- this.notice=res.data[0].f_change_message
300
- }
301
- }catch(e){}
302
-
303
- this.loginother();
304
- $('#login-button').click(function (event) {
305
- event.preventDefault()
306
- $('form').fadeOut(500)
307
- })
308
- if (window.location.search && window.location.search.indexOf('af_key') !== -1&& window.location.search.indexOf('af_n') !== -1) {
309
- const subUrl = window.location.search.replace('?af_key=','').split('&af_n=')
310
- console.log(subUrl)
311
- this.model.ename = window.atob(subUrl[0])
312
- this.model.password = window.atob(subUrl[1])
313
- console.log('this.model.ename',this.model.ename)
314
- this.otherLogin = true
315
- this.confirm()
316
- }else{
317
- //跳转不需要验证码
318
- this.createCode()
319
- }
320
- console.log(this.$login)
321
- }
322
- },
323
- data () {
324
- return {
325
- vTime: '',
326
- image:{
327
- img1: '/images/newStyle/login-info.png',
328
- img2: '/images/newStyle/login-con.png',
329
- img3: '/images/newStyle/login-left.png',
330
- img4: '/images/newStyle/login-user.png',
331
- img5: '/images/newStyle/login-pwd.png',
332
- img6: '/images/newStyle/login-check.png',
333
- img7: '/images/newStyle/login-do.png',
334
- },
335
- config: {
336
- isMac: false,
337
- depPrompt: false,
338
- weakPassword: false,
339
- title: '燃气客服系统',
340
- distanceLogin: false,
341
- // 那些角色可以定时获取预约提示
342
- isTip : false,
343
- // 那些角色可以定时获取预约提示
344
- msgRole : '预约处理人员',
345
- // 定时获取提示间隔 单位:分钟
346
- times: 25,
347
- serviceKey: '5d83a22dd2824234b1580ede32530e99'
348
- },
349
- showlogin: true,
350
- isSso: false,
351
- titleShow: true, //标题显示
352
- otherLogin:false,
353
- login: false,
354
- depPromptShow: false,
355
- model: {},
356
- show: false,
357
- checkCode: '',
358
- login_do:true,
359
- picLyanzhengma: '',
360
- // 修改密码弹框展示
361
- modifyPwShow: false,
362
- logoandroid:false,
363
- showus:false,
364
- notice:'',
365
- loginotherflag :true,
366
- // 报建待办
367
- AppDaiBan: '',
368
- //安检待办
369
- safecheckDaiBan:[],
370
- // 预约待处理
371
- OrderDaiBan: ''
372
- }
373
- },
374
- methods: {
375
- //格式化时间
376
- format(dat){
377
- //获取年月日,时间
378
- const year = dat.getFullYear();
379
- const mon = (dat.getMonth()+1) < 10 ? "0"+(dat.getMonth()+1) : dat.getMonth()+1;
380
- const data = dat.getDate() < 10 ? "0"+(dat.getDate()) : dat.getDate();
381
- const hour = dat.getHours() < 10 ? "0"+(dat.getHours()) : dat.getHours();
382
- const min = dat.getMinutes() < 10 ? "0"+(dat.getMinutes()) : dat.getMinutes();
383
- const seon = dat.getSeconds() < 10 ? "0"+(dat.getSeconds()) : dat.getSeconds();
384
-
385
- return year + "-" + mon + "-" + data + " " + hour + ":" + min + ":" + seon;
386
- },
387
- async getDaiBan(){
388
- let http = new HttpResetClass()
389
- let condition = ''
390
- if(this.$login.f.deps!=='柠条塔'){
391
- condition = ` (f_orderstate != '预约成功' and f_orderstate != '预约失败' ) or f_orderstate is null `
392
- } else {
393
- condition =` f_orderstate is null and (f_address in( select f_address from t_user_address where f_slice_area='柠条塔') or f_address like '%柠条塔%') `
394
- }
395
- await http.load('POST', '/rs/sql/singleTable', {data: {
396
- tablename:'t_order_center',
397
- condition:condition
398
- }}, {
399
- resolveMsg: null,
400
- rejectMsg: null
401
- }).then((res) => {
402
- let OrderDaiBan = {}
403
- res.data.forEach(item=>{
404
- OrderDaiBan[item.f_ordertype] = OrderDaiBan[item.f_ordertype] || []
405
- OrderDaiBan[item.f_ordertype].push(item)
406
- })
407
- this.OrderDaiBan = `您有${res.data.length}条需要处理的微信预约业务!`
408
- if (res.data.length> 0){
409
- this.OrderDaiBan += `其中 ${Object.keys(OrderDaiBan).map(key=>`${key}:${OrderDaiBan[key].length}条`).join(', ')}`
410
- }
411
- })
412
- let data = {
413
- condition: '1 = 1',
414
- data: {
415
- orgid: this.$login.f.orgid,
416
- id: this.$login.f.id
417
- }
418
- }
419
- await http.load('POST', '/rs/sql/checkuser', {data: data}, {
420
- resolveMsg: null,
421
- rejectMsg: null
422
- }).then((res) => {
423
- let AppDaiBan = {}
424
- res.data.forEach(item=>{
425
- AppDaiBan[item.defname] = AppDaiBan[item.defname] || []
426
- AppDaiBan[item.defname].push(item)
427
- })
428
- this.AppDaiBan = `您有${res.data.length}条需要处理的报建待办业务!`
429
- if (res.data.length> 0){
430
- this.AppDaiBan += `其中 ${Object.keys(AppDaiBan).map(key=>`${key}:${AppDaiBan[key].length}条`).join(', ')}`
431
- }
432
- })
433
-
434
- },
435
- async getDaiBanA(){
436
- // 是否全局开启待办通知
437
- if (daibanJson.enable) {
438
- console.log("当前获取到待办配置为" + JSON.stringify(daibanJson))
439
- let http = new HttpResetClass()
440
- let daibanArray = []
441
- for (let daibanItem of daibanJson.daiban) {
442
- console.log("开始处理待办任务:" + daibanItem.title + "当前任务状态:" + daibanItem.enable?"开启":"关闭" )
443
- if (daibanItem.enable) { // 控制每一项通知是否开启
444
- let postResult = ''; //提示信息为
445
- await http.load("POST",daibanItem.url,{data:daibanItem.data},{ resolveMsg: null, rejectMsg: null})
446
- .then((res)=>{
447
- let responseData = res.data
448
- for (let item of responseData) {
449
- postResult += eval(daibanItem.text) + "\n"
450
- }
451
- postResult += '\t'
452
- daibanArray.push({text:postResult,oldData:daibanItem})
453
- })
454
- }
455
- }
456
- console.log("安检数据为:"+JSON.stringify(daibanArray))
457
- this.safecheckDaiBan = daibanArray
458
- }else {
459
- console.log("待办提醒全局关闭。")
460
- }
461
-
462
-
463
-
464
-
465
- },
466
-
467
- async loginother(){
468
- if (this.config.distanceLogin) {
469
- if (this.$login && this.$login.getUrlParames('name') ) {
470
- let ename = this.$login.getUrlParames('name');
471
- let logininfo = await this.$resetpost('rs/logic/getLoginData',{data:{ename:ename}},{resolveMsg: null, rejectMsg: null});
472
- if(logininfo.data){
473
- if(logininfo.data.ename && logininfo.data.password){
474
- this.model.ename = logininfo.data.ename
475
- this.model.password =logininfo.data.password
476
- let gen = saveGen(this)
477
- return co(gen)
478
- }
479
- }
480
- }
481
- }
482
- },
483
- theme(){
484
- // var elementList = document.querySelectorAll('body');
485
- // console.log(elementList)
486
- // document.querySelectorAll('body')[0].className='themeTwo'
487
- // var elementList = document.querySelectorAll('body');
488
- // console.log(elementList)
489
- },
490
- onReady () {
491
- this.$emit('ready')
492
- },
493
- confirm (key) {
494
- this.login_do=!this.login_do
495
- // return
496
- if (key == 'key') {
497
- $('form').fadeOut(500)
498
- }
499
- this.login = true
500
- // let gen = saveGen(this)
501
- // return co(gen)
502
- if((!this.otherLogin) && this.$login && this.$login.Verification){
503
- console.log('跳转过来的不走验证')
504
- if(this.picLyanzhengma == '') {
505
- this.$showMessage("请输入验证码!").then(()=>{
506
- this.login = false
507
- $('form').fadeIn(500)
508
- this.createCode()
509
- })
510
- }else if(this.picLyanzhengma.toUpperCase() != this.checkCode ) {
511
- //若输入的验证码与产生的验证码不一致时
512
- this.$showMessage("验证码不正确").then(()=>{
513
- this.login = false
514
- $('form').fadeIn(500)
515
- this.createCode();//刷新验证码
516
- this.picLyanzhengma = '';
517
- })
518
- }else {
519
- this.login = true
520
- let gen = saveGen(this)
521
- return co(gen)
522
- }
523
- }else {
524
- this.login = true
525
- let gen = saveGen(this)
526
- return co(gen)
527
- }
528
- },
529
- createCode(){
530
- let code = "";
531
- let codeLength = 4;//验证码的长度
532
- let random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
533
- 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');//随机数
534
- for (let i = 0; i < codeLength; i++) {
535
- //循环操作
536
- let index = Math.floor(Math.random() * 36);//取得随机数的索引(0~35)
537
- code += random[index];//根据索引取得随机数加到code上
538
- }
539
- this.checkCode = code;//把code值赋给验证码
540
- },
541
-
542
- async depPromptConfirm () {
543
- this.depPromptShow = false
544
- this.showlogin = false
545
- return this.$goto('home-page', {functions: this.$login.f,config: this.config})
546
- },
547
-
548
- depPromptCancel () {
549
- this.depPromptShow = false
550
- this.createCode()
551
- this.picLyanzhengma = ''
552
- this.model.ename = ''
553
- this.model.password = ''
554
- this.login = false
555
- $('form').fadeIn(500)
556
- }
557
- },
558
- watch: {
559
- 'modifyPwShow' (val){
560
- if (!val) {
561
- window.location.reload()
562
- }
563
- }
564
- }
565
- }
566
- </script>
567
-
568
- <style>
569
- .ssoLoadingMain .ssoLoadingImg {
570
- position: absolute;
571
- top:0;
572
- left: 0;
573
- bottom: 0;
574
- right: 0;
575
- margin: auto;
576
- }
577
- .showStyle {
578
- display: none !important;
579
- }
580
- </style>
1
+ <template>
2
+ <div class="ssoLoadingMain" v-if="!showlogin && isSso">
3
+ <img class="ssoLoadingImg" src="../../../static/newStyle/login-do.gif">
4
+ </div>
5
+ <div class="syslogin" v-if="showlogin">
6
+ <img style="position: fixed; left: 50px; top: 50px; height: 70px" src="../../../static/furuike/logo2.jpg">
7
+ <div class="login-title" >
8
+ <div class="row auto">
9
+ <marquee style="width:80%;margin-top:25px"><span style="font-size: 1.8rem;color: white;">{{notice}}</span></marquee>
10
+ <div class="login-title-chi" style="white-space: nowrap;margin-right:-5%">
11
+ <div v-if="titleShow">
12
+ <img src="../../../static/newStyle/login-info.png"/>
13
+ <span @click="showus=true">关于我们</span>
14
+ </div>
15
+ </div>
16
+ </div>
17
+ </div>
18
+
19
+ <modal :show.sync="showus" backdrop="true" width="50%" style="width:auto;">
20
+ <article slot="modal-body" class="modal-body" >
21
+ <img style="height:100%;width:100%" src="../../../static/newStyle/about-us.png"/>
22
+ </article>
23
+ <footer slot="modal-footer" class="modal-footer">
24
+ </footer>
25
+ </modal>
26
+
27
+
28
+ <div class="logoew" v-if="logoandroid" >
29
+ <div v-if="logoandroid" class="imglogo"></div>
30
+ <p class="logocontent">燃气客服系统Android版</p>
31
+ <p class="logofooter">(仅浏览器扫描)</p>
32
+ </div>
33
+ <!--输入框-->
34
+ <div class="loginmain">
35
+ <!-- <img src="../../../static/login_title1.png" alt="图片加载未完成" class="img-responsive" style="margin: 0 auto; padding-top: 150px;" /> -->
36
+ <div class="loginmain-left">
37
+ <img class="loginmain-left-img" src="../../../static/newStyle/login-left.png">
38
+ </div>
39
+ <div class="loginmain-right" style="padding-top: 1%">
40
+
41
+ <div style="display: flex;align-items: center;gap: 10px;height: fit-content">
42
+ <img style="height: 50px; width: 60px" src="../../../static/furuike/logo1.jpg">
43
+ <p @click="theme()" style="white-space: nowrap">{{config.title}}</p>
44
+ </div>
45
+
46
+
47
+ <form v-show="!login">
48
+ <!-- <input type="text" placeholder="用户名" v-model="model.ename" class="usericon">-->
49
+ <div class="login-input">
50
+ <img src="../../../static/newStyle/login-user.png"/>
51
+ <input type="text" style="display: inline;background-color: white!important;" placeholder="用户名" v-model="model.ename"/>
52
+ </div>
53
+ <div class="login-input">
54
+ <img src="../../../static/newStyle/login-pwd.png"/>
55
+ <input type="password" placeholder="密码" style="display: inline;background-color: darkgray;" v-model="model.password"
56
+ @keyup.enter="confirm('key')"/>
57
+ </div>
58
+ <div class="login-input-1" v-if="$login.Verification">
59
+ <img src="../../../static/newStyle/login-check.png"/>
60
+ <input class="login-check" type="text" placeholder="请输入验证码"
61
+ v-model="picLyanzhengma" @keyup.enter="confirm('key')"/>
62
+ </div>
63
+ <div class="login-input-2" v-if="$login.Verification">
64
+ <input class="login-check-1" style="display: inline;background-color:#eeeeee !important;"
65
+ type="button" @click="createCode" v-model="checkCode"/>
66
+ </div>
67
+ <div class="login-bt" :style="{marginTop: $login.Verification ? '30%' : '10%'}">
68
+ <button type="button" id="login-button" class="login-button" @click.prevent="confirm('click')">登录</button>
69
+ </div>
70
+ </form>
71
+ <div v-show="login" class="login_load">
72
+ <img src="../../../static/newStyle/login-do.gif">
73
+ </div>
74
+ </div>
75
+ </div>
76
+ <div class="login-foot" v-show="false">
77
+ 技术支持:西安奥枫软件有限公司
78
+ </div>
79
+ <div class="login-foot" v-show="$login.BAinformation">
80
+ {{{ $login.BAinformation }}}
81
+ </div>
82
+
83
+ <modal v-if="depPromptShow" :show.sync="depPromptShow" :backdrop="false" v-ref:modal >
84
+ <header slot="modal-header" style="height: 8vh" class="modal-header">
85
+ <!--<h4 class="modal-title">登录信息</h4>-->
86
+ </header>
87
+ <article slot="modal-body" class="modal-body">
88
+ <form class="form-horizontal">
89
+ <div class="row">
90
+ <div class="col-sm-12 form-group">
91
+ <label class="col-sm-5 ">当前登录人:</label>
92
+ <label style="font-weight:normal">{{$login.f.name}}</label>
93
+ </div>
94
+ <!--<div class="col-sm-12 form-group" v-if="$login.f.number">-->
95
+ <!--<label class="col-sm-5 ">组&nbsp;织&nbsp;编&nbsp;码:</label>-->
96
+ <!--<label style="font-weight:normal">{{$login.f.number}}</label>-->
97
+ <!-- <div class="col-sm-7">
98
+ <span >{{$login.f.number}}</span>
99
+ </div> -->
100
+ <!--</div>-->
101
+ <div class="col-sm-12 form-group">
102
+ <label class="col-sm-5">所在销售点:</label>
103
+ <label style="font-weight:normal">{{$login.f.deps}}</label>
104
+ <!-- <div class="col-sm-7">
105
+ <span >{{$login.f.deps}}</span>
106
+ </div> -->
107
+ </div>
108
+ <div class="col-sm-12 " v-if="AppDaiBan !==''">
109
+ <label class="col-sm-2">报装待办:</label>
110
+ <span style="font-weight:normal">{{AppDaiBan}}</span>
111
+ </div>
112
+ <div class="col-sm-12 " v-if="OrderDaiBan !==''">
113
+ <label class="col-sm-2">预约待办:</label>
114
+ <span style="font-weight:normal">{{OrderDaiBan}}</span>
115
+ </div>
116
+ <div class="col-sm-12 " v-for="daibanitem in safecheckDaiBan">
117
+ <label class="col-sm-2">{{daibanitem.oldData.title}}:</label>
118
+ <span style="font-weight:normal">{{daibanitem.text}}</span>
119
+ </div>
120
+ </div>
121
+ </form>
122
+ </article>
123
+ <footer slot="modal-footer" style="height: 8vh" class="modal-footer">
124
+ <button class="button_search" @click="depPromptConfirm">确认</button>
125
+ <button class="button_clear" @click="depPromptCancel">取消</button>
126
+ </footer>
127
+ </modal>
128
+
129
+ <!-- 修改密码组件 -->
130
+ <modify-pw :show.sync="modifyPwShow" v-if="modifyPwShow"></modify-pw>
131
+ </div>
132
+ </template>
133
+
134
+ <script>
135
+ import co from 'co'
136
+ import $ from 'jquery'
137
+ import Vue from 'vue'
138
+ import {HttpResetClass} from 'vue-client'
139
+
140
+ let daibanJson = require('../../util/Daiban.json')
141
+
142
+
143
+ let saveGen = function *(self) {
144
+ try {
145
+ if(self.$login){
146
+ // 账号ename,密码password,是否显示异地登陆
147
+ yield self.$login.login(self.model.ename, self.model.password, true)
148
+ }
149
+ if(self.$appdata){
150
+ yield self.$appdata.load()
151
+
152
+ }
153
+ if (Vue.$heatCompatibility) {
154
+ try {
155
+ if(self.$loginHeat){
156
+ yield self.$loginHeat.login(self.model.ename, self.model.password)
157
+ }
158
+ if(self.$appdataHeat){
159
+ yield self.$appdataHeat.load()
160
+ }
161
+ } catch (e) {
162
+ console.log('热力系统登陆失败!')
163
+ }
164
+ }
165
+ yield self.$getConfig(self, 'Login')
166
+ console.log('登录配置', self.config)
167
+ if (self.config.isMac) {
168
+ // 获取该登录人分公司下的mac配置
169
+ let getMacs = yield self.$resetpost('rs/sql/equipmentQuery', {data: {condition: `f_filialeids like '%${self.$login.f.f_orgids}%'`}}, {
170
+ resolveMsg: null,
171
+ rejectMsg: null
172
+ }).catch(() => {
173
+ throw new Error('获取mac配置失败')
174
+ })
175
+ console.log('MAC地址信息', getMacs)
176
+ // 获取本地mac地址
177
+ let getLocalMac = yield self.$resetget('http://127.0.0.1:8003/loadmac', {
178
+ resolveMsg: null,
179
+ rejectMsg: null
180
+ }).catch(() => {
181
+ throw new Error('获取本地mac配置失败')
182
+ })
183
+ console.log('本地MAC地址信息', getLocalMac)
184
+ // 对Mac地址进行匹配
185
+ let macValidate = false
186
+ for (let i = 0; i < getLocalMac.data.mac.length; i++) {
187
+ for (let j = 0; j < getMacs.data.length; j++) {
188
+ if (getMacs.data[j].f_mac_number.toLocaleUpperCase() === getLocalMac.data.mac[i]) {
189
+ macValidate = true
190
+ }
191
+ }
192
+ }
193
+ if (!macValidate) {
194
+ throw new Error('Mac地址验证失败, 请联系管理员!!')
195
+ }
196
+ }
197
+ console.log(self.$login.depPrompt)
198
+ // 弱口令验证
199
+ //跳转过来的不进行验证
200
+ if ((!self.otherLogin) && self.config.weakPassword && !(/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/.test(self.model.password))) {
201
+ self.$showMessage('登录系统: 此账户的密码过于简单,请修改密码后重新登陆!!!', ['confirm']).then((res) => {
202
+ self.modifyPwShow = true
203
+ })
204
+ } else if ((!self.otherLogin) && self.$login.depPrompt) {
205
+ self.depPromptShow = true
206
+ if (self.$login.showDaiBan && self.$login.r.includes('展示预约信息')){
207
+ // 获取待办
208
+ self.getDaiBan()
209
+
210
+ }
211
+ if (self.$login.showDaiBan && self.$login.r.includes('登录预约信息')){
212
+ // 获取待办 在util下有个Daiban.jsond 文件 ,在里面进行配置,在功能权限界面增加登录预约信息
213
+ self.getDaiBanA()
214
+ }
215
+ } else {
216
+ self.showlogin = false
217
+ self.$goto('home-page', {functions: self.$login.f,config: self.config})
218
+ // if (self.otherLogin){
219
+ // window.history.pushState(null,null,'')
220
+ // }
221
+ if (self.$login) {
222
+ console.log('登录信息', self.$login.f)
223
+ global.login=self.$login.f
224
+ console.log('登录信息', global.login)
225
+ }
226
+ }
227
+
228
+ } catch (ret) {
229
+ console.error('登录失败', ret)
230
+ let msg
231
+ if (ret instanceof Error) {
232
+ msg = ret
233
+ }
234
+ if (ret.status === 0) {
235
+ msg = '服务连接错误,请确认服务状态'
236
+ } else if (ret.status === 401) {
237
+ msg = ret.data
238
+ } else if (ret.status === 710) {
239
+ msg = ret.data
240
+ }
241
+ self.createCode()
242
+ self.picLyanzhengma = ''
243
+ yield self.$showMessage(msg)
244
+ self.model.ename = ''
245
+ self.model.password = ''
246
+ self.login = false
247
+ $('form').fadeIn(500)
248
+ }
249
+ }
250
+ export default {
251
+ title: '登录',
252
+ async ready () {
253
+ if (window.location.href.includes('ticket')) {
254
+ this.isSso = true
255
+ this.showlogin = false
256
+ let url = window.location.href.split("?")[1]
257
+ let obj = {}
258
+ for (let params of url.split("&")) {
259
+ let kv = params.split("=")
260
+ obj[kv[0]] = kv[1]
261
+ }
262
+ let params = {
263
+ st: obj.ticket,
264
+ serviceKey: this.config.serviceKey
265
+ }
266
+ this.$resetpost('/sso/logic/serviceValidate', params,{resolveMsg: null, rejectMsg: null}).then((re) => {
267
+ // this.$showMessage("re----" + JSON.stringify(re))
268
+ if (re.data.code === 200) {
269
+ this.showlogin = false
270
+ let condition = `ename = '${re.data.data.userName}'`
271
+ this.$resetpost('rs/sql/singleTable', {data: { items: '*', tablename: 't_user', condition: condition}}, {resolveMsg: null, rejectMsg: null}).then((res) => {
272
+ if (res.data && res.data.length > 0) {
273
+ this.model.ename = res.data[0].ename
274
+ this.model.password = res.data[0].password
275
+ // this.$showMessage("re----" + JSON.stringify(this.model))
276
+ let gen = saveGen(this)
277
+ return co(gen)
278
+ }
279
+ })
280
+ } else {
281
+ this.showlogin = true
282
+ }
283
+ this.isSso = false
284
+ })
285
+ } else {
286
+ this.titleShow = this.$appdata.getSingleValue('关于我们')
287
+ window.versionTime = window.versionTime ? window.versionTime : new Date().getTime()
288
+ this.vTime = this.format(new Date(window.versionTime));
289
+ try{
290
+ let http = new HttpResetClass()
291
+ let res = await http.load('POST', 'rs/sql/singleTable',
292
+ {data:{
293
+ tablename: 't_changedeclare',
294
+ condition: ` f_type ='变更通知' `
295
+ }
296
+ }, {resolveMsg: null, rejectMsg: null})
297
+ if(res.data.length>0){
298
+ console.log("---------------获取通知",res.data[0].f_change_message)
299
+ this.notice=res.data[0].f_change_message
300
+ }
301
+ }catch(e){}
302
+
303
+ this.loginother();
304
+ $('#login-button').click(function (event) {
305
+ event.preventDefault()
306
+ $('form').fadeOut(500)
307
+ })
308
+ if (window.location.search && window.location.search.indexOf('af_key') !== -1&& window.location.search.indexOf('af_n') !== -1) {
309
+ const subUrl = window.location.search.replace('?af_key=','').split('&af_n=')
310
+ console.log(subUrl)
311
+ this.model.ename = window.atob(subUrl[0])
312
+ this.model.password = window.atob(subUrl[1])
313
+ console.log('this.model.ename',this.model.ename)
314
+ this.otherLogin = true
315
+ this.confirm()
316
+ }else{
317
+ //跳转不需要验证码
318
+ this.createCode()
319
+ }
320
+ console.log(this.$login)
321
+ }
322
+ },
323
+ data () {
324
+ return {
325
+ vTime: '',
326
+ image:{
327
+ img1: '/images/newStyle/login-info.png',
328
+ img2: '/images/newStyle/login-con.png',
329
+ img3: '/images/newStyle/login-left.png',
330
+ img4: '/images/newStyle/login-user.png',
331
+ img5: '/images/newStyle/login-pwd.png',
332
+ img6: '/images/newStyle/login-check.png',
333
+ img7: '/images/newStyle/login-do.png',
334
+ },
335
+ config: {
336
+ isMac: false,
337
+ depPrompt: false,
338
+ weakPassword: false,
339
+ title: '燃气客服系统',
340
+ distanceLogin: false,
341
+ // 那些角色可以定时获取预约提示
342
+ isTip : false,
343
+ // 那些角色可以定时获取预约提示
344
+ msgRole : '预约处理人员',
345
+ // 定时获取提示间隔 单位:分钟
346
+ times: 25,
347
+ serviceKey: '5d83a22dd2824234b1580ede32530e99'
348
+ },
349
+ showlogin: true,
350
+ isSso: false,
351
+ titleShow: true, //标题显示
352
+ otherLogin:false,
353
+ login: false,
354
+ depPromptShow: false,
355
+ model: {},
356
+ show: false,
357
+ checkCode: '',
358
+ login_do:true,
359
+ picLyanzhengma: '',
360
+ // 修改密码弹框展示
361
+ modifyPwShow: false,
362
+ logoandroid:false,
363
+ showus:false,
364
+ notice:'',
365
+ loginotherflag :true,
366
+ // 报建待办
367
+ AppDaiBan: '',
368
+ //安检待办
369
+ safecheckDaiBan:[],
370
+ // 预约待处理
371
+ OrderDaiBan: ''
372
+ }
373
+ },
374
+ methods: {
375
+ //格式化时间
376
+ format(dat){
377
+ //获取年月日,时间
378
+ const year = dat.getFullYear();
379
+ const mon = (dat.getMonth()+1) < 10 ? "0"+(dat.getMonth()+1) : dat.getMonth()+1;
380
+ const data = dat.getDate() < 10 ? "0"+(dat.getDate()) : dat.getDate();
381
+ const hour = dat.getHours() < 10 ? "0"+(dat.getHours()) : dat.getHours();
382
+ const min = dat.getMinutes() < 10 ? "0"+(dat.getMinutes()) : dat.getMinutes();
383
+ const seon = dat.getSeconds() < 10 ? "0"+(dat.getSeconds()) : dat.getSeconds();
384
+
385
+ return year + "-" + mon + "-" + data + " " + hour + ":" + min + ":" + seon;
386
+ },
387
+ async getDaiBan(){
388
+ let http = new HttpResetClass()
389
+ let condition = ''
390
+ if(this.$login.f.deps!=='柠条塔'){
391
+ condition = ` (f_orderstate != '预约成功' and f_orderstate != '预约失败' ) or f_orderstate is null `
392
+ } else {
393
+ condition =` f_orderstate is null and (f_address in( select f_address from t_user_address where f_slice_area='柠条塔') or f_address like '%柠条塔%') `
394
+ }
395
+ await http.load('POST', '/rs/sql/singleTable', {data: {
396
+ tablename:'t_order_center',
397
+ condition:condition
398
+ }}, {
399
+ resolveMsg: null,
400
+ rejectMsg: null
401
+ }).then((res) => {
402
+ let OrderDaiBan = {}
403
+ res.data.forEach(item=>{
404
+ OrderDaiBan[item.f_ordertype] = OrderDaiBan[item.f_ordertype] || []
405
+ OrderDaiBan[item.f_ordertype].push(item)
406
+ })
407
+ this.OrderDaiBan = `您有${res.data.length}条需要处理的微信预约业务!`
408
+ if (res.data.length> 0){
409
+ this.OrderDaiBan += `其中 ${Object.keys(OrderDaiBan).map(key=>`${key}:${OrderDaiBan[key].length}条`).join(', ')}`
410
+ }
411
+ })
412
+ let data = {
413
+ condition: '1 = 1',
414
+ data: {
415
+ orgid: this.$login.f.orgid,
416
+ id: this.$login.f.id
417
+ }
418
+ }
419
+ await http.load('POST', '/rs/sql/checkuser', {data: data}, {
420
+ resolveMsg: null,
421
+ rejectMsg: null
422
+ }).then((res) => {
423
+ let AppDaiBan = {}
424
+ res.data.forEach(item=>{
425
+ AppDaiBan[item.defname] = AppDaiBan[item.defname] || []
426
+ AppDaiBan[item.defname].push(item)
427
+ })
428
+ this.AppDaiBan = `您有${res.data.length}条需要处理的报建待办业务!`
429
+ if (res.data.length> 0){
430
+ this.AppDaiBan += `其中 ${Object.keys(AppDaiBan).map(key=>`${key}:${AppDaiBan[key].length}条`).join(', ')}`
431
+ }
432
+ })
433
+
434
+ },
435
+ async getDaiBanA(){
436
+ // 是否全局开启待办通知
437
+ if (daibanJson.enable) {
438
+ console.log("当前获取到待办配置为" + JSON.stringify(daibanJson))
439
+ let http = new HttpResetClass()
440
+ let daibanArray = []
441
+ for (let daibanItem of daibanJson.daiban) {
442
+ console.log("开始处理待办任务:" + daibanItem.title + "当前任务状态:" + daibanItem.enable?"开启":"关闭" )
443
+ if (daibanItem.enable) { // 控制每一项通知是否开启
444
+ let postResult = ''; //提示信息为
445
+ await http.load("POST",daibanItem.url,{data:daibanItem.data},{ resolveMsg: null, rejectMsg: null})
446
+ .then((res)=>{
447
+ let responseData = res.data
448
+ for (let item of responseData) {
449
+ postResult += eval(daibanItem.text) + "\n"
450
+ }
451
+ postResult += '\t'
452
+ daibanArray.push({text:postResult,oldData:daibanItem})
453
+ })
454
+ }
455
+ }
456
+ console.log("安检数据为:"+JSON.stringify(daibanArray))
457
+ this.safecheckDaiBan = daibanArray
458
+ }else {
459
+ console.log("待办提醒全局关闭。")
460
+ }
461
+
462
+
463
+
464
+
465
+ },
466
+
467
+ async loginother(){
468
+ if (this.config.distanceLogin) {
469
+ if (this.$login && this.$login.getUrlParames('name') ) {
470
+ let ename = this.$login.getUrlParames('name');
471
+ let logininfo = await this.$resetpost('rs/logic/getLoginData',{data:{ename:ename}},{resolveMsg: null, rejectMsg: null});
472
+ if(logininfo.data){
473
+ if(logininfo.data.ename && logininfo.data.password){
474
+ this.model.ename = logininfo.data.ename
475
+ this.model.password =logininfo.data.password
476
+ let gen = saveGen(this)
477
+ return co(gen)
478
+ }
479
+ }
480
+ }
481
+ }
482
+ },
483
+ theme(){
484
+ // var elementList = document.querySelectorAll('body');
485
+ // console.log(elementList)
486
+ // document.querySelectorAll('body')[0].className='themeTwo'
487
+ // var elementList = document.querySelectorAll('body');
488
+ // console.log(elementList)
489
+ },
490
+ onReady () {
491
+ this.$emit('ready')
492
+ },
493
+ confirm (key) {
494
+ this.login_do=!this.login_do
495
+ // return
496
+ if (key == 'key') {
497
+ $('form').fadeOut(500)
498
+ }
499
+ this.login = true
500
+ // let gen = saveGen(this)
501
+ // return co(gen)
502
+ if((!this.otherLogin) && this.$login && this.$login.Verification){
503
+ console.log('跳转过来的不走验证')
504
+ if(this.picLyanzhengma == '') {
505
+ this.$showMessage("请输入验证码!").then(()=>{
506
+ this.login = false
507
+ $('form').fadeIn(500)
508
+ this.createCode()
509
+ })
510
+ }else if(this.picLyanzhengma.toUpperCase() != this.checkCode ) {
511
+ //若输入的验证码与产生的验证码不一致时
512
+ this.$showMessage("验证码不正确").then(()=>{
513
+ this.login = false
514
+ $('form').fadeIn(500)
515
+ this.createCode();//刷新验证码
516
+ this.picLyanzhengma = '';
517
+ })
518
+ }else {
519
+ this.login = true
520
+ let gen = saveGen(this)
521
+ return co(gen)
522
+ }
523
+ }else {
524
+ this.login = true
525
+ let gen = saveGen(this)
526
+ return co(gen)
527
+ }
528
+ },
529
+ createCode(){
530
+ let code = "";
531
+ let codeLength = 4;//验证码的长度
532
+ let random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
533
+ 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');//随机数
534
+ for (let i = 0; i < codeLength; i++) {
535
+ //循环操作
536
+ let index = Math.floor(Math.random() * 36);//取得随机数的索引(0~35)
537
+ code += random[index];//根据索引取得随机数加到code上
538
+ }
539
+ this.checkCode = code;//把code值赋给验证码
540
+ },
541
+
542
+ async depPromptConfirm () {
543
+ this.depPromptShow = false
544
+ this.showlogin = false
545
+ return this.$goto('home-page', {functions: this.$login.f,config: this.config})
546
+ },
547
+
548
+ depPromptCancel () {
549
+ this.depPromptShow = false
550
+ this.createCode()
551
+ this.picLyanzhengma = ''
552
+ this.model.ename = ''
553
+ this.model.password = ''
554
+ this.login = false
555
+ $('form').fadeIn(500)
556
+ }
557
+ },
558
+ watch: {
559
+ 'modifyPwShow' (val){
560
+ if (!val) {
561
+ window.location.reload()
562
+ }
563
+ }
564
+ }
565
+ }
566
+ </script>
567
+
568
+ <style>
569
+ .ssoLoadingMain .ssoLoadingImg {
570
+ position: absolute;
571
+ top:0;
572
+ left: 0;
573
+ bottom: 0;
574
+ right: 0;
575
+ margin: auto;
576
+ }
577
+ </style>