decoration-index.js
2.75 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
'use strict';
var $ = require('jquery'),
common = require('../common/common');
var ENUM = {
checkStatus: {
100: '暂存',
200: '待审核',
300: '审核通过',
900: '驳回'
}
};
new common.dropDown({
el: "#brand-name",
ajax: "brand"
});
new common.dropDown({
el: "#supplier-name",
ajax: "supplier"
});
new common.dropDown({
el: "#shop-name",
ajax: "shopsRest"
});
new common.dropDown({
el: "#status"
});
var g = new common.grid({
el: '#basicTable',
parms: function() {
return {
shopsId: common.util.__input("shop-name"),
checkStatus: common.util.__input("status"),
supplierId: common.util.__input("supplier-name"),
brandId: common.util.__input("brand-name")
};
},
columns: [{
display: "店铺ID",
name: "shopsId"
}, {
display: "店铺名称",
name: "shopsName"
}, {
display: "包含品牌",
name: "brands",
render: function(item) {
//console.log(item);
if (item.brands instanceof Array && item.brands.length > 0) {
var html = '';
$.each(item.brands, function(i, value) {
html += value.brandName + '<br>';
});
return html;
} else {
return '';
}
}
}, {
display: "创建时间",
name: "createTime",
render: function(item) {
if (item.createTime) {
return common.util.__dateFormat(new Date(item.createTime * 1000), "yyyy-MM-dd hh:mm:ss");
} else {
return '';
}
}
}, {
display: "更新时间",
name: "updateTime",
render: function(item) {
if (item.updateTime) {
return common.util.__dateFormat(new Date(item.updateTime * 1000), "yyyy-MM-dd hh:mm:ss");
} else {
return '';
}
}
}, {
display: "状态",
name: "checkStatus",
render: function(item) {
if (item.checkStatus) {
return ENUM.checkStatus[item.checkStatus]
} else {
return '未装修';
}
}
}, {
display: "操作",
render: function(item) {
var HtmArr = [];
if(item.checkStatus == 200){
HtmArr.push('<a href="/supplier/store/decorationDetail/'+item.shopsId+'/'+item.shopsType+'/view/'+item.id+'/" class="btn btn-info btn-xs">装修查看</a>');
}else {
HtmArr.push('<a href="/supplier/store/decorationDetail/'+item.shopsId+'/'+item.shopsType+'/editor/'+item.id+'/" class="btn btn-success btn-xs">装修编辑</a>');
}
if (item.checkStatus == 900) {
HtmArr.push('<a href="javascript:void(0)" class="btn btn-warning btn-xs commentBtn" data-comment="'+item.comment+'">驳回理由</a>');
}
return HtmArr.join('');
}
}]
});
g.init($("#gridurl").val());
// 筛选
$(document).on('click', "#filter-btn", function() {
g.reload();
});
//查看驳回理由
$(document).on('click', ".commentBtn", function() {
var comment = $(this).attr("data-comment");
common.dialog.confirm(
"查看驳回理由",
comment,
function(){},
function(){}
);
});