Former-commit-id: 866c70993d62632664d85f0aae14bb1b801b753d
Former-commit-id: 6517ccc49adc093d9ff92635d880d06b0b930224
1.0
wanggang 5 years ago
parent 5507d9f51d
commit c4ac1f4c57

@ -239,7 +239,6 @@ namespace TeacherExt.Controllers
{
var userName = User.Identity.Name;
var organId = this._userRepo.ReadOnlyTable().Where(o => o.UserName == userName).Select(o => o.OrganId).FirstOrDefault();
model.OrganId = model.OrganId.HasValue ? model.OrganId : organId;
if (User.IsInRole("局管理员"))
{
model.Organs = this._organRepo.Table().ToList().Where(o => o.ParentId == null).ToList();
@ -249,9 +248,13 @@ namespace TeacherExt.Controllers
model.Organs = this._organRepo.ReadOnlyTable().ToList().Where(o => o.Id == organId).ToList();
}
var query = this._userRepo.ReadOnlyTable().Include(o => o.Organ).Include(o => o.Teacher).AsQueryable();
if (User.IsInRole("局管理员"))
{
//全部数据
if (model.OrganId.HasValue)
{
query = query.Where(o => o.OrganId == model.OrganId.Value);
}
}
else if (User.IsInRole("校管理员"))
{
@ -261,6 +264,10 @@ namespace TeacherExt.Controllers
{
query = query.Where(o => o.UserName == userName);
}
if (!model.OrganId.HasValue)
{
model.OrganId = organId;
}
query = query
.WhereIf(!string.IsNullOrEmpty(model.RequestEditStatus), o => o.Teacher.RequestEditStatus == model.RequestEditStatus)
.WhereIf(!string.IsNullOrEmpty(model.CheckStatus), o => o.Teacher.CheckStatus == model.CheckStatus)

@ -15,7 +15,8 @@ namespace TeacherExt.Entities
public TeacherInfo Info { get; set; }
public TeacherProp Prop { get; set; }
/////////////////////////////////
[Required]
public string RequestEditStatus { get; set; }
@ -124,10 +125,8 @@ namespace TeacherExt.Entities
public DateTime? JobTimeSchoolEducationDate { get; set; }
[Required]
public string MaxEducation { get; set; }
[Required]
public string MaxDegree { get; set; }
public bool IsClassTeacher { get; set; }

@ -283,7 +283,6 @@ namespace TeacherExt.Models
[SkipSearch, SkipList]
[SelectList]
[Required(ErrorMessage = "必填项")]
[Display(Order = 320, Name = "全日制教育学历")]
public string FullTimeSchoolEducation { get; set; }
@ -469,7 +468,6 @@ namespace TeacherExt.Models
public string CurrentAddressArea { get; set; }
[SkipSearch, SkipList]
[Required(ErrorMessage = "必填项")]
[Display(Order = 560, Name = "现家庭详细地址")]
public string CurrentAddressStreat { get; set; }

@ -44,3 +44,23 @@
</div>
</div>
</form>
<div class="row">
<p>
测试账号(密码统一为6个1)
</p>
<p>
局管理员admin
</p>
<p>
校管理员admin1 admin2
</p>
<p>
校长xiaozhang1 xiaozhang2
</p>
<p>
老师laoshi1 laoshi2
</p>
<p>
职工zhigong1 zhigong2
</p>
</div>

@ -3,7 +3,7 @@
var index = 0;
}
<div class="row">
<div class="col-sm-3">
<div class="col-sm-2">
<div class="card">
<div class="card-body">
<ul class="navbar-nav">
@ -12,7 +12,7 @@
</div>
</div>
</div>
<div class="col-sm-9">
<div class="col-sm-10">
<form method="post" action="/" target="_self">
<div class="card">
<div class="card-header">
@ -62,64 +62,71 @@
</div>
</div>
<div class="card-body">
<table class="table table-hover text-nowrap">
<tr>
<th><input type="checkbox" class="select_all" /></th>
<th>行号</th>
<th>申请修改状态</th>
<th>审核状态</th>
<th>姓名</th>
<th>性别</th>
<th>民族</th>
<th>籍贯</th>
<th>审核</th>
<th>编辑</th>
<th>审计</th>
</tr>
@foreach (var item in Model.List)
{
index++;
<tr>
<td>
<input type="checkbox" name="list[]" value="@item.Id" />
</td>
<td>@index</td>
<td>@item.RequestEditStatus</td>
<td>@item.CheckStatus</td>
<td>@item.RealName</td>
<td>@item.Sex</td>
<td>@item.Nation</td>
<td>@item.NativePlace</td>
<td>
@if (User.IsInRole("局管理员") && Model.CheckStatus == "待局级审核")
{
<a href="@Url.Action("Details", new { userId = item.UserId })">审核</a>
}
@if (User.IsInRole("校管理员") && Model.CheckStatus == "待校级审核")
{
<a href="@Url.Action("Details", new { userId = item.UserId })">审核</a>
}
@if (User.IsInRole("局管理员") && Model.CheckStatus == "局级审核成功")
{
<a href="@Url.Action("Details", new { userId = item.UserId })">重置</a>
}
@if (User.IsInRole("校管理员") && Model.CheckStatus == "待校级审核")
{
<a href="@Url.Action("Details", new { userId = item.UserId })">重置</a>
}
</td>
<td>
@if (User.Identity.Name == item.UserName)
{
<a href="@Url.Action("Edit",new { userId=item.UserId})">我的</a>
}
</td>
<td>
<a href="@Url.Action("History",new { UserName=item.UserName})">日志</a>
</td>
</tr>
}
</table>
<div class="row">
<div class="col-sm-12" style="overflow-x:auto;">
<table class="table table-bordered text-nowrap">
<tr>
<th><input type="checkbox" class="select_all" /></th>
<th>行号</th>
<th>申请修改状态</th>
<th>审核状态</th>
<th>姓名</th>
<th>性别</th>
<th>民族</th>
<th>籍贯</th>
<th>审核</th>
<th>重置</th>
<th>编辑</th>
<th>审计</th>
</tr>
@foreach (var item in Model.List)
{
index++;
<tr>
<td>
<input type="checkbox" name="list[]" value="@item.Id" />
</td>
<td>@index</td>
<td>@item.RequestEditStatus</td>
<td>@item.CheckStatus</td>
<td>@item.RealName</td>
<td>@item.Sex</td>
<td>@item.Nation</td>
<td>@item.NativePlace</td>
<td>
@if (User.IsInRole("局管理员") && item.CheckStatus == "待局级审核")
{
<a href="@Url.Action("Details", new { userId = item.UserId })">局级审核</a>
}
@if (User.IsInRole("校管理员") && item.CheckStatus == "待校级审核")
{
<a href="@Url.Action("Details", new { userId = item.UserId })">校级审核</a>
}
</td>
<td>
@if (User.IsInRole("局管理员") && item.CheckStatus == "局级审核成功")
{
<a href="@Url.Action("Details", new { userId = item.UserId })">重置</a>
}
@if (User.IsInRole("校管理员") && item.CheckStatus == "待校级审核")
{
<a href="@Url.Action("Details", new { userId = item.UserId })">重置</a>
}
</td>
<td>
@if (User.Identity.Name == item.UserName)
{
<a href="@Url.Action("Edit",new { userId=item.UserId})">我的</a>
}
</td>
<td>
<a href="@Url.Action("History",new { UserName=item.UserName})">日志</a>
</td>
</tr>
}
</table>
</div>
</div>
</div>
<div class="card-footer">
@(await Html.PartialAsync("_Paged"))

@ -1,5 +1,5 @@
@{
var cls = "col-sm-6";
var cls = "col-sm-4";
}
<script>
//是否最高职称聘任

Loading…
Cancel
Save