diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Sanitation/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Sanitation/Form.cshtml index 418c68752..68ac55b37 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Sanitation/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Sanitation/Form.cshtml @@ -8,16 +8,19 @@
-
分数*
- @*
*@ - +
类型
+
+
+
+
评分
+
检查者
-
日期框*
+
时间*
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Sanitation/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Sanitation/Form.js index 298574ec3..e4aa0b66c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Sanitation/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Sanitation/Form.js @@ -15,16 +15,34 @@ var bootstrap = function ($, learun) { page.initData(); }, bind: function () { - //$('#Grade').lrDataItemSelect({ code: 'DromitoryGrade' }); + $('#AType').lrselect({ + data: [{ text: "卫生", value: "0" }, { text: "纪律", value: "1" }], + text: "text", + value: "value" + }) + $('#Grade').lrselect({ + data: + [ + { text: "5-优", value: "0" }, + { text: "3-良", value: "1" }, + { text: "1-中", value: "2" }, + { text: "0-差", value: "3" } + ], + text: "text", + value: "value" + }) }, initData: function () { if (!!keyValue) { $.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Sanitation/GetFormData?keyValue=' + keyValue, function (data) { for (var id in data) { + console.log(data,"data") if (!!data[id].length && data[id].length > 0) { - $('#' + id ).jfGridSet('refreshdata', data[id]); + $('#' + id).jfGridSet('refreshdata', data[id]); + console.log(id,223) } else { + console.log(id,123) $('[data-table="' + id + '"]').lrSetFormData(data[id]); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Sanitation/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Sanitation/Index.js index e11954e18..eee3741a3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Sanitation/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Sanitation/Index.js @@ -47,7 +47,7 @@ var bootstrap = function ($, learun) { }); // 编辑 $('#lr_edit').on('click', function () { - var keyValue = $('#gridtable').jfGridValue('ID'); + var keyValue = $('#gridtable').jfGridValue('zbid'); if (learun.checkrow(keyValue)) { learun.layerForm({ id: 'form', @@ -63,7 +63,7 @@ var bootstrap = function ($, learun) { }); // 删除 $('#lr_delete').on('click', function () { - var keyValue = $('#gridtable').jfGridValue('ID'); + var keyValue = $('#gridtable').jfGridValue('zbid'); if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { @@ -84,12 +84,121 @@ var bootstrap = function ($, learun) { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/LogisticsManagement/Sanitation/GetPageList', headData: [ - { label: "分数", name: "Grade", width: 100, align: "left" }, - { label: "检查者", name: "GradedUser", width: 100, align: "left" }, - { label: "日期框", name: "GradedTime", width: 100, align: "left" }, - { label: "备注", name: "Remark", width: 100, align: "left" }, + { + label: "类型", name: "AType", width: 80, align: "left", + formatter: function (cellvalue) { + if (cellvalue == 0) { + return "卫生"; + } else { + return "纪律"; + } + } + }, + { + label: "院系", name: "dept", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + key: value, + keyId: 'deptno', + callback: function (_data) { + callback(_data['deptname']); + } + }); + } + }, + { + label: "专业", name: "major", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'majorno', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { + label: "班级", name: "classno", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: value, + keyId: 'classno', + callback: function (_data) { + callback(_data['classname']); + } + }); + } + }, + { + label: "宿舍楼", name: "ApartmentId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_DormitoryData', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: "评价", name: "Grade", width: 100, align: "left", + formatter: function (cellvalue) { + if (cellvalue == 0) { + return "5-优"; + } else if (cellvalue == 1) { + return "3-良"; + } else if (cellvalue == 2) { + return "1-中"; + } else if (cellvalue == 3) { + return "0-差"; + } + } + }, + { + label: "班主任", name: "empnoone", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', + key: value, + keyId: 'f_encode', + callback: function (_data) { + callback(_data['f_realname']); + } + }); + } + }, + { label: "电话", name: "mobileone", width: 100, align: "left" }, + { + label: "辅导员", name: "empnotwo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', + key: value, + keyId: 'f_encode', + callback: function (_data) { + callback(_data['f_realname']); + } + }); + } + }, + { label: "电话", name: "mobiletwo", width: 100, align: "left" }, + { label: "考核人", name: "GradedUser", width: 100, align: "left" }, + { + label: "时间", name: "GradedTime", width: 100, align: "left", + formatter: function (cellvalue) { + return learun.formatDate(cellvalue, 'yyyy-MM-dd'); + } + }, + { label: "备注", name: "demo", width: 100, align: "left" }, ], - mainId: 'ID', + mainId: 'GradedTime', + sidx: 'GradedTime desc', isPage: true }); //page.search(); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Sanitation/Acc_SanitationEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Sanitation/Acc_SanitationEntity.cs index 08937bcc6..8f6763db8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Sanitation/Acc_SanitationEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Sanitation/Acc_SanitationEntity.cs @@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement /// 日 期:2019-05-05 15:44 /// 描 述:宿舍卫生管理 /// - public class Acc_SanitationEntity + public class Acc_SanitationEntity { #region 实体成员 /// @@ -25,7 +25,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement [Column("ROOMID")] public string RoomID { get; set; } /// - /// 卫生分数 + /// 评价 /// [Column("GRADE")] public string Grade { get; set; } @@ -54,6 +54,11 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement /// [Column("REMARK")] public string Remark { get; set; } + /// + /// 类型 + /// + [Column("ATYPE")] + public string AType { get; set; } #endregion #region 扩展操作 @@ -74,6 +79,26 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } #endregion #region 扩展字段 + [NotMapped] + public string dept { get; set; } + [NotMapped] + public string major { get; set; } + [NotMapped] + public string classno { get; set; } + [NotMapped] + public string empnoone { get; set; } + [NotMapped] + public string mobileone { get; set; } + [NotMapped] + public string empnotwo { get; set; } + [NotMapped] + public string mobiletwo { get; set; } + [NotMapped] + public string zbid { get; set; } + [NotMapped] + public string demo { get; set; } + [NotMapped] + public string ApartmentId { get; set; } #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Sanitation/SanitationService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Sanitation/SanitationService.cs index 6745cf7b5..c84bb5e2b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Sanitation/SanitationService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Sanitation/SanitationService.cs @@ -30,25 +30,25 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement try { var strSql = new StringBuilder(); - strSql.Append("SELECT "); - strSql.Append(@" - t.ID, - t.Grade, - t.GradedUser, - t.GradedTime, - t.Remark - "); - strSql.Append(" FROM Acc_Sanitation t "); - strSql.Append(" WHERE 1=1 "); + strSql.Append(@"select fb.* ,zb.ID zbid,zb.AType,zb.Grade,zb.GradedUser,zb.GradedTime,zb.Remark demo from Acc_Sanitation zb + left join( + select ci.*, ad.* from Acc_DormitoryBuild ad + left join ( + select aa.classno ,aa.classname,fb1.empno as empnoone,fb1.Mobile as MobileOne, + fb2.empno empnoTwo,fb2.Mobile as MobileTwo from classinfo aa + left join empinfo fb1 on aa.classdiredctorno = fb1.EmpNo + left join empinfo fb2 on aa.ClassTutorNo = fb2.EmpNo + )ci on ci.classno = ad.class + )fb on zb.roomid = fb.id where 1=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数 var dp = new DynamicParameters(new { }); if (!queryParam["RoomID"].IsEmpty()) { dp.Add("RoomID", queryParam["RoomID"].ToString(), DbType.String); - strSql.Append(" AND t.RoomID =@RoomID "); + strSql.Append(" AND zb.RoomID =@RoomID "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination).OrderByDescending(a=>a.GradedTime).ToList(); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination).OrderByDescending(a => a.GradedTime).ToList(); } catch (Exception ex) { @@ -95,7 +95,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement { try { - return this.BaseRepository("CollegeMIS").FindList().Where(a=>a.BuildType!="5").OrderBy(a => a.Name).ToList(); + return this.BaseRepository("CollegeMIS").FindList().Where(a => a.BuildType != "5").OrderBy(a => a.Name).ToList(); } catch (Exception ex) { @@ -147,6 +147,9 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement { try { + var loginuser = LoginUserInfo.Get(); + entity.CreateUser = loginuser.realName; + entity.CreateTime = DateTime.Now; if (!string.IsNullOrEmpty(keyValue)) { entity.Modify(keyValue);