731 lines
23 KiB
JavaScript
731 lines
23 KiB
JavaScript
function getColModelGrid() {
|
|
var i = 0;
|
|
var colModelGrid = [
|
|
{ name: 'id', hidden: true, optionHide: true },
|
|
{ name: 'EncryptTradeId', hidden: true, optionHide: true },
|
|
{
|
|
name: 'TradeNumber',
|
|
label: '交易编号',
|
|
index: 'TradeNumber',
|
|
width: 150,
|
|
align: 'center',
|
|
sortIndex: i++,
|
|
sortable: true
|
|
}, {
|
|
name: 'GroupName',
|
|
label: '分组名',
|
|
index: 'GroupName',
|
|
sortIndex: i++,
|
|
width: 80,
|
|
sortable: false,
|
|
hidden: !page.isGuoyuan
|
|
}, {
|
|
name: 'ContractCode',
|
|
label: '确认书编号',
|
|
index: 'ContractCode',
|
|
width: 150,
|
|
align: 'center',
|
|
sortIndex: i++,
|
|
sortable: true
|
|
}, {
|
|
name: 'ExchangeOptionCode',
|
|
label: '期权代码',
|
|
index: 'ExchangeOptionCode',
|
|
width: 150,
|
|
align: 'center',
|
|
sortIndex: i++,
|
|
sortable: true
|
|
}, {
|
|
name: 'ChildLeg',
|
|
label: '多腿编号',
|
|
index: 'ChildLeg',
|
|
width: 80,
|
|
align: 'center',
|
|
sortIndex: i++,
|
|
sortable: false
|
|
}, {
|
|
name: page.isPvRounded ? 'RoundedPositionPnl' : 'PositionPnl',
|
|
label: '浮动盈亏',
|
|
index: page.isPvRounded ? 'RoundedPositionPnl' : 'PositionPnl',
|
|
sortIndex: i++,
|
|
width: 65,
|
|
align: 'center',
|
|
sortable: true,
|
|
formatter: PriceFormat
|
|
}, {
|
|
name: 'RealizedPnl',
|
|
label: '实现盈亏',
|
|
index: 'RealizedPnl',
|
|
sortIndex: i++,
|
|
width: 65,
|
|
align: 'center',
|
|
sortable: false,
|
|
formatter: RealizedPnlFormat
|
|
}, {
|
|
name: 'CurrentVolatility',
|
|
label: '当前波动率',
|
|
index: 'CurrentVolatility',
|
|
sortIndex: i++,
|
|
width: 65,
|
|
align: 'center',
|
|
formatter: otcformat.trading.premiumRateP,
|
|
sortable: true
|
|
}, {
|
|
name: 'Delta',
|
|
label: 'Delta',
|
|
index: 'Delta',
|
|
width: 100,
|
|
align: 'center',
|
|
sortIndex: i++,
|
|
formatter: otcformat.trading.greek,
|
|
sortable: false
|
|
}, {
|
|
name: 'DeltaLots',
|
|
label: 'Delta手数',
|
|
index: 'DeltaLots',
|
|
width: 100,
|
|
align: 'center',
|
|
sortIndex: i++,
|
|
formatter: otcformat.trading.notional,
|
|
sortable: false
|
|
}, {
|
|
name: 'Gamma',
|
|
label: 'Gamma',
|
|
index: 'Gamma',
|
|
width: 100,
|
|
sortIndex: i++,
|
|
align: 'center',
|
|
formatter: otcformat.trading.greek,
|
|
sortable: false
|
|
}, {
|
|
name: 'GammaLots',
|
|
label: 'Gamma手数',
|
|
index: 'GammaLots',
|
|
width: 100,
|
|
sortIndex: i++,
|
|
align: 'center',
|
|
formatter: otcformat.trading.notional,
|
|
sortable: false
|
|
}, {
|
|
name: 'Theta',
|
|
label: 'Theta',
|
|
index: 'Theta',
|
|
width: 100,
|
|
align: 'center',
|
|
sortIndex: i++,
|
|
formatter: otcformat.trading.greek,
|
|
sortable: true
|
|
}, {
|
|
name: 'Rho',
|
|
label: 'Rho',
|
|
index: 'Rho',
|
|
width: 100,
|
|
align: 'center',
|
|
sortIndex: i++,
|
|
formatter: otcformat.trading.greek,
|
|
sortable: true
|
|
}, {
|
|
name: 'Vega',
|
|
label: 'Vega',
|
|
index: 'Vega',
|
|
sortIndex: i++,
|
|
width: 100,
|
|
align: 'center',
|
|
formatter: otcformat.trading.greek,
|
|
sortable: true
|
|
}, {
|
|
name: 'ExerciseDate',
|
|
label: '到期日期',
|
|
index: 'ExerciseDate',
|
|
width: 80,
|
|
sortIndex: i++,
|
|
align: 'center',
|
|
formatter: 'date',
|
|
sortable: true
|
|
}, {
|
|
name: 'ExerciseModeCn',
|
|
label: '行权方式',
|
|
index: 'ExerciseModeCn',
|
|
width: 80,
|
|
sortIndex: i++,
|
|
align: 'center',
|
|
sortable: false,
|
|
formatter: ShowToolName
|
|
}, {
|
|
name: 'TradeType',
|
|
label: '结构类型',
|
|
index: 'TradeType',
|
|
sortIndex: i++,
|
|
width: 70,
|
|
align: 'center',
|
|
formatter: function (cellvalue, options, rowObject) {
|
|
return rowObject.StructureType && rowObject.IsGroup != 2 ? rowObject.StructureType : rowObject.TradeType;
|
|
},
|
|
sortable: true
|
|
}, {
|
|
name: 'KnockInOutStatus',
|
|
label: '观察状态',
|
|
index: 'KnockInOutStatus',
|
|
sortIndex: i++,
|
|
width: 100,
|
|
align: 'center',
|
|
sortable: false
|
|
}, {
|
|
name: 'ClientName',
|
|
label: '交易对手方',
|
|
index: 'ClientName',
|
|
width: 150,
|
|
sortIndex: i++,
|
|
align: 'center',
|
|
sortable: true
|
|
}, {
|
|
name: 'ClientNumber',
|
|
label: '交易对手编号',
|
|
index: 'ClientNumber',
|
|
width: 150,
|
|
sortIndex: i++,
|
|
align: 'center',
|
|
sortable: false
|
|
}, {
|
|
name: 'AssetBookName',
|
|
label: '簿记账户',
|
|
index: 'AssetBookName',
|
|
width: 150,
|
|
sortIndex: i++,
|
|
align: 'center',
|
|
sortable: true
|
|
}, {
|
|
name: 'TradeDate',
|
|
label: '成交日期',
|
|
sortIndex: i++,
|
|
index: 'TradeDate',
|
|
width: 90,
|
|
align: 'center',
|
|
formatter: 'date',
|
|
sortable: true
|
|
}, {
|
|
name: 'OptionType',
|
|
sortIndex: i++,
|
|
label: '看涨看跌',
|
|
index: 'OptionType',
|
|
width: 80,
|
|
align: 'center',
|
|
sortable: false
|
|
}, {
|
|
name: 'BuySell',
|
|
sortIndex: i++,
|
|
label: '买卖方向',
|
|
index: 'BuySell',
|
|
width: 80,
|
|
align: 'center',
|
|
sortable: false
|
|
}, {
|
|
name: 'UnderlyingCode',
|
|
label: '标的代码',
|
|
index: 'UnderlyingCode',
|
|
width: 80,
|
|
align: 'center',
|
|
sortIndex: i++,
|
|
sortable: true
|
|
}, {
|
|
name: 'UnderlyingAssetName',
|
|
label: '标的名称',
|
|
index: 'UnderlyingAssetName',
|
|
width: 80,
|
|
align: 'center',
|
|
sortIndex: i++,
|
|
sortable: true
|
|
}, {
|
|
name: 'UnderlyingVariety',
|
|
label: '标的品种',
|
|
index: 'UnderlyingVariety',
|
|
sortIndex: i++,
|
|
width: 60,
|
|
align: 'center',
|
|
sortable: false,
|
|
hidden: !page.showUnderlyingVariety,
|
|
optionHide: !page.showUnderlyingVariety
|
|
}, {
|
|
name: 'InitialSpotPrice',
|
|
label: '期初标的价格',
|
|
index: 'InitialSpotPrice',
|
|
sortIndex: i++,
|
|
width: 85,
|
|
align: 'center',
|
|
formatter: SpotPriceFormat,
|
|
sortable: true
|
|
}, {
|
|
name: 'Strike',
|
|
label: '执行价格',
|
|
index: 'Strike',
|
|
sortIndex: i++,
|
|
width: 100,
|
|
align: 'center',
|
|
formatter: StrikeFormatter,
|
|
sortable: true
|
|
}, {
|
|
name: 'TradeSinglePrice',
|
|
label: '权利金(成交)',
|
|
index: 'TradeSinglePrice',
|
|
sortIndex: i++,
|
|
width: 100,
|
|
align: 'center',
|
|
formatter: function (cellValue, options, rowObject) {
|
|
if (rowObject.IsUsePremiumRate) {
|
|
return otcformat.trading.premiumRateP(rowObject.PremiumRate);
|
|
}
|
|
else {
|
|
return otcformat.trading.tradeSinglePrice(cellValue);
|
|
}
|
|
},
|
|
sortable: false
|
|
}, {
|
|
name: 'TradeOriginalAmountV',
|
|
label: '成交数量',
|
|
sortIndex: i++,
|
|
width: 70,
|
|
align: 'center',
|
|
formatter: function (cellvalue, options, rowObject) {
|
|
return otcformat.trading.notional(Math.abs(tradeHelper.getTradeAmountV(rowObject.trade, null, rowObject.CountRatio)));
|
|
},
|
|
sortable: false
|
|
}, {
|
|
name: 'TradeOriginalAmount',
|
|
label: '有效成交数量',
|
|
index: 'TradeOriginalAmount',
|
|
sortIndex: i++,
|
|
width: 100,
|
|
align: 'center',
|
|
formatter: TradeOriginalAmountFormat,
|
|
sortable: false
|
|
}, {
|
|
name: 'TradePrice',
|
|
label: '成交金额',
|
|
index: 'TradePrice',
|
|
sortIndex: i++,
|
|
width: 100,
|
|
align: 'center',
|
|
formatter: TradePriceFormat,
|
|
sortable: true
|
|
}, {
|
|
name: 'etcTradePrice',
|
|
label: '存续成本',
|
|
index: 'etcTradePrice',
|
|
sortIndex: i++,
|
|
width: 100,
|
|
align: 'center',
|
|
formatter: etcTradePriceFormat,
|
|
sortable: false
|
|
}, {
|
|
name: 'StockEqvNotionalToShow',
|
|
label: '名义本金',
|
|
index: 'StockEqvNotionalToShow',
|
|
sortIndex: i++,
|
|
width: 100,
|
|
align: 'center',
|
|
formatter: StockEqvNotionalFormat,
|
|
sortable: false
|
|
}, {
|
|
name: 'UnderlyingPrice',
|
|
label: '最新标的价格',
|
|
index: 'UnderlyingPrice',
|
|
width: 100,
|
|
align: 'center',
|
|
sortIndex: i++,
|
|
formatter: otcformat.trading.umprice,
|
|
sortable: false
|
|
}, {
|
|
name: 'RiskFreeRate',
|
|
label: '无风险利率',
|
|
index: 'RiskFreeRate',
|
|
width: 80,
|
|
align: 'center',
|
|
sortIndex: i++,
|
|
formatter: otcformat.trading.premiumRateP,
|
|
sortable: false
|
|
}, {
|
|
name: 'DividendRate',
|
|
label: '分红率',
|
|
index: 'DividendRate',
|
|
width: 80,
|
|
align: 'center',
|
|
sortIndex: i++,
|
|
formatter: otcformat.trading.premiumRateP,
|
|
sortable: false
|
|
}, {
|
|
name: 'SinglePV',
|
|
label: '权利金(存续)',
|
|
index: 'SinglePV',
|
|
sortIndex: i++,
|
|
width: 100,
|
|
align: 'center',
|
|
sortable: false,
|
|
formatter: function (cellValue, options, rowObject) {
|
|
if (rowObject.IsUsePremiumRate) {
|
|
var premiumRate = tradeHelper.GetPremiumRateByTradeSinglePrice(cellValue, rowObject.InitialSpotPrice);
|
|
return otcformat.trading.premiumRateP(premiumRate);
|
|
} else {
|
|
return otcformat.trading.tradePrice(cellValue);
|
|
}
|
|
}
|
|
}, {
|
|
name: 'TradeAmountV',
|
|
label: '存续数量',
|
|
sortIndex: i++,
|
|
width: 70,
|
|
align: 'center',
|
|
formatter: function (cellvalue, options, rowObject) {
|
|
return otcformat.trading.notional(tradeHelper.getTradeAmountV(rowObject.trade, rowObject.TradeAmount, 1));
|
|
},
|
|
sortable: false
|
|
}, {
|
|
name: 'TradeAmount',
|
|
label: '有效存续数量',
|
|
index: 'TradeAmount',
|
|
sortIndex: i++,
|
|
width: 100,
|
|
align: 'center',
|
|
formatter: TradeAmountFormat,
|
|
sortable: false
|
|
}, {
|
|
name: page.isPvRounded ? 'RoundedPV' : 'PV',
|
|
label: '存续市值',
|
|
index: page.isPvRounded ? 'RoundedPV' : 'PV',
|
|
sortIndex: i++,
|
|
width: 100,
|
|
align: 'center',
|
|
sortable: false,
|
|
formatter: otcformat.trading.tradePrice
|
|
}, {
|
|
name: 'CalSpotPrice',
|
|
label: '计算标的价格',
|
|
index: 'CalSpotPrice',
|
|
sortIndex: i++,
|
|
width: 100,
|
|
align: 'center',
|
|
sortable: false,
|
|
formatter: otcformat.trading.tradePrice
|
|
}, {
|
|
name: 'Margin',
|
|
label: '维持预付金',
|
|
index: 'Margin',
|
|
sortIndex: i++,
|
|
width: 100,
|
|
align: 'center',
|
|
sortable: false,
|
|
formatter: otcformat.trading.tradePrice
|
|
}, {
|
|
name: 'TraderName',
|
|
label: '交易员',
|
|
index: 'TraderName',
|
|
sortIndex: i++,
|
|
width: 100,
|
|
align: 'center',
|
|
sortable: false
|
|
}, {
|
|
name: 'SurvivingNominalPrincipal',
|
|
label: '存续名义本金',
|
|
index: 'SurvivingNominalPrincipal',
|
|
sortIndex: i++,
|
|
hidden: !page.showGuohai,
|
|
optionHide: !page.showGuohai,
|
|
width: 100,
|
|
align: 'center',
|
|
sortable: false,
|
|
formatter(cellValue, options, rowObject) {
|
|
return main.formatNumber(cellValue || '', 2);
|
|
}
|
|
}
|
|
];
|
|
//if (page.showCreditExposure) {
|
|
// colModelGrid.push({
|
|
// name: 'Exposure',
|
|
// label: '信用风险敞口',
|
|
// index: 'Exposure',
|
|
// sortIndex: i++,
|
|
// width: 100,
|
|
// align: 'center',
|
|
// sortable: false,
|
|
// formatter: otcformat.trading.tradePrice
|
|
// });
|
|
//}
|
|
|
|
//if (page.calcPnlExplain) {
|
|
// var pnlCols = [{
|
|
// name: 'PnLDelta', label: 'dPnLDelta', width: 100, align: 'center', sortable: false, formatter: otcformat.trading.greek
|
|
// }, {
|
|
// name: 'PnLGamma', label: 'dPnLGamma', width: 100, align: 'center', sortable: false, formatter: otcformat.trading.greek
|
|
// }, {
|
|
// name: 'PnLVega', label: 'dPnLVega', width: 100, align: 'center', sortable: false, formatter: otcformat.trading.greek
|
|
// }, {
|
|
// name: 'PnLTheta', label: 'dPnLTheta', width: 100, align: 'center', sortable: false, formatter: otcformat.trading.greek
|
|
// }, {
|
|
// name: 'PnLPsi', label: 'dPnLPsi', width: 100, align: 'center', sortable: false, formatter: otcformat.trading.greek
|
|
// }];
|
|
// colModelGrid = colModelGrid.concat(pnlCols);
|
|
//}
|
|
|
|
//if (page.needShowSpv) {
|
|
// //涨停市值,不变市值,跌停市值
|
|
// var spvCols = [{
|
|
// name: 'Spv1', label: '涨停市值', width: 100, align: 'center', sortable: false, formatter: otcformat.trading.greek
|
|
// }, {
|
|
// name: 'Spv2', label: '不变市值', width: 100, align: 'center', sortable: false, formatter: otcformat.trading.greek
|
|
// }, {
|
|
// name: 'Spv3', label: '跌停市值', width: 100, align: 'center', sortable: false, formatter: otcformat.trading.greek
|
|
// }];
|
|
// colModelGrid = colModelGrid.concat(spvCols);
|
|
//}
|
|
|
|
return tradeHelper.getAmountToNotional(colModelGrid);
|
|
}
|
|
|
|
$(function () {
|
|
var PostData = GetPostData();
|
|
//PostData.VolType = "持仓";
|
|
//$("#VolType").val("持仓");
|
|
|
|
var grid = jQuery('#listGrid').jqGrid({
|
|
url: '/trade/realtimePositionRisksQuery',
|
|
datatype: "local",
|
|
height: 'auto',
|
|
width: '96%',
|
|
multiselect: true,
|
|
autowidth: false,
|
|
shrinkToFit: false,
|
|
viewrecords: true,
|
|
jsonReader: { repeatitems: false },
|
|
mtype: 'POST',
|
|
postData: PostData,
|
|
afterInsertRow: AfterInsertRow,
|
|
onSelectRow: rowclick,
|
|
ondblClickRow: rowdblclick,
|
|
colModel: getColModelGrid(),
|
|
pager: jQuery('#pagerGrid'),
|
|
pagerpos: 'left',
|
|
rowNum: 500,
|
|
rowList: [50, 100, 200, 500, 10000],
|
|
footerrow: false,
|
|
//userDataOnFooter: true,
|
|
loadComplete: gridComplete,
|
|
onPaging: onJqgridPaging,
|
|
grouping: true,
|
|
loadonce: false
|
|
});
|
|
document.onkeydown = function (event) {
|
|
var e = event ? event : (window.event ? window.event : null);
|
|
if (e.keyCode === 13) {
|
|
SearchClick(true);
|
|
}
|
|
};
|
|
|
|
let underlyingCtrl = new tradeHelper.UnderlyingSelectCtrl('#UnderlyingId')
|
|
.setFlag(tradeHelper.UnderlyingSelectFlag.OtcTrade);
|
|
|
|
$(window).resize(function () {
|
|
//如有频繁改变大小的需求,要增加延迟运行的逻辑;
|
|
$("#listGrid").setGridWidth($("#main-wrapper").width() - 30);
|
|
var newHeight = $(window).height() - 350;
|
|
$("#listGrid").setGridHeight(newHeight);
|
|
});
|
|
});
|
|
|
|
const GroupingFormat = main.numberFormat(2, { grouping: true });
|
|
const ThreeDecimalGroupingFormat = main.numberFormat(3, { grouping: false });
|
|
|
|
function gridComplete(data) {
|
|
var jgrid = $(this);
|
|
main.setcolumnChooser(jgrid, '实时持仓风险');
|
|
$(window).resize();
|
|
if (page.calcPnlExplain && data.Sum) {
|
|
$('#footSummaryDiv').text("dPnL: " + data.Sum.dpnl.toFixed(2));
|
|
}
|
|
|
|
if (data.Msg) {
|
|
$("#showTimestamp").text(data.Msg);
|
|
} else {
|
|
$("#showTimestamp").text("");
|
|
}
|
|
}
|
|
|
|
function rowdblclick(rowid) {
|
|
var rowData = $(this).getRowData(rowid);
|
|
if (rowData.id > 0 && rowData.TradeType) {
|
|
starttradeView(rowData.EncryptTradeId, rowData.TradeType);
|
|
}
|
|
}
|
|
|
|
function starttradeView(id, tradeType) {
|
|
var srcurl = "/trade/tradeView/?enid=" + id + "&isFromPositionReport=false&isOnlyCloseButton=true";
|
|
main.open("查看交易", srcurl, { area: ['1260px', '800px'] });
|
|
}
|
|
|
|
//---------------------------Formatter---------------------------------
|
|
function TradeOriginalAmountFormat(cellValue, options, rowObject) {
|
|
return otcformat.trading.notional(Math.abs(cellValue));
|
|
}
|
|
|
|
function TradeAmountFormat(cellValue, options, rowObject) {
|
|
return otcformat.trading.notional(cellValue);
|
|
}
|
|
|
|
function SpotPriceFormat(cellValue, options, rowObject) {
|
|
if (rowObject.TradeType !== "场内期权" && rowObject.TradeType !== "商品期货" && rowObject.TradeType !== "股票" && rowObject.TradeType !== "商品现货") {
|
|
return otcformat.trading.umprice(cellValue)
|
|
}
|
|
else {
|
|
return "";
|
|
}
|
|
}
|
|
|
|
function TradePriceFormat(cellValue, options, rowObject) {
|
|
return otcformat.trading.tradePrice(cellValue * (rowObject.BuySell === "买入" || rowObject.BuySell === "多头开仓" || rowObject.BuySell === "空头开仓" ? -1 : 1));
|
|
}
|
|
|
|
function etcTradePriceFormat(cellValue, options, rowObject) {
|
|
//黑箱主交易后台已经处理过了
|
|
if (rowObject.IsGroup == 1) {
|
|
return otcformat.trading.tradePrice(cellValue);
|
|
}
|
|
return otcformat.trading.tradePrice(cellValue * (rowObject.BuySell === "买入" || rowObject.BuySell === "多头开仓" || rowObject.BuySell === "空头开仓" ? -1 : 1));
|
|
}
|
|
|
|
|
|
function PriceFormat(cellValue, options, rowObject) {
|
|
return otcformat.trading.tradePrice(cellValue);
|
|
}
|
|
|
|
function RealizedPnlFormat(cellValue, options, rowObject) {
|
|
return otcformat.trading.tradePrice(cellValue);
|
|
}
|
|
|
|
function StockEqvNotionalFormat(cellValue, options, rowObject) {
|
|
if (rowObject.TradeType !== "场内期权" && rowObject.TradeType !== "商品期货" && rowObject.TradeType !== "股票" && rowObject.TradeType !== "商品现货") {
|
|
return otcformat.trading.StockEqvNotional(cellValue);
|
|
}
|
|
else {
|
|
return "";
|
|
}
|
|
}
|
|
|
|
function ComputePV(cellValue, options, rowObject) {
|
|
var pv = main.formatNumber(rowObject.SinglePV) * main.formatNumber(rowObject.TradeAmount);
|
|
return otcformat.trading.tradePrice(pv);
|
|
}
|
|
|
|
function PercentFormat(cellValue, options, rowObject) {
|
|
return otcformat.trading.premiumRateP(cellValue);
|
|
}
|
|
|
|
function DoubleFormat(cellValue, options, rowObject) {
|
|
return main.formatNumber(cellValue);
|
|
}
|
|
|
|
function StrikeFormatter(cellValue, options, rowObject) {
|
|
if (rowObject.TradeType == "自定义交易") {
|
|
return "";
|
|
}
|
|
if (rowObject.Strike) {
|
|
if (rowObject.IsMoneynessOption === "是") {
|
|
return otcformat.trading.premiumRateP(rowObject.Strike);
|
|
} else {
|
|
return otcformat.trading.umprice(rowObject.Strike);
|
|
}
|
|
} else {
|
|
if (rowObject.Strike === 0) {
|
|
return 0;
|
|
}
|
|
else {
|
|
return "";
|
|
}
|
|
}
|
|
}
|
|
|
|
function ShowToolName(cellValue, options, rowObject) {
|
|
if ("American" == rowObject.ExerciseMode) {
|
|
return "美式";
|
|
} else if ("European" == rowObject.ExerciseMode) {
|
|
return "欧式";
|
|
}
|
|
}
|
|
|
|
//---------------------------------------------------------------------------------
|
|
|
|
function rowclick(id) { }
|
|
|
|
|
|
//导出提示
|
|
function execExport() {
|
|
|
|
|
|
var jgrid = jQuery('#listGrid');
|
|
var postData = GetPostData();
|
|
if ($("#useRange").prop("checked")) {
|
|
postData.StartDate = $("#startDate").val();
|
|
postData.ValueDate = $('#endDate').val();
|
|
asyncDownload(postData);
|
|
} else {
|
|
postData.ValueDate = $('#endDate').val();
|
|
var ids = jgrid.jqGrid('getGridParam', 'selarrrow');
|
|
if (ids.length > 0) {
|
|
postData.TradeIds = ids;
|
|
}
|
|
downLoadFile("/trade/DownloadRealTimePositionRisks?" + $.param(postData, true));
|
|
parent.layer.closeAll();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
function showMessage(mesg) {
|
|
|
|
}
|
|
var stopExport = false;
|
|
function ProcessInFinal(url) {
|
|
if (url) {
|
|
downLoadFile(url);
|
|
stopExport = false;
|
|
} else {
|
|
main.alert("导出失败");
|
|
stopExport = true;
|
|
}
|
|
}
|
|
function downLoadFile(downloadUrlStr) {
|
|
window.open(downloadUrlStr);
|
|
}
|
|
|
|
function GetPostData() {
|
|
var postData = {};
|
|
|
|
postData.TradeNumber = $("#TradeNumber").val();
|
|
postData.BookIds = $("#BookId").val();
|
|
postData.AssetIdGroupList = $("#GroupId").val();
|
|
postData.TradeTypes = $("#TradeType").val();
|
|
postData.UnderlyingIds = $("#UnderlyingId").val();
|
|
postData.TraderIds = $("#TraderId").val();
|
|
postData.ClientIds = $("#ClientId").val();
|
|
postData.VolType = $("#VolType").val();
|
|
postData.IsParentTrade = $("#IsParentTrade").val();
|
|
postData.GroupNames = $("#GroupNames").val();
|
|
postData.TagIds = $("#TagIds").val();
|
|
return postData;
|
|
}
|
|
|
|
function SearchClick(isSearchclick) {
|
|
var listGrid = $('#listGrid');
|
|
listGrid.appendPostData(GetPostData());
|
|
if (typeof (isSearchclick) != "undefined" && isSearchclick) {
|
|
//点击搜索时默认第一页
|
|
listGrid.jqGrid('setGridParam',
|
|
{
|
|
page: 1
|
|
});
|
|
}
|
|
listGrid.jqGrid('setGridParam', { datatype: 'json' }).trigger('reloadGrid');
|
|
}
|
|
|
|
function showcolumnChooser() {
|
|
var jgrid = jQuery('#listGrid');
|
|
main.showcolumnChooser(jgrid, '实时持仓风险');
|
|
}
|