bidDetail.html
11.4 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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<!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: 160px">
<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="attribute" type="text">
<input id="bidUid" type="text">
<input id="storageId" type="text">
<input id="sizeId" 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>
<a id="returnList" 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 ENUM = {
sku_p_status: {
0 : '待付保证金',
1 : '出售中',
2 : '卖家取消支付',
3 : '卖家支付超时',
4 : '卖家取消出售',
10 : '待审核',
11 : '审核不通过',
100 : '已出售',
101 : '出售中', // 买家手动取消、买家超时未支付对应 --》skup 出售中
102 : '出售中',
200 : '平台取消出售',
201 : '已出售' // 订单鉴定失败 --》skup 已出售
}
};
function parseURL(url){
var url = url.split("?")[1];
var para = url.split("&");
var len = para.length;
var res = {};
var arr = [];
for(var i=0;i<len;i++){
arr = para[i].split("=");
res[arr[0]] = arr[1];
}
return res;
}
$(function () {
var productId = parseURL(window.location.href).productId;
var midSortId = parseURL(window.location.href).midSortId;
$('#returnList').linkbutton({
onClick: function () {
location.href = contextPath + "/html/goods/storage/storageList.html?time_version=" + new Date().getTime();
}
});
//
// * 卖家操作
//* 0:初始(未支付保证金),*1:可售(已经支付保证金),2:卖家取消支付保证金,3:卖家超时未支付保证金,4:卖家支付保证金后取消售卖
//* 买家操作
//* 100:购买使得商品卖出(可能下单未支付,且未超时,或者已支付),101:取消卖出(买家手动),102:取消卖出(超时未支付)
//* 平台操作
//* 200:客服取消,201:鉴定失败
$("#status").myCombobox({
prompt: "状态",
width: 200,
data: [{id: '10',text: '求购中'}, {id: '60',text: '求购成功'}, {id: '71',text: '求购关闭(买家取消求购)'}, {id: '72',text: '求购关闭(买家求购超时)'},
{id: '73',text: '求购关闭(平台取消求购)'}],
valueField: "id",
textField: "text"
});
$("#attribute").myCombobox({
prompt: "SKU_P类型",
width: 200,
data: [{id: '1',text: '现货'}],
valueField: "id",
textField: "text"
});
$("#SKUP").textbox({
prompt: "SKU_P"
});
$("#bidUid").textbox({
prompt: "卖家UID"
});
$("#storageId").textbox({
prompt: "SKU"
});
$.ajax({
contentType: "application/json",
dataType: "json",
type: "GET",
url: contextPath + '/size/queryAllSize4Goods?sortId=' + midSortId,
success: function (data) {
if (data.code != 200 || !data.data || data.data.length == 0) {
return;
}
$("#sizeId").myCombobox({
prompt: "尺码",
width: 200,
data: data.data,
valueField: "id",
textField: "text"
});
}
});
$("#skupTable").myDatagrid({
fit: true,
fitColumns: true,
nowrap: false,
url: contextPath + "/storage/bidPriceList",
method: 'POST',
queryParams: {
'productId': productId,
},
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "SKU_P",
field: "skup",
width: 40,
align: "center"
}, {
title: "SKUP类型",
field: "attributeStr",
width: 80,
align: "center",
}, {
title: "SKU",
field: "productId",
width: 80,
align: "center"
}, {
title: "颜色",
field: "colorName",
width: 100,
align: "center"
}, {
title: "尺码",
field: "sizeName",
width: 80,
align: "center"
}, {
title: "买家UID",
field: "bidUid",
width: 200,
align: "center"
}, {
title: "求购价",
field: "price",
width: 50,
align: "center",
}, {
title: "状态",
field: "statusStr",
width: 50,
align: "center"
}, {
title: "创建时间",
field: "createTimeStr",
width: 130,
align: "center"
}, {
title: "操作",
field: "operations",
width: 120,
align: "center",
formatter: function (value, rowData) {
var button = '';
if (rowData.status == 10) {
button += "<a role='cancel' dataId='" + rowData.skup + "' product_name='" + rowData.productName + "' style='margin-left:10px;background-color: #f0ad4e'>取消求购</a>";
}
return button;
}
}]],
cache: false,
pagination: true,
pageSize: 50,
idField: "id",
singleSelect: false,
checkOnSelect: false,
onLoadSuccess: function () {
// 取消
$(this).myDatagrid("getPanel").find("a[role='cancel']").linkbutton({
iconCls: "icon-edit",
onClick: function () {
var id = $(this).attr("dataId");
cancelBid(id);
}
});
}
});
// 搜索
$("#searchLinkButton").linkbutton({
onClick: function () {
var param = getParams();
$("#skupTable").myDatagrid("load", param);
}
});
// 搜索全部
$("#searchAllLinkButton").linkbutton({
onClick: function () {
$('#status').combobox('clear');
$('#SKUP').textbox('clear');
$('#attribute').combobox('clear');
$('#bidUid').textbox('clear');
$('#storageId').textbox('clear');
$('#sizeId').combobox('clear');
var param = {};
$("#skupTable").myDatagrid("load", param);
}
});
/**
* 提取出搜索参数
* <input id="status" type="text"/>
<input id="SKUP" type="text">
<input id="bidUid" type="text">
<input id="storageId" type="text">
*/
function getParams() {
var status = $('#status').combobox('getValue');
var skup = $('#SKUP').textbox('getValue');
var attribute = $('#attribute').combobox('getValue');
var bidUid = $('#bidUid').textbox('getValue');
var storageId = $('#storageId').textbox('getValue');
var sizeId = $('#sizeId').combobox('getValue');
var param = {'productId': productId};
if (undefined !== status && null !== status && "" !== status) {
param.status = status;
}
if (undefined !== skup && null !== skup && "" !== skup) {
param.skup = skup;
}
if (undefined !== attribute && null !== attribute && "" !== attribute) {
param.attribute = attribute;
}
if (undefined !== bidUid && null !== bidUid && "" !== bidUid) {
param.bidUid = bidUid;
}
if (undefined !== storageId && null !== storageId && "" !== storageId) {
param.storageId = storageId;
}
if (undefined !== sizeId && null !== sizeId && "" !== sizeId) {
param.sizeId = sizeId;
}
return param;
}
function editRow(id, productName) {
var skup = id;
var div = $("<div>").appendTo($(document.body));
var message = "确定要取消售卖此件商品吗?商品取消售卖后,卖家的该件商品强制下架,退还卖家保证金";
$.messager.confirm("取消售卖提醒", message, function (flag) {
if (flag) {
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
interval: 500,
text: ""
});
$.post(contextPath + "/product/cancelSaleSkup",{"skup":skup, "productName" : productName}, function (data) {
$.messager.progress("close");
if (data.code == 200) {
$("#skupTable").myDatagrid("reload");
$.messager.show({title: "提示", msg: '操作成功', height: 120});
} else {
$.messager.alert("失败", '操作失败', "error");
}
}, "json");
}
});
}
// 取消求购
function cancelBid(skup) {
$.post(contextPath + "/storage/cancelBid",{"skup":skup}, function (data) {
$.messager.progress("close");
if (data.code == 200) {
$("#skupTable").myDatagrid("reload");
$.messager.show({title: "提示", msg: '操作成功', height: 120});
} else {
$.messager.alert("失败", '操作失败', "error");
}
}, "json");
}
});
</script>
</body>
</html>