123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-content">
- <form method="post" action="{:url('batchsend',[],'')}/id/{$id}/mode/{$mode}" class="form-horizontal">
- <div class="form-group">
- <label class="col-sm-2 control-label">备注</label>
- <div class="col-sm-6">
- <textarea name="todo_content" class="form-control" cols="30" rows="3" ></textarea>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">执行人<span class="text-danger">*</span></label>
- <div class="col-sm-6">
- <input type="text" class="form-control" oninput="changeSearch(this)" placeholder="搜索运送员">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label"></label>
- <div class="col-sm-10">
- <table class="table table-striped">
- <thead>
- <tr>
- <th><input type="checkbox" class="check-all"></th>
- <th>运送员名称</th>
- <th>今日送达次数</th>
- <th>上次位置</th>
- <th>上次修改时间</th>
- </tr>
- </thead>
- <tbody class="layer-photos" id="layer-photos">
- {foreach ($user_list as $key => $value)}
- <tr>
- <td><input name="to_user_id[]" type="checkbox" class="ids" value="{$value['id']}"></td>
- <td>{$value['real_name']}</td>
- <td>{$value['nums']}</td>
- <td>{$value['title']}</td>
- <td>{$value['addr_time']}</td>
- </tr>
- {/foreach}
- </tbody>
- </table>
- </div>
- </div>
- <div class="hr-line-dashed"></div>
- <div class="form-group">
- <div class="col-sm-6 col-sm-offset-2">
- <button class="btn btn-primary ajax-post" data-layer="1" data-reload="1" target-form="form-horizontal" type="submit">确 定</button>
- <button class="btn cancel-btn btn-default" type="button">取 消</button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- {/block}
- {block name="script"}
- <script>
- var lists = {:json_encode($user_list)};
- function changeSearch(_self) {
- var keyword = $(_self).val();
- var str = '';
- for (let o in lists){
- if(keyword){
- if(lists[o].real_name.indexOf(keyword) != -1){
- str += '<tr>';
- str += '<td><input name="to_user_id[]" type="checkbox" class="ids" value="'+lists[o].id+'"></td>';
- str += '<td>'+lists[o].real_name+'</td>';
- str += '<td>'+lists[o].nums+'</td>';
- str += '<td>'+lists[o].title+'</td>';
- str += '<td>'+lists[o].addr_time+'</td>';
- str += '</tr>';
- }
- }else{
- str += '<tr>';
- str += '<td><input name="to_user_id[]" type="checkbox" class="ids" value="'+lists[o].id+'"></td>';
- str += '<td>'+lists[o].real_name+'</td>';
- str += '<td>'+lists[o].nums+'</td>';
- str += '<td>'+lists[o].title+'</td>';
- str += '<td>'+lists[o].addr_time+'</td>';
- str += '</tr>';
- }
- }
- $('#layer-photos').html(str);
- console.log(keyword);
- }
- //全选的实现
- $(".check-all").click(function(){
- $(".ids").prop("checked", this.checked);
- });
- $(".ids").click(function(){
- var option = $(".ids");
- option.each(function(i){
- if(!this.checked){
- $(".check-all").prop("checked", false);
- return false;
- }else{
- $(".check-all").prop("checked", true);
- }
- });
- });
- </script>
- {/block}
|