Authored by mali

库存管理

<!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="status" type="text"/>
<input id="SKUP" type="text">
<input id="sellerUid" type="text">
<input id="storageId" 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="skupTable"></table>
</div>
</div>
<script type="text/javascript">
var brandId;
$(function () {
$("#status").myCombobox({
prompt: "请选择",
width: 200,
data: [{id: '1',text: '待付保证金'}, {id: '2',text: '卖家取消支付'}, {id: '2',text: '卖家支付超时'}, {id: '2',text: '出售中'}
, {id: '2',text: '卖家取消出售'}, {id: '2',text: '平台取消出售'}, {id: '2',text: '已出售'}],
valueField: "id",
textField: "text"
});
$("#SKUP").textbox({
prompt: "SKU_P"
});
$("#sellerUid").textbox({
prompt: "卖家UID"
});
$("#storageId").textbox({
prompt: "SKU"
});
$("#skupTable").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: "SKU_P",
field: "skup",
width: 40,
align: "center"
}, {
title: "SKU",
field: "storageId",
width: 80,
align: "center",
}, {
title: "颜色",
field: "colorName",
width: 100,
align: "center"
}, {
title: "尺码",
field: "sizeName",
width: 80,
align: "center"
}, {
title: "卖家UID",
field: "sellerUid",
width: 200,
align: "center"
}, {
title: "销售价",
field: "price",
width: 50,
align: "center",
}, {
title: "状态",
field: "status",
width: 50,
align: "center",
formatter: function (value, rowData) {
if (value == 1) {
return '开启';
}
return '关闭';
},
}, {
title: "创建时间",
field: "createTime",
width: 130,
align: "center"
}, {
title: "操作",
field: "operations",
width: 120,
align: "center",
formatter: function (value, rowData) {
var str = "<a role='edit' dataId='" + rowData.skup + "' 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");
editRow(id);
}
});
}
});
// 搜索
$("#searchLinkButton").linkbutton({
onClick: function () {
var param = getParams();
$("#skupTable").myDatagrid("load", param);
}
});
// 搜索全部
$("#searchAllLinkButton").linkbutton({
onClick: function () {
$('#status').combobox('clear');
$('#SKUP').combobox('clear');
$('#sellerUid').textbox('clear');
$('#storageId').textbox('clear');
var param = {};
$("#skupTable").myDatagrid("load", param);
}
});
/**
* 提取出搜索参数
* <input id="status" type="text"/>
<input id="SKUP" type="text">
<input id="sellerUid" type="text">
<input id="storageId" type="text">
*/
function getParams() {
var status = $('#status').combobox('getValue');
var skup = $('#SKUP').textbox('getValue');
var sellerUid = $('#sellerUid').textbox('getValue');
var storageId = $('#storageId').textbox('getValue');
var param = {};
if (undefined !== status && null !== status && "" !== status) {
param.status = status;
}
if (undefined !== skup && null !== skup && "" !== skup) {
param.skup = skup;
}
if (undefined !== sellerUid && null !== sellerUid && "" !== sellerUid) {
param.sellerUid = sellerUid;
}if (undefined !== storageId && null !== storageId && "" !== storageId) {
param.storageId = storageId;
}
return param;
}
function editRow(id) {
var skup = id;
var div = $("<div>").appendTo($(document.body));
var message = "确认取消售卖吗?";
window.top.$.messager.confirm("确认", message, function (flag) {
if (flag) {
window.top.$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
interval: 500,
text: ""
});
$.post(contextPath + "/brand/updateBrandStatus",{"skup":skup}, function (data) {
window.top.$.messager.progress("close");
if (data.code == 200) {
$("#skupTable").myDatagrid("reload");
window.top.$.messager.show({title: "提示",msg: msg, height: 120});
} else {
window.top.$.messager.alert("失败", data.message, "error");
}
}, "json");
}
});
}
});
</script>
</body>
</html>
\ No newline at end of file
... ...
<!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
... ...