87 lines
2.7 KiB
Plaintext
87 lines
2.7 KiB
Plaintext
@model client_black
|
|
@{
|
|
ViewBag.Title = "黑名单客户 | 编辑";
|
|
Layout = "~/Views/Shared/_InfoLayout.cshtml";
|
|
}
|
|
<style>
|
|
#IsUnLimited {
|
|
width: 15px
|
|
}
|
|
|
|
.form-layout {
|
|
min-width: auto !important
|
|
}
|
|
|
|
textarea {
|
|
width: 50%;
|
|
display: inline-block;
|
|
}
|
|
|
|
.text-box {
|
|
width: 265px;
|
|
}
|
|
</style>
|
|
@section JS
|
|
{
|
|
<script type="text/javascript">
|
|
|
|
function checkSubmitData() {
|
|
var pass = $('#clientbalckForm').valid();
|
|
var Name = $("#Name").val();
|
|
if (Name == null) {
|
|
main.message("用户名称不能为空");
|
|
pass = false
|
|
return pass;
|
|
}
|
|
return pass;
|
|
}
|
|
|
|
function saveclientblack() {
|
|
if (!checkSubmitData()) return false;
|
|
|
|
var data = $("#clientbalckForm").serialize();
|
|
main.post("/clientblack/ClientBlackAddJson?checkStatus=true", data, {
|
|
success: function (res) {
|
|
if (!res.success) {
|
|
if (res.msg.indexOf("备注已存在") >= 0) {
|
|
main.confirm(res.msg, function () {
|
|
main.post("/clientblack/ClientBlackAddJson?checkStatus=false", data).done(function (res) {
|
|
window.parent.reloadclient_black();
|
|
parent.layer.closeAll();
|
|
})
|
|
});
|
|
} else {
|
|
main.alert(res.msg);
|
|
}
|
|
}
|
|
else {
|
|
window.parent.reloadclient_black();
|
|
parent.layer.closeAll();
|
|
}
|
|
},
|
|
error: function (msg) {
|
|
alert("error:" + msg);
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
}
|
|
|
|
@using (Html.BeginForm("clientblackAdd", "clientblack", FormMethod.Post, new { id = "clientbalckForm", autocomplete = "off" }))
|
|
{
|
|
<div class="form-layout">
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel" for="Name">客户名称</label>
|
|
<input id="Name" class="text-box" type="text" value="@Model.Name" @(string.IsNullOrEmpty(Model.Name) ? "" : "readonly") name="Name" />
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel" for="Remarks">备注</label>
|
|
<textarea rows="2" id="Remarks" name="Remarks">@Model.Remarks</textarea>
|
|
</div>
|
|
</div>
|
|
<div class="form-buttons">
|
|
@MyControls.Btn("保存", "saveclientblack()")
|
|
@MyControls.Btn("关闭", "layer.closeMe()")
|
|
</div>
|
|
}
|