@@ -43,11 +43,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult QRCode(string keyValue) | |||
public ActionResult QRCode() | |||
{ | |||
var Data = officeEquipmentIBLL.GetOfficeEquipmentEntity(keyValue); | |||
var emp = empinfoIBLL.GetEmpInfoEntityByEmpNo(Data.Name); | |||
ViewBag.qrcode = "设备名称:" + Data.DeviceName + ",设备编号:" + Data.Code + ",配置:" + Data.Description + ",使用人:" + emp.EmpName; | |||
return View(); | |||
} | |||
#endregion | |||
@@ -90,7 +87,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
OfficeEquipment = OfficeEquipmentData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -38,6 +38,10 @@ var bootstrap = function ($, learun) { | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (keyValue.indexOf(',') != -1) { | |||
learun.alert.warning("只能选择一条记录进行编辑!"); | |||
return; | |||
} | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
@@ -67,6 +71,10 @@ var bootstrap = function ($, learun) { | |||
// 查看二维码 | |||
$('#lr_qrCode').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (keyValue.indexOf(',') != -1) { | |||
learun.alert.warning("只能选择一条记录进行编辑!"); | |||
return; | |||
} | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'formqrCode', | |||
@@ -119,7 +127,8 @@ var bootstrap = function ($, learun) { | |||
{ label: "备注", name: "Remark", width: 100, align: "left"}, | |||
], | |||
mainId:'Id', | |||
isPage: true | |||
isPage: true, | |||
isMultiselect: true, | |||
}); | |||
page.search(); | |||
}, | |||
@@ -39,5 +39,5 @@ | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/OfficeEquipment/qrCode.js") | |||
@*@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuVolunteer/server.js")*@ | |||
@*@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuVolunteerPhone/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") |
@@ -50,49 +50,16 @@ var bootstrap = function ($, learun) { | |||
param: {}, | |||
}); | |||
}, | |||
initData: function () { | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OfficeEquipment/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
//扫码签到 | |||
makeCode(qrCode); | |||
} | |||
}); | |||
var currentUrl1 = "http://api.cyzjzx.com"; | |||
//var currentUrl1 = "http://192.168.10.58:8012"; | |||
//扫码签到 | |||
makeCode(currentUrl1 + '/arrangelesson/getqrcode?keyValue=' + keyValue); | |||
} | |||
} | |||
}; | |||
//// 设置表单数据 | |||
//setFormData = function (processId, param, callback) { | |||
// if (!!processId) { | |||
// $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/MeetingManagement/GetFormDataByProcessId?processId=' + processId, function (data) { | |||
// for (var id in data) { | |||
// if (!!data[id] && data[id].length > 0) { | |||
// $('#' + id).jfGridSet('refreshdata', data[id]); | |||
// } | |||
// else { | |||
// if (id == 'MeetingManagement' && data[id]) { | |||
// keyValue = data[id].Id; | |||
// } | |||
// $('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
// } | |||
// } | |||
// }); | |||
// } | |||
// callback && callback(); | |||
//} | |||
// 验证数据是否填写完整 | |||
//validForm = function () { | |||
// if (!$('body').lrValidform()) { | |||
// return false; | |||
// } | |||
// return true; | |||
//}; | |||
// 保存数据 | |||
save = function (processId, callBack, i) { | |||
if (!!callBack) { | |||
@@ -110,6 +77,6 @@ var qrcode = new QRCode(document.getElementById("qrCode"), { | |||
height: 420 | |||
}); | |||
function makeCode(urls) { | |||
console.log(urls,"urls") | |||
console.log(urls, "urls") | |||
qrcode.makeCode(urls); | |||
} |
@@ -41,6 +41,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
dp.Add("Name", queryParam["Name"].ToString(), DbType.String); | |||
strSql.Append(" AND t.Name = @Name "); | |||
} | |||
if (!queryParam["Code"].IsEmpty()) | |||
{ | |||
dp.Add("Code", "%" + queryParam["Code"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.Code like @Code "); | |||
} | |||
if (!queryParam["DeviceName"].IsEmpty()) | |||
{ | |||
dp.Add("DeviceName", "%" + queryParam["DeviceName"].ToString() + "%", DbType.String); | |||
@@ -55,7 +60,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
if (!LoginUserInfo.Get().roleIds.Contains("5a6e22b1-2a08-4258-9964-3cb7fbb9ebee")) | |||
{ | |||
strSql.Append(" AND t.Name = " + LoginUserInfo.Get().account + " "); | |||
strSql.Append(" AND t.Name = '" + LoginUserInfo.Get().account + "' "); | |||
} | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<OfficeEquipmentEntity>(strSql.ToString(), dp, pagination); | |||
@@ -107,12 +112,20 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").Delete<OfficeEquipmentEntity>(t => t.Id == keyValue); | |||
//多个删除 | |||
var keyValueArr = keyValue.Split(','); | |||
foreach (var item in keyValueArr) | |||
{ | |||
db.Delete<OfficeEquipmentEntity>(t => t.Id == item); | |||
} | |||
db.Commit(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Rollback(); | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
@@ -58,13 +58,37 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
var user = LoginUserInfo.Get(); | |||
if (!user.isSystem) //超管/安全办 | |||
{ | |||
var dept = this.BaseRepository().FindList<DepartmentEntity>(x => x.F_SchoolMaster == //user.realName); | |||
"李明纯").ToList(); | |||
var depts = ""; | |||
if (user.roleIds.Contains("9593aeff-a62b-45ea-bfd1-c9766669c1a8"))//分管领导 | |||
{ | |||
strSql.Append(" AND (t.Status = 2 or t.Name = '" + user.userId + "')"); | |||
if (dept.Count() > 0) | |||
{ | |||
for (int i = 0; i < dept.Count(); i++) | |||
{ | |||
if (i == dept.Count()-1) | |||
{ | |||
depts += " t.Department= '" + dept[i].F_DepartmentId + "'"; | |||
} | |||
else | |||
{ | |||
depts += "t.Department='" + dept[i].F_DepartmentId + "' or "; | |||
} | |||
} | |||
strSql.Append(" and (" + depts + ")"); | |||
} | |||
else | |||
{ | |||
strSql.Append(" AND t.Department = '" + user.departmentId + "' "); | |||
} | |||
strSql.Append(" and t.Name = '" + user.userId + "' "); | |||
} | |||
else if (user.roleIds.Contains("ab90ee97-c8e2-4bc9-80b4-68aff407c777"))//部门领导 | |||
{ | |||
strSql.Append(" AND t.Department = '" + user.departmentId + "'"); | |||
strSql.Append(" AND t.Department = '" + user.departmentId | |||
+ "' and (t.Status = 1 or t.Name = '" + user.userId + "')"); | |||
} | |||
else if (user.roleIds.Contains("a58a6f8f-0e50-4708-ae35-1fb85761a7b1")) | |||
{ | |||