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

90 lines
3.1 KiB
Plaintext

@model StockBlackWhite
@{
ViewBag.Title = "个股黑白名单 | 编辑";
Layout = "~/Views/Shared/_InfoLayout.cshtml";
}
<style>
#IsUnLimited {
width: 15px
}
.text-box {
width: 265px;
}
.form-layout {
min-width: auto !important;
}
</style>
@section JS
{
<script type="text/javascript">
function checkSubmitData() {
var pass = $('#StockBlackWhiteForm').valid();
var UnderlyingCode = $("#UnderlyingCode").val();
var UnderlyingName = $("#UnderlyingName").val();
var BlackWhiteState = $("#BlackWhiteState").val();
if (UnderlyingCode == null) {
main.message("标的代码不能为空");
pass = false
return pass;
}
if (UnderlyingName == null) {
main.message("标的名称不能为空");
pass = false
return pass;
}
if (BlackWhiteState == null) {
main.message("名单类别不能为空");
pass = false
return pass;
}
return pass;
}
function saveclientblack() {
if (!checkSubmitData()) return false;
var data = $("#StockBlackWhiteForm").serialize();
main.post("/StockBlackWhite/StockBlackWhiteAddJson?checkStatus=true", data, {
success: function (res) {
if (!res.success) {
if (res.msg.indexOf("是否覆盖") >= 0) {
main.confirm(res.msg, function () {
main.post("/StockBlackWhite/StockBlackWhiteAddJson?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("StockBlackWhite", "StockBlackWhiteAddJson", FormMethod.Post, new { id = "StockBlackWhiteForm", autocomplete = "off" }))
{
<div class="form-layout">
@Html.MyTextFor(model => model.UnderlyingCode)
@Html.MyTextFor(model => model.UnderlyingName)
@Html.MyDropdownFor(model => model.BlackWhiteState, StockBlackWhiteController.GetAllStockBlackWhiteType(), new { }, "", false)
@Html.MyDropdownFor(model => model.LimitRange, StockBlackWhiteController.GetAllLimitRangeType(), new { }, "", false)
</div>
<div class="form-buttons">
@MyControls.Btn("保存", "saveclientblack()")
@MyControls.Btn("关闭", "layer.closeMe()")
</div>
}