Bez popisu

authorization.js 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //获取数据
  2. List2();
  3. List3();
  4. $(function() {
  5. //更新事件
  6. $('#sc_btns').click(function() {
  7. if ($("#sc_keyWords").val()=="") {
  8. layer.msg("序列号不能为空");
  9. } else{
  10. List1();
  11. }
  12. })
  13. });
  14. //授权
  15. function List1() {
  16. var sequence=$("#sc_keyWords").val();
  17. $.ajax({
  18. url: huayi.config.callcenter_url + '/callcenterapi/api/authorize/auth',
  19. data: {
  20. tdata:sequence,
  21. kind:0,
  22. },
  23. async: true,
  24. dataType: 'json',
  25. type: 'post', //HTTP请求类型
  26. success: function(data) {
  27. List2();
  28. List3();
  29. layer.msg("注册码已发送");
  30. },
  31. error: function(xhr, type, errorThrown) {
  32. //异常处理;
  33. }
  34. })
  35. }
  36. //查询授权
  37. function List2() {
  38. $.ajax({
  39. url: huayi.config.callcenter_url + '/callcenterapi/api/authorize/auth',
  40. data: {
  41. kind:1,
  42. },
  43. async: true,
  44. dataType: 'json',
  45. type: 'post', //HTTP请求类型
  46. success: function(data) {
  47. var result=data.data
  48. $(".datatime").text(result.year+"-"+result.month+"-"+result.day);
  49. $(".authorization").text(data.data.AgentCount); // 坐席授权数量
  50. $(".ivrtext").text(data.data.IvrFlowCount); //IVR数量
  51. },
  52. error: function(xhr, type, errorThrown) {
  53. //异常处理;
  54. }
  55. })
  56. }
  57. //获取序列号
  58. function List3() {
  59. $.ajax({
  60. url: huayi.config.callcenter_url + '/callcenterapi/api/authorize/auth',
  61. data: {
  62. kind:2,
  63. },
  64. async: true,
  65. dataType: 'json',
  66. type: 'post', //HTTP请求类型
  67. success: function(data) {
  68. $(".sequence").text(data.data.message) //序列号
  69. },
  70. error: function(xhr, type, errorThrown) {
  71. //异常处理;
  72. }
  73. })
  74. }