{extend name="base" /} {block name="css"} <link rel="stylesheet" type="text/css" href="__ADMIN__/js/mmgrid/mmGrid.css?v={$v}" /> {/block} {block name="js"} <script src="__ADMIN__/js/mmgrid/mmGrid.js?v={$v}" type="text/javascript"></script> <script src="__ADMIN__/goods/goods.js?v={$v}" type="text/javascript"></script> {/block} {block name="main"} <div class="wst-toolbar"> <select id="areaId1" class='j-ipt j-areas hide' level="0" onchange="WST.ITAreas({id:'areaId1',val:this.value,className:'j-areas'});"> <option value="">-商家所在地-</option> {volist name="areaList" id="vo"} <option value="{$vo['areaId']}">{$vo['areaName']}</option> {/volist} </select> <input type="text" name="shopName" placeholder='店铺名称/店铺编号' id="shopName" class='j-ipt hide'/> <select id="cat_0" class='ipt pgoodsCats' level="0" onchange="WST.ITGoodsCats({id:'cat_0',val:this.value,isRequire:false,className:'pgoodsCats'});"> <option value="">-所属分类-</option> {volist name=":WSTGoodsCats(0)" id="vo"} <option value="{$vo['catId']}">{$vo['catName']}</option> {/volist} </select> <input type="text" name="goodsName" placeholder='商品名称/商品编号' id="goodsName" class='j-ipt'/> <input type="text" name="shopName" placeholder='店铺名称' id="shopName" class='j-ipt'/> <input type="text" id="startDate" name="startDate" class="laydate-icon j-ipt" maxLength="20" value='' placeholder='开始日期'/> 至 <input type="text" id="endDate" name="endDate" class="laydate-icon j-ipt" maxLength="20" value='' placeholder='结束日期'/> <button class="btn btn-primary" onclick='javascript:loadGrid(0)'><i class='fa fa-search'></i>查询</button> <div style='clear:both'></div> </div> <div class='wst-grid'> <div id="mmg" class="mmg layui-form"></div> <div id="pg" style="text-align: right;"></div> </div> <script> function initShelvesGrid(){ var h = WST.pageHeight(); var cols = [ {title:' ', name:'goodsImg', width: 30, renderer: function(val,item,rowIndex){ var thumb = item['goodsImg']; //thumb = thumb.replace('.','_thumb.'); return "<span class='weixin'><img id='img' onmouseout='toolTip()' onmouseover='toolTip()' style='height:60px;width:60px;' src='"+WST.conf.IMGURL+"/"+thumb+"/thumb80" +"'><span class='imged' ><img style='height:180px;width:180px;' src='"+WST.conf.IMGURL+"/"+item['goodsImg']+"'></span></span>"; }}, {title:'商品名称', name:'goodsName', width: 120,sortable:true,renderer: function(val,item,rowIndex){ return "<span ><p class='wst-nowrap'>"+item['goodsName']+"</p></span>"; }}, {title:'商品编号', name:'goodsSn' ,width:60,sortable:true}, {title:'价格', name:'shopPrice' ,width:20,sortable:true, renderer: function(val,item,rowIndex){ return '¥'+item['shopPrice']; }}, {title:'所属店铺', name:'shopName' ,width:60,sortable:true}, {title:'申请上架时间', name:'saleTime' ,width:60,sortable:true}, {title:'审核通过时间', name:'createTime' ,width:60,sortable:true}, {title:'所属分类', name:'goodsCatName' ,width:60,renderer: function(val,item,rowIndex){ return "<span ><p class='wst-nowrap'>"+item['goodsCatName']+"</p></span>"; }}, {title:'销量', name:'saleNum' ,width:20,sortable:true,align:'center'}, {title:'状态', name:'isSale' ,width:30,renderer: function (val,item,rowIndex){ if(item['isSale']==1){ return "<span class='statu-yes'><i class='fa fa-check-circle'></i> 已上架</span>"; }else{ return "<span class='statu-no'><i class='fa fa-ban'></i>已下架</span>"; } }}, {title:'操作', name:'' ,width:150, align:'center', renderer: function(val,item,rowIndex){ var h = ""; h += "<a class='btn btn-blue' target='_blank' href='"+WST.U("home/goods/detail","id="+item['goodsId'])+"'><i class='fa fa-search'></i>查看</a> "; return h; }} ]; mmg = $('.mmg').mmGrid({height: (h-85),indexCol: true, indexColWidth:50, cols: cols,method:'POST', url: WST.U('admin/goods/shelvesByPage'), fullWidthRows: true, autoLoad: true,remoteSort: true,sortName:'goodsSn',sortStatus:'desc', plugins: [ $('#pg').mmPaginator({}) ] }); } $(function(){ var laydate = layui.laydate; laydate.render({ elem: '#startDate' }); laydate.render({ elem: '#endDate' }); }) $(function(){initShelvesGrid();}) </script> {/block}