@@ -16,6 +16,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public class OfficeEquipmentController : MvcControllerBase | |||
{ | |||
private OfficeEquipmentIBLL officeEquipmentIBLL = new OfficeEquipmentBLL(); | |||
private EmpInfoIBLL empinfoIBLL = new EmpInfoBLL(); | |||
#region 视图功能 | |||
@@ -26,7 +27,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
@@ -35,7 +36,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 生成二维码 | |||
@@ -44,6 +45,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[HttpGet] | |||
public ActionResult QRCode(string keyValue) | |||
{ | |||
var Data = officeEquipmentIBLL.GetOfficeEquipmentEntity(keyValue); | |||
var emp = empinfoIBLL.GetEmpInfoEntityByEmpNo(Data.Name); | |||
ViewBag.qrcode = "设备名称:" + Data.DeviceName + ",设备编号:" + Data.Code + ",配置:" + Data.Description + ",使用人:" + emp.EmpName; | |||
return View(); | |||
} | |||
#endregion | |||
@@ -80,8 +84,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var OfficeEquipmentData = officeEquipmentIBLL.GetOfficeEquipmentEntity( keyValue ); | |||
var jsonData = new { | |||
var OfficeEquipmentData = officeEquipmentIBLL.GetOfficeEquipmentEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
OfficeEquipment = OfficeEquipmentData, | |||
}; | |||
return Success(jsonData); | |||
@@ -114,7 +119,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
OfficeEquipmentEntity entity = strEntity.ToObject<OfficeEquipmentEntity>(); | |||
officeEquipmentIBLL.SaveEntity(keyValue,entity); | |||
officeEquipmentIBLL.SaveEntity(keyValue, entity); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
} | |||
@@ -4,13 +4,17 @@ | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="OfficeEquipment"> | |||
<div class="lr-form-item-title">名称<font face="宋体">*</font></div> | |||
<div class="lr-form-item-title">姓名<font face="宋体">*</font></div> | |||
<div id="Name" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="OfficeEquipment"> | |||
<div class="lr-form-item-title">部门<font face="宋体">*</font></div> | |||
<div id="Department" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="OfficeEquipment"> | |||
<div class="lr-form-item-title">设备编号<font face="宋体">*</font></div> | |||
<input id="Code" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="OfficeEquipment"> | |||
<div class="lr-form-item-title">设备名称<font face="宋体">*</font></div> | |||
<input id="DeviceName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
@@ -11,13 +11,17 @@ | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">名称</div> | |||
<div class="lr-form-item-title">姓名</div> | |||
<div id="Name"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">部门</div> | |||
<div id="Department"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">设备编号</div> | |||
<input id="Code" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">设备名称</div> | |||
<input id="DeviceName" type="text" class="form-control" /> | |||
@@ -29,7 +29,7 @@ var bootstrap = function ($, learun) { | |||
title: '新增', | |||
url: top.$.rootUrl + '/EducationalAdministration/OfficeEquipment/Form', | |||
width: 600, | |||
height: 400, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
@@ -72,8 +72,8 @@ var bootstrap = function ($, learun) { | |||
id: 'formqrCode', | |||
title: '二维码', | |||
url: top.$.rootUrl + '/EducationalAdministration/OfficeEquipment/qrCode?keyValue=' + keyValue, | |||
width: 700, | |||
height: 900, | |||
width: 600, | |||
height: 600, | |||
btn: null, | |||
end: function () { refreshGirdData(); } | |||
}); | |||
@@ -86,10 +86,11 @@ var bootstrap = function ($, learun) { | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
$('#gridtable').lrAuthorizeJfGridLei({ | |||
url: top.$.rootUrl + '/EducationalAdministration/OfficeEquipment/GetPageList', | |||
headData: [ | |||
{ label: "名称", name: "Name", width: 100, align: "left", | |||
{ | |||
label: "姓名", name: "Name", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op,$cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'TeacherInfo', | |||
@@ -110,7 +111,9 @@ var bootstrap = function ($, learun) { | |||
callback(_data['name']); | |||
} | |||
}); | |||
}}, | |||
} | |||
}, | |||
{ label: "设备编号", name: "Code", width: 100, align: "left"}, | |||
{ label: "设备名称", name: "DeviceName", width: 100, align: "left"}, | |||
{ label: "配置描述", name: "Description", width: 100, align: "left"}, | |||
{ label: "备注", name: "Remark", width: 100, align: "left"}, | |||
@@ -6,31 +6,38 @@ | |||
@*<div id="subprint" style="margin:0 auto;cursor:pointer;margin-bottom:10px; position:relative; width:80px; height:28px;line-height:28px;border-radius:4px; background:#039cfd;color:#FFF;text-align:center;"> | |||
打印 | |||
</div>*@ | |||
<script> | |||
var qrCode = "@ViewBag.qrCode"; | |||
</script> | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-6 lr-form-item" data-table="OfficeEquipment"> | |||
<div class="lr-form-item-title">名称<font face="宋体">*</font></div> | |||
<div id="Name" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="OfficeEquipment"> | |||
<div class="lr-form-item-title">部门<font face="宋体">*</font></div> | |||
<div id="Department" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="OfficeEquipment"> | |||
<div class="lr-form-item-title">设备名称<font face="宋体">*</font></div> | |||
<input id="DeviceName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="OfficeEquipment"> | |||
<div class="lr-form-item-title">配置描述<font face="宋体">*</font></div> | |||
<input id="Description" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="OfficeEquipment"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height:100px;"></textarea> | |||
</div> | |||
<div class="lr-form-item-title">姓名<font face="宋体">*</font></div> | |||
<div id="Name" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
@*<div class="col-xs-6 lr-form-item" data-table="OfficeEquipment"> | |||
<div class="lr-form-item-title">部门<font face="宋体">*</font></div> | |||
<div id="Department" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="OfficeEquipment"> | |||
<div class="lr-form-item-title">设备编号<font face="宋体">*</font></div> | |||
<input id="DeviceName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="OfficeEquipment"> | |||
<div class="lr-form-item-title">设备名称<font face="宋体">*</font></div> | |||
<input id="DeviceName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="OfficeEquipment"> | |||
<div class="lr-form-item-title">配置描述<font face="宋体">*</font></div> | |||
<input id="Description" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="OfficeEquipment"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height:100px;"></textarea> | |||
</div>*@ | |||
<div class="col lr-form-item" data-table="OfficeEquipment"> | |||
<div id="qrCode" style="text-align:center"></div> | |||
<div id="qrCode" style="text-align:center"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/OfficeEquipment/qrCode.js") | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuVolunteer/server.js") | |||
@*@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuVolunteer/server.js")*@ | |||
@Html.AppendJsFile("/Content/jquery/jquery-1.10.2.min.js", "/Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js", "/Content/js/qrcode.min.js") |
@@ -61,7 +61,7 @@ var bootstrap = function ($, learun) { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
//扫码签到 | |||
makeCode(data[id].Id); | |||
makeCode(qrCode); | |||
} | |||
}); | |||
} | |||
@@ -110,5 +110,6 @@ var qrcode = new QRCode(document.getElementById("qrCode"), { | |||
height: 550 | |||
}); | |||
function makeCode(urls) { | |||
console.log(urls,"urls") | |||
qrcode.makeCode(urls); | |||
} |
@@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// 日 期:2024-09-18 10:42 | |||
/// 描 述:配置描述 | |||
/// </summary> | |||
public class OfficeEquipmentEntity | |||
public class OfficeEquipmentEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
@@ -20,6 +20,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 设备编号 | |||
/// </summary> | |||
[Column("CODE")] | |||
public string Code { get; set; } | |||
/// <summary> | |||
/// 设备名称 | |||
/// </summary> | |||
[Column("DEVICENAME")] | |||
@@ -51,6 +51,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
dp.Add("Department", queryParam["Department"].ToString(), DbType.String); | |||
strSql.Append(" AND t.Department = @Department "); | |||
} | |||
if (!LoginUserInfo.Get().isSystem) | |||
{ | |||
if (!LoginUserInfo.Get().roleIds.Contains("5a6e22b1-2a08-4258-9964-3cb7fbb9ebee")) | |||
{ | |||
strSql.Append(" AND t.Name = " + LoginUserInfo.Get().account + " "); | |||
} | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<OfficeEquipmentEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||