Files
zszq-trs/YLErpWeb/Views/SwapTrade2/SwapLongShortSwap.cshtml
T
张名锐 5b7f17727d refactor(swaptrade): 优化互换交易中的数量和金额格式化功能
- 引入UnderlyingInstrumentType字段用于精确控制格式化规则
- 添加quantityPrecision配置支持不同产品类型的数量精度设置
- 实现formatAmount和formatQuantity方法提供统一格式化接口
- 更新视图模板使用新的格式化方法替代直接数据绑定
- 重构swapPricePrecisionHelper.js支持按产品类型定制格式化规则
- 移除废弃的inputFormatTradeAmount等旧格式化配置
- 添加千分位分组显示功能提升数字可读性
2026-08-06 12:41:30 +08:00

127 lines
6.5 KiB
Plaintext

@model UnwindData
@{
ViewBag.Title = "交易 | 收益结算";
Layout = "~/Views/Shared/_InfoLayout.cshtml";
bool isUseApproval = ViewBag.isUseApproval;
bool isShowReCheckClose = ViewBag.IsShowReCheckClose;
}
@section CSS{
<link rel="stylesheet" href="~/Style/Css/unwindSwapTrade.css?v=@(HtmlUtil.JsVersion)" />
}
@section JS
{
<script>
var model = @Json.Serialize(Model);
model.StartDate = model.StartDate ? model.StartDate.substr(0, 10) : "";
model.ValueDate = model.ValueDate ? model.ValueDate.substr(0, 10) : "";
var isUseApproval = "@isUseApproval" == "True";
var g_isShowReCheckClose = "@isShowReCheckClose" == "True";
</script>
<script src="~/front/calendar?v=@(HtmlUtil.JsVersion)"></script>
<script src="~/Scripts/fast/fastVue.components.js?v=@HtmlUtil.JsVersion"></script>
<script src="~/front/swappriceprecision?v=@(HtmlUtil.JsVersion)"></script>
<script src="~/Scripts/app/swaptrade/swapPricePrecisionHelper.js?v=@HtmlUtil.JsVersion"></script>
<script src="~/Scripts/app/swaptrade/swapLongShort.js?v=@HtmlUtil.JsVersion"></script>
}
<div class="pb-3" id="vueDiv">
<div class="yc-panel">
<div id="commomArea" class="row" style="height:140px">
<div class="form-group col-md-4">
<label class="formlabel">成交名义本金</label>
<input class="text-box" :value="formatAmount(deal.NotionalValue)" readonly="readonly" type="text" />
</div>
<div class="form-group col-md-4">
<label class="formlabel">持仓名义本金</label>
<input class="text-box" :value="formatAmount(deal.PosiNotionalValue)" readonly="readonly" type="text" />
</div>
<div class="form-group col-md-4">
<label class="formlabel">起始日期</label>
<input class="text-box" id="startDate" readonly="readonly" type="text" v-model="deal.StartDate" />
</div>
<div class="form-group col-md-4">
<label class="formlabel">收益结算日期</label>
<vue-datepicker :maxdate="maxUnwindDate" :mindate="minStartDate" :holiday="1" v-model="deal.ValueDate" v-on:input="setValueDate" />
</div>
<div class="form-group col-md-4">
<label class="formlabel">年化天数</label>
<input class="text-box" v-model="deal.AnnualDays" readonly="readonly" type="text" />
</div>
<div class="form-group col-md-4">
<label class="formlabel">平仓总额</label>
<input class="text-box" :value="formatAmount(deal.SwapCloseAmount)" readonly="readonly" type="text" />
</div>
</div>
</div>
<div class="yc-panel">
<div class="row no-gutters" style="display:block;">
<div class="titleDiv">
<div class="titleHead"></div>
<div class="titleLabel"><label>预付金/预付金</label></div>
</div>
<div style="margin: 5px 0 0 12px">
<table class="table table-bordered ratetable" style="width:750px;">
<tbody>
<tr>
<td width="116px">收支方向</td>
<td>利息金额</td>
<td>其他费用</td>
<td>预付金/预付金平仓盈亏</td>
</tr>
<tr v-for="item in marginList">
<td :class="item.InterestDirection==1?'swapget':'swappay'">{{item.InterestDirection==1?"收取":"支付"}}</td>
<td>
<vue-number-input v-model="item.InterestAmount" v-bind:format="inputFormatEqvNotional" v-on:input="changeInterestAmount(item)"></vue-number-input>
</td>
<td>
<vue-number-input v-model="item.InterestFee" v-bind:format="inputFormatEqvNotional" v-on:input="changeInterestAmount(item)"></vue-number-input>
</td>
<td>{{formatAmount(item.InterestClosePnL)}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row no-gutters" style="display:block;">
<div class="titleDiv">
<div class="titleHead"></div>
<div class="titleLabel"><label>利息端</label></div>
</div>
<div style="margin: 5px 0 0 12px">
<table class="table table-bordered">
<tbody>
<tr>
<td>收支方向</td>
<td>利息金额</td>
<td>其他费用</td>
<td>利息端平仓盈亏</td>
</tr>
<tr v-for="item in interestList">
<td :class="item.InterestDirection==1?'swapget':'swappay'">{{item.InterestDirection==1?"收取":"支付"}}</td>
<td>
<vue-number-input v-model="item.InterestAmount" v-bind:format="inputFormatEqvNotional" v-on:input="changeInterestAmount(item)"></vue-number-input>
</td>
<td>
<vue-number-input v-model="item.InterestFee" v-bind:format="inputFormatEqvNotional" v-on:input="changeInterestAmount(item)"></vue-number-input>
</td>
<td>{{formatAmount(item.InterestClosePnL)}}</td>
</tr>
</tbody>
</table>
</div>
<div>
@if (isUseApproval)
{
<button class="btn btn-default swapclose" type="button" v-on:click="submitApproval('reject');">拒绝</button>
<button class="btn btn-primary swapsave" type="button" v-on:click="submitApproval('pass')">审批通过</button>
}
else
{
<button class="btn btn-default swapclose" type="button" onclick="layer.closeMe();">取消</button>
<button class="btn btn-primary swapsave" type="button" v-on:click="incomeTrade">{{getSumbitText()}}</button>
}
</div>
<div class="clearfix"></div>
</div>
</div>
</div>