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)