layui templet

function toUrl(refUrl) {
window.open(refUrl, "服务报告", "_blank");
}
function mm(logName,sourceType,refUrl) {
/* */
if (sourceType==='TSE_MM'||sourceType==='FAE_MM') {
return '<a style="text-decoration :underline ; text-underline: #00a0e9;" onclick="toUrl(\''+refUrl+'\')">'+logName+'</a>';
} else {
return logName;
}
}
layui.use(['jquery', 'table', 'laypage', 'form'], function () {
$ = layui.jquery;
var table = layui.table;
var forLineId=$("#forLineId").val();
table.render({
id: 'dit'
,elem: '#dit'
,method:"post"
, url: $("#PageContext").val() + '/workLog/listPage?forLineId='+forLineId
, cols: [[
{type: 'numbers', width: '5%'},
{field: 'logDate', width: '15%', title: '服务日期', sort: false},
{field: 'userName', width: '12%', title: '服务人', sort: false},
{field: 'logName', width: '68%', title: '服务内容', sort: false,templet:'<div>{{ mm(d.logName,d.sourceType,d.refUrl)}}</div>'}
]]
, page: true
, limit: 10//每页条数
, limits: [10, 20, 30, 40, 50]
, height: 480
});
posted @ 2019-02-19 16:29  albert_think  阅读(2154)  评论(0编辑  收藏  举报