Pārlūkot izejas kodu

公文下发添加角色功能 未完成

临城职教中职
ndbs pirms 2 gadiem
vecāks
revīzija
c4292ae4a3
6 mainītis faili ar 215 papildinājumiem un 55 dzēšanām
  1. +42
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleBLL.cs
  2. +10
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleIBLL.cs
  3. +22
    -18
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.cshtml
  4. +106
    -36
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.js
  5. +15
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/RoleController.cs
  6. +20
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-form.js

+ 42
- 0
Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleBLL.cs Parādīt failu

@@ -254,5 +254,47 @@ namespace Learun.Application.Organization

}
#endregion

#region 扩展数据
/// <summary>
/// 获取树形数据
/// </summary>
/// <param name="parentId">父级id</param>
/// <returns></returns>
public List<TreeModel> GetTree(string parentId)
{
try
{
List<RoleEntity> list = GetList();
List<TreeModel> treeList = new List<TreeModel>();
foreach (var item in list)
{
TreeModel node = new TreeModel
{
id = item.F_RoleId,
text = item.F_FullName,
value = item.F_RoleId,
showcheck = false,
checkstate = 0,
isexpand = true,
parentId = item.F_RoleId
};
treeList.Add(node);
}
return treeList;
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion
}
}

+ 10
- 0
Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleIBLL.cs Parādīt failu

@@ -59,6 +59,16 @@ namespace Learun.Application.Organization
/// <returns></returns>
void SaveEntity(string keyValue, RoleEntity roleEntity);
string GetIdByRoleName(string v);
#endregion
#region 扩展数据
/// <summary>
/// 角色树
/// </summary>
/// <param name="parentId">父级id</param>
/// <returns></returns>
List<TreeModel> GetTree(string parentId);


#endregion
}
}

+ 22
- 18
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.cshtml Parādīt failu

@@ -3,39 +3,43 @@
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap" id="form">
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" >
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile">
<div class="lr-form-item-title">主题<font face="宋体">*</font></div>
<input id="Title" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
<input id="Title" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" >
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile">
<div class="lr-form-item-title">接收对象</div>
<div id="SendType"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" id="ReceiverIddiv">
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" id="ReceiverIddiv">
<div class="lr-form-item-title">接收人</div>
<div id="ReceiverUserId" ></div>
<div id="ReceiverUserId"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" id="DeptIddiv">
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" id="DeptIddiv">
<div class="lr-form-item-title">接收部门</div>
<div id="DeptId" ></div>
<div id="DeptId"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" id="PostIddiv">
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" id="PostIddiv">
<div class="lr-form-item-title">接收岗位</div>
<div id="PostId" ></div>
<div id="PostId"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" id="CompanyIddiv">
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" id="RoleIddiv">
<div class="lr-form-item-title">接收角色</div>
<div id="RoleId"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" id="CompanyIddiv">
<div class="lr-form-item-title">接收校区</div>
<div id="CompanyId" ></div>
<div id="CompanyId"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile">
<div class="lr-form-item-title">文号<font face="宋体">*</font></div>
<input id="DocNo" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" >
<div class="lr-form-item-title">文号<font face="宋体">*</font></div>
<input id="DocNo" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" >
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile">
<div class="lr-form-item-title">文件</div>
<div id="Url" ></div>
<div id="Url"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile" >
<div class="col-xs-12 lr-form-item" data-table="Sys_SendFile">
<div class="lr-form-item-title">正文</div>
<div id="Contents" style="height:300px;"></div>
</div>


+ 106
- 36
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.js Parādīt failu

@@ -29,16 +29,15 @@ var bootstrap = function ($, learun) {
$('#CompanyId').lrCompanySelect({ type: 'multiple' });
$('#DeptId').lrDepartmentSelect({ type: 'treemultiple' });
$('#PostId').lrPostSelect({ type: 'treemultiple' });
$('#RoleId').lrRoleSelect({ type: 'treemultiple' });
$('#ReceiverUserId').lrUserSelect({ type: '1' });
$('#SendType').lrDataItemSelect({
code: 'FileSendType', select: function (item) {
if (item != null && item != undefined) {
if (item.id === 1 || item.id === "1") {
$("#CompanyIddiv").show();
$("#CompanyId").removeAttr("isvalid");
$("#CompanyId").removeAttr("NotNull");
//$("#CompanyId").attr("isvalid", "yes");
//$("#CompanyId").attr("checkexpession", "NotNull");
$("#CompanyId").attr("isvalid", "yes");
$("#CompanyId").attr("checkexpession", "NotNull");
$("#DeptIddiv").hide();
$("#DeptId").removeAttr("isvalid");
$("#DeptId").removeAttr("NotNull");
@@ -48,21 +47,25 @@ var bootstrap = function ($, learun) {
$("#PostIddiv").hide();
$("#PostId").removeAttr("isvalid");
$("#PostId").removeAttr("NotNull");
$("#RoleIddiv").hide();
$("#RoleId").removeAttr("isvalid");
$("#RoleId").removeAttr("NotNull");
} else if (item.id === 2 || item.id === "2") {
$("#CompanyIddiv").hide();
$("#CompanyId").removeAttr("isvalid");
$("#CompanyId").removeAttr("NotNull");
$("#DeptIddiv").show();
$("#DeptId").removeAttr("isvalid");
$("#DeptId").removeAttr("NotNull");
//$("#DeptId").attr("isvalid", "yes");
//$("#DeptId").attr("checkexpession", "NotNull");
$("#DeptId").attr("isvalid", "yes");
$("#DeptId").attr("checkexpession", "NotNull");
$("#ReceiverIddiv").hide();
$("#ReceiverUserId").removeAttr("isvalid");
$("#ReceiverUserId").removeAttr("NotNull");
$("#PostIddiv").hide();
$("#PostId").removeAttr("isvalid");
$("#PostId").removeAttr("NotNull");
$("#RoleIddiv").hide();
$("#RoleId").removeAttr("isvalid");
$("#RoleId").removeAttr("NotNull");
} else if (item.id === 3 || item.id === "3") {
$("#CompanyIddiv").hide();
$("#CompanyId").removeAttr("isvalid");
@@ -76,7 +79,10 @@ var bootstrap = function ($, learun) {
$("#PostIddiv").show();
$("#PostId").attr("isvalid", "yes");
$("#PostId").attr("checkexpession", "NotNull");
} else {
$("#RoleIddiv").hide();
$("#RoleId").removeAttr("isvalid");
$("#RoleId").removeAttr("NotNull");
} else if (item.id === 4 || item.id === "4") {
$("#CompanyIddiv").hide();
$("#CompanyId").removeAttr("isvalid");
$("#CompanyId").removeAttr("NotNull");
@@ -89,6 +95,25 @@ var bootstrap = function ($, learun) {
$("#PostIddiv").hide();
$("#PostId").removeAttr("isvalid");
$("#PostId").removeAttr("NotNull");
$("#RoleIddiv").hide();
$("#RoleId").removeAttr("isvalid");
$("#RoleId").removeAttr("NotNull");
} else {
$("#CompanyIddiv").hide();
$("#CompanyId").removeAttr("isvalid");
$("#CompanyId").removeAttr("NotNull");
$("#DeptIddiv").hide();
$("#DeptId").removeAttr("isvalid");
$("#DeptId").removeAttr("NotNull");
$("#ReceiverIddiv").hide();
$("#ReceiverUserId").removeAttr("isvalid");
$("#ReceiverUserId").removeAttr("NotNull");
$("#PostIddiv").hide();
$("#PostId").removeAttr("isvalid");
$("#PostId").removeAttr("NotNull");
$("#RoleIddiv").show();
$("#RoleId").attr("isvalid", "yes");
$("#RoleId").attr("checkexpession", "NotNull");
}
}
}
@@ -107,12 +132,10 @@ var bootstrap = function ($, learun) {
}
else {
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
if (data[id].SendType === 1 || data[id].SendType == "1") {
if (item.id === 1 || item.id === "1") {
$("#CompanyIddiv").show();
$("#CompanyId").removeAttr("isvalid");
$("#CompanyId").removeAttr("NotNull");
//$("#CompanyId").attr("isvalid", "yes");
//$("#CompanyId").attr("checkexpession", "NotNull");
$("#CompanyId").attr("isvalid", "yes");
$("#CompanyId").attr("checkexpession", "NotNull");
$("#DeptIddiv").hide();
$("#DeptId").removeAttr("isvalid");
$("#DeptId").removeAttr("NotNull");
@@ -122,24 +145,26 @@ var bootstrap = function ($, learun) {
$("#PostIddiv").hide();
$("#PostId").removeAttr("isvalid");
$("#PostId").removeAttr("NotNull");
$("#CompanyId").lrselectSet(data[id].ReceiverId);
} else if (data[id].SendType === 2 || data[id].SendType == "2") {
$("#RoleIddiv").hide();
$("#RoleId").removeAttr("isvalid");
$("#RoleId").removeAttr("NotNull");
} else if (item.id === 2 || item.id === "2") {
$("#CompanyIddiv").hide();
$("#CompanyId").removeAttr("isvalid");
$("#CompanyId").removeAttr("NotNull");
$("#DeptIddiv").show();
$("#DeptId").removeAttr("isvalid");
$("#DeptId").removeAttr("NotNull");
//$("#DeptId").attr("isvalid", "yes");
//$("#DeptId").attr("checkexpession", "NotNull");
$("#DeptId").attr("isvalid", "yes");
$("#DeptId").attr("checkexpession", "NotNull");
$("#ReceiverIddiv").hide();
$("#ReceiverUserId").removeAttr("isvalid");
$("#ReceiverUserId").removeAttr("NotNull");
$("#PostIddiv").hide();
$("#PostId").removeAttr("isvalid");
$("#PostId").removeAttr("NotNull");
$("#DeptId").lrselectSet(data[id].ReceiverId);
} else if (data[id].SendType === 3 || data[id].SendType === "3") {
$("#RoleIddiv").hide();
$("#RoleId").removeAttr("isvalid");
$("#RoleId").removeAttr("NotNull");
} else if (item.id === 3 || item.id === "3") {
$("#CompanyIddiv").hide();
$("#CompanyId").removeAttr("isvalid");
$("#CompanyId").removeAttr("NotNull");
@@ -152,8 +177,10 @@ var bootstrap = function ($, learun) {
$("#PostIddiv").show();
$("#PostId").attr("isvalid", "yes");
$("#PostId").attr("checkexpession", "NotNull");
$("#PostId").lrselectSet(data[id].ReceiverId);
} else {
$("#RoleIddiv").hide();
$("#RoleId").removeAttr("isvalid");
$("#RoleId").removeAttr("NotNull");
} else if (item.id === 4 || item.id === "4") {
$("#CompanyIddiv").hide();
$("#CompanyId").removeAttr("isvalid");
$("#CompanyId").removeAttr("NotNull");
@@ -161,14 +188,30 @@ var bootstrap = function ($, learun) {
$("#DeptId").removeAttr("isvalid");
$("#DeptId").removeAttr("NotNull");
$("#ReceiverIddiv").show();
$("#ReceiverUserId").attr("isvalid", "yes");
$("#ReceiverUserId").attr("checkexpession", "NotNull");
$("#PostIddiv").hide();
$("#PostId").removeAttr("isvalid");
$("#PostId").removeAttr("NotNull");
$("#RoleIddiv").hide();
$("#RoleId").removeAttr("isvalid");
$("#RoleId").removeAttr("NotNull");
} else {
$("#CompanyIddiv").hide();
$("#CompanyId").removeAttr("isvalid");
$("#CompanyId").removeAttr("NotNull");
$("#DeptIddiv").hide();
$("#DeptId").removeAttr("isvalid");
$("#DeptId").removeAttr("NotNull");
$("#ReceiverIddiv").hide();
$("#ReceiverUserId").removeAttr("isvalid");
$("#ReceiverUserId").removeAttr("NotNull");
//$("#ReceiverUserId").attr("isvalid", "yes");
//$("#ReceiverUserId").attr("checkexpession", "NotNull");
$("#PostIddiv").hide();
$("#PostId").removeAttr("isvalid");
$("#PostId").removeAttr("NotNull");
$("#ReceiverUserId").lrformselectSet(data[id].ReceiverId);
$("#RoleIddiv").show();
$("#RoleId").attr("isvalid", "yes");
$("#RoleId").attr("checkexpession", "NotNull");
}
}
}
@@ -190,7 +233,7 @@ var bootstrap = function ($, learun) {
keyValue = data[id].SFileId;
}
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
if (data[id].SendType === 1 || data[id].SendType == "1") {
if (item.id === 1 || item.id === "1") {
$("#CompanyIddiv").show();
$("#CompanyId").attr("isvalid", "yes");
$("#CompanyId").attr("checkexpession", "NotNull");
@@ -203,8 +246,10 @@ var bootstrap = function ($, learun) {
$("#PostIddiv").hide();
$("#PostId").removeAttr("isvalid");
$("#PostId").removeAttr("NotNull");
$("#CompanyId").lrselectSet(data[id].ReceiverId);
} else if (data[id].SendType === 2 || data[id].SendType == "2") {
$("#RoleIddiv").hide();
$("#RoleId").removeAttr("isvalid");
$("#RoleId").removeAttr("NotNull");
} else if (item.id === 2 || item.id === "2") {
$("#CompanyIddiv").hide();
$("#CompanyId").removeAttr("isvalid");
$("#CompanyId").removeAttr("NotNull");
@@ -217,8 +262,10 @@ var bootstrap = function ($, learun) {
$("#PostIddiv").hide();
$("#PostId").removeAttr("isvalid");
$("#PostId").removeAttr("NotNull");
$("#DeptId").lrselectSet(data[id].ReceiverId);
} else if (data[id].SendType === 3 || data[id].SendType === "3") {
$("#RoleIddiv").hide();
$("#RoleId").removeAttr("isvalid");
$("#RoleId").removeAttr("NotNull");
} else if (item.id === 3 || item.id === "3") {
$("#CompanyIddiv").hide();
$("#CompanyId").removeAttr("isvalid");
$("#CompanyId").removeAttr("NotNull");
@@ -231,8 +278,10 @@ var bootstrap = function ($, learun) {
$("#PostIddiv").show();
$("#PostId").attr("isvalid", "yes");
$("#PostId").attr("checkexpession", "NotNull");
$("#PostId").lrselectSet(data[id].ReceiverId);
} else {
$("#RoleIddiv").hide();
$("#RoleId").removeAttr("isvalid");
$("#RoleId").removeAttr("NotNull");
} else if (item.id === 4 || item.id === "4") {
$("#CompanyIddiv").hide();
$("#CompanyId").removeAttr("isvalid");
$("#CompanyId").removeAttr("NotNull");
@@ -245,7 +294,25 @@ var bootstrap = function ($, learun) {
$("#PostIddiv").hide();
$("#PostId").removeAttr("isvalid");
$("#PostId").removeAttr("NotNull");
$("#ReceiverUserId").lrformselectSet(data[id].ReceiverId);
$("#RoleIddiv").hide();
$("#RoleId").removeAttr("isvalid");
$("#RoleId").removeAttr("NotNull");
} else {
$("#CompanyIddiv").hide();
$("#CompanyId").removeAttr("isvalid");
$("#CompanyId").removeAttr("NotNull");
$("#DeptIddiv").hide();
$("#DeptId").removeAttr("isvalid");
$("#DeptId").removeAttr("NotNull");
$("#ReceiverIddiv").hide();
$("#ReceiverUserId").removeAttr("isvalid");
$("#ReceiverUserId").removeAttr("NotNull");
$("#PostIddiv").hide();
$("#PostId").removeAttr("isvalid");
$("#PostId").removeAttr("NotNull");
$("#RoleIddiv").show();
$("#RoleId").attr("isvalid", "yes");
$("#RoleId").attr("checkexpession", "NotNull");
}
}
}
@@ -280,9 +347,12 @@ var bootstrap = function ($, learun) {
} else if (sendtype == "3") {
formData.ReceiverId = $("#PostId").lrselectGet();
formData.Receiver = $("#PostId").find(".lr-select-placeholder").text();
} else {
} else if (sendtype == "4") {
formData.ReceiverId = $("#ReceiverUserId").lrformselectGet();
formData.Receiver = $("#ReceiverUserId").find("span").text();
} else {
formData.ReceiverId = $("#RoleId").lrselectGet();
formData.Receiver = $("#RoleId").find(".lr-select-placeholder").text();
}
if (!!processId) {
formData.SProcessId = processId;


+ 15
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/RoleController.cs Parādīt failu

@@ -40,6 +40,21 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers
#endregion

#region 获取数据
#region 扩展数据
/// <summary>
/// 获取树形数据
/// </summary>
/// <param name="companyId">公司主键</param>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetTree(string companyId)
{
var data = roleIBLL.GetTree(companyId);
return JsonResult(data);
}

#endregion
/// <summary>
/// 获取角色列表信息
/// </summary>


+ 20
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-form.js Parādīt failu

@@ -611,7 +611,26 @@
});
}
}

//角色下拉框
$.fn.lrRoleSelect = function (op) {
// op:parentId 父级id,maxHeight 200,
var dfop = {
type: 'tree',
// 是否允许搜索
allowSearch: true,
// 访问数据接口地址
url: top.$.rootUrl + '/LR_OrganizationModule/Role/GetTree',
// 访问数据接口参数
param: { parentId: '0' }
};
op = op || {};
dfop.param.companyId = op.companyId;
dfop.param.parentId = op.parentId;
if (!!op.type) {
dfop.type = op.type;
}
return $(this).lrselect(dfop);
};
// 省市区级联
$.fn.lrAreaSelect = function (op) {
// op:parentId 父级id,maxHeight 200,


Notiek ielāde…
Atcelt
Saglabāt