index.js
3.02 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
'use strict';
var $ = require('jquery'),
common=require('../common/common');
var ENUM={
status:{0:'待审核',1:'审核通过',2:'驳回',3:'过期',4:'作废'},//全部
tips:{"0":0,"1":0,"2":0,"3":0,"4":0,"all":0}
}
/*下拉选择*/
new common.dropDown({el:"#store",ajax:"queryShop"});
new common.dropDown({el:"#brand",ajax:"queryBrand"});
new common.dropDown({el:"#createor",ajax:"querySupplier"});
var t = new common.tab({
el:"#basicTab",
click:function(){
g.reload(1);
},
columns:[
{name:"0",display:"待审核({0})"},
{name:"1",display:"审核通过({1})"},
{name:"2",display:"驳回({2})"},
{name:"3",display:"过期({3})"},
{name:"4",display:"作废({4})"},
{name:"all",display:"全部({all})"}
]
}).init(ENUM.tips);
var g = new common.grid({
el: '#basicTable',
parms:function(){
return {
brandId:common.util.__input("brandId"),
name:common.util.__input("filter-name"),
reqDepartment:common.util.__input("filter-dep"),
status: t.active
};
},
columns:[
{display:"SKN",name:"skn"},
{display:"商品信息",render:function(item){
var html=[];
html.push("<p>名称:"+item.productName+"</p>");
html.push("<p>品牌:"+item.productName+"</p>");
html.push("<p>品类:"+item.productName+"</p>");
return html.join('');
}},
{display:"售价",name:"salesPrice"},
{display:"年龄层/性别",name:"skn"},
{display:"是否预售",name:"skn"},
{display:"奥莱",name:"skn"},
{display:"商品类别",name:"skn"},
{display:"其他",name:"skn"},
{display:"创建时间",name:"skn"},
{display:"创建人",name:"skn"},
{display:"操作",render:function(item){
var HtmArr=[];
HtmArr.push('<a class="btn btn-info btn-xs apply-update" href="/base/goods/update/:productSkn">修改</a>');
HtmArr.push('<a class="btn btn-primary btn-xs apply-success" data-index="'+ item.__index+'" href="javascript:;">通过</a>');
HtmArr.push('<a class="btn btn-warning btn-xs apply-back" data-index="'+ item.__index+'" href="javascript:;">驳回</a>');
return HtmArr.join('');
}}
]
});
g.init('/base/goods/ajax/index');
var Bll={
toast:function(content,fn){
common.dialog.confirm("温馨提示",content,function(){
common.util.__ajax({
url:'/supplier/index/status',
data:fn()
},function(){
g.reload();
});
});
}
}
//通过
$(document).on("click",".apply-success",function(){
var item=g.rows[$(this).data("index")];
var data=function(){
return {
id:item.id
};
}
Bll.toast("你确定审核通过吗?",data);
});
//驳回
$(document).on("click",".apply-back",function(){
var item=g.rows[$(this).data("index")];
var data=function(){
return {
id:item.id
};
}
Bll.toast($("#template").html(),data);
});