diff --git a/YLErpWeb/Views/client_margin_template/client_margin_templateList.cshtml b/YLErpWeb/Views/client_margin_template/client_margin_templateList.cshtml
index ef88d0d7..404a6f6f 100644
--- a/YLErpWeb/Views/client_margin_template/client_margin_templateList.cshtml
+++ b/YLErpWeb/Views/client_margin_template/client_margin_templateList.cshtml
@@ -1,6 +1,6 @@
@using YLErp.Enums;
@{
- ViewBag.Title = "预付金模板V2";
+ ViewBag.Title = "预付金模板";
ViewBag.Menu = "数据管理-预付金模板V2";
Layout = "~/Views/Shared/_MainLayout.cshtml";
}
@@ -70,7 +70,7 @@
function setClientMarginTemplate(id) {
var editurl = "/client_margin_template/client_margin_templateEdit/?id=" + id;
- main.infopage("设置客户预付金", editurl, { area: ['1480px', '800px'] });
+ main.infopage(id ? "编辑客户预付金绑定" : "新增客户预付金绑定", editurl, { area: ['1480px', '800px'] });
}
function deleteClientMarginTemplate(id) {
diff --git a/YLErpWeb/Views/credit/creditEdit.cshtml b/YLErpWeb/Views/credit/creditEdit.cshtml
index 9ff43b13..b074c6a7 100644
--- a/YLErpWeb/Views/credit/creditEdit.cshtml
+++ b/YLErpWeb/Views/credit/creditEdit.cshtml
@@ -60,6 +60,14 @@
changeFormCredit(Number(moneytemp).toFixed(2) + "");
}
+ //授信可用比例默认填1;授信额度置灰,按 原始授信值×最大授信可用比例 联动计算
+ if (!$("#MaxCreditUseRatio").val()) {
+ $("#MaxCreditUseRatio").val("1");
+ }
+ $("#OriginalCredit").on("input change", calcCreditByRatio);
+ $("#MaxCreditUseRatio").on("input change", calcCreditByRatio);
+ calcCreditByRatio();
+
//$('#Credit').keyup(function () {
// changePrice();
//});
@@ -134,6 +142,19 @@
}
}
+ //授信额度 = 原始授信值 × 最大授信可用比例(空白按1);原始授信值为空时不折算,保留原授信额度
+ function calcCreditByRatio() {
+ var original = $("#OriginalCredit").val();
+ if (original == null || original == "") {
+ return;
+ }
+ var ratio = $("#MaxCreditUseRatio").val();
+ var money = (Number(original.replace(/,/g, "")) * (ratio == "" ? 1 : Number(ratio))).toFixed(2);
+ $("#Credit").val(money);
+ $("#CreditVal").val(money);
+ changeFormCredit(money);
+ }
+
function checkSubmitData() {
var pass = $('#creditEditForm').valid();
if (pass) {
@@ -416,11 +437,11 @@
}
- @Html.MyDecimalFor(model => model.Credit, new { onfocus = "moneyOnFocus()", onblur = "this.value=cc(this.value);" }, !pageObj.UseClientStockEqvNotional)
+ @Html.MyDecimalFor(model => model.Credit, new { @readonly = "readonly", style = "background-color:#eee;" }, !pageObj.UseClientStockEqvNotional)
@Html.MyDecimalFor(model => model.OriginalCredit, new { onfocus = "moneyOnFocusOriginalCredit()", onblur = "this.value=cc(this.value);" }, required: false)
@Html.MyDecimalFor(model => model.MaxCreditUseRatio, required: false)
-
注:填写原始授信值后,授信额度将按"原始授信值×最大授信可用比例(空白按1)"自动计算.
+
注:授信额度按"原始授信值×最大授信可用比例(默认1)"自动计算,无需填写;原始授信值为空时不折算,保留原授信额度.
@if (PS.Config.Company == CompanyEnum.中金)
{
@Html.MyDecimalFor(model => model.PFECredit, new { onkeyup = "changePFECredit()", onfocus = "pfeCreditOnFocus()", onblur = "this.value=cc(this.value);" }, true)
diff --git a/YLErpWeb/Views/margin_template_v2/margin_template_v2ClientList.cshtml b/YLErpWeb/Views/margin_template_v2/margin_template_v2ClientList.cshtml
index 7e0e4226..75ada014 100644
--- a/YLErpWeb/Views/margin_template_v2/margin_template_v2ClientList.cshtml
+++ b/YLErpWeb/Views/margin_template_v2/margin_template_v2ClientList.cshtml
@@ -1,5 +1,5 @@
@{
- ViewBag.Title = "预付金模板V2";
+ ViewBag.Title = "预付金模板";
ViewBag.Menu = "数据管理-预付金模板V2";
Layout = "~/Views/Shared/_MainLayout.cshtml";
}
@@ -119,13 +119,13 @@
if (id) {
editurl = "/margin_template_v2/margin_template_v2ClientEdit/?enid=" + id;
}
- main.infopage("编辑默认预付金模板", editurl, { area: ['1480px', '800px'] });
+ main.infopage(id ? "编辑客户预付金模板" : "新增客户预付金模板", editurl, { area: ['1480px', '800px'] });
}
function startCopymargin_template_v2(id) {
var editurl = "/margin_template_v2/margin_template_v2ClientCopy/?enid=" + id;
- main.infopage("复制默认预付金模板", editurl, { area: ['1480px', '800px'] });
+ main.infopage("复制客户预付金模板", editurl, { area: ['1480px', '800px'] });
}
function deleteEditmargin_template_v2(id) {
diff --git a/YLErpWeb/Views/margin_template_v2/margin_template_v2DefaultList.cshtml b/YLErpWeb/Views/margin_template_v2/margin_template_v2DefaultList.cshtml
index 9f183439..721b3347 100644
--- a/YLErpWeb/Views/margin_template_v2/margin_template_v2DefaultList.cshtml
+++ b/YLErpWeb/Views/margin_template_v2/margin_template_v2DefaultList.cshtml
@@ -1,5 +1,5 @@
@{
- ViewBag.Title = "预付金模板V2";
+ ViewBag.Title = "预付金模板";
ViewBag.Menu = "数据管理-预付金模板V2";
Layout = "~/Views/Shared/_MainLayout.cshtml";
}
@@ -127,12 +127,12 @@
if (id) {
editurl = "/margin_template_v2/margin_template_v2DefaultEdit/?enid=" + id;
}
- main.infopage("编辑默认预付金模板", editurl, { area: ['1480px', '800px'] });
+ main.infopage(id ? "编辑全局预付金模板" : "新增全局预付金模板", editurl, { area: ['1480px', '800px'] });
}
function startCopymargin_template_v2(id) {
editurl = "/margin_template_v2/margin_template_v2DefaultCopy/?enid=" + id;
- main.infopage("复制默认预付金模板", editurl, { area: ['1480px', '800px'] });
+ main.infopage("复制全局预付金模板", editurl, { area: ['1480px', '800px'] });
}
function deleteEditmargin_template_v2(id) {
diff --git a/YLErpWeb/Views/margin_template_v2/margin_template_v2List.cshtml b/YLErpWeb/Views/margin_template_v2/margin_template_v2List.cshtml
index 24eb54e4..410f8990 100644
--- a/YLErpWeb/Views/margin_template_v2/margin_template_v2List.cshtml
+++ b/YLErpWeb/Views/margin_template_v2/margin_template_v2List.cshtml
@@ -1,6 +1,6 @@
@using YLErp.Enums;
@{
- ViewBag.Title = "预付金模板V2";
+ ViewBag.Title = "预付金模板";
ViewBag.Menu = "数据管理-预付金模板V2";
Layout = "~/Views/Shared/_MainLayout.cshtml";
}
@@ -134,13 +134,13 @@
if (id) {
editurl = "/margin_template_v2/margin_template_v2Edit/?enid=" + id;
}
- main.infopage("编辑预付金模板", editurl, { area: ['1180px', '92%'] });
+ main.infopage(id ? "编辑自定义预付金模板" : "新增自定义预付金模板", editurl, { area: ['1180px', '92%'] });
}
function startCopymargin_template_v2(id) {
editurl = "/margin_template_v2/margin_template_v2Copy/?enid=" + id;
- main.infopage("复制预付金模板", editurl, { area: ['1180px', '92%'] });
+ main.infopage("复制自定义预付金模板", editurl, { area: ['1180px', '92%'] });
}
function startDeletemargin_template_v2(id) {
diff --git a/YLErpWeb/appsettings.local.json b/YLErpWeb/appsettings.local.json
index e2956912..a7fb2c4f 100644
--- a/YLErpWeb/appsettings.local.json
+++ b/YLErpWeb/appsettings.local.json
@@ -10,7 +10,8 @@
"ylcms": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=glms_yltrs_ylcms;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;",
"yladmin": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=glms_yltrs_admin;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;",
"ylclient": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=glms_yltrs_client;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;",
- "bondoms": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=glms_bond_oms;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;"
+ "bondoms": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=glms_bond_oms;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;",
+ "bigdata": "server=192.168.2.96;uid=DBAdmin;pooling=true;port=3306;pwd=YieldChain$$2025;database=glms_bigdata;charset=utf8;Allow User Variables=True;SslMode=none;Connection Timeout=30;IgnoreCommandTransaction=true;"
},
"AppSettings": {
"VirtualPathRoot": "",
diff --git a/YLErpWeb/wwwroot/Scripts/app/client/clientMarginTemplateEdit.js b/YLErpWeb/wwwroot/Scripts/app/client/clientMarginTemplateEdit.js
index 357c5756..ed41b441 100644
--- a/YLErpWeb/wwwroot/Scripts/app/client/clientMarginTemplateEdit.js
+++ b/YLErpWeb/wwwroot/Scripts/app/client/clientMarginTemplateEdit.js
@@ -3,6 +3,21 @@ const inputFormatPercent = Object.freeze({ precision: 2, append: '%' });
const inputFormatPercentNegative = Object.freeze({ precision: 2, append: '%', negative: true });
const inputFormatNegative = Object.freeze({ precision: 2, negative: true });
+//区间追保结构(RuleType=15)只读回显用常量,与 marginTemplateV2Edit.js 保持一致
+const RangeMarginRuleType = 15;
+//允许配期限档(SpanConfig.BondTerm)的资产类型掩码,本期仅利率债
+const TermTierEnabledUnderlyingMask = 16;
+//利率债区块固定展开的4个期限档([BondTerm值, 展示文案])
+const SpanBondTerms = [['<5y', '≤5y'], ['5y-10y', '(5y-10y]'], ['10y-30y', '(10y-30y]'], ['>30y', '>30y']];
+//标的资产类型标志位 -> 名称(与 marginTemplateV2Edit 的录入区块标题一致)
+const UnderlyingTypeNames = [
+ [16, "利率债"], [32, "信用债"], [64, "其它债券"], [128, "股票"], [256, "股指"], [512, "股指期货"],
+ [1024, "商品期货"], [2048, "商品现货"], [4096, "新三板挂牌股票"], [8192, "香港股票"], [16384, "香港股指"],
+ [32768, "基金及基金专户"], [65536, "黄金期货"], [131072, "国债期货"], [262144, "其他期货"], [524288, "黄金现货"],
+ [1048576, "其他现货"], [2097152, "境外期货"], [4194304, "境外现货"], [8388608, "境外股票"], [16777216, "境外股指"],
+ [33554432, "汇率"], [67108864, "Shibor"], [134217728, "银行间回购定盘"], [268435456, "利率收益率"], [536870912, "债券指数"]
+];
+
const vue = new Vue({
el: '#marginTemplateV2Form',
data: {
@@ -10,14 +25,92 @@ const vue = new Vue({
marginTemplates: page.marginTemplates,
marginTemplate: page.marginTemplate,
clientNames: [],
- //新增模式的客户多选(编辑模式仍为单条绑定,走 clientMarginTemplate.ClientId)
- selectedClientIds: [],
isAdd: page.isAdd
},
created: function () {
this.clientMarginTemplate.ValueDate = new moment(this.clientMarginTemplate.ValueDate).format("YYYY-MM-DD");
},
+ computed: {
+ //区间追保结构只读参数组:连续利率债行归一个区块、按固定4档对位(缺档不补造、同档重复/异常档独立成段保留展示);
+ //其余行(含ETF子类行)每行独立成块——分组口径与 marginTemplateV2Edit.rebuildSpanBlocks 一致,但只回显不新增行
+ ruleRangeBlocks() {
+ if (this.marginTemplate.RuleType != RangeMarginRuleType) return [];
+ var details = this.marginTemplate.Details || [];
+ var that = this;
+ var blocks = [];
+ var i = 0;
+ while (i < details.length) {
+ if ((details[i].UnderlyingType || 0) === TermTierEnabledUnderlyingMask) {
+ var j = i;
+ while (j < details.length && (details[j].UnderlyingType || 0) === TermTierEnabledUnderlyingMask) j++;
+ var byTerm = {};
+ var extras = [];
+ for (var k = i; k < j; k++) {
+ var bt = (details[k].SpanConfig && details[k].SpanConfig.BondTerm) || '';
+ var canonical = SpanBondTerms.some(function (t) { return t[0] === bt; });
+ if (canonical && !byTerm[bt]) byTerm[bt] = details[k]; else extras.push(details[k]);
+ }
+ var sections = SpanBondTerms.map(function (t) {
+ return { key: 't' + t[0], termLabel: t[1], detail: byTerm[t[0]] || null };
+ });
+ extras.forEach(function (r, xi) {
+ sections.push({ key: 'x' + xi, termLabel: that.bondTermLabel(r), detail: r });
+ });
+ blocks.push({ key: 'i' + i, no: blocks.length + 1, ut: TermTierEnabledUnderlyingMask, isTBond: true, etfKind: '', sections: sections });
+ i = j;
+ } else {
+ var d = details[i];
+ blocks.push({
+ key: 'i' + i, no: blocks.length + 1, ut: d.UnderlyingType || 0, isTBond: false,
+ etfKind: (d.SpanConfig && d.SpanConfig.EtfKind) || '',
+ sections: [{ key: 'single', termLabel: '', detail: d }]
+ });
+ i++;
+ }
+ }
+ return blocks;
+ }
+ },
methods: {
+ //资产类型标志位掩码 -> 名称(0=全部),与 marginTemplateV2Edit.underlyingTypeNames 一致
+ underlyingTypeNames(mask) {
+ mask = parseInt(mask) || 0;
+ if (mask === 0) return "全部";
+ var names = [];
+ for (var i = 0; i < UnderlyingTypeNames.length; i++) {
+ if ((mask & UnderlyingTypeNames[i][0]) > 0) names.push(UnderlyingTypeNames[i][1]);
+ }
+ return names.length > 0 ? names.join("、") : "全部";
+ },
+ //期限档 BondTerm -> 展示文案(空=全部)
+ bondTermLabel(detail) {
+ var v = (detail.SpanConfig && detail.SpanConfig.BondTerm) || '';
+ var map = { '': '全部', '<5y': '≤5y', '5y-10y': '(5y-10y]', '10y-30y': '(10y-30y]', '>30y': '>30y' };
+ return map[v] !== undefined ? map[v] : v;
+ },
+ //区间计价口径文案:按 detail 资产类型切换,与取数侧对齐(债券类=中债估值净价/期初全价×券面总额,其余=收盘价口径),
+ //直接沿用 marginTemplateV2Edit.spanText 的判定
+ spanText(detail) {
+ var ut = (detail && detail.UnderlyingType) || 0;
+ var bondMask = 16 | 32 | 64;
+ var isBond = ut !== 0 && (ut & ~bondMask) === 0;
+ if (!isBond) {
+ return {
+ priceInit: '参考标的期初净价',
+ priceCur: '参考标的当前收盘价',
+ priceCurShort1: '参考标的当前收盘价',
+ priceCurShort: '参考标的当前收盘价',
+ amountBase: '参考标的期初价格 × 参考标的名义份额'
+ };
+ }
+ return {
+ priceInit: '期初净价',
+ priceCur: '当前净价',
+ priceCurShort1: '当前净价',
+ priceCurShort: '当前净价',
+ amountBase: '期初全价 × 券面总额'
+ };
+ },
changeMarginTemplate() {
this.marginTemplates.forEach(x => {
if (this.clientMarginTemplate.MarginTemplateId === x.id) {
@@ -32,7 +125,12 @@ const vue = new Vue({
//当前内容上供修正重试(已成功的客户重试会因同天同结构互斥校验失败,不会重复入库)
saveMarginTemplateV2() {
var thisObj = this;
- var ids = this.isAdd ? (this.selectedClientIds || []) : [this.clientMarginTemplate.ClientId];
+ //取值直接读控件(与兄弟页面读 chosen 的 $("#tradeTypes").val() 一致,不依赖 v-model 同步):
+ //新增=多选控件 val()(数组);编辑=表单对象上的原绑定客户
+ var chosenVal = this.isAdd ? $("#ClientId").val() : this.clientMarginTemplate.ClientId;
+ var ids = this.isAdd
+ ? (Array.isArray(chosenVal) ? chosenVal : (chosenVal ? [chosenVal] : []))
+ : [chosenVal];
if (!ids.length) {
main.message("请至少选择一个客户");
return;
diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeEdit.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeEdit.js
index 4934a0fe..1eb7edb3 100644
--- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeEdit.js
+++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeEdit.js
@@ -1968,6 +1968,8 @@ function __init(vue) {
let clientId = page.Trade.ClientId;
let client = clientId ? consClients.find(x => x.id === clientId) : null;
!client && page.isAdd && (client = consClients[0]);
+ //setData 只写控件显示值、不触发 onSelect 回写 v-model——新增时默认客户须显式回写,否则 trade.ClientId 为空、保存报"请设置交易对手方"
+ client && page.isAdd && vue.changeClient(client);
autoClient.setData(client);
_getMainProtocolCode(client);
}
diff --git a/YLErpWeb/wwwroot/Scripts/app/trade/swapTradeEdit.js b/YLErpWeb/wwwroot/Scripts/app/trade/swapTradeEdit.js
index 0ad5dc9e..8482a44d 100644
--- a/YLErpWeb/wwwroot/Scripts/app/trade/swapTradeEdit.js
+++ b/YLErpWeb/wwwroot/Scripts/app/trade/swapTradeEdit.js
@@ -1185,6 +1185,8 @@ function __init(vue) {
let clientId = page.Trade.ClientId;
let client = clientId ? consClients.find(x => x.id === clientId) : null;
!client && page.IsNew && (client = consClients[0]);
+ //setData 只写控件显示值、不触发 onSelect 回写 v-model——新增时默认客户须显式回写,否则 trade.ClientId 为空、保存报"请设置交易对手方"
+ client && page.IsNew && (vue.trade.ClientId = client.id);
autoClient.setData(client);
_getMainProtocolCode(client);
}