@@ -8,16 +8,19 @@ | |||
<input id="RoomID" value="@ViewBag.RoomID" type="hidden" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_Sanitation"> | |||
<div class="lr-form-item-title">分数<font face="宋体">*</font></div> | |||
@*<div id="Grade" isvalid="yes" checkexpession="NotNull"></div>*@ | |||
<input id="Grade" type="text" class="from-control" isvalid="yes" checkexpession="NotNull" /> | |||
<div class="lr-form-item-title">类型</div> | |||
<div id="AType"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_Sanitation"> | |||
<div class="lr-form-item-title">评分</div> | |||
<div id="Grade"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_Sanitation"> | |||
<div class="lr-form-item-title">检查者</div> | |||
<input id="GradedUser" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_Sanitation"> | |||
<div class="lr-form-item-title">日期框<font face="宋体">*</font></div> | |||
<div class="lr-form-item-title">时间<font face="宋体">*</font></div> | |||
<input id="GradedTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd',onpicked: function () { $('#GradedTime').trigger('change'); } })" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Acc_Sanitation"> | |||
@@ -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]); | |||
} | |||
} | |||
@@ -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(); | |||
@@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
/// 日 期:2019-05-05 15:44 | |||
/// 描 述:宿舍卫生管理 | |||
/// </summary> | |||
public class Acc_SanitationEntity | |||
public class Acc_SanitationEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
@@ -25,7 +25,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
[Column("ROOMID")] | |||
public string RoomID { get; set; } | |||
/// <summary> | |||
/// 卫生分数 | |||
/// 评价 | |||
/// </summary> | |||
[Column("GRADE")] | |||
public string Grade { get; set; } | |||
@@ -54,6 +54,11 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
/// </summary> | |||
[Column("REMARK")] | |||
public string Remark { get; set; } | |||
/// <summary> | |||
/// 类型 | |||
/// </summary> | |||
[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 | |||
} | |||
} | |||
@@ -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<Acc_SanitationEntity>(strSql.ToString(), dp, pagination).OrderByDescending(a=>a.GradedTime).ToList(); | |||
return this.BaseRepository("CollegeMIS").FindList<Acc_SanitationEntity>(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<Acc_DormitoryBuildEntity>().Where(a=>a.BuildType!="5").OrderBy(a => a.Name).ToList(); | |||
return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>().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); | |||