shootMeter.MeterSize.Index.js
3.51 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
webpackJsonp([154],[
/* 0 */
/***/ function(module, exports, __webpack_require__) {
/**
* Created by ty on 2016/3/22.
* 测量尺码管理
*/
var $ = __webpack_require__(1);
var common = __webpack_require__(2);
new common.edit("#filter").init();
new common.dropDown({el: "#hasMeasure-filter"});
new common.dropDown({
el: "#brand-filter", ajax: "brand", params: function () {
return {status: 1};
}
});
var tabTree = new common.tabTree("#category-filter", {
columns: [{
state: "prov",
text: "一级分类",
hide: false,
addclass: ""
}],
datas: [{id: "", name: ""}]
});
tabTree.init();
var g = new common.grid({
el: "#content-list",
hash: false,
parms: function () {
return {
productSkn: common.util.__input('skn-filter'),
brandId: common.util.__input('brand-filter'),
productSku: common.util.__input('sku-filter'),
arriveStartTime: new Date(common.util.__input('startTime')).getTime() / 1000,
arriveEndTime: new Date(common.util.__input('endTime')).getTime() / 1000,
isMeasure: common.util.__input('hasMeasure-filter'),
maxSortId: tabTree.getAddress()[0] ? tabTree.getAddress()[0].id : ""
};
},
columns: [
{display: "SKN", name: "productSkn"},
{display: "名称", name: "productName"},
{display: "品牌", name: "brandName"},
{display: "分类", name: "productType"},
{display: "性别", name: "genderName"},
{
display: "尺码",
name: "sizeRelationsList",
render: function (item1) {
return common.util.__template2($("#sizeinfo-template").html(), item1);
}
},
{
display: "到货时间",
name: "",
render: function (item1) {
if (item1.expectArrivalTime) {
return Bll.getLocalTime(item1.expectArrivalTime);
}
else {
return ""
}
}
},
{display: "操作人", name: "updateUserName"},
{
display: "操作", name: "", render: function (item1) {
var arr = [];
arr.push('<a class="btn btn-xs btn-info add2" data-index="' + item1.__index + '">编辑</a>');
return arr.join("");
}
}
]
});
g.init("/meterManage/productSize/queryProdSizeList");
//当点击“无需测量”,该列输入框不可编辑
common.sizeInfo.check();
var Bll = {
getLocalTime: function (nS) {
var date = new Date(parseInt(nS) * 1000);
var mm = date.getMonth() + 1;
var dd = date.getDate();
var h = date.getHours();
var min = date.getMinutes();
var second = date.getSeconds();
return date.getFullYear() + "-" + (mm < 10 ? "0" + mm : mm) + "-" + (dd < 10 ? "0" + dd : dd) + " " + (h < 10 ? "0" + h : h) + ":"
+ (min < 10 ? "0" + min : min) + ":" + (second < 10 ? "0" + second : second);
}
};
$(document).on('click', '#filter-btn', function () {
g.reload(1);
});
$(document).on('click', '.add2', function () {
var item = g.rows[$(this).data("index")];
//拼接分类字符串
var a = item.productType.replace(/<br>/g, "/");
item.productType = a.substring(0, a.length - 1);
common.sizeInfo.toast("/meterManage/productSize/saveProdSizeInfo", item,false,g);
});
/***/ }
]);