65 lines
2.2 KiB
Plaintext
65 lines
2.2 KiB
Plaintext
@model ClientLevel
|
|
@{
|
|
ViewBag.Title = "客户等级 | 编辑";
|
|
Layout = "~/Views/Shared/_InfoLayout.cshtml";
|
|
var pageObj = new
|
|
{
|
|
isHongYuan = PS.Config.Company == CompanyEnum.宏源
|
|
};
|
|
}
|
|
@section CSS{
|
|
<style>
|
|
.formlabel { width: 120px !important; }
|
|
</style>
|
|
}
|
|
@section JS{
|
|
<script type="text/javascript">
|
|
var page = @Json.Serialize(pageObj);
|
|
|
|
$(function () {
|
|
if (page.isHongYuan) {
|
|
//$('#Ratio').prev('label').text("预付金系数R1");注:数据库旧字段Ratio,是追保系数,也就是现在的名称:R2
|
|
}
|
|
});
|
|
|
|
function checkSubmitData() {
|
|
return $('#clientlevelEditForm').valid();
|
|
}
|
|
|
|
function saveclientlevel() {
|
|
var ratioValue = $("#Ratio").val();
|
|
if (ratioValue && ratioValue <= 0) {
|
|
main.message("预付金系数应该大于0");
|
|
return;
|
|
}
|
|
if (!checkSubmitData()) return false;
|
|
|
|
var data = $("#clientlevelEditForm").serialize();
|
|
main.post("/clientlevel/clientlevelEditJson", data).done(function (res) {
|
|
window.location.href = "/clientlevel/clientlevelview?enid=" + res.obj.EncryptId;
|
|
try {
|
|
window.parent.reloadclientlevel();
|
|
}
|
|
catch (e) { }
|
|
});
|
|
}
|
|
|
|
</script>
|
|
}
|
|
@using (Html.BeginForm("clientlevelEdit", "clientlevel", FormMethod.Post, new { id = "clientlevelEditForm", 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.LevelName)
|
|
<input type="hidden" id="NameHidden" value="@Model.LevelName" />
|
|
@Html.MyDecimalFor(model => model.Ratio)
|
|
@Html.MyDecimalFor(model => model.AddRatio)
|
|
@Html.MyTextFor(model => model.Desc)
|
|
@Html.MyDropdownFor1(model => model.ValidState, ConsGlobal.ValidStates(), appendBlank: false)
|
|
</div>
|
|
<div class="form-buttons">
|
|
@MyControls.Btn("保存", "saveclientlevel()")
|
|
@MyControls.Btn("关闭", "layer.closeMe()")
|
|
</div>
|
|
} |