From 751f93df90906c036b30d3e78cc3439d4253090d Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Sat, 18 Sep 2021 14:49:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=BA=BA=E5=91=98=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/SRProjectPeople/Form.cshtml | 4 +- .../Views/SRProjectPeople/Form.js | 22 ++++- .../Views/SRProjectPeople/Index.js | 97 +++++++++++-------- .../SRProjectPeople/SRProjectPeopleEntity.cs | 9 +- .../SRProjectPeople/SRProjectPeopleService.cs | 4 +- 5 files changed, 90 insertions(+), 46 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Form.cshtml index 7c2f0f189..713a57b58 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Form.cshtml @@ -8,8 +8,8 @@
-
项目负责人
-
+
项目负责人*
+
项目成员*
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Form.js index b57bd8af4..0b0dc8528 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Form.js @@ -15,16 +15,30 @@ var bootstrap = function ($, learun) { page.initData(); }, bind: function () { - $('#SRProjectBasicId').lrDataItemSelect({ code: 'NoticeCategory' }); - $('#ManageName').lrDataSourceSelect({ code: 'EmpInfo',value: 'empid',text: 'empname' }); - $('#Players').lrDataSourceSelect({ code: 'EmpInfo',value: 'empid',text: 'empname' }); + $('#SRProjectBasicId').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/CustomFunction/SRProjectBasic/GetList', + value: "ID", + text: "EnCode" + }); + $('#ManageName').lrDataSourceSelect({ code: 'EmpInfo', value: 'empid', text: 'empname' }); + $('#Players').lrUserSelect({ type: '1' }); + + //$('#Players').lrselect({ + // allowSearch: true, + // url: top.$.rootUrl + '/CustomFunction/SRProjectBasic/GetList', + // value: 'empid', + // text: 'empname', + // // 类型 + // type: 'multiple' + //}); }, initData: function () { if (!!keyValue) { $.lrSetForm(top.$.rootUrl + '/CustomFunction/SRProjectPeople/GetFormData?keyValue=' + keyValue, function (data) { for (var id in data) { if (!!data[id].length && data[id].length > 0) { - $('#' + id ).jfGridSet('refreshdata', data[id]); + $('#' + id).jfGridSet('refreshdata', data[id]); } else { $('[data-table="' + id + '"]').lrSetFormData(data[id]); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Index.js index f353e40b8..0ad9ba6c3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectPeople/Index.js @@ -16,8 +16,13 @@ var bootstrap = function ($, learun) { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 220, 400); - $('#SRProjectBasicId').lrDataItemSelect({ code: 'NoticeCategory' }); - $('#ManageName').lrDataSourceSelect({ code: 'EmpInfo',value: 'empid',text: 'empname' }); + $('#SRProjectBasicId').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/CustomFunction/SRProjectBasic/GetList', + value: "ID", + text: "EnCode" + }); + $('#ManageName').lrDataSourceSelect({ code: 'EmpInfo', value: 'empid', text: 'empname' }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -57,7 +62,7 @@ var bootstrap = function ($, learun) { if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/CustomFunction/SRProjectPeople/DeleteForm', { keyValue: keyValue}, function () { + learun.deleteForm(top.$.rootUrl + '/CustomFunction/SRProjectPeople/DeleteForm', { keyValue: keyValue }, function () { refreshGirdData(); }); } @@ -71,50 +76,66 @@ var bootstrap = function ($, learun) { }, // 初始化列表 initGird: function () { - $('#gridtable').lrAuthorizeJfGrid({ + $('#gridtable').jfGrid({ url: top.$.rootUrl + '/CustomFunction/SRProjectPeople/GetPageList', headData: [ - { label: "项目编号", name: "SRProjectBasicId", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'NoticeCategory', - callback: function (_data) { - callback(_data.text); - } - }); - }}, - { label: "项目负责人", name: "ManageName", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', - key: value, - keyId: 'empid', - callback: function (_data) { - callback(_data['empname']); - } - }); - }}, - { label: "项目成员", name: "Players", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', - key: value, - keyId: 'empid', - callback: function (_data) { - callback(_data['empname']); - } - }); - }}, + { label: "项目编号", name: "EnCode", width: 100, align: "left" }, + { + label: "项目负责人", name: "ManageName", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', + key: value, + keyId: 'empid', + callback: function (_data) { + callback(_data['empname']); + } + }); + } + }, + { + label: "项目成员", name: "Players", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + if (value.indexOf(',') != -1) { + var content = ''; + var timearr = value.split(','); + for (var i = 0; i < timearr.length; i++) { + learun.clientdata.getAsync('custmerData', + { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser', + key: timearr[i], + keyId: 'f_userid', + callback: function (_data) { + content += _data['f_realname'] + ','; + } + }); + } + content = content.substring(0, content.length - 1); + callback(content); + } else { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser', + key: value, + keyId: 'f_userid', + callback: function (_data) { + callback(_data['f_realname']); + } + }); + } + + + + } + }, ], - mainId:'ID', + mainId: 'ID', isPage: true }); page.search(); }, search: function (param) { param = param || {}; - $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleEntity.cs index 172d5ad59..27f3c11fd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleEntity.cs @@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction /// 日 期:2021-09-15 17:10 /// 描 述:项目人员管理 /// - public class SRProjectPeopleEntity + public class SRProjectPeopleEntity { #region 实体成员 /// @@ -58,6 +58,10 @@ namespace Learun.Application.TwoDevelopment.CustomFunction public void Create() { this.ID = Guid.NewGuid().ToString(); + this.CreateTime=DateTime.Now; + var userinfo = LoginUserInfo.Get(); + this.CreateUserId = userinfo.userId; + this.CreateUserName = userinfo.realName; } /// /// 编辑调用 @@ -69,6 +73,9 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } #endregion #region 扩展字段 + [NotMapped] + public string EnCode { get; set; } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleService.cs index 60cd5514b..ec9d40610 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectPeople/SRProjectPeopleService.cs @@ -35,9 +35,11 @@ namespace Learun.Application.TwoDevelopment.CustomFunction t.ID, t.SRProjectBasicId, t.ManageName, - t.Players + t.Players, +s.EnCode "); strSql.Append(" FROM SRProjectPeople t "); + strSql.Append(" join SRProjectBasic s on t.SRProjectBasicId=s.Id "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数