/// <summary> /// 获取指定部门下一级子部门列表 /// </summary> /// <returns></returns> public string Dot2DotTreeDeptModel_GetSubDepts() { string parentid = this.GetRequestVal("parentid"); string nid = this.GetRequestVal("nodeid"); if (string.IsNullOrWhiteSpace(parentid)) { throw new Exception("参数parentid不能为空"); } if (string.IsNullOrWhiteSpace(nid)) { throw new Exception("参数nodeid不能为空"); } EasyuiTreeNode node = null; List <EasyuiTreeNode> d = new List <EasyuiTreeNode>(); BP.WF.Template.NodeDepts sdepts = new BP.WF.Template.NodeDepts(); sdepts.Retrieve(BP.WF.Template.NodeDeptAttr.FK_Node, int.Parse(nid)); if (BP.WF.Glo.OSModel == OSModel.OneOne) { BP.Port.Dept parentDept = new BP.Port.Dept(parentid); BP.Port.Depts depts = new BP.Port.Depts(); depts.Retrieve(BP.Port.DeptAttr.ParentNo, parentid); //增加部门 foreach (BP.Port.Dept dept in depts) { node = new EasyuiTreeNode(); node.id = "DEPT_" + dept.No; node.text = dept.Name; node.iconCls = "icon-department"; node.@checked = sdepts.GetEntityByKey(BP.WF.Template.NodeDeptAttr.FK_Dept, dept.No) != null; node.attributes = new EasyuiTreeNodeAttributes(); node.attributes.No = dept.No; node.attributes.Name = dept.Name; node.attributes.ParentNo = parentDept.No; node.attributes.ParentName = parentDept.Name; node.attributes.TType = "DEPT"; node.attributes.Code = BP.Tools.chs2py.ConvertStr2Code(dept.Name); node.state = "closed"; node.children = new List <EasyuiTreeNode>(); node.children.Add(new EasyuiTreeNode()); node.children[0].text = "loading..."; d.Add(node); } } else { BP.GPM.Dept parentDept = new BP.GPM.Dept(parentid); BP.GPM.Depts depts = new BP.GPM.Depts(); depts.Retrieve(BP.GPM.DeptAttr.ParentNo, parentid, BP.GPM.DeptAttr.Idx); //增加部门 foreach (BP.GPM.Dept dept in depts) { node = new EasyuiTreeNode(); node.id = "DEPT_" + dept.No; node.text = dept.Name; node.iconCls = "icon-department"; node.@checked = sdepts.GetEntityByKey(BP.WF.Template.NodeDeptAttr.FK_Dept, dept.No) != null; node.attributes = new EasyuiTreeNodeAttributes(); node.attributes.No = dept.No; node.attributes.Name = dept.Name; node.attributes.ParentNo = parentDept.No; node.attributes.ParentName = parentDept.Name; node.attributes.TType = "DEPT"; node.attributes.Code = BP.Tools.chs2py.ConvertStr2Code(dept.Name); node.state = "closed"; node.children = new List <EasyuiTreeNode>(); node.children.Add(new EasyuiTreeNode()); node.children[0].text = "loading..."; d.Add(node); } } return(Newtonsoft.Json.JsonConvert.SerializeObject(d)); }