Files
zszq-trs/YLErpWeb/Views/credit_rating/credit_ratingEdit.cshtml
T
2024-05-09 14:06:26 +08:00

86 lines
3.3 KiB
Plaintext

@model CreditRating
@{
ViewBag.Title = "资信等级 | 编辑";
Layout = "~/Views/Shared/_InfoLayout.cshtml";
}
<style>
#IsUnLimited { width: 15px }
.text-box { width: 265px; }
</style>
@section JS
{
<script type="text/javascript">
var submitclick_credit_rating = false;
$(function () {
SetAceDropDown(false);
$("#IsUnLimited").on("click", setCreditLine);
if ($("#IsUnLimited").prop("checked")) {
$("#CreditLine").val("不适用").prop("disabled", true);
}
});
function setCreditLine() {
if ($("#IsUnLimited").prop("checked")) {
$("#CreditLine").val("不适用").prop("disabled", true);
} else {
$("#CreditLine").val("").prop("disabled",false);
}
}
function checkSubmitData() {
var pass = $('#credit_ratingEditForm').valid();
if (!$("#IsUnLimited").prop("checked")) {
if ($("#CreditLine").val() === "") {
$("#CreditLine").val(0);
}
if (parseFloat($("#CreditLine").val()) < 0) {
main.message("授信额度不能为负数");
pass = false;
}
} else {
$("#IsUnLimited").val(1);
}
return pass;
}
function savecredit_rating() {
if (!checkSubmitData()) return false;
var data = $("#credit_ratingEditForm").serialize();
main.post("/credit_rating/credit_ratingEditJson", data).done(function (res) {
window.location.href = "/credit_rating/credit_ratingview?enid=" + res.obj.EncryptId;
try {
window.parent.reloadcredit_rating();
} catch (e) { }
});
}
</script>
}
@using (Html.BeginForm("credit_ratingEdit", "credit_rating", FormMethod.Post, new { id = "credit_ratingEditForm",autocomplete="off" }))
{
<div class="form-layout">
<input type="hidden" value="@Model.id" name="id" id="id" />
@Html.HiddenFor(model => model.EncryptId)
@Html.MyTextFor(model => model.CreditName, true)
<input type="hidden" id="NameHidden" value="@Model.CreditName" />
<div class="form-group col-md-6">
<label class="formlabel" for="IsUnLimited">额度不限</label>
<input id="IsUnLimited" class="" type="checkbox" name="IsUnLimited" value="@Model.IsUnLimited" @(Model.IsUnLimited == 1 ? "checked" : "")>
</div>
@Html.MyDecimalFor(model => model.CreditLine)
@Html.MyDropdownFor1(model => model.IsSuspend, GlobalData.GetBoolList(), appendBlank: false)
@Html.MyDropdownFor1(model => model.ValidState, ConsGlobal.ValidStates(), appendBlank: false)
<div class="form-group col-md-6">
<label class="formlabel" for="Remark">说明</label>
<input id="Remark" class="text-box width-p200" type="text" value="@Model.Remark" name="Remark">
<span class="field-validation-valid" data-valmsg-for="Remark" data-valmsg-replace="true"></span>
</div>
</div>
<div class="form-buttons">
@MyControls.Btn("保存", "savecredit_rating()")
@MyControls.Btn("关闭", "layer.closeMe()")
</div>
}