goodsAdd.html
3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE html>
<div id="tt" class="easyui-layout" fit="true" style="overflow-y: scroll">
<div region="north" style="height: 60px;">
<div style="margin-left: 20px;margin-top: 10px">
<input class="easyui-textbox" id="sknsIpt" style="width: 340px">
</input>
<a id="searchProductBtn" class="btn-info" >搜索商品</a>
</div>
</div>
<div region="center" id="productListDiv" style="margin-left: 20px">
<table id="productListTable"></table>
</div>
</div>
<script>
$(function () {
//用于页面刷新后的数据行定位
var index ="";
$("#sknsIpt").textbox({
required:false,
prompt: "输入SKN,多个SKN以逗号隔开"
});
$("#searchProductBtn").linkbutton({
iconCls : "icon-search",
onClick : function() {
$("#productListTable").datagrid("load", {
skns: $("#sknsIpt").textbox("getValue")
});
}
});
$("#productListTable").myDatagrid({
fit: true,
fitColumns: true,
striped: true,
url: serverContextPath + "/grassGoods/searchProducts",
method: 'POST',
loadFilter: function (data) {
var tmp = defaultLoadFilter(data);
tmp.rows = tmp.list?tmp.list:[];
return tmp;
},
columns: [[
{
field: "ck",
checkbox:true,
align: "left"
},
{
title: "产品图片",
field: "default_images",
width: 15,
align: "center",
formatter: function (value, rowData, rowIndex) {
return "<img style='width: 80px; height: 80px' src='"+value+"'/>";
}
},
{
title: "产品名称",
field: "product_name",
width: 30,
align: "left"
},{
title: "SKN",
field: "product_skn",
width: 20,
align: "labelAmount"
},
{
title: "品牌",
field: "brand_name",
width: 20,
align: "labelAmount"
},
{
title: "现价",
field: "sales_price",
width: 20,
align: "labelAmount"
},
{
title: "吊牌价",
field: "market_price",
width: 20,
align: "labelAmount"
},
{
title: "预售(哪个?)",
field: "sales_num",
width: 20,
align: "labelAmount"
},
{
title: "库存",
field: "storage_num",
width: 20,
align: "labelAmount"
}
]],
cache: false,
pagination: true,
pageSize: 10,
pageList: [10],
idField: "product_skn",
singleSelect: false,
onLoadSuccess: function (data) {
if(index != ""){
$(this).datagrid("scrollTo",index);
index = "";
}
}
});
});
</script>