274 lines
14 KiB
Plaintext
274 lines
14 KiB
Plaintext
@model trade_cash
|
|
@{
|
|
ViewBag.Title = "交易 | 交易平仓";
|
|
Layout = "~/Views/Shared/_InfoLayout.cshtml";
|
|
trade trade = ViewBag.trade;
|
|
trade pairTrade = ViewBag.PairTrade;
|
|
//是否平仓复核提交
|
|
bool isReCheckConfirm = trade.TradeStatus == ConsTrade.平仓待复核;
|
|
bool isShowReCheckClose = ViewBag.IsShowReCheckClose;
|
|
bool isUseApproval = ViewBag.isUseApproval;
|
|
var systemValueDate = valuedateBLL.ValueDate;
|
|
if (trade.SettlementType == SettlementTypeEnum.ReferencePrice && PS.Config.Company == CompanyEnum.厦门象屿)
|
|
{
|
|
systemValueDate = YLErp.Modules.SpecialModule.XiaMenXiangYuHelper.GetRefernceValueDate(systemValueDate);
|
|
}
|
|
if (trade.ExerciseDate <= systemValueDate)
|
|
{
|
|
systemValueDate = trade.ExerciseDate.Value;
|
|
}
|
|
if (!isUseApproval)
|
|
{
|
|
Model.ValueDate = systemValueDate;
|
|
}
|
|
var pageObj = new
|
|
{
|
|
trade,
|
|
variety = ViewBag.variety,
|
|
pairTrade = ViewBag.PairTrade,
|
|
g_isShowReCheckClose = isShowReCheckClose,
|
|
systemValueDate = systemValueDate.ToString("yyyy-MM-dd"),
|
|
tradeDate = (trade.UnWindDate ?? trade.TradeDate).Value.ToString("yyyy-MM-dd"),
|
|
UnwindSinglePriceAngle = valuedateBLL.SystemDate.UnwindSinglePriceAngle,
|
|
UnwindAmountAngle = valuedateBLL.SystemDate.UnwindAmountAngle,
|
|
g_precisionOfMinuteInQuote = YLErp.PS.Config.ErpElement.PrecisionOfMinuteInQuote
|
|
};
|
|
}
|
|
@section CSS{
|
|
<style type="text/css">
|
|
.btn {
|
|
border: none
|
|
}
|
|
</style>
|
|
}
|
|
@section JS
|
|
{
|
|
<script src="~/Scripts/app/tradeHelper.js?v=@HtmlUtil.JsVersion"></script>
|
|
<script>
|
|
var pageObj = @Json.Serialize(pageObj);
|
|
var model =@Html.JsonSerialize(Model);
|
|
model.FinalPriceType = "System";
|
|
model.ValueDate = moment(model.ValueDate).format("YYYY-MM-DD");
|
|
model.UnwindVol = main.toNumberExcludingNaNEx(model.UnwindVol * 100);
|
|
model.Strike = main.toNumberExcludingNaNEx(model.Strike);
|
|
var variety =@Json.Serialize(ViewBag.variety);
|
|
var pairTrade =@Html.JsonSerialize(pairTrade);
|
|
var trade = @Html.JsonSerialize(trade);
|
|
var g_isShowReCheckClose = "@isShowReCheckClose" == "True";
|
|
var g_isUseApproval = "@isUseApproval" == "True";
|
|
var systemValueDate = moment("@(valuedateBLL.ValueDate <= trade.ExerciseDate ? valuedateBLL.ValueDate.ToString("yyyy-MM-dd") : trade.ExerciseDate?.ToString("yyyy-MM-dd"))");
|
|
var tradeDate = "@trade.TradeDate.Value.ToString("yyyy-MM-dd")";
|
|
var exerciseDate = "@trade.ExerciseDate.Value.ToString("yyyy-MM-dd")";
|
|
function initUnwindDate() {
|
|
main.setTradeDatePicker(model.ValueDate, "#unwindDate", null, vue.setUnwindDate);
|
|
$("#unwindDate").datepicker("option", "minDate", tradeDate);
|
|
$("#unwindDate").datepicker("option", "maxDate", exerciseDate);
|
|
}
|
|
$(document).ready(function () {
|
|
initUnwindDate();
|
|
});
|
|
</script>
|
|
<script src="~/Scripts/app/trade/tradeUnwind.js?v=@(HtmlUtil.JsVersion)"></script>
|
|
}
|
|
@if (!isReCheckConfirm || isUseApproval)
|
|
{
|
|
<div id="vueDiv" class="row" style="margin-top: 20px">
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">标的代码</label>
|
|
<input class="text-box" v-model="tradeCash.UnderlyingCode" readonly="readonly" type="text" />
|
|
</div>
|
|
@if (Model.IsUsePremiumRate != null && Model.IsUsePremiumRate.Value)
|
|
{
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">成交名义本金</label>
|
|
<input class="text-box" v-model="tradeCash.OriginalStockEqvNotional" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">持仓名义本金</label>
|
|
<input class="text-box" v-model="tradeCash.StockEqvNotional" readonly="readonly" type="text" />
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">交易数量</label>
|
|
<input class="text-box" v-model="tradeCash.TradeOriginalAmount" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">持仓数量</label>
|
|
<input class="text-box" v-model="tradeCash.TradeAmount" readonly="readonly" type="text" />
|
|
</div>
|
|
}
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓日期</label>
|
|
<input class="text-box" id="unwindDate" onchange="vue.setUnwindDate($(this).val())" v-model="tradeCash.ValueDate" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">标的价格</label>
|
|
<input class="text-box" v-model="tradeCash.FinalPrice" v-on:change="changeUnderlyingPrice()" type="number" min="0" />
|
|
<template v-if="tradeCash.FinalPriceType=='User'">
|
|
<span class="glyphicon glyphicon-user" title="使用用户输入的标的价格"></span>
|
|
</template>
|
|
<template v-else>
|
|
<span class="glyphicon glyphicon-tags" title="使用系统中的标的价格"></span>
|
|
</template>
|
|
<a href="javascript:void(0)" v-on:click="refreshUnderlyingPrice()">
|
|
<span title="使用系统标的价格" class="glyphicon glyphicon-refresh"></span>
|
|
</a>
|
|
</div>
|
|
|
|
@if (Model.IsUsePremiumRate != null && Model.IsUsePremiumRate.Value)
|
|
{
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">期初价格</label>
|
|
<input class="text-box" v-model="tradeCash.InitialSpotPrice" v-on:change="changeUnderlyingPrice()" disabled="disabled" type="number" min="0" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓单价</label>
|
|
<input class="text-box" v-model="tradeCash.UnwindPricePercentRate" :readonly="trade.IsTradePricePayType" v-on:change="changeUnwindPricePercentRate()" type="text" />%
|
|
<a href="javascript:void(0)" v-on:click="getUnwindPrice()"><span title="计算平仓单价" class="glyphicon glyphicon-refresh"></span></a>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓单价</label>
|
|
<input class="text-box" v-model="tradeCash.UnwindPrice" :readonly="trade.IsTradePricePayType" v-on:change="changeUnwindPrice()" type="text" />¥
|
|
<a href="javascript:void(0)" v-on:click="getUnwindPrice()"><span title="计算平仓单价" class="glyphicon glyphicon-refresh"></span></a>
|
|
</div>
|
|
}
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓类型</label>
|
|
<select style="height: 30px;" v-model="tradeCash.UnwindType" v-on:change="changeUnwindType()">
|
|
<option value="全部平仓">全部平仓</option>
|
|
<option value="部分平仓">部分平仓</option>
|
|
</select>
|
|
</div>
|
|
@if (Model.IsUsePremiumRate != null && Model.IsUsePremiumRate.Value)
|
|
{
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓比例</label>
|
|
<input class="text-box" v-model="tradeCash.UnwindPercentRate" :readonly="tradeCash.UnwindType=='全部平仓'" v-on:change="changeUnwindPercentRate()" type="text" />%
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓数量</label>
|
|
<input class="text-box" v-model="tradeCash.UnwindTradeAmount" :readonly="tradeCash.UnwindType=='全部平仓'" v-on:change="changeUnwindTradeAmount()" type="text" />{{variety.QuoteUnitSingle}}
|
|
</div>
|
|
}
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓总额</label>
|
|
<input class="text-box" v-model="tradeCash.Amount" :readonly="!trade.IsTradePricePayType" v-on:change="changeAmount()" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-12" style="margin-top: 20px">
|
|
@if (ViewBag.isUseApproval)
|
|
{
|
|
<input type="button" class="btn btn-primary" value="审批通过" v-on:click="submitApproval('pass')" style="margin-left: 45px;" />
|
|
<input type="button" class="btn btn-primary" value="拒绝" v-on:click="submitApproval('reject')" />
|
|
}
|
|
else
|
|
{
|
|
|
|
<input type="button" class="btn btn-primary" :value="getSumbitText()" v-on:click="submit" style="margin-left: 45px;" />
|
|
<input type="button" class="btn btn-primary" value="取消" v-on:click="closetrade_cashWindow" />
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div id="vueDiv" class="row" style="margin-top: 20px">
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">标的代码</label>
|
|
<input class="text-box" v-model="tradeCash.UnderlyingCode" readonly="readonly" type="text" />
|
|
</div>
|
|
@if (Model.IsUsePremiumRate != null && Model.IsUsePremiumRate.Value)
|
|
{
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">成交名义本金</label>
|
|
<input class="text-box" v-model="tradeCash.OriginalStockEqvNotional" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">持仓名义本金</label>
|
|
<input class="text-box" v-model="tradeCash.StockEqvNotional" readonly="readonly" type="text" />
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">交易数量</label>
|
|
<input class="text-box" v-model="tradeCash.TradeOriginalAmount" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">持仓数量</label>
|
|
<input class="text-box" v-model="tradeCash.TradeAmount" readonly="readonly" type="text" />
|
|
</div>
|
|
}
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓日期</label>
|
|
<input class="text-box datepicker" v-model="tradeCash.ValueDate" readonly="readonly" type="text" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">标的价格</label>
|
|
<input class="text-box" v-model="tradeCash.FinalPrice" v-on:change="changeUnderlyingPrice()" readonly="readonly" type="number" min="0" />
|
|
</div>
|
|
|
|
@if (Model.IsTradePricePayType == true)
|
|
{
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓总额</label>
|
|
<input class="text-box" v-model="tradeCash.AmountCheck" :readonly="!trade.IsTradePricePayType" v-on:change="changeAmount()" type="text" />
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
if (Model.IsUsePremiumRate == true)
|
|
{
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">期初价格</label>
|
|
<input class="text-box" v-model="tradeCash.InitialSpotPrice" v-on:change="changeUnderlyingPrice()" disabled="disabled" type="number" min="0" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓单价</label>
|
|
<input class="text-box" v-model="tradeCash.UnwindPricePercentRateCheck" :readonly="trade.IsTradePricePayType" type="text" />%
|
|
<a href="javascript:void(0)" v-on:click="getUnwindPrice()"><span title="计算平仓单价" class="glyphicon glyphicon-refresh"></span></a>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓单价</label>
|
|
<input class="text-box" v-model="tradeCash.UnwindPriceCheck" :readonly="trade.IsTradePricePayType" type="text" />¥
|
|
<a href="javascript:void(0)" v-on:click="getUnwindPrice()"><span title="计算平仓单价" class="glyphicon glyphicon-refresh"></span></a>
|
|
</div>
|
|
}
|
|
}
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓类型</label>
|
|
<input class="text-box" v-model="tradeCash.UnwindType" readonly="readonly" type="text" />
|
|
</div>
|
|
@if (Model.IsUsePremiumRate == true)
|
|
{
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓比例</label>
|
|
<input class="text-box" v-model="tradeCash.UnwindPercentRate" readonly="readonly" type="text" />%
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">平仓数量</label>
|
|
<input class="text-box" v-model="tradeCash.UnwindTradeAmount" readonly="readonly" type="text" />
|
|
{{variety.QuoteUnitSingle}}
|
|
</div>
|
|
}
|
|
<div class="form-group col-md-12" style="margin-top: 20px">
|
|
<input type="button" class="btn btn-primary" value="复核" v-on:click="review" style="margin-left: 45px;" />
|
|
<input type="button" class="btn btn-primary" value="拒绝" v-on:click="reject" />
|
|
<input type="button" class="btn btn-primary" value="取消" v-on:click="closetrade_cashWindow" />
|
|
</div>
|
|
</div>
|
|
}
|