1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <div style='max-height:500px;overflow:auto;min-width:850px;'>
- <div class="input-group layui-row" style="margin:10px;">
- <input type="text" placeholder="请输入名称进行搜索" id="select-url-kw" value="" class="form-control">
- <span class="input-group-addon btn btn-default select-btn" data-type="url">搜索</span>
- </div>
- <table class="table table-hover supplyquery" style="min-width:850px;">
- <tbody>
-
- <?php foreach($ds as $row){ ?>
- <tr>
- <td>
- <img src='{:tomedia($row['thumb'])}' style='width:30px;height:30px;padding1px;border:1px solid #ccc' />
- <?php if($row['is_finished'] == 1){ ?>
- <span style="color:red;">[已结束] </span>
- <?php } ?>
- <?php if($row['is_grab'] == 1){ ?>
- <span style="color:red;">[已抢光]</span>
- <?php } ?>
- {$row['goodsname']}
- </td>
- <td style="width:80px;"><a href="javascript:;" class="choose_dan_link_goods" data-json='{:json_encode($row);}'>选择</a></td>
- </tr>
- <?php } ?>
-
- <?php if(count($ds)<=0){ ?>
- <tr>
- <td colspan='4' align='center'>未找到商品</td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
- </div>
- <script>
- var query_kwd = '{$kwd}';
- var query_url = "{:U('goods/query_normal', array('type' => $type,'template' => 'mult','is_not_hexiao' => $is_not_hexiao,'unselect_goodsid' => $_GPC['unselect_goodsid']))}";
- var can_next = true;
- $(".select-btn").click(function(){
- query_kwd = $.trim($("#select-url-kw").val());
- if(!can_next)
- {
- return false;
- }
- can_next = false;
- $.ajax({
- url:query_url,
- type:'post',
- dataType:'json',
- data:{keyword:query_kwd,is_ajax:1},
- success:function(ret){
- if(ret.code == 0)
- {
- $('.supplyquery tbody').html(ret.html);
- // $('#pager_ajax').html(ret.pager);
- }
- can_next = true;
- }
- })
- });
- $(document).delegate(".choose_dan_link_goods","click",function(){
-
- //data-json
- var json_obj = JSON.parse($(this).attr('data-json'));
- var p_html = '';
- p_html+= '<div class="input-group mult_choose_goodsid" data-gid="'+json_obj.gid+'" style="border-radius: 0;float: left;margin: 10px;margin-left:0px;">';
- p_html+= ' <div class="layadmin-text-center choose_user">';
- p_html+= ' <img style="" src="'+json_obj.thumb+'">';
- p_html+= ' <div class="layadmin-maillist-img" style="">'+json_obj.goodsname+'</div>';
- p_html+= ' <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_bind(this)"><i class="layui-icon"></i></button>';
- p_html+= ' </div>';
- p_html+= '</div>';
-
- //$(cur_open_div).parent().siblings().remove();
- var can_tr = true;
- $(cur_open_div).parent().siblings().each(function(){
- if( $(this).attr('data-gid') == json_obj.gid )
- {
- can_tr = false;
- }
- })
-
- if( can_tr )
- {
- $(cur_open_div).parent().after(p_html);
- //$(cur_open_div).val( json_obj.gid );
- }
-
- //layer.close(layer.index);
- });
-
- </script>
|