batchsend.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="row">
  4. <div class="col-sm-12">
  5. <div class="ibox float-e-margins">
  6. <div class="ibox-content">
  7. <form method="post" action="{:url('batchsend',[],'')}/id/{$id}/mode/{$mode}" class="form-horizontal">
  8. <div class="form-group">
  9. <label class="col-sm-2 control-label">备注</label>
  10. <div class="col-sm-6">
  11. <textarea name="todo_content" class="form-control" cols="30" rows="3" ></textarea>
  12. </div>
  13. </div>
  14. <div class="form-group">
  15. <label class="col-sm-2 control-label">执行人<span class="text-danger">*</span></label>
  16. <div class="col-sm-6">
  17. <input type="text" class="form-control" oninput="changeSearch(this)" placeholder="搜索运送员">
  18. </div>
  19. </div>
  20. <div class="form-group">
  21. <label class="col-sm-2 control-label"></label>
  22. <div class="col-sm-10">
  23. <table class="table table-striped">
  24. <thead>
  25. <tr>
  26. <th><input type="checkbox" class="check-all"></th>
  27. <th>运送员名称</th>
  28. <th>今日送达次数</th>
  29. <th>上次位置</th>
  30. <th>上次修改时间</th>
  31. </tr>
  32. </thead>
  33. <tbody class="layer-photos" id="layer-photos">
  34. {foreach ($user_list as $key => $value)}
  35. <tr>
  36. <td><input name="to_user_id[]" type="checkbox" class="ids" value="{$value['id']}"></td>
  37. <td>{$value['real_name']}</td>
  38. <td>{$value['nums']}</td>
  39. <td>{$value['title']}</td>
  40. <td>{$value['addr_time']}</td>
  41. </tr>
  42. {/foreach}
  43. </tbody>
  44. </table>
  45. </div>
  46. </div>
  47. <div class="hr-line-dashed"></div>
  48. <div class="form-group">
  49. <div class="col-sm-6 col-sm-offset-2">
  50. <button class="btn btn-primary ajax-post" data-layer="1" data-reload="1" target-form="form-horizontal" type="submit">确 定</button>
  51. <button class="btn cancel-btn btn-default" type="button">取 消</button>
  52. </div>
  53. </div>
  54. </form>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. {/block}
  60. {block name="script"}
  61. <script>
  62. var lists = {:json_encode($user_list)};
  63. function changeSearch(_self) {
  64. var keyword = $(_self).val();
  65. var str = '';
  66. for (let o in lists){
  67. if(keyword){
  68. if(lists[o].real_name.indexOf(keyword) != -1){
  69. str += '<tr>';
  70. str += '<td><input name="to_user_id[]" type="checkbox" class="ids" value="'+lists[o].id+'"></td>';
  71. str += '<td>'+lists[o].real_name+'</td>';
  72. str += '<td>'+lists[o].nums+'</td>';
  73. str += '<td>'+lists[o].title+'</td>';
  74. str += '<td>'+lists[o].addr_time+'</td>';
  75. str += '</tr>';
  76. }
  77. }else{
  78. str += '<tr>';
  79. str += '<td><input name="to_user_id[]" type="checkbox" class="ids" value="'+lists[o].id+'"></td>';
  80. str += '<td>'+lists[o].real_name+'</td>';
  81. str += '<td>'+lists[o].nums+'</td>';
  82. str += '<td>'+lists[o].title+'</td>';
  83. str += '<td>'+lists[o].addr_time+'</td>';
  84. str += '</tr>';
  85. }
  86. }
  87. $('#layer-photos').html(str);
  88. console.log(keyword);
  89. }
  90. //全选的实现
  91. $(".check-all").click(function(){
  92. $(".ids").prop("checked", this.checked);
  93. });
  94. $(".ids").click(function(){
  95. var option = $(".ids");
  96. option.each(function(i){
  97. if(!this.checked){
  98. $(".check-all").prop("checked", false);
  99. return false;
  100. }else{
  101. $(".check-all").prop("checked", true);
  102. }
  103. });
  104. });
  105. </script>
  106. {/block}