diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuCancelLeaveManagementController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuCancelLeaveManagementController.cs index c239d9a7e..b3c17a4d1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuCancelLeaveManagementController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuCancelLeaveManagementController.cs @@ -40,7 +40,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers } /// - /// 主页面【学工信息管理】 + /// 主页面【学工信息管理】【旧】 /// /// [HttpGet] @@ -49,7 +49,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return View(); } /// - /// 表单页【学工信息管理】 + /// 表单页【学工信息管理】【旧】 /// /// [HttpGet] @@ -57,6 +57,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + /// + /// 表单页-查看 + /// + /// + [HttpGet] + public ActionResult FormView() + { + return View(); + } #endregion #region 获取数据 @@ -97,6 +106,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } + /// + /// 获取表单数据 + /// + /// 流程实例主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormDataByProcessId(string processId) + { + var StuCancelLeaveManagementData = stuCancelLeaveManagementIBLL.GetEntityByProcessId(processId); + var jsonData = new + { + StuCancelLeaveManagement = StuCancelLeaveManagementData, + }; + return Success(jsonData); + } #endregion #region 提交数据 @@ -129,6 +154,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers entity.CreateUserId = loginInfo.userId; entity.CreateUserNo = loginInfo.account; entity.CreateTime = DateTime.Now; + entity.CheckStatus = "0"; + stuCancelLeaveManagementIBLL.SaveEntity(keyValue,entity); return Success("保存成功!"); @@ -152,6 +179,19 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers stuCancelLeaveManagementIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } + + /// + /// 提交实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoSubmit(string keyValue, string status, string processId) + { + stuCancelLeaveManagementIBLL.DoSubmit(keyValue, status, processId); + return Success("提交成功!"); + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuLeaveManagementController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuLeaveManagementController.cs index 222db3064..8ddafdca0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuLeaveManagementController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuLeaveManagementController.cs @@ -39,9 +39,18 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + /// + /// 表单页-查看 + /// + /// + [HttpGet] + public ActionResult FormView() + { + return View(); + } /// - /// 主页面【学工信息管理】 + /// 主页面【学工信息管理】【旧】 /// /// [HttpGet] @@ -67,7 +76,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return View(); } /// - /// 表单页【学工信息管理】 + /// 表单页【学工信息管理】【旧】 /// /// [HttpGet] @@ -116,6 +125,24 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } + + /// + /// 获取表单数据 + /// + /// 流程实例主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormDataByProcessId(string processId) + { + var StuLeaveManagementData = stuLeaveManagementIBLL.GetEntityByProcessId(processId); + var jsonData = new + { + StuLeaveManagement = StuLeaveManagementData, + }; + return Success(jsonData); + } + #endregion #region 提交数据 @@ -148,6 +175,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers entity.CreateUserId = loginInfo.userId; entity.CreateUserNo = loginInfo.account; entity.CreateTime = DateTime.Now; + entity.CheckStatus = "0"; stuLeaveManagementIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } @@ -170,6 +198,19 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers stuLeaveManagementIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } + + /// + /// 提交实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoSubmit(string keyValue, string status, string processId) + { + stuLeaveManagementIBLL.DoSubmit(keyValue, status, processId); + return Success("提交成功!"); + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Form.cshtml index ab19cd831..4843bd8d9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Form.cshtml @@ -3,21 +3,25 @@ Layout = "~/Views/Shared/_Form.cshtml"; }
-
-
销假类型*
-
+ @*
+
销假类型*
+
+
*@ + -
+
到校时间*
- +
-
+
销假事由
- +
-
+
备注
- +
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Form.js index a00dd2c37..5e9b69484 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Form.js @@ -6,8 +6,40 @@ */ var acceptClick; var keyValue = request('keyValue'); +var keyValueInLeave = request('keyValueInLeave'); +//console.log(keyValue, keyValueInLeave); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; var bootstrap = function ($, learun) { "use strict"; + if (keyValue == "null") { + keyValue = ""; + } + // 设置权限 + setAuthorize = function (data) { + if (!!data) { + for (var field in data) { + if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 + $('#' + data[field].fieldId).parent().remove(); + } + else { + if (data[field].isEdit != 1) { + $('#' + data[field].fieldId).attr('disabled', 'disabled'); + if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { + $('#' + data[field].fieldId).css({ 'padding-right': '58px' }); + $('#' + data[field].fieldId).find('.btn-success').remove(); + } + } + } + } + } + }; var page = { init: function () { $('.lr-form-wrap').lrscroll(); @@ -15,7 +47,10 @@ var bootstrap = function ($, learun) { page.initData(); }, bind: function () { - $('#CancelLeaveType').lrDataItemSelect({ code: 'LeaveType' }); + if (!!keyValueInLeave) { + $('#LeaveId').val(keyValueInLeave); + } + //$('#CancelLeaveType').lrDataItemSelect({ code: 'LeaveType' }); }, initData: function () { if (!!keyValue) { @@ -27,23 +62,52 @@ var bootstrap = function ($, learun) { else { $('[data-table="' + id + '"]').lrSetFormData(data[id]); } + $("#WorkTime").val(data[id].WorkTime); } }); } } }; - // 保存数据 - acceptClick = function (callBack) { + // 设置表单数据 + setFormData = function (processId, param, callback) { + if (!!processId) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/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 == 'StuCancelLeaveManagement' && data[id]) { + keyValue = data[id].Id; + } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + $("#WorkTime").val(data[id].WorkTime); + } + }); + } + callback && callback(); + } + // 验证数据是否填写完整 + validForm = function () { if (!$('body').lrValidform()) { return false; } + return true; + }; + // 保存数据 + save = function (processId, callBack, i) { + var formData = $('body').lrGetFormData(); + if (!!processId) { + formData.ProcessId = processId; + } var postData = { - strEntity: JSON.stringify($('body').lrGetFormData()) + strEntity: JSON.stringify(formData) }; $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { - callBack(); + callBack(res, i); } }); }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/FormView.cshtml new file mode 100644 index 000000000..df3fd648c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/FormView.cshtml @@ -0,0 +1,27 @@ +@{ + ViewBag.Title = "学生销假管理"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+ @*
+
销假类型*
+
+
*@ + +
+
到校时间*
+ +
+
+
销假事由
+ +
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/FormView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/FormView.js new file mode 100644 index 000000000..5e9b69484 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/FormView.js @@ -0,0 +1,115 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-03-26 11:35 + * 描 述:学生销假管理 + */ +var acceptClick; +var keyValue = request('keyValue'); +var keyValueInLeave = request('keyValueInLeave'); +//console.log(keyValue, keyValueInLeave); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +var bootstrap = function ($, learun) { + "use strict"; + if (keyValue == "null") { + keyValue = ""; + } + // 设置权限 + setAuthorize = function (data) { + if (!!data) { + for (var field in data) { + if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 + $('#' + data[field].fieldId).parent().remove(); + } + else { + if (data[field].isEdit != 1) { + $('#' + data[field].fieldId).attr('disabled', 'disabled'); + if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { + $('#' + data[field].fieldId).css({ 'padding-right': '58px' }); + $('#' + data[field].fieldId).find('.btn-success').remove(); + } + } + } + } + } + }; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + if (!!keyValueInLeave) { + $('#LeaveId').val(keyValueInLeave); + } + //$('#CancelLeaveType').lrDataItemSelect({ code: 'LeaveType' }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/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]); + } + $("#WorkTime").val(data[id].WorkTime); + } + }); + } + } + }; + // 设置表单数据 + setFormData = function (processId, param, callback) { + if (!!processId) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/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 == 'StuCancelLeaveManagement' && data[id]) { + keyValue = data[id].Id; + } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + $("#WorkTime").val(data[id].WorkTime); + } + }); + } + callback && callback(); + } + // 验证数据是否填写完整 + validForm = function () { + if (!$('body').lrValidform()) { + return false; + } + return true; + }; + // 保存数据 + save = function (processId, callBack, i) { + var formData = $('body').lrGetFormData(); + if (!!processId) { + formData.ProcessId = processId; + } + var postData = { + strEntity: JSON.stringify(formData) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(res, i); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Index.cshtml index b6437f748..113d1e308 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Index.cshtml @@ -11,8 +11,8 @@
-
销假类型
-
+
请假类型
+
审核状态
@@ -27,10 +27,13 @@
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Index.js index 8bcc525a9..f0c704cc1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Index.js @@ -7,6 +7,7 @@ var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; + var processId = ''; var page = { init: function () { page.initGird(); @@ -16,42 +17,39 @@ var bootstrap = function ($, learun) { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 220, 400); - $('#CancelLeaveType').lrDataItemSelect({ code: 'LeaveType' }); - $('#CheckStatus').lrDataItemSelect({ code: 'LeaveCheck' }); + $('#LeaveType').lrDataItemSelect({ code: 'LeaveTypeOfStu' }); + $('#CheckStatus').lrselect({ data: [{ id: '0', text: '草稿' }, { id: '1', text: '审批中' }, { id: '2', text: '审批通过' }, { id: '3', text: '审批不通过' }] }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); - // 新增 - $('#lr_add').on('click', function () { - learun.layerForm({ - id: 'form', - title: '新增', - url: top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/Form', - width: 600, - height: 400, - callBack: function (id) { - return top[id].acceptClick(refreshGirdData); - } - }); - }); // 编辑 $('#lr_edit').on('click', function () { - var keyValue = $('#gridtable').jfGridValue('Id'); - if (learun.checkrow(keyValue)) { - var status = $('#gridtable').jfGridValue('CheckStatus'); - if (status == "1" || status == "2") { - learun.alert.warning("该项已审核无法编辑!"); + var keyValueInLeave = $('#gridtable').jfGridValue('IdInLeave'); + if (learun.checkrow(keyValueInLeave)) { + var keyValue = $('#gridtable').jfGridValue('Id'); + var CheckStatus = $('#gridtable').jfGridValue('CheckStatus'); + if (keyValue != null && CheckStatus != "0") { + learun.alert.warning("当前项已提交销假!"); return false; } learun.layerForm({ id: 'form', title: '编辑', - url: top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/Form?keyValue=' + keyValue, + url: top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/Form?keyValue=' + keyValue + '&keyValueInLeave=' + keyValueInLeave, width: 600, height: 400, callBack: function (id) { - return top[id].acceptClick(refreshGirdData); + var res = false; + // 验证数据 + res = top[id].validForm(); + // 保存数据 + if (res) { + res = top[id].save('', function () { + page.search(); + }); + } + return res; } }); } @@ -61,14 +59,47 @@ var bootstrap = function ($, learun) { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { var status = $('#gridtable').jfGridValue('CheckStatus'); - if (status == "1") { - learun.alert.warning("该项已审核通过无法删除!"); + if (status != "0") { + learun.alert.warning("当前项已提交销假!"); return false; } learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/DeleteForm', { keyValue: keyValue}, function () { - refreshGirdData(); + page.search(); + }); + } + }); + } + }); + //  查看 + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formview', + title: '查看', + url: top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/FormView?keyValue=' + keyValue, + width: 600, + height: 400, + btn: null + }); + } + }); + //  提交 + $('#lr_submit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var CheckStatus = $('#gridtable').jfGridValue('CheckStatus'); + if (CheckStatus != "0") { + learun.alert.warning("当前项已提交销假!"); + return false; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + processId = learun.newGuid(); + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/DoSubmit', { keyValue: keyValue, status: "1", processId: processId }, function (res) { + refreshGirdData(res, {}); }); } }); @@ -77,131 +108,78 @@ var bootstrap = function ($, learun) { }, // 初始化列表 initGird: function () { - $('#gridtable').lrAuthorizeJfGrid({ + $('#gridtable').jfGrid({ url: top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/GetPageList', headData: [ + { label: "学号", name: "CreateUserNoInLeave", width: 100, align: "left" }, { - label: "审核状态", name: "CheckStatus", width: 100, align: "left", + label: "姓名", name: "CreateUserIdInLeave", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('dataItem', { + learun.clientdata.getAsync('user', { key: value, - code: 'LeaveCheck', callback: function (_data) { - callback(_data.text ? _data.text : "申请中"); + callback(_data.name); } }); } }, - { label: "审核备注", name: "CheckRemark", width: 100, align: "left" }, - { label: "审核时间", name: "CheckTime", width: 130, align: "left" }, { - label: "审核人", name: "CheckUserNo", width: 100, align: "left", + label: "请假类型", name: "LeaveType", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', - key: value, - keyId: 'empno', - callback: function (_data) { - callback(_data['empname']); - } - }); - } - }, - { label: "销假类型", name: "CancelLeaveType", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'LeaveType', - callback: function (_data) { - callback(_data.text); - } - }); - }}, - { label: "到校时间", name: "WorkTime", width: 120, align: "left"}, - { label: "销假事由", name: "CancelLeaveReason", width: 100, align: "left" }, - { label: "学号", name: "CreateUserNo", width: 100, align: "left" }, - { label: "姓名", name: "CreateUserName", width: 100, align: "left" }, - { label: "申请时间", name: "CreateTime", width: 130, align: "left" }, - { - 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: "DeptNo", 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: "MajorNo", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + learun.clientdata.getAsync('dataItem', { key: value, - keyId: 'majorno', + code: 'LeaveTypeOfStu', callback: function (_data) { - callback(_data['majorname']); + callback(_data.text); } }); } }, + { label: "请假时间", name: "StartTime", width: 120, align: "left" }, + { label: "返校时间", name: "EndTime", width: 120, align: "left" }, + { label: "请假天数", name: "LeaveDay", width: 100, align: "left" }, + { label: "请假事由", name: "LeaveReason", width: 100, align: "left" }, { - label: "班主任", name: "ClassDiredctorNo", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', - key: value, - keyId: 'empno', - callback: function (_data) { - callback(_data['empname']); - } - }); + label: "审核状态", name: "CheckStatusInLeave", width: 100, align: "left", formatter: function (cellvalue) { + return cellvalue == "1" ? "审核中" : cellvalue == "2" ? "审核通过" : cellvalue == "3" ? "审核未通过" : "草稿"; } }, + { label: "销假填表时间", name: "CreateTime", width: 130, align: "left" }, + { label: "到校时间", name: "WorkTime", width: 120, align: "left"}, + { label: "销假事由", name: "CancelLeaveReason", width: 100, align: "left" }, { - label: "辅导员", name: "ClassTutorNo", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', - key: value, - keyId: 'empno', - callback: function (_data) { - callback(_data['empname']); - } - }); + label: "销假审核状态", name: "CheckStatus", width: 100, align: "left", formatter: function (cellvalue) { + return cellvalue == "1" ? "审核中" : cellvalue == "2" ? "审核通过" : cellvalue == "3" ? "审核未通过" : cellvalue == "0" ? "草稿" : ""; } }, ], mainId:'Id', isPage: true, - sord: 'CreateTime desc' + sord: 'CreateTimeInLeave desc' }); page.search(); }, search: function (param) { param = param || {}; - param.StuNo = learun.clientdata.get(['userinfo']).account; + param.CreateUserIdInLeave = learun.clientdata.get(['userinfo']).userId; //登录用户的已审核通过的请假单 $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); } }; - refreshGirdData = function () { - $('#gridtable').jfGridSet('reload'); + refreshGirdData = function (res, postData) { + if (!!res) { + if (res.code == 200) { + // 发起流程 + var postData = { + schemeCode: 'StuCancelLeaveManagement',// 填写流程对应模板编号 + processId: processId, + level: '1', + }; + learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { + learun.loading(false); + }); + } + page.search(); + } }; page.init(); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Form.cshtml index 4dad89d71..08574f89c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Form.cshtml @@ -9,16 +9,20 @@
请假时间*
- +
返校时间*
- +
请假天数*
+
+
附件上传
+
+
请假事由
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Form.js index 339169c36..037cd3fe7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Form.js @@ -6,8 +6,35 @@ */ var acceptClick; var keyValue = request('keyValue'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; var bootstrap = function ($, learun) { "use strict"; + // 设置权限 + setAuthorize = function (data) { + if (!!data) { + for (var field in data) { + if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 + $('#' + data[field].fieldId).parent().remove(); + } + else { + if (data[field].isEdit != 1) { + $('#' + data[field].fieldId).attr('disabled', 'disabled'); + if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { + $('#' + data[field].fieldId).css({ 'padding-right': '58px' }); + $('#' + data[field].fieldId).find('.btn-success').remove(); + } + } + } + } + } + }; var page = { init: function () { $('.lr-form-wrap').lrscroll(); @@ -15,8 +42,8 @@ var bootstrap = function ($, learun) { page.initData(); }, bind: function () { - $('#LeaveType').lrDataItemSelect({ code: 'LeaveType' }); - $('#CheckStatus').lrDataItemSelect({ code: 'LeaveCheck' }); + $('#LeaveType').lrDataItemSelect({ code: 'LeaveTypeOfStu' }); + $('#Files').lrUploader(); }, initData: function () { if (!!keyValue) { @@ -28,23 +55,56 @@ var bootstrap = function ($, learun) { else { $('[data-table="' + id + '"]').lrSetFormData(data[id]); } + + $("#StartTime").val(data[id].StartTime); + $("#EndTime").val(data[id].EndTime); } }); } } }; - // 保存数据 - acceptClick = function (callBack) { + // 设置表单数据 + setFormData = function (processId, param, callback) { + if (!!processId) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/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 == 'StuLeaveManagement' && data[id]) { + keyValue = data[id].Id; + } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + + $("#StartTime").val(data[id].StartTime); + $("#EndTime").val(data[id].EndTime); + } + }); + } + callback && callback(); + } + // 验证数据是否填写完整 + validForm = function () { if (!$('body').lrValidform()) { return false; } + return true; + }; + // 保存数据 + save = function (processId, callBack, i) { + var formData = $('body').lrGetFormData(); + if (!!processId) { + formData.ProcessId = processId; + } var postData = { - strEntity: JSON.stringify($('body').lrGetFormData()) + strEntity: JSON.stringify(formData) }; $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { - callBack(); + callBack(res, i); } }); }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/FormView.cshtml new file mode 100644 index 000000000..9dd976407 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/FormView.cshtml @@ -0,0 +1,31 @@ +@{ + ViewBag.Title = "学生请假管理"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
请假类型*
+
+
+
+
请假时间*
+ +
+
+
返校时间*
+ +
+
+
请假天数*
+ +
+
+
附件上传
+
+
+
+
请假事由
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuLeaveManagement/FormView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/FormView.js new file mode 100644 index 000000000..037cd3fe7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/FormView.js @@ -0,0 +1,112 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2020-11-27 10:05 + * 描 述:学生请假管理 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +var bootstrap = function ($, learun) { + "use strict"; + // 设置权限 + setAuthorize = function (data) { + if (!!data) { + for (var field in data) { + if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 + $('#' + data[field].fieldId).parent().remove(); + } + else { + if (data[field].isEdit != 1) { + $('#' + data[field].fieldId).attr('disabled', 'disabled'); + if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { + $('#' + data[field].fieldId).css({ 'padding-right': '58px' }); + $('#' + data[field].fieldId).find('.btn-success').remove(); + } + } + } + } + } + }; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#LeaveType').lrDataItemSelect({ code: 'LeaveTypeOfStu' }); + $('#Files').lrUploader(); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/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]); + } + + $("#StartTime").val(data[id].StartTime); + $("#EndTime").val(data[id].EndTime); + } + }); + } + } + }; + // 设置表单数据 + setFormData = function (processId, param, callback) { + if (!!processId) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/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 == 'StuLeaveManagement' && data[id]) { + keyValue = data[id].Id; + } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + + $("#StartTime").val(data[id].StartTime); + $("#EndTime").val(data[id].EndTime); + } + }); + } + callback && callback(); + } + // 验证数据是否填写完整 + validForm = function () { + if (!$('body').lrValidform()) { + return false; + } + return true; + }; + // 保存数据 + save = function (processId, callBack, i) { + var formData = $('body').lrGetFormData(); + if (!!processId) { + formData.ProcessId = processId; + } + var postData = { + strEntity: JSON.stringify(formData) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(res, i); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Index.cshtml index 565a7cd58..44ca26268 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Index.cshtml @@ -27,10 +27,14 @@
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Index.js index ba1e8eec3..7735ec920 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Index.js @@ -7,6 +7,7 @@ var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; + var processId = ''; var page = { init: function () { page.initGird(); @@ -16,8 +17,8 @@ var bootstrap = function ($, learun) { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 220, 400); - $('#LeaveType').lrDataItemSelect({ code: 'LeaveType' }); - $('#CheckStatus').lrDataItemSelect({ code: 'LeaveCheck' }); + $('#LeaveType').lrDataItemSelect({ code: 'LeaveTypeOfStu' }); + $('#CheckStatus').lrselect({ data: [{ id: '0', text: '草稿' }, { id: '1', text: '审批中' }, { id: '2', text: '审批通过' }, { id: '3', text: '审批不通过' }] }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -31,7 +32,16 @@ var bootstrap = function ($, learun) { width: 600, height: 400, callBack: function (id) { - return top[id].acceptClick(refreshGirdData); + var res = false; + // 验证数据 + res = top[id].validForm(); + // 保存数据 + if (res) { + res = top[id].save('', function () { + page.search(); + }); + } + return res; } }); }); @@ -40,8 +50,8 @@ var bootstrap = function ($, learun) { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { var status = $('#gridtable').jfGridValue('CheckStatus'); - if (status == "1" || status == "2") { - learun.alert.warning("该项已审核无法编辑!"); + if (status != "0") { + learun.alert.warning("当前项已提交!"); return false; } learun.layerForm({ @@ -51,7 +61,16 @@ var bootstrap = function ($, learun) { width: 600, height: 400, callBack: function (id) { - return top[id].acceptClick(refreshGirdData); + var res = false; + // 验证数据 + res = top[id].validForm(); + // 保存数据 + if (res) { + res = top[id].save('', function () { + page.search(); + }); + } + return res; } }); } @@ -61,8 +80,8 @@ var bootstrap = function ($, learun) { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { var status = $('#gridtable').jfGridValue('CheckStatus'); - if (status == "1") { - learun.alert.warning("该项已审核通过无法删除!"); + if (status != "0") { + learun.alert.warning("当前项已提交!"); return false; } learun.layerConfirm('是否确认删除该项!', function (res) { @@ -74,35 +93,80 @@ var bootstrap = function ($, learun) { }); } }); + //  查看 + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formview', + title: '查看', + url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/FormView?keyValue=' + keyValue, + width: 600, + height: 400, + btn: null + }); + } + }); + //  提交 + $('#lr_submit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var CheckStatus = $('#gridtable').jfGridValue('CheckStatus'); + if (CheckStatus != "0") { + learun.alert.warning("当前项已提交!"); + return false; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + processId = learun.newGuid(); + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/DoSubmit', { keyValue: keyValue, status: "1", processId: processId }, function (res) { + refreshGirdData(res, {}); + }); + } + }); + } + }); }, // 初始化列表 initGird: function () { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/GetPageList', headData: [ + //{ + // label: "审核状态", name: "CheckStatus", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('dataItem', { + // key: value, + // code: 'LeaveCheck', + // callback: function (_data) { + // callback(_data.text ? _data.text : "申请中"); + // } + // }); + // } + //}, + //{ label: "审核备注", name: "CheckRemark", width: 100, align: "left" }, + //{ label: "审核时间", name: "CheckTime", width: 130, align: "left" }, + //{ + // label: "审核人", name: "CheckUserNo", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', + // key: value, + // keyId: 'empno', + // callback: function (_data) { + // callback(_data['empname']); + // } + // }); + // } + //}, + { label: "学号", name: "CreateUserNo", width: 100, align: "left" }, { - label: "审核状态", name: "CheckStatus", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'LeaveCheck', - callback: function (_data) { - callback(_data.text ? _data.text : "申请中"); - } - }); - } - }, - { label: "审核备注", name: "CheckRemark", width: 100, align: "left" }, - { label: "审核时间", name: "CheckTime", width: 130, align: "left" }, - { - label: "审核人", name: "CheckUserNo", width: 100, align: "left", + label: "姓名", name: "CreateUserId", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', + learun.clientdata.getAsync('user', { key: value, - keyId: 'empno', callback: function (_data) { - callback(_data['empname']); + callback(_data.name); } }); } @@ -112,85 +176,88 @@ var bootstrap = function ($, learun) { formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('dataItem', { key: value, - code: 'LeaveType', + code: 'LeaveTypeOfStu', callback: function (_data) { callback(_data.text); } }); } }, - { label: "请假时间", name: "StartTime", width: 100, align: "left" }, - { label: "返校时间", name: "EndTime", width: 100, align: "left" }, + { label: "请假时间", name: "StartTime", width: 120, align: "left" }, + { label: "返校时间", name: "EndTime", width: 120, align: "left" }, { label: "请假天数", name: "LeaveDay", width: 100, align: "left" }, { label: "请假事由", name: "LeaveReason", width: 100, align: "left" }, - { label: "学号", name: "CreateUserNo", width: 100, align: "left" }, - { label: "姓名", name: "CreateUserName", width: 100, align: "left" }, { label: "申请时间", name: "CreateTime", width: 130, align: "left" }, { - 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: "DeptNo", 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: "MajorNo", 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: "ClassDiredctorNo", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', - key: value, - keyId: 'empno', - callback: function (_data) { - callback(_data['empname']); - } - }); - } - }, - { - label: "辅导员", name: "ClassTutorNo", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', - key: value, - keyId: 'empno', - callback: function (_data) { - callback(_data['empname']); - } - }); + label: "审核状态", name: "CheckStatus", width: 100, align: "left", formatter: function (cellvalue) { + return cellvalue == "1" ? "审核中" : cellvalue == "2" ? "审核通过" : cellvalue == "3" ? "审核未通过" : "草稿"; } }, + //{ + // 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: "DeptNo", 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: "MajorNo", 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: "ClassDiredctorNo", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', + // key: value, + // keyId: 'empno', + // callback: function (_data) { + // callback(_data['empname']); + // } + // }); + // } + //}, + //{ + // label: "辅导员", name: "ClassTutorNo", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', + // key: value, + // keyId: 'empno', + // callback: function (_data) { + // callback(_data['empname']); + // } + // }); + // } + //}, ], mainId: 'Id', @@ -205,8 +272,21 @@ var bootstrap = function ($, learun) { $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; - refreshGirdData = function () { - $('#gridtable').jfGridSet('reload'); + refreshGirdData = function (res, postData) { + if (!!res) { + if (res.code == 200) { + // 发起流程 + var postData = { + schemeCode: 'StuLeaveManagement',// 填写流程对应模板编号 + processId: processId, + level: '1', + }; + learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { + learun.loading(false); + }); + } + page.search(); + } }; page.init(); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherCancelLeaveManagement/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherCancelLeaveManagement/Form.js index 776666a21..df24318bc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherCancelLeaveManagement/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherCancelLeaveManagement/Form.js @@ -23,24 +23,23 @@ var bootstrap = function ($, learun) { } // 设置权限 setAuthorize = function (data) { - if(!!data) - { - for (var field in data) { - if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 - $('#' + data[field].fieldId).parent().remove(); - } - else { - if (data[field].isEdit != 1) { - $('#' + data[field].fieldId).attr('disabled', 'disabled'); - if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { - $('#' + data[field].fieldId).css({ 'padding-right': '58px' }); - $('#' + data[field].fieldId).find('.btn-success').remove(); - } - } - } - } - } - }; + if (!!data) { + for (var field in data) { + if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 + $('#' + data[field].fieldId).parent().remove(); + } + else { + if (data[field].isEdit != 1) { + $('#' + data[field].fieldId).attr('disabled', 'disabled'); + if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { + $('#' + data[field].fieldId).css({ 'padding-right': '58px' }); + $('#' + data[field].fieldId).find('.btn-success').remove(); + } + } + } + } + } + }; var page = { init: function () { $('.lr-form-wrap').lrscroll(); @@ -61,34 +60,37 @@ var bootstrap = function ($, learun) { $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/TeacherCancelLeaveManagement/GetFormData?keyValue=' + keyValue, function (data) { for (var id in data) { if (!!data[id].length && data[id].length > 0) { - $('#' + id ).jfGridSet('refreshdata', data[id]); + $('#' + id).jfGridSet('refreshdata', data[id]); } else { $('[data-table="' + id + '"]').lrSetFormData(data[id]); } } + $("#WorkTime").val(data[id].WorkTime); }); } } }; // 设置表单数据 - setFormData = function (processId,param,callback) { + setFormData = function (processId, param, callback) { if (!!processId) { $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/TeacherCancelLeaveManagement/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 == 'TeacherCancelLeaveManagement' && data[id] ){ + $('#' + id).jfGridSet('refreshdata', data[id]); + } + else { + if (id == 'TeacherCancelLeaveManagement' && data[id]) { keyValue = data[id].Id; } - $('[data-table="' + id + '"]').lrSetFormData(data[id]); - } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); } - }); - } - callback && callback(); } + } + $("#WorkTime").val(data[id].WorkTime); + }); + } + callback && callback(); + } // 验证数据是否填写完整 validForm = function () { if (!$('body').lrValidform()) { @@ -99,8 +101,8 @@ var bootstrap = function ($, learun) { // 保存数据 save = function (processId, callBack, i) { var formData = $('body').lrGetFormData(); - if(!!processId){ - formData.ProcessId =processId; + if (!!processId) { + formData.ProcessId = processId; } var postData = { strEntity: JSON.stringify(formData) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherCancelLeaveManagement/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherCancelLeaveManagement/FormView.js index 493cbc476..df24318bc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherCancelLeaveManagement/FormView.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherCancelLeaveManagement/FormView.js @@ -66,6 +66,7 @@ var bootstrap = function ($, learun) { $('[data-table="' + id + '"]').lrSetFormData(data[id]); } } + $("#WorkTime").val(data[id].WorkTime); }); } } @@ -85,6 +86,7 @@ var bootstrap = function ($, learun) { $('[data-table="' + id + '"]').lrSetFormData(data[id]); } } + $("#WorkTime").val(data[id].WorkTime); }); } callback && callback(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherLeaveManagement/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherLeaveManagement/Form.js index bd1947328..7cc9d33c3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherLeaveManagement/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherLeaveManagement/Form.js @@ -18,24 +18,23 @@ var bootstrap = function ($, learun) { "use strict"; // 设置权限 setAuthorize = function (data) { - if(!!data) - { - for (var field in data) { - if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 - $('#' + data[field].fieldId).parent().remove(); - } - else { - if (data[field].isEdit != 1) { - $('#' + data[field].fieldId).attr('disabled', 'disabled'); - if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { - $('#' + data[field].fieldId).css({ 'padding-right': '58px' }); - $('#' + data[field].fieldId).find('.btn-success').remove(); - } - } - } - } - } - }; + if (!!data) { + for (var field in data) { + if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 + $('#' + data[field].fieldId).parent().remove(); + } + else { + if (data[field].isEdit != 1) { + $('#' + data[field].fieldId).attr('disabled', 'disabled'); + if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { + $('#' + data[field].fieldId).css({ 'padding-right': '58px' }); + $('#' + data[field].fieldId).find('.btn-success').remove(); + } + } + } + } + } + }; var page = { init: function () { $('.lr-form-wrap').lrscroll(); @@ -55,34 +54,41 @@ var bootstrap = function ($, learun) { $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/TeacherLeaveManagement/GetFormData?keyValue=' + keyValue, function (data) { for (var id in data) { if (!!data[id].length && data[id].length > 0) { - $('#' + id ).jfGridSet('refreshdata', data[id]); + $('#' + id).jfGridSet('refreshdata', data[id]); } else { $('[data-table="' + id + '"]').lrSetFormData(data[id]); } + + $("#StartTime").val(data[id].StartTime); + $("#EndTime").val(data[id].EndTime); } }); } } }; // 设置表单数据 - setFormData = function (processId,param,callback) { + setFormData = function (processId, param, callback) { if (!!processId) { $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/TeacherLeaveManagement/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 == 'TeacherLeaveManagement' && data[id] ){ + $('#' + id).jfGridSet('refreshdata', data[id]); + } + else { + if (id == 'TeacherLeaveManagement' && data[id]) { keyValue = data[id].Id; } - $('[data-table="' + id + '"]').lrSetFormData(data[id]); - } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); } - }); - } - callback && callback(); } + + $("#StartTime").val(data[id].StartTime); + $("#EndTime").val(data[id].EndTime); + } + }); + } + callback && callback(); + } // 验证数据是否填写完整 validForm = function () { if (!$('body').lrValidform()) { @@ -93,8 +99,8 @@ var bootstrap = function ($, learun) { // 保存数据 save = function (processId, callBack, i) { var formData = $('body').lrGetFormData(); - if(!!processId){ - formData.ProcessId =processId; + if (!!processId) { + formData.ProcessId = processId; } var postData = { strEntity: JSON.stringify(formData) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherLeaveManagement/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherLeaveManagement/FormView.js index bd1947328..7cc9d33c3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherLeaveManagement/FormView.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherLeaveManagement/FormView.js @@ -18,24 +18,23 @@ var bootstrap = function ($, learun) { "use strict"; // 设置权限 setAuthorize = function (data) { - if(!!data) - { - for (var field in data) { - if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 - $('#' + data[field].fieldId).parent().remove(); - } - else { - if (data[field].isEdit != 1) { - $('#' + data[field].fieldId).attr('disabled', 'disabled'); - if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { - $('#' + data[field].fieldId).css({ 'padding-right': '58px' }); - $('#' + data[field].fieldId).find('.btn-success').remove(); - } - } - } - } - } - }; + if (!!data) { + for (var field in data) { + if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 + $('#' + data[field].fieldId).parent().remove(); + } + else { + if (data[field].isEdit != 1) { + $('#' + data[field].fieldId).attr('disabled', 'disabled'); + if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { + $('#' + data[field].fieldId).css({ 'padding-right': '58px' }); + $('#' + data[field].fieldId).find('.btn-success').remove(); + } + } + } + } + } + }; var page = { init: function () { $('.lr-form-wrap').lrscroll(); @@ -55,34 +54,41 @@ var bootstrap = function ($, learun) { $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/TeacherLeaveManagement/GetFormData?keyValue=' + keyValue, function (data) { for (var id in data) { if (!!data[id].length && data[id].length > 0) { - $('#' + id ).jfGridSet('refreshdata', data[id]); + $('#' + id).jfGridSet('refreshdata', data[id]); } else { $('[data-table="' + id + '"]').lrSetFormData(data[id]); } + + $("#StartTime").val(data[id].StartTime); + $("#EndTime").val(data[id].EndTime); } }); } } }; // 设置表单数据 - setFormData = function (processId,param,callback) { + setFormData = function (processId, param, callback) { if (!!processId) { $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/TeacherLeaveManagement/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 == 'TeacherLeaveManagement' && data[id] ){ + $('#' + id).jfGridSet('refreshdata', data[id]); + } + else { + if (id == 'TeacherLeaveManagement' && data[id]) { keyValue = data[id].Id; } - $('[data-table="' + id + '"]').lrSetFormData(data[id]); - } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); } - }); - } - callback && callback(); } + + $("#StartTime").val(data[id].StartTime); + $("#EndTime").val(data[id].EndTime); + } + }); + } + callback && callback(); + } // 验证数据是否填写完整 validForm = function () { if (!$('body').lrValidform()) { @@ -93,8 +99,8 @@ var bootstrap = function ($, learun) { // 保存数据 save = function (processId, callBack, i) { var formData = $('body').lrGetFormData(); - if(!!processId){ - formData.ProcessId =processId; + if (!!processId) { + formData.ProcessId = processId; } var postData = { strEntity: JSON.stringify(formData) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 5f97b7b4e..7acc5b0b0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -1070,6 +1070,7 @@ + @@ -1106,6 +1107,7 @@ + @@ -7904,6 +7906,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/ioc.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/ioc.config index ab01c2205..2f1f612c2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/ioc.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/ioc.config @@ -35,6 +35,9 @@ + + + @@ -80,7 +83,9 @@ - + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementBLL.cs index 9819c68d8..28d830e89 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementBLL.cs @@ -67,6 +67,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取主表实体数据 + /// + /// 流程实例ID + /// + public StuCancelLeaveManagementEntity GetEntityByProcessId(string processId) + { + try + { + return stuCancelLeaveManagementService.GetEntityByProcessId(processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion #region 提交数据 @@ -119,6 +143,52 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 提交实体数据 + /// + /// 主键 + public void DoSubmit(string keyValue, string status, string processId) + { + try + { + stuCancelLeaveManagementService.DoSubmit(keyValue, status, processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 审核实体数据 + /// + /// 主键 + public void ChangeStatusByProcessId(string status, string processId, string userId) + { + try + { + stuCancelLeaveManagementService.ChangeStatusByProcessId(status, processId, userId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementEntity.cs index 258efd80e..26770dc7f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementEntity.cs @@ -55,7 +55,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("CREATETIME")] public DateTime? CreateTime { get; set; } /// - /// 审核状态 + /// 审核状态(0草稿,1审核中,2审核通过,3,审核不通过) /// [Column("CHECKSTATUS")] public string CheckStatus { get; set; } @@ -79,6 +79,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration ///
[Column("CHECKUSERNO")] public string CheckUserNo { get; set; } + /// + /// 流程Id + /// + [Column("PROCESSID")] + public string ProcessId { get; set; } + /// + /// 销假请假单Id + /// + [Column("LEAVEID")] + public string LeaveId { get; set; } #endregion #region 扩展操作 @@ -111,6 +121,56 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration public string ClassDiredctorNo { get; set; } [NotMapped] public string ClassTutorNo { get; set; } + /// + /// Id + /// + [NotMapped] + public string IdInLeave { get; set; } + /// + /// 请假类型 + /// + [NotMapped] + public string LeaveType { get; set; } + /// + /// 开始时间 + /// + [NotMapped] + public DateTime? StartTime { get; set; } + /// + /// 结束时间 + /// + [NotMapped] + public DateTime? EndTime { get; set; } + /// + /// 请假天数 + /// + [NotMapped] + public decimal? LeaveDay { get; set; } + /// + /// 请假事由 + /// + [NotMapped] + public string LeaveReason { get; set; } + /// + /// 申请人ID + /// + [NotMapped] + public string CreateUserIdInLeave { get; set; } + /// + /// 申请人编号 + /// + [NotMapped] + public string CreateUserNoInLeave { get; set; } + /// + /// 申请时间 + /// + [NotMapped] + public DateTime? CreateTimeInLeave { get; set; } + /// + /// 审核状态(0草稿,1审核中,2审核通过,3审核不通过,) + /// + [NotMapped] + public string CheckStatusInLeave { get; set; } #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementIBLL.cs index ddbdd751a..b180ef92f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementIBLL.cs @@ -27,6 +27,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// StuCancelLeaveManagementEntity GetStuCancelLeaveManagementEntity(string keyValue); + + /// + /// 获取主表实体数据 + /// + /// 流程实例ID + /// + StuCancelLeaveManagementEntity GetEntityByProcessId(string processId); #endregion #region 提交数据 @@ -42,6 +49,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// 实体 void SaveEntity(string keyValue, StuCancelLeaveManagementEntity entity); + + /// + /// 提交实体数据 + /// + /// 主键 + void DoSubmit(string keyValue, string status, string processId); + + /// + /// 审核实体数据 + /// + /// 主键 + void ChangeStatusByProcessId(string status, string processId, string userId); + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementService.cs index bfeb8a4cd..d88a489a6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementService.cs @@ -30,16 +30,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration try { var strSql = new StringBuilder(); - strSql.Append("SELECT t.*,s.StuName as CreateUserName,s.ClassNo,s.DeptNo,s.MajorNo,c.ClassDiredctorNo,c.ClassTutorNo "); - strSql.Append(" FROM StuCancelLeaveManagement t left join StuInfoBasic s on t.CreateUserNo=s.StuNo left join ClassInfo c on s.ClassNo=c.ClassNo "); - strSql.Append(" WHERE 1=1 "); + strSql.Append("SELECT t.Id as IdInLeave,t.LeaveType,t.StartTime,t.EndTime,t.LeaveDay,t.LeaveReason,t.CreateUserNo as CreateUserNoInLeave,t.CreateUserId as CreateUserIdInLeave,t.CreateTime as CreateTimeInLeave,t.CheckStatus as CheckStatusInLeave,t2.* "); + strSql.Append(" FROM StuLeaveManagement t "); + strSql.Append(" left join StuCancelLeaveManagement t2 on t.Id=t2.LeaveId "); + strSql.Append(" WHERE 1=1 and t.CheckStatus='2' "); var queryParam = queryJson.ToJObject(); // 虚拟参数 var dp = new DynamicParameters(new { }); - if (!queryParam["CancelLeaveType"].IsEmpty()) + if (!queryParam["LeaveType"].IsEmpty()) { - dp.Add("CancelLeaveType",queryParam["CancelLeaveType"].ToString(), DbType.String); - strSql.Append(" AND t.CancelLeaveType = @CancelLeaveType "); + dp.Add("LeaveType",queryParam["LeaveType"].ToString(), DbType.String); + strSql.Append(" AND t.LeaveType = @LeaveType "); } if (!queryParam["CheckStatus"].IsEmpty()) { @@ -49,14 +50,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration if (!queryParam["StuNo"].IsEmpty()) { dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); - strSql.Append(" AND t.CreateUserNo = @StuNo "); - } - //班级班主任/辅导员 - if (!queryParam["ClassManagerNo"].IsEmpty()) - { - dp.Add("ClassManagerNo", queryParam["ClassManagerNo"].ToString(), DbType.String); - strSql.Append(" AND (c.ClassDiredctorNo = @ClassManagerNo or c.ClassTutorNo = @ClassManagerNo ) "); + strSql.Append(" AND t2.CreateUserNo = @StuNo "); } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); } catch (Exception ex) @@ -96,6 +92,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取主表实体数据 + /// + /// 流程实例ID + /// + public StuCancelLeaveManagementEntity GetEntityByProcessId(string processId) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(t => t.ProcessId == processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion #region 提交数据 @@ -156,6 +176,52 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 提交实体数据 + /// + /// 主键 + public void DoSubmit(string keyValue, string status, string processId) + { + try + { + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuCancelLeaveManagement set CheckStatus='" + status + "',ProcessId='" + processId + "' where Id='" + keyValue + "' "); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 审核实体数据 + /// + /// 主键 + public void ChangeStatusByProcessId(string status, string processId, string userId) + { + try + { + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuCancelLeaveManagement set CheckStatus='" + status + "',CheckUserId='" + userId + "',CheckTime='" + DateTime.Now + "' where ProcessId='" + processId + "' "); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementBLL.cs index cdc1dbf71..46c2533db 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementBLL.cs @@ -67,6 +67,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取主表实体数据 + /// + /// 流程实例ID + /// + public StuLeaveManagementEntity GetEntityByProcessId(string processId) + { + try + { + return stuLeaveManagementService.GetEntityByProcessId(processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion #region 提交数据 @@ -119,6 +143,52 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 提交实体数据 + /// + /// 主键 + public void DoSubmit(string keyValue, string status, string processId) + { + try + { + stuLeaveManagementService.DoSubmit(keyValue, status, processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 审核实体数据 + /// + /// 主键 + public void ChangeStatusByProcessId(string status, string processId, string userId) + { + try + { + stuLeaveManagementService.ChangeStatusByProcessId(status, processId, userId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementEntity.cs index a55ce6d79..0d2f3fac3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementEntity.cs @@ -60,7 +60,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("CREATETIME")] public DateTime? CreateTime { get; set; } /// - /// 审核状态 + /// 审核状态(0草稿,1审核中,2审核通过,3审核不通过,) /// [Column("CHECKSTATUS")] public string CheckStatus { get; set; } @@ -84,6 +84,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration ///
[Column("CHECKTIME")] public DateTime? CheckTime { get; set; } + /// + /// 附件上传 + /// + [Column("FILES")] + public string Files { get; set; } + /// + /// 流程Id + /// + [Column("PROCESSID")] + public string ProcessId { get; set; } #endregion #region 扩展操作 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementIBLL.cs index 4f2798c34..2842707a4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementIBLL.cs @@ -27,6 +27,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// StuLeaveManagementEntity GetStuLeaveManagementEntity(string keyValue); + + /// + /// 获取主表实体数据 + /// + /// 流程实例ID + /// + StuLeaveManagementEntity GetEntityByProcessId(string processId); #endregion #region 提交数据 @@ -42,6 +49,18 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// 实体 void SaveEntity(string keyValue, StuLeaveManagementEntity entity); + + /// + /// 提交实体数据 + /// + /// 主键 + void DoSubmit(string keyValue, string status, string processId); + + /// + /// 审核实体数据 + /// + /// 主键 + void ChangeStatusByProcessId(string status, string processId, string userId); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementService.cs index bd09b5f5c..940a1e94d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementService.cs @@ -31,8 +31,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration try { var strSql = new StringBuilder(); - strSql.Append("SELECT t.*,s.StuName as CreateUserName,s.ClassNo,s.DeptNo,s.MajorNo,c.ClassDiredctorNo,c.ClassTutorNo "); - strSql.Append(" FROM StuLeaveManagement t left join StuInfoBasic s on t.CreateUserNo=s.StuNo left join ClassInfo c on s.ClassNo=c.ClassNo "); + strSql.Append("SELECT t.*,s.StuName as CreateUserName "); + //strSql.Append("SELECT t.*,s.StuName as CreateUserName,s.ClassNo,s.DeptNo,s.MajorNo,c.ClassDiredctorNo,c.ClassTutorNo "); + strSql.Append(" FROM StuLeaveManagement t "); + strSql.Append(" left join StuInfoBasic s on t.CreateUserNo=s.StuNo "); + //strSql.Append(" left join ClassInfo c on s.ClassNo=c.ClassNo "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数 @@ -53,43 +56,43 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration strSql.Append(" AND t.CreateUserNo = @StuNo "); } //班级班主任/辅导员/系主任 - if (!queryParam["ClassManagerNo"].IsEmpty()) - { - dp.Add("ClassManagerNo", queryParam["ClassManagerNo"].ToString(), DbType.String); - strSql.Append(" AND (c.ClassDiredctorNo = @ClassManagerNo or c.ClassTutorNo = @ClassManagerNo "); - //登录用户是否是系主任:若是,展示大于2天的请假记录; - var deptDirectorRoleId = Config.GetValue("DeptDirectorRoleId"); - if (deptDirectorRoleId != null) - { - var loginInfoRoleIds = LoginUserInfo.Get().roleIds; - if (loginInfoRoleIds.IndexOf(',') == -1) - { - if (loginInfoRoleIds == deptDirectorRoleId) - { - strSql.Append(" or t.LeaveDay>2 )"); - } - else - { - strSql.Append(" ) "); - } - } - else - { - if (loginInfoRoleIds.Split(',').Contains(deptDirectorRoleId)) - { - strSql.Append(" or t.LeaveDay>2 )"); - } - else - { - strSql.Append(" ) "); - } - } - } - else - { - strSql.Append(" ) "); - } - } + //if (!queryParam["ClassManagerNo"].IsEmpty()) + //{ + // dp.Add("ClassManagerNo", queryParam["ClassManagerNo"].ToString(), DbType.String); + // strSql.Append(" AND (c.ClassDiredctorNo = @ClassManagerNo or c.ClassTutorNo = @ClassManagerNo "); + // //登录用户是否是系主任:若是,展示大于2天的请假记录; + // var deptDirectorRoleId = Config.GetValue("DeptDirectorRoleId"); + // if (deptDirectorRoleId != null) + // { + // var loginInfoRoleIds = LoginUserInfo.Get().roleIds; + // if (loginInfoRoleIds.IndexOf(',') == -1) + // { + // if (loginInfoRoleIds == deptDirectorRoleId) + // { + // strSql.Append(" or t.LeaveDay>2 )"); + // } + // else + // { + // strSql.Append(" ) "); + // } + // } + // else + // { + // if (loginInfoRoleIds.Split(',').Contains(deptDirectorRoleId)) + // { + // strSql.Append(" or t.LeaveDay>2 )"); + // } + // else + // { + // strSql.Append(" ) "); + // } + // } + // } + // else + // { + // strSql.Append(" ) "); + // } + //} return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); } catch (Exception ex) @@ -129,6 +132,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取主表实体数据 + /// + /// 流程实例ID + /// + public StuLeaveManagementEntity GetEntityByProcessId(string processId) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(t => t.ProcessId == processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion #region 提交数据 @@ -189,6 +216,52 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 提交实体数据 + /// + /// 主键 + public void DoSubmit(string keyValue, string status, string processId) + { + try + { + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuLeaveManagement set CheckStatus='" + status + "',ProcessId='" + processId + "' where Id='" + keyValue + "' "); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 审核实体数据 + /// + /// 主键 + public void ChangeStatusByProcessId(string status, string processId, string userId) + { + try + { + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuLeaveManagement set CheckStatus='" + status + "',CheckUserId='" + userId + "',CheckTime='" + DateTime.Now + "' where ProcessId='" + processId + "' "); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj index 612208381..4f82fc4c6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj @@ -97,8 +97,10 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/StuCancelLeaveManageMethod.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/StuCancelLeaveManageMethod.cs new file mode 100644 index 000000000..38b2e3880 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/StuCancelLeaveManageMethod.cs @@ -0,0 +1,27 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Learun.Application.WorkFlow +{ + public class StuCancelLeaveManageMethod : IWorkFlowMethod + { + StuCancelLeaveManagementIBLL stuCancelLeaveManagementIBLL = new StuCancelLeaveManagementBLL(); + + + public void Execute(WfMethodParameter parameter) + { + if (parameter.code == "agree") + { + stuCancelLeaveManagementIBLL.ChangeStatusByProcessId("2", parameter.processId, parameter.userId); + } + else + { + stuCancelLeaveManagementIBLL.ChangeStatusByProcessId("3", parameter.processId, parameter.userId); + } + } + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/StuLeaveManagementMethod.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/StuLeaveManagementMethod.cs new file mode 100644 index 000000000..9eb33794a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/StuLeaveManagementMethod.cs @@ -0,0 +1,26 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Learun.Application.WorkFlow +{ + public class StuLeaveManagementMethod : IWorkFlowMethod + { + StuLeaveManagementIBLL stuLeaveManagementIBLL = new StuLeaveManagementBLL(); + + public void Execute(WfMethodParameter parameter) + { + if (parameter.code == "agree") + { + stuLeaveManagementIBLL.ChangeStatusByProcessId("2", parameter.processId, parameter.userId); + } + else + { + stuLeaveManagementIBLL.ChangeStatusByProcessId("3", parameter.processId, parameter.userId); + } + } + } +}