netsale.js
2.78 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
'use strict';
var $ = require('jquery'),
common = require('../common/common');
var ENUM = {
gender: {
1: '男',
2: '女',
3: '通用'
}
}
var g = new common.grid({
el: "#basicTable",
parms: function() {
return {
productSkn: common.util.__input("productSkn"),
productSkc: common.util.__input("productSkc"),
productSku: common.util.__input("productSku"),
productName: common.util.__input("productName"),
shopId: common.util.__input("shopId"),
brandId: common.util.__input("brandId"),
isJit: common.util.__input("isJit"),
stock: common.util.__input("stock"),
isScreen: common.util.__input("isScreen"),
isMeasure: common.util.__input("isMeasure"),
gender: common.util.__input("gender"),
maxSortId: common.util.__input("maxSortId"),
middleSortId: common.util.__input("middleSortId"),
smallSortId: common.util.__input("smallSortId"),
isOutLets: common.util.__input("isOutLets"),
productStatus: common.util.__input("productStatus"),
isScreen: common.util.__input("isScreen")
};
},
columns: [{
display: '',
type: 'checkbox'
}, {
display: 'skn',
name: 'productSkn'
}, {
display: '图片',
name: 'picImgUrl',
render: function(item) {
return '<img src="' + item.picImgUrl + '">';
}
}, {
display: '商品信息',
render: function(item) {
return '<p><strong>名称:</strong>' + item.productName + '</p>' +
'<p><strong>品牌:</strong>' + item.brandName + '</p>' +
'<p><strong>类目:</strong>' + item.maxSortName + '/' + item.middleSortName + '</p>';
}
}, {
display: '售价',
render: function(item) {
return '<p><strong>吊牌价:</strong>' + item.retailPrice + '</p>' +
'<p><strong>销售价:</strong>' + item.salesPrice + '</p>' +
'<p><strong>是否VIP:</strong></p>' +
'<p style="color: #ccc;"><strong>yoho币:</strong>' + item.returnCoin + '</p>';
}
}, {
display: '库存',
name: 'stock'
}, {
display: '年龄层/性别',
name: 'vip_discount_type',
render: function(item) {
return ENUM.gender[item.gender];
}
}, {
display: '商品类别',
name: 'vip_price'
}, {
display: '操作信息',
render: function(item) {
var html = '';
if (item.founder_name) {
html += '<p>' + item.founder_name + '</p>';
}
if (item.updateTime) {
html += '<p>' + item.updateTime + '</p>';
}
return html;
}
}, {
display: '上架状态',
name: 'vip2_price'
}, {
display: '操作',
render: function(item) {
return '<a href="/goods/netsale/edit/' + item.productSkn + '" class="btn btn-info btn-xs edit-btn">编辑</a>' +
'<a href="javascript:;" class="btn btn-info btn-xs edit-btn">上架</a>' +
'<a href="javascript:;" class="btn btn-info btn-xs info-btn">查看</a>';
}
}]
});
g.init($("#gridurl").val());
$("#filter-btn").click(function() {
g.reload(1);
});