$("#list").hiMallDatagrid({
url: './list',
nowrap: false,
rownumbers: true,
NoDataMsg: '没有找到符合条件的商品',
border: false,
fit: true,
fitColumns: true,
pagination: true,
idField: "id",
pageSize: 9,
pagePosition: 'bottom',
pageNumber:1,
queryParams: { auditStatus: val },
operationButtons: (parseInt(val) != 4? "#saleOff" : null),
columns:
[[
{ checkbox: true, width: 39 },
{ field: "productCode", title: '商品编号', width: 50 },
{ field: "shopName", title: "店铺", align: "left",width:100 },
{
field: "name", title: '商品', width: 280, align: 'left',
formatter: function (value, row, index) {
var html = '<img style="margin-left:15px;" width="40" height="40" src="' + row.imgUrl + '" /><span class="overflow-ellipsis" style="width:200px"><a title="' + value + '" href="/product/detail/' + row.id + '" target="_blank" href="' + row.url + '">' + value + '</a></span>';
return html;
}
},
{ field: "categoryName", title: "分类", width: 85, align: "left" },
{ field: "brandName", title: "品牌", width: 55, align: "left" },
{
field: "price", title: "价格", width: 70, align: "left",
formatter: function (value, row, index) {
return '¥' + value.toFixed(2);
}
},
{ field: "state", title: "状态", width: 80, align: "left" },
{
field: "s", title: "操作", width: 90, align: "center",
formatter: function (value, row, index) {
var html = "";
html += '<span class="btn-a">';
if (row.auditStatus == 1 && row.saleStatus == 1)//仅未审核的商品需要审核
html += '<a class="good-check" onclick="audit(' + row.id + ')">审核</a>';
else if (row.auditStatus == 2)//
html += '<a class="good-break" onclick="infractionSaleOffDialog(' + row.id + ')">违规下架</a>';
else if (row.auditStatus >= 3) {
html += '<a class="good-break" onclick="$.dialog.alert(\'' + row.auditReason + '\');">查看原因</a>';
}
html += '</span>';
return html;
}
}
]]
});
}