Files
zszq-trs/YLErpWeb/Views/margin_template_v2/margin_template_v2DefaultEdit.cshtml
T
hjhan 0e0a6d0962 style: 预付金模板左栏控件统一宽度,多选标签宽度自适应
- chosen 已选项去掉固定 130px 宽:短标签右侧留白、搜索框被挤到下一行撑高控件
- 左栏加 tpl-base 标识,input/select 统一 240px、说明 textarea 跟随列宽,
  去掉三页面各写一个内联宽度(320/460px 混用)
2026-08-28 09:03:52 +08:00

503 lines
42 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@using YLErp.Enums;
@model margin_template_v2
@{
ViewBag.Title = "预付金模板 | 编辑";
Layout = "~/Views/Shared/_InfoLayout.cshtml";
var pageObj = new
{
isAdd = Model == null || Model.id == 0,
marginTemplate = Model,
detail = new margin_template_detail() { ValueDate = new DateTime(2020, 1, 1), ComparedInitialMarginRate = 1 },
etfSubtypeItems = YLErp.BLL.DictionaryBLL.GetDictionaryItems("ETF 子类").Select(x => x.Name).ToList()
};
var selectedBookIds = margin_template_v2.ParseBookIds(Model?.BookIds);
}
@section CSS{
<link href="~/Style/Css/margin_template_v2Edit.css?v=@(HtmlUtil.JsVersion)" rel="stylesheet" />
}
@section JS{
<script type="text/javascript">
@*内联页面对象用 ToInlineJsonNewtonsoft + EscapeHtml,敏感字符 \uXXXX 转义)替代 @Json.Serialize
全局 AntiXssConverter 会把 < > 实体编码为 &lt; &gt;,导致 SpanConfig.BondTerm 等字段回读后变脏值入库*@
const pageVue = @Html.Raw(JsonHelper.ToInlineJson(Model));
const page = @Html.Raw(JsonHelper.ToInlineJson(pageObj));
page.marginTemplate.ValueDate = page.marginTemplate.ValueDate.substr(0, 10);
</script>
<script src="~/front/calendar?v=@(HtmlUtil.JsVersion)"></script>
<script src="~/Scripts/app/marginTemplate/marginTemplateV2DefaultEdit.js?v=@HtmlUtil.JsVersion"></script>
}
<form id="marginTemplateV2Form" method="post" onsubmit="return false;">
<div class="row no-gutters">
<div class="col form-layout tpl-base" style="height: 720px; overflow-y: auto;">
<div class="border">
<P>新模板信息</P>
<div class="form-group">
<label class="formlabel">模板名称</label>
<input class="text-box" v-model="marginTemplate.Name" />
</div>
<div class="form-group">
<label class="formlabel">适用结构</label>
<select class="chosen-select" id="tradeTypes" multiple>
<option value="香草期权" @(Model.TradeTypes != null && Model.TradeTypes.Contains("香草期权") ? "selected" : "")>香草期权</option>
<option value="障碍期权" @(Model.TradeTypes != null && Model.TradeTypes.Contains("障碍期权") ? "selected" : "")>障碍期权</option>
<option value="二元期权" @(Model.TradeTypes != null && Model.TradeTypes.Contains("二元期权") ? "selected" : "")>二元期权</option>
<option value="亚式期权" @(Model.TradeTypes != null && Model.TradeTypes.Contains("亚式期权") ? "selected" : "")>亚式期权</option>
<option value="彩虹期权" @(Model.TradeTypes != null && Model.TradeTypes.Contains("彩虹期权") ? "selected" : "")>彩虹期权</option>
<option value="合成价差期权" @(Model.TradeTypes != null && Model.TradeTypes.Contains("合成价差期权") ? "selected" : "")>合成价差期权</option>
<option value="远期" @(Model.TradeTypes != null && Model.TradeTypes.Contains("远期") ? "selected" : "")>远期</option>
<option value="双鲨期权" @(Model.TradeTypes != null && Model.TradeTypes.Contains("双鲨期权") ? "selected" : "")>双鲨期权</option>
<option value="凤凰期权" @(Model.TradeTypes != null && Model.TradeTypes.Contains("凤凰期权") ? "selected" : "")>凤凰期权</option>
<option value="雪球期权" @(Model.TradeTypes != null && Model.TradeTypes.Contains("雪球期权") ? "selected" : "")>雪球期权</option>
<option value="气囊结构" @(Model.TradeTypes != null && Model.TradeTypes.Contains("气囊结构") ? "selected" : "")>气囊结构</option>
<option value="收益互换" @(Model.TradeTypes != null && Model.TradeTypes.Contains("收益互换") ? "selected" : "")>收益互换</option>
<option value="区间累积期权" @(Model.TradeTypes != null && Model.TradeTypes.Contains("区间累积期权") ? "selected" : "")>区间累积期权</option>
<option value="累计期权" @(Model.TradeTypes != null && Model.TradeTypes.Contains("累计期权") ? "selected" : "")>累计期权</option>
<option value="Risky期权" @(Model.TradeTypes != null && Model.TradeTypes.Contains("Risky期权") ? "selected" : "")>Risky期权</option>
<option value="自定义交易" @(Model.TradeTypes != null && Model.TradeTypes.Contains("自定义交易") ? "selected" : "")>自定义交易</option>
</select>
</div>
<div class="form-group">
<label class="formlabel">适用簿记账户</label>
<select class="chosen-select" id="BookIds" multiple data-placeholder="请选择簿记账户">
@foreach (var item in AssetunitController.GetAllassetunit())
{
<option value="@item.Value" @(selectedBookIds.Contains(item.Value?.Trim() ?? "") ? "selected" : "")>@item.Text</option>
}
</select>
</div>
<div class="form-group">
<label class="formlabel">适用买卖方向</label>
<select class="chosen-select" id="BuySellType" multiple>
<option value="1" @((Model.BuySellType & BuySellEnum.Buy) > 0 ? "selected" : "")>买入</option>
<option value="2" @((Model.BuySellType & BuySellEnum.Sell) > 0 ? "selected" : "")>卖出</option>
</select>
</div>
<div class="form-group">
<label class="formlabel">适用预付金场景</label>
<select class="chosen-select" id="MarginScenarios" multiple>
<option value="1" @((Model.MarginScenarios & MarginScenarioEnum.Initial) > 0 ? "selected" : "")>初始预付金</option>
<option value="2" @((Model.MarginScenarios & MarginScenarioEnum.Position) > 0 ? "selected" : "")>持仓预付金</option>
</select>
</div>
<div class="form-group" v-show="marginTemplate.RuleType==5 || marginTemplate.RuleType==6">
<label class="formlabel">参数类型</label>
<select v-model="marginTemplate.DefaultParameterType" v-bind:disabled="!isAdd">
<option value="@((int)DefaultMarginParameterTypeEnum.个股)">@DefaultMarginParameterTypeEnum.个股.ToString()</option>
<option value="@((int)DefaultMarginParameterTypeEnum.指数)">@DefaultMarginParameterTypeEnum.指数.ToString()</option>
</select>
</div>
<div class="form-group">
<label class="formlabel">是否生效</label>
<select v-model="marginTemplate.IsValid">
<option value="true">是</option>
<option value="false">否</option>
</select>
</div>
<div class="form-group">
<label class="formlabel">生效日期</label>
<vue-datepicker name="ValueDate" class="text-box" v-model="marginTemplate.ValueDate" />
</div>
</div>
<div class="border">
<P>选择模板规则</P>
<div class="form-group">
<label class="formlabel">预付金规则</label>
@if (PS.Config.Company == CompanyEnum.厦门象屿)
{
@*厦门象屿原本就不渲染此下拉,保持原样*@
}
else
{
@*预付金模板V2迁移:本部署(TRS)只开放 无预付金 和 区间追保结构 两种规则(2026-08 按业务要求)。
原"其他公司显示完整规则列表"的代码以注释形式保留在下方,如需恢复取消注释即可。*@
<select v-model="marginTemplate.RuleType" v-on:change="changeRuleType()">
<option value="@((int)MarginRuleTypeEnum.无预付金)">@MarginRuleTypeEnum.无预付金.ToString()</option>
<option value="@((int)MarginRuleTypeEnum.区间追保结构)">@MarginRuleTypeEnum.区间追保结构.ToString()</option>
</select>
@* 原完整规则列表(保留备查):
<select v-model="marginTemplate.RuleType" v-on:change="changeRuleType()">
<option value="@((int)MarginRuleTypeEnum.无预付金)">@MarginRuleTypeEnum.无预付金.ToString()</option>
<option value="@((int)MarginRuleTypeEnum.按固定利率)">@MarginRuleTypeEnum.按固定利率.ToString()</option>
<option value="@((int)MarginRuleTypeEnum.按浮动盈亏)">@MarginRuleTypeEnum.按浮动盈亏.ToString()</option>
<option value="@((int)MarginRuleTypeEnum.类香草预付金规则)">@MarginRuleTypeEnum.类香草预付金规则.ToString()</option>
<option value="@((int)MarginRuleTypeEnum.触发条件预付金规则1)">@MarginRuleTypeEnum.触发条件预付金规则1.ToString()</option>
<option value="@((int)MarginRuleTypeEnum.触发条件预付金规则2)">@MarginRuleTypeEnum.触发条件预付金规则2.ToString()</option>
<option value="@((int)MarginRuleTypeEnum.触发条件预付金规则3)">@MarginRuleTypeEnum.触发条件预付金规则3.ToString()</option>
<option value="@((int)MarginRuleTypeEnum.含赔付预付金计算规则)">@MarginRuleTypeEnum.含赔付预付金计算规则.ToString()</option>
<option value="@((int)MarginRuleTypeEnum.标准SPAN)">@MarginRuleTypeEnum.标准SPAN.ToString()</option>
<option value="@((int)MarginRuleTypeEnum.买入自动赎回规则1)">@MarginRuleTypeEnum.买入自动赎回规则1.ToString()</option>
<option value="@((int)MarginRuleTypeEnum.卖出自动赎回规则1)">@MarginRuleTypeEnum.卖出自动赎回规则1.ToString()</option>
</select>
*@
}
</div>
<div class="form-group">
<label class="formlabel">规则描述</label>
<textarea class="text-box" rows="3" style="text-align:left;" v-model="marginTemplate.Comments" v-bind:title="marginTemplate.Comments" disabled>
</textarea>
</div>
<div class="form-group">
<label class="formlabel">是否按标的分类设置参数</label>
<select v-model="marginTemplate.UnderlyingSeperateType" v-on:change="changeUnderlyingSeperateType()" v-bind:disabled="marginTemplate.RuleType != @((int)MarginRuleTypeEnum.按固定利率) && marginTemplate.RuleType != @((int)MarginRuleTypeEnum.标准SPAN) && marginTemplate.RuleType != @((int)MarginRuleTypeEnum.卖出自动赎回规则1) && marginTemplate.RuleType != @((int)MarginRuleTypeEnum.区间追保结构)">
<option value="@((int)UnderlyingSeperateTypeEnum.None)">不区分</option>
<option v-if="marginTemplate.RuleType != @((int)MarginRuleTypeEnum.区间追保结构)" value="@((int)UnderlyingSeperateTypeEnum.CustomStock)">按自定义权益分类</option>
<option v-if="marginTemplate.RuleType == @((int)MarginRuleTypeEnum.区间追保结构)" value="@((int)UnderlyingSeperateTypeEnum.CustomInstrumentType)">按资产类型分类</option>
</select>
</div>
<div class="form-group">
<label class="formlabel"></label>
<textarea class="text-box" rows="5" style="text-align:left;" v-model="marginTemplate.UnderlyingSeperateComments" v-bind:title="marginTemplate.UnderlyingSeperateComments" disabled>
</textarea>
</div>
</div>
</div>
<div class="col form-layout" style="height: 720px; overflow-y:auto;">
<template v-if="marginTemplate.RuleType == @((int)MarginRuleTypeEnum.区间追保结构)">
<div class="border detail">
<table class="table table-bordered" style="margin-bottom:0;">
<thead>
<tr>
<th v-if="marginTemplate.UnderlyingSeperateType == @((int)UnderlyingSeperateTypeEnum.CustomInstrumentType)">标的资产类型</th>
<th style="width:120px;">期限档位</th>
<th style="width:80px;">操作</th>
</tr>
</thead>
<tbody>
<tr v-for="row in ruleRangeDetailRows" v-bind:key="row.index">
<td v-if="marginTemplate.UnderlyingSeperateType == @((int)UnderlyingSeperateTypeEnum.CustomInstrumentType) && row.rowspan > 0" v-bind:rowspan="row.rowspan" style="vertical-align:middle;">
@*chosen 选中变化通过 jQuery trigger("change") 通知(chosen.jquery.js trigger_form_field_change),
Vue 的 v-on:change(原生监听)收不到,改由 JS 内 jQuery 委托监听(见 marginTemplateV2DefaultEdit.js 底部)*@
<select class="chosen-select" :id="'UnderlyingType'+row.index" multiple>
<option value="16" :selected="(row.detail.UnderlyingType & 16)>0?true:false">利率债</option>
<option value="32" :selected="(row.detail.UnderlyingType & 32)>0?true:false">信用债</option>
<option value="64" :selected="(row.detail.UnderlyingType & 64)>0?true:false">其它债券</option>
<option value="128" :selected="(row.detail.UnderlyingType & 128)>0?true:false">股票</option>
<option value="256" :selected="(row.detail.UnderlyingType & 256)>0?true:false">股指</option>
<option value="512" :selected="(row.detail.UnderlyingType & 512)>0?true:false">股指期货</option>
<option value="1024" :selected="(row.detail.UnderlyingType & 1024)>0?true:false">商品期货</option>
<option value="2048" :selected="(row.detail.UnderlyingType & 2048)>0?true:false">商品现货</option>
<option value="4096" :selected="(row.detail.UnderlyingType & 4096)>0?true:false">新三板挂牌股票</option>
<option value="8192" :selected="(row.detail.UnderlyingType & 8192)>0?true:false">香港股票</option>
<option value="16384" :selected="(row.detail.UnderlyingType & 16384)>0?true:false">香港股指</option>
<option value="32768" :selected="(row.detail.UnderlyingType & 32768)>0?true:false">基金及基金专户</option>
<option value="65536" :selected="(row.detail.UnderlyingType & 65536)>0?true:false">黄金期货</option>
<option value="131072" :selected="(row.detail.UnderlyingType & 131072)>0?true:false">国债期货</option>
<option value="262144" :selected="(row.detail.UnderlyingType & 262144)>0?true:false">其他期货</option>
<option value="524288" :selected="(row.detail.UnderlyingType & 524288)>0?true:false">黄金现货</option>
<option value="1048576" :selected="(row.detail.UnderlyingType & 1048576)>0?true:false">其他现货</option>
<option value="2097152" :selected="(row.detail.UnderlyingType & 2097152)>0?true:false">境外期货</option>
<option value="4194304" :selected="(row.detail.UnderlyingType & 4194304)>0?true:false">境外现货</option>
<option value="8388608" :selected="(row.detail.UnderlyingType & 8388608)>0?true:false">境外股票</option>
<option value="16777216" :selected="(row.detail.UnderlyingType & 16777216)>0?true:false">境外股指</option>
<option value="33554432" :selected="(row.detail.UnderlyingType & 33554432)>0?true:false">汇率</option>
<option value="67108864" :selected="(row.detail.UnderlyingType & 67108864)>0?true:false">Shibor</option>
<option value="134217728" :selected="(row.detail.UnderlyingType & 134217728)>0?true:false">银行间回购定盘</option>
<option value="268435456" :selected="(row.detail.UnderlyingType & 268435456)>0?true:false">利率收益率</option>
<option value="536870912" :selected="(row.detail.UnderlyingType & 536870912)>0?true:false">债券指数</option>
</select>
</td>
@*期限档由区块结构固定承载(纯利率债区块固定4档、其他区块为空=全部),只读展示不再下拉选择*@
<td>{{bondTermLabel(row.detail)}}</td>
<td v-if="row.rowspan > 0" v-bind:rowspan="row.rowspan" style="vertical-align:middle;"><button class="delBtn" type="button" v-on:click="deleteDetail(row.index)">- 删除区块</button></td>
</tr>
</tbody>
</table>
</div>
@*规则15区间追保录入(客户原型全量手工录入,资产类型区块式):纯利率债区块固定展开4个期限档、每档一套参数;其他资产类型区块一套参数、无期限档;x/y 字段保留兼容存量数据*@
<div v-for="blk in ruleRangeBlocks" v-bind:key="'spanblk'+blk.key" class="border spanBlk" style="padding:6px 10px; margin-top:10px;">
<p style="margin:4px 0; font-weight:bold;">
参数组{{blk.no}}<span v-if="marginTemplate.UnderlyingSeperateType == @((int)UnderlyingSeperateTypeEnum.CustomInstrumentType)">资产类型:{{underlyingTypeNames(blk.ut)}}</span>
@*ETF 子类(仅纯基金区块展示):选 可转债ETF/科创债ETF 分期限档(展开4档),其他子类/不区分不分档*@
<span v-if="blk.isFundBlock"> ETF 子类:<select v-model="blk.sections[0].detail.SpanConfig.EtfKind" v-on:change="onEtfKindChange(blk)"><option value="">不区分</option><option v-for="it in etfSubtypeItems" v-bind:value="it">{{it}}</option></select></span>
<span v-if="blk.isTBond">(按期限分档:≤5y、(5y-10y]、(10y-30y]、&gt;30y,每个档位独立设置)</span>
</p>
<div v-for="sec in blk.sections" v-bind:key="sec.key">
<p v-if="blk.isTBond" style="margin:8px 0 2px; font-weight:bold;">期限档位:{{sec.termLabel}}</p>
<template v-if="sec.detail && sec.detail.SpanConfig">
<p style="margin:4px 0;">
预警线:<vue-number-input v-model="sec.detail.SpanConfig.WarnLine" v-bind:format="inputFormatPercent"></vue-number-input>
 平仓线:<vue-number-input v-model="sec.detail.SpanConfig.CloseLine" v-bind:format="inputFormatPercent"></vue-number-input>
</p>
<p style="margin:4px 0;">多头方向(客户看多)</p>
<table class="table table-bordered" style="margin-bottom:6px;">
<thead>
<tr><th>追保价格区间</th><th>追保金额</th></tr>
</thead>
<tbody>
<tr v-for="(tier, ti) in sec.detail.SpanConfig.LongSpans" v-bind:key="'long'+ti">
<td>
<template v-if="ti === 0">
<vue-number-input v-model="tier.Lower" v-bind:format="inputFormatPercent"></vue-number-input> × {{spanText(sec.detail).priceInit}} ≤ {{spanText(sec.detail).priceCur}}
</template>
<template v-else>
<vue-number-input v-model="tier.Lower" v-bind:format="inputFormatPercent"></vue-number-input> × {{spanText(sec.detail).priceInit}} ≤ {{spanText(sec.detail).priceCur}} &lt; <vue-number-input v-model="tier.Upper" v-bind:format="inputFormatPercent"></vue-number-input> × {{spanText(sec.detail).priceInit}}
</template>
</td>
<td>
<vue-number-input v-model="tier.AmountRate" v-bind:format="inputFormatPercent"></vue-number-input> × {{spanText(sec.detail).amountBase}}
</td>
</tr>
</tbody>
</table>
<p style="margin:4px 0;">空头方向(客户看空)</p>
<table class="table table-bordered" style="margin-bottom:0;">
<thead>
<tr><th>追保价格区间</th><th>追保金额</th></tr>
</thead>
<tbody>
<tr v-for="(tier, ti) in sec.detail.SpanConfig.ShortSpans" v-bind:key="'short'+ti">
<td>
<template v-if="ti === 0">
{{spanText(sec.detail).priceCurShort1}} ≤ <vue-number-input v-model="tier.Upper" v-bind:format="inputFormatPercent"></vue-number-input> × {{spanText(sec.detail).priceInit}}
</template>
<template v-else>
<vue-number-input v-model="tier.Lower" v-bind:format="inputFormatPercent"></vue-number-input> × {{spanText(sec.detail).priceInit}} &lt; {{spanText(sec.detail).priceCurShort}} ≤ <vue-number-input v-model="tier.Upper" v-bind:format="inputFormatPercent"></vue-number-input> × {{spanText(sec.detail).priceInit}}
</template>
</td>
<td>
<vue-number-input v-model="tier.AmountRate" v-bind:format="inputFormatPercent"></vue-number-input> × {{spanText(sec.detail).amountBase}}
</td>
</tr>
</tbody>
</table>
</template>
</div>
</div>
</template>
<template v-for="(detail,index) in marginTemplate.Details">
<div class="border detail" v-show="marginTemplate.RuleType != @((int)MarginRuleTypeEnum.区间追保结构)">
<div class="row no-gutters">
<div class="col">
<template v-if="marginTemplate.RuleType == @((int)MarginRuleTypeEnum.按固定利率) || marginTemplate.RuleType == @((int)MarginRuleTypeEnum.按浮动盈亏)">
<div class="form-group" v-show="marginTemplate.UnderlyingSeperateType == @((int)UnderlyingSeperateTypeEnum.CustomStock) && marginTemplate.RuleType == @((int)MarginRuleTypeEnum.按固定利率)">
<label class="formlabel">当标的分类为</label>
<select class="chosen-select" :id="'UnderlyingType'+index" multiple>
<option value="1" :selected="(detail.UnderlyingType & 1)>0?true:false">指数</option>
<option value="2" :selected="(detail.UnderlyingType & 2)>0?true:false">个股/ETF-核准制发行</option>
<option value="4" :selected="(detail.UnderlyingType & 4)>0?true:false">个股/ETF-非核准制发行</option>
<option value="8" :selected="(detail.UnderlyingType & 8)>0?true:false">其他</option>
</select> 时,
</div>
<div class="form-group">
<label class="formlabel">持仓预付金率</label>
<vue-number-input v-model="detail.MarginRatio2" v-bind:format="inputFormatPercent"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">是否使用持仓名义本金</label>
<select v-model="detail.UsePositionStockEqvNotional">
<option value="false">否</option>
<option value="true">是</option>
</select>
</div>
</template>
<template v-if="marginTemplate.RuleType == @((int)MarginRuleTypeEnum.类香草预付金规则)">
<div class="form-group">
<label class="formlabel">初始预付金率</label>
<vue-number-input v-model="detail.MarginRatio1" v-bind:format="inputFormatPercent"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">临时预付金率1</label>
<vue-number-input v-model="detail.MarginRatio2" v-bind:format="inputFormatPercent"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">临时预付金率2</label>
<vue-number-input v-model="detail.MarginRatio3" v-bind:format="inputFormatPercent"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">临时预付金率3</label>
<vue-number-input v-model="detail.MarginRatio4" v-bind:format="inputFormatPercent"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">是否内含价值</label>
<select v-model="detail.IsIntrinsicValue">
<option value="false">否</option>
<option value="true">是</option>
</select>
</div>
<div class="form-group">
<label class="formlabel">组合预付金率</label>
<vue-number-input v-model="detail.GroupRatio" v-bind:format="inputFormatPercent"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">总名义本金</label>
<vue-number-input v-model="detail.StockEqvNotional"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">单一标的持仓名义本金</label>
<vue-number-input v-model="detail.SingleStockEqvNotional"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">持仓标的分散程度</label>
<vue-number-input v-model="detail.PositionUnderlyingAmount"></vue-number-input>
</div>
</template>
<template v-if="marginTemplate.RuleType == @((int)MarginRuleTypeEnum.触发条件预付金规则1) || marginTemplate.RuleType == @((int)MarginRuleTypeEnum.触发条件预付金规则2)">
<div class="form-group">
<label class="formlabel">初始预付金率</label>
<vue-number-input v-model="detail.MarginRatio1" v-bind:format="inputFormatPercent"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">维持预付金率</label>
<vue-number-input v-model="detail.MarginRatio2" v-bind:format="inputFormatPercent"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">触发追保跌幅</label>
<vue-number-input v-model="detail.RedeemPriceLimit" v-bind:format="inputFormatPercent"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">是否使用行权价</label>
<select v-model="detail.IsUseStrike">
<option value="false">否</option>
<option value="true">是</option>
</select>
</div>
<div class="form-group">
<label class="formlabel">最大跌幅限制</label>
<vue-number-input v-model="detail.RedeemPriceMax" v-bind:format="inputFormatPercent"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">持仓标的分散程度</label>
<vue-number-input v-model="detail.PositionUnderlyingAmount"></vue-number-input>
</div>
</template>
<template v-if="marginTemplate.RuleType == @((int)MarginRuleTypeEnum.触发条件预付金规则3)">
<div class="form-group">
<label class="formlabel">预付金比率</label>
<vue-number-input v-model="detail.MarginRatio1" v-bind:format="inputFormatPercent"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">持仓预付金比率</label>
<vue-number-input v-model="detail.MarginRatio3" v-bind:format="inputFormatPercent"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">是否使用持仓名义本金</label>
<select v-model="detail.UsePositionStockEqvNotional">
<option value="false">否</option>
<option value="true">是</option>
</select>
</div>
<div class="form-group">
<label class="formlabel">涨跌幅类型</label>
<select v-model="detail.PriceLimitType">
<option value="0">跌幅</option>
<option value="1">涨幅</option>
</select>
</div>
<div class="form-group">
<label class="formlabel">触发追保比例</label>
<vue-number-input v-model="detail.RedeemPriceLimit" v-bind:format="inputFormatPercent"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">是否使用行权价</label>
<select v-model="detail.IsUseStrike">
<option value="false">否</option>
<option value="true">是</option>
</select>
</div>
<div class="form-group">
<label class="formlabel">最大涨跌幅限制</label>
<vue-number-input v-model="detail.RedeemPriceMax" v-bind:format="inputFormatPercent"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">追加比例</label>
<vue-number-input v-model="detail.MarginRatio2" v-bind:format="inputFormatPercent"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">持仓标的分散程度</label>
<vue-number-input v-model="detail.PositionUnderlyingAmount"></vue-number-input>
</div>
</template>
<template v-if="marginTemplate.RuleType == @((int)MarginRuleTypeEnum.标准SPAN)">
<div class="form-group" v-show="marginTemplate.UnderlyingSeperateType == @((int)UnderlyingSeperateTypeEnum.CustomStock)">
<label class="formlabel">当标的分类为</label>
<select class="chosen-select" :id="'UnderlyingType'+index" multiple>
<option value="1" :selected="(detail.UnderlyingType & 1)>0?true:false">指数</option>
<option value="2" :selected="(detail.UnderlyingType & 2)>0?true:false">个股/ETF-核准制发行</option>
<option value="4" :selected="(detail.UnderlyingType & 4)>0?true:false">个股/ETF-非核准制发行</option>
<option value="8" :selected="(detail.UnderlyingType & 8)>0?true:false">其他</option>
</select> 时,
</div>
<div class="form-group">
<label class="formlabel">标的价格变化幅度a</label>
<select v-model="detail.IsUsePriceLimit">
<option value="true">单日标的涨跌幅配置</option>
<option value="false">无</option>
</select> * <vue-number-input v-model="detail.MarginRatio1" v-bind:format="inputFormatPercent"></vue-number-input> * St
</div>
<div class="form-group">
<label class="formlabel">标的波动率变化幅度b</label>
<vue-number-input v-model="detail.MarginRatio2" v-bind:format="inputFormatPercent"></vue-number-input>
</div>
<div class="form-group">
<div style="margin-left: 25px;">
当计算维持预付金时,最后与初始预付金的 <vue-number-input v-model="detail.ComparedInitialMarginRate" v-bind:format="inputFormatPercentNegative"></vue-number-input> 取较大值。
</div>
</div>
</template>
<template v-if="marginTemplate.RuleType == @((int)MarginRuleTypeEnum.买入自动赎回规则1) || marginTemplate.RuleType == @((int)MarginRuleTypeEnum.卖出自动赎回规则1)">
<div class="form-group" v-show="marginTemplate.UnderlyingSeperateType == @((int)UnderlyingSeperateTypeEnum.CustomStock) && marginTemplate.RuleType == @((int)MarginRuleTypeEnum.卖出自动赎回规则1)">
<label class="formlabel">当标的分类为</label>
<select class="chosen-select" :id="'UnderlyingType'+index" multiple>
<option value="1" :selected="(detail.UnderlyingType & 1)>0?true:false">指数</option>
<option value="2" :selected="(detail.UnderlyingType & 2)>0?true:false">个股/ETF-核准制发行</option>
<option value="4" :selected="(detail.UnderlyingType & 4)>0?true:false">个股/ETF-非核准制发行</option>
<option value="8" :selected="(detail.UnderlyingType & 8)>0?true:false">其他</option>
</select> 时,
</div>
<div class="form-group">
<label class="formlabel">x</label>
<vue-number-input v-model="detail.MarginRatio1" v-bind:format="marginTemplate.RuleType == @((int)MarginRuleTypeEnum.买入自动赎回规则1) ? inputFormatNegative : inputFormatPercentNegative"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">y</label>
<vue-number-input v-model="detail.MarginRatio2" v-bind:format="marginTemplate.RuleType == @((int)MarginRuleTypeEnum.买入自动赎回规则1) ? inputFormatNegative : inputFormatPercentNegative"></vue-number-input>
</div>
<div class="form-group">
<label class="formlabel">是否取与保底金额孰小</label>
<select v-model="detail.IsNeedCompare">
<option value="false">否</option>
<option value="true">是</option>
</select>
</div>
<div class="form-group">
<div style="margin-left: 25px;">
当计算维持预付金时,最后与初始预付金的 <vue-number-input v-model="detail.ComparedInitialMarginRate" v-bind:format="inputFormatPercentNegative"></vue-number-input> 取较大值。
</div>
</div>
</template>
</div>
<div class="col-auto" v-show="index + 1 == marginTemplate.Details.length">
<button class="delBtn" v-show="marginTemplate.UnderlyingSeperateType == @((int)UnderlyingSeperateTypeEnum.CustomStock) || marginTemplate.UnderlyingSeperateType == @((int)UnderlyingSeperateTypeEnum.CustomInstrumentType) || marginTemplate.RuleType == @((int)MarginRuleTypeEnum.区间追保结构)" v-on:click="deleteDetail(index)">- 删除</button>
</div>
</div>
</div>
</template>
<button class="addBtn" v-show="marginTemplate.UnderlyingSeperateType == @((int)UnderlyingSeperateTypeEnum.CustomStock) || marginTemplate.UnderlyingSeperateType == @((int)UnderlyingSeperateTypeEnum.CustomInstrumentType) || marginTemplate.RuleType == @((int)MarginRuleTypeEnum.区间追保结构)" v-on:click="addDetail()" v-bind:disabled="marginTemplate.RuleType == @((int)MarginRuleTypeEnum.无预付金) || marginTemplate.RuleType == @((int)MarginRuleTypeEnum.自动赎回买入预付金规则) || marginTemplate.RuleType == @((int)MarginRuleTypeEnum.保底预付金规则) || marginTemplate.RuleType == @((int)MarginRuleTypeEnum.含赔付预付金计算规则)">+ 新增参数组</button>
</div>
</div>
<div class="form-buttons">
<button class="btn btn-primary" type="button" v-on:click="saveMarginTemplateV2(false)">保存</button>
<button class="btn btn-primary" type="button" onclick="layer.closeMe()">关闭</button>
</div>
</form>