522 lines
25 KiB
JavaScript
522 lines
25 KiB
JavaScript
const configcolumn_data = {
|
|
Barrier: "BarrierList",
|
|
DoubleShark: "DoubleSharkList",
|
|
AutoCall: "AutoCallList",
|
|
SnowBall: "SnowBallList",
|
|
Accumulator: "ObStatus_Accumulator_List"
|
|
};
|
|
|
|
const ObservationStatusTradeEnum = {
|
|
Barrier: 1,
|
|
DoubleShark: 2,
|
|
AutoCall: 3,
|
|
SnowBall: 4,
|
|
Binary: 5,
|
|
Accumulator: 6,
|
|
};
|
|
|
|
function GetGridColModes() {
|
|
var colModelGrid = [
|
|
{
|
|
name: 'id', label: 'id', hidden: true, optionHide: true
|
|
}, {
|
|
name: 'IsMoneynessOption', label: 'IsMoneynessOption', hidden: true, optionHide: true
|
|
}, {
|
|
name: 'EncryptId', label: 'EncryptId', hidden: true, optionHide: true
|
|
}, {
|
|
name: 'UnderlyingId', label: 'UnderlyingId', hidden: true, optionHide: true
|
|
}, {
|
|
name: 'TradeType', label: 'TradeType', hidden: true, optionHide: true
|
|
}, {
|
|
name: 'TradeStatus', label: '交易状态', width: 95, align: 'center'
|
|
}
|
|
];
|
|
|
|
if (tabIndexSelect === ObservationStatusTradeEnum.DoubleShark) {
|
|
let colModelGrid2 = [
|
|
{
|
|
name: 'trade_double_sharkfin_option.KnockInOutStatusCn', label: '观察状态', width: 95, sortable: false, align: 'center'
|
|
}, {
|
|
name: 'trade_double_sharkfin_option.KnockInOutDate',
|
|
label: '敲入敲出日期', width: 95, sortable: false, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'TradeNumber', label: '交易编号', width: 150, align: 'center'
|
|
}, {
|
|
name: 'ClientName', label: '交易对手方', width: 300, align: 'center'
|
|
}, {
|
|
name: 'TradeDate', label: '成交日期', width: 90, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'ExerciseDate', label: '到期日期', width: 90, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'BuySell', label: '买卖方向', width: 70, align: 'center'
|
|
}, {
|
|
name: 'UnderlyingCode', label: '标的代码', width: 100, align: 'center'
|
|
}, {
|
|
name: 'trade_double_sharkfin_option.LatestObservationDate',
|
|
label: '最近观察日', width: 100, sortable: false, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'trade_double_sharkfin_option.BarrierHigh',
|
|
label: '高障碍价格', width: 90, sortable: false, align: 'right', formatter: barrierHighFormat
|
|
}, {
|
|
name: 'trade_double_sharkfin_option.BarrierLow',
|
|
label: '低障碍价格', width: 90, sortable: false, align: 'right', formatter: barrierLowFormat
|
|
}
|
|
];
|
|
colModelGrid = colModelGrid.concat(colModelGrid2);
|
|
}
|
|
else if (tabIndexSelect === ObservationStatusTradeEnum.AutoCall) {
|
|
let colModelGrid2 = [
|
|
{
|
|
name: 'OptionType', label: '看涨看跌', width: 70, align: 'center', hidden: true, optionHide: true
|
|
},{
|
|
name: 'trade_autocall.KnockInOutStatusCn',
|
|
label: '观察状态', width: 95, sortable: false, align: 'center'
|
|
}, {
|
|
name: 'trade_autocall.KnockInOutDate',
|
|
label: '敲入敲出日期', width: 95, sortable: false, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'TradeNumber', label: '交易编号', width: 150, align: 'center'
|
|
}, {
|
|
name: 'ClientName', label: '交易对手方', width: 300, align: 'center'
|
|
}, {
|
|
name: 'TradeDate', label: '成交日期', width: 90, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'ExerciseDate', label: '到期日期', width: 90, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'BuySell', label: '买卖方向', width: 70, align: 'center'
|
|
}, {
|
|
name: 'UnderlyingCode', label: '标的代码', width: 100, align: 'center'
|
|
}, {
|
|
name: 'trade_autocall.LatestKOObservationDate',
|
|
label: '最近敲出观察日', width: 100, sortable: false, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'trade_autocall.LatestKOBarrier',
|
|
label: '最近敲出障碍价格', width: 100, sortable: false, align: 'right', formatter: autocallLatestKOBarrierFormat
|
|
}, {
|
|
name: 'trade_autocall.LatestObservationDate',
|
|
label: '最近敲入观察日', width: 100, sortable: false, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'trade_autocall.KIBarrier',
|
|
label: '敲入障碍价格', width: 100, sortable: false, align: 'right', formatter: autocallKIBarrierFormat
|
|
}
|
|
];
|
|
colModelGrid = colModelGrid.concat(colModelGrid2);
|
|
}
|
|
else if (tabIndexSelect === ObservationStatusTradeEnum.SnowBall) {
|
|
let colModelGrid2 = [
|
|
{
|
|
name: 'OptionType', label: '看涨看跌', width: 70, align: 'center', hidden: true, optionHide: true
|
|
}, {
|
|
name: 'trade_snowball.KnockInOutStatusCn',
|
|
label: '观察状态', width: 95, sortable: false, align: 'center'
|
|
}, {
|
|
name: 'trade_snowball.KnockInOutDate',
|
|
label: '敲入敲出日期', width: 95, sortable: false, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'TradeNumber', label: '交易编号', width: 150, align: 'center'
|
|
}, {
|
|
name: 'ClientName', label: '交易对手方', width: 300, align: 'center'
|
|
}, {
|
|
name: 'TradeDate', label: '成交日期', width: 90, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'ExerciseDate', label: '到期日期', width: 90, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'BuySell', label: '买卖方向', width: 70, align: 'center'
|
|
}, {
|
|
name: 'UnderlyingCode', label: '标的代码', width: 100, align: 'center'
|
|
}, {
|
|
name: 'trade_snowball.LatestKOObservationDate',
|
|
label: '最近敲出观察日', width: 100, sortable: false, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'trade_snowball.LatestKOBarrier',
|
|
label: '最近敲出障碍价格', width: 100, sortable: false, align: 'right', formatter: snowballLatestKOBarrierFormat
|
|
}, {
|
|
name: 'trade_snowball.LatestObservationDate',
|
|
label: '最近敲入观察日', width: 100, sortable: false, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'trade_snowball.KIBarrier',
|
|
label: '敲入障碍价格', width: 100, sortable: false, align: 'right', formatter: snowballKIBarrierFormat
|
|
}
|
|
];
|
|
colModelGrid = colModelGrid.concat(colModelGrid2);
|
|
}
|
|
else if (tabIndexSelect === ObservationStatusTradeEnum.Accumulator) {
|
|
let colModelGrid2 = [
|
|
{
|
|
name: 'trade_accumulator_option.KnockInOutStatusCn',
|
|
label: '观察状态', width: 95, sortable: false, align: 'center'
|
|
}, {
|
|
name: 'trade_accumulator_option.KnockOutDate',
|
|
label: '敲出日期', width: 95, sortable: false, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'trade_accumulator_option.EarlyTerminate',
|
|
label: '敲出是否终止', width: 100, sortable: false, align: 'right', formatter: EarlyTerminateFormat
|
|
}, {
|
|
name: 'TradeNumber', label: '交易编号', width: 150, align: 'center'
|
|
}, {
|
|
name: 'ClientName', label: '交易对手方', width: 300, align: 'center'
|
|
}, {
|
|
name: 'TradeDate', label: '成交日期', width: 90, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'ExerciseDate', label: '到期日期', width: 90, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'BuySell', label: '买卖方向', width: 70, align: 'center'
|
|
}, {
|
|
name: 'OptionType', label: '看涨看跌', width: 70, align: 'center'
|
|
}, {
|
|
name: 'UnderlyingCode', label: '标的代码', width: 100, align: 'center'
|
|
}, {
|
|
name: 'StrikeToShow',
|
|
label: '执行价格', width: 100, sortable: false, align: 'center', formatter: otcformat.trading.umprice
|
|
}, {
|
|
name: 'trade_accumulator_option.LatestObservationDate',
|
|
label: '最近观察日', width: 100, sortable: false, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'trade_accumulator_option.PayoffType',
|
|
label: '上端收益类型', width: 100, sortable: false, align: 'center'
|
|
}, {
|
|
name: 'trade_accumulator_option.LatestKOBarrier',
|
|
label: '最近障碍价格', width: 100, sortable: false, align: 'right', formatter: accumulatorLatestKOBarrierFormat
|
|
}
|
|
];
|
|
colModelGrid = colModelGrid.concat(colModelGrid2);
|
|
}
|
|
else {
|
|
let colModelGrid2 = [
|
|
{
|
|
name: 'trade_barrier_option.KnockInOutStatusCn', label: '观察状态', width: 95, sortable: false, align: 'center'
|
|
}, {
|
|
name: 'trade_barrier_option.KnockInOutDate', label: '敲入敲出日期', width: 95, sortable: false, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'TradeNumber', label: '交易编号', width: 150, align: 'center'
|
|
}, {
|
|
name: 'ClientName', label: '交易对手方', width: 300, align: 'center'
|
|
}, {
|
|
name: 'TradeDate', label: '成交日期', width: 90, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'ExerciseDate', label: '到期日期', width: 90, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'BuySell', label: '买卖方向', width: 70, align: 'center'
|
|
}, {
|
|
name: 'UnderlyingCode', label: '标的代码', width: 100, align: 'center'
|
|
}, {
|
|
name: 'trade_barrier_option.LatestObservationDate',
|
|
label: '最近观察日', width: 100, sortable: false, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'trade_barrier_option.BarrierType', label: '障碍类型', width: 70, sortable: false, align: 'center'
|
|
}, {
|
|
name: 'trade_barrier_option.BarrierPrice',
|
|
label: '障碍价格', width: 90, sortable: false, align: 'right', formatter: barrierPriceFormat
|
|
}, {
|
|
name: 'trade_barrier_option.UpperBarrierPrice',
|
|
label: '高障碍价格', width: 90, sortable: false, align: 'right', formatter: upperBarrierPriceFormat
|
|
}
|
|
];
|
|
colModelGrid = colModelGrid.concat(colModelGrid2);
|
|
}
|
|
|
|
colModelGrid.push({
|
|
name: 'UnderlyingPrice', label: '标的最新价格', width: 90, align: 'right',
|
|
formatter: function (cellValue, options, rowObject) {
|
|
return main.formatNumber(cellValue);
|
|
},
|
|
sortable: false
|
|
});
|
|
|
|
return colModelGrid;
|
|
}
|
|
|
|
$(function () {
|
|
var PostData = {};
|
|
PostData.TabIndex = tabIndexSelect;
|
|
$(".datepicker").datepicker({
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
showButtonPanel: true,
|
|
showOtherMonths: true,
|
|
selectOtherMonths: true
|
|
});
|
|
colModelGrid = GetGridColModes();
|
|
grid = jQuery('#listGrid').jqGrid({
|
|
url: "/trade/tradeObservationStatusQuery",
|
|
datatype: 'json',
|
|
multiselect: true,
|
|
height: 'auto',
|
|
width: '96%',
|
|
autowidth: false,
|
|
shrinkToFit: false,
|
|
viewrecords: true,
|
|
jsonReader: { repeatitems: false },
|
|
caption: '',
|
|
mtype: 'POST',
|
|
postData: PostData,
|
|
colModel: colModelGrid,
|
|
pager: jQuery('#pagerGrid'),
|
|
pagerpos: 'left',
|
|
ondblClickRow: rowdblclick,
|
|
rowNum: 20,
|
|
rowList: [20, 30, 50, 200, 10000],
|
|
footerrow: false,
|
|
loadComplete: gridComplete,
|
|
grouping: true
|
|
});
|
|
|
|
function keyEnter(event) {
|
|
try {
|
|
var e = event || window.event || {};
|
|
if (e.keyCode === 13) {
|
|
SearchClick(true);
|
|
}
|
|
} catch (e) {
|
|
//
|
|
}
|
|
}
|
|
|
|
document.onkeydown = keyEnter;
|
|
let underlyingCtrl = new tradeHelper.UnderlyingSelectCtrl('#UnderlyingId').setFlag(tradeHelper.UnderlyingSelectFlag.OtcTrade);
|
|
tabSelect(tabIndexSelect);
|
|
});
|
|
|
|
function rowdblclick(rowid) {
|
|
var rowData = $(this).getRowData(rowid);
|
|
starttradeView(rowData.EncryptId, rowData.TradeType);
|
|
}
|
|
|
|
function barrierPriceFormat(cellValue, options, rowObject) {
|
|
return rowObject.IsMoneynessOptionData ? main.formatNumber(rowObject.InitialSpotPrice * rowObject.trade_barrier_option.BarrierPrice) : main.formatNumber(rowObject.trade_barrier_option.BarrierPrice);
|
|
}
|
|
|
|
function upperBarrierPriceFormat(cellValue, options, rowObject) {
|
|
return rowObject.IsMoneynessOptionData ? main.formatNumber(rowObject.InitialSpotPrice * rowObject.trade_barrier_option.UpperBarrierPrice) : main.formatNumber(rowObject.trade_barrier_option.UpperBarrierPrice);
|
|
}
|
|
|
|
function barrierHighFormat(cellValue, options, rowObject) {
|
|
return rowObject.IsMoneynessOptionData ? main.formatNumber(rowObject.InitialSpotPrice * rowObject.trade_double_sharkfin_option.BarrierHigh) : main.formatNumber(rowObject.trade_double_sharkfin_option.BarrierHigh);
|
|
}
|
|
|
|
function barrierLowFormat(cellValue, options, rowObject) {
|
|
return rowObject.IsMoneynessOptionData ? main.formatNumber(rowObject.InitialSpotPrice * rowObject.trade_double_sharkfin_option.BarrierLow) : main.formatNumber(rowObject.trade_double_sharkfin_option.BarrierLow);
|
|
}
|
|
|
|
function autocallLatestKOBarrierFormat(cellValue, options, rowObject) {
|
|
return rowObject.IsMoneynessOptionData ? main.formatNumber(rowObject.InitialSpotPrice * rowObject.trade_autocall.LatestKOBarrier) : main.formatNumber(rowObject.trade_autocall.LatestKOBarrier);
|
|
}
|
|
|
|
function autocallKIBarrierFormat(cellValue, options, rowObject) {
|
|
return rowObject.IsMoneynessOptionData ? main.formatNumber(rowObject.InitialSpotPrice * rowObject.trade_autocall.KIBarrier) : main.formatNumber(rowObject.trade_autocall.KIBarrier);
|
|
}
|
|
|
|
function snowballLatestKOBarrierFormat(cellValue, options, rowObject) {
|
|
return rowObject.IsMoneynessOptionData ? main.formatNumber(rowObject.InitialSpotPrice * rowObject.trade_snowball.LatestKOBarrier) : main.formatNumber(rowObject.trade_snowball.LatestKOBarrier);
|
|
}
|
|
|
|
function snowballKIBarrierFormat(cellValue, options, rowObject) {
|
|
console.log(rowObject.trade_snowball.IsInitialKnockedIn);
|
|
if (rowObject.trade_snowball.IsInitialKnockedIn == true) {
|
|
debugger;
|
|
|
|
return "";
|
|
}
|
|
return rowObject.IsMoneynessOptionData ? main.formatNumber(rowObject.InitialSpotPrice * rowObject.trade_snowball.KIBarrier) : main.formatNumber(rowObject.trade_snowball.KIBarrier);
|
|
}
|
|
|
|
function accumulatorLatestKOBarrierFormat(cellValue, options, rowObject) {
|
|
return rowObject.IsMoneynessOptionData ? main.formatNumber(rowObject.InitialSpotPrice * rowObject.trade_accumulator_option.LatestKOBarrier) : main.formatNumber(rowObject.trade_accumulator_option.LatestKOBarrier);
|
|
}
|
|
|
|
|
|
function EarlyTerminateFormat(cellValue, options, rowObject) {
|
|
return cellValue == true ? "是" : "否";
|
|
}
|
|
function gridComplete() {
|
|
var jgrid = $(this);
|
|
|
|
var rowIds = jgrid.jqGrid('getDataIDs');
|
|
for (var i = 0; i < rowIds.length; i++) {
|
|
var rowId = rowIds[i];
|
|
var rowdata = jgrid.getRowData(rowId);
|
|
if (rowdata.TradeStatus === "已平仓" || rowdata.TradeStatus === "已执行" || rowdata.TradeStatus === "已到期") {
|
|
$('#' + rowIds[i]).addClass("UnwindBg");
|
|
}
|
|
else if (rowdata.TradeType === "障碍期权") {
|
|
if (rowdata['trade_barrier_option.KnockInOutStatusCn'] === "已敲入") {
|
|
$('#' + rowIds[i]).addClass("KnockInBg");
|
|
}
|
|
|
|
if (rowdata.TradeStatus !== "已平仓"
|
|
&& rowdata['trade_barrier_option.KnockInOutStatusCn'] !== "已敲入"
|
|
&& rowdata['trade_barrier_option.KnockInOutStatusCn'] !== "已敲出"
|
|
&& (rowdata['trade_barrier_option.BarrierType'] === "上升敲入" && rowdata.UnderlyingPrice >= rowdata['trade_barrier_option.BarrierPrice']
|
|
|| rowdata['trade_barrier_option.BarrierType'] === "下降敲入" && rowdata.UnderlyingPrice <= rowdata['trade_barrier_option.BarrierPrice']
|
|
|| rowdata['trade_barrier_option.BarrierType'] === "双障碍敲入" && (rowdata.UnderlyingPrice <= rowdata['trade_barrier_option.BarrierPrice'] || rowdata.UnderlyingPrice >= rowdata['trade_barrier_option.UpperBarrierPrice']))
|
|
) {
|
|
$('#' + rowIds[i]).addClass("WillKnockInBg");
|
|
}
|
|
else if (rowdata.TradeStatus != "已平仓"
|
|
&& rowdata['trade_barrier_option.KnockInOutStatusCn'] !== "已敲入"
|
|
&& rowdata['trade_barrier_option.KnockInOutStatusCn'] !== "已敲出"
|
|
&& (rowdata['trade_barrier_option.BarrierType'] === "上升敲出" && rowdata.UnderlyingPrice * 1 >= rowdata['trade_barrier_option.BarrierPrice']
|
|
|| rowdata['trade_barrier_option.BarrierType'] === "下降敲出" && rowdata.UnderlyingPrice * 1 <= rowdata['trade_barrier_option.BarrierPrice']
|
|
|| rowdata['trade_barrier_option.BarrierType'] === "双障碍敲出" && (rowdata.UnderlyingPrice * 1 <= rowdata['trade_barrier_option.BarrierPrice'] || rowdata.UnderlyingPrice * 1 >= rowdata['trade_barrier_option.UpperBarrierPrice']))
|
|
) {
|
|
$('#' + rowIds[i]).addClass("WillKnockOutBg");
|
|
}
|
|
}
|
|
else if (rowdata.TradeType === "双鲨期权") {
|
|
if (rowdata.TradeStatus !== "已平仓"
|
|
&& rowdata['trade_double_sharkfin_option.KnockInOutStatusCn'] !== "已敲入"
|
|
&& rowdata['trade_double_sharkfin_option.KnockInOutStatusCn'] !== "已敲出"
|
|
&& (rowdata.UnderlyingPrice * 1 <= rowdata['trade_double_sharkfin_option.BarrierLow'] || rowdata.UnderlyingPrice * 1 >= rowdata['trade_double_sharkfin_option.BarrierHigh'])
|
|
) {
|
|
$('#' + rowIds[i]).addClass("WillKnockOutBg");
|
|
}
|
|
}
|
|
else if (rowdata.TradeType === "凤凰期权") {
|
|
if (rowdata['trade_autocall.KnockInOutStatusCn'] === "已敲入") {
|
|
$('#' + rowIds[i]).addClass("KnockInBg");
|
|
}
|
|
|
|
let isCall = rowdata["OptionType"] === '看涨';
|
|
if (rowdata.TradeStatus !== "已平仓"
|
|
&& rowdata['trade_autocall.KnockInOutStatusCn'] !== "已敲入"
|
|
&& rowdata['trade_autocall.KnockInOutStatusCn'] !== "已敲出"
|
|
&& (isCall ? rowdata.UnderlyingPrice * 1 <= rowdata['trade_autocall.KIBarrier']
|
|
: rowdata.UnderlyingPrice * 1 >= rowdata['trade_autocall.KIBarrier'])) {
|
|
$('#' + rowIds[i]).addClass("WillKnockInBg");
|
|
}
|
|
else if (rowdata.TradeStatus !== "已平仓"
|
|
&& rowdata['trade_autocall.KnockInOutStatusCn'] !== "已敲出"
|
|
&& (isCall ? rowdata.UnderlyingPrice * 1 >= rowdata['trade_autocall.LatestKOBarrier']
|
|
: rowdata.UnderlyingPrice * 1 <= rowdata['trade_autocall.LatestKOBarrier'])) {
|
|
$('#' + rowIds[i]).addClass("WillKnockOutBg");
|
|
}
|
|
}
|
|
else if (rowdata.TradeType === "雪球期权") {
|
|
if (rowdata['trade_snowball.KnockInOutStatusCn'] === "已敲入") {
|
|
$('#' + rowIds[i]).addClass("KnockInBg");
|
|
}
|
|
let isCall = rowdata["OptionType"] === '看涨';
|
|
if (rowdata.TradeStatus !== "已平仓"
|
|
&& rowdata['trade_snowball.KnockInOutStatusCn'] !== "已敲入"
|
|
&& rowdata['trade_snowball.KnockInOutStatusCn'] !== "已敲出"
|
|
&& (isCall ? rowdata.UnderlyingPrice * 1 <= rowdata['trade_snowball.KIBarrier']
|
|
: rowdata.UnderlyingPrice * 1 >= rowdata['trade_snowball.KIBarrier'])) {
|
|
$('#' + rowIds[i]).addClass("WillKnockInBg");
|
|
}
|
|
else if (rowdata.TradeStatus !== "已平仓"
|
|
&& rowdata['trade_snowball.KnockInOutStatusCn'] !== "已敲出"
|
|
&& (isCall ? rowdata.UnderlyingPrice * 1 >= rowdata['trade_snowball.LatestKOBarrier']
|
|
: rowdata.UnderlyingPrice * 1 <= rowdata['trade_snowball.LatestKOBarrier'])) {
|
|
$('#' + rowIds[i]).addClass("WillKnockOutBg");
|
|
}
|
|
} else if (rowdata.TradeType === "累计期权") {
|
|
//trade_accumulator_option.EarlyTerminate 敲出是否终止
|
|
//rowdata.TradeStatus 交易状态
|
|
|
|
if (rowdata.TradeStatus != "已平仓" && rowdata['trade_accumulator_option.KnockInOutStatusCn'] !== "敲出"
|
|
&& (rowdata.UnderlyingPrice * 1 >= parseFloat(rowdata['trade_accumulator_option.LatestKOBarrier']) && rowdata.OptionType == "看涨"
|
|
|| rowdata.UnderlyingPrice * 1 <= parseFloat(rowdata['trade_accumulator_option.LatestKOBarrier']) && rowdata.OptionType == "看跌")) {
|
|
if (rowdata["trade_accumulator_option.EarlyTerminate"] === '是') {
|
|
$('#' + rowIds[i]).addClass("WillKnockOutBg");
|
|
} else {
|
|
$('#' + rowIds[i]).addClass("KnockInBg");
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
var newHeight = $(window).height() - 250;
|
|
$(".ui-jqgrid .ui-jqgrid-bdiv").css("cssText", "height: " + newHeight + "px!important;");
|
|
$('.ui-jqgrid-bdiv', '#gbox_listGrid').floatingScroll();
|
|
|
|
$(".selftooltip").tooltip({ html: true, show: 50000, trigger: "hover" });
|
|
|
|
var columnKey = "";
|
|
if (tabIndexSelect === ObservationStatusTradeEnum.Barrier) {
|
|
columnKey = configcolumn_data.Barrier;
|
|
}
|
|
else if (tabIndexSelect === ObservationStatusTradeEnum.DoubleShark) {
|
|
columnKey = configcolumn_data.DoubleShark;
|
|
}
|
|
else if (tabIndexSelect === ObservationStatusTradeEnum.AutoCall) {
|
|
columnKey = configcolumn_data.AutoCall;
|
|
}
|
|
else if (tabIndexSelect === ObservationStatusTradeEnum.SnowBall) {
|
|
columnKey = configcolumn_data.SnowBall;
|
|
}
|
|
else if (tabIndexSelect === ObservationStatusTradeEnum.Accumulator) {
|
|
columnKey = configcolumn_data.Accumulator;
|
|
}
|
|
|
|
main.setcolumnChooser(jgrid, columnKey);
|
|
}
|
|
|
|
function rowclick(id) {
|
|
|
|
}
|
|
|
|
function starttradeView(id, tradeType) {
|
|
main.open("查看交易", "/trade/tradeView/?enid={0}".template(id));
|
|
}
|
|
|
|
function reloadtrade() {
|
|
//重新加载
|
|
SearchClick();
|
|
$('#modal-edittrade').modal('hide');
|
|
}
|
|
|
|
function setGridPostData() {
|
|
var listGrid = $('#listGrid');
|
|
|
|
listGrid.appendPostData({ TradeNumber: $("#TradeNumber").val() });
|
|
listGrid.appendPostData({ ClientIds: $("#ClientId").val() });
|
|
listGrid.appendPostData({ UnderlyingIds: $("#UnderlyingId").val() });
|
|
listGrid.appendPostData({ TradeDateStart: $("#DateFromTradeDate").val() });
|
|
listGrid.appendPostData({ TradeDateEnd: $("#DateToTradeDate").val() });
|
|
listGrid.appendPostData({ TradeStatus: $("#TradeStatus").val() });
|
|
listGrid.appendPostData({ ExerciseDateStart: $("#DateFromExerciseDate").val() });
|
|
listGrid.appendPostData({ ExerciseDateEnd: $("#DateToExerciseDate").val() });
|
|
listGrid.appendPostData({ TabIndex: tabIndexSelect });
|
|
}
|
|
|
|
function SearchClick(isSearchclick) {
|
|
|
|
setGridPostData();
|
|
if (isSearchclick) {
|
|
//点击搜索时默认第一页
|
|
$('#listGrid').jqGrid('setGridParam', { page: 1 });
|
|
}
|
|
main.isSearching = true;
|
|
$('#listGrid').trigger('reloadGrid');
|
|
$("#load_listGrid").hide();
|
|
}
|
|
|
|
function showcolumnChooser() {
|
|
var jgrid = jQuery('#listGrid');
|
|
var columnKey = "";
|
|
if (tabIndexSelect === ObservationStatusTradeEnum.Barrier) {
|
|
columnKey = configcolumn_data.Barrier;
|
|
}
|
|
else if (tabIndexSelect === ObservationStatusTradeEnum.DoubleShark) {
|
|
columnKey = configcolumn_data.DoubleShark;
|
|
}
|
|
else if (tabIndexSelect === ObservationStatusTradeEnum.AutoCall) {
|
|
columnKey = configcolumn_data.AutoCall;
|
|
}
|
|
else if (tabIndexSelect === ObservationStatusTradeEnum.SnowBall) {
|
|
columnKey = configcolumn_data.SnowBall;
|
|
}
|
|
else if (tabIndexSelect === ObservationStatusTradeEnum.Accumulator) {
|
|
columnKey = configcolumn_data.Accumulator;
|
|
}
|
|
main.showcolumnChooser(jgrid, columnKey);
|
|
}
|
|
|
|
function tabSelect(tabIndex) {
|
|
$("#myTab").children().removeClass("active");
|
|
$("#tab" + tabIndex).addClass("active");
|
|
tabIndexSelect = tabIndex;
|
|
|
|
SearchClick(true);
|
|
} |