150 lines
5.1 KiB
Plaintext
150 lines
5.1 KiB
Plaintext
|
|
@using WX.CRM.WebHelper;
|
|
|
|
@{
|
|
ViewBag.Title = "HgRecord";
|
|
Layout = "~/Views/Shared/_Layout2.cshtml";
|
|
|
|
}
|
|
<link href="/Content/data_grid_list.css" rel="stylesheet" />
|
|
<script src="/Scripts/op/jquery.tablegrid.js"></script>
|
|
|
|
<div class="mvctool bgb">
|
|
<button id="btnSave">确定</button>
|
|
</div>
|
|
<div class="bas_datagrid">
|
|
<table id="tablist"></table>
|
|
<input type="hidden" id="hidRecordIds" />
|
|
</div>
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
|
|
$("#hidRecordIds").val(parent.window.$("#recordId").val());
|
|
|
|
loadtablegrid();
|
|
|
|
//$(window).resize(function () {//自动适应大小
|
|
// $('#tablist').tablegrid('resize', {
|
|
// height: $(window).height() - 110
|
|
// });
|
|
//});
|
|
|
|
});
|
|
function frameReturnByClose() {
|
|
$("#modalwindow").window('close');
|
|
}
|
|
function frameReturnByReload(flag) {
|
|
$("#tablist").tablegrid("Load");
|
|
}
|
|
function frameReturnByMes(mes) {
|
|
$.messageBox5s('提示', mes);
|
|
}
|
|
|
|
function loadtablegrid() {
|
|
$('#tablist').datagrid({
|
|
url: '/Quality/ComplainCustomer/GetCsvrRecordList',
|
|
idField: 'RECORDID',
|
|
queryParams: { ResId: '@(Request.QueryString["ResId"])' },
|
|
pagination: false,//允许分页
|
|
//pageSize: 20,//每一页数据数量
|
|
//pageList: [20, 50],
|
|
columns: [[
|
|
{ field: 'ck', checkbox: true },
|
|
{ field: 'RECORDID', title: '编号' },
|
|
{ field: 'RESID', title: '客户ID' },
|
|
{ field: 'CALLTYPE', title: '呼叫类型' },
|
|
{ field: 'SERVICENUMBER', title: '主叫号码'},
|
|
{ field: 'TELNUMBERLAST4', title: '被叫号码' },
|
|
{ field: 'TIMELENGTH', title: '时长(秒)' },
|
|
{ field: 'TIMESTART', title: '开始时间' },
|
|
{ field: 'SALESEID', title: '受理人' }
|
|
]],
|
|
onLoadSuccess: function (data) {
|
|
if (data) {
|
|
//console.log(data.rows);
|
|
var memoId = $("#hidRecordIds").val();
|
|
$.each(data.rows, function (index, item) {
|
|
if (memoId.indexOf(item.RECORDID) != -1) {
|
|
$('#tablist').datagrid('checkRow', index);
|
|
}
|
|
});
|
|
}
|
|
},
|
|
onCheck: function (rowIndex, rowData) {
|
|
var memoId = $("#hidRecordIds").val();
|
|
if (memoId.indexOf(rowData.RECORDID) == -1) {
|
|
if (memoId == "") {
|
|
memoId = rowData.RECORDID;
|
|
}
|
|
else {
|
|
memoId += "," + rowData.RECORDID;
|
|
}
|
|
$("#hidRecordIds").val(memoId);
|
|
}
|
|
},
|
|
onUncheck: function (rowIndex, rowData) {
|
|
var memoId = $("#hidRecordIds").val().split(',');
|
|
for (var item in memoId) {
|
|
if (memoId[item] == rowData.RECORDID) {
|
|
memoId.splice(item, 1);
|
|
}
|
|
}
|
|
$("#hidRecordIds").val(memoId.join());
|
|
},
|
|
onCheckAll: function (rows) {
|
|
//console.log(rows);
|
|
for (var index in rows) {
|
|
var memoIds = $("#hidRecordIds").val();
|
|
var id = rows[index].RECORDID;
|
|
var find = memoIds.indexOf(id);
|
|
if (find == -1) {
|
|
if (memoIds == "") {
|
|
memoIds = rows[index].RECORDID;
|
|
}
|
|
else {
|
|
memoIds += "," + rows[index].RECORDID;
|
|
}
|
|
}
|
|
$("#hidRecordIds").val(memoIds);
|
|
}
|
|
},
|
|
onUncheckAll: function (rows) {
|
|
//console.log(rows);
|
|
var memoId = $("#hidRecordIds").val().split(',');
|
|
for (var index in rows) {
|
|
for (var item in memoId) {
|
|
if (memoId[item] == rows[index].RECORDID) {
|
|
memoId.splice(item, 1);
|
|
}
|
|
}
|
|
}
|
|
$("#hidRecordIds").val(memoId.join());
|
|
},
|
|
onLoadError: function () {
|
|
$.messager.alert("警告", "信息加载失败!", "error");
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
|
|
@*ToolBar事件处理*@
|
|
<script type="text/javascript">
|
|
function GetIframeHtml(src) {
|
|
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
|
|
}
|
|
|
|
//获取datagrid头部及字段
|
|
function getDataGridHeader() {
|
|
var columns = $('#tablist').tablegrid("getAllHead");
|
|
return columns;
|
|
}
|
|
|
|
$("#btnSave").click(function () {
|
|
var pkids = $("#hidRecordIds").val();
|
|
//console.log(pkids);
|
|
window.parent.frameReturnByClose();
|
|
window.parent.selectRecord(pkids);
|
|
});
|
|
|
|
</script>
|