Info.js
1.81 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
var $ = require('jquery'),
common=require('../../common/common');
var ENUM={
shopNature:{1:'旗舰店',2:'专卖店'},
shopsType:{1:'单品店',2:'多品店'},
checkStatus:{100:'暂存',200:'审核中',300:'通过',900:'驳回'},
opt:{"add":"添加","delete":"删除"},
href:{"info":"/supplier/store/index","info2":"/supplier/check/index","info3":"/supplier/store/examine"}
};
var Bll={
toast:function(content,url){
common.dialog.confirm("温馨提示",content,function(){
common.util.__ajax({
url:url,
data:{shopsId:$("#shopsId").val()}
},function(){
var href=location.pathname.match(/\/supplier\/store\/(\w*)\//);
location.href=ENUM.href[href[1]];
});
});
}
}
$('#basicTable').on('click', '#tongguo', function() {
Bll.toast("您确定要通过审核吗?","/Shops/ShopsRest/checkShopPass");
});
$('#basicTable').on('click', '#bohui', function() {
Bll.toast("您确定要驳回审核吗?","/Shops/ShopsRest/checkReject");
});
for(var key in ENUM){
var me=$("#"+key);
me.parent("div").html(ENUM[key][me.val()]);
}
$("#otherUrl").add("#websiteUrl").add("#shopAddress").each(function(){
var data=JSON.parse($(this).val());
var me=$(this).parent();
$.each(data,function(i,item){
me.append("<p>"+item+"</p>");
});
});
var g2=new common.grid({
el:"#baseTable",
columns:[
{display:"品牌","name":"brandName"},
{display:"供应商","name":"supplierName"},
{display:"操作",render:function(item){
return ENUM.opt[item.method]||"无变化";
}}
]
});
if($("#shopRelationList").val()){
var a=JSON.parse($("#shopRelationList").val());
g2.init(a);
}