diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleBLL.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleBLL.cs index 2233752dd..0da520a62 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleBLL.cs @@ -254,5 +254,47 @@ namespace Learun.Application.Organization } #endregion + + #region 扩展数据 + /// + /// 获取树形数据 + /// + /// 父级id + /// + public List GetTree(string parentId) + { + try + { + List list = GetList(); + List treeList = new List(); + 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 } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleIBLL.cs index 8100f64b5..d17280765 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleIBLL.cs @@ -59,6 +59,16 @@ namespace Learun.Application.Organization /// void SaveEntity(string keyValue, RoleEntity roleEntity); string GetIdByRoleName(string v); + #endregion + #region 扩展数据 + /// + /// 角色树 + /// + /// 父级id + /// + List GetTree(string parentId); + + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.cshtml index e42a53fb7..1849ebe44 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.cshtml @@ -3,39 +3,43 @@ Layout = "~/Views/Shared/_Form.cshtml"; }
-
+
主题*
- +
-
+
接收对象
-
+
接收人
-
+
-
+
接收部门
-
+
-
+
接收岗位
-
+
-
+
+
接收角色
+
+
+
接收校区
-
+
+
+
+
文号*
+
-
-
文号*
- -
-
+
文件
-
+
-
+
正文
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.js index 130b971d8..f66be45fc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.js @@ -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; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/RoleController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/RoleController.cs index 06529906c..830608435 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/RoleController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/RoleController.cs @@ -40,6 +40,21 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers #endregion #region 获取数据 + #region 扩展数据 + /// + /// 获取树形数据 + /// + /// 公司主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetTree(string companyId) + { + var data = roleIBLL.GetTree(companyId); + return JsonResult(data); + } + + #endregion /// /// 获取角色列表信息 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-form.js index 149723df4..d1a6ac186 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-form.js @@ -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,