From 19bc2e140fbef74cf87f8e0edfb2d173b1f52d40 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期一, 29 八月 2022 13:06:20 +0800
Subject: [PATCH] 提交
---
zhengcaioa/Services/ProjectService.cs | 2 +-
zhengcaioa/zhengcaioa/Views/PltUserRole/Index.cshtml | 2 +-
zhengcaioa/zhengcaioa/Views/Project/Select.cshtml | 22 ++++++++++++++--------
zhengcaioa/zhengcaioa/Controllers/PltUserRoleController.cs | 21 +++++++++++++++++----
4 files changed, 33 insertions(+), 14 deletions(-)
diff --git a/zhengcaioa/Services/ProjectService.cs b/zhengcaioa/Services/ProjectService.cs
index 8c304df..1ac1682 100644
--- a/zhengcaioa/Services/ProjectService.cs
+++ b/zhengcaioa/Services/ProjectService.cs
@@ -27,7 +27,7 @@
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;
diff --git a/zhengcaioa/zhengcaioa/Controllers/PltUserRoleController.cs b/zhengcaioa/zhengcaioa/Controllers/PltUserRoleController.cs
index b036aba..67ce702 100644
--- a/zhengcaioa/zhengcaioa/Controllers/PltUserRoleController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/PltUserRoleController.cs
@@ -19,15 +19,17 @@
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]
@@ -39,12 +41,23 @@
#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
});
}
diff --git a/zhengcaioa/zhengcaioa/Views/PltUserRole/Index.cshtml b/zhengcaioa/zhengcaioa/Views/PltUserRole/Index.cshtml
index 5e15473..e8dc9e3 100644
--- a/zhengcaioa/zhengcaioa/Views/PltUserRole/Index.cshtml
+++ b/zhengcaioa/zhengcaioa/Views/PltUserRole/Index.cshtml
@@ -95,7 +95,7 @@
<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>
diff --git a/zhengcaioa/zhengcaioa/Views/Project/Select.cshtml b/zhengcaioa/zhengcaioa/Views/Project/Select.cshtml
index b45e2d4..aff4513 100644
--- a/zhengcaioa/zhengcaioa/Views/Project/Select.cshtml
+++ b/zhengcaioa/zhengcaioa/Views/Project/Select.cshtml
@@ -23,18 +23,24 @@
{
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";
+ }
+
+ 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: 100 },
+ }, { 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('銆�');
@@ -50,7 +56,7 @@
}
},
{
- 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('銆�');
@@ -67,7 +73,7 @@
}
},
{
- 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('銆�');
--
Gitblit v1.9.1