|
|
@@ -1,16 +1,16 @@
|
|
1
|
1
|
var isFirstShowTopMsg = true;
|
|
2
|
2
|
$(document).ready(function() {
|
|
3
|
3
|
|
|
4
|
|
- if (/mobile/i.test(navigator.userAgent) || /android/i.test(navigator.userAgent)) {
|
|
|
4
|
+ if(/mobile/i.test(navigator.userAgent) || /android/i.test(navigator.userAgent)) {
|
|
5
|
5
|
$(".title-box").hide();
|
|
6
|
6
|
}
|
|
7
|
7
|
|
|
8
|
|
- if ($.cookie("token") == null) {
|
|
|
8
|
+ if($.cookie("token") == null) {
|
|
9
|
9
|
window.location.href = "login.html";
|
|
10
|
10
|
}
|
|
11
|
11
|
|
|
12
|
12
|
obj.AgentExten = $.cookie("extno");
|
|
13
|
|
- if (obj.AgentExten == undefined) {
|
|
|
13
|
+ if(obj.AgentExten == undefined) {
|
|
14
|
14
|
$(".Gnumbox").hide();
|
|
15
|
15
|
}
|
|
16
|
16
|
$(".Gnum").text(obj.AgentExten);
|
|
|
@@ -22,7 +22,7 @@ $(document).ready(function() {
|
|
22
|
22
|
$.getJSON(huayi.config.callcenter_url + 'UserAccount/GetNowUser', {
|
|
23
|
23
|
"token": $.cookie("token")
|
|
24
|
24
|
}, function(result) {
|
|
25
|
|
- if (result.state.toLowerCase() == "success") {
|
|
|
25
|
+ if(result.state.toLowerCase() == "success") {
|
|
26
|
26
|
// console.log(result);
|
|
27
|
27
|
// $.cookie("userType", result.data.usertype, {
|
|
28
|
28
|
// expires: 7
|
|
|
@@ -31,7 +31,7 @@ $(document).ready(function() {
|
|
31
|
31
|
$.cookie("userRoleId", result.data.role.F_RoleId, {
|
|
32
|
32
|
expires: 7
|
|
33
|
33
|
});
|
|
34
|
|
-
|
|
|
34
|
+
|
|
35
|
35
|
$.cookie("userRoleCode", result.data.role.F_RoleCode, {
|
|
36
|
36
|
expires: 7
|
|
37
|
37
|
});
|
|
|
@@ -46,7 +46,7 @@ $(document).ready(function() {
|
|
46
|
46
|
$('.user_code').text(result.data.user.F_WorkNumber);
|
|
47
|
47
|
localStorage.setItem('F_UserCode', result.data.user.F_UserCode)
|
|
48
|
48
|
$('.group').text(result.data.user.F_SeartGroup);
|
|
49
|
|
- if (result.data.role) {
|
|
|
49
|
+ if(result.data.role) {
|
|
50
|
50
|
// console.log(result.data);
|
|
51
|
51
|
$(".rolename").text(result.data.role.F_RoleName);
|
|
52
|
52
|
}
|
|
|
@@ -55,7 +55,7 @@ $(document).ready(function() {
|
|
55
|
55
|
obj.AgentGroup = result.data.user.F_SeartGroupID;
|
|
56
|
56
|
obj.AgentID = result.data.user.F_UserCode;
|
|
57
|
57
|
//obj.AgentExten = result.data.user.F_WorkNumber;
|
|
58
|
|
- if (result.data.user.F_SeatFlag) {
|
|
|
58
|
+ if(result.data.user.F_SeatFlag) {
|
|
59
|
59
|
Connect();
|
|
60
|
60
|
$("#top-search").show();
|
|
61
|
61
|
$(".phoneBZ").show();
|
|
|
@@ -67,11 +67,11 @@ $(document).ready(function() {
|
|
67
|
67
|
//分机号
|
|
68
|
68
|
//话务相关
|
|
69
|
69
|
$("#top-search li").click(function() {
|
|
70
|
|
- if ($(this).find("i").hasClass("active")) {
|
|
71
|
|
- if (obj.AgentID) {
|
|
|
70
|
+ if($(this).find("i").hasClass("active")) {
|
|
|
71
|
+ if(obj.AgentID) {
|
|
72
|
72
|
var fun = $(this).attr("datafun");
|
|
73
|
73
|
obj.Type = fun;
|
|
74
|
|
- switch (fun) {
|
|
|
74
|
+ switch(fun) {
|
|
75
|
75
|
case "Login":
|
|
76
|
76
|
// obj.AgentGroup = "364";
|
|
77
|
77
|
obj.AgentType = "0";
|
|
|
@@ -113,14 +113,14 @@ $(document).ready(function() {
|
|
113
|
113
|
document.onkeydown = function(e) {
|
|
114
|
114
|
var theEvent = window.event || e;
|
|
115
|
115
|
var code = theEvent.keyCode || theEvent.which;
|
|
116
|
|
- if (code == 13) {
|
|
|
116
|
+ if(code == 13) {
|
|
117
|
117
|
$(".CallOut").click();
|
|
118
|
118
|
}
|
|
119
|
119
|
}
|
|
120
|
120
|
//外呼呼出
|
|
121
|
121
|
$(".CallOut").click(function(event) {
|
|
122
|
122
|
event.stopPropagation();
|
|
123
|
|
- if ($("#Result").val()) {
|
|
|
123
|
+ if($("#Result").val()) {
|
|
124
|
124
|
$.ajax({
|
|
125
|
125
|
type: "get",
|
|
126
|
126
|
url: huayi.config.callcenter_url + "CallOutOpt/GetCallOutprefix",
|
|
|
@@ -132,7 +132,7 @@ $(document).ready(function() {
|
|
132
|
132
|
},
|
|
133
|
133
|
success: function(result) {
|
|
134
|
134
|
// result = $.parseJSON(result);
|
|
135
|
|
- if (result.state.toLowerCase() == "success") {
|
|
|
135
|
+ if(result.state.toLowerCase() == "success") {
|
|
136
|
136
|
var guid = uuid();
|
|
137
|
137
|
obj.Type = $("#hidwhtype").val();
|
|
138
|
138
|
obj.DestinationNumber = result.data.phone;
|
|
|
@@ -163,7 +163,7 @@ $(document).ready(function() {
|
|
163
|
163
|
//外呼弹屏数字键盘号码输入
|
|
164
|
164
|
$(".Num_ul li div").click(function() {
|
|
165
|
165
|
var rt = $("#Result").val() + "";
|
|
166
|
|
- if (rt.length < 18) {
|
|
|
166
|
+ if(rt.length < 18) {
|
|
167
|
167
|
rt = rt + $(this).find("a").text();
|
|
168
|
168
|
$("#Result").val(rt);
|
|
169
|
169
|
}
|
|
|
@@ -173,7 +173,7 @@ $(document).ready(function() {
|
|
173
|
173
|
var Result = $("#Result").val() + "";
|
|
174
|
174
|
Result = Result.substr(0, Result.length - 1);
|
|
175
|
175
|
$("#Result").val(Result);
|
|
176
|
|
- if (Result.length == 0) {
|
|
|
176
|
+ if(Result.length == 0) {
|
|
177
|
177
|
$(".img").addClass("hidens");
|
|
178
|
178
|
}
|
|
179
|
179
|
})
|
|
|
@@ -200,7 +200,7 @@ $(document).ready(function() {
|
|
200
|
200
|
showDialog();
|
|
201
|
201
|
//侦听浏览器窗口大小变化
|
|
202
|
202
|
window.onresize = function() {
|
|
203
|
|
- if ($('#dialogMove').is(':visible')) {
|
|
|
203
|
+ if($('#dialogMove').is(':visible')) {
|
|
204
|
204
|
showDialog();
|
|
205
|
205
|
}
|
|
206
|
206
|
}
|
|
|
@@ -214,7 +214,7 @@ $(document).ready(function() {
|
|
214
|
214
|
},
|
|
215
|
215
|
success: function(result) {
|
|
216
|
216
|
|
|
217
|
|
- if (result.state.toLowerCase() == "success") {
|
|
|
217
|
+ if(result.state.toLowerCase() == "success") {
|
|
218
|
218
|
var con = result.data.user;
|
|
219
|
219
|
// console.log(con)
|
|
220
|
220
|
$('.mgh').val(con.F_UserId);
|
|
|
@@ -257,11 +257,11 @@ $(document).ready(function() {
|
|
257
|
257
|
var ymm = $('.spwd').val();
|
|
258
|
258
|
var xmm = $('.npwd').val();
|
|
259
|
259
|
var qmm = $('.epwd').val();
|
|
260
|
|
- if (xmm !== qmm) {
|
|
|
260
|
+ if(xmm !== qmm) {
|
|
261
|
261
|
$('.wrong').show();
|
|
262
|
262
|
$('.npwd').val('')
|
|
263
|
263
|
$('.epwd').val('')
|
|
264
|
|
- } else if (xmm == '') {
|
|
|
264
|
+ } else if(xmm == '') {
|
|
265
|
265
|
layer.msg("密码不允许为空!");
|
|
266
|
266
|
} else {
|
|
267
|
267
|
$('.wrong').hide();
|
|
|
@@ -281,7 +281,7 @@ $(document).ready(function() {
|
|
281
|
281
|
},
|
|
282
|
282
|
success: function(result) {
|
|
283
|
283
|
// result = $.parseJSON(result);
|
|
284
|
|
- if (result.state.toLowerCase() == "success") {
|
|
|
284
|
+ if(result.state.toLowerCase() == "success") {
|
|
285
|
285
|
layer.msg("修改成功!");
|
|
286
|
286
|
}
|
|
287
|
287
|
}
|
|
|
@@ -299,11 +299,11 @@ $(document).ready(function() {
|
|
299
|
299
|
done: function() {}
|
|
300
|
300
|
});
|
|
301
|
301
|
var r = $("#inputImage");
|
|
302
|
|
- if (window.FileReader) {
|
|
|
302
|
+ if(window.FileReader) {
|
|
303
|
303
|
r.change(function() {
|
|
304
|
304
|
var e, i = new FileReader,
|
|
305
|
305
|
t = this.files;
|
|
306
|
|
- if (t.length && (e = t[0], /^image\/\w+$/.test(e.type))) {
|
|
|
306
|
+ if(t.length && (e = t[0], /^image\/\w+$/.test(e.type))) {
|
|
307
|
307
|
i.readAsDataURL(e);
|
|
308
|
308
|
i.onload = function() {
|
|
309
|
309
|
r.val("");
|
|
|
@@ -322,7 +322,7 @@ $(document).ready(function() {
|
|
322
|
322
|
"token": $.cookie("token")
|
|
323
|
323
|
}, function(result) {
|
|
324
|
324
|
result = $.parseJSON(result);
|
|
325
|
|
- if (result.state.toLowerCase() == "success") {
|
|
|
325
|
+ if(result.state.toLowerCase() == "success") {
|
|
326
|
326
|
$(".yhtx").attr("src", huayi.config.callcenter_url.substr(0, huayi.config.callcenter_url.length - 1) +
|
|
327
|
327
|
result.data);
|
|
328
|
328
|
layer.msg("上传成功");
|
|
|
@@ -348,39 +348,39 @@ $(document).ready(function() {
|
|
348
|
348
|
|
|
349
|
349
|
})
|
|
350
|
350
|
//菜单数字
|
|
351
|
|
- function workcount() {
|
|
352
|
|
- $.getJSON(huayi.config.callcenter_url + 'WorkOrderNew/GetWorkCount', {
|
|
353
|
|
- "token": $.cookie("token")
|
|
354
|
|
- }, function(result) {
|
|
355
|
|
- if (result.state.toLowerCase() == "success") {
|
|
356
|
|
- $(".DZP").text(result.DZP); //待指派
|
|
357
|
|
- $(".DJD").text(result.DJD); //待接单
|
|
358
|
|
- $(".DCL").text(result.DCL); //已接单(待处理)
|
|
359
|
|
- $(".YCL").text(result.YCL); //已完成的
|
|
360
|
|
- $(".YZP").text(result.YZP); //客服已分配
|
|
361
|
|
- $(".RV_await").text(result.RV_await); //待回访
|
|
362
|
|
- $(".RV_have").text(result.RV_have); //已回访
|
|
363
|
|
- $(".RV_resul").text(result.RV_result);//综合回访
|
|
364
|
|
- $(".DWJ").text(result.DWJ); //待完结
|
|
365
|
|
- $(".GCDBL").text(result.GCDBL); //高层待审批
|
|
366
|
|
- $(".KHFK").text(result.KHFK); //客户工单
|
|
367
|
|
- $(".YQGD").text(result.YQGD); //延期工单
|
|
368
|
|
- $(".WSP").text(result.WSP); //微信未通过工单
|
|
369
|
|
- $(".YBL").text(result.YBL); //已审批
|
|
370
|
|
- $(".YGGD").text(result.YGGD); //微信业务员工单
|
|
371
|
|
- $(".DSP").text(result.DSP); //大区经理分公司经理待审批
|
|
372
|
|
- $(".YCD").text(result.YCD); //业务员大区经理分公司经理已创单
|
|
373
|
|
- $(".TD").text(result.TD); //退单
|
|
374
|
|
- $(".CQGD").text(result.CQGD); //超期
|
|
375
|
|
- $(".CBGD").text(result.CBGD); //催办
|
|
376
|
|
- $(".ZHCX").text(result.ZHCX); //综合查询
|
|
377
|
|
- $(".CSGD").text(result.CSGD);//抄送工单
|
|
378
|
|
- }
|
|
379
|
|
- })
|
|
380
|
|
- }
|
|
|
351
|
+function workcount() {
|
|
|
352
|
+ $.getJSON(huayi.config.callcenter_url + 'WorkOrderNew/GetWorkCount', {
|
|
|
353
|
+ "token": $.cookie("token")
|
|
|
354
|
+ }, function(result) {
|
|
|
355
|
+ if(result.state.toLowerCase() == "success") {
|
|
|
356
|
+ $(".DZP").text(result.DZP); //待指派
|
|
|
357
|
+ $(".DJD").text(result.DJD); //待接单
|
|
|
358
|
+ $(".DCL").text(result.DCL); //已接单(待处理)
|
|
|
359
|
+ $(".YCL").text(result.YCL); //已完成的
|
|
|
360
|
+ $(".YZP").text(result.YZP); //客服已分配
|
|
|
361
|
+ $(".RV_await").text(result.RV_await); //待回访
|
|
|
362
|
+ $(".RV_have").text(result.RV_have); //已回访
|
|
|
363
|
+ $(".RV_resul").text(result.RV_result); //综合回访
|
|
|
364
|
+ $(".DWJ").text(result.DWJ); //待完结
|
|
|
365
|
+ $(".GCDBL").text(result.GCDBL); //高层待审批
|
|
|
366
|
+ $(".KHFK").text(result.KHFK); //客户工单
|
|
|
367
|
+ $(".YQGD").text(result.YQGD); //延期工单
|
|
|
368
|
+ $(".WSP").text(result.WSP); //微信未通过工单
|
|
|
369
|
+ $(".YBL").text(result.YBL); //已审批
|
|
|
370
|
+ $(".YGGD").text(result.YGGD); //微信业务员工单
|
|
|
371
|
+ $(".DSP").text(result.DSP); //大区经理分公司经理待审批
|
|
|
372
|
+ $(".YCD").text(result.YCD); //业务员大区经理分公司经理已创单
|
|
|
373
|
+ $(".TD").text(result.TD); //退单
|
|
|
374
|
+ $(".CQGD").text(result.CQGD); //超期
|
|
|
375
|
+ $(".CBGD").text(result.CBGD); //催办
|
|
|
376
|
+ $(".ZHCX").text(result.ZHCX); //综合查询
|
|
|
377
|
+ $(".CSGD").text(result.CSGD); //抄送工单
|
|
|
378
|
+ }
|
|
|
379
|
+ })
|
|
|
380
|
+}
|
|
381
|
381
|
//上传头像
|
|
382
|
382
|
function uploadtx() {
|
|
383
|
|
- if (document.getElementById("upFile").files.length > 0) {
|
|
|
383
|
+ if(document.getElementById("upFile").files.length > 0) {
|
|
384
|
384
|
var formData = new FormData();
|
|
385
|
385
|
formData.append("upFile", document.getElementById("upFile").files[0]);
|
|
386
|
386
|
formData.append("token", $.cookie("token"));
|
|
|
@@ -403,7 +403,7 @@ function uploadtx() {
|
|
403
|
403
|
uploadtx();
|
|
404
|
404
|
});
|
|
405
|
405
|
var r = $.parseJSON(result);
|
|
406
|
|
- if (r.state.toLowerCase() == "success") {
|
|
|
406
|
+ if(r.state.toLowerCase() == "success") {
|
|
407
|
407
|
$(".yhtx").attr("src", huayi.config.callcenter_url.substr(0, huayi.config.callcenter_url.length - 1) + r.data);
|
|
408
|
408
|
|
|
409
|
409
|
layer.msg("上传成功");
|
|
|
@@ -418,7 +418,7 @@ function uploadtx() {
|
|
418
|
418
|
}
|
|
419
|
419
|
//格式化呼叫状态
|
|
420
|
420
|
function GetCallState(val) {
|
|
421
|
|
- if (val == '1') {
|
|
|
421
|
+ if(val == '1') {
|
|
422
|
422
|
return '已接通';
|
|
423
|
423
|
} else {
|
|
424
|
424
|
return '未接通';
|
|
|
@@ -428,7 +428,7 @@ function GetCallState(val) {
|
|
428
|
428
|
//外呼弹屏
|
|
429
|
429
|
function whtp() {
|
|
430
|
430
|
$("#Result").val("");
|
|
431
|
|
- if ($(".WH").hasClass("fadeOutUp")) {
|
|
|
431
|
+ if($(".WH").hasClass("fadeOutUp")) {
|
|
432
|
432
|
$(".WH").removeClass("fadeOutUp").addClass("fadeInDown");
|
|
433
|
433
|
}
|
|
434
|
434
|
$(".WH").removeClass("hidens");
|
|
|
@@ -442,7 +442,7 @@ function whtp() {
|
|
442
|
442
|
function loadWH() {
|
|
443
|
443
|
$(".phonediv").hide();
|
|
444
|
444
|
var n = $(".bg_title .lactive").attr("itemid");
|
|
445
|
|
- switch (n) {
|
|
|
445
|
+ switch(n) {
|
|
446
|
446
|
case '0':
|
|
447
|
447
|
var obj = $(".phonediv").eq(0);
|
|
448
|
448
|
obj.show();
|
|
|
@@ -574,7 +574,7 @@ function loadWH() {
|
|
574
|
574
|
function formatterDealType(val, row) {
|
|
575
|
575
|
//处理方式0:IVR处理1骚扰电话2自助服务3转值班电话4留言5呼损6人工处理
|
|
576
|
576
|
var str = '-';
|
|
577
|
|
- switch (val) {
|
|
|
577
|
+ switch(val) {
|
|
578
|
578
|
case 0:
|
|
579
|
579
|
str = 'IVR处理';
|
|
580
|
580
|
break;
|
|
|
@@ -604,7 +604,7 @@ function getDepts() {
|
|
604
|
604
|
$.getJSON(huayi.config.callcenter_url + "SeatGroup/GetList", {
|
|
605
|
605
|
token: $.cookie("token"),
|
|
606
|
606
|
}, function(data) {
|
|
607
|
|
- if (data.rows && data.rows.length > 0) {
|
|
|
607
|
+ if(data.rows && data.rows.length > 0) {
|
|
608
|
608
|
$('#s_department').html('');
|
|
609
|
609
|
$('#s_department').append('<option value="">请选择</option>');
|
|
610
|
610
|
$.each(data.rows, function(i, v) {
|
|
|
@@ -616,7 +616,7 @@ function getDepts() {
|
|
616
|
616
|
//格式化 电话号码 分机号
|
|
617
|
617
|
function view(val) {
|
|
618
|
618
|
var str = '';
|
|
619
|
|
- if (val) {
|
|
|
619
|
+ if(val) {
|
|
620
|
620
|
str = '<a onclick="call(\'' + val + '\')">' + val + '</a>';
|
|
621
|
621
|
}
|
|
622
|
622
|
return str;
|
|
|
@@ -628,7 +628,7 @@ function call(val) {
|
|
628
|
628
|
}
|
|
629
|
629
|
|
|
630
|
630
|
function logout() {
|
|
631
|
|
- if (!$('.Logout').hasClass('active')) {
|
|
|
631
|
+ if(!$('.Logout').hasClass('active')) {
|
|
632
|
632
|
$.ajax({
|
|
633
|
633
|
url: huayi.config.callcenter_url + "Login/Logout",
|
|
634
|
634
|
data: {
|
|
|
@@ -636,7 +636,7 @@ function logout() {
|
|
636
|
636
|
},
|
|
637
|
637
|
dataType: "json",
|
|
638
|
638
|
success: function(res) {
|
|
639
|
|
- if (res.state) {
|
|
|
639
|
+ if(res.state) {
|
|
640
|
640
|
location.href = "./login.html";
|
|
641
|
641
|
}
|
|
642
|
642
|
}
|
|
|
@@ -654,25 +654,25 @@ function loadMenu() {
|
|
654
|
654
|
"token": $.cookie("token")
|
|
655
|
655
|
}, function(result) {
|
|
656
|
656
|
$.ajaxSettings.async = true;
|
|
657
|
|
- if (result.state.toLowerCase() == "success") {
|
|
|
657
|
+ if(result.state.toLowerCase() == "success") {
|
|
658
|
658
|
var data = result.data;
|
|
659
|
659
|
|
|
660
|
660
|
var _html = "";
|
|
661
|
661
|
$.each(data, function(i) {
|
|
662
|
662
|
var row = data[i];
|
|
663
|
|
- if (row.F_ParentID == "0") {
|
|
|
663
|
+ if(row.F_ParentID == "0") {
|
|
664
|
664
|
_html += '<li>';
|
|
665
|
665
|
_html += '<a class="Click"data-id="Menu_' + row.F_ModuleId + '" href="' + row.F_OptUrl +
|
|
666
|
666
|
'"><i class="fa iconfont">' + row.F_ImgUrl + '</i><span class="nav-label">' + row.F_ModuleName +
|
|
667
|
667
|
'</span><span class="fa arrow"></span></a>';
|
|
668
|
668
|
var childNodes = row.ChildNodes; //二级
|
|
669
|
|
- if (childNodes.length > 0) {
|
|
|
669
|
+ if(childNodes.length > 0) {
|
|
670
|
670
|
_html += '<ul class="nav nav-second-level">';
|
|
671
|
671
|
$.each(childNodes, function(i) {
|
|
672
|
672
|
var subrow = childNodes[i];
|
|
673
|
673
|
|
|
674
|
674
|
var childNodsThird = subrow.ChildNodes; //三级
|
|
675
|
|
- if (childNodsThird.length > 0) {
|
|
|
675
|
+ if(childNodsThird.length > 0) {
|
|
676
|
676
|
_html += '<li>';
|
|
677
|
677
|
_html += '<a href="' + subrow.F_OptUrl + '">';
|
|
678
|
678
|
_html += '<span class="nav-label">' + subrow.F_ModuleName + '</span>';
|
|
|
@@ -683,7 +683,7 @@ function loadMenu() {
|
|
683
|
683
|
var subrowThird = childNodsThird[i];
|
|
684
|
684
|
_html += '<li>';
|
|
685
|
685
|
_html += '<a class="J_menuItem" data-id="Menu_' + subrowThird.F_ModuleId + '" href="' + subrowThird.F_OptUrl +
|
|
686
|
|
- '" >' + subrowThird.F_ModuleName + '</a>';
|
|
|
686
|
+ '" >' + subrowThird.F_ModuleName + '</a>';
|
|
687
|
687
|
_html += '<span class="' + subrowThird.F_Button + '"></span>';
|
|
688
|
688
|
_html += '</li>';
|
|
689
|
689
|
});
|
|
|
@@ -692,7 +692,7 @@ function loadMenu() {
|
|
692
|
692
|
_html += '<li>';
|
|
693
|
693
|
_html += '<a class="J_menuItem" data-id="Menu_' + subrow.F_ModuleId + '" href="' + subrow.F_OptUrl +
|
|
694
|
694
|
'" >' + subrow.F_ModuleName + '</a>';
|
|
695
|
|
- if (subrow.F_Button != '') {
|
|
|
695
|
+ if(subrow.F_Button != '') {
|
|
696
|
696
|
_html += '<span class="' + subrow.F_Button + '"></span>';
|
|
697
|
697
|
}
|
|
698
|
698
|
_html += '</li>';
|
|
|
@@ -734,30 +734,38 @@ function getTopMsgs() {
|
|
734
|
734
|
$.getJSON(huayi.config.callcenter_url + 'Msg/GetServerMsg', {
|
|
735
|
735
|
token: $.cookie("token")
|
|
736
|
736
|
}, function(result) {
|
|
737
|
|
- if(result.state.toLowerCase() === 'success'){
|
|
|
737
|
+ if(result.state.toLowerCase() === 'success') {
|
|
738
|
738
|
$.cookie("token", $.cookie("token"), {
|
|
739
|
739
|
expires: 7
|
|
740
|
740
|
});
|
|
741
|
741
|
$('#top_notices_lists').empty();
|
|
742
|
742
|
result = result.data;
|
|
743
|
743
|
var str = '';
|
|
744
|
|
- if (result && result.length) {
|
|
745
|
|
- if(isFirstShowTopMsg){
|
|
|
744
|
+ if(result && result.length) {
|
|
|
745
|
+ if(isFirstShowTopMsg) {
|
|
746
|
746
|
$('#top_notices_lists').show();
|
|
747
|
747
|
isFirstShowTopMsg = false;
|
|
748
|
748
|
}
|
|
749
|
749
|
$('#top_notices_num').text(result.length);
|
|
750
|
|
- for (var i = 0; i < result.length; i++) {
|
|
751
|
|
- str += '<li class="top_notices_item">' +
|
|
752
|
|
- result[i].Detail +
|
|
753
|
|
- '<button type="button" class="btn btn-primary btn-sm" onclick="signRead('+ result[i].ID +', event)">未读</button>' +
|
|
|
750
|
+ for(var i = 0; i < result.length; i++) {
|
|
|
751
|
+ if(result[i].Detail.split(',').length>1){
|
|
|
752
|
+ str += '<li class="top_notices_item">' +
|
|
|
753
|
+ '<span class="top_notices_con">'+result[i].Detail.split(',')[0]+' <a onclick="goSee(this)" dataId="' + result[i].Detail.split(',')[2] + '">'+result[i].Detail.split(',')[1]+'</a></span>' +
|
|
|
754
|
+ '<button type="button" class="btn btn-primary btn-sm" onclick="signRead(' + result[i].ID + ', event)">未读</button>' +
|
|
754
|
755
|
'</li>' +
|
|
755
|
756
|
'<li class="divider"></li>';
|
|
|
757
|
+ }else{
|
|
|
758
|
+ str += '<li class="top_notices_item">' +
|
|
|
759
|
+ '<span class="top_notices_con">'+result[i].Detail.split(',')[0]+'</span>' +
|
|
|
760
|
+ '<button type="button" class="btn btn-primary btn-sm" onclick="signRead(' + result[i].ID + ', event)">未读</button>' +
|
|
|
761
|
+ '</li>' +
|
|
|
762
|
+ '<li class="divider"></li>';
|
|
|
763
|
+ }
|
|
756
|
764
|
}
|
|
757
|
765
|
} else {
|
|
758
|
766
|
str = '<li class="top_notices_item">' +
|
|
759
|
|
- '<span class="top_notices_con">暂无消息!</span>' +
|
|
760
|
|
- '</li>';
|
|
|
767
|
+ '<span class="top_notices_con">暂无消息!</span>' +
|
|
|
768
|
+ '</li>';
|
|
761
|
769
|
$('#top_notices_num').text(0);
|
|
762
|
770
|
}
|
|
763
|
771
|
$('#top_notices_lists').append(str);
|
|
|
@@ -766,6 +774,19 @@ function getTopMsgs() {
|
|
766
|
774
|
});
|
|
767
|
775
|
}
|
|
768
|
776
|
|
|
|
777
|
+function goSee(oid) {
|
|
|
778
|
+ var oid = $(oid).attr('dataId')
|
|
|
779
|
+ console.log(oid)
|
|
|
780
|
+ layer.open({
|
|
|
781
|
+ shadeClose: true,
|
|
|
782
|
+ type: 2,
|
|
|
783
|
+ title: '工单详情',
|
|
|
784
|
+ maxmin: true, //开启最大化最小化按钮
|
|
|
785
|
+ area: ['75%', '85%'],
|
|
|
786
|
+ offset: ['100px', '350px'],
|
|
|
787
|
+ content: './WorkOrder/commonHtml/orderDetails.html?oid=' + oid
|
|
|
788
|
+ });
|
|
|
789
|
+}
|
|
769
|
790
|
// 标记消息状态
|
|
770
|
791
|
function signRead(signid, e) {
|
|
771
|
792
|
e.stopPropagation();
|
|
|
@@ -784,7 +805,7 @@ function signRead(signid, e) {
|
|
784
|
805
|
token: $.cookie("token")
|
|
785
|
806
|
},
|
|
786
|
807
|
success: function(data) {
|
|
787
|
|
- if (data.state.toLowerCase() === "success") {
|
|
|
808
|
+ if(data.state.toLowerCase() === "success") {
|
|
788
|
809
|
// 更新顶部消息内容和数量
|
|
789
|
810
|
getTopMsgs();
|
|
790
|
811
|
$('#top_notices_lists').hide();
|
|
|
@@ -799,4 +820,4 @@ $(document).click(function(e) {
|
|
799
|
820
|
if($(e.target).is($('.top_notices_lists')) || $(e.target).is($('.top_notices_item')) || $(e.target).is($('.top_notices_con')) || $(e.target).is($('.divider'))) {
|
|
800
|
821
|
$('#top_notices_lists').show();
|
|
801
|
822
|
}
|
|
802
|
|
-})
|
|
|
823
|
+})
|