197 lines
8.1 KiB
Plaintext
197 lines
8.1 KiB
Plaintext
|
|
@{
|
|
ViewBag.Title = "远期预付金成本";
|
|
Layout = "~/Views/Shared/_MainLayout.cshtml";
|
|
var valueDate = ViewBag.valueDate;
|
|
}
|
|
|
|
@section CSS{
|
|
<style>
|
|
.no-skin {
|
|
position: static !important;
|
|
}
|
|
#ValueDate {
|
|
width: 152px!important;
|
|
font-size: 1rem!important;
|
|
}
|
|
</style>
|
|
}
|
|
@section JS{
|
|
|
|
<script type="text/javascript">
|
|
var g_grid={};
|
|
var sysdate = '@valueDate';
|
|
const page = {IsUseDisplayNotional: "@PS.Config.IsUseDisplayNotional" === "True"}
|
|
$(function () {
|
|
var sysdate = '@valueDate';
|
|
var PostData = { ValueDate: sysdate, PendingMarginCallPayment:$("#PendingMarginCallPayment").val()};
|
|
$("#ValueDate").datepicker({
|
|
changeMonth: true, changeYear: true, showButtonPanel: true, showOtherMonths: true, selectOtherMonths: true,
|
|
onSelect: function (se) {
|
|
|
|
}
|
|
});
|
|
$("#ValueDate").val(sysdate);
|
|
|
|
@Html.Raw(JqGridSimple.OutGrid("/forwardtrade/MarginCostListQuery"));
|
|
g_grid = jQuery('#listGrid');
|
|
function keyEnter(event) {
|
|
try {
|
|
var e = event ? event : (window.event ? window.event : null);
|
|
if (e.keyCode == 13) {
|
|
SearchClick(true);
|
|
}
|
|
} catch (e) {
|
|
|
|
}
|
|
}
|
|
document.onkeydown = keyEnter;
|
|
try {
|
|
SetAceDropDown();
|
|
} catch (e) {
|
|
|
|
}
|
|
function AfterInsertRow(rowid, aData) {
|
|
}
|
|
});
|
|
|
|
var colModelGrid = [{
|
|
name: 'EncryptId', label: 'EncryptId', index: 'EncryptId', width: 1, align: 'left', hidden: true
|
|
},{
|
|
name: 'TradeNumber', label: '交易编号', index: 'TradeNumber', width: 150, align: 'left'
|
|
}, {
|
|
name: 'TradeStatus', label: '交易状态', index: 'TradeStatus', width: 120, align: 'left'
|
|
}, {
|
|
name: 'TradeDate', label: '交易日期', index: 'TradeDate', width: 100, align: 'left', formatter: "date"
|
|
}, {
|
|
name: 'TotalMarginCost', label: '预付金成本累计', index: 'TotalMarginCost', width: 100, align: 'left', formatter: TwoDecimalsFormat
|
|
}, {
|
|
name: 'ExerciseDate', label: '到期日期', index: 'ExerciseDate', width: 180, align: 'left', formatter: "date"
|
|
}, {
|
|
name: 'BuySell', label: '交易方向', index: 'BuySell', width: 100, align: 'center'
|
|
}, {
|
|
name: 'OptionType', label: '多空方向', index: 'OptionType', width: 100, align: 'center', formatter: function (cellValue, options, rowObject) {
|
|
if (cellValue != "") {
|
|
return cellValue == "看涨" ? "多头" : "空头";
|
|
}
|
|
}
|
|
}, {
|
|
name: 'UnderlyingCode', label: '标的代码', index: 'UnderlyingCode', width: 100, align: 'center'
|
|
}, {
|
|
name: 'Strike', label: '交割价格', index: 'Strike', width: 100, align: 'center', formatter: TwoDecimalsFormat
|
|
}, {
|
|
name: 'TradeAmount', label: '交易数量', index: 'TradeAmount', width: 100, align: 'center', formatter: function (cellValue, options, rowObject) {
|
|
return numeral(page.IsUseDisplayNotional ? cellValue * (rowObject.CountRatio || 1) : cellValue).format("0,0.00");
|
|
}
|
|
}, {
|
|
name: 'StockEqvNotional', label: '名义本金', index: 'StockEqvNotional', width: 100, align: 'center', formatter: TwoDecimalsFormat
|
|
}, {
|
|
name: 'ClientName', label: '客户名称', index: 'ClientName', width: 100, align: 'center'
|
|
}, {
|
|
name: 'AssetBookName', label: '簿记账户', index: 'AssetBookName', width: 100, align: 'center'
|
|
}, {
|
|
name: 'TraderName', label: '交易员', index: 'TraderName', width: 100, align: 'center'
|
|
}];
|
|
|
|
function gridComplete() {
|
|
|
|
}
|
|
|
|
//function customButton(cellValue, options, rowObject) {
|
|
// var imageHtml = "<input type=\"button\" value=\"删除\" class=\"btn-warning\" onclick=\"deleteclient('" + rowObject.EncryptId + "');\" />";
|
|
// return imageHtml;
|
|
//}
|
|
|
|
|
|
function showToolName(cellValue, options, rowObject) {
|
|
var html = "<input type=\"button\" class=\"wentiEdit\" title='查看客户信息' onclick=\"startclientView('{0}')\" value=\"{1}\" />".template(rowObject.EncryptId, "查看");
|
|
return html;
|
|
}
|
|
|
|
function showOperation(cellValue, options, rowObject) {
|
|
var hasContractUrl = !main.isEmpty(cellValue);
|
|
if (hasContractUrl) {
|
|
return `<input type="button" class="wentiEdit" title="下载追保通知书" onclick="main.downloadFiles('${cellValue}')" value="下载" />`;
|
|
}
|
|
return '<input type="button" class="wentiEdit" title="还未生成追保通知书" disabled="disabled" value="下载" />';
|
|
}
|
|
|
|
function MarginPaymentFormat(cellValue, options, rowObject) {
|
|
return numeral(Math.ceil(cellValue * 100) / 100).format("0,0.00");
|
|
}
|
|
|
|
function TwoDecimalsFormat(cellValue, options, rowObject) {
|
|
return numeral(cellValue).format("0,0.00");
|
|
}
|
|
|
|
function rowclick(id) {
|
|
|
|
}
|
|
|
|
function reloadclient() {
|
|
//重新加载
|
|
SearchClick();
|
|
}
|
|
|
|
function SearchClick(isSearchclick) {
|
|
var listGrid = $('#listGrid');
|
|
listGrid.appendPostData({ ClientId: $("#ClientId").val() });
|
|
listGrid.appendPostData({ ValueDate: $("#ValueDate").val(), TraderId: $("#TraderId").val() });
|
|
listGrid.appendPostData({ AssetIds: $("#AssetId").val() });
|
|
listGrid.appendPostData({ AssetIdGroupList: $("#GroupId").val() });
|
|
listGrid.onSelectRow = rowdblclick;
|
|
listGrid.ondblClickRow = rowdblclick;
|
|
|
|
if (typeof (isSearchclick) != "undefined" && isSearchclick) {
|
|
//点击搜索时默认第一页
|
|
listGrid.jqGrid('setGridParam', {
|
|
page: 1
|
|
});
|
|
}
|
|
listGrid.trigger('reloadGrid');
|
|
}
|
|
|
|
//function GeneratePaymentDoc(id) {
|
|
// main.post("/client/GeneratePaymentDoc/", { valueDate: $("#ValueDate").val()}).done(function (data) {
|
|
// reloadclient();
|
|
// });
|
|
//}
|
|
|
|
//function SendMailPaymentDoc() {
|
|
// main.post("/client/SendMailPaymentDoc/", { valueDate: $("#ValueDate").val() }).done(function (data) {
|
|
// //reloadclient();
|
|
// });
|
|
//}
|
|
function exportTrade() {
|
|
var dateTemp = new Date().Format("yyyyMMddhhmmss");
|
|
var fileName = "远期交易预付金占用成本" + dateTemp;
|
|
main.toExcel("listGrid", fileName, "xls");
|
|
}
|
|
|
|
// 查看预付金成本
|
|
function viewMarginCost(id, num) {
|
|
var srcurl = "/forwardtrade/TradeMarginCost/?enid=" + id + "&tradenum=" + num;
|
|
main.open("查看预付金成本(交易编号:" + num + ")", srcurl, {});
|
|
}
|
|
|
|
function rowdblclick(rowid) {
|
|
var rowData = $(this).getRowData(rowid);
|
|
if (rowData.EncryptId && rowData.TradeNumber) {
|
|
viewMarginCost(rowData.EncryptId, rowData.TradeNumber);
|
|
}
|
|
}
|
|
|
|
</script>
|
|
}
|
|
|
|
<div class="searchdiv">
|
|
@Html.MyAceDropdownInput2("ClientId", "客户名称",CurUser.GetClientSelectItems(CurUser.交易管理_查看所有交易))
|
|
@Html.ShortInput("ValueDate", "交易日期")
|
|
@Html.MyAceDropdownInput2("TraderId", "交易员", GlobalData.GetAllTrader())
|
|
@Html.MyAceDropdownInput("AssetId", "簿记账户", AssetunitController.GetClientassetunit())
|
|
@Html.MyAceDropdownInput("GroupId", "簿记账户组", AssetUnitModel.GetAllAssetUnitGroupItem())
|
|
@MyControls.SearchBtn()
|
|
@MyControls.Btn("导出Excel", "exportTrade()")
|
|
</div>
|
|
@Html.Raw(JqGridSimple.OutTable())
|