Keine Beschreibung

index.js 3.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. var openid = helper.cookies.get("openid");
  2. var UserType = helper.cookies.get("usertype");
  3. var UserCode = helper.cookies.get("usercode");
  4. var UserWord = helper.cookies.get("userword");
  5. //var openid = "oXF5e1mWpX5DajW5_yjNLPKb8ThE";
  6. $(".add_icon").click(function() {
  7. //点击图片后发送跳转到指定页面的事件。
  8. window.location.href = "AddWorkolder.html";
  9. })
  10. workcount()
  11. function workcount() {
  12. $.getJSON(huayi.config.callcenter_url + 'WxLogin/GetWorkCount', {
  13. OpenId: openid
  14. }, function(result) {
  15. if(result.state == "success") {
  16. if (result.message=="成功") {
  17. //办理人员
  18. $(".DJD").text(result.DJD); //待接单
  19. $(".DCL").text(result.DCL); //待处理
  20. $(".YCL").text(result.YCL); //已处理
  21. //业务员
  22. if(UserType == 2 || UserType == 4) {
  23. $(".state").text("已创单");
  24. $(".YCD").show();
  25. $(".YFP").hide();
  26. $(".YCD").text(result.YCD); //已创单
  27. }
  28. $(".TD").text(result.TD); //已退单
  29. //分公司经理
  30. $(".DSP").text(result.DSP); //待办理
  31. $(".YBL").text(result.YBL); //已办理
  32. $(".YFP").text(result.YFP); //已分配
  33. $(".TD").text(result.TD); //已退单
  34. //高层
  35. $(".GCDBL").text(result.GCDBL); //待办理
  36. $(".YBL").text(result.YBL); //已办理
  37. } else if(result.message == "你的账号已在别处登录,你确定要再次登录吗?"){
  38. mui.alert('你的账号已在别处登录,你确定要再次登录吗?', '错误提示', function() {
  39. $.ajax({
  40. type: "post",
  41. url: huayi.config.callcenter_url + 'WxLogin/Login',
  42. async: true,
  43. dataType: 'json',
  44. data: {
  45. UserCode: UserCode,
  46. Password: UserWord,
  47. UserType: UserType,
  48. State: 1,
  49. openid: openid,
  50. //openid: 'oXF5e1mWpX5DajW5_yjNLPKb8ThE', //微信openid 测试用
  51. },
  52. success: function(data) {
  53. if(data.state == "success") {
  54. var UserType = data.data.usertype;
  55. var UserCode = data.data.usercode;
  56. var UserName = data.data.UserName;
  57. var rolename = data.data.rolename;
  58. UserWord = UserWord;
  59. var UserCode = data.data.usercode;
  60. helper.cookies.set("usercode", UserCode, 7);
  61. helper.cookies.set("usertype", UserType, 7);
  62. helper.cookies.set("userword", UserWord, 7);
  63. helper.cookies.set("UserName", UserName, 7);
  64. helper.cookies.set("rolename", rolename, 7);
  65. if(UserType == "-1") { //系统管理员
  66. window.location.href = "../client-side/client_index.html";
  67. } else if(UserType == "0") { //接待部
  68. window.location.href = "../client-side/client_index.html";
  69. } else if(UserType == "1") { //办理人员
  70. window.location.href = "../client-side/client_index.html";
  71. } else if(UserType == "2") { //区域客服
  72. window.location.href = "../client-side/high_list.html";
  73. } else if(UserType == "3") { //监管
  74. window.location.href = "../client-side/Waiting_list.html";
  75. } else if(UserType == "4") { //监管
  76. window.location.href = "../client-side/Have_list.html";
  77. }
  78. } else {
  79. mui.alert(data.message);
  80. }
  81. }
  82. })
  83. });
  84. }
  85. }
  86. })
  87. }