商丘12345 前端

drop_down_data.js 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. //工单类型
  2. var typeList = [];
  3. $.ajax({
  4. type: "get",
  5. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListById',
  6. async: false,
  7. data: {
  8. id: 2
  9. },
  10. dataType: 'json',
  11. success: function(data) {
  12. var type_data = data.data;
  13. $(type_data).each(function(i, n) {
  14. var obj = {};
  15. obj.value = n.F_ValueId;
  16. obj.text = n.F_Value;
  17. typeList.push(obj)
  18. })
  19. }
  20. });
  21. //事发地域
  22. var areaList = [];
  23. $.ajax({
  24. type: "get",
  25. url: huayi.config.callcenter_url + 'web/GetWebAreaList',
  26. async: false,
  27. data: {},
  28. dataType: 'json',
  29. success: function(data) {
  30. var area_data = data.data;
  31. console.log(area_data);
  32. $(area_data).each(function(i, n) {
  33. var obj = {};
  34. obj.value = n.F_AreaId;
  35. obj.text = n.F_AreaName;
  36. areaList.push(obj)
  37. console.log(obj);
  38. })
  39. }
  40. });
  41. //主题词
  42. var keyList = [];
  43. $.ajax({
  44. type: "get",
  45. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListById',
  46. async: false,
  47. data: {
  48. id: 3
  49. },
  50. dataType: 'json',
  51. success: function(data) {
  52. var key_data = data.data;
  53. $(key_data).each(function(i, n) {
  54. var obj = {};
  55. obj.value = n.F_ValueId;
  56. obj.text = n.F_Value;
  57. keyList.push(obj)
  58. })
  59. }
  60. });
  61. (function($, doc) {
  62. $.ready(function() {
  63. //诉求类型
  64. var userPicker = new $.PopPicker();
  65. userPicker.setData(typeList);
  66. var showUserPickerButton = doc.getElementById('showUserPicker');
  67. var userResult = doc.getElementById('userResult');
  68. showUserPickerButton.addEventListener('tap', function(event) {
  69. userPicker.show(function(items) {
  70. console.log(items)
  71. userResult.value = items[0].text;
  72. userResult.setAttribute("data-index", items[0].value);
  73. //返回 false 可以阻止选择框的关闭
  74. //return false;
  75. });
  76. }, false);
  77. //主题词
  78. var zhuTiPicker = new $.PopPicker();
  79. zhuTiPicker.setData(keyList);
  80. var showZhuTiPickerButton = doc.getElementById('showZhuTiPicker');
  81. var zhuTiResult = doc.getElementById('zhuTiResult');
  82. showZhuTiPickerButton.addEventListener('tap', function(event) {
  83. zhuTiPicker.show(function(items) {
  84. console.log(items)
  85. zhuTiResult.value = items[0].text;
  86. zhuTiResult.setAttribute("data-index", items[0].value);
  87. //返回 false 可以阻止选择框的关闭
  88. //return false;
  89. });
  90. }, false);
  91. //事件地址
  92. var cityPicker3 = new $.PopPicker();
  93. cityPicker3.setData(areaList);
  94. var showCityPickerButton = doc.getElementById('showCityPicker3');
  95. var cityResult3 = doc.getElementById('cityResult3');
  96. showCityPickerButton.addEventListener('tap', function(event) {
  97. cityPicker3.show(function(items) {
  98. cityResult3.value = items[0].text;
  99. cityResult3.setAttribute("data-index", items[0].value);
  100. //返回 false 可以阻止选择框的关闭
  101. //return false;
  102. });
  103. }, false);
  104. })
  105. })(mui, document);