已85版本为例,最近有很多现场反馈希望能修改这里行程信息显示
这里的行程信息格式化是在方案中配置的,我们可以通过修改这里的格式化函数按照需要显示的数据样式去修改
点击右边标红按钮新增格式化函数,参数按照原来标准方法设置
上面添加完后记得点击保存,在脚本中生成tripTest方法,加入以下代码:
var initData = bizCollBillBase.getModelInitData();
var startDateStr = rowObject.startDate || "";
startDateStr = startDateStr.split(" ")[0];
var endDateStr = rowObject.endDate || "";
endDateStr = endDateStr.split(" ")[0];
var fromStr = rowObject.from || "";
var toStr = rowObject.to || "";
var roomDaysStr = rowObject.roomDays || "";
if(startDateStr == "" && endDateStr == "" && fromStr == "" && toStr == "" && roomDaysStr ==""){
return "";
}
//避免roomDaysStr=0时,强制赋值为“”
if(roomDaysStr == ""){
roomDaysStr = "0";
}
return "<span id = 'tripInfoSpan'>" + startDateStr + "—" + endDateStr + "</br>" + waf.wafutil.htmlEncode(fromStr) + "—" + waf.wafutil.htmlEncode(toStr) + "," +
_self._localeStr.ACCOMMODATION + waf.wafutil.htmlEncode(roomDaysStr) + "天,补助: "
+ waf.wafutil.htmlEncode(rowObject.allowanceDays) +"天</span>";
预览可以看到这边已经把补助字段也放出来了,长途交通费、住宿费等格式化方法也可以参照这样修改
推荐阅读