promotionInfoRefresh.js
1.35 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
var $ = require('jquery'),
common = require('../../../../common/common');
var date_util=require('./_date_util');
var fixDateTime=function(){
if(PromotionInfo.startTime&&PromotionInfo.startTime>0){
PromotionInfo.startTimeStr=date_util.getDateStr(PromotionInfo.startTime);
}
if(PromotionInfo.endTime&&PromotionInfo.endTime>0){
PromotionInfo.endTimeStr=date_util.getDateStr(PromotionInfo.endTime);
}
}
var PromotionInfoRefresh={
actionUrl:"/promotionInfo/detail",
tabLoader:null,
columnName:null,
refresh : function(_params){
var _g=this;
_g.tabLoader=_params.tabLoader;
_g.columnName=_params.columnName;
var reqData={param: _params.promotionId};
common.util.__ajax2({url : _g.actionUrl, data:reqData},function(rs){
if(rs.code == 200){
PromotionInfo=rs.data;
//修复日期格式,只修改一次即可
fixDateTime();
_g.tabLoader.loadTabHtml(_g.columnName);
}else{
common.util.__tip(rs.message || rs.data.message);
}
return false;
},function(rs){
common.util.__tip("加载失败!", "warning");
});
}
}
module.exports = PromotionInfoRefresh;