| | |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | try |
| | | { |
| | | var checkUserSn = _context.Projects.Where(x => x.Name == projectDTO.Name && x.RecStatus == "A" && x.Id != projectDTO.Id).FirstOrDefault(); |
| | | var checkUserSn = _context.Projects.Where(x => x.Name == projectDTO.Name.Trim() && x.RecStatus == "A" && x.Id != projectDTO.Id).FirstOrDefault(); |
| | | if (checkUserSn != null && (string.IsNullOrWhiteSpace(projectDTO.Id) || (!string.IsNullOrWhiteSpace(projectDTO.Id) && checkUserSn.Id != projectDTO.Id))) |
| | | { |
| | | resultEntity.Result = false; |
| | |
| | | private readonly IPltRoleService _pltRoleService; |
| | | private readonly IUserService _userService; |
| | | private readonly ISysCodeService _sysCodeService; |
| | | private readonly IHrDeptService _hrDeptService; |
| | | |
| | | |
| | | |
| | | public PltUserRoleController(ILogger<PltUserRoleController> logger, IPltRoleService pltRoleService, IUserService userService, ISysCodeService sysCodeService) |
| | | public PltUserRoleController(ILogger<PltUserRoleController> logger, IPltRoleService pltRoleService, IUserService userService, ISysCodeService sysCodeService |
| | | , IHrDeptService hrDeptService) |
| | | { |
| | | _logger = logger; |
| | | _pltRoleService = pltRoleService; |
| | | _userService = userService; |
| | | _sysCodeService = sysCodeService; |
| | | _hrDeptService = hrDeptService; |
| | | } |
| | | |
| | | [CheckLogin] |
| | |
| | | #endregion |
| | | #region 获取所有人员 |
| | | var listUser = _userService.GetList(); |
| | | var listType = _sysCodeService.GetCodeDataAll().Where(a=>a.CodeTable == "plt_user" && a.CodeField == "user_type").ToList(); |
| | | var deptDTOs = _hrDeptService.GetList().ToList(); |
| | | var listType = new List<CodeDataEntity>(); |
| | | |
| | | foreach (var dept in deptDTOs) |
| | | { |
| | | var codeDataEntity = new CodeDataEntity(); |
| | | codeDataEntity.CodeSn = dept.Id; |
| | | codeDataEntity.Comments = dept.DeptName; |
| | | listType.Add(codeDataEntity); |
| | | } |
| | | |
| | | //var listType = _sysCodeService.GetCodeDataAll().Where(a=>a.CodeTable == "plt_user" && a.CodeField == "user_type").ToList(); |
| | | var dicTypeUser = new Dictionary<string, List<PltUserDTO>>(); |
| | | if (listType.Count > 0) |
| | | { |
| | | listType.ForEach(t => { |
| | | dicTypeUser[t.CodeSn] = listUser.Where(u => u.UserType == t.CodeSn).ToList(); |
| | | dicTypeUser[t.CodeSn] = listUser.Where(u => u.DeptId == t.CodeSn).ToList();// u.UserType |
| | | }); |
| | | |
| | | } |
| | |
| | | <div class="col-sm-3 col-md-3"> |
| | | <div class="checkbox i-checks user"> |
| | | <label> |
| | | <div class="icheckbox_square-green" data-pageid="@mUser.Id" data-parentid="@mUser.UserType" style="position: relative;"> |
| | | <div class="icheckbox_square-green" data-pageid="@mUser.Id" data-parentid="@mUser.DeptId" style="position: relative;"> |
| | | <input style="position: absolute; opacity: 0;" type="checkbox" value=""> |
| | | <ins class="iCheck-helper" style="background: rgb(255, 255, 255); margin: 0px; padding: 0px; border: 0px; border-image: none; left: 0%; top: 0%; width: 100%; height: 100%; display: block; position: absolute; opacity: 0;"></ins> |
| | | </div> <i></i><span class="uname">@mUser.UserName</span> |
| | |
| | | { |
| | | label: '公告时间', name: 'StartTime', labtype: 'txt', hidden: false, width: 90 , |
| | | formatter: function (v) { |
| | | return $.trim(v) == '' ? '' : $.trim(v).replace("T"," ") //.substring(0,10); |
| | | return $.trim(v) == '' ? '' : $.trim(v).substring(0, 10); //$.trim(v).replace("T"," ") |
| | | } |
| | | }, |
| | | { label: '项目区域', name: 'Sheng', labtype: 'txt', hidden: false, width: 100 }, |
| | | { label: '项目区域', name: 'Sheng', labtype: 'txt', hidden: false, width: 160 }, |
| | | { |
| | | label: '项目名称', name: 'Name', labtype: 'txt', hidden: false, width: 400 , |
| | | label: '项目名称', name: 'Name', labtype: 'txt', hidden: false, width: 500 , |
| | | formatter: function (cellvalue, options, rowObject) { |
| | | return "<a onclick=\"OpenWindow('" + cellvalue + "','98%','100%', '/Project/Add?id=" + rowObject.Id + "')\" >" + cellvalue + "</a>"; |
| | | |
| | | var color = ""; |
| | | if (rowObject.Fblx != null && rowObject.Fblx != '') { |
| | | color = "red"; |
| | | } |
| | | }, { label: '项目编号', name: 'Number', labtype: 'txt', hidden: false, width: 100 }, |
| | | |
| | | return "<a onclick=\"OpenWindow('" + cellvalue + "','98%','100%', '/Project/Add?id=" + rowObject.Id + "')\" ><span style='color:" + color + ";'>" + cellvalue + "</span></a>"; |
| | | } |
| | | }, { label: '项目编号', name: 'Number', labtype: 'txt', hidden: false, width: 140 }, |
| | | { |
| | | label: '中标供应商', name: 'Toubiaocishu', labtype: 'txt', hidden: false, width: 400, |
| | | label: '中标供应商', name: 'Toubiaocishu', labtype: 'txt', hidden: false, width: 200, |
| | | formatter: function (cellvalue, options, rowObject) { |
| | | if (cellvalue != null && cellvalue != "null" && cellvalue != "") { |
| | | var ss = cellvalue.split('、'); |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '第二候选', name: 'Drhx', labtype: 'txt', hidden: false, width: 400, |
| | | label: '第二候选', name: 'Drhx', labtype: 'txt', hidden: false, width: 200, |
| | | formatter: function (cellvalue, options, rowObject) { |
| | | if (cellvalue != null && cellvalue != "null" && cellvalue != "") { |
| | | var ss = cellvalue.split('、'); |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '第三候选', name: 'Dshx', labtype: 'txt', hidden: false, width: 400, |
| | | label: '第三候选', name: 'Dshx', labtype: 'txt', hidden: false, width: 200, |
| | | formatter: function (cellvalue, options, rowObject) { |
| | | if (cellvalue != null && cellvalue != "null" && cellvalue != "") { |
| | | var ss = cellvalue.split('、'); |