Brak opisu

orderMsgRemind.js 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. $.ajax({
  35. type: "get",
  36. url: huayi.config.callcenter_url + "equipmentapi/api/worepairbase/getyd?id="+orderId, //获取数据的Servlet地址
  37. async: true,
  38. dataType: 'json',
  39. // data: {isread:1},
  40. success: function(data) {
  41. if (data.state === "success") {
  42. layer.msg("已读成功!");
  43. } else {
  44. layer.msg("消息提醒操作失败!");
  45. }
  46. }
  47. });
  48. }
  49. function showAuto() {
  50. sendmsg()
  51. }