87,910
社区成员
发帖
与我相关
我的任务
分享
$(function () {
var dataGridParam={
id:"project",
queryUrl:'${ctx}/fwzl/nongfanggl/getNongfangInfo.do',
httpUrl:'${ctx}',
columns: [/* {
field:"state",
checkbox:true
}, */{field: "ids",title: '序号',align: 'center',
formatter: function(value, row, index) {
// return index+1;
var pageSize = $('#kzxList').bootstrapTable('getOptions').pageSize || 10; //通过表的#id 可以得到每页多少条
var pageNumber = $('#kzxList').bootstrapTable('getOptions').pageNumber || 1; //通过表的#id 可以得到当前第几页
return pageSize * (pageNumber - 1) + index + 1; //返回每条的序号: 每页条数 * (当前页 - 1 )+ 序号
}
},{
field: 'owner',
title: '权利人姓名',
align: 'center',
sortable:true
}, {
field: 'farmhouseCode',
title: '项目编号',
align: 'center',
sortable:true
}, {
field: 'leasePrice',
title: '出租价格',
align: 'center',
sortable:true,
formatter: function(value, row, index) {
var html = "";
if(value==0){
html="面议";
}else{
html=value+"万元/年"
}
return html;
}
}, {
field: 'contactNumber',
title: '联系电话',
align: 'center',
sortable:true
}, {
field: 'district',
title: '区域',
align: 'center'
}, {
field: 'status',
title: '状态',
align: 'center',
sortable:true,
formatter: function(value, row, index) {
if (value == 0 || value == 4) {
return "<span style='color:blue;'>待审核</span>";
} else if (value == 1) {
return "<span style='color:green;'>已审核</span>";
} else if (value == 2) {
return "<span style='color:red;'>不通过</span>";
}
}
}, {
field: 'caozuo',
title: '操作',
align:'center',
formatter: function(value, row, index) {
if (row.status == 1) {
var html = '<a style="margin-left:10px" class="btn btn-primary btn-outline btn-sm" onclick="toNongfangDetail('+ row.id +')">查看</a>'
+'<a style="margin-left:10px" class="btn btn-danger btn-outline btn-sm" onclick="deletes('+ row.id +')">删除</a>'
return html;
} else {
var html = '<a style="margin-left:10px" class="btn btn-primary btn-outline btn-sm" onclick="toNongfangDetail('+ row.id +')">查看</a>'+
'<a style="margin-left:10px" class="btn btn-primary btn-outline btn-sm" onclick="updateById('+ row.id +')">修改</a>'
+'<a style="margin-left:10px" class="btn btn-danger btn-outline btn-sm" onclick="deletes('+ row.id +')">删除</a>'
return html;
}
}
}]
}
initdatagrid(dataGridParam);
});
引用js <script src="${ctx}/static/common/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="${ctx}/static/common/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="${ctx}/static/common/js/bootstrap.min.js?v=3.3.6"></script>
<link href="${ctx}/static/common/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet" />
<link href="${ctx}/static/common/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
这样就没问题了啊