818 lines
25 KiB
JavaScript
818 lines
25 KiB
JavaScript
var g_grid = {};
|
|
|
|
function getGrid(summaryType) {
|
|
var postData = GetPostData();
|
|
var obj = {
|
|
url: '/trade/ExchangeConfirmQuery',
|
|
datatype: 'json',
|
|
multiselect: false,
|
|
height: 'auto',
|
|
width: '96%',
|
|
autowidth: false,
|
|
shrinkToFit: false,
|
|
viewrecords: true,
|
|
jsonReader: { repeatitems: false },
|
|
caption: '',
|
|
mtype: 'POST',
|
|
postData: postData,
|
|
afterInsertRow: AfterInsertRow,
|
|
onSelectRow: rowclick,
|
|
ondblClickRow: rowdblclick,
|
|
pager: jQuery('#pagerGrid'),
|
|
pagerpos: 'left',
|
|
rowNum: 20,
|
|
rowList: [20, 30, 50, 200, 10000],
|
|
footerrow: false,
|
|
loadComplete: gridComplete,
|
|
onPaging: onJqgridPaging
|
|
};
|
|
switch (summaryType) {
|
|
case "场外期权":
|
|
obj.colModel = colModelGrid_Option;
|
|
break;
|
|
case "收益互换":
|
|
obj.colModel = colModelGrid_Swap;
|
|
break;
|
|
default:
|
|
}
|
|
|
|
if (page.IsAutoSealAndUploadFiles) {
|
|
|
|
var colObj1 = {
|
|
name: 'SealResult',
|
|
label: '电子章用印结果',
|
|
index: 'SealResult',
|
|
width: 150,
|
|
align: 'center',
|
|
formatter: function (cellValue, options, rowObject) {
|
|
if (rowObject.MetaDic.SealResult == "失败") {
|
|
var html = ("<span style='color:red;'>失败</span><a href='javascript:;' style='color:blue;' title='查看失败详情' onclick=\"ViewErrInfo('{0}')\" ><详情></a>")
|
|
.template(rowObject.ContractCode);
|
|
return html;
|
|
}
|
|
else {
|
|
return rowObject.MetaDic.SealResult;
|
|
}
|
|
}
|
|
};
|
|
|
|
var colObj2 = {
|
|
name: 'SealTime',
|
|
label: '电子章用印时间',
|
|
index: 'SealTime',
|
|
width: 150,
|
|
align: 'left',
|
|
formatter: function (cellValue, options, rowObject) {
|
|
return rowObject.MetaDic.SealTime;
|
|
}
|
|
};
|
|
obj.colModel.push(colObj1, colObj2);
|
|
}
|
|
g_grid = jQuery('#listGrid').jqGrid(obj);
|
|
|
|
return g_grid;
|
|
}
|
|
|
|
function ViewErrInfo(code) {
|
|
main.post("/trade/GetSealErrMsg/", code,
|
|
{
|
|
success: function (resp) {
|
|
main.alert(resp.msg);
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function setSummaryType(summaryType) {
|
|
$("#myTab li").removeClass("active");
|
|
$("#myTab :contains('" + summaryType + "')").parent().addClass("active");
|
|
$("[tag]").hide();
|
|
$("[tag*='" + summaryType + "']").show();
|
|
|
|
if (typeof g_grid.GridUnload === 'function') { g_grid.GridUnload(); }
|
|
g_grid = getGrid(summaryType);
|
|
}
|
|
|
|
$(function () {
|
|
|
|
$('#TradeStatus').css('width', '250px');
|
|
$("#DateFromTradeDate").datepicker({
|
|
changeMonth: true, changeYear: true, showButtonPanel: true, showOtherMonths: true, selectOtherMonths: true,
|
|
onSelect: function (selectedDate) {//选择日期后执行的操作
|
|
setValidation("DateToTradeDate", selectedDate, false);
|
|
}
|
|
});
|
|
$("#DateToTradeDate").datepicker({
|
|
changeMonth: true, changeYear: true, showButtonPanel: true, showOtherMonths: true, selectOtherMonths: true,
|
|
onSelect: function (selectedDate) {//选择日期后执行的操作
|
|
setValidation("DateFromTradeDate", selectedDate, true);
|
|
}
|
|
});
|
|
$("#DateFromTradeDate").val(page.valuedate);
|
|
$("#DateToTradeDate").val(page.valuedate);
|
|
|
|
setValidation("DateFromTradeDate", $("#DateToTradeDate").val(), true);
|
|
setValidation("DateToTradeDate", $("#DateFromTradeDate").val(), false);
|
|
setValidation("TradeTip", "卖出开仓", false);
|
|
|
|
if (page.IsAutoSealAndUploadFiles) {
|
|
$("#DateFromSealDate").datepicker({
|
|
changeMonth: true, changeYear: true, showButtonPanel: true, showOtherMonths: true, selectOtherMonths: true,
|
|
onSelect: function (selectedDate) {//选择日期后执行的操作
|
|
setValidation("DateToSealDate", selectedDate, false);
|
|
}
|
|
});
|
|
$("#DateToSealDate").datepicker({
|
|
changeMonth: true, changeYear: true, showButtonPanel: true, showOtherMonths: true, selectOtherMonths: true,
|
|
onSelect: function (selectedDate) {//选择日期后执行的操作
|
|
setValidation("DateFromSealDate", selectedDate, true);
|
|
}
|
|
});
|
|
$("#DateToSealDate").val(page.valuedate);
|
|
$("#DateFromSealDate").val(page.valuedate);
|
|
|
|
setValidation("DateFromSealDate", $("#DateToSealDate").val(), true);
|
|
setValidation("DateToSealDate", $("#DateFromSealDate").val(), false);
|
|
}
|
|
|
|
$(".datepicker").datepicker({
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
showButtonPanel: true,
|
|
showOtherMonths: true,
|
|
selectOtherMonths: true
|
|
});
|
|
|
|
setSummaryType("场外期权");
|
|
$("#myTab li a").on("click", function (e) {
|
|
setSummaryType($(e.target).text());
|
|
});
|
|
document.onkeydown = function (event) {
|
|
try {
|
|
var e = event ? event : (window.event ? window.event : null);
|
|
if (e.keyCode === 13) {
|
|
SearchClick(true);
|
|
}
|
|
} catch (e) {
|
|
//
|
|
}
|
|
};
|
|
});
|
|
|
|
function gridComplete() {
|
|
$(window).off('resize.jqGrid');
|
|
$(window).on('resize.jqGrid', function () {
|
|
$("#listGrid").jqGrid('setGridWidth', $('#riskContent').width() - 2);
|
|
});
|
|
$("#listGrid").jqGrid('setGridWidth', $('#riskContent').width() - 2);
|
|
}
|
|
|
|
function ShowStructFormater(cellValue, options, rowObject) {
|
|
var html;
|
|
if (rowObject.TradeType === "合成价差期权") {
|
|
html =
|
|
"<a href=\"#\" class=\"selftooltip\" style=\"z-index:10000000\" data-toggle=\"tooltip\" title=\"{1}\">{0}</a>"
|
|
.template(cellValue || '', rowObject.SyntheticUnderlyingTipsInfo);
|
|
return html;
|
|
}
|
|
return cellValue || '';
|
|
}
|
|
|
|
function StrikeFormatter(cellValue, options, rowObject) {
|
|
if (rowObject.Strike) {
|
|
if (rowObject.IsMoneynessOption === "是") {
|
|
return otcformat.trading.premiumRateP(rowObject.Strike);
|
|
} else {
|
|
return Number(rowObject.Strike).toFixed(2);
|
|
}
|
|
} else {
|
|
return "";
|
|
}
|
|
}
|
|
|
|
//下载确认书
|
|
function DownLoadDoc(res) {
|
|
window.open(res);
|
|
}
|
|
|
|
//批量下载确认书
|
|
function BatchDownLoadDoc() {
|
|
var startDate = $("#DateFromTradeDate").val();
|
|
var endDate = $("#DateToTradeDate").val();
|
|
var clientIds = $("#ClientId").val();
|
|
|
|
var tip = "下载符合当前筛选条件的确认书";
|
|
|
|
var htmlContent = '<form class="form-horizontal" role="form" style="padding:15px 12px 5px">' +
|
|
'<div class="form-group">' +
|
|
'<label style="padding:10px 12px 10px">' + tip + '</label><br />' +
|
|
'<label class="col-sm-5 control-label">文档类型</label>' +
|
|
'<label class="btn btn-sm btn-primary" style="border:none"><input type="checkbox" checked name="docType" value="PDF"> PDF</label>' +
|
|
'<label class="btn btn-sm btn-primary" style="border:none"><input type="checkbox" checked name="docType" value="DOC"> DOC</label>';
|
|
if (page.IsZheQi) {
|
|
htmlContent += '<br/><label class="col-sm-5 control-label">下载用印文件</label>' +
|
|
'<select id="Seal" style="margin-top:5px;"><option>是</option><option>否</option></select>';
|
|
}
|
|
main.open2("批量下载确认书",
|
|
htmlContent + '</div></form>',
|
|
{
|
|
area: ["400px", "250px"],
|
|
btn: ['下载', '取消'],
|
|
yes: function (index, layero) {
|
|
var docpdf = [];
|
|
$('input[name="docType"]:checked').each(function (i) {
|
|
docpdf.push($(this).val())
|
|
});
|
|
|
|
var isSeal = $("#Seal").val() == '是' ? true : false;
|
|
var postData =
|
|
{
|
|
TradeDateStart: startDate,
|
|
TradeDateEnd: endDate,
|
|
ClientIds: clientIds,
|
|
TradeIds: null,
|
|
TradeCashIds: null,
|
|
TradeNumber: $("#TradeNumber").val(),
|
|
ContractCode: $("#ContractCode").val(),
|
|
TradeTypeList: [$("#myTab .active a").text()],
|
|
DocType: null,
|
|
docpdf: docpdf,
|
|
IsSeal: isSeal
|
|
};
|
|
if (page.IsAutoSealAndUploadFiles) {
|
|
postData.SealResults = $("#SealResults").val();
|
|
//postData.SealDateStart = $("#DateFromSealDate").val();
|
|
//postData.SealDateEnd = $("#DateToSealDate").val();
|
|
}
|
|
openWindowWithPost("/trade/BatchDownLoadDoc/", postData);
|
|
parent.layer.closeAll();
|
|
},
|
|
cancel: function (index, layero) {
|
|
parent.layer.closeAll();
|
|
},
|
|
success: function (layero, index) {
|
|
$(".btn-group").on("click", ".btn", function (event) {
|
|
$('input[name="docType"]:checked').prop("checked", false);
|
|
$(this).children("input").prop("checked", true);
|
|
});
|
|
}
|
|
});
|
|
}
|
|
function openWindowWithPost(url, data) {
|
|
var form = document.createElement("form");
|
|
form.target = "_blank";
|
|
form.method = "POST";
|
|
form.action = url;
|
|
form.style.display = "none";
|
|
|
|
for (var key in data) {
|
|
if (data[key] instanceof Array) {
|
|
if (data[key].length === 0) {
|
|
var input = document.createElement("input");
|
|
input.type = "hidden";
|
|
input.name = key;
|
|
input.value = null;
|
|
form.appendChild(input);
|
|
}
|
|
else {
|
|
data[key].forEach((item, index, array) => {
|
|
var input = document.createElement("input");
|
|
input.type = "hidden";
|
|
input.name = key;
|
|
input.value = data[key][index];
|
|
form.appendChild(input);
|
|
});
|
|
}
|
|
}
|
|
else {
|
|
var input1 = document.createElement("input");
|
|
input1.type = "hidden";
|
|
input1.name = key;
|
|
input1.value = data[key];
|
|
form.appendChild(input1);
|
|
}
|
|
}
|
|
|
|
document.body.appendChild(form);
|
|
form.submit();
|
|
document.body.removeChild(form);
|
|
}
|
|
|
|
function rowdblclick(rowid) {
|
|
var rowData = $(this).getRowData(rowid);
|
|
starttradeView(rowData.EncryptId);
|
|
}
|
|
|
|
function showDownload(cellvalue, options, rowObject) {
|
|
var html = "";
|
|
if (rowObject.MetaDic.ContractDocUrl) {
|
|
html += "<input type=\"button\" class=\"wentiEdit\" title='下载确认书' onclick=\"DownLoadDoc('{0}')\" value=\"{1}\" />"
|
|
.template(rowObject.MetaDic.ContractDocUrl, "下载");
|
|
} else {
|
|
html += "<input type=\"button\" class=\"wentiEdit\" title='确认书未生成或未找到指定的确认书文件' disabled='disabled' value=\"{1}\" />"
|
|
.template(rowObject.MetaDic.ContractDocUrl, "下载");
|
|
}
|
|
return html;
|
|
}
|
|
|
|
function showToolName(cellValue, options, rowObject) {
|
|
var html = showDownload(cellValue, options, rowObject);
|
|
|
|
|
|
|
|
return html;
|
|
}
|
|
|
|
function starttradeView(id) {
|
|
var srcurl = "/trade/tradeView/?enid=" + id + "&isOnlyCloseButton=true";
|
|
main.open("查看交易", srcurl, { area: ['1280px', '800px'] },
|
|
);
|
|
}
|
|
|
|
function reloadtrade() {
|
|
//重新加载
|
|
SearchClick();
|
|
$('#modal-edittrade').modal('hide');
|
|
}
|
|
|
|
function SearchClick(isSearchclick) {
|
|
var listGrid = $('#listGrid');
|
|
listGrid.appendPostData(GetPostData());
|
|
if (isSearchclick) {
|
|
//点击搜索时默认第一页
|
|
listGrid.jqGrid('setGridParam', { page: 1 });
|
|
}
|
|
listGrid.trigger('reloadGrid');
|
|
}
|
|
|
|
function GetPostData() {
|
|
var postData = {};
|
|
|
|
postData.TradeNumber = $("#TradeNumber").val();
|
|
postData.ContractCode = $("#ContractCode").val();
|
|
postData.ClientIds = ($("#ClientId").val() || []);
|
|
postData.TradeDateStart = $("#DateFromTradeDate").val();
|
|
postData.TradeDateEnd = $("#DateToTradeDate").val();
|
|
postData.TabIndex = $("#myTab li.active a").attr("tabIndex");
|
|
|
|
if (page.IsAutoSealAndUploadFiles) {
|
|
postData.SealResults = $("#SealResults").val();
|
|
postData.SealDateStart = $("#DateFromSealDate").val();
|
|
postData.SealDateEnd = $("#DateToSealDate").val();
|
|
}
|
|
|
|
return postData;
|
|
}
|
|
|
|
function gJGenerateConfirmBook(id, hasGeneratedConfirmBook) {
|
|
|
|
if (main.isEmpty($("#DateFromTradeDate").val())) {
|
|
main.message("请选择起始日期!");
|
|
return;
|
|
}
|
|
|
|
if (main.isEmpty($("#DateToTradeDate").val())) {
|
|
main.message("请选择结束日期!");
|
|
return;
|
|
}
|
|
|
|
if (hasGeneratedConfirmBook == "True") {
|
|
if (!page.IsAutoSealAndUploadFiles) {
|
|
//if (main.isEmpty($("#DateFromSealDate").val())) {
|
|
// main.message("请选择电子章用印起始日期!");
|
|
// return;
|
|
//}
|
|
|
|
//if (main.isEmpty($("#DateToSealDate").val())) {
|
|
// main.message("请选择电子章用印结束日期!");
|
|
// return;
|
|
//}
|
|
if (!confirm("确认覆盖已有的确认书?")) {
|
|
return;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var jgrid = jQuery('#listGrid');
|
|
tradeIds = main.GetGridIds(jgrid);
|
|
|
|
if (page.IsAutoSealAndUploadFiles) {
|
|
//tradeIds.forEach((v, i, arr) => {
|
|
// var tradeId = v;
|
|
// main.post("/trade/IsSealWaiting/", { tradeId: tradeId },
|
|
// {
|
|
// success: function (resp) {
|
|
// if (resp.success) {
|
|
// if (!confirm("用印正在等待中重新生成将中断用印并重新进行自动用印(如有),是否确认操作?")) {
|
|
// return;
|
|
// }
|
|
// }
|
|
|
|
// }
|
|
// });
|
|
//});
|
|
if (!confirm("重新生成将覆盖已有的交易确认书并重新进行自动用印(如有),是否确认操作?")) {
|
|
return;
|
|
}
|
|
}
|
|
|
|
var htmlContent = '<form class="form-horizontal" role="form" style="padding:15px 12px 5px">' +
|
|
'<div class="form-group">' +
|
|
'<label class="col-sm-4 control-label">文档类型</label>' +
|
|
'<div class="btn-group col-sm-8" data-toggle="buttons">' +
|
|
'<label class="btn btn-sm btn-primary active" style="border:none"><input type="radio" checked name="docType" value="PDF"> PDF</label>' +
|
|
'<label class="btn btn-sm btn-primary" style="border:none"><input type="radio" name="docType" value="DOC"> DOC</label>' +
|
|
'</div>' +
|
|
'</div>' +
|
|
'</form>';
|
|
|
|
main.open2("生成确认书",
|
|
htmlContent,
|
|
{
|
|
area: ["300px", "200px"],
|
|
btn: ['生成', '取消'],
|
|
yes: function (index, layero) {
|
|
var docType = $('input[name="docType"]:checked').val();
|
|
var clientIds = $("#ClientId").val();
|
|
var postData = { clientIds, docType: docType, startDate: $("#DateFromTradeDate").val(), endDate: $("#DateToTradeDate").val(), tradeType: $("#myTab li.active a").attr("tabIndex") };
|
|
//if (page.IsAutoSealAndUploadFiles) {
|
|
// //postData.SealDateStart = $("#DateFromSealDate").val();
|
|
// //postData.SealDateEnd = $("#DateToSealDate").val();
|
|
// postData.sealResults = $("#SealResults").val();
|
|
//}
|
|
|
|
|
|
main.post("/TradeConfirmBook/GetSingleGenerateConfirmBook/", postData,
|
|
{
|
|
success: function (resp) {
|
|
if (resp.success) {
|
|
main.downloadFiles(resp.obj);
|
|
} else {
|
|
main.alert(resp.msg.replace("\r\n", "<br/>"));
|
|
if (resp.obj) {
|
|
main.downloadFiles(resp.obj);
|
|
}
|
|
}
|
|
window.reloadtrade();
|
|
window.layer.closeAll();
|
|
}
|
|
});
|
|
},
|
|
cancel: function (index, layero) {
|
|
parent.layer.closeAll();
|
|
},
|
|
success: function (layero, index) {
|
|
$(".btn-group").on("click", ".btn", function (event) {
|
|
$('input[name="docType"]:checked').prop("checked", false);
|
|
$(this).children("input").prop("checked", true);
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
function setValidation(elId, selectedDate, isSetMax) {
|
|
if (isSetMax) {
|
|
var time = selectedDate.split("-");
|
|
var year = time[0];
|
|
var month = time[1] - 1;
|
|
var day = time[2];
|
|
$("#" + elId).datepicker(
|
|
'option', 'maxDate', new Date(year, month, day)
|
|
);
|
|
} else {
|
|
let time = selectedDate.split("-");
|
|
let year = time[0];
|
|
let month = time[1] - 1;
|
|
let day = time[2];
|
|
$("#" + elId).datepicker(
|
|
'option', 'minDate', new Date(year, month, day)
|
|
);
|
|
}
|
|
}
|
|
|
|
function BatchSealContracts(){
|
|
var jgrid = jQuery('#listGrid');
|
|
var ids = main.GetGridIds(jgrid);
|
|
if (ids.length == 0) {
|
|
main.alert("请至少选择一笔交易"); return;
|
|
}
|
|
|
|
main.post("/trade/IsContractGenerated/", { ids: ids,types:["结算确认书","提前终止确认书"] }).done(function (res) {
|
|
if (res.success) {
|
|
main.post("/trade/SealContracts/", { ids: ids,types:["结算确认书","提前终止确认书"] }).done(function (resp) {
|
|
if (resp.success) {
|
|
|
|
SearchClick(true);
|
|
}
|
|
});
|
|
}
|
|
}).fail(function(res){
|
|
|
|
});
|
|
}
|
|
|
|
const colModelGrid_Swap = [
|
|
{
|
|
name: 'id',
|
|
hidden: true,
|
|
optionHide: true
|
|
}, {
|
|
name: '',
|
|
label: '操作',
|
|
width: 80,
|
|
align: 'center',
|
|
formatter: showToolName,
|
|
optionHide: true
|
|
}, {
|
|
name: 'EncryptId',
|
|
hidden: true,
|
|
optionHide: true
|
|
}, {
|
|
name: 'UnderlyingId',
|
|
hidden: true,
|
|
optionHide: true
|
|
}, {
|
|
name: 'TradeTip',
|
|
label: '交易指令',
|
|
index: 'TradeTip',
|
|
width: 70,
|
|
align: 'left',
|
|
formatter: function (cellvalue, options, rowObject) {
|
|
return rowObject.MetaDic["TradeTip"] ?? "";
|
|
}
|
|
}, {
|
|
name: 'TradeSinglePrice',
|
|
hidden: true,
|
|
optionHide: true
|
|
}, {
|
|
name: 'MetaDic',
|
|
hidden: true,
|
|
optionHide: true
|
|
}, {
|
|
name: 'TradeStatus',
|
|
label: '交易状态',
|
|
index: 'TradeStatus',
|
|
width: 70,
|
|
align: 'left'
|
|
}, {
|
|
name: 'TradeNumber',
|
|
label: '交易编号',
|
|
index: 'TradeNumber',
|
|
width: 150,
|
|
align: 'left'
|
|
}, {
|
|
name: 'ContractCode',
|
|
label: '确认书编号',
|
|
index: 'ContractCode',
|
|
width: 120,
|
|
align: 'left',
|
|
sortable: false,
|
|
formatter: ShowStructFormater
|
|
}, {
|
|
name: 'ClientName',
|
|
label: '客户名称',
|
|
index: 'ClientName',
|
|
width: 70,
|
|
align: 'left'
|
|
}, {
|
|
name: 'TradeDate',
|
|
label: '交易日期',
|
|
index: 'TradeDate',
|
|
width: 90,
|
|
align: 'left',
|
|
formatter: 'date'
|
|
}, {
|
|
name: 'AssetBookName',
|
|
label: '簿记账户',
|
|
index: 'AssetBookName',
|
|
width: 70,
|
|
align: 'left'
|
|
}, {
|
|
name: 'StartDate',
|
|
label: '开始日期',
|
|
index: 'StartDate',
|
|
width: 90,
|
|
align: 'left',
|
|
formatter: 'date'
|
|
}, {
|
|
name: 'MaturityDate',
|
|
label: '标的到期日',
|
|
index: 'MaturityDate',
|
|
width: 90,
|
|
align: 'left',
|
|
formatter: 'date'
|
|
}, {
|
|
name: 'OptName',
|
|
label: '交易操作者',
|
|
index: 'OptName',
|
|
width: 70,
|
|
align: 'left'
|
|
}, {
|
|
name: 'OptDate',
|
|
label: '交易操作时间',
|
|
index: 'OptDate',
|
|
width: 90,
|
|
align: 'left',
|
|
formatter: 'date'
|
|
}, {
|
|
name: 'ConfirmBookOptName',
|
|
label: '操作人',
|
|
index: 'ConfirmBookOptName',
|
|
width: 70,
|
|
align: 'left',
|
|
formatter: function (cellvalue, options, rowObject) {
|
|
return rowObject.MetaDic.ConfirmBookOptName;
|
|
}
|
|
}, {
|
|
name: 'ConfirmBookOptDate',
|
|
label: '操作时间',
|
|
index: 'ConfirmBookOptDate',
|
|
width: 90,
|
|
align: 'left',
|
|
formatter: function (cellvalue, options, rowObject) {
|
|
return rowObject.MetaDic.ConfirmBookOptDate;
|
|
}
|
|
}
|
|
];
|
|
|
|
const colModelGrid_Option = [
|
|
{
|
|
name: 'id',
|
|
hidden: true,
|
|
optionHide: true
|
|
}, {
|
|
name: 'EncryptId',
|
|
hidden: true,
|
|
optionHide: true
|
|
},
|
|
{
|
|
name: '',
|
|
label: '操作',
|
|
width: 80,
|
|
align: 'center',
|
|
formatter: showToolName,
|
|
optionHide: true
|
|
}, {
|
|
name: 'TradeStatus',
|
|
label: '交易状态',
|
|
index: 'TradeStatus',
|
|
width: 70,
|
|
align: 'left'
|
|
},
|
|
{
|
|
name: 'TradeNumber',
|
|
label: '交易编号',
|
|
index: 'TradeNumber',
|
|
width: 150,
|
|
align: 'left'
|
|
},
|
|
{
|
|
name: 'ClientName',
|
|
label: '客户名称',
|
|
index: 'ClientName',
|
|
width: 70,
|
|
align: 'left'
|
|
},
|
|
{
|
|
name: 'OriginalStockEqvNotional',
|
|
label: '名义本金',
|
|
index: 'OriginalStockEqvNotional',
|
|
width: 70,
|
|
align: 'left',
|
|
formatter: otcformat.trading.StockEqvNotional
|
|
},
|
|
{
|
|
name: 'TradeDate',
|
|
label: '交易日期',
|
|
index: 'TradeDate',
|
|
width: 90,
|
|
align: 'left',
|
|
formatter: 'date'
|
|
}, {
|
|
name: 'BuySell',
|
|
label: '交易方向',
|
|
index: 'BuySell',
|
|
width: 70,
|
|
align: 'left'
|
|
},
|
|
{
|
|
name: 'UnderlyingCode',
|
|
label: '标的代码',
|
|
index: 'UnderlyingCode',
|
|
width: 60,
|
|
align: 'left',
|
|
formatter: ShowStructFormater
|
|
}, {
|
|
name: 'TradeType',
|
|
label: '结构类型',
|
|
index: 'TradeType',
|
|
width: 70,
|
|
align: 'left',
|
|
formatter: function (cellvalue, options, rowObject) {
|
|
return rowObject.StructureType && rowObject.IsGroup != 2 ? rowObject.StructureType : rowObject.TradeType;
|
|
}
|
|
},
|
|
{
|
|
name: 'ExerciseDate',
|
|
label: '到期日期',
|
|
index: 'ExerciseDate',
|
|
width: 90,
|
|
align: 'left',
|
|
formatter: 'date'
|
|
},
|
|
{
|
|
name: 'Strike',
|
|
label: '执行价格',
|
|
index: 'Strike',
|
|
width: 90,
|
|
align: 'left',
|
|
formatter: StrikeFormatter
|
|
},
|
|
{
|
|
name: 'OriginalNotional',
|
|
label: '交易数量',
|
|
index: 'OriginalNotional',
|
|
width: 70,
|
|
align: 'left',
|
|
formatter: function (cellvalue, options, rowObject) {
|
|
if (rowObject.trade_cash.Action != "系统操作-期权费") {
|
|
return Number(rowObject.trade_cash.UnwindNotional).toFixed(2);
|
|
}
|
|
return Number(cellvalue).toFixed(2);
|
|
}
|
|
}, {
|
|
name: 'TradePrice',
|
|
label: '成交金额',
|
|
index: 'TradePrice',
|
|
width: 90,
|
|
align: 'left',
|
|
formatter: function (cellvalue, options, rowObject) {
|
|
return Number(cellvalue).toFixed(2);
|
|
}
|
|
},
|
|
{
|
|
name: 'FinalPrice',
|
|
label: '结算/平仓价格',
|
|
index: 'FinalPrice',
|
|
width: 140,
|
|
align: 'left',
|
|
formatter: function (cellvalue, options, rowObject) {
|
|
if (rowObject.trade_cash.Action == "系统操作-期权费") {
|
|
return "";
|
|
}
|
|
else {
|
|
return Number(rowObject.MetaDic["FinalPrice"]).toFixed(2);
|
|
}
|
|
}
|
|
},
|
|
{
|
|
name: 'Amount',
|
|
label: '结算金额',
|
|
index: 'Amount',
|
|
width: 70,
|
|
align: 'left',
|
|
formatter: function (cellvalue, options, rowObject) {
|
|
if (rowObject.trade_cash.Action == "系统操作-期权费") {
|
|
return "";
|
|
}
|
|
else {
|
|
return Number(rowObject.MetaDic["Amount"]).toFixed(2);
|
|
}
|
|
}
|
|
},
|
|
{
|
|
name: 'OptName',
|
|
label: '交易操作者',
|
|
index: 'OptName',
|
|
width: 70,
|
|
align: 'left'
|
|
}, {
|
|
name: 'OptDate',
|
|
label: '交易操作时间',
|
|
index: 'OptDate',
|
|
width: 90,
|
|
align: 'left',
|
|
formatter: 'date'
|
|
}, {
|
|
name: 'ConfirmBookOptName',
|
|
label: '操作人',
|
|
index: 'ConfirmBookOptName',
|
|
width: 70,
|
|
align: 'left',
|
|
formatter: function (cellvalue, options, rowObject) {
|
|
return rowObject.MetaDic.ConfirmBookOptName;
|
|
}
|
|
}, {
|
|
name: 'ConfirmBookOptDate',
|
|
label: '操作时间',
|
|
index: 'ConfirmBookOptDate',
|
|
width: 90,
|
|
align: 'left',
|
|
formatter: function (cellvalue, options, rowObject) {
|
|
return rowObject.MetaDic.ConfirmBookOptDate;
|
|
}
|
|
}
|
|
]; |