Brak opisu

serch.js 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. mui.init({})
  2. var UserCode = helper.cookies.get("usercode");
  3. var openid = helper.cookies.get("openid");
  4. (function($) {
  5. $.init();
  6. var result = $('#start_data')[0];
  7. var btns = $('.btn');
  8. btns.each(function(i, btn) {
  9. btn.addEventListener('tap', function() {
  10. var optionsJson = this.getAttribute('data-options') || '{}';
  11. var options = JSON.parse(optionsJson);
  12. var id = this.getAttribute('id');
  13. var picker = new $.DtPicker(options);
  14. picker.show(function(rs) {
  15. result.value = rs.text;
  16. picker.dispose();
  17. });
  18. }, false);
  19. });
  20. var result1 = $('#end_data')[0];
  21. var btns1 = $('.btn1');
  22. btns1.each(function(i, btn) {
  23. btn.addEventListener('tap', function() {
  24. var optionsJson = this.getAttribute('data-options') || '{}';
  25. var options1 = JSON.parse(optionsJson);
  26. var id = this.getAttribute('id');
  27. var picker = new $.DtPicker(options1);
  28. picker.show(function(rs) {
  29. result1.value = rs.text;
  30. picker.dispose();
  31. });
  32. }, false);
  33. });
  34. })(mui);
  35. //搜索
  36. $('.return').on('tap', function() {
  37. window.location.href = "list.html";
  38. });
  39. //搜索
  40. $('.submit').on('tap', function() {
  41. Keyword = $("#keyword").val(); //关键词
  42. Complaint = $("#complaint").attr('data-index'); //投诉类型
  43. State = $("#state").attr('data-index'); //工单状态
  44. Start_data = $("#start_data").val(); //开始日期
  45. End_data = $("#end_data").val(); //结束日期
  46. // window.location.href = "editWorkolder.html?id=" + id+'&itype='+itype;
  47. var start = new Date(Start_data.replace("-", "/").replace("-", "/"));
  48. var end = new Date(End_data.replace("-", "/").replace("-", "/"));
  49. // alert(start);
  50. // alert(end);
  51. if(start<end){
  52. window.location.href = "inquire.html?Keyword=" + Keyword+'&Complaint='+Complaint+'&State='+State+'&Start_data='+Start_data+'&End_data='+End_data;
  53. }else if(start>end){
  54. alert("开始时间大于结束时间,请重新选择");
  55. return
  56. }
  57. window.location.href = "inquire.html?Keyword=" + Keyword+'&Complaint='+Complaint+'&State='+State+'&Start_data='+Start_data+'&End_data='+End_data;
  58. });
  59. $(function() {
  60. //房东关系
  61. var keyList = [];
  62. console.log(keyList);
  63. $.ajax({
  64. type: "get",
  65. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  66. async: false,
  67. data: {
  68. flag: 'GDLX'
  69. },
  70. dataType: 'json',
  71. success: function(data) {
  72. var key_data = data.data;
  73. console.log(data.data);
  74. $(key_data).each(function(i, n) {
  75. var obj = {};
  76. obj.value = n.F_DictionaryValueId;
  77. obj.text = n.F_Name;
  78. keyList.push(obj)
  79. })
  80. }
  81. });
  82. (function($, doc) {
  83. $.init();
  84. $.ready(function() {
  85. // 投诉类型
  86. var cityPicker3 = new $.PopPicker();
  87. cityPicker3.setData(keyList);
  88. var showCityPickerButton = doc.getElementById('showCityPicker3');
  89. var cityResult3 = doc.getElementById('complaint');
  90. showCityPickerButton.addEventListener('tap', function(event) {
  91. cityPicker3.show(function(items) {
  92. cityResult3.value = items[0].text;
  93. cityResult3.setAttribute("data-index", items[0].value);
  94. //返回 false 可以阻止选择框的关闭
  95. //return false;
  96. });
  97. }, false);
  98. // 工单状态
  99. var cityPicker = new $.PopPicker();
  100. cityPicker.setData(
  101. [{ value: '1',
  102. text: '待接单'},{
  103. value: '2',
  104. text: '待完成'
  105. },{
  106. value: '3',
  107. text: '已完成'
  108. },{
  109. value: '5',
  110. text: '超期工单'
  111. }]);
  112. var showCityPickerButton = doc.getElementById('showCityPicker');
  113. var cityResult = doc.getElementById('state');
  114. showCityPickerButton.addEventListener('tap', function(event) {
  115. cityPicker.show(function(items) {
  116. cityResult.value = items[0].text;
  117. cityResult.setAttribute("data-index", items[0].value);
  118. //返回 false 可以阻止选择框的关闭
  119. //return false;
  120. });
  121. }, false);
  122. })
  123. })(mui, document);
  124. })