ajaxGoodsList.html 11.2 KB

<style type="text/css">
	.flexigrid .bDiv tr{display: block;}
	.bd-line{font-size: 0;}
	.flexigrid .bDiv td{border: 0;}
	.flexigrid div.bDiv tr:hover td{background-color: #F4FCFA;}
	.flexigrid div.bDiv tr.trSelected td{ background: #ffffdf none repeat scroll 0 0;}
	.flexigrid .bDiv a{color: #999;}
	.flexigrid .bDiv .active a,.flexigrid .bDiv span a:hover{color: #FFF;}
	.flexigrid .bDiv .row a:hover{text-decoration: none;color: #C4182E;background-color: #EEEEEE;text-decoration: underline;}
	.flexigrid .bDiv .row .active a:hover{text-decoration: none;color: #fff;background-color: #999;text-decoration: underline;}
	.ncsc-default-table thead {font-size: 0;}
	.ncsc-default-table thead th{font-size: 12px; vertical-align: middle;display: inline-block;*display: inline;*zoom: 1;}
	.w20{width: 2% !important;}
	.w50{width: 5% !important;}
	.w60{width: 6% !important;}
	.w80{width: 8% !important;}
	.w120{width: 10% !important;}
	.w150{width: 12% !important;}
	.w200{width: 14% !important;}
	.w250{width: 16% !important;}
</style>
<table class="ncsc-default-table">
	<thead>
		<tr>
			<th class="w20"><input type="checkbox" onclick="$('input[name=\'goods_id\[\]\']').prop('checked', this.checked);"></th>
			<th class="w50">&nbsp;</th>
			<th class="w200">商品名称</th>
			<th class="w150">
				<a href="javascript:sort('cat_id');">分类</a>
			</th>
			<th class="w40">
				<a href="javascript:sort('dis_type');">分销</a>
			</th>
			<th class="w60">
				<a href="javascript:sort('shop_price');">价格</a>
			</th>
			<th class="w60">
				<a href="javascript:sort('is_recommend');">推荐</a>
			</th>
			<th class="w60">
				<a href="javascript:sort('is_new');">新品</a>
			</th>
			<th class="w50">
				<a href="javascript:sort('is_hot');">热卖</a>
			</th>
			<th class="w50">
				<a href="javascript:sort('is_on_sale');">上/下架</a>
			</th>
			<th class="w50">
				<a href="javascript:sort('give_integral');">是否积分</a>
			</th>
			<th class="w60">
				<a href="javascript:sort('store_count');">库存</a>
			</th>
			<th class="w60">
				<a href="javascript:sort('sort');">排序</a>
			</th>
			<th class="w140">操作</th>
		</tr>
	</thead>
	<tbody>
		<empty name="goodsList">
			<tr>
				<td colspan="20" class="norecord">
					<div class="warning-option"><i class="icon-warning-sign"></i><span>暂无符合条件的数据记录</span></div>
				</td>
			</tr>
			<else/>
			<volist name="goodsList" id="list">
				<tr class="bd-line">
					<td  class="w20">
						<input type="checkbox" name="goods_id[]" value="{$list.goods_id}"/>
					</td>
					<td class=" w50">
						<div class="pic-thumb">
							<a href="/Mobile/Goods/goodsInfo/stoid/{:getAdmStoId()}/id/{$list['goods_id']}.html" target="_blank">
								<img style="width:32px;height:32px" src="{:getImg($list.original_img,'__PUBLIC__/images/not_adv.jpg',0,0)}" />
							</a>
						</div>
					</td>
					<td class="tl w200">
						<dl class="goods-name">
							<dt style="max-width: 450px !important;">
                    <if condition="$list[is_virtual] eq 1"><span class="type-virtual" title="虚拟兑换商品">虚拟</span></if>
								{$list.goods_name|getSubstr=0,33}</dt>
							<dd>商品编号:{$list.goods_sn}</dd>
							<dd class="serve">
								<if condition="$list.prom_type eq 1">
									<a   href="{:U('Promotion/flash_sale_info',array('id'=>$list['prom_id']))}"><span class="open" title="秒杀商品"><i class="commend"></i></span></a>
								</if>
								<if condition="$list.prom_type eq 2">
									<a  href="{:U('Promotion/group_buy',array('act'=>'edit','id'=>$list['prom_id']))}"><span class="open" title="团购商品"><i class="commend"></i></span></a>
								</if>
								<if condition="$list.prom_type eq 3">
									<a   href="{:U('Promotion/prom_goods_info',array('id'=>$list['prom_id']))}">	<span class="open" title="促销优惠"><i class="commend"></i></span></a>
								</if>
								<if condition="$list.prom_type eq 4">
									<a   href="{:U('Marketing/integral_shop',array('id'=>$list['prom_id']))}"><span class="open" title="积分购"><i class="commend"></i></span></a>
								</if>

								<if condition="$list.prom_type eq 6">
									<a   href="{:U('team/addinfo',array('id'=>$list['prom_id']))}"><span class="open" title="天天拼单"><i class="commend"></i></span></a>
								</if>

								<a  href="javascript:" onclick="show_mobile_man(this)" b_href="{:U('Mobile/Goods/goodsInfo',array('stoid'=>getAdmStoId(),'id'=> $list['goods_id']))}"><span title="手机端商品详情"><i class="icon-tablet"></i></span></a>


							</dd>
						</dl>
					</td>

					<td class="w150"><span>{$catList[$list[cat_id]][name]}</span></td>
					<td class="w40"><span>
					<if condition='$list[dis_type] eq 0'>
						<font color="red">主营</font>
								<else />
								可选
							</if>

					</span></td>
					<td  class="w60"><span style="color:red">&yen;{$list.shop_price}</span></td>


					<td align="center" axis="col0"  class="w60">
						<div style="text-align: center;">
							<if condition='$list[is_recommend] eq 1'>
								<span class="yes" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','is_recommend',this)"><i class="fa fa-check-circle"></i></span>
								<else />
								<span class="no" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','is_recommend',this)"><i class="fa fa-ban"></i></span>
							</if>
						</div>
					</td>
					<td align="center" axis="col0"  class="w60">
						<div style="text-align: center; ">
							<if condition='$list[is_new] eq 1'>
								<span class="yes" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','is_new',this)"><i class="fa fa-check-circle"></i></span>
								<else />
								<span class="no" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','is_new',this)"><i class="fa fa-ban"></i></span>
							</if>
						</div>
					</td>
					<td align="center" axis="col0" class="w50">
						<div style="text-align: center;">
							<if condition='$list[is_hot] eq 1'>
								<span class="yes" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','is_hot',this)"><i class="fa fa-check-circle"></i></span>
								<else />
								<span class="no" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','is_hot',this)"><i class="fa fa-ban"></i></span>
							</if>
						</div>
					</td>
					<td align="center" axis="col0"  class="w50">
						<div style="text-align: center;">
							<if condition='$list[is_on] eq 1'>
								<span class="yes" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','down_time',this,1)"><i class="fa fa-check-circle"></i></span>
								<else />
								<span class="no" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','down_time',this,1)"><i class="fa fa-ban"></i></span>
							</if>
						</div>
					</td>
					<td align="center" axis="col0"  class="w50">
						<div style="text-align: center;">
							<if condition='$list[give_integral] eq 1'>
								<span class="yes" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','give_integral',this)"><i class="fa fa-check-circle"></i></span>
								<else />
								<span class="no" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','give_integral',this)"><i class="fa fa-ban"></i></span>
							</if>

						</div>
					</td>
					<td  class="w60">
						<input style="<if condition='$list.store_count lt $store_warning_storage'>color: red</if>" class="txt-cen" type="text" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" onpaste="this.value=this.value.replace(/[^\d.]/g,'')" onChange="changeTableVal5('goods','goods_id','{$list.goods_id}','store_count',this)" name="store_count" size="4" data-table="goods" data-id="{$list.goods_id}" value="{$list.store_count}" />
					</td>
					<td  class="w60">
						<input class="txt-cen" type="text" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')"  onChange="changeTableVal('goods','goods_id','{$list.goods_id}','sort',this)"  size="4" value="{$list.sort}" />
					</td>

					<td class="nscs-table-handle w140">

						<a class="btn green aClick" id="{$list['goods_id']}" storeid="{$list['store_id']}" href="javascript:void(0)"><i class="fa fa-chain"></i>链接</a>

						<a class="btn green" href="{:U('Admin/Goods/addEditGoods',array('sku'=>trim($list['sku'])))}?oldurl={$oldurl}"><i class="fa fa-edit"></i>编辑</a>
						<if condition="$p_erpid">
							<a class="btn green" href="{:U('Admin/Goods/goods_erplist',array('goods_id'=>$list['goods_id']))}"><i class="fa fa-list"></i>预出库订单</a>
						</if><br>
						<a class="btn green" href="javascript:void(0);" onclick="del('{$list[goods_id]}')"><i class="fa fa-trash"></i>删除</a>
						<if condition="$p_erpid">
						<a class="btn green" href="javascript:void(0);" onclick="updatesku('{$list[erpwareid]}')" title="同步线下条码、商品编号及市场价格"><i class="fa fa-refresh"  ></i>同步信息</a>

							<!--<a class="btn green" href="javascript:void(0);" onclick="updatewareno('{$list[goods_sn]}')" title="同步线下条码及商品ID"><i class="fa fa-refresh"  ></i>按编号同步信息</a>-->
						</if>

					</td>
				</tr>
			</volist>
		</empty>
	</tbody>
</table>

<div class="layer_box dn">
	<input readonly="readonly" class="contentTxt" id="content" value="" />
	<div id="btn" class="js-copy" data-clipboard-target="#content"><span>复制</span></div>
</div>

<!--分页位置--> {$page}
<script>

    var btn = document.getElementById('btn');
    var clipboard = new Clipboard(btn);//实例化

    //复制成功执行的回调,可选
    clipboard.on('success', function(e) {
        layer.alert('复制成功', {
            closeBtn: 0
        }, function() {
            layer.closeAll();
            $(".layer_box").addClass("dn");
        });
    });

    //复制失败执行的回调,可选
    clipboard.on('error', function(e) {
        layer.alert('复制失败');
    });

    $(".aClick").click(function(e) {
        var store_id = $(this).attr("storeid");
        var gpid = $(this).attr("id");
        var http ="";
        var ishttps = 'https:' == document.location.protocol ? true : false;
        if(ishttps) {http ="https://"; } else {http ="http://";}
        var host = window.location.host;
        var controller = "/Mobile/Goods/goodsInfo/stoid/";
        var val = store_id+"/id/"+gpid;
        var url = http+host+controller+val;
        $("#content").val(url);
        var t = $(this).parents("tr").index();
        $(".layer_box").css("top", (t + 1) * 70-20)
        $(".layer_box").removeClass("dn");
        e.stopPropagation();//阻止冒泡到body
    });

    $(" body").click(function(){
        $(".layer_box").addClass("dn");
    });


    // 点击分页触发的事件
    $(".pagination  a").click(function(){
        cur_page = $(this).data('p');
        $("#cur_page").val(cur_page);
        ajax_get_table('search-form2',cur_page);
    });

    $(document).ready(function(){
        // 表格行点击选中切换
        $('#flexigrid >table>tbody>tr').click(function(){
            $(this).toggleClass('trSelected');
        });
        $('#good_count').empty().html("{$pager->totalRows}");
    });

    // 点击分页触发的事件
    $(".pagination  a").click(function() {
        cur_page = $(this).data('p');
        ajax_get_table('search-form2', cur_page);
    });






</script>