87 lines
2.3 KiB
Plaintext
87 lines
2.3 KiB
Plaintext
@model Structure_Info
|
|
@{
|
|
ViewBag.Title = "结构信息 | 编辑";
|
|
Layout = "~/Views/Shared/_InfoLayout.cshtml";
|
|
|
|
var pageObj = new
|
|
{
|
|
range = ViewBag.range,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
@section CSS{
|
|
|
|
}
|
|
|
|
@section JS
|
|
{
|
|
<script type="text/javascript">
|
|
var page = @Json.Serialize(pageObj);
|
|
function closestructureInfoWindow() {
|
|
try {
|
|
window.parent.layer.closeAll();
|
|
} catch (e) {
|
|
}
|
|
}
|
|
|
|
|
|
function checkSubmitData() {
|
|
var pass = $('#structureInfoEditForm').valid();
|
|
return pass;
|
|
}
|
|
|
|
function savestructureInfo() {
|
|
if (!checkSubmitData()) {
|
|
return false;
|
|
}
|
|
|
|
main.post("/StructureInfo/SaveStructureInfo2", {
|
|
id: $("#id").val(),
|
|
EncryptId: $("#EncryptId").val(),
|
|
StructureName: $("#StructureName").val(),
|
|
StructureTypeSm: $("#StructureTypeSm").val(),
|
|
Range: $("#range").val(),
|
|
|
|
}).done(function (res) {
|
|
window.parent.showmiddlemessage("成功更新本条数据");
|
|
try {
|
|
window.parent.reloadcredit();
|
|
} catch (e) {
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
$(function () {
|
|
if (page.range === 2) {//自定义要素时不展示此字段
|
|
$("#StructureTypeSm").parent().hide();
|
|
$("#StructureName").prev().text("模板名称")
|
|
}
|
|
});
|
|
</script>
|
|
}
|
|
|
|
@using (Html.BeginForm("StructureInfoEdit", "StructureInfo", FormMethod.Post, new { id = "structureInfoEditForm" }))
|
|
{
|
|
<div class="form-layout">
|
|
<input type="hidden" value="@pageObj.range" name="range" id="range" />
|
|
@Html.HiddenFor(model => model.EncryptId)
|
|
|
|
<div class="form-group col-md-6" style="width:600px;">
|
|
@Html.MyTextFor(model => model.StructureName, true);
|
|
|
|
@Html.HiddenFor(model => model.id)
|
|
</div>
|
|
|
|
<div class="form-group col-md-6" style="width:600px;">
|
|
@Html.MyDropdownFor1(model => model.StructureTypeSm, GlobalData.GetCustomStructureTypeSm())
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-buttons">
|
|
@MyControls.Btn("保存", "savestructureInfo()")
|
|
@MyControls.Btn("关闭", "closestructureInfoWindow()")
|
|
</div>
|
|
} |