Przeglądaj źródła

【增加】移动端:学生请假管理;

master
dyy 3 lat temu
rodzic
commit
76f5a67244
16 zmienionych plików z 948 dodań i 1 usunięć
  1. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/Check/Check.css
  2. +24
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/Check/Check.html
  3. +170
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/Check/Check.js
  4. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/Check/form/form.css
  5. +35
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/Check/form/form.html
  6. +164
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/Check/form/form.js
  7. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/StuLeaveManagement.css
  8. +26
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/StuLeaveManagement.html
  9. +173
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/StuLeaveManagement.js
  10. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/form/form.css
  11. +26
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/form/form.html
  12. +161
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/form/form.js
  13. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj
  14. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuAttendanceLeaveApi.cs
  15. +161
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuLeaveManagementApi.cs
  16. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config

+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/Check/Check.css Wyświetl plik

@@ -0,0 +1 @@


+ 24
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/Check/Check.html Wyświetl plik

@@ -0,0 +1,24 @@
<div class="lr-page lr-EducationalAdministrationStuLeaveManagement-page">
<div class="lr-page-tool">
<div class="lr-tool-left">
总共<span class="lr-badge lr-badge-primary">0</span>条
</div>
<div class="lr-tool-right">
<div class="lr-tool-right-btn lr_multiple_search">
<i class="iconfont icon-searchlist"></i>
<div class="lr-tool-right-btn-content lr-form-container">
<div class="lr-form-row">
<label>请假类型</label>
<div id="LeaveType"></div>
</div>
<div class="lr-form-row">
<label>审核状态</label>
<div id="CheckStatus"></div>
</div>
</div>
</div>
</div>
</div>
<div class="lr-page-content" id="lr_EducationalAdministrationStuLeaveManagement_list"></div>
</div>

+ 170
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/Check/Check.js Wyświetl plik

@@ -0,0 +1,170 @@
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
* Copyright (c) 2013-2018 北京泉江科技有限公司
* 创建人:超级管理员
* 日 期:2019-12-25 10:39
* 描 述:学生请假管理
*/
(function () {
var begin = '';
var end = '';
var multipleData = null;
var page = {
grid: null,
init: function ($page) {
begin = '';
end = '';
multipleData = null;
page.grid = $page.find('#lr_EducationalAdministrationStuLeaveManagement_list').lrpagination({
lclass: page.lclass,
rows: 10, // 每页行数
getData: function (param, callback) {// 获取数据 param 分页参数,callback 异步回调
param.multipleData = multipleData;
page.loadData(param, callback, $page);
},
renderData: function (_index, _item, _$item) {// 渲染数据模板
return page.rowRender(_index, _item, _$item, $page);
},
click: function (item, $item, $et) {// 列表行点击事件
if ($et.hasClass('lr-btn-danger')) {
page.btnClick(item, $item, $page);
}
else {
page.rowClick(item, $item, $page);
}
},
btns: page.rowBtns
});
// 多条件查询
var $multiple = $page.find('.lr_multiple_search').multiplequery({
callback: function (data) {
begin = '';
end = '';
multipleData = data || {};
page.grid.reload();
}
});
$multiple.find('#LeaveType').lrpickerex({
type: 'dataItem',
code: 'LeaveType'
});
$multiple.find('#CheckStatus').lrpickerex({
type: 'dataItem',
code: 'LeaveCheck'
});
},
lclass: 'lr-list',
loadData: function (param, callback, $page) {// 列表加载后台数据
var _postParam = {
pagination: {
rows: param.rows,
page: param.page,
sidx: 'CreateTime desc',
sord: 'DESC'
},
queryJson: JSON.stringify({ ClassManagerNo: learun.storage.get('userinfo').baseinfo.account })
};
if (param.multipleData) {
multipleData.ClassManagerNo = learun.storage.get('userinfo').baseinfo.account;
_postParam.queryJson = JSON.stringify(multipleData);
}
if (param.begin && param.end) {
_postParam.queryJson = JSON.stringify({ StartTime: param.begin, EndTime: param.end, ClassManagerNo: learun.storage.get('userinfo').baseinfo.account });
}
learun.httpget(config.webapi + 'learun/adms/EducationalAdministration/StuLeaveManagement/pagelist', _postParam, (data) => {
$page.find('.lr-badge').text('0');
if (data) {
$page.find('.lr-badge').text(data.records);
callback(data.rows, parseInt(data.records));
}
else {
callback([], 0);
}
});
},
rowRender: function (_index, _item, _$item, $page) {// 渲染列表行数据
_$item.addClass('lr-list-item lr-list-item-multi');
_$item.append($('<p class="lr-ellipsis"><span>审核状态:</span></p>').dataFormatter({
value: _item.CheckStatus == "1" ? "同意" : _item.CheckStatus == "2" ? "不同意" : "申请中"
}));
_$item.append($('<p class="lr-ellipsis"><span>审核备注:</span></p>').dataFormatter({ value: _item.CheckRemark }));
_$item.append($('<p class="lr-ellipsis"><span>审核时间:</span></p>').dataFormatter({ value: _item.CheckTime }));
_$item.append($('<p class="lr-ellipsis"><span>审核人:</span></p>').dataFormatter({
value: _item.CheckUserNo,
type: 'dataSource',
code: 'EmpInfo',
keyId: 'empno',
text: 'empname'
}));
_$item.append($('<p class="lr-ellipsis"><span>请假类型:</span></p>').dataFormatter({
value: _item.LeaveType,
type: 'dataItem',
code: 'LeaveType'
}));
_$item.append($('<p class="lr-ellipsis"><span>开始时间:</span></p>').dataFormatter({ value: _item.StartTime }));
_$item.append($('<p class="lr-ellipsis"><span>结束时间:</span></p>').dataFormatter({ value: _item.EndTime }));
_$item.append($('<p class="lr-ellipsis"><span>请假天数:</span></p>').dataFormatter({ value: _item.LeaveDay }));
_$item.append($('<p class="lr-ellipsis"><span>请假事由:</span></p>').dataFormatter({ value: _item.LeaveReason }));
_$item.append($('<p class="lr-ellipsis"><span>学号:</span></p>').dataFormatter({ value: _item.CreateUserNo }));
_$item.append($('<p class="lr-ellipsis"><span>姓名:</span></p>').dataFormatter({ value: _item.CreateUserName }));
_$item.append($('<p class="lr-ellipsis"><span>申请时间:</span></p>').dataFormatter({ value: _item.CreateTime }));
_$item.append($('<p class="lr-ellipsis"><span>班级:</span></p>').dataFormatter({
value: _item.ClassNo,
type: 'dataSource',
code: 'bjsj',
keyId: 'classno',
text: 'classname'
}));
_$item.append($('<p class="lr-ellipsis"><span>系部:</span></p>').dataFormatter({
value: _item.DeptNo,
type: 'dataSource',
code: 'CdDeptInfo',
keyId: 'deptno',
text: 'deptname'
}));
_$item.append($('<p class="lr-ellipsis"><span>专业:</span></p>').dataFormatter({
value: _item.MajorNo,
type: 'dataSource',
code: 'CdMajorInfo',
keyId: 'majorno',
text: 'majorname'
}));
_$item.append($('<p class="lr-ellipsis"><span>班主任:</span></p>').dataFormatter({
value: _item.ClassDiredctorNo,
type: 'dataSource',
code: 'EmpInfo',
keyId: 'empno',
text: 'empname'
}));
_$item.append($('<p class="lr-ellipsis"><span>辅导员:</span></p>').dataFormatter({
value: _item.ClassTutorNo,
type: 'dataSource',
code: 'EmpInfo',
keyId: 'empno',
text: 'empname'
}));
return '';
},
rowClick: function (item, $item, $page) {// 列表行点击触发方法
learun.nav.go({ path: 'EducationalAdministration/StuLeaveManagement/Check/form', title: '详情', type: 'right', param: { keyValue: item.Id, LeaveDay: item.LeaveDay } });
},
btnClick: function (item, $item, $page) {// 左滑按钮点击事件
if (item.CheckStatus == "1") {
learun.layer.warning("该项已审核通过无法删除!");
return false;
}
learun.layer.confirm('确定要删除该笔数据吗?', function (_index) {
if (_index === '1') {
learun.layer.loading(true, '正在删除该笔数据');
learun.httppost(config.webapi + 'learun/adms/EducationalAdministration/StuLeaveManagement/delete', item.Id, (data) => {
if (data) {// 删除数据成功
page.grid.reload();
}
learun.layer.loading(false);
});
}
}, '智慧校园提示', ['取消', '确定']);
},
rowBtns: [] // 列表行左滑按钮
};
return page;
})();

+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/Check/form/form.css Wyświetl plik

@@ -0,0 +1 @@


+ 35
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/Check/form/form.html Wyświetl plik

@@ -0,0 +1,35 @@
<div class="lr-form-container">
<div class="lr-form-row " data-table="StuLeaveManagement">
<font face="宋体">*</font>
<label>请假类型</label>
<div id="LeaveType" readonly="readonly" isvalid="yes" checkexpession="NotNull" errormsg="请假类型"></div>
</div>
<div class="lr-form-row " data-table="StuLeaveManagement">
<font face="宋体">*</font>
<label>开始时间</label>
<div id="StartTime" readonly="readonly" isvalid="yes" checkexpession="NotNull" errormsg="开始时间"></div>
</div>
<div class="lr-form-row " data-table="StuLeaveManagement">
<font face="宋体">*</font>
<label>结束时间</label>
<div id="EndTime" readonly="readonly" isvalid="yes" checkexpession="NotNull" errormsg="结束时间"></div>
</div>
<div class="lr-form-row " data-table="StuLeaveManagement">
<font face="宋体">*</font>
<label>请假天数</label>
<input id="LeaveDay" readonly="readonly" type="text" isvalid="yes" checkexpession="PositiveFloatint" errormsg="请假天数" />
</div>
<div class="lr-form-row lr-form-row-multi" data-table="StuLeaveManagement">
<label>请假事由</label>
<textarea id="LeaveReason" readonly="readonly" style="height:100px;" errormsg="请假事由"></textarea>
</div>
<div class="lr-form-row " data-table="StuLeaveManagement">
<font face="宋体">*</font>
<label>审核状态</label>
<div id="CheckStatus" isvalid="yes" checkexpession="NotNull" errormsg="审核状态"></div>
</div>
<div class="lr-form-row lr-form-row-multi" data-table="StuLeaveManagement">
<label>审核备注</label>
<textarea id="CheckRemark" style="height:100px;" errormsg="审核备注"></textarea>
</div>
</div>

+ 164
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/Check/form/form.js Wyświetl plik

@@ -0,0 +1,164 @@
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
* Copyright (c) 2013-2018 北京泉江科技有限公司
* 创建人:超级管理员
* 日 期:2019-12-25 10:39
* 描 述:学生请假管理
*/
(function () {
var keyValue = '';
var $header = null;
var titleText = '';
var page = {
isScroll: true,
init: function ($page, param) {
keyValue = param.keyValue;
LeaveDay = param.LeaveDay;
// 添加头部按钮列表
var _html = '\
<div class="lr-form-header-cancel" >取消</div>\
<div class="lr-form-header-btnlist" >\
<div class="lr-form-header-more" ><i class="iconfont icon-more" ></i></div>\
<div class="lr-form-header-edit" ><i class="iconfont icon-edit" ></i></div>\
</div>\
<div class="lr-form-header-submit" >提交</div>';
$header = $page.parents('.f-page').find('.f-page-header');
$header.append(_html);
// 取消
$header.find('.lr-form-header-cancel').on('tap', function () {
learun.layer.confirm('确定要退出当前编辑?', function (_index) {
if (_index === '1') {
if (keyValue) {// 如果是编辑状态
learun.formblur();
$header.find('.lr-form-header-cancel').hide();
$header.find('.lr-form-header-submit').hide();
$header.find('.lr-form-header-btnlist').show();
$header.find('.f-page-title').text(titleText);
$page.find('.lr-form-container').setFormRead();
}
else {// 如果是新增状态 关闭当前页面
learun.nav.closeCurrent();
}
}
}, '智慧校园提示', ['取消', '确定']);
});
// 编辑
$header.find('.lr-form-header-edit').on('tap', function () {
if (keyValue) {
//判断是否可以审核:请假天数大于2天且登录用户不是系主任,提示无法审核;
if (LeaveDay > 2) {
//获取是否是系主任
learun.httpget(config.webapi + 'learun/adms/EducationalAdministration/StuLeaveManagement/isDeptDirector', "", (data) => {
if (data && data != "" && data != undefined) {
if (data.IsDeptDirector == false) {
learun.layer.warning("该请假申请大于2天,需要由系主任审核!");
return false;
} else {
$header.find('.lr-form-header-btnlist').hide();
$header.find('.lr-form-header-cancel').show();
$header.find('.lr-form-header-submit').show();
titleText = $header.find('.f-page-title').text();
$header.find('.f-page-title').text('编辑');
$page.find('.lr-form-container').setFormWrite();
}
}
learun.layer.loading(false);
});
} else {
$header.find('.lr-form-header-btnlist').hide();
$header.find('.lr-form-header-cancel').show();
$header.find('.lr-form-header-submit').show();
titleText = $header.find('.f-page-title').text();
$header.find('.f-page-title').text('编辑');
$page.find('.lr-form-container').setFormWrite();
}
}
});
// 更多
$header.find('.lr-form-header-more').on('tap', function () {
learun.actionsheet({
id: 'more',
data: [
],
cancel: function () {
}
});
});
// 提交
$header.find('.lr-form-header-submit').on('tap', function () {
// 获取表单数据
if (!$page.find('.lr-form-container').lrformValid()) {
return false;
}
var _postData = {}
_postData.keyValue = keyValue;
_postData.strEntity = JSON.stringify($page.find('.lr-form-container').lrformGet());
learun.layer.loading(true, '正在提交数据');
learun.httppost(config.webapi + 'learun/adms/EducationalAdministration/StuLeaveManagement/saveCheck', _postData, (data) => {
learun.layer.loading(false);
if (data) {// 表单数据保存成功
if (keyValue) {
learun.layer.toast('保存数据成功!');
learun.formblur();
$header.find('.lr-form-header-cancel').hide();
$header.find('.lr-form-header-submit').hide();
$header.find('.lr-form-header-btnlist').show();
$header.find('.f-page-title').text(titleText);
$page.find('.lr-form-container').setFormRead();
}
else {// 如果是
learun.nav.closeCurrent();
}
var prepage = learun.nav.getpage('EducationalAdministration/StuLeaveManagement/Check');
prepage.grid.reload();
}
});
});
page.bind($page, param);
if (keyValue) {
// 添加编辑按钮
$page.find('.lr-form-container').setFormRead();
$header.find('.lr-form-header-btnlist').show();
// 获取表单数据
learun.layer.loading(true, '获取表单数据');
learun.httpget(config.webapi + 'learun/adms/EducationalAdministration/StuLeaveManagement/form', keyValue, (data) => {
if (data) {
for (var id in data) {
if (data[id].length) {
$page.find('#' + id).lrgridSet(data[id]);
}
else {
$page.find('[data-table="' + id + '"]').lrformSet(data[id]);
}
}
}
learun.layer.loading(false);
});
}
else {
$header.find('.lr-form-header-cancel').show();
$header.find('.lr-form-header-submit').show();
}
},
bind: function ($page, param) {
$page.find('#LeaveType').lrpickerex({
code: 'LeaveType',
type: 'dataItem'
});
$page.find('#StartTime').lrdate({
type: 'date'
});
$page.find('#EndTime').lrdate({
type: 'date'
});
$page.find('#CheckStatus').lrpickerex({
code: 'LeaveCheck',
type: 'dataItem'
});
}, destroy: function (pageinfo) {
$header = null;
keyValue = '';
}
};
return page;
})();

+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/StuLeaveManagement.css Wyświetl plik

@@ -0,0 +1 @@


+ 26
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/StuLeaveManagement.html Wyświetl plik

@@ -0,0 +1,26 @@
<div class="lr-page lr-EducationalAdministrationStuLeaveManagement-page">
<div class="lr-page-tool">
<div class="lr-tool-left">
总共<span class="lr-badge lr-badge-primary">0</span>条
</div>
<div class="lr-tool-right">
<div class="lr-tool-right-btn lr_multiple_search">
<i class="iconfont icon-searchlist"></i>
<div class="lr-tool-right-btn-content lr-form-container">
<div class="lr-form-row">
<label>请假类型</label>
<div id="LeaveType"></div>
</div>
<div class="lr-form-row">
<label>审核状态</label>
<div id="CheckStatus"></div>
</div>
</div>
</div>
</div>
</div>
<div class="lr-page-content" id="lr_EducationalAdministrationStuLeaveManagement_list"></div>
<div class="lr-list-addbtn" id="lr_EducationalAdministrationStuLeaveManagement_btn">
<i class="iconfont icon-add1"></i>
</div>
</div>

+ 173
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/StuLeaveManagement.js Wyświetl plik

@@ -0,0 +1,173 @@
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
* Copyright (c) 2013-2018 北京泉江科技有限公司
* 创建人:超级管理员
* 日 期:2019-12-25 10:39
* 描 述:学生请假管理
*/
(function () {
var begin = '';
var end = '';
var multipleData = null;
var page = {
grid: null,
init: function ($page) {
begin = '';
end = '';
multipleData = null;
page.grid = $page.find('#lr_EducationalAdministrationStuLeaveManagement_list').lrpagination({
lclass: page.lclass,
rows: 10, // 每页行数
getData: function (param, callback) {// 获取数据 param 分页参数,callback 异步回调
param.multipleData = multipleData;
page.loadData(param, callback, $page);
},
renderData: function (_index, _item, _$item) {// 渲染数据模板
return page.rowRender(_index, _item, _$item, $page);
},
click: function (item, $item, $et) {// 列表行点击事件
if ($et.hasClass('lr-btn-danger')) {
page.btnClick(item, $item, $page);
}
else {
page.rowClick(item, $item, $page);
}
},
btns: page.rowBtns
});
// 多条件查询
var $multiple = $page.find('.lr_multiple_search').multiplequery({
callback: function (data) {
begin = '';
end = '';
multipleData = data || {};
page.grid.reload();
}
});
$multiple.find('#LeaveType').lrpickerex({
type: 'dataItem',
code: 'LeaveType'
});
$multiple.find('#CheckStatus').lrpickerex({
type: 'dataItem',
code: 'LeaveCheck'
});
$page.find('#lr_EducationalAdministrationStuLeaveManagement_btn').on('tap', function () {
learun.nav.go({ path: 'EducationalAdministration/StuLeaveManagement/form', title: '新增', type: 'right' });
});
},
lclass: 'lr-list',
loadData: function (param, callback, $page) {// 列表加载后台数据
var _postParam = {
pagination: {
rows: param.rows,
page: param.page,
sidx: 'CreateTime desc',
sord: 'DESC'
},
queryJson: JSON.stringify({ StuNo: learun.storage.get('userinfo').baseinfo.account })
};
if (param.multipleData) {
multipleData.StuNo = learun.storage.get('userinfo').baseinfo.account;
_postParam.queryJson = JSON.stringify(multipleData);
}
if (param.begin && param.end) {
_postParam.queryJson = JSON.stringify({ StartTime: param.begin, EndTime: param.end, StuNo: learun.storage.get('userinfo').baseinfo.account });
}
learun.httpget(config.webapi + 'learun/adms/EducationalAdministration/StuLeaveManagement/pagelist', _postParam, (data) => {
$page.find('.lr-badge').text('0');
if (data) {
$page.find('.lr-badge').text(data.records);
callback(data.rows, parseInt(data.records));
}
else {
callback([], 0);
}
});
},
rowRender: function (_index, _item, _$item, $page) {// 渲染列表行数据
_$item.addClass('lr-list-item lr-list-item-multi');
_$item.append($('<p class="lr-ellipsis"><span>审核状态:</span></p>').dataFormatter({
value: _item.CheckStatus == "1" ? "同意" : _item.CheckStatus == "2" ? "不同意" : "申请中"
}));
_$item.append($('<p class="lr-ellipsis"><span>审核备注:</span></p>').dataFormatter({ value: _item.CheckRemark }));
_$item.append($('<p class="lr-ellipsis"><span>审核时间:</span></p>').dataFormatter({ value: _item.CheckTime }));
_$item.append($('<p class="lr-ellipsis"><span>审核人:</span></p>').dataFormatter({
value: _item.CheckUserNo,
type: 'dataSource',
code: 'EmpInfo',
keyId: 'empno',
text: 'empname'
}));
_$item.append($('<p class="lr-ellipsis"><span>请假类型:</span></p>').dataFormatter({
value: _item.LeaveType,
type: 'dataItem',
code: 'LeaveType'
}));
_$item.append($('<p class="lr-ellipsis"><span>开始时间:</span></p>').dataFormatter({ value: _item.StartTime }));
_$item.append($('<p class="lr-ellipsis"><span>结束时间:</span></p>').dataFormatter({ value: _item.EndTime }));
_$item.append($('<p class="lr-ellipsis"><span>请假天数:</span></p>').dataFormatter({ value: _item.LeaveDay }));
_$item.append($('<p class="lr-ellipsis"><span>请假事由:</span></p>').dataFormatter({ value: _item.LeaveReason }));
_$item.append($('<p class="lr-ellipsis"><span>学号:</span></p>').dataFormatter({ value: _item.CreateUserNo }));
_$item.append($('<p class="lr-ellipsis"><span>姓名:</span></p>').dataFormatter({ value: _item.CreateUserName }));
_$item.append($('<p class="lr-ellipsis"><span>申请时间:</span></p>').dataFormatter({ value: _item.CreateTime }));
_$item.append($('<p class="lr-ellipsis"><span>班级:</span></p>').dataFormatter({
value: _item.ClassNo,
type: 'dataSource',
code: 'bjsj',
keyId: 'classno',
text: 'classname'
}));
_$item.append($('<p class="lr-ellipsis"><span>系部:</span></p>').dataFormatter({
value: _item.DeptNo,
type: 'dataSource',
code: 'CdDeptInfo',
keyId: 'deptno',
text: 'deptname'
}));
_$item.append($('<p class="lr-ellipsis"><span>专业:</span></p>').dataFormatter({
value: _item.MajorNo,
type: 'dataSource',
code: 'CdMajorInfo',
keyId: 'majorno',
text: 'majorname'
}));
_$item.append($('<p class="lr-ellipsis"><span>班主任:</span></p>').dataFormatter({
value: _item.ClassDiredctorNo,
type: 'dataSource',
code: 'EmpInfo',
keyId: 'empno',
text: 'empname'
}));
_$item.append($('<p class="lr-ellipsis"><span>辅导员:</span></p>').dataFormatter({
value: _item.ClassTutorNo,
type: 'dataSource',
code: 'EmpInfo',
keyId: 'empno',
text: 'empname'
}));
return '';
},
rowClick: function (item, $item, $page) {// 列表行点击触发方法
learun.nav.go({ path: 'EducationalAdministration/StuLeaveManagement/form', title: '详情', type: 'right', param: { keyValue: item.Id, CheckStatus: item.CheckStatus } });
},
btnClick: function (item, $item, $page) {// 左滑按钮点击事件
if (item.CheckStatus == "1") {
learun.layer.warning("该项已审核通过无法删除!");
return false;
}
learun.layer.confirm('确定要删除该笔数据吗?', function (_index) {
if (_index === '1') {
learun.layer.loading(true, '正在删除该笔数据');
learun.httppost(config.webapi + 'learun/adms/EducationalAdministration/StuLeaveManagement/delete', item.Id, (data) => {
if (data) {// 删除数据成功
page.grid.reload();
}
learun.layer.loading(false);
});
}
}, '智慧校园提示', ['取消', '确定']);
},
rowBtns: ['<a class="lr-btn-danger">删除</a>'] // 列表行左滑按钮
};
return page;
})();

+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/form/form.css Wyświetl plik

@@ -0,0 +1 @@


+ 26
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/form/form.html Wyświetl plik

@@ -0,0 +1,26 @@
<div class="lr-form-container">
<div class="lr-form-row " data-table="StuLeaveManagement">
<font face="宋体">*</font>
<label>请假类型</label>
<div id="LeaveType" isvalid="yes" checkexpession="NotNull" errormsg="请假类型"></div>
</div>
<div class="lr-form-row " data-table="StuLeaveManagement">
<font face="宋体">*</font>
<label>开始时间</label>
<div id="StartTime" isvalid="yes" checkexpession="NotNull" errormsg="开始时间"></div>
</div>
<div class="lr-form-row " data-table="StuLeaveManagement">
<font face="宋体">*</font>
<label>结束时间</label>
<div id="EndTime" isvalid="yes" checkexpession="NotNull" errormsg="结束时间"></div>
</div>
<div class="lr-form-row " data-table="StuLeaveManagement">
<font face="宋体">*</font>
<label>请假天数</label>
<input id="LeaveDay" type="text" isvalid="yes" checkexpession="PositiveFloatint" errormsg="请假天数" />
</div>
<div class="lr-form-row lr-form-row-multi" data-table="StuLeaveManagement">
<label>请假事由</label>
<textarea id="LeaveReason" style="height:100px;" errormsg="请假事由"></textarea>
</div>
</div>

+ 161
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/StuLeaveManagement/form/form.js Wyświetl plik

@@ -0,0 +1,161 @@
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
* Copyright (c) 2013-2018 北京泉江科技有限公司
* 创建人:超级管理员
* 日 期:2019-12-25 10:39
* 描 述:学生请假管理
*/
(function () {
var keyValue = '';
var $header = null;
var titleText = '';
var page = {
isScroll: true,
init: function ($page, param) {
keyValue = param.keyValue;
CheckStatus = param.CheckStatus;
// 添加头部按钮列表
var _html = '\
<div class="lr-form-header-cancel" >取消</div>\
<div class="lr-form-header-btnlist" >\
<div class="lr-form-header-more" ><i class="iconfont icon-more" ></i></div>\
<div class="lr-form-header-edit" ><i class="iconfont icon-edit" ></i></div>\
</div>\
<div class="lr-form-header-submit" >提交</div>';
$header = $page.parents('.f-page').find('.f-page-header');
$header.append(_html);
// 取消
$header.find('.lr-form-header-cancel').on('tap', function () {
learun.layer.confirm('确定要退出当前编辑?', function (_index) {
if (_index === '1') {
if (keyValue) {// 如果是编辑状态
learun.formblur();
$header.find('.lr-form-header-cancel').hide();
$header.find('.lr-form-header-submit').hide();
$header.find('.lr-form-header-btnlist').show();
$header.find('.f-page-title').text(titleText);
$page.find('.lr-form-container').setFormRead();
}
else {// 如果是新增状态 关闭当前页面
learun.nav.closeCurrent();
}
}
}, '智慧校园提示', ['取消', '确定']);
});
// 编辑
$header.find('.lr-form-header-edit').on('tap', function () {
if (keyValue) {
if (CheckStatus == "1" || CheckStatus == "2") {
learun.layer.warning("该项已审核无法编辑!");
return false;
}
}
$header.find('.lr-form-header-btnlist').hide();
$header.find('.lr-form-header-cancel').show();
$header.find('.lr-form-header-submit').show();
titleText = $header.find('.f-page-title').text();
$header.find('.f-page-title').text('编辑');
$page.find('.lr-form-container').setFormWrite();
});
// 更多
$header.find('.lr-form-header-more').on('tap', function () {
learun.actionsheet({
id: 'more',
data: [
{
text: '删除',
mark: true,
event: function () {// 删除当前条信息
learun.layer.confirm('确定要删除该笔数据吗?', function (_index) {
if (_index === '1') {
learun.layer.loading(true, '正在删除该笔数据');
learun.httppost(config.webapi + 'learun/adms/EducationalAdministration/StuLeaveManagement/delete', keyValue, (data) => {
learun.layer.loading(false);
if (data) {// 删除数据成功
learun.nav.closeCurrent();
var prepage = learun.nav.getpage('EducationalAdministration/StuLeaveManagement');
prepage.grid.reload();
}
});
}
}, '智慧校园提示', ['取消', '确定']);
}
}
],
cancel: function () {
}
});
});
// 提交
$header.find('.lr-form-header-submit').on('tap', function () {
// 获取表单数据
if (!$page.find('.lr-form-container').lrformValid()) {
return false;
}
var _postData = {}
_postData.keyValue = keyValue;
_postData.strEntity = JSON.stringify($page.find('.lr-form-container').lrformGet());
learun.layer.loading(true, '正在提交数据');
learun.httppost(config.webapi + 'learun/adms/EducationalAdministration/StuLeaveManagement/save', _postData, (data) => {
learun.layer.loading(false);
if (data) {// 表单数据保存成功
if (keyValue) {
learun.layer.toast('保存数据成功!');
learun.formblur();
$header.find('.lr-form-header-cancel').hide();
$header.find('.lr-form-header-submit').hide();
$header.find('.lr-form-header-btnlist').show();
$header.find('.f-page-title').text(titleText);
$page.find('.lr-form-container').setFormRead();
}
else {// 如果是
learun.nav.closeCurrent();
}
var prepage = learun.nav.getpage('EducationalAdministration/StuLeaveManagement');
prepage.grid.reload();
}
});
});
page.bind($page, param);
if (keyValue) {
// 添加编辑按钮
$page.find('.lr-form-container').setFormRead();
$header.find('.lr-form-header-btnlist').show();
// 获取表单数据
learun.layer.loading(true, '获取表单数据');
learun.httpget(config.webapi + 'learun/adms/EducationalAdministration/StuLeaveManagement/form', keyValue, (data) => {
if (data) {
for (var id in data) {
if (data[id].length) {
$page.find('#' + id).lrgridSet(data[id]);
}
else {
$page.find('[data-table="' + id + '"]').lrformSet(data[id]);
}
}
}
learun.layer.loading(false);
});
}
else {
$header.find('.lr-form-header-cancel').show();
$header.find('.lr-form-header-submit').show();
}
},
bind: function ($page, param) {
$page.find('#LeaveType').lrpickerex({
code: 'LeaveType',
type: 'dataItem'
});
$page.find('#StartTime').lrdate({
type: 'date'
});
$page.find('#EndTime').lrdate({
type: 'date'
});
}, destroy: function (pageinfo) {
$header = null;
keyValue = '';
}
};
return page;
})();

+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj Wyświetl plik

@@ -211,6 +211,7 @@
<Compile Include="Modules\PersonnelManagement\EpidemicSituationCopyApi.cs" />
<Compile Include="Modules\StuInfoBasicApi.cs" />
<Compile Include="Modules\StatisticsApi.cs" />
<Compile Include="Modules\StuLeaveManagementApi.cs" />
<Compile Include="Modules\TaiGang\TUserApi.cs" />
<Compile Include="Modules\TeacherWorkloadApi.cs" />
<Compile Include="Modules\PersonnelManagement\DutyScheduleApi.cs" />


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuAttendanceLeaveApi.cs Wyświetl plik

@@ -11,7 +11,7 @@ namespace Learun.Application.WebApi
    /// Copyright (c) 2013-2018 北京泉江科技有限公司 
    /// 创 建:超级管理员
    /// 日 期:2019-06-24 14:40
    /// 描 述:请假
    /// 描 述:学生课表请假管理
    /// </summary>
public class StuAttendanceLeaveApi : BaseApi
{


+ 161
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuLeaveManagementApi.cs Wyświetl plik

@@ -0,0 +1,161 @@
using Nancy;
using Learun.Util;
using System.Collections.Generic;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using System;
using System.Linq;

namespace Learun.Application.WebApi.Modules
{/// <summary>
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创 建:超级管理员
/// 日 期:2019-12-25 10:35
/// 描 述:学生请假管理
/// </summary>
public class StuLeaveManagementApi : BaseApi
{
private StuLeaveManagementIBLL stuLeaveManagementIBLL = new StuLeaveManagementBLL();

/// <summary>
/// 注册接口
/// <summary>
public StuLeaveManagementApi()
: base("/Learun/adms/EducationalAdministration/StuLeaveManagement")
{
Get["/pagelist"] = GetPageList;
Get["/form"] = GetForm;
Post["/delete"] = DeleteForm;
Post["/save"] = SaveForm;
Post["/saveCheck"] = SaveCheckForm;
Get["/isDeptDirector"] = GetIsDeptDirector;
}
#region 获取数据

/// <summary>
/// 获取页面显示列表分页数据
/// <summary>
/// <param name="_"></param>
/// <returns></returns>
public Response GetPageList(dynamic _)
{
ReqPageParam parameter = this.GetReqData<ReqPageParam>();
var data = stuLeaveManagementIBLL.GetPageList(parameter.pagination, parameter.queryJson);
var jsonData = new
{
rows = data,
total = parameter.pagination.total,
page = parameter.pagination.page,
records = parameter.pagination.records
};
return Success(jsonData);
}
/// <summary>
/// 获取表单数据
/// <summary>
/// <param name="_"></param>
/// <returns></returns>
public Response GetForm(dynamic _)
{
string keyValue = this.GetReqData();
var StuLeaveManagementData = stuLeaveManagementIBLL.GetStuLeaveManagementEntity(keyValue);
var jsonData = new
{
StuLeaveManagement = StuLeaveManagementData,
};
return Success(jsonData);
}
/// <summary>
/// 获取登录用户是否是系主任
/// <summary>
/// <param name="_"></param>
/// <returns></returns>
public Response GetIsDeptDirector(dynamic _)
{
bool isDeptDirector = false;//登录用户是否是系主任标识

var deptDirectorRoleId = Config.GetValue("DeptDirectorRoleId");
var loginInfoRoleIds = this.userInfo.roleIds;
if (loginInfoRoleIds.IndexOf(',') == -1)
{
if (loginInfoRoleIds == deptDirectorRoleId)
{
isDeptDirector = true;
}
}
else
{
if (loginInfoRoleIds.Split(',').Contains(deptDirectorRoleId))
{
isDeptDirector = true;
}
}
var jsonData = new
{
IsDeptDirector = isDeptDirector,
};
return Success(jsonData);
}

#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// <param name="_"></param>
/// <summary>
/// <returns></returns>
public Response DeleteForm(dynamic _)
{
string keyValue = this.GetReqData();
stuLeaveManagementIBLL.DeleteEntity(keyValue);
return Success("删除成功!");
}
/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="_"></param>
/// <summary>
/// <returns></returns>
public Response SaveForm(dynamic _)
{
ReqFormEntity parameter = this.GetReqData<ReqFormEntity>();
StuLeaveManagementEntity entity = parameter.strEntity.ToObject<StuLeaveManagementEntity>();
entity.CreateTime = DateTime.Now;
entity.CreateUserId = this.userInfo.userId;
entity.CreateUserNo = this.userInfo.account;
stuLeaveManagementIBLL.SaveEntity(parameter.keyValue, entity);
return Success("保存成功!");
}

/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="_"></param>
/// <summary>
/// <returns></returns>
public Response SaveCheckForm(dynamic _)
{
ReqFormEntity parameter = this.GetReqData<ReqFormEntity>();
StuLeaveManagementEntity entity = parameter.strEntity.ToObject<StuLeaveManagementEntity>();
entity.CheckUserId = this.userInfo.userId;
entity.CheckUserNo = this.userInfo.account;
entity.CheckTime = DateTime.Now;
stuLeaveManagementIBLL.SaveEntity(parameter.keyValue, entity);
return Success("保存成功!");
}
#endregion

#region 私有类

/// <summary>
/// 表单实体类
/// <summary>
private class ReqFormEntity
{
public string keyValue { get; set; }
public string strEntity { get; set; }
}
#endregion

}
}

+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config Wyświetl plik

@@ -107,5 +107,7 @@
<add key="QJUrl" value="www.qj.com"/>
<!-- 报名选修课的最大课程数 -->
<add key="ElectiveLessonApplyMax" value="2" />
<!--系主任角色Id-->
<add key="DeptDirectorRoleId" value="cccde0ce-ebfe-41f2-9a78-e49aaa21cd5a" />
</appSettings>

Ładowanie…
Anuluj
Zapisz