lineheadquery.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <div style='max-height:500px;overflow:auto;min-width:850px;'>
  2. <table class="table table-hover supplyquery" style="min-width:850px;">
  3. <div class="input-group layui-row" style="margin:10px;">
  4. <input type="text" placeholder="请输入内容进行搜索" id="select-url-kw" value="" class="form-control">
  5. <span class="input-group-addon btn btn-default select-btn" id="search_kw" data-type="url">搜索</span>
  6. </div>
  7. <tbody>
  8. <?php foreach( $need_data as $row ){ ?>
  9. <tr>
  10. <td>{$row['community_name']}</td>
  11. <td>{$row['head_name']}</td>
  12. <td>{$row['head_mobile']}</td>
  13. <td>{$row['fullAddress']}</td>
  14. <td style="width:80px;"><a href="javascript:;" class="choose_dan_head" data-json='{:json_encode($row);}'>选择</a></td>
  15. </tr>
  16. <?php } ?>
  17. <?php if( count($need_data)<=0){ ?>
  18. <tr>
  19. <td colspan='4' align='center'>未找到可分配的小区</td>
  20. </tr>
  21. <?php } ?>
  22. </tbody>
  23. </table>
  24. </div>
  25. <script type="text/javascript" >
  26. var query_kwd = '{$kwd}';
  27. var query_url = "{:U('communityhead/lineheadquery', array('is_just_line' => $is_just_line))}";
  28. var can_next = true;
  29. $("#search_kw").click(function(){
  30. var query_kwd = $('#select-url-kw').val();
  31. if(!can_next)
  32. {
  33. return false;
  34. }
  35. can_next = false;
  36. $.ajax({
  37. url:query_url,
  38. type:'post',
  39. dataType:'json',
  40. data:{keyword:query_kwd,is_ajax:1},
  41. success:function(ret){
  42. if(ret.code == 0)
  43. {
  44. $('.supplyquery tbody').html(ret.html);
  45. }
  46. can_next = true;
  47. }
  48. })
  49. })
  50. $(document).undelegate(".choose_dan_head","click").delegate(".choose_dan_head","click",function(){
  51. var json_obj = JSON.parse($(this).attr('data-json'));
  52. var p_html = '';
  53. p_html+= '<div class="multi-audio-item " data-id="'+json_obj.id+'">';
  54. p_html+= ' <div class="input-group">';
  55. p_html+= ' <input type="text" class="form-control img-textname" readonly="" value="'+json_obj.community_name+'">';
  56. p_html+= ' <input type="hidden" value="'+json_obj.id+'" name="head_id[]">';
  57. p_html+= ' <div class="input-group-btn">';
  58. p_html+= ' <button class="btn btn-default" data-id="'+json_obj.id+'" onclick="cancle_head(this, '+json_obj.id+')" type="button"><i class="fa fa-remove"></i></button>';
  59. p_html+= ' </div>';
  60. p_html+= ' </div>';
  61. p_html+= '</div>';
  62. //$(cur_open_div).val( json_obj.member_id );
  63. // $(cur_open_div).parent().siblings().remove();
  64. $('.multi-audio-details').append(p_html);
  65. // $(cur_open_div).val( json_obj.head_id );
  66. layer.close(layer.index);
  67. });
  68. </script>