system-clients 3.2.67 → 3.2.68

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,869 +1,864 @@
1
- <template>
2
- <div @click="hindsetting1()" :class="{'with-watermark':showwatermakeflag}">
3
- <span class="newTip" transition="newTip" @click="tipClick" v-if="newTipShow">
4
- <span>您有一条新提醒</span>
5
- </span>
6
- <!-- <div class="system-main" id="box" v-el:box v-if="!isManger">-->
7
- <!-- <div class="system-logo" style="height: auto">-->
8
- <!-- <img :src="imgs.logoimg" alt=""/>-->
9
- <!-- <label>{{systemname}}</label>-->
10
- <!-- <div class="system-logo-chi" >-->
11
- <!-- <div v-if="userpane" class="auto system-logo-prompt" style="float: right">-->
12
- <!-- <span>{{orgpathnames}}</span>-->
13
- <!-- </div>-->
14
- <!-- &lt;!&ndash;<div class="system-logo-chi-img1" style="float: right" @mouseenter="mouseenteruser()" @mouseleave="mouseleaveuser()"></div>&ndash;&gt;-->
15
- <!-- <span style="float: right; padding-top: 2px" @mouseenter="mouseenteruser()" @mouseleave="mouseleaveuser()" class="system-logo-chi-span-1">{{$login.f.name}}</span>-->
16
- <!-- <span style="border-left: 1px solid;float: right;padding-top: 2px" class="system-logo-chi-span-1"> <img src="../../static/newStyle/login-f.png" height="20" width="20"> </span>-->
17
- <!-- <a href="index.html" onclick="return confirm('您确定要退出系统吗?');" style="float: right;padding-top: 2px">-->
18
- <!-- <img src="../../static/newStyle/system-off.png" alt="" >-->
19
- <!-- <span class="system-logo-chi-span-1">退出系统</span>-->
20
- <!-- </a>-->
21
- <!-- <div style="float: right" :class="{'dropstyle':setting,'dropstyle-1':!setting}">-->
22
- <!-- <dropdown class="auto" >-->
23
- <!-- <span data-toggle="dropdown" @click="hindsetting()" >-->
24
- <!-- <img :src="srcsetting" alt=""><span>系统设置</span>-->
25
- <!-- </span>-->
26
- <!-- <ul slot="dropdown-menu" class="dropdown-menu dropdown-menu-up dropstyle-chi" >-->
27
- <!-- &lt;!&ndash; <li>系统信息及设置</li>&ndash;&gt;-->
28
- <!-- <li style="color: #ffffff;white-space: nowrap" @click="show=true">修改密码</li>-->
29
- <!-- <li style="color: #ffffff;white-space: nowrap" @click="AddChangeMsgShow=true">系统版本</li>-->
30
- <!-- </ul>-->
31
- <!-- </dropdown>-->
32
- <!-- </div>-->
33
-
34
- <!-- </div>-->
35
- <!-- </div>-->
36
- <!-- <div class="system-left tree-flex" :class="{'system-left-1': !treeOrIcon}" id="top" v-el:top >-->
37
- <!-- <div class="system-left-chi" :class="{'system-left-icon': !treeOrIcon}" >-->
38
- <!-- <div class="span system-left-tree" >-->
39
- <!-- <left-tree :functions='functions.functions' :userid='userid' @isnodo="isnodo" :treeOrIcon="treeOrIcon" :tabs="tabs" v-ref:tree></left-tree>-->
40
- <!-- &lt;!&ndash; <icon-tree :functions='functions.functions' :userid='userid' v-show="!treeOrIcon"></icon-tree>&ndash;&gt;-->
41
- <!-- </div>-->
42
- <!-- </div>-->
43
- <!-- <div class="system-foot-stretch" >-->
44
- <!-- <a @click="changeShow()"><img src="../../static/images/lefticon/菜单伸缩.png" alt=""></a>-->
45
- <!-- </div>-->
46
- <!-- </div>-->
47
-
48
-
49
- <!-- <div class="system-right" :class="{'system-right-1': !treeOrIcon}" id="bottom" v-el:bottom>-->
50
- <!-- <div class="span">-->
51
- <!-- <echarts-box v-if="$refs.mic.tabs.length === 0"></echarts-box>-->
52
- <!-- <dynamic :comps='[]' :showup="true" :showhide="false" name='main' :selecttab.sync="selecttab" @tab-changed="tabChange" @tabscg="tabcg" v-ref:mic v-show="!($refs.mic.tabs.length === 0)"></dynamic>-->
53
- <!-- </div>-->
54
- <!-- </div>-->
55
- <!-- <div class="system-foot" v-el:bottom>-->
56
-
57
- <!-- <div class="system-foot-box">-->
58
-
59
- <!-- </div>-->
60
- <!-- </div>-->
61
- <!-- </div>-->
62
- <div class='flex-row system-main' id="box" v-el:box v-if="!isManger">
63
- <div class="auto login-operator1" v-if="$refs.mic.tabs.length === 0">
64
- <span>
65
- <img
66
- src="../../assets/people.png" height="15" width="15">
67
- 登录人:</span>
68
- <label>{{ orgpathnames }}</label>
69
- </div>
70
- <div class="system-left tree-flex" :class="{'tree-flex-icon': !treeOrIcon}" id="top" v-el:top>
71
- <div class="system-left-chi" :class="{'system-left-icon': !treeOrIcon}">
72
- <div class="span system-left-tree " style="height:85%">
73
- <h3>{{ systemname }}</h3>
74
- <!-- <div class="span" style="margin-bottom:10px;padding-bottom:5px;padding-top:5px;flex: 1;border-top: 1px solid #e5e5e5;border-bottom: 1px solid #e5e5e5;">-->
75
- <left-tree :functions='functions.functions' :userid='userid' @isnodo="isnodo" v-show="treeOrIcon"
76
- :tabs="tabs" v-ref:tree></left-tree>
77
- <!--&lt;!&ndash; <icon-tree :functions='functions.functions' :userid='userid' v-show="!treeOrIcon"></icon-tree>&ndash;&gt;-->
78
- </div>
79
-
80
- <div class="tree-flex-footer">
81
- <!-- <a @click="changeShow()"><img :src="imgs.open" alt=""><span v-if="treeOrIcon">菜单伸缩</span></a>-->
82
- <!-- <a><img src="../../../static/treeset.png" alt="">系统设置</a> -->
83
- <dropdown class="auto">
84
- <button type="button" data-toggle="dropdown">
85
- <img :src="imgs.set" alt=""><span v-if="treeOrIcon">系统设置</span>
86
- </button>
87
- <ul slot="dropdown-menu" class="dropdown-menu dropdown-menu-up">
88
- <li>系统信息及设置</li>
89
- <!-- <li>{{name}}</li> -->
90
- <li>{{ date }}</li>
91
- <li @click="openUrl()">售后服务</li>
92
- <li @click="show=true">修改密码</li>
93
- <li @click="AddChangeMsgShow=true">系统版本:V3.0</li>
94
- </ul>
95
-
96
- </dropdown>
97
- <dropdown class="auto">
98
- <a href="index.html" @click.prevent="logOut">
99
- <img :src="imgs.out" alt=""><span v-if="treeOrIcon">退出系统</span>
100
- </a>
101
- </dropdown>
102
- </div>
103
- </div>
104
- </div>
105
- <!-- <div class="line" id="line" v-show="treeOrIcon" v-el:line></div> -->
106
-
107
- <div class="flex right-bg system-right" id="bottom" v-el:bottom>
108
- <!-- <operator-badge></operator-badge> -->
109
- <div class="span">
110
- <echarts-box v-if="$refs.mic.tabs.length === 0"></echarts-box>
111
- <dynamic :comps='[]' name='main' :selecttab.sync="selecttab" :orgpathnames="orgpathnames"
112
- @tab-changed="tabChange" @tabscg="tabcg" v-ref:mic v-show="!($refs.mic.tabs.length === 0)"></dynamic>
113
- </div>
114
- </div>
115
- </div>
116
- <div v-show="isManger">
117
- <route v-ref:route></route>
118
- </div>
119
- <modal v-if="newTipContextShow" :show.sync="newTipContextShow" :backdrop="false">
120
- <header slot="modal-header" style="display:none"> </header>
121
- <article slot="modal-body" class="modal-body">
122
- <form class="form-horizontal">
123
- <div class="row">
124
- <div class="col-sm-12 " v-if="AppDaiBan !==''">
125
- <label class="col-sm-2">报装待办:</label>
126
- <span style="font-weight:normal">{{AppDaiBan}}</span>
127
- </div>
128
- <div class="col-sm-12 " v-if="OrderDaiBan !==''">
129
- <label class="col-sm-2">预约待办:</label>
130
- <span style="font-weight:normal">{{OrderDaiBan}}</span>
131
- </div>
132
- </div>
133
- </form>
134
- </article>
135
- <footer slot="modal-footer" style="height: 8vh" class="modal-footer">
136
- <button class="button_search" @click="newTipContextShow = false">确认</button>
137
- </footer>
138
- </modal>
139
-
140
- <!-- 变更录入 模态框 -->
141
- <add-changemsg :show="AddChangeMsgShow" v-on:toggle="AddChangeMsgShow = false"></add-changemsg>
142
- <!-- 修改密码组件 -->
143
- <modify-pw :show.sync="show" v-if="show"></modify-pw>
144
- <!-- 修改密码模态框 -->
145
- </div>
146
- </template>
147
-
148
- <script>
149
- import vue from 'vue'
150
- import co from 'co'
151
- import {HttpResetClass} from "vue-client";
152
-
153
- let getwartermakr = async function (self) {
154
- let param = {
155
- tablename: 't_singlevalue',
156
- condition: " 1=1 and name=\'水印内容\'"
157
- };
158
- let result = await self.$resetpost('rs/sql/saleSingleTable', {data: param}, {resolveMsg: null, rejectMsg: null});
159
- if (result && result.data.length > 0) {
160
- self.showwatermakeflag = true;
161
- createWaterMark(result.data[0].value);
162
- } else {
163
- self.showwatermakeflag = false;
164
- }
165
- }
166
-
167
- let createWaterMark = function (userName) {
168
- let style;
169
- if (style) style.remove();
170
- let width = window.parseInt(document.body.clientWidth);
171
- let canvasWidth = width / window.parseInt(width / 320);
172
- let fontFamily = window.getComputedStyle(document.body)["font-family"];
173
- let canvas = document.createElement("canvas");
174
- canvas.width = canvasWidth;
175
- canvas.height = 200;
176
- let ctx = canvas.getContext("2d");
177
- ctx.rotate((-20 * Math.PI) / 180);
178
- ctx.font = `20px ${fontFamily}`;
179
- ctx.fillStyle = "rgba(8,8,8,.1)";
180
- ctx.fillText(userName, 50, 200);
181
- let imgSrc = canvas.toDataURL("image/png");
182
- style = document.createElement("style");
183
- style.innerHTML = `.with-watermark:before{
184
- content: "";
185
- width: 100%;
186
- height: 100%;
187
- display: block;
188
- position: absolute;
189
- background-image: url("${imgSrc}");
190
- }`;
191
- (document.head.append || document.head.appendChild).apply(document.head, [style]);
192
- }
193
-
194
- window.onunload = () => {
195
- vue.http({url: `rs/user/update/${this.$login.f.ename}`, method: 'GET'})
196
- }
197
- window.onbeforeunload = () => {
198
- vue.http({url: `rs/user/update/${this.$login.f.ename}`, method: 'GET'})
199
- }
200
- export default {
201
- title: '主界面',
202
- props: ['functions', 'userid', 'config'],
203
- data() {
204
- return {
205
- // 页面提示信息定时器
206
- interval: null,
207
- newTipShow: false,
208
- newTipContextShow: false,
209
- AppDaiBan: '',
210
- OrderDaiBan: '',
211
- // 左侧树下部三个小图标
212
- imgs: {
213
- open: '/images/lefticon/菜单伸缩.png',
214
- set: '/images/lefticon/系统设置.png',
215
- out: '/images/lefticon/退出系统.png',
216
- img1: '/images/newStyle/login-user.png',
217
- logoimg: '/static/newStyle/fife.png'
218
- // img2: '/images/lefticon/退出系统.png',
219
- },
220
- treeOrIcon: false,
221
- isManger: false,
222
- show: false,
223
- orgpathnames: `${this.$login.f.f_fengongsi}-${this.$login.f.f_parentname}-${this.$login.f.name}`,
224
- systemname: '客服系统',
225
- date: this.$login.toStandardDateString(),
226
- tabs: [], //已初始化页签数组
227
- selecttab: '',
228
- setting: true,
229
- srcsetting: '../../static/newStyle/setting.png',
230
- showwatermakeflag: false,
231
- // headerHint: true, // 右侧顶部提示信息
232
- // value: 25645.26,
233
- // AddChangeMsgShow: false,
234
- // showsum: false
235
- lockReconnect: false, // 避免重复连接
236
- timeout: 10000, // 10秒发一次心跳
237
- connectNumber: 10, // 重连次数
238
- timeoutObj: null,
239
- serverTimeoutObj: null
240
- }
241
- },
242
- ready() {
243
- //使用socket发送代办消息提醒
244
- vue.prototype.$connectNumber = this.connectNumber
245
- this.initWebSocket()
246
- getwartermakr(this);
247
- let component = this.$login.getUrlCompileParames('component')
248
- if (component) {
249
- this.isManger = true
250
- this.$refs.route.init(component, {data: this.functions.functions})
251
- }
252
- if (this.$login.f.password == '1') {
253
- this.$showMessage('本地登录系统为此账户的初始密码,请确认修改密码!!!', ['confirm', 'cancel']).then((res) => {
254
- if (res == 'confirm')
255
- this.show = true
256
- })
257
- }
258
- console.log("系统名称", this.$appdata.getSingleValue("系统名称"))
259
- this.systemname = this.$appdata.getSingleValue("系统名称") ? this.$appdata.getSingleValue("系统名称") : '客服系统'
260
- // let oBox = this.getElement("box")
261
- // let oTop = this.getElement("top")
262
- // let oBottom = this.getElement("bottom")
263
- // let oLine = this.getElement("line")
264
- // let that = this
265
- // oLine.onmousedown = function(e) {
266
- // let disX = (e || event).clientX
267
- // oLine.left = oLine.offsetLeft
268
- // document.onmousemove = function(e) {
269
- // let iT = oLine.left + ((e || event).clientX - disX)
270
- // var e = e || window.event
271
- // let tarnameb = e.target || e.srcElement
272
- // let maxT = oBox.clientWight - oLine.offsetWidth
273
- // oLine.style.margin = 0
274
- // iT < 0 && (iT = 0)
275
- // iT > maxT && (iT = maxT)
276
- // oLine.style.left = oTop.style.width = iT + "px"
277
- // oBottom.style.width = oBox.clientWidth - iT + "px"
278
- // that.$set('treeWidth', iT)
279
- // return false
280
- // }
281
- // document.onmouseup = function() {
282
- // document.onmousemove = null
283
- // document.onmouseup = null
284
- // oLine.releaseCapture && oLine.releaseCapture()
285
- // }
286
- // oLine.setCapture && oLine.setCapture()
287
- // return false
288
- // }
289
- this.changeShow()
290
- this.gotoWorkOrderSite()
291
- // 获取预约列表
292
- this.functions.f_role_name && this.functions.f_role_name.includes(this.config.msgRole) && this.config.isTip && this.getOrderList()
293
- },
294
- methods: {
295
- // 清除
296
- reset () {
297
- clearTimeout(this.timeoutObj)
298
- clearTimeout(this.serverTimeoutObj)
299
- },
300
- //每隔几分钟发送一个固定信息给服务端,服务端收到后回复一个固定信息
301
- //如果服务端在一定时间内没有收到信息,就认为客户端断开了,服务端就会断开连接
302
- // 发送心跳--确保连接有效
303
- start () {
304
- // 重置
305
- vue.prototype.$connectNumber = this.connectNumber // 重置重连次数
306
- this.timeoutObj = setTimeout(() => {
307
- this.$socket.send('ping')
308
- console.log('ping!')
309
- this.serverTimeoutObj = setTimeout(() => {
310
- this.$socket.close()
311
- }, this.timeout)
312
- }, this.timeout)
313
- },
314
- // 重连
315
- reconnect () {
316
- if (this.lockReconnect) return
317
- // if (this.$connectNumber <= 0) {
318
- // vue.showMessage('连接已断开,将无法接收消息,请重新登录', ['confirm']).then((res) => {
319
- // if (res === 'confirm') {
320
- // location.reload()
321
- // }
322
- // })
323
- // return
324
- // }
325
- // this.$connectNumber--
326
- setTimeout(() => {
327
- console.log('连接异常,尝试重新连接。。。。')
328
- this.initWebSocket()
329
- this.lockReconnect = false
330
- }, 1000 * 60)
331
- },
332
- // 初始化
333
- initWebSocket () {
334
- let path = `ws://${location.host}/ws?token=${this.$login.f.id}`
335
- try {
336
- if ('WebSocket' in window) {
337
- // 创建对象
338
- vue.prototype.$socket = new WebSocket(path)
339
- } else {
340
- this.$showMessage('您的浏览器不支持websocket的协议,建议使用新版谷歌浏览器,请勿使用IE浏览器,360浏览器请使用极速模式,不要使用兼容模式!"')
341
- }
342
- } catch (e) {
343
- this.reconnect()
344
- }
345
-
346
- this.$socket.onopen = this.onOpen // 连接成功
347
- this.$socket.onmessage = this.onMessage // 收到消息时回调
348
- this.$socket.onclose = this.onClose // 连接关闭时回调
349
- this.$socket.onerror = this.onError // 通讯异常
350
- },
351
- // 通讯异常
352
- onError () {
353
- console.log('通讯异常')
354
- this.reconnect()
355
- },
356
- // 连接成功
357
- onOpen () {
358
- console.log('webSocket连接成功')
359
- this.start()//每十秒发送心跳包,确保连接状态有效
360
- },
361
- // 收到消息时回调函数
362
- onMessage (event) {
363
- if (event.data === 'pong') { //建立心跳机制发送ping,返回pong
364
- this.reset() // 重置心跳
365
- this.start() // 重新开始心跳
366
- return
367
- }
368
- //不是pong消息,就是服务器返回的消息(提示消息)
369
-
370
- let data = JSON.parse(event.data)
371
- console.log('收到消息', data)
372
- //向所有子组件广播一个名为'onMessage'的事件,并传递一个数据参数'data'。
373
- this.$broadcast('onMessage', data)
374
- //作用是显示一个消息。
375
- this.$showMessage(data.message)
376
- },
377
- // 关闭连接时回调函数
378
- onClose () {
379
- console.log('webSocket连接断开')
380
- this.reset()
381
- this.reconnect() // 重连
382
- },
383
- getOrderList(){
384
- let times = this.config.times * 60 * 1000
385
- console.log("=定时提示间隔=", times)
386
- try {
387
- this.interval = setInterval(() => {
388
- this.getDaiBan()
389
- }, times)
390
- } catch (error) {
391
- console.log('捕获到异常', error)
392
- }
393
- },
394
- async getDaiBan(){
395
- this.OrderDaiBan = ''
396
- this.AppDaiBan = ''
397
- let http = new HttpResetClass()
398
- await http.load('POST', '/rs/sql/singleTable', {data: {
399
- tablename:'t_order_center',
400
- condition:` (f_orderstate != '预约成功' and f_orgstr ='${this.$login.f.orgid}' and f_orderstate != '预约失败' ) or f_orderstate is null`
401
- }}, {
402
- resolveMsg: null,
403
- rejectMsg: null
404
- }).then((res) => {
405
- let OrderDaiBan = {}
406
- res.data.forEach(item=>{
407
- OrderDaiBan[item.f_ordertype] = OrderDaiBan[item.f_ordertype] || []
408
- OrderDaiBan[item.f_ordertype].push(item)
409
- })
410
- if (res.data.length> 0){
411
- this.OrderDaiBan = `您有${res.data.length}条需要处理的微信预约业务!`
412
- this.OrderDaiBan += `其中 ${Object.keys(OrderDaiBan).map(key=>`${key}:${OrderDaiBan[key].length}条`).join(', ')}`
413
- }
414
- })
415
- let data = {
416
- condition: '1 = 1',
417
- data: {
418
- orgid: this.$login.f.orgid,
419
- id: this.$login.f.id
420
- }
421
- }
422
- await http.load('POST', '/rs/sql/checkuser', {data: data}, {
423
- resolveMsg: null,
424
- rejectMsg: null
425
- }).then((res) => {
426
- let AppDaiBan = {}
427
- res.data.forEach(item=>{
428
- AppDaiBan[item.defname] = AppDaiBan[item.defname] || []
429
- AppDaiBan[item.defname].push(item)
430
- })
431
- if (res.data.length> 0){
432
- this.AppDaiBan = `您有${res.data.length}条需要处理的报建待办业务!`
433
- this.AppDaiBan += `其中 ${Object.keys(AppDaiBan).map(key=>`${key}:${AppDaiBan[key].length}条`).join(', ')}`
434
- }
435
- }).catch((e)=>{
436
- console.error(e)
437
- })
438
- if(this.AppDaiBan || this.OrderDaiBan){
439
- this.newTipShow = true
440
- }
441
- },
442
- // 提醒框被点击
443
- tipClick(){
444
- this.newTipShow = false
445
- this.newTipContextShow = true
446
- },
447
- gotoWorkOrderSite(){
448
- const isRemind =this.$appdata.getSingleValue("站点工单提醒")
449
- console.log('站点工单是否提醒',isRemind)
450
- if(isRemind && isRemind !== '是'){
451
- return
452
- }
453
- if(this.functions && this.functions.f_role_name && this.functions.f_role_name.indexOf('派单员') !== -1){
454
- const data = {
455
- "condition":
456
- {
457
- "condition":" 1=1 ",
458
- "sign":"1=1"
459
- },
460
- "userid":this.functions.name
461
- }
462
- new HttpResetClass().load('POST','rs/path/operatorService/n', {data}, {resolveMsg: null, rejectMsg: null}).then(res=>{
463
- if(res.data && res.data.n !== 0){
464
- this.$showMessage('你有'+res.data.n+'个工单待处理,请尽快前往站点工单页面进行处理')
465
- }
466
- })
467
- }
468
- },
469
- openUrl() {
470
- var url = `http://123.60.214.109:8406/submitTicket?personName=${this.$login.f.name}&orgName=${this.$login.f.orgs}`
471
- window.open(url, '_blank')
472
- },
473
- hindsetting() {
474
- this.setting = !this.setting
475
- if (this.setting) {
476
- this.srcsetting = '../../static/newStyle/setting.png'
477
- } else {
478
- this.srcsetting = '../../static/newStyle/setting1.png'
479
- }
480
-
481
- },
482
- hindsetting1() {
483
-
484
- if (!this.setting) {
485
- this.srcsetting = '../../static/newStyle/setting.png'
486
- this.setting = true
487
- }
488
-
489
- },
490
- isnodo(val) {
491
- console.log(val, 'ss')
492
- this.selecttab = val
493
- },
494
- unfurl() {
495
- if (this.showsum) {
496
- this.showsum = false
497
- } else {
498
- this.showsum = true
499
- }
500
- },
501
- // getElement(id) {
502
- // return document.getElementById(id)
503
- // },
504
- changeShow() {
505
- // this.treeOrIcon = !this.treeOrIcon
506
- // let oBox = this.getElement("box")
507
- // let oTop = this.getElement("top")
508
- // let oBottom = this.getElement("bottom")
509
- // let oLine = this.getElement("line")
510
- // if (this.treeOrIcon) {
511
- // // oLine.style.left = oTop.style.width = 300 + "px"
512
- // oTop.style.width = 150 + "px"
513
- // oBottom.style.width = oBox.clientWidth - 150 + "px"
514
- // }else {
515
- // oLine.style.left = oTop.style.width = 50 + "px"
516
- // oBottom.style.width = oBox.clientWidth - 50 + "px"
517
- // }
518
- // }
519
- this.treeOrIcon = !this.treeOrIcon
520
- // if (this.treeOrIcon) {
521
- // this.$els.top.style.width = 14 + "%"
522
- // this.$els.bottom.style.width = this.$els.box.clientWidth - 14 + "%"
523
- // }else {
524
- // this.$els.top.style.width = 8 + "%"
525
- // this.$els.bottom.style.width = this.$els.box.clientWidth - 8 + "%"
526
- // }
527
- },
528
- changeMain(userid) {
529
- this.$goto('res-main', {userid: this.userid}, 'self')
530
- },
531
- tabChange(name) {
532
- console.log(name, 'tabchanage')
533
- this.selecttab = name
534
- this.$refs.tree.changeSelect(name)
535
- },
536
- tabcg(val) {
537
- console.log(val)
538
- this.tabs = val
539
- },
540
- logOut() {
541
- console.log(this.$login.f)
542
- this.$showMessage('您确定要退出系统吗?', ['confirm', 'cancel']).then(async (res) => {
543
- if (res == 'confirm') {
544
- let data = {
545
- userid: this.$login.f.id,
546
- username: this.$login.f.name,
547
- usertelephone: this.$login.f.f_user_telephone
548
- }
549
- await this.$resetpost('rs/logic/logOut', data, {resolveMsg: '退出成功', rejectMsg: null})
550
- window.location.reload()
551
- }
552
- })
553
- }
554
- },
555
- computed: {
556
- nowDate() {
557
- return this.$login.getNowDate()
558
- }
559
- }
560
- }
561
- </script>
562
- <style lang="less">
563
- .newTip-transition {
564
- transition: all .4s ease;
565
- }
566
- .newTip-enter, .newTip-leave {
567
- height: 0;
568
- padding: 0 10px;
569
- opacity: 0;
570
- }
571
- .newTip a {
572
- color: #333;
573
- }
574
- .newTip {
575
- cursor: pointer;
576
- text-align: center;
577
- position: absolute;
578
- top: 3em;
579
- margin: 0 auto;
580
- width: 200px;
581
- left: 48%;
582
- line-height: 2;
583
- z-index: 10010;
584
- box-shadow: 0 4px 12px rgba(0,0,0,0.38);
585
- pointer-events: all;
586
- border-radius: 4px;
587
- background-color: whitesmoke;
588
- }
589
- /* 组件内通用样式 */
590
- .select-error {
591
- button {
592
- border-bottom: 1px solid #a94442 !important;
593
- }
594
- }
595
-
596
- // input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{
597
- // -webkit-appearance:textfield;
598
- // }
599
- /* 表单输入框组 */
600
- .form-input-group {
601
- display: flex;
602
-
603
- label {
604
- width: 100px;
605
- text-align: right;
606
-
607
- + * {
608
- flex: 1;
609
- }
610
- }
611
- }
612
-
613
- // 日期组件在表单中沾满
614
- .form-horizontal .datepicker {
615
- width: 100%;
616
- }
617
-
618
- // 下拉选择框占据剩余全部空间
619
- .select-overspread {
620
- .form-group {
621
- // margin: 0px 5px 10px 0px;
622
- .form-control {
623
- margin-right: 0px;
624
- }
625
- }
626
-
627
- .btn-group, .btn-group-vertical {
628
- width: 100%;
629
- // padding-right: 5px;
630
- button {
631
- width: 100%;
632
- display: flex;
633
- justify-content: space-between;
634
- align-items: center;
635
- }
636
- }
637
-
638
- .dropdown-menu {
639
- width: 100%
640
- }
641
- }
642
-
643
- // 需要特定宽度的的样式
644
- .width-60 {
645
- width: 60px;
646
- }
647
-
648
- .userpanel {
649
- font-weight: 300;
650
- color: #333;
651
- position: fixed;
652
- right: 30px;
653
- top: 45px;
654
- background-color: white;
655
- box-shadow: darkgrey 0.5px 0.5px 0.5px 0.5px;
656
- padding: 4px 10px 4px 10px;
657
- border-radius: 2px;
658
- }
659
-
660
- .width-80 {
661
- width: 80px;
662
- }
663
-
664
- .width-100 {
665
- width: 100px;
666
- }
667
-
668
-
669
- /*右侧区域的背景*/
670
- .right-bg {
671
- width: 100%;
672
- flex: 1;
673
- color: #304A66;
674
- }
675
-
676
- .tree-flex {
677
- height: 100%;
678
- // width: 150px;
679
- /*width: 60px;*/
680
- background: #4a7cae;
681
- color: #fff;
682
-
683
- }
684
-
685
- .tree-flex-icon {
686
- width: 50px;
687
- /*transition: 0.5s;*/
688
-
689
- > .span {
690
- overflow-x: visible;
691
- }
692
- }
693
-
694
- .tree-flex h3 {
695
- text-align: center;
696
- margin: 1em 0;
697
- }
698
-
699
- .tree-flex-footer {
700
- height: 50px;
701
- display: flex;
702
- flex-direction: column;
703
- color: #fff;
704
- }
705
-
706
- .tree-flex-footer a, .tree-flex-footer button {
707
- flex: 1;
708
- padding: 8px 5px;
709
- font-size: 1.2em;
710
- // border-top: 1px solid #697D93;
711
- border-top: 1px solid #4a7cae;
712
- text-decoration: none;
713
- color: #fff;
714
- cursor: pointer;
715
- }
716
-
717
- .tree-flex-footer button {
718
- height: auto;
719
- width: 100%;
720
- border-radius: 0px;
721
- background-color: rgba(255, 255, 255, 0);
722
- border: none;
723
- border-top: 1px solid #4a7cae;
724
- // border-top: 1px solid #697D93;
725
- text-align: left;
726
- }
727
-
728
- .tree-flex-footer button:hover {
729
- outline: none;
730
- background-color: rgba(255, 255, 255, 0.2);
731
- }
732
-
733
- .tree-flex-footer button:focus {
734
- outline: none;
735
- background-color: rgba(255, 255, 255, 0.5);
736
- }
737
-
738
- .tree-flex-footer a:hover {
739
- color: #FFF;
740
- background-color: rgba(255, 255, 255, 0.2);
741
- }
742
-
743
- .tree-flex .btn-group {
744
- height: 50px !important;
745
- }
746
-
747
- .tree-flex .dropdown-menu {
748
- /* 控制显示列表的样式 */
749
- background: #4a7cae;
750
- border-radius: 0px;
751
- color: #fff;
752
- width: auto;
753
- margin: 0px;
754
- padding: 0px;
755
- }
756
-
757
- .tree-flex .dropdown-menu-up {
758
- /* bottom,top控制上下,left和right控制左右*/
759
- left: 100% !important;
760
- top: auto !important;
761
- bottom: 0;
762
- }
763
-
764
- .tree-flex .dropdown-menu-down {
765
- /* bottom,top控制上下,left和right控制左右*/
766
- left: 100% !important;
767
- top: 0 !important;
768
- }
769
-
770
- .tree-flex .dropdown-menu li {
771
- text-align: center;
772
- line-height: 50px;
773
- border-bottom: 1px solid #697D93;
774
- font-size: 1.2em;
775
- width: auto;
776
- white-space: nowrap;
777
- cursor: default;
778
-
779
- }
780
-
781
- .tree-flex .dropdown-menu li + li {
782
- text-align: left;
783
- border: 0;
784
- line-height: 40px;
785
- padding-left: 15px;
786
- padding-right: 15px;
787
- font-size: 1em;
788
- cursor: pointer;
789
- }
790
-
791
- .tree-flex .dropdown-menu li + li:hover {
792
- background-color: rgba(255, 255, 255, 0.2);
793
- }
794
-
795
- .tree-flex .dropdown-menu li a {
796
- border: none;
797
- color: #fff;
798
- height: 40px;
799
- line-height: 40px;
800
- font-size: 1em;
801
- padding: 0px;
802
- }
803
-
804
- .tree-flex .dropdown-menu li a:hover {
805
- color: #fff;
806
- background-color: rgba(255, 255, 255, 0);
807
- }
808
-
809
- .tree-flex img {
810
- height: 1.2em;
811
- width: 1.2em;
812
- margin-right: 15px;
813
- margin-left: 5px;
814
- }
815
-
816
- .line {
817
- height: 100%;
818
- width: 5px;
819
- background: #4C637B;
820
- cursor: e-resize;
821
- }
822
-
823
- /*为树(tree)组件写的样式*/
824
- .tree-img {
825
- font-size: 1.2em;
826
- }
827
-
828
- /*将较长信息截断显示,鼠标悬停显示全部信息*/
829
- .cutout50 {
830
- max-width: 50px;
831
- overflow: hidden;
832
- text-overflow: ellipsis;
833
- white-space: nowrap;
834
- }
835
-
836
- /* 滚动条样式 */
837
- /*---滚动条默认显示样式--*/
838
- ::-webkit-scrollbar-thumb {
839
- // display: none;
840
- background-color: rgba(0, 0, 0, 0.4);
841
- /*background-color:red;*/
842
- height: 50px;
843
- outline-offset: -2px;
844
- /*outline:2px solid #fff;*/
845
- -webkit-border-radius: 4px;
846
- /*border: 2px solid #fff;*/
847
- }
848
-
849
- /*---鼠标点击滚动条显示样式--*/
850
- ::-webkit-scrollbar-thumb:hover {
851
- // display: inherit;
852
- background-color: rgba(0, 0, 0, 0.4);
853
- height: 50px;
854
- -webkit-border-radius: 4px;
855
- }
856
-
857
- /*---滚动条大小--*/
858
- ::-webkit-scrollbar {
859
- width: 8px;
860
- height: 8px;
861
- }
862
-
863
- /*---滚动框背景样式--*/
864
- ::-webkit-scrollbar-track-piece {
865
- /* 全透明,不显示 */
866
- background-color: rgba(255, 255, 255, 0);
867
- -webkit-border-radius: 0;
868
- }
869
- </style>
1
+ <template>
2
+ <div @click="hindsetting1()" :class="{'with-watermark':showwatermakeflag}">
3
+ <span class="newTip" transition="newTip" @click="tipClick" v-if="newTipShow">
4
+ <span>您有一条新提醒</span>
5
+ </span>
6
+ <!-- <div class="system-main" id="box" v-el:box v-if="!isManger">-->
7
+ <!-- <div class="system-logo" style="height: auto">-->
8
+ <!-- <img :src="imgs.logoimg" alt=""/>-->
9
+ <!-- <label>{{systemname}}</label>-->
10
+ <!-- <div class="system-logo-chi" >-->
11
+ <!-- <div v-if="userpane" class="auto system-logo-prompt" style="float: right">-->
12
+ <!-- <span>{{orgpathnames}}</span>-->
13
+ <!-- </div>-->
14
+ <!-- &lt;!&ndash;<div class="system-logo-chi-img1" style="float: right" @mouseenter="mouseenteruser()" @mouseleave="mouseleaveuser()"></div>&ndash;&gt;-->
15
+ <!-- <span style="float: right; padding-top: 2px" @mouseenter="mouseenteruser()" @mouseleave="mouseleaveuser()" class="system-logo-chi-span-1">{{$login.f.name}}</span>-->
16
+ <!-- <span style="border-left: 1px solid;float: right;padding-top: 2px" class="system-logo-chi-span-1"> <img src="../../static/newStyle/login-f.png" height="20" width="20"> </span>-->
17
+ <!-- <a href="index.html" onclick="return confirm('您确定要退出系统吗?');" style="float: right;padding-top: 2px">-->
18
+ <!-- <img src="../../static/newStyle/system-off.png" alt="" >-->
19
+ <!-- <span class="system-logo-chi-span-1">退出系统</span>-->
20
+ <!-- </a>-->
21
+ <!-- <div style="float: right" :class="{'dropstyle':setting,'dropstyle-1':!setting}">-->
22
+ <!-- <dropdown class="auto" >-->
23
+ <!-- <span data-toggle="dropdown" @click="hindsetting()" >-->
24
+ <!-- <img :src="srcsetting" alt=""><span>系统设置</span>-->
25
+ <!-- </span>-->
26
+ <!-- <ul slot="dropdown-menu" class="dropdown-menu dropdown-menu-up dropstyle-chi" >-->
27
+ <!-- &lt;!&ndash; <li>系统信息及设置</li>&ndash;&gt;-->
28
+ <!-- <li style="color: #ffffff;white-space: nowrap" @click="show=true">修改密码</li>-->
29
+ <!-- <li style="color: #ffffff;white-space: nowrap" @click="AddChangeMsgShow=true">系统版本</li>-->
30
+ <!-- </ul>-->
31
+ <!-- </dropdown>-->
32
+ <!-- </div>-->
33
+
34
+ <!-- </div>-->
35
+ <!-- </div>-->
36
+ <!-- <div class="system-left tree-flex" :class="{'system-left-1': !treeOrIcon}" id="top" v-el:top >-->
37
+ <!-- <div class="system-left-chi" :class="{'system-left-icon': !treeOrIcon}" >-->
38
+ <!-- <div class="span system-left-tree" >-->
39
+ <!-- <left-tree :functions='functions.functions' :userid='userid' @isnodo="isnodo" :treeOrIcon="treeOrIcon" :tabs="tabs" v-ref:tree></left-tree>-->
40
+ <!-- &lt;!&ndash; <icon-tree :functions='functions.functions' :userid='userid' v-show="!treeOrIcon"></icon-tree>&ndash;&gt;-->
41
+ <!-- </div>-->
42
+ <!-- </div>-->
43
+ <!-- <div class="system-foot-stretch" >-->
44
+ <!-- <a @click="changeShow()"><img src="../../static/images/lefticon/菜单伸缩.png" alt=""></a>-->
45
+ <!-- </div>-->
46
+ <!-- </div>-->
47
+
48
+
49
+ <!-- <div class="system-right" :class="{'system-right-1': !treeOrIcon}" id="bottom" v-el:bottom>-->
50
+ <!-- <div class="span">-->
51
+ <!-- <echarts-box v-if="$refs.mic.tabs.length === 0"></echarts-box>-->
52
+ <!-- <dynamic :comps='[]' :showup="true" :showhide="false" name='main' :selecttab.sync="selecttab" @tab-changed="tabChange" @tabscg="tabcg" v-ref:mic v-show="!($refs.mic.tabs.length === 0)"></dynamic>-->
53
+ <!-- </div>-->
54
+ <!-- </div>-->
55
+ <!-- <div class="system-foot" v-el:bottom>-->
56
+
57
+ <!-- <div class="system-foot-box">-->
58
+
59
+ <!-- </div>-->
60
+ <!-- </div>-->
61
+ <!-- </div>-->
62
+ <div class='flex-row system-main' id="box" v-el:box v-if="!isManger">
63
+ <div class="auto login-operator1" v-if="$refs.mic.tabs.length === 0">
64
+ <span>
65
+ <img
66
+ src="../../assets/people.png" height="15" width="15">
67
+ 登录人:</span>
68
+ <label>{{ orgpathnames }}</label>
69
+ </div>
70
+ <div class="system-left tree-flex" :class="{'tree-flex-icon': !treeOrIcon}" id="top" v-el:top>
71
+ <div class="system-left-chi" :class="{'system-left-icon': !treeOrIcon}">
72
+ <div class="span system-left-tree " style="height:85%">
73
+ <h3>{{ systemname }}</h3>
74
+ <!-- <div class="span" style="margin-bottom:10px;padding-bottom:5px;padding-top:5px;flex: 1;border-top: 1px solid #e5e5e5;border-bottom: 1px solid #e5e5e5;">-->
75
+ <left-tree :functions='functions.functions' :userid='userid' @isnodo="isnodo" v-show="treeOrIcon"
76
+ :tabs="tabs" v-ref:tree></left-tree>
77
+ <!--&lt;!&ndash; <icon-tree :functions='functions.functions' :userid='userid' v-show="!treeOrIcon"></icon-tree>&ndash;&gt;-->
78
+ </div>
79
+
80
+ <div class="tree-flex-footer">
81
+ <!-- <a @click="changeShow()"><img :src="imgs.open" alt=""><span v-if="treeOrIcon">菜单伸缩</span></a>-->
82
+ <!-- <a><img src="../../../static/treeset.png" alt="">系统设置</a> -->
83
+ <dropdown class="auto">
84
+ <button type="button" data-toggle="dropdown">
85
+ <img :src="imgs.set" alt=""><span v-if="treeOrIcon">系统设置</span>
86
+ </button>
87
+ <ul slot="dropdown-menu" class="dropdown-menu dropdown-menu-up">
88
+ <li>系统信息及设置</li>
89
+ <!-- <li>{{name}}</li> -->
90
+ <li>{{ date }}</li>
91
+ <li @click="openUrl()">售后服务</li>
92
+ <li @click="show=true">修改密码</li>
93
+ <li @click="AddChangeMsgShow=true">系统版本:V3.0</li>
94
+ </ul>
95
+
96
+ </dropdown>
97
+ <dropdown class="auto">
98
+ <a href="index.html" @click.prevent="logOut">
99
+ <img :src="imgs.out" alt=""><span v-if="treeOrIcon">退出系统</span>
100
+ </a>
101
+ </dropdown>
102
+ </div>
103
+ </div>
104
+ </div>
105
+ <!-- <div class="line" id="line" v-show="treeOrIcon" v-el:line></div> -->
106
+
107
+ <div class="flex right-bg system-right" id="bottom" v-el:bottom>
108
+ <!-- <operator-badge></operator-badge> -->
109
+ <div class="span">
110
+ <echarts-box v-if="$refs.mic.tabs.length === 0"></echarts-box>
111
+ <dynamic :comps='[]' name='main' :selecttab.sync="selecttab" :orgpathnames="orgpathnames"
112
+ @tab-changed="tabChange" @tabscg="tabcg" v-ref:mic v-show="!($refs.mic.tabs.length === 0)"></dynamic>
113
+ </div>
114
+ </div>
115
+ </div>
116
+ <div v-show="isManger">
117
+ <route v-ref:route></route>
118
+ </div>
119
+ <modal v-if="newTipContextShow" :show.sync="newTipContextShow" :backdrop="false">
120
+ <header slot="modal-header" style="display:none"> </header>
121
+ <article slot="modal-body" class="modal-body">
122
+ <form class="form-horizontal">
123
+ <div class="row">
124
+ <div class="col-sm-12 " v-if="AppDaiBan !==''">
125
+ <label class="col-sm-2">报装待办:</label>
126
+ <span style="font-weight:normal">{{AppDaiBan}}</span>
127
+ </div>
128
+ <div class="col-sm-12 " v-if="OrderDaiBan !==''">
129
+ <label class="col-sm-2">预约待办:</label>
130
+ <span style="font-weight:normal">{{OrderDaiBan}}</span>
131
+ </div>
132
+ </div>
133
+ </form>
134
+ </article>
135
+ <footer slot="modal-footer" style="height: 8vh" class="modal-footer">
136
+ <button class="button_search" @click="newTipContextShow = false">确认</button>
137
+ </footer>
138
+ </modal>
139
+
140
+ <!-- 变更录入 模态框 -->
141
+ <add-changemsg :show="AddChangeMsgShow" v-on:toggle="AddChangeMsgShow = false"></add-changemsg>
142
+ <!-- 修改密码组件 -->
143
+ <modify-pw :show.sync="show" v-if="show"></modify-pw>
144
+ <!-- 修改密码模态框 -->
145
+ </div>
146
+ </template>
147
+
148
+ <script>
149
+ import vue from 'vue'
150
+ import co from 'co'
151
+ import {HttpResetClass} from "vue-client";
152
+
153
+ let getwartermakr = async function (self) {
154
+ let param = {
155
+ tablename: 't_singlevalue',
156
+ condition: " 1=1 and name=\'水印内容\'"
157
+ };
158
+ let result = await self.$resetpost('rs/sql/saleSingleTable', {data: param}, {resolveMsg: null, rejectMsg: null});
159
+ if (result && result.data.length > 0) {
160
+ self.showwatermakeflag = true;
161
+ createWaterMark(result.data[0].value);
162
+ } else {
163
+ self.showwatermakeflag = false;
164
+ }
165
+ }
166
+
167
+ let createWaterMark = function (userName) {
168
+ let style;
169
+ if (style) style.remove();
170
+ let width = window.parseInt(document.body.clientWidth);
171
+ let canvasWidth = width / window.parseInt(width / 320);
172
+ let fontFamily = window.getComputedStyle(document.body)["font-family"];
173
+ let canvas = document.createElement("canvas");
174
+ canvas.width = canvasWidth;
175
+ canvas.height = 200;
176
+ let ctx = canvas.getContext("2d");
177
+ ctx.rotate((-20 * Math.PI) / 180);
178
+ ctx.font = `20px ${fontFamily}`;
179
+ ctx.fillStyle = "rgba(8,8,8,.1)";
180
+ ctx.fillText(userName, 50, 200);
181
+ let imgSrc = canvas.toDataURL("image/png");
182
+ style = document.createElement("style");
183
+ style.innerHTML = `.with-watermark:before{
184
+ content: "";
185
+ width: 100%;
186
+ height: 100%;
187
+ display: block;
188
+ position: absolute;
189
+ background-image: url("${imgSrc}");
190
+ }`;
191
+ (document.head.append || document.head.appendChild).apply(document.head, [style]);
192
+ }
193
+
194
+ window.onunload = () => {
195
+ vue.http({url: `rs/user/update/${this.$login.f.ename}`, method: 'GET'})
196
+ }
197
+ window.onbeforeunload = () => {
198
+ vue.http({url: `rs/user/update/${this.$login.f.ename}`, method: 'GET'})
199
+ }
200
+ export default {
201
+ title: '主界面',
202
+ props: ['functions', 'userid', 'config'],
203
+ data() {
204
+ return {
205
+ // 页面提示信息定时器
206
+ interval: null,
207
+ newTipShow: false,
208
+ newTipContextShow: false,
209
+ AppDaiBan: '',
210
+ OrderDaiBan: '',
211
+ // 左侧树下部三个小图标
212
+ imgs: {
213
+ open: '/images/lefticon/菜单伸缩.png',
214
+ set: '/images/lefticon/系统设置.png',
215
+ out: '/images/lefticon/退出系统.png',
216
+ img1: '/images/newStyle/login-user.png',
217
+ logoimg: '/static/newStyle/fife.png'
218
+ // img2: '/images/lefticon/退出系统.png',
219
+ },
220
+ treeOrIcon: false,
221
+ isManger: false,
222
+ show: false,
223
+ orgpathnames: `${this.$login.f.f_fengongsi}-${this.$login.f.f_parentname}-${this.$login.f.name}`,
224
+ systemname: '客服系统',
225
+ date: this.$login.toStandardDateString(),
226
+ tabs: [], //已初始化页签数组
227
+ selecttab: '',
228
+ setting: true,
229
+ srcsetting: '../../static/newStyle/setting.png',
230
+ showwatermakeflag: false,
231
+ // headerHint: true, // 右侧顶部提示信息
232
+ // value: 25645.26,
233
+ // AddChangeMsgShow: false,
234
+ // showsum: false
235
+ }
236
+ },
237
+ ready() {
238
+ //使用socket发送代办消息提醒
239
+ vue.prototype.$connectNumber = this.connectNumber
240
+ this.initWebSocket()
241
+ getwartermakr(this);
242
+ let component = this.$login.getUrlCompileParames('component')
243
+ if (component) {
244
+ this.isManger = true
245
+ this.$refs.route.init(component, {data: this.functions.functions})
246
+ }
247
+ if (this.$login.f.password == '1') {
248
+ this.$showMessage('本地登录系统为此账户的初始密码,请确认修改密码!!!', ['confirm', 'cancel']).then((res) => {
249
+ if (res == 'confirm')
250
+ this.show = true
251
+ })
252
+ }
253
+ console.log("系统名称", this.$appdata.getSingleValue("系统名称"))
254
+ this.systemname = this.$appdata.getSingleValue("系统名称") ? this.$appdata.getSingleValue("系统名称") : '客服系统'
255
+ // let oBox = this.getElement("box")
256
+ // let oTop = this.getElement("top")
257
+ // let oBottom = this.getElement("bottom")
258
+ // let oLine = this.getElement("line")
259
+ // let that = this
260
+ // oLine.onmousedown = function(e) {
261
+ // let disX = (e || event).clientX
262
+ // oLine.left = oLine.offsetLeft
263
+ // document.onmousemove = function(e) {
264
+ // let iT = oLine.left + ((e || event).clientX - disX)
265
+ // var e = e || window.event
266
+ // let tarnameb = e.target || e.srcElement
267
+ // let maxT = oBox.clientWight - oLine.offsetWidth
268
+ // oLine.style.margin = 0
269
+ // iT < 0 && (iT = 0)
270
+ // iT > maxT && (iT = maxT)
271
+ // oLine.style.left = oTop.style.width = iT + "px"
272
+ // oBottom.style.width = oBox.clientWidth - iT + "px"
273
+ // that.$set('treeWidth', iT)
274
+ // return false
275
+ // }
276
+ // document.onmouseup = function() {
277
+ // document.onmousemove = null
278
+ // document.onmouseup = null
279
+ // oLine.releaseCapture && oLine.releaseCapture()
280
+ // }
281
+ // oLine.setCapture && oLine.setCapture()
282
+ // return false
283
+ // }
284
+ this.changeShow()
285
+ this.gotoWorkOrderSite()
286
+ // 获取预约列表
287
+ this.functions.f_role_name && this.functions.f_role_name.includes(this.config.msgRole) && this.config.isTip && this.getOrderList()
288
+ },
289
+ methods: {
290
+ // 清除
291
+ reset () {
292
+ clearTimeout(this.timeoutObj)
293
+ clearTimeout(this.serverTimeoutObj)
294
+ },
295
+ //每隔几分钟发送一个固定信息给服务端,服务端收到后回复一个固定信息
296
+ //如果服务端在一定时间内没有收到信息,就认为客户端断开了,服务端就会断开连接
297
+ // 发送心跳--确保连接有效
298
+ start () {
299
+ // 重置
300
+ vue.prototype.$connectNumber = this.connectNumber // 重置重连次数
301
+ this.timeoutObj = setTimeout(() => {
302
+ this.$socket.send('ping')
303
+ console.log('ping!')
304
+ this.serverTimeoutObj = setTimeout(() => {
305
+ this.$socket.close()
306
+ }, this.timeout)
307
+ }, this.timeout)
308
+ },
309
+ // 重连
310
+ reconnect () {
311
+ if (this.lockReconnect) return
312
+ // if (this.$connectNumber <= 0) {
313
+ // vue.showMessage('连接已断开,将无法接收消息,请重新登录', ['confirm']).then((res) => {
314
+ // if (res === 'confirm') {
315
+ // location.reload()
316
+ // }
317
+ // })
318
+ // return
319
+ // }
320
+ // this.$connectNumber--
321
+ setTimeout(() => {
322
+ console.log('连接异常,尝试重新连接。。。。')
323
+ this.initWebSocket()
324
+ this.lockReconnect = false
325
+ }, 1000 * 60)
326
+ },
327
+ // 初始化
328
+ initWebSocket () {
329
+ let path = `ws://${location.host}/ws?token=${this.$login.f.id}`
330
+ try {
331
+ if ('WebSocket' in window) {
332
+ // 创建对象
333
+ vue.prototype.$socket = new WebSocket(path)
334
+ } else {
335
+ this.$showMessage('您的浏览器不支持websocket的协议,建议使用新版谷歌浏览器,请勿使用IE浏览器,360浏览器请使用极速模式,不要使用兼容模式!"')
336
+ }
337
+ } catch (e) {
338
+ this.reconnect()
339
+ }
340
+
341
+ this.$socket.onopen = this.onOpen // 连接成功
342
+ this.$socket.onmessage = this.onMessage // 收到消息时回调
343
+ this.$socket.onclose = this.onClose // 连接关闭时回调
344
+ this.$socket.onerror = this.onError // 通讯异常
345
+ },
346
+ // 通讯异常
347
+ onError () {
348
+ console.log('通讯异常')
349
+ this.reconnect()
350
+ },
351
+ // 连接成功
352
+ onOpen () {
353
+ console.log('webSocket连接成功')
354
+ this.start()//每十秒发送心跳包,确保连接状态有效
355
+ },
356
+ // 收到消息时回调函数
357
+ onMessage (event) {
358
+ if (event.data === 'pong') { //建立心跳机制发送ping,返回pong
359
+ this.reset() // 重置心跳
360
+ this.start() // 重新开始心跳
361
+ return
362
+ }
363
+ //不是pong消息,就是服务器返回的消息(提示消息)
364
+
365
+ let data = JSON.parse(event.data)
366
+ console.log('收到消息', data)
367
+ //向所有子组件广播一个名为'onMessage'的事件,并传递一个数据参数'data'。
368
+ this.$broadcast('onMessage', data)
369
+ //作用是显示一个消息。
370
+ this.$showMessage(data.message)
371
+ },
372
+ // 关闭连接时回调函数
373
+ onClose () {
374
+ console.log('webSocket连接断开')
375
+ this.reset()
376
+ this.reconnect() // 重连
377
+ },
378
+ getOrderList(){
379
+ let times = this.config.times * 60 * 1000
380
+ console.log("=定时提示间隔=", times)
381
+ try {
382
+ this.interval = setInterval(() => {
383
+ this.getDaiBan()
384
+ }, times)
385
+ } catch (error) {
386
+ console.log('捕获到异常', error)
387
+ }
388
+ },
389
+ async getDaiBan(){
390
+ this.OrderDaiBan = ''
391
+ this.AppDaiBan = ''
392
+ let http = new HttpResetClass()
393
+ await http.load('POST', '/rs/sql/singleTable', {data: {
394
+ tablename:'t_order_center',
395
+ condition:` (f_orderstate != '预约成功' and f_orgstr ='${this.$login.f.orgid}' and f_orderstate != '预约失败' ) or f_orderstate is null`
396
+ }}, {
397
+ resolveMsg: null,
398
+ rejectMsg: null
399
+ }).then((res) => {
400
+ let OrderDaiBan = {}
401
+ res.data.forEach(item=>{
402
+ OrderDaiBan[item.f_ordertype] = OrderDaiBan[item.f_ordertype] || []
403
+ OrderDaiBan[item.f_ordertype].push(item)
404
+ })
405
+ if (res.data.length> 0){
406
+ this.OrderDaiBan = `您有${res.data.length}条需要处理的微信预约业务!`
407
+ this.OrderDaiBan += `其中 ${Object.keys(OrderDaiBan).map(key=>`${key}:${OrderDaiBan[key].length}条`).join(', ')}`
408
+ }
409
+ })
410
+ let data = {
411
+ condition: '1 = 1',
412
+ data: {
413
+ orgid: this.$login.f.orgid,
414
+ id: this.$login.f.id
415
+ }
416
+ }
417
+ await http.load('POST', '/rs/sql/checkuser', {data: data}, {
418
+ resolveMsg: null,
419
+ rejectMsg: null
420
+ }).then((res) => {
421
+ let AppDaiBan = {}
422
+ res.data.forEach(item=>{
423
+ AppDaiBan[item.defname] = AppDaiBan[item.defname] || []
424
+ AppDaiBan[item.defname].push(item)
425
+ })
426
+ if (res.data.length> 0){
427
+ this.AppDaiBan = `您有${res.data.length}条需要处理的报建待办业务!`
428
+ this.AppDaiBan += `其中 ${Object.keys(AppDaiBan).map(key=>`${key}:${AppDaiBan[key].length}条`).join(', ')}`
429
+ }
430
+ }).catch((e)=>{
431
+ console.error(e)
432
+ })
433
+ if(this.AppDaiBan || this.OrderDaiBan){
434
+ this.newTipShow = true
435
+ }
436
+ },
437
+ // 提醒框被点击
438
+ tipClick(){
439
+ this.newTipShow = false
440
+ this.newTipContextShow = true
441
+ },
442
+ gotoWorkOrderSite(){
443
+ const isRemind =this.$appdata.getSingleValue("站点工单提醒")
444
+ console.log('站点工单是否提醒',isRemind)
445
+ if(isRemind && isRemind !== '是'){
446
+ return
447
+ }
448
+ if(this.functions && this.functions.f_role_name && this.functions.f_role_name.indexOf('派单员') !== -1){
449
+ const data = {
450
+ "condition":
451
+ {
452
+ "condition":" 1=1 ",
453
+ "sign":"1=1"
454
+ },
455
+ "userid":this.functions.name
456
+ }
457
+ new HttpResetClass().load('POST','rs/path/operatorService/n', {data}, {resolveMsg: null, rejectMsg: null}).then(res=>{
458
+ if(res.data && res.data.n !== 0){
459
+ this.$showMessage('你有'+res.data.n+'个工单待处理,请尽快前往站点工单页面进行处理')
460
+ }
461
+ })
462
+ }
463
+ },
464
+ openUrl() {
465
+ var url = `http://123.60.214.109:8406/submitTicket?personName=${this.$login.f.name}&orgName=${this.$login.f.orgs}`
466
+ window.open(url, '_blank')
467
+ },
468
+ hindsetting() {
469
+ this.setting = !this.setting
470
+ if (this.setting) {
471
+ this.srcsetting = '../../static/newStyle/setting.png'
472
+ } else {
473
+ this.srcsetting = '../../static/newStyle/setting1.png'
474
+ }
475
+
476
+ },
477
+ hindsetting1() {
478
+
479
+ if (!this.setting) {
480
+ this.srcsetting = '../../static/newStyle/setting.png'
481
+ this.setting = true
482
+ }
483
+
484
+ },
485
+ isnodo(val) {
486
+ console.log(val, 'ss')
487
+ this.selecttab = val
488
+ },
489
+ unfurl() {
490
+ if (this.showsum) {
491
+ this.showsum = false
492
+ } else {
493
+ this.showsum = true
494
+ }
495
+ },
496
+ // getElement(id) {
497
+ // return document.getElementById(id)
498
+ // },
499
+ changeShow() {
500
+ // this.treeOrIcon = !this.treeOrIcon
501
+ // let oBox = this.getElement("box")
502
+ // let oTop = this.getElement("top")
503
+ // let oBottom = this.getElement("bottom")
504
+ // let oLine = this.getElement("line")
505
+ // if (this.treeOrIcon) {
506
+ // // oLine.style.left = oTop.style.width = 300 + "px"
507
+ // oTop.style.width = 150 + "px"
508
+ // oBottom.style.width = oBox.clientWidth - 150 + "px"
509
+ // }else {
510
+ // oLine.style.left = oTop.style.width = 50 + "px"
511
+ // oBottom.style.width = oBox.clientWidth - 50 + "px"
512
+ // }
513
+ // }
514
+ this.treeOrIcon = !this.treeOrIcon
515
+ // if (this.treeOrIcon) {
516
+ // this.$els.top.style.width = 14 + "%"
517
+ // this.$els.bottom.style.width = this.$els.box.clientWidth - 14 + "%"
518
+ // }else {
519
+ // this.$els.top.style.width = 8 + "%"
520
+ // this.$els.bottom.style.width = this.$els.box.clientWidth - 8 + "%"
521
+ // }
522
+ },
523
+ changeMain(userid) {
524
+ this.$goto('res-main', {userid: this.userid}, 'self')
525
+ },
526
+ tabChange(name) {
527
+ console.log(name, 'tabchanage')
528
+ this.selecttab = name
529
+ this.$refs.tree.changeSelect(name)
530
+ },
531
+ tabcg(val) {
532
+ console.log(val)
533
+ this.tabs = val
534
+ },
535
+ logOut() {
536
+ console.log(this.$login.f)
537
+ this.$showMessage('您确定要退出系统吗?', ['confirm', 'cancel']).then(async (res) => {
538
+ if (res == 'confirm') {
539
+ let data = {
540
+ userid: this.$login.f.id,
541
+ username: this.$login.f.name,
542
+ usertelephone: this.$login.f.f_user_telephone
543
+ }
544
+ await this.$resetpost('rs/logic/logOut', data, {resolveMsg: '退出成功', rejectMsg: null})
545
+ window.location.reload()
546
+ }
547
+ })
548
+ }
549
+ },
550
+ computed: {
551
+ nowDate() {
552
+ return this.$login.getNowDate()
553
+ }
554
+ }
555
+ }
556
+ </script>
557
+ <style lang="less">
558
+ .newTip-transition {
559
+ transition: all .4s ease;
560
+ }
561
+ .newTip-enter, .newTip-leave {
562
+ height: 0;
563
+ padding: 0 10px;
564
+ opacity: 0;
565
+ }
566
+ .newTip a {
567
+ color: #333;
568
+ }
569
+ .newTip {
570
+ cursor: pointer;
571
+ text-align: center;
572
+ position: absolute;
573
+ top: 3em;
574
+ margin: 0 auto;
575
+ width: 200px;
576
+ left: 48%;
577
+ line-height: 2;
578
+ z-index: 10010;
579
+ box-shadow: 0 4px 12px rgba(0,0,0,0.38);
580
+ pointer-events: all;
581
+ border-radius: 4px;
582
+ background-color: whitesmoke;
583
+ }
584
+ /* 组件内通用样式 */
585
+ .select-error {
586
+ button {
587
+ border-bottom: 1px solid #a94442 !important;
588
+ }
589
+ }
590
+
591
+ // input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{
592
+ // -webkit-appearance:textfield;
593
+ // }
594
+ /* 表单输入框组 */
595
+ .form-input-group {
596
+ display: flex;
597
+
598
+ label {
599
+ width: 100px;
600
+ text-align: right;
601
+
602
+ + * {
603
+ flex: 1;
604
+ }
605
+ }
606
+ }
607
+
608
+ // 日期组件在表单中沾满
609
+ .form-horizontal .datepicker {
610
+ width: 100%;
611
+ }
612
+
613
+ // 下拉选择框占据剩余全部空间
614
+ .select-overspread {
615
+ .form-group {
616
+ // margin: 0px 5px 10px 0px;
617
+ .form-control {
618
+ margin-right: 0px;
619
+ }
620
+ }
621
+
622
+ .btn-group, .btn-group-vertical {
623
+ width: 100%;
624
+ // padding-right: 5px;
625
+ button {
626
+ width: 100%;
627
+ display: flex;
628
+ justify-content: space-between;
629
+ align-items: center;
630
+ }
631
+ }
632
+
633
+ .dropdown-menu {
634
+ width: 100%
635
+ }
636
+ }
637
+
638
+ // 需要特定宽度的的样式
639
+ .width-60 {
640
+ width: 60px;
641
+ }
642
+
643
+ .userpanel {
644
+ font-weight: 300;
645
+ color: #333;
646
+ position: fixed;
647
+ right: 30px;
648
+ top: 45px;
649
+ background-color: white;
650
+ box-shadow: darkgrey 0.5px 0.5px 0.5px 0.5px;
651
+ padding: 4px 10px 4px 10px;
652
+ border-radius: 2px;
653
+ }
654
+
655
+ .width-80 {
656
+ width: 80px;
657
+ }
658
+
659
+ .width-100 {
660
+ width: 100px;
661
+ }
662
+
663
+
664
+ /*右侧区域的背景*/
665
+ .right-bg {
666
+ width: 100%;
667
+ flex: 1;
668
+ color: #304A66;
669
+ }
670
+
671
+ .tree-flex {
672
+ height: 100%;
673
+ // width: 150px;
674
+ /*width: 60px;*/
675
+ background: #4a7cae;
676
+ color: #fff;
677
+
678
+ }
679
+
680
+ .tree-flex-icon {
681
+ width: 50px;
682
+ /*transition: 0.5s;*/
683
+
684
+ > .span {
685
+ overflow-x: visible;
686
+ }
687
+ }
688
+
689
+ .tree-flex h3 {
690
+ text-align: center;
691
+ margin: 1em 0;
692
+ }
693
+
694
+ .tree-flex-footer {
695
+ height: 50px;
696
+ display: flex;
697
+ flex-direction: column;
698
+ color: #fff;
699
+ }
700
+
701
+ .tree-flex-footer a, .tree-flex-footer button {
702
+ flex: 1;
703
+ padding: 8px 5px;
704
+ font-size: 1.2em;
705
+ // border-top: 1px solid #697D93;
706
+ border-top: 1px solid #4a7cae;
707
+ text-decoration: none;
708
+ color: #fff;
709
+ cursor: pointer;
710
+ }
711
+
712
+ .tree-flex-footer button {
713
+ height: auto;
714
+ width: 100%;
715
+ border-radius: 0px;
716
+ background-color: rgba(255, 255, 255, 0);
717
+ border: none;
718
+ border-top: 1px solid #4a7cae;
719
+ // border-top: 1px solid #697D93;
720
+ text-align: left;
721
+ }
722
+
723
+ .tree-flex-footer button:hover {
724
+ outline: none;
725
+ background-color: rgba(255, 255, 255, 0.2);
726
+ }
727
+
728
+ .tree-flex-footer button:focus {
729
+ outline: none;
730
+ background-color: rgba(255, 255, 255, 0.5);
731
+ }
732
+
733
+ .tree-flex-footer a:hover {
734
+ color: #FFF;
735
+ background-color: rgba(255, 255, 255, 0.2);
736
+ }
737
+
738
+ .tree-flex .btn-group {
739
+ height: 50px !important;
740
+ }
741
+
742
+ .tree-flex .dropdown-menu {
743
+ /* 控制显示列表的样式 */
744
+ background: #4a7cae;
745
+ border-radius: 0px;
746
+ color: #fff;
747
+ width: auto;
748
+ margin: 0px;
749
+ padding: 0px;
750
+ }
751
+
752
+ .tree-flex .dropdown-menu-up {
753
+ /* bottom,top控制上下,left和right控制左右*/
754
+ left: 100% !important;
755
+ top: auto !important;
756
+ bottom: 0;
757
+ }
758
+
759
+ .tree-flex .dropdown-menu-down {
760
+ /* bottom,top控制上下,left和right控制左右*/
761
+ left: 100% !important;
762
+ top: 0 !important;
763
+ }
764
+
765
+ .tree-flex .dropdown-menu li {
766
+ text-align: center;
767
+ line-height: 50px;
768
+ border-bottom: 1px solid #697D93;
769
+ font-size: 1.2em;
770
+ width: auto;
771
+ white-space: nowrap;
772
+ cursor: default;
773
+
774
+ }
775
+
776
+ .tree-flex .dropdown-menu li + li {
777
+ text-align: left;
778
+ border: 0;
779
+ line-height: 40px;
780
+ padding-left: 15px;
781
+ padding-right: 15px;
782
+ font-size: 1em;
783
+ cursor: pointer;
784
+ }
785
+
786
+ .tree-flex .dropdown-menu li + li:hover {
787
+ background-color: rgba(255, 255, 255, 0.2);
788
+ }
789
+
790
+ .tree-flex .dropdown-menu li a {
791
+ border: none;
792
+ color: #fff;
793
+ height: 40px;
794
+ line-height: 40px;
795
+ font-size: 1em;
796
+ padding: 0px;
797
+ }
798
+
799
+ .tree-flex .dropdown-menu li a:hover {
800
+ color: #fff;
801
+ background-color: rgba(255, 255, 255, 0);
802
+ }
803
+
804
+ .tree-flex img {
805
+ height: 1.2em;
806
+ width: 1.2em;
807
+ margin-right: 15px;
808
+ margin-left: 5px;
809
+ }
810
+
811
+ .line {
812
+ height: 100%;
813
+ width: 5px;
814
+ background: #4C637B;
815
+ cursor: e-resize;
816
+ }
817
+
818
+ /*为树(tree)组件写的样式*/
819
+ .tree-img {
820
+ font-size: 1.2em;
821
+ }
822
+
823
+ /*将较长信息截断显示,鼠标悬停显示全部信息*/
824
+ .cutout50 {
825
+ max-width: 50px;
826
+ overflow: hidden;
827
+ text-overflow: ellipsis;
828
+ white-space: nowrap;
829
+ }
830
+
831
+ /* 滚动条样式 */
832
+ /*---滚动条默认显示样式--*/
833
+ ::-webkit-scrollbar-thumb {
834
+ // display: none;
835
+ background-color: rgba(0, 0, 0, 0.4);
836
+ /*background-color:red;*/
837
+ height: 50px;
838
+ outline-offset: -2px;
839
+ /*outline:2px solid #fff;*/
840
+ -webkit-border-radius: 4px;
841
+ /*border: 2px solid #fff;*/
842
+ }
843
+
844
+ /*---鼠标点击滚动条显示样式--*/
845
+ ::-webkit-scrollbar-thumb:hover {
846
+ // display: inherit;
847
+ background-color: rgba(0, 0, 0, 0.4);
848
+ height: 50px;
849
+ -webkit-border-radius: 4px;
850
+ }
851
+
852
+ /*---滚动条大小--*/
853
+ ::-webkit-scrollbar {
854
+ width: 8px;
855
+ height: 8px;
856
+ }
857
+
858
+ /*---滚动框背景样式--*/
859
+ ::-webkit-scrollbar-track-piece {
860
+ /* 全透明,不显示 */
861
+ background-color: rgba(255, 255, 255, 0);
862
+ -webkit-border-radius: 0;
863
+ }
864
+ </style>