|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+//刷新弹出框
|
|
|
2
|
+//t = setInterval("showAuto()", 1000 * 60);
|
|
|
3
|
+showAuto()
|
|
|
4
|
+function sendmsg() {
|
|
|
5
|
+ $.ajax({
|
|
|
6
|
+ type: "get",
|
|
|
7
|
+ url: huayi.config.callcenter_url + "equipmentapi/api/worepairbase/getbxmessagelist", //获取数据的Servlet地址
|
|
|
8
|
+ async: true,
|
|
|
9
|
+ dataType: 'json',
|
|
|
10
|
+ data: {isread:0},
|
|
|
11
|
+ success: function(data) {
|
|
|
12
|
+ if(data.data.rows.length) {
|
|
|
13
|
+ $('audio').remove();
|
|
|
14
|
+ audioElementHovertree = document.createElement('audio');
|
|
|
15
|
+ audioElementHovertree.setAttribute('src', './js/video/Sound.mp3');
|
|
|
16
|
+ audioElementHovertree.setAttribute('autoplay', 'autoplay'); // 打开自动播放
|
|
|
17
|
+ var orderId = data.data.rows[0].id
|
|
|
18
|
+ layer.confirm('来新工单了', {
|
|
|
19
|
+ icon: 7,
|
|
|
20
|
+ btn: ['确定'], // 按钮
|
|
|
21
|
+ shade: 0,
|
|
|
22
|
+ offset: "rb"
|
|
|
23
|
+ }, function (index) {
|
|
|
24
|
+ // 当用户点击“确定”按钮时执行的代码
|
|
|
25
|
+ console.log('用户点击了确定');
|
|
|
26
|
+ updataOrderMsg(orderId)
|
|
|
27
|
+ layer.close(index); // 关闭确认框
|
|
|
28
|
+ });
|
|
|
29
|
+ }
|
|
|
30
|
+ }
|
|
|
31
|
+ });
|
|
|
32
|
+}
|
|
|
33
|
+function updataOrderMsg(orderId){
|
|
|
34
|
+
|
|
|
35
|
+ $.ajax({
|
|
|
36
|
+ type: "get",
|
|
|
37
|
+ url: huayi.config.callcenter_url + "equipmentapi/api/worepairbase/getyd?id="+orderId, //获取数据的Servlet地址
|
|
|
38
|
+ async: true,
|
|
|
39
|
+ dataType: 'json',
|
|
|
40
|
+// data: {isread:1},
|
|
|
41
|
+ success: function(data) {
|
|
|
42
|
+ if (data.state === "success") {
|
|
|
43
|
+ layer.msg("已读成功!");
|
|
|
44
|
+ } else {
|
|
|
45
|
+ layer.msg("消息提醒操作失败!");
|
|
|
46
|
+ }
|
|
|
47
|
+ }
|
|
|
48
|
+ });
|
|
|
49
|
+}
|
|
|
50
|
+function showAuto() {
|
|
|
51
|
+ sendmsg()
|
|
|
52
|
+}
|