diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FillinFromController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FillinFromController.cs index 2202a05f2..7ce53cbba 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FillinFromController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FillinFromController.cs @@ -29,6 +29,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return View(); } /// + /// + /// + /// + [HttpGet] + public ActionResult FormIndex() + { + return View(); + } + /// /// 表单页 /// /// @@ -46,6 +55,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + + /// + /// 设置公式 + /// + /// + [HttpGet] + public ActionResult Formula() + { + return View(); + } #endregion #region 获取数据 @@ -115,17 +134,66 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { FillinFromEntity entity = strEntity.ToObject(); - if (entity.State == 0) + if (!string.IsNullOrEmpty(keyValue)) { - entity.State = 1; + #region 修改状态 + if (entity.State == 1) + { + entity.State = 2; + } + else if (entity.State == 2) + { + entity.State = 3; + } + #endregion } - if (string.IsNullOrEmpty(keyValue)) + else { + entity.State = 1; } fillinFromIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } #endregion + #region 扩展数据 + /// + /// 隐藏/撤下 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult HideList(string keyValue) + { + var Model = fillinFromIBLL.GetFillInNo(keyValue); + if (Model != null) + { + //隐藏 + Model.IsFlag = 1; + } + fillinFromIBLL.SaveEntity(keyValue, Model); + return Success("保存成功!"); + } + + /// + /// 撤回 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoCanCel(string keyValue) + { + var Model = fillinFromIBLL.GetFillInNo(keyValue); + if (Model != null) + { + //重新填写 + Model.State = 3; + } + fillinFromIBLL.SaveEntity(keyValue, Model); + return Success("保存成功!"); + } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.cshtml index dd921747d..d2a75cf93 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.cshtml @@ -20,8 +20,8 @@
-
填报周期
-
+
填报周期*
+
填报时间
@@ -35,9 +35,21 @@
备      注
- @Html.AppendJsFile("/Areas/EducationalAdministration/Views/FillinFrom/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.js index 8a73f7255..cb0386b77 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.js @@ -15,6 +15,9 @@ var bootstrap = function ($, learun) { page.initData(); }, bind: function () { + $('#lrPeople')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + $('#lrPeople').val(learun.clientdata.get(['userinfo']).realName); + $('#lrTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); $('#FillingDept').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }); $('#FillingPeople').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); $('#FillingCycle').lrDataItemSelect({ @@ -43,6 +46,7 @@ var bootstrap = function ($, learun) { }); } $('#State').val('0'); + $('#IsFlag').val('0'); } }; // 保存数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.cshtml new file mode 100644 index 000000000..1a7752e20 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.cshtml @@ -0,0 +1,42 @@ +@{ + ViewBag.Title = "质量目标管理体系指标模块"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
工作模块
+ +
+
+
项目名称
+ +
+
+
填报周期
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/FillinFrom/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.js new file mode 100644 index 000000000..ed4d37c55 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.js @@ -0,0 +1,248 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-21 18:39 + * 描 述:质量目标管理体系指标模块 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#FillingCycle').lrDataItemSelect({ code: 'ThisCycle' }); + $('#FillingPeople').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/Form', + width: 500, + 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 State = $('#gridtable').jfGridValue('State'); + if (State !== 0) { + learun.alert.warning("当前项目已提交不能修改!"); + return; + } + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var State = $('#gridtable').jfGridValue('State'); + if (State !== 0) { + learun.alert.warning("当前项目已提交不能删除!"); + return; + } + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //撤回 + $('#lr_cancel').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var RStatus = $('#gridtable').jfGridValue('State'); + if (RStatus == 1) { + learun.alert.warning("已提交!"); + return false; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Repair/DoSubmit', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //设置公式 + //$('#lr_formula').on('click', function () { + // var keyValue = $('#gridtable').jfGridValue('Id'); + // if (learun.checkrow(keyValue)) { + // //var RStatus = $('#gridtable').jfGridValue('State'); + // //if (RStatus == 1) { + // // learun.alert.warning("已提交!"); + // // return false; + // //} + // learun.layerForm({ + // id: 'form', + // title: '设置公式', + // url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/FormPeople?keyValue=' + keyValue, + // // url: top.$.rootUrl + '/LR_SystemModule/DataItem/GetDetailList', + // //param: { itemCode: 'Client_ProductInfo' }, + // //selectWord: 'F_ItemName', + // //value: 'F_ItemValue', + // //text: 'F_ItemName', + // //headData: [{ label: "商品编号", name: "F_ItemValue", width: 100, align: "left" }, + // //{ label: "商品名称", name: "F_ItemName", width: 450, align: "left" }], + // //select: function (item) { + // //} + // }); + // } + //}); + //设置填报人 + $('#lr_people').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var RStatus = $('#gridtable').jfGridValue('State'); + if (RStatus !== 1) { + learun.alert.warning("当前项不能设置填报人!"); + return false; + } + learun.layerForm({ + id: 'form', + title: '设置填报人', + url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/FormPeople?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + //隐藏撤下 + $('#lr_hide').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var RStatus = $('#gridtable').jfGridValue('State'); + if (RStatus == 1) { + learun.alert.warning("已提交!"); + return false; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Repair/DoSubmit', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/GetPageList', + headData: [ + { label: "核心工作模块", name: "WorderModule", width: 300, align: "center" }, + { label: "序号", name: "SerialNo", width: 100, align: "center" }, + { label: "项目名称", name: "ProjectName", width: 300, align: "center" }, + { + label: "填报周期", name: "FillingCycle", width: 100, align: "center", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'ThisCycle', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "填报时间", name: "FillingTime", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'CycleTime', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "填报部门", name: "FillingDept", width: 100, align: "center", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: "填报人", name: "FillingPeople", width: 150, align: "center", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', + key: value, + keyId: 'f_userid', + callback: function (_data) { + callback(_data['f_realname']); + } + }); + } + }, + { + label: "状态", name: "State", width: 150, align: "center", + formatter: function (cellvalue) { + if (cellvalue === 0) { + return '草稿'; + } else if (cellvalue === 1) { + return '待设置填报人'; + } else if (cellvalue === 2) { + return '待设置公式'; + } else { + return '已完成'; + } + } + }, + { label: "备注", name: "Demo", width: 300, align: "center" }, + ], + mainId: 'Id', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.cshtml index 191e9a33b..5f8aed7df 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.cshtml @@ -5,39 +5,51 @@
工作模块*
- +
项目名称*
- +
序      号*
- +
填报部门*
-
+
填报周期
-
+
填报时间
-
+
+
+
+
填报人*
+
-
-
填报人*
-
-
备      注
- @Html.AppendJsFile("/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.js index 788f0154b..3999d8690 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.js @@ -15,7 +15,9 @@ var bootstrap = function ($, learun) { page.initData(); }, bind: function () { - console.log($('#FillingDept').lrDataSourceSelect); + $('#lrPeople')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + $('#lrPeople').val(learun.clientdata.get(['userinfo']).realName); + $('#lrTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); $('#FillingDept').lrDataSourceSelect({ code: 'classdata', value: 'id', @@ -23,18 +25,16 @@ var bootstrap = function ($, learun) { select: function (item) { var DeptCode = $('#FillingDept').lrselectGet(); if (DeptCode != null && DeptCode != "" && DeptCode != undefined) { - $('#FillingPeople').lrDataSourceSelect({ + $('#FillingPeople').lrselectRefresh({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=teacheruserdata', value: 'f_userid', text: 'f_realname', - param: { strWhere: " 1=1 and f_encode ='' " }, + param: { strWhere: " 1=1 and f_departmentid in ('" + DeptCode + "')" } }); } } - }); $("#FillingPeople").lrselect(); - $('#FillingPeople').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); //设置周期 $('#FillingCycle').lrDataItemSelect({ code: 'ThisCycle', @@ -62,6 +62,7 @@ var bootstrap = function ($, learun) { }); } $('#State').val('0'); + $('#IsFlag').val('0'); } }; // 保存数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Formula.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Formula.cshtml new file mode 100644 index 000000000..d92b9bd34 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Formula.cshtml @@ -0,0 +1,59 @@ +@{ + ViewBag.Title = "质量目标管理体系指标模块"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
工作模块*
+ +
+
+
项目名称*
+ +
+
+
序      号*
+ +
+
+
填报部门*
+
+
+
+
填报周期
+
+
+
+
填报时间
+
+
+
+
填报人*
+
+
+
+
设置公式*
+
+
+
+
备      注
+ +
+ + + + +
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/FillinFrom/Formula.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Formula.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Formula.js new file mode 100644 index 000000000..306cf6953 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Formula.js @@ -0,0 +1,97 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-21 18:39 + * 描 述:质量目标管理体系指标模块 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#Formula').lrGirdSelect({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=FormulaMain', + selectWord: 'name', + value: 'result', + text: 'name', + headData: + [ + { label: "公式", name: "result", width: 300, align: "left" }, + { label: "公式名称", name: "name", width: 300, align: "left" } + ], + select: function (item) { + } + }); + $('#lrPeople')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + $('#lrPeople').val(learun.clientdata.get(['userinfo']).realName); + $('#lrTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); + $('#FillingDept').lrDataSourceSelect({ + code: 'classdata', + value: 'id', + text: 'name', + select: function (item) { + var DeptCode = $('#FillingDept').lrselectGet(); + if (DeptCode != null && DeptCode != "" && DeptCode != undefined) { + $('#FillingPeople').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=teacheruserdata', + value: 'f_userid', + text: 'f_realname', + param: { strWhere: " 1=1 and f_departmentid in ('" + DeptCode + "')" } + }); + } + } + }); + $("#FillingPeople").lrselect(); + //设置周期 + $('#FillingCycle').lrDataItemSelect({ + code: 'ThisCycle', + select: function (item) { + var Cycles = $("#FillingCycle").lrselectGet(); + if (Cycles != null && Cycles != "" && Cycles != undefined && Cycles == 2) { + $('#FillingTime').lrDataItemSelect({ code: 'CycleTime' }); + } else { + $('#FillingTime').lrDataItemSelect({ code: 'undefined' }); + } + } + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/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]); + } + } + }); + } + $('#State').val('0'); + $('#IsFlag').val('0'); + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormulaIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormulaIndex.cshtml new file mode 100644 index 000000000..5efed7c1f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormulaIndex.cshtml @@ -0,0 +1,55 @@ +@{ + ViewBag.Title = "质量目标管理体系指标模块"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
工作模块*
+ +
+
+
项目名称*
+ +
+
+
序      号*
+ +
+
+
填报部门*
+
+
+
+
填报周期*
+
+
+
+
填报时间
+
+
+ @*
+
填报人*
+
+
*@ +
+
备      注
+ +
+ + + + +
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/FillinFrom/FormulaIndex.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormulaIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormulaIndex.js new file mode 100644 index 000000000..0f523b937 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormulaIndex.js @@ -0,0 +1,70 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-21 18:39 + * 描 述:质量目标管理体系指标模块 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#lrPeople')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + $('#lrPeople').val(learun.clientdata.get(['userinfo']).realName); + $('#lrTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); + $('#FillingDept').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }); + $('#FillingPeople').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); + $('#FillingCycle').lrDataItemSelect({ + code: 'ThisCycle', + select: function (item) { + var Cycles = $("#FillingCycle").lrselectGet(); + if (Cycles != null && Cycles != "" && Cycles != undefined && Cycles == 2) { + $('#FillingTime').lrDataItemSelect({ code: 'CycleTime' }); + } else { + $('#FillingTime').lrDataItemSelect({ code: 'undefined' }); + } + } + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/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]); + } + } + }); + } + $('#State').val('0'); + $('#IsFlag').val('0'); + + + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.cshtml index a722abf2d..f79d9f108 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.cshtml @@ -11,25 +11,17 @@
-
核心工作模块
+
工作模块
项目名称
-
+
填报周期
-
-
状态
- -
-
-
填报人
-
-
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.js index 5d8695d6a..ae1347785 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.js @@ -78,14 +78,14 @@ var bootstrap = function ($, learun) { $('#lr_cancel').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { - var RStatus = $('#gridtable').jfGridValue('State'); - if (RStatus == 1) { - learun.alert.warning("已提交!"); + var State = $('#gridtable').jfGridValue('State'); + if (State <= 3) { + learun.alert.warning("当前项未执行到此处,不能测回!"); return false; } - learun.layerConfirm('是否确认提交该项!', function (res) { + learun.layerConfirm('是否确认撤回该项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Repair/DoSubmit', { keyValue: keyValue }, function () { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/DoCancel', { keyValue: keyValue }, function () { refreshGirdData(); }); } @@ -96,16 +96,19 @@ var bootstrap = function ($, learun) { $('#lr_formula').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { - var RStatus = $('#gridtable').jfGridValue('State'); - if (RStatus == 1) { - learun.alert.warning("已提交!"); + var State = $('#gridtable').jfGridValue('State'); + if (State !== 2) { + learun.alert.warning("当前项不能设置公式!"); return false; } - learun.layerConfirm('是否确认提交该项!', function (res) { - if (res) { - learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Repair/DoSubmit', { keyValue: keyValue }, function () { - refreshGirdData(); - }); + learun.layerForm({ + id: 'form', + title: '设置公式', + url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/Formula?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); } }); } @@ -135,14 +138,9 @@ var bootstrap = function ($, learun) { $('#lr_hide').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { - var RStatus = $('#gridtable').jfGridValue('State'); - if (RStatus == 1) { - learun.alert.warning("已提交!"); - return false; - } - learun.layerConfirm('是否确认提交该项!', function (res) { + learun.layerConfirm('是否确认隐藏该项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Repair/DoSubmit', { keyValue: keyValue }, function () { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/HideList', { keyValue: keyValue }, function () { refreshGirdData(); }); } @@ -217,6 +215,8 @@ var bootstrap = function ($, learun) { return '待设置填报人'; } else if (cellvalue === 2) { return '待设置公式'; + } else if (cellvalue === 3) { + return '待填报'; } else { return '已完成'; } 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 6a356e5a5..96c2ad2bd 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 @@ -957,7 +957,10 @@ + + + @@ -7322,6 +7325,9 @@ + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromBLL.cs index e76a0ecc8..72da331d3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromBLL.cs @@ -121,5 +121,31 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion + + #region 扩展数据 + /// + /// 获取CdMajor表实体数据 + /// 主键 + /// + /// + public FillinFromEntity GetFillInNo(string keyValue) + { + try + { + return fillinFromService.GetFillInNo(keyValue); + } + 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/FillinFrom/FillinFromEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromEntity.cs index b55082d8c..bfc1be637 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromEntity.cs @@ -14,66 +14,81 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration public class FillinFromEntity { #region 实体成员 - /// - /// 主键 - /// + /// + /// 主键 + /// [Column("ID")] public string Id { get; set; } - /// - /// 工作模块 - /// + /// + /// 工作模块 + /// [Column("WORDERMODULE")] public string WorderModule { get; set; } - /// - /// 序号 - /// + /// + /// 序号 + /// [Column("SERIALNO")] public string SerialNo { get; set; } - /// - /// 项目名称 - /// + /// + /// 项目名称 + /// [Column("PROJECTNAME")] public string ProjectName { get; set; } - /// - /// 公式 - /// + /// + /// 数1 + /// [Column("FORMULA")] - public string Formul { get; set; } - /// - /// 结果 - /// + public string Formula { get; set; } + /// + /// 结果 + /// [Column("LASTRESULT")] public string LastResult { get; set; } - /// - /// 填报周期 - /// + /// + /// 填报周期 + /// [Column("FILLINGCYCLE")] public string FillingCycle { get; set; } - /// - /// 填报时间 - /// + /// + /// 填报时间 + /// [Column("FILLINGTIME")] public string FillingTime { get; set; } - /// - /// 填报部门 - /// + /// + /// 填报部门 + /// [Column("FILLINGDEPT")] public string FillingDept { get; set; } - /// - /// 填报人 - /// + /// + /// 填报人 + /// [Column("FILLINGPEOPLE")] public string FillingPeople { get; set; } - /// - /// 状态 0:草稿 1待指派部门 2待填写公式 3 已完成 - /// + /// + /// 提交人 + /// + [Column("LRPEOPLE")] + public string lrPeople { get; set; } + /// + /// 录入时间 + /// + [Column("LRTIME")] + public DateTime? lrTime { get; set; } + /// + /// 状态 0:草稿 1待指派部门 2待填写公式 3 已完成 + /// [Column("STATE")] public int? State { get; set; } - /// - /// Demo - /// + /// + /// Demo + /// [Column("DEMO")] public string Demo { get; set; } + /// + /// 隐藏/撤下 + /// + [Column("ISFLAG")] + public int? IsFlag { get; set; } #endregion #region 扩展操作 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromIBLL.cs index df263f9da..8b07f53db 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromIBLL.cs @@ -27,6 +27,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// FillinFromEntity GetFillinFromEntity(string keyValue); + + + /// + /// 获取表实体数据 + /// 主键 + /// + /// + FillinFromEntity GetFillInNo(string keyValue); #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromService.cs index 9fc0e624d..b13845e7a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromService.cs @@ -43,7 +43,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration t.FillingDept, t.FillingPeople, t.Demo, - t.State + t.State, + t.lrPeople, + t.lrTime, + t.IsFlag "); strSql.Append(" FROM FillinFrom t "); strSql.Append(" WHERE 1=1 "); @@ -62,20 +65,15 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } if (!queryParam["FillingCycle"].IsEmpty()) { - dp.Add("FillingCycle",queryParam["FillingCycle"].ToString(), DbType.String); + dp.Add("FillingCycle", queryParam["FillingCycle"].ToString(), DbType.String); strSql.Append(" AND t.FillingCycle = @FillingCycle "); } - if (!queryParam["State"].IsEmpty()) - { - dp.Add("State", "%" + queryParam["State"].ToString() + "%", DbType.String); - strSql.Append(" AND t.State Like @State "); - } if (!queryParam["FillingPeople"].IsEmpty()) { - dp.Add("FillingPeople",queryParam["FillingPeople"].ToString(), DbType.String); + dp.Add("FillingPeople", queryParam["FillingPeople"].ToString(), DbType.String); strSql.Append(" AND t.FillingPeople = @FillingPeople "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) { @@ -126,7 +124,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - this.BaseRepository("CollegeMIS").Delete(t=>t.Id == keyValue); + this.BaseRepository("CollegeMIS").Delete(t => t.Id == keyValue); } catch (Exception ex) { @@ -176,5 +174,31 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion + #region 扩展数据 + + /// + /// 获取CdMajor表实体数据 + /// 主键 + /// + /// + public FillinFromEntity GetFillInNo(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(x => x.Id == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion } }