@@ -20,7 +20,23 @@ var bootstrap = function ($, learun) { | |||||
$('#Files').lrUploader(); | $('#Files').lrUploader(); | ||||
var ContentsUE = UE.getEditor('Contents'); | var ContentsUE = UE.getEditor('Contents'); | ||||
$('#Coachs').lrUserSelect(1); | $('#Coachs').lrUserSelect(1); | ||||
$('#Peoples').lrUserSelect(1); | |||||
//$('#Peoples').lrselect({ | |||||
// // 字段 | |||||
// value: "F_AreaCode", | |||||
// text: "F_AreaName", | |||||
// title: "F_AreaName", | |||||
// type: 'multiple', | |||||
// // 展开最大高度 | |||||
// maxHeight: 200, | |||||
// // 是否允许搜索 | |||||
// allowSearch: true, | |||||
// // 访问数据接口地址 | |||||
// url: top.$.rootUrl + '/LR_SystemModule/Area/Getlist', | |||||
// // 访问数据接口参数 | |||||
// param: { parentId: '' }, | |||||
//}); | |||||
$('#Peoples').lrDataSourceSelect({ code: 'StuInfoBasic', value: 'stuno', text: 'stuname', type: 'multiple' }); | |||||
//$('#Teamid').lrUserSelect(1); | //$('#Teamid').lrUserSelect(1); | ||||
$('#Teamid').lrDataSourceSelect({ code: 'Trainteam', value: 'name', text: 'name' }); | $('#Teamid').lrDataSourceSelect({ code: 'Trainteam', value: 'name', text: 'name' }); | ||||
//$('#Peoples').lrDataItemSelect({ code: '' }); | //$('#Peoples').lrDataItemSelect({ code: '' }); | ||||
@@ -222,29 +222,72 @@ var bootstrap = function ($, learun) { | |||||
{ | { | ||||
label: '教练员', name: 'Coachs', width: 200, align: 'left', | label: '教练员', name: 'Coachs', width: 200, align: 'left', | ||||
formatterAsync: function (callback, value, row, op, $cell) { | formatterAsync: function (callback, value, row, op, $cell) { | ||||
learun.clientdata.getAsync('user', { | |||||
key: value, | |||||
callback: function (_data) { | |||||
callback(_data.name); | |||||
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=' + 'teacheruserdata', | |||||
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=' + 'teacheruserdata', | |||||
key: value, | |||||
keyId: 'f_userid', | |||||
callback: function (_data) { | |||||
callback(_data['f_realname']); | |||||
} | |||||
}); | |||||
} | |||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
label: '运动员', name: 'Peoples', width: 200, align: 'left', | label: '运动员', name: 'Peoples', width: 200, align: 'left', | ||||
formatterAsync: function (callback, value, row, op, $cell) { | formatterAsync: function (callback, value, row, op, $cell) { | ||||
learun.clientdata.getAsync('user', { | |||||
key: value, | |||||
keyId: 'id', | |||||
textId: 'name', | |||||
callback: function (text) { | |||||
var str = ""; | |||||
for (var i = 0; i < text.length; i++) { | |||||
str+=text[i].name+"," | |||||
} | |||||
callback(str); | |||||
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=' + 'StuInfoBasic', | |||||
key: timearr[i], | |||||
keyId: 'stuno', | |||||
callback: function (_data) { | |||||
content += _data['stuname'] + ","; | |||||
} | |||||
}); | |||||
} | } | ||||
}); | |||||
content = content.substring(0, content.length - 1); | |||||
callback(content); | |||||
} else { | |||||
learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic', | |||||
key: value, | |||||
keyId: 'stuno', | |||||
callback: function (_data) { | |||||
callback(_data['stuname']); | |||||
} | |||||
}); | |||||
} | |||||
//learun.clientdata.getAsync('custmerData', { | |||||
// url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic', | |||||
// key: value, | |||||
// keyId: 'stuno', | |||||
// callback: function (_data) { | |||||
// callback(_data['stuname']); | |||||
// } | |||||
//}); | |||||
} | } | ||||
}, | }, | ||||
{ label: '时间', name: 'Createtime', width: 150, align: 'left' } | { label: '时间', name: 'Createtime', width: 150, align: 'left' } | ||||
@@ -8,7 +8,7 @@ | |||||
<input id="Name" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | <input id="Name" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | ||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item" data-table="Notice_Train_Teams" > | <div class="col-xs-12 lr-form-item" data-table="Notice_Train_Teams" > | ||||
<div class="lr-form-item-title">下拉框<font face="宋体">*</font></div> | |||||
<div class="lr-form-item-title">人员<font face="宋体">*</font></div> | |||||
<div id="Teamusers" isvalid="yes" checkexpession="NotNull" ></div> | <div id="Teamusers" isvalid="yes" checkexpession="NotNull" ></div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -15,7 +15,7 @@ var bootstrap = function ($, learun) { | |||||
page.initData(); | page.initData(); | ||||
}, | }, | ||||
bind: function () { | bind: function () { | ||||
$('#Teamusers').lrUserSelect(1); | |||||
$('#Teamusers').lrUserSelect({ type: '1' }); | |||||
//$('#Teamusers').lrDataSourceSelect({ code: 'teacheruserdata',value: 'f_userid',text: 'f_userid' }); | //$('#Teamusers').lrDataSourceSelect({ code: 'teacheruserdata',value: 'f_userid',text: 'f_userid' }); | ||||
}, | }, | ||||
initData: function () { | initData: function () { | ||||
@@ -32,7 +32,7 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
// 编辑 | // 编辑 | ||||
$('#lr_edit').on('click', function () { | $('#lr_edit').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('BelongId'); | |||||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
learun.layerForm({ | learun.layerForm({ | ||||
id: 'form', | id: 'form', | ||||
@@ -48,7 +48,7 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
// 删除 | // 删除 | ||||
$('#lr_delete').on('click', function () { | $('#lr_delete').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('BelongId'); | |||||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
learun.layerConfirm('是否确认删除该项!', function (res) { | learun.layerConfirm('是否确认删除该项!', function (res) { | ||||
if (res) { | if (res) { | ||||
@@ -66,19 +66,37 @@ var bootstrap = function ($, learun) { | |||||
url: top.$.rootUrl + '/Ask/Notice_Train_Teams/GetPageList', | url: top.$.rootUrl + '/Ask/Notice_Train_Teams/GetPageList', | ||||
headData: [ | headData: [ | ||||
{ label: "队伍名称", name: "Name", width: 100, align: "left"}, | { label: "队伍名称", name: "Name", width: 100, align: "left"}, | ||||
{ label: "下拉框", name: "Teamusers", width: 100, align: "left", | |||||
{ label: "人员", name: "Teamusers", width: 100, align: "left", | |||||
formatterAsync: function (callback, value, row, op,$cell) { | formatterAsync: function (callback, value, row, op,$cell) { | ||||
learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', | |||||
key: value, | |||||
keyId: 'f_userid', | |||||
callback: function (_data) { | |||||
callback(_data['f_userid']); | |||||
} | |||||
}); | |||||
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=' + 'teacheruserdata', | |||||
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=' + 'teacheruserdata', | |||||
key: value, | |||||
keyId: 'f_userid', | |||||
callback: function (_data) { | |||||
callback(_data['f_realname']); | |||||
} | |||||
}); | |||||
} | |||||
}}, | }}, | ||||
], | ], | ||||
mainId:'BelongId', | |||||
mainId:'Id', | |||||
isPage: true | isPage: true | ||||
}); | }); | ||||
page.search(); | page.search(); | ||||
@@ -239,17 +239,19 @@ namespace Learun.Application.TwoDevelopment.Ask | |||||
var postIds = userinfo.postIds; | var postIds = userinfo.postIds; | ||||
var strSql = new StringBuilder(); | var strSql = new StringBuilder(); | ||||
var misdbname = BaseRepository("CollegeMIS").getDbConnection().Database; | |||||
var basedbname = BaseRepository().getDbConnection().Database; | |||||
//SELECT t.*,r.RNewsId,r.RTime,d.F_FullName FROM Notice_Train_Sports t | //SELECT t.*,r.RNewsId,r.RTime,d.F_FullName FROM Notice_Train_Sports t | ||||
//left join NoticeLog_Train_Sports r on t.T_id = r.NewsId and r.RUserId = 'system' | //left join NoticeLog_Train_Sports r on t.T_id = r.NewsId and r.RUserId = 'system' | ||||
// left join adms7ultimate2_新疆体育.dbo.lr_base_user u on u.F_UserId = 'system' | |||||
// left join adms7ultimate2_新疆体育.dbo.LR_BASE_DEPARTMENT d on d.F_DepartmentId = t.Noticedept | |||||
// left join "+ basedbname + ".dbo.lr_base_user u on u.F_UserId = 'system' | |||||
// left join "+ basedbname + ".dbo.LR_BASE_DEPARTMENT d on d.F_DepartmentId = t.Noticedept | |||||
// WHERE | // WHERE | ||||
// t.Noticedept like '%7781c7a8-0db2-492b-bebb-fa7d45af5406%' or t.noticepeople like '%%' ORDER BY t.createtime DESC | // t.Noticedept like '%7781c7a8-0db2-492b-bebb-fa7d45af5406%' or t.noticepeople like '%%' ORDER BY t.createtime DESC | ||||
strSql.Append("SELECT t.*,r.RNewsId,r.RTime,d.F_FullName FROM Notice_Train_Sports t "); | strSql.Append("SELECT t.*,r.RNewsId,r.RTime,d.F_FullName FROM Notice_Train_Sports t "); | ||||
strSql.Append(" left join NoticeLog_Train_Sports r on t.T_id = r.NewsId and r.RUserId =@userId "); | strSql.Append(" left join NoticeLog_Train_Sports r on t.T_id = r.NewsId and r.RUserId =@userId "); | ||||
strSql.Append(" left join adms7ultimate2_新疆体育.dbo.lr_base_user u on u.F_UserId =@userId "); | |||||
strSql.Append(" left join adms7ultimate2_新疆体育.dbo.LR_BASE_DEPARTMENT d on d.F_DepartmentId = t.Noticedept "); | |||||
strSql.Append(" left join "+ basedbname + ".dbo.lr_base_user u on u.F_UserId =@userId "); | |||||
strSql.Append(" left join " + basedbname + ".dbo.LR_BASE_DEPARTMENT d on d.F_DepartmentId = t.Noticedept "); | |||||
strSql.Append(" WHERE 1=1 "); | strSql.Append(" WHERE 1=1 "); | ||||
//去掉用户入职时间条件 | //去掉用户入职时间条件 | ||||
//if (userinfo.account.Contains("20")) | //if (userinfo.account.Contains("20")) | ||||
@@ -62,7 +62,7 @@ namespace Learun.Application.TwoDevelopment.Ask | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
return this.BaseRepository("CollegeMIS").FindEntity<Notice_Train_TeamsEntity>(keyValue.ToInt()); | |||||
return this.BaseRepository("CollegeMIS").FindEntity<Notice_Train_TeamsEntity>(keyValue); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||