chooseSkns.html
5.91 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<!DOCTYPE html>
<div id="tt" class="easyui-layout" fit="true" style="overflow-y: scroll;height: 80%" >
<form name="publishArticleForm" id="publishArticleForm" method="post" >
<div style="margin-top: 20px;margin-left: 30px">
<table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab">
<tr style="height: 60px">
<td >
<span style="color:red">*</span><label>手动搜索商品</label> <br>
<input id="skn" name="skn" class="easyui-textbox" style="width: 380px;"/>
<a id="searchBtn" class="go-search btn btn-primary">搜索商品</a>
</td>
</tr>
</table>
</div>
</form>
<table id="labelGroupListTable"></table>
</div>
<div region="center" id="labelGroupList" style="margin-left: 20px">
</div>
<script>
$("#searchBtn").linkbutton({
iconCls : "icon-search",
onClick : function() {
checkedItemsObj ={};
$("#labelGroupListTable").datagrid("load", {
productSkns: $("#skn").textbox("getValue"),
status: 1,
sales: "Y",
stocknumber: "1",
attribute_not: "2"
});
}
});
$("#skn").textbox({
prompt: "请输入skn,多个以逗号隔开"
});
$("#labelGroupListTable").myDatagrid({
fit: true,
fitColumns: true,
striped: true,
onCheckAll: addcheckItem,
onCheck: addcheckItem,
onUncheckAll: removeAllItem,
onUncheck: removeSingleItem,
queryParams: {
productSkns: $("#skn").textbox("getValue"),
status: 1,
sales: "Y",
stocknumber: "1",
attribute_not: "2"
},
url: "/yohosearch/search.json",
// url: +serverContextPath+"/product/queryProductInfoBySkns",
// url: serverContextPath+"/labelGroupManage/getLabelGroupList",
method: 'POST',
loadFilter: function (data) {
var tmp = defaultLoadFilter(data);
tmp.rows = tmp.list;
return tmp;
},
// columns: [[
// {
// title: "ID",
// field: "id",
// width: 15,
// align: "center",
// checkbox:true,
// formatter: function (value, rowData, rowIndex) {
// return value;
// }
// },
//
// {
// title: "标签分组名称",
// field: "groupName",
// width: 30,
// align: "left"
// },
// {
// title: "所属标签数",
// field: "labelAmount",
// width: 20,
// align: "left"
// }, {
// title: "状态",
// field: "status",
// width: 25,
// align: "left",
// formatter: function (value, rowData, rowIndex) {
// if(value == '0'){
// return "关闭";
// }
// if(value == '1'){
// return "开启";
// }
// }
// }
//
// ]],
columns: [[
{
title: "产品图片",
field: "default_images",
width: 15,
align: "center",
formatter: function (value, rowData, rowIndex) {
var result='';
if (value) {
if(value.indexOf('http://') == 0){
result = item.default_images.split("?")[0];
}else{
var fileMode = value.substring(15, 17);
if(fileMode=='01'){
result= "http://"+"img11.static.yhbimg.com"+"goodsimg"+value;
}
if(fileMode=='02'){
result= "http://"+"img12.static.yhbimg.com"+"goodsimg"+value;
}
}
}
else {
result = ""
}
if (result) {
return "<img width=120 height=60 src='" + result + "?imageMogr2/thumbnail/320x320/extent/320x320/background/d2hpdGU=/position/center/quality/90'/>";
} else {
return "";
}
}
},
{
title: "产品名称",
field: "product_name",
width: 30,
align: "left"
},
{
title: "品牌",
field: "brand_name",
width: 20,
align: "left"
}, {
title: "现价",
field: "sales_price",
width: 25,
align: "left",
}, {
title: "吊牌价",
field: "market_price",
width: 25,
align: "left",
}, {
title: "库存",
field: "stock_number",
width: 25,
align: "left"
}
]],
cache: false,
pagination: true,
pageSize: 10,
pageList: [10],
idField: "id",
checkbox:true,
onLoadSuccess: function (data) {
debugger
for (var i=0; i<data.list.length;i++){
var rowdata = data.list[i]
checkedItemsObj[rowdata.id] = rowdata;
}
resetSelectedCheckBox(data);
}
});
</script>