|
|
<!DOCTYPE html>
|
|
|
<html>
|
|
|
<head>
|
|
|
<meta charset="UTF-8"/>
|
|
|
<title>Yoho!UFO运营平台</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: 220px">
|
|
|
<script>
|
|
|
document.write(addHead('门店商品', ''));
|
|
|
</script>
|
|
|
<style>
|
|
|
.div_search input {
|
|
|
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="maxSortId" type="text"><!-- 一级分类 -->
|
|
|
<input id="middleSortId" type="text"><!-- 二级分类 -->
|
|
|
<input id="brandName" type="text"><!-- 品牌名称 -->
|
|
|
<input id="sellerUid" type="text"><!-- 卖家UID -->
|
|
|
<input id="storageNum" type="text"><!-- 商品库存 -->
|
|
|
<input id="storageId" type="text"><!-- SKU -->
|
|
|
<input id="skup" type="text"><!-- SKU-P -->
|
|
|
<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">
|
|
|
|
|
|
|
|
|
(function () {
|
|
|
|
|
|
// 加载列表
|
|
|
$("#productTable").myDatagrid({
|
|
|
fit: true,
|
|
|
fitColumns: true,
|
|
|
nowrap: false,
|
|
|
url: contextPath + "/storage/storageListLineShops",
|
|
|
method: 'POST',
|
|
|
queryParams: {
|
|
|
sellerUid: 500031170 // 默认查询该 UID
|
|
|
},
|
|
|
loadFilter: function (data) {
|
|
|
var temp = defaultLoadFilter(data);
|
|
|
temp.rows = temp.list;
|
|
|
return temp;
|
|
|
},
|
|
|
columns: [[{
|
|
|
title: "商品编码",
|
|
|
field: "id",
|
|
|
width: 40,
|
|
|
align: "center"
|
|
|
}, {
|
|
|
title: "商品图片",
|
|
|
field: "colorImage",
|
|
|
width: 40,
|
|
|
align: "center",
|
|
|
formatter: function (value) {
|
|
|
return '<img src="' + value + '" style="width: 48px; height: 48px;vertical-align: middle;">'
|
|
|
}
|
|
|
}, {
|
|
|
title: "商品名称",
|
|
|
field: "productName",
|
|
|
width: 100,
|
|
|
align: "center",
|
|
|
}, {
|
|
|
title: "品牌",
|
|
|
field: "brandName",
|
|
|
width: 60,
|
|
|
align: "center"
|
|
|
}, {
|
|
|
title: "最低价",
|
|
|
field: "currentPrice",
|
|
|
width: 40,
|
|
|
align: "center",
|
|
|
formatter: function (value) {
|
|
|
if (value) {
|
|
|
return value;
|
|
|
}
|
|
|
return '--';
|
|
|
}
|
|
|
}, {
|
|
|
title: "可售库存",
|
|
|
field: "storage",
|
|
|
width: 20,
|
|
|
align: "center",
|
|
|
formatter: function (value) {
|
|
|
if (value) {
|
|
|
return value;
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
}, {
|
|
|
title: "操作",
|
|
|
field: "operations",
|
|
|
width: 40,
|
|
|
align: "center",
|
|
|
formatter: function (value, rowData) {
|
|
|
var str = "<a role='edit' dataId='" + rowData.id + "' sortId = '" + rowData.midSortId + "' 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");
|
|
|
var midSortId = $(this).attr("sortId");
|
|
|
detailStorage(id, midSortId);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 获取品牌名称
|
|
|
$.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"
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 商品库存
|
|
|
$("#storageNum").myCombobox({
|
|
|
prompt: "商品库存",
|
|
|
width: 200,
|
|
|
data: [{id: '1', text: '有库存'}, {id: '0', text: '无库存'}],
|
|
|
valueField: "id",
|
|
|
textField: "text"
|
|
|
});
|
|
|
|
|
|
// 一级和二级分类 联动
|
|
|
var mxSortCombobox = $("#maxSortId");
|
|
|
var mdSortCombobox = $("#middleSortId");
|
|
|
var sortComboboxUrl = contextPath + '/productSort/getLevel2SortBySortId?sortId='
|
|
|
mxSortCombobox.combobox({
|
|
|
url: sortComboboxUrl,
|
|
|
method: "get",
|
|
|
editable: false,
|
|
|
valueField: 'id',
|
|
|
textField: 'text',
|
|
|
loadFilter: function (data) {
|
|
|
data = defaultLoadFilter(data);
|
|
|
data.unshift({id: 0, text: "一级品类"});
|
|
|
return data;
|
|
|
},
|
|
|
onSelect: function (rec) {
|
|
|
if (0 === rec.id) {
|
|
|
try {
|
|
|
mdSortCombobox.combobox('disable');
|
|
|
mdSortCombobox.combobox('setValue', '0');
|
|
|
} catch (e) {
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
try {
|
|
|
mdSortCombobox.combobox('reload', sortComboboxUrl + rec.id);
|
|
|
mdSortCombobox.combobox('enable');
|
|
|
mdSortCombobox.combobox('setValue', '0');
|
|
|
} catch (e) {
|
|
|
}
|
|
|
},
|
|
|
loadFilter: function (data) {
|
|
|
data = defaultLoadFilter(data);
|
|
|
data.unshift({id: 0, text: "一级分类"});
|
|
|
return data;
|
|
|
}
|
|
|
});
|
|
|
mdSortCombobox.combobox({
|
|
|
method: "get",
|
|
|
editable: false,
|
|
|
valueField: 'id',
|
|
|
textField: 'text',
|
|
|
data: [{text: '二级分类', id: '0'}],
|
|
|
loadFilter: function (data) {
|
|
|
data = defaultLoadFilter(data);
|
|
|
data.unshift({id: 0, text: "请选择分类"});
|
|
|
return data;
|
|
|
},
|
|
|
onSelect: function (rec) {
|
|
|
if (0 === rec.id) {
|
|
|
return;
|
|
|
}
|
|
|
},
|
|
|
loadFilter: function (data) {
|
|
|
data = defaultLoadFilter(data);
|
|
|
data.unshift({id: 0, text: "请选择二级分类"});
|
|
|
return data;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 其他搜索框
|
|
|
$("#id").textbox({
|
|
|
prompt: "商品编码"
|
|
|
});
|
|
|
$("#productName").textbox({
|
|
|
prompt: "商品名称"
|
|
|
});
|
|
|
$("#sellerUid").textbox({
|
|
|
prompt: "卖家UID"
|
|
|
});
|
|
|
$("#storageId").textbox({
|
|
|
prompt: "SKU"
|
|
|
});
|
|
|
$("#skup").textbox({
|
|
|
prompt: "SKU-P"
|
|
|
});
|
|
|
|
|
|
// 筛选 过滤
|
|
|
$("#searchLinkButton").linkbutton({
|
|
|
onClick: function () {
|
|
|
var param = getParams();
|
|
|
$("#productTable").myDatagrid("load", param);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 搜索全部
|
|
|
$("#searchAllLinkButton").linkbutton({
|
|
|
onClick: function () {
|
|
|
$("#productTable").myDatagrid("load", {});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 提取搜索参数
|
|
|
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 maxSortId = $('#maxSortId').combobox('getValue');
|
|
|
var midSortId = $('#middleSortId').combobox('getValue');
|
|
|
var skup = $('#skup').textbox('getValue');
|
|
|
var param = {};
|
|
|
if (undefined !== brandName && null !== brandName && "" !== brandName) {
|
|
|
param.brandId = 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;
|
|
|
}
|
|
|
if (maxSortId !== undefined && null !== maxSortId && "" !== maxSortId && 0 != maxSortId) {
|
|
|
param.maxSortId = maxSortId;
|
|
|
}
|
|
|
if (midSortId !== undefined && null !== midSortId && "" !== midSortId && 0 != midSortId) {
|
|
|
param.midSortId = midSortId;
|
|
|
}
|
|
|
return param;
|
|
|
}
|
|
|
|
|
|
// 跳转编辑页
|
|
|
function detailStorage(id, midSortId) {
|
|
|
this.location.href = contextPath + "/html/goods/storageLineShops/storageLineShopsDetail.html?productId=" + id + "&midSortId=" + midSortId;
|
|
|
}
|
|
|
|
|
|
}())
|
|
|
|
|
|
</script>
|
|
|
|
|
|
</body>
|
|
|
</html> |
|
|
\ No newline at end of file |
...
|
...
|
|