今天在这里给大家分享的功能是查看数据对应的详细数据
效果图:
未点击客户欠费表格列时,用户欠费表格显示“没有数据可以用于显示”
点击客户欠费表格列后,用户欠费表格显示了其对应的详细信息数据
MVC代码:
//根据欠费信息ID查询用户欠费信息
public ActionResult SelectUserArrearsInfo(BsgridPage bsgridPage, int OverdueBillInfoID)
{
var list = (from tbUserArrearsInfo in myModels.XPW_UserArrearsInfo
join tbOverdueBillInfo in myModels.XPW_OverdueBillInfo on tbUserArrearsInfo.OverdueBillInfoID equals tbOverdueBillInfo.OverdueBillInfoID
join tbCommunity in myModels.XSYS_Community on tbUserArrearsInfo.CommunityID equals tbCommunity.CommunityID
join tbArrearsStatus in myModels.XSYS_ArrearsType on tbUserArrearsInfo.ArrearsTypeID equals tbArrearsStatus.ArrearsTypeID
join tbManager in myModels.PW_Staff on tbUserArrearsInfo.CustomerManagerID equals tbManager.StaffID
join tbNumberStatus in myModels.XSYS_StatusType on tbUserArrearsInfo.StatusTypeID equals tbNumberStatus.StatusTypeID
join tbBusinessType in myModels.XSYS_BusinessType on tbUserArrearsInfo.BusinessTypeID equals tbBusinessType.BusinessTypeID
where tbUserArrearsInfo.OverdueBillInfoID == OverdueBillInfoID
orderby tbUserArrearsInfo.UserArrearsInfoID ascending
select new UserArrearsInfoVo
{
UserArrearsInfoID = tbUserArrearsInfo.UserArrearsInfoID,//用户欠费信息ID
CommunityID = tbUserArrearsInfo.CommunityID,//社区ID
ArrearsTypeID = tbUserArrearsInfo.ArrearsTypeID,//欠费状态ID
CustomerManagerID = tbUserArrearsInfo.CustomerManagerID,//客户经理ID
StatusTypeID = tbUserArrearsInfo.StatusTypeID,//号码状态ID
BusinessTypeID = tbUserArrearsInfo.BusinessTypeID,//业务类型ID
CommunityName = tbCommunity.Community,//社区
ArrearsStatusName = tbArrearsStatus.ArrearsType,//欠费状态
CustomerManagerName = tbManager.StaffName,//客户经理
NumberStatusName = tbNumberStatus.StatusType,//号码状态
BusinessTypeName = tbBusinessType.BusinessType,//业务类型
UserNumber = tbUserArrearsInfo.UserNumber,//用户号码
UserName = tbUserArrearsInfo.UserName,//用户名称
UserAddress = tbUserArrearsInfo.UserAddress,//用户地址
StatusChangeTimeStr = tbUserArrearsInfo.StatusChangeTime.ToString(),//状态变更时间
BoxName = tbUserArrearsInfo.BoxName,//箱盒名称
ArrearsMoney = tbUserArrearsInfo.ArrearsMoney,//欠费金额
LateFeeEstimation = tbUserArrearsInfo.LateFeeEstimation,//滞纳金估算
ArrearsMonthly = tbUserArrearsInfo.ArrearsMonthly,//欠费月次
StartOverdueTimeStr = tbUserArrearsInfo.StartOverdueTime.ToString(),//最早欠费时间
EndOverdueTimeStr = tbUserArrearsInfo.EndOverdueTime.ToString()//最后欠费时间
});
int intTotalRows = list.Count();
List UserArrearsInfoVo = list.Skip(bsgridPage.GetStartIndex()).Take(bsgridPage.pageSize).ToList();
Bsgrid bsgrid = new Bsgrid()
{
success = true,
totalRows = intTotalRows,
curPage = bsgridPage.curPage,
data = UserArrearsInfoVo
};
return Json(bsgrid, JsonRequestBehavior.AllowGet);
}
JQuery代码:
//声明变量
var tabOverdueBillInfo;//客户欠费table
var tabUserArrearsInfo;//用户欠费table
//绑定用户欠费表格代码
tabOverdueBillInfo = $.fn.bsgrid.init("tabOverdueBillInfo", {
url: '/QueryPlatform/AccountInfoQuery/SelectOverdueBillInfo',
autoLoad: false,
stripeRows: true,
rowHoverColor: true,
displayBlankRows: false,
pageSize: 10,
pageSizeSelect: true,
paingLittleToolbar: true,
pagingToolbarAlign: "left",
event: {//给客户欠费表格添加列点击事件
customRowEvents: {
click: function (record, rowIndex, trObj, options) {
if (record != null) {
OverdueBillInfoID = record.OverdueBillInfoID;
searchUserArrearsInfo();//应用查询用户欠费信息方法
searchAccountArrearsInfo();
}
}
}
}
});
//绑定用户欠费表格代码
tabUserArrearsInfo = $.fn.bsgrid.init("tabUserArrearsInfo", {
url: '/QueryPlatform/AccountInfoQuery/SelectUserArrearsInfo',
autoLoad: false,
stripeRows: true,
rowHoverColor: true,
displayBlankRows: false,
pageSize: 5,
pageSizeSelect: true,
paingLittleToolbar: true,
pagingToolbarAlign: "left"
});
//查询用户欠费信息方法
function searchUserArrearsInfo() {
tabUserArrearsInfo.search("OverdueBillInfoID=" + OverdueBillInfoID);
}