system-clients 3.2.39 → 3.2.41

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