|
|
<!DOCTYPE html>
|
|
|
<html>
|
|
|
<head>
|
|
|
<meta charset="UTF-8"/>
|
|
|
<title>Yoho!Buy运营平台</title>
|
|
|
<script src="/ufoPlatform/js/include.js"></script>
|
|
|
<script src="/ufoPlatform/js/ajaxfileupload.js"></script>
|
|
|
</head>
|
|
|
<body class="easyui-layout" fit="true">
|
|
|
<div region="north" style="height: 230px">
|
|
|
<script>
|
|
|
document.write(addHead('商品库存信息', ''));
|
|
|
</script>
|
|
|
<style>
|
|
|
.div_search input {margin-top: 20px; }
|
|
|
.div_search .textbox {margin-top: 20px;}
|
|
|
.div_search .easyui-linkbutton {margin-top: 20px;}
|
|
|
</style>
|
|
|
<div style="margin-left: 30px;" class="div_search">
|
|
|
<input id="id" type="text">
|
|
|
<input id="productName" type="text">
|
|
|
<input id="productSort" type="text">
|
|
|
<input id="brandName" type="text">
|
|
|
|
|
|
<input id="sellerUid" type="text">
|
|
|
<input id="storageNum" type="text">
|
|
|
<input id="storageId" type="text">
|
|
|
<input id="skup" type="text">
|
|
|
<a id="searchLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">筛选</a>
|
|
|
<a id="searchAllLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">全部</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div region="center">
|
|
|
<div style="margin-left: 30px;margin-top: 20px;height: 660px">
|
|
|
<table id="productTable"></table>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
var brandId;
|
|
|
$(function () {
|
|
|
$.ajax({
|
|
|
contentType: "application/json",
|
|
|
dataType: "json",
|
|
|
type: "GET",
|
|
|
url: contextPath + '/brand/getBrandName',
|
|
|
success: function (data) {
|
|
|
if (data.code != 200 || !data.data || data.data.length == 0) {
|
|
|
return;
|
|
|
}
|
|
|
$("#brandName").myCombobox({
|
|
|
prompt: "选择名称",
|
|
|
width: 200,
|
|
|
data: data.data,
|
|
|
valueField: "id",
|
|
|
textField: "text"
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$("#storage_num").myCombobox({
|
|
|
prompt: "请选择",
|
|
|
width: 200,
|
|
|
data: [{id: '1',text: '有库存'}, {id: '2',text: '无库存'}],
|
|
|
valueField: "id",
|
|
|
textField: "text"
|
|
|
});
|
|
|
|
|
|
|
|
|
$("#productTable").myDatagrid({
|
|
|
fit: true,
|
|
|
fitColumns: true,
|
|
|
nowrap: false,
|
|
|
url: contextPath + "/brand/getBrandPageList",
|
|
|
method: 'POST',
|
|
|
/*queryParams: {
|
|
|
'brandName':'',
|
|
|
'status':''
|
|
|
},*/
|
|
|
loadFilter: function (data) {
|
|
|
var temp = defaultLoadFilter(data);
|
|
|
temp.rows = temp.list;
|
|
|
return temp;
|
|
|
},
|
|
|
columns: [[{
|
|
|
title: "商品编码",
|
|
|
field: "id",
|
|
|
width: 40,
|
|
|
align: "center"
|
|
|
}, {
|
|
|
title: "商品名称",
|
|
|
field: "productName",
|
|
|
width: 80,
|
|
|
align: "center",
|
|
|
}, {
|
|
|
title: "品牌",
|
|
|
field: "brandName",
|
|
|
width: 100,
|
|
|
align: "center"
|
|
|
}, {
|
|
|
title: "最低价",
|
|
|
field: "price",
|
|
|
width: 80,
|
|
|
align: "center"
|
|
|
}, {
|
|
|
title: "可售库存",
|
|
|
field: "storageNum",
|
|
|
width: 200,
|
|
|
align: "center"
|
|
|
}, {
|
|
|
title: "操作",
|
|
|
field: "operations",
|
|
|
width: 120,
|
|
|
align: "center",
|
|
|
formatter: function (value, rowData) {
|
|
|
var str = "<a role='edit' dataId='" + rowData.id + "' style='margin-left:10px'>库存详情</a>";
|
|
|
return str;
|
|
|
}
|
|
|
}]],
|
|
|
cache: false,
|
|
|
pagination: true,
|
|
|
pageSize: 10,
|
|
|
pageList: [10],
|
|
|
idField: "id",
|
|
|
singleSelect: false,
|
|
|
checkOnSelect: false,
|
|
|
onLoadSuccess: function () {
|
|
|
$(this).myDatagrid("getPanel").find("a[role='edit']").linkbutton({
|
|
|
iconCls: "icon-edit",
|
|
|
onClick: function () {
|
|
|
var id = $(this).attr("dataId");
|
|
|
detailStorage(id);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
// 搜索
|
|
|
$("#searchLinkButton").linkbutton({
|
|
|
onClick: function () {
|
|
|
var param = getParams();
|
|
|
$("#productTable").myDatagrid("load", param);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
$("#id").textbox({
|
|
|
prompt: "商品编码"
|
|
|
});
|
|
|
$("#productName").textbox({
|
|
|
prompt: "商品名称"
|
|
|
});
|
|
|
$("#sellerUid").textbox({
|
|
|
prompt: "卖家UID"
|
|
|
});
|
|
|
$("#storageId").textbox({
|
|
|
prompt: "SKU"
|
|
|
});
|
|
|
$("#skup").textbox({
|
|
|
prompt: "SKU-p"
|
|
|
});
|
|
|
|
|
|
// 搜索全部
|
|
|
$("#searchAllLinkButton").linkbutton({
|
|
|
onClick: function () {
|
|
|
$('#brandName').combobox('clear');
|
|
|
$('#storageNum').combobox('clear');
|
|
|
$('#id').textbox('clear');
|
|
|
$('#productName').textbox('clear');
|
|
|
$('#sellerUid').textbox('clear');
|
|
|
$('#storageId').textbox('clear');
|
|
|
$('#skup').textbox('clear');
|
|
|
var param = {};
|
|
|
$("#productTable").myDatagrid("load", param);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
/**
|
|
|
* 提取出搜索参数
|
|
|
*/
|
|
|
function getParams() {
|
|
|
var brandName = $('#brandName').combobox('getValue');
|
|
|
var storageNum = $('#storageNum').combobox('getValue');
|
|
|
var id = $('#id').textbox('getValue');
|
|
|
var productName = $('#productName').textbox('getValue');
|
|
|
var sellerUid = $('#sellerUid').textbox('getValue');
|
|
|
var storageId = $('#storageId').textbox('getValue');
|
|
|
var skup = $('#skup').textbox('getValue');
|
|
|
var param = {};
|
|
|
if (undefined !== brandName && null !== brandName && "" !== brandName) {
|
|
|
param.brandName = brandName;
|
|
|
}
|
|
|
if (undefined !== storageNum && null !== storageNum && "" !== storageNum) {
|
|
|
param.storageNum = storageNum;
|
|
|
}
|
|
|
if (undefined !== id && null !== id && "" !== id) {
|
|
|
param.id = id;
|
|
|
}
|
|
|
if (undefined !== productName && null !== productName && "" !== productName) {
|
|
|
param.productName = productName;
|
|
|
}
|
|
|
if (undefined !== sellerUid && null !== sellerUid && "" !== sellerUid) {
|
|
|
param.sellerUid = sellerUid;
|
|
|
}
|
|
|
if (undefined !== storageId && null !== storageId && "" !== storageId) {
|
|
|
param.storageId = storageId;
|
|
|
}
|
|
|
if (undefined !== skup && null !== skup && "" !== skup) {
|
|
|
param.skup = skup;
|
|
|
}
|
|
|
return param;
|
|
|
}
|
|
|
|
|
|
|
|
|
function detailStorage(id) {
|
|
|
this.location.href = contextPath + "/html/goods/storage/storageDetail.html?productId=" + id;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
</body>
|
|
|
</html> |
|
|
\ No newline at end of file |
...
|
...
|
|