123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- <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 supplyquery table-hover supplyquery" style="min-width:850px;">
- <thead>
- <th>门店名称</th>
- <th>门店地址</th>
- <th>所属供应商</th>
- <th>门店电话</th>
- <th>操作</th>
- </thead>
- <tbody>
- <?php foreach( $ds as $row ){ ?>
- <tr>
- <td><img src="{$row['room_logo']}" style='width:30px;height:30px;padding1px;border:1px solid #ccc' /> {$row['room_name']}</td>
- <td>{$row['room_address']}</td>
- <td>{$row['supply_name']}</td>
- <td>{$row['mobile']}</td>
- <?php if($row['exist'] == 0){ ?>
- <?php if($gpc['template'] == 'mult'){ ?>
- <td style="width:80px;"><a href="javascript:;" class="choose_mult_link" data-json='{:json_encode($row);}'>选择</a></td>
- <?php }else if($gpc['template'] == 'mult_goods'){ ?>
- <td style="width:80px;"><a href="javascript:;" class="choose_mult_goods_link" data-json='{:json_encode($row);}'>选择</a></td>
- <?php }else{ ?>
- <td style="width:80px;"><a href="javascript:;" class="choose_dan_link" data-json='{:json_encode($row);}'>选择</a></td>
- <?php }?>
- <?php }else{ ?>
- <td style="width:80px; border: #ccc">选择</td>
- <?php } ?>
- </tr>
- <?php } ?>
- <?php if( count($ds)<=0){ ?>
- <tr>
- <td colspan='5' align='center'>
- <?php if(!empty($supply_id)){ ?>
- 该独立供应商还没有门店
- <?php }else{ ?>
- 平台还没有门店
- <?php } ?>
- </td>
- </tr>
- <?php } ?>
- </tbody>
- <?php if( count($ds) > 0){ ?>
- <tfoot>
- <tr>
- <td colspan='5' align='center' id="pager_ajax">{$pager}</td>
- </tr>
- </tfoot>
- <?php } ?>
- </table>
- </div>
- <script>
- var query_kwd = '{$kwd}';
- <?php if( !empty($url)){ ?>
- var query_url = "{:U($url, array('template' => $gpc['template']))}";
- <?php }else{ ?>
- var query_url = "{:U('salesroom/query', array('template' => $gpc['template']))}";
- <?php } ?>
- var can_next = true;
- $(document).delegate(".choose_dan_link","click",function(){
-
- //data-json
- var json_obj = JSON.parse($(this).attr('data-json'));
- var p_html = '';
- p_html+= '<div class="input-group " style="margin: 0;">';
- p_html+= ' <div class="layadmin-text-center choose_user">';
- p_html+= ' <img style="" src="'+json_obj.room_logo+'">';
- p_html+= ' <div class="layadmin-maillist-img" style="">'+json_obj.room_name+'</div>';
- p_html+= ' <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_room_bind(this)"><i class="layui-icon"></i></button>';
- p_html+= ' </div>';
- p_html+= '</div>';
-
- $(cur_open_div).parent().siblings().remove();
- $(cur_open_div).parent().after(p_html);
-
- $(cur_open_div).val( json_obj.id );
- layer.close(layer.index);
- });
- $(document).delegate(".choose_mult_link","click",function(){
- //data-json
- var json_obj = JSON.parse($(this).attr('data-json'));
- var p_html = '';
- p_html+= '<div class="input-group mult_choose_roomid" data-roomid="'+json_obj.id+'" 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.room_logo+'">';
- p_html+= ' <div class="layadmin-maillist-img" style="">'+json_obj.room_name+'</div>';
- p_html+= ' <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_room_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-roomid') == json_obj.id )
- {
- can_tr = false;
- }
- })
- if( can_tr )
- {
- $(cur_open_div).parent().after(p_html);
- //$(cur_open_div).val( json_obj.gid );
- }
- //layer.close(layer.index);
- });
- $(document).delegate(".choose_mult_goods_link","click",function(){
- var room_count = $('.mult_choose_roomid').length;
- room_count = room_count + 1;
- //data-json
- var json_obj = JSON.parse($(this).attr('data-json'));
- var p_html = '';
- p_html+= '<div class="input-group mult_choose_room_list" style="width:100%">';
- p_html+= '<div class="input-group mult_choose_roomid" data-roomid="'+json_obj.id+'" style="border-radius: 0;margin: 10px;margin-left:0px;">';
- p_html+= ' <div class="choose_room_title">指定门店'+room_count+'</div>';
- p_html+= ' <div class="layadmin-text-center choose_user">';
- p_html+= ' <img style="" src="'+json_obj.room_logo+'">';
- p_html+= ' <div class="layadmin-maillist-img" style="">'+json_obj.room_name+'</div>';
- p_html+= ' <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_room_bind(this)"><i class="layui-icon"></i></button>';
- p_html+= ' </div>';
- p_html+= '</div>';
- p_html+= ' <div class="input-group" style="margin-top: 10px;">';
- p_html+= ' <input type="checkbox" class="is_hx_member" lay-filter="is_hx_member" lay-skin="primary" name="is_hx_member" value="1" title="是否指定核销人员"/>';
- p_html+= ' </div>';
- p_html+= ' <div class="input-group selectHxMember" style="margin-top: 10px;display:none;">';
- p_html+= ' <input type="text" disabled value="" class="form-control valid" name="smember_id" placeholder="">';
- p_html+= ' <span class="input-group-btn">';
- p_html+= ' <span data-input="#hexiao_smember_list_'+json_obj.id+'" class="btn btn-default chose_smember_id">选择核销人员</span>';
- p_html+= ' </span>';
- p_html+= ' </div>';
- p_html+= ' <div class="form-group hx_smember_list" id="hx_smember_list">';
- p_html+= ' <div class="col-sm-12 col-xs-12">';
- p_html+= ' <div id="hexiao_smember_list_'+json_obj.id+'"></div>';
- p_html+= ' </div>';
- p_html+= ' </div>';
- p_html+= ' </div>';
- //$(cur_open_div).parent().siblings().remove();
- var can_tr = true;
- $(cur_open_div).parent().find('.mult_choose_roomid').each(function(){
- if( $(this).attr('data-roomid') == json_obj.id )
- {
- can_tr = false;
- }
- })
- if( can_tr )
- {
- $(cur_open_div).before(p_html);
- }
- form.render('checkbox');
- //layer.close(layer.index);
- });
-
- $(".select-btn").click(function(){
-
- query_kwd = $.trim($("#select-url-kw").val());
-
- var s_page = $(this).attr('page');
- if(!can_next)
- {
- return false;
- }
- can_next = false;
- $.ajax({
- url:query_url,
- type:'post',
- dataType:'json',
- data:{keyword:query_kwd, page:1,is_ajax:1},
- success:function(ret){
- console.log(ret);
- if(ret.code == 0)
- {
- $('.supplyquery tbody').html(ret.html);
- $('#pager_ajax').html(ret.pager);
- }
- can_next = true;
- }
- })
- });
- $("body").delegate(".pagination a","click",function(){
- var s_page = $(this).attr('page');
- if(!can_next)
- {
- return false;
- }
- can_next = false;
- $.ajax({
- url:query_url,
- type:'post',
- dataType:'json',
- data:{keyword:query_kwd, page:s_page,is_ajax:1},
- success:function(ret){
- if(ret.code == 0)
- {
- $('.supplyquery tbody').html(ret.html);
- $('#pager_ajax').html(ret.pager);
-
- }
- can_next = true;
- }
- })
- })
- </script>
|