78 lines
3.0 KiB
JavaScript
78 lines
3.0 KiB
JavaScript
function TradeMarketReportConfigureListCtrl() {
|
|
$(function () {
|
|
let ctrl = main.jqGrid({
|
|
url: "/clientbalance/GetTradeMarketReportConfigureList",
|
|
searchForm: '#form1',
|
|
colModelGrid: [{
|
|
name: 'id', hidden: true, optionHide: true
|
|
}, {
|
|
name: 'EncryptId', hidden: true, optionHide: true
|
|
}, {
|
|
name: 'ClientId', label: '客户id', index: 'ClientId', hidden: true
|
|
}, {
|
|
name: 'TemplateName', label: '模板', index: 'TemplateName'
|
|
}, {
|
|
name: 'ClientName', label: '适用客户', index: 'ClientName', width: 200
|
|
}, {
|
|
name: 'Remarks', label: '备注', index: 'Remarks'
|
|
}, {
|
|
name: 'OptName', label: '操作人', index: 'OptName'
|
|
}, {
|
|
name: 'OptDate', label: '操作时间', index: 'OptDate', width: 160, formatter: 'datetime'
|
|
}, {
|
|
name: '', label: '操作', width: 160, formatter: showToolName, sortable: false, hidden: false, optionHide: false
|
|
}]
|
|
});
|
|
|
|
window.reloadData = ctrl.SearchClick;
|
|
});
|
|
function showToolName(cellValue, options, rowObject) {
|
|
if (rowObject.ClientName==="全部") {
|
|
return "<input type=\"button\" class=\"wentiEdit\" title='修改' onclick=\"TradeMarketReportConfigureEdit('{0}')\" value=\"{1}\" />".template(rowObject.EncryptId, "修改");
|
|
} else {
|
|
return "<input type=\"button\" class=\"wentiEdit\" title='修改' onclick=\"TradeMarketReportConfigureEdit('{0}')\" value=\"{1}\" /><input type=\"button\" class=\"wentiEdit\" title='删除' onclick=\"TradeMarketReportConfigureDelete('{0}')\" value=\"{2}\" />".template(rowObject.EncryptId, "修改", "删除");
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
function TradeMarketReportConfigureAdd() {
|
|
var url = "/clientbalance/TradeMarketReportConfigureEdit";
|
|
main.infopage("新增报告配置", url, { area: ['550px', '400px'] });
|
|
}
|
|
|
|
function TradeMarketReportConfigureEdit(id) {
|
|
var url = "/clientbalance/TradeMarketReportConfigureEdit?enid=" + id;
|
|
main.infopage("修改报告配置", url, { area: ['550px', '400px'] });
|
|
}
|
|
//导入报告配置
|
|
function importTradeMarketReportConfigure() {
|
|
main.infopage('报告配置导入', "/clientbalance/TradeMarketReportConfigureImport", { area: ['550px', '300px'] });
|
|
}
|
|
function TradeMarketReportConfigureDelete(id) {
|
|
var url = "/clientbalance/TradeMarketReportConfigureDelete?enid=" + id;
|
|
main.post(url).done(function (res) {
|
|
reloadConfigure();
|
|
});
|
|
}
|
|
|
|
function reloadConfigure() {
|
|
SearchClick();
|
|
}
|
|
|
|
function SearchClick(isSearchclick) {
|
|
var listGrid = $('#listGrid');
|
|
|
|
listGrid.appendPostData({ ClientId: $("#ClientId").val() });
|
|
|
|
query_data = listGrid.jqGrid('getPostData');
|
|
if (typeof isSearchclick !== "undefined" && isSearchclick) {
|
|
//点击搜索时默认第一页
|
|
listGrid.jqGrid('setGridParam',
|
|
{
|
|
page: 1
|
|
});
|
|
}
|
|
|
|
listGrid.trigger('reloadGrid');
|
|
} |