标的交易数量与价格统一
This commit is contained in:
@@ -93,8 +93,8 @@ namespace YLErp.Web.Controllers
|
||||
|
||||
td = new ExchangeTrade
|
||||
{
|
||||
TradeType = isOption ? "场内期权" : "商品期货",
|
||||
InstrumentType = ConsGlobal.InstrumentType.CommodityFutures,
|
||||
TradeType = "信用债",
|
||||
InstrumentType = ConsGlobal.InstrumentType.CreditBonds,
|
||||
TradeDate = valuedateBLL.ValueDate,
|
||||
TraderId = UserId,
|
||||
TraderName = UserName,
|
||||
@@ -129,6 +129,8 @@ namespace YLErp.Web.Controllers
|
||||
|
||||
public JsonResult AjaxSaveTradeEdit(ExchangeTrade model)
|
||||
{
|
||||
model.TradeAmount *= 100;//张数
|
||||
model.TradeSinglePrice /= 100;// 价格除100
|
||||
var td = new ExchangeTradeSaveService(CurUser).Save(model, Model.Enum.TradeSourceEnum.系统交易);
|
||||
return JsonSuccessData(td);
|
||||
}
|
||||
|
||||
@@ -31,13 +31,6 @@
|
||||
<span class="search-label">标的代码</span>
|
||||
<select id="UnderlyingIds" name="UnderlyingIds" multiple></select>
|
||||
</div>
|
||||
@if (!pageObj.IsGuoJun)
|
||||
{
|
||||
<div class="search-group">
|
||||
<span class="search-label">期权代码</span>
|
||||
<input class="search-input" id="OptionCode" name="OptionCode" type="text" autocomplete="off">
|
||||
</div>
|
||||
}
|
||||
<!-- <div class="search-group">
|
||||
<span class="search-label">持仓日期</span>
|
||||
<input class="search-input datepicker" style="width:152px !important" name="TradeDateTo" type="text" autocomplete="off">
|
||||
|
||||
@@ -135,13 +135,13 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group col-6">
|
||||
<label class="formlabel" for="TradeAmount">成交数量</label>
|
||||
<input id="TradeAmount" class="text-box" type="text" value="@(Model.TradeAmount.ToString("F2"))" name="TradeAmount" />
|
||||
<label class="formlabel" for="TradeAmount">成交数量/张数</label>
|
||||
<input id="TradeAmount" class="text-box" type="text" value="@((Model.TradeAmount*0.01).ToString("F2"))" name="TradeAmount" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-6">
|
||||
<label class="formlabel">成交单价</label>
|
||||
<input id="TradeSinglePrice" class="text-box" type="text" name="TradeSinglePrice" value="@(Model.TradeSinglePrice.ToString("F6"))">
|
||||
<input id="TradeSinglePrice" class="text-box" type="text" name="TradeSinglePrice" value="@((Model.TradeSinglePrice*100).ToString("F6"))">
|
||||
<a href="javascript:void(0)" onclick="rightPaneMgr.refreshPrice()">
|
||||
<span title="使用系统最新价格" class="glyphicon glyphicon-refresh"></span>
|
||||
</a>
|
||||
|
||||
@@ -84,13 +84,13 @@
|
||||
<th>成交日期</th>
|
||||
<td>@(Model.TradeDate.ToString("yyyy-MM-dd"))</td>
|
||||
<th>成交单价</th>
|
||||
<td>@(Model.TradeSinglePrice)</td>
|
||||
<td>@(Model.TradeSinglePrice*100)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>成交手数</th>
|
||||
<td>@(Model.TradeLots)</td>
|
||||
<th>成交数量</th>
|
||||
<td>@(PS.Config.IsUseDisplayNotional ? Model.TradeAmount * Model.CountRatio : Model.TradeAmount)</td>
|
||||
<th>成交数量/张数</th>
|
||||
<td>@(Model.TradeAmount*0.01)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
|
||||
@@ -187,12 +187,6 @@ function getColModelGrid() {
|
||||
name: 'UnderlyingName',
|
||||
label: '标的名称',
|
||||
width: 150
|
||||
}, {
|
||||
name: 'OptionCode',
|
||||
label: '期权代码',
|
||||
width: 120,
|
||||
hidden: page.IsGuoJun,
|
||||
optionHid: page.IsGuoJun,
|
||||
}, {
|
||||
name: 'Position',
|
||||
label: '持仓手数',
|
||||
|
||||
@@ -7,6 +7,8 @@ const consTraders = page.traderList;
|
||||
const consAssetUnits = page.CanSelectTrader ? ylotc.assetunits : ylotc.assetunits.filter(x => x.TraderIds.includes(page.Trade.TraderId));
|
||||
const consCommissionType = Object.freeze({ 不收取: 0, 系统计算: 1, 手动录入: 2 });
|
||||
const consInstrumentTypes = tradeHelper.InstrumentTypes;
|
||||
const amountNum = 0.01;
|
||||
const lotAmountNum = 100;
|
||||
var instTypes = [];
|
||||
//标的信息管理
|
||||
const leftPaneMgr = (new function () {
|
||||
@@ -110,7 +112,7 @@ const leftPaneMgr = (new function () {
|
||||
consView.ContractSize = (data.ContractSize || 1) / (data.CountRatio || 1);
|
||||
let tradeAmount = parseFloat($('#TradeAmount').val()) || 0;
|
||||
if (!_init) {
|
||||
$('#TradeLots').val((tradeAmount / consView.ContractSize).toFixed(2));
|
||||
$('#TradeLots').val((tradeAmount * lotAmountNum / consView.ContractSize).toFixed(2));
|
||||
}
|
||||
$('#MaturityDate').val(data.MaturityDate || '');
|
||||
});
|
||||
@@ -121,7 +123,7 @@ const leftPaneMgr = (new function () {
|
||||
consView.ContractSize = _init && page.ContractSize ? page.ContractSize : (data.ContractSize || 1) / (data.CountRatio || 1);
|
||||
let tradeAmount = parseFloat($('#TradeAmount').val()) || 0;
|
||||
if (!_init) {
|
||||
$('#TradeLots').val((tradeAmount / consView.ContractSize).toFixed(2));
|
||||
$('#TradeLots').val((tradeAmount * lotAmountNum / consView.ContractSize).toFixed(2));
|
||||
}
|
||||
|
||||
$('#MaturityDate').val(data.MaturityDate || '');
|
||||
@@ -193,14 +195,14 @@ const rightPaneMgr = (new function () {
|
||||
let lotsInput = FastVue.numberInput(document.getElementById('TradeLots'));
|
||||
$('#TradeLots').on('change', function () {
|
||||
let lots = lotsInput.getValue();
|
||||
$('#TradeAmount').val((lots * consView.ContractSize).toFixed(2));
|
||||
$('#TradeAmount').val((lots * amountNum * consView.ContractSize).toFixed(2));
|
||||
});
|
||||
|
||||
//成交数量
|
||||
let tradeAmountInput = FastVue.numberInput(document.getElementById('TradeAmount'));
|
||||
$('#TradeAmount').on('change', function () {
|
||||
let tradeAmount = tradeAmountInput.getValue();
|
||||
$('#TradeLots').val((tradeAmount / consView.ContractSize).toFixed(2));
|
||||
$('#TradeLots').val((tradeAmount * lotAmountNum / consView.ContractSize).toFixed(2));
|
||||
});
|
||||
|
||||
//成交价格
|
||||
@@ -226,7 +228,7 @@ const rightPaneMgr = (new function () {
|
||||
});
|
||||
} else {
|
||||
main.post("/pricing/AjaxGetUnderlyingPrice", { underlyingCode: $('#UnderlyingCode').val() }).done(function (resp) {
|
||||
$("#TradeSinglePrice").val(resp.obj.price);
|
||||
$("#TradeSinglePrice").val(resp.obj.price * lotAmountNum);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user