隐藏,前台

	$.ajax({
url:"../../stock",
data: $.toJSON(opts),
type:"post",
dataType:"json",
success:function(data) {
var result = data.result;
var reason = data.reason;
if("OK"==result){
if(data.itemList!=null){
if(data.itemList.length>0){
for(var i=0;i<data.itemList.length;i++){
if(data.page.pos>=20){
value = i+20+1;
}else{
value = i+1;
}
if(i%2 == 0){
tab+="<tr class=\"table1-tr1 \" align=\"center\">";
}else{
tab+="<tr class=\"table1-tr2 \" align=\"center\">";
}
tab+="<td>"+value+"</td>";
tab+="<td>"+data.itemList[i].itemName+"</td>";
tab+="<td>"+data.itemList[i].typeName+"</td>";
tab+="<td>"+data.itemList[i].unitName+"</td>";
tab+="<td class='table1-a' width='300px' style='padding-left:60px;' nowrap=\"nowrap\">";
tab+='<a href=\"#\" onclick=\"openDialog(\'query\', \''+data.itemList[i].itemID+'\');\"><p><img src=\"../../images/ico1-1.png\" width=\"16\" height=\"16\"/></p>查看</a>';
//tab+="<input type=\"button\" value=\"查看\" style=\"margin-right:5px;\" onclick='openDialog(\"query\",\""+data.itemList[i].itemID+"\");' class=\"table_butonstyle\">";
//add by guanhao 增加权限控制
if($('#jurisdiction', parent.parent.document).val() != "CSViewer"){
tab+='<a href=\"#\" onclick=\"openDialog(\'update\', \''+data.itemList[i].itemID+'\');\"><p><img src=\"../../images/ico1-2.png\" width=\"16\" height=\"16\"/></p>修改</a>';
tab+='<a href=\"#\" onclick=\"delItem(\''+data.itemList[i].itemID+'\');\"><p><img src=\"../../images/ico1-3.png\" width=\"16\" height=\"16\"/></p>删除</a>';
// tab+="<input type=\"button\" value=\"修改\" style=\"margin-right:5px;\" onclick='openDialog(\"update\",\""+data.itemList[i].itemID+"\");' class=\"table_butonstyle\">";
// tab+="<input type=\"button\" value=\"删除\" style=\"margin-right:5px;\" onclick='delItem(\""+data.itemList[i].itemID+"\");'>";
}else{
$("#addItem").hide();
}
tab+="</td></tr>";
}
}
}
value = 0;
tab+="</tbody>";
tab+="</table>";
$("#itemtable").html(tab);
if(data.page!=null){
totalCount = data.page.totalCount;
}
$("#totalCount").html("每页显示20条,共有"+totalCount+"条记录");
//生成分页
$(".page").pagination(totalCount, {
num_edge_entries: 1,
num_display_entries: 3,
callback: pageselectCallback,
items_per_page:20,
current_page:parseInt(opts.item.pos/20)
});
$(".page").show();
}else{
alert(reason);;
}
},
error:function(msg){
alert(msg);
}
});
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值