110 lines
3.8 KiB
Plaintext
110 lines
3.8 KiB
Plaintext
@model WX.CRM.Model.Entity.BAS_INNERDEPARTMENT
|
|
@using WX.CRM.WebHelper;
|
|
@{
|
|
ViewBag.Title = "创建bas_innerDepartment";
|
|
Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
|
|
|
|
}
|
|
@section scripts{
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
$("#map_PARENTID").attr("data-val-noinput-input", "@(Request.QueryString["notId"] == null ? "[-1]" : Request.QueryString["notId"])");
|
|
})
|
|
</script>
|
|
}
|
|
<style>
|
|
.input-validation-error {
|
|
background-color: #ffeeee;
|
|
border: 1px solid #ff0000;
|
|
}
|
|
</style>
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
$("#btnSave").click(function () {
|
|
if ($("#CreateForm").valid()) {
|
|
$(".combo").css("display", "");
|
|
if (!$("#map_PARENTID").valid())
|
|
return;
|
|
$.r_ajax({
|
|
url: "/Base/InnerDepartment/Edit",
|
|
type: "Post",
|
|
data: $("#CreateForm").serialize(),
|
|
dataType: "json",
|
|
loading: true,
|
|
success: function (data) {
|
|
if (data.type == 1) {
|
|
window.parent.frameReturnByMes(data.message);
|
|
window.parent.frameReturnByReload(true);
|
|
window.parent.frameReturnByClose()
|
|
}
|
|
else {
|
|
window.parent.frameReturnByMes(data.message);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
return false;
|
|
});
|
|
$('#comboTree').combotree({
|
|
required: true,
|
|
url: "/Base/InnerDepartment/GetTreeJson",
|
|
height:28,
|
|
onSelect: function (node) {
|
|
$("#map_PARENTID").attr("value", node.id);
|
|
if (!$("#map_PARENTID").valid()) {
|
|
$(".combo").addClass("input-validation-error");
|
|
$(".combo-text").addClass("input-validation-error");
|
|
} else {
|
|
$(".combo").removeClass("input-validation-error");
|
|
$(".combo-text").removeClass("input-validation-error");
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
<div class="mvctool bgb">
|
|
@Html.ToolButtonPlain("btnSave", "icon-save", "保存", false, "")
|
|
</div>
|
|
@using (Html.BeginForm("Edit", "bas_innerDepartment", null, FormMethod.Post, new { Id = "CreateForm" }))
|
|
{
|
|
@Html.ValidationSummary(true)
|
|
<table class="fromEditTable setTextWidth200">
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
@Html.LabelFor(m => m.map_PARENTID)
|
|
</td>
|
|
<td >
|
|
@Html.TextBoxFor(m => m.map_PARENTID, new { style = "width:210px;display:none;" })
|
|
<input id="comboTree" style="width: 200px;" value="@Model.map_PARENTID" />
|
|
</td>
|
|
<td >
|
|
@Html.ValidationMessageFor(m => m.map_PARENTID)
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td >
|
|
@Html.LabelFor(m => m.map_DEPTNAME)
|
|
</td>
|
|
<td >
|
|
@Html.TextBoxFor(m => m.map_DEPTNAME)
|
|
@Html.HiddenFor(m => m.DEPTID)
|
|
</td>
|
|
<td>
|
|
@Html.ValidationMessageFor(m => m.map_DEPTNAME)
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="width:80px">
|
|
@Html.LabelFor(m => m.map_INNERDEPTCODE)
|
|
</td>
|
|
<td style="width:210px">
|
|
@Html.TextBoxFor(m => m.map_INNERDEPTCODE)
|
|
</td>
|
|
<td style="width:110px">
|
|
@Html.ValidationMessageFor(m => m.map_INNERDEPTCODE)
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
} |