From e9e929b9a2ea0fac27827c9204fc8e3a2af114ae Mon Sep 17 00:00:00 2001 From: edy Date: Wed, 23 Jun 2021 16:23:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/FillinFromController.cs | 24 ++++-- .../Views/FillinFrom/Form.js | 35 +------- .../Views/FillinFrom/FormPeople.cshtml | 43 ++++++++++ .../Views/FillinFrom/FormPeople.js | 83 +++++++++++++++++++ .../Views/FillinFrom/Index.cshtml | 2 +- .../Views/FillinFrom/Index.js | 39 ++------- .../Learun.Application.Web.csproj | 2 + .../FillinFrom/FillinFromEntity.cs | 2 +- 8 files changed, 160 insertions(+), 70 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.js 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 d23272bc8..2202a05f2 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 @@ -26,7 +26,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -35,7 +35,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); + } + /// + /// 设置填报人 + /// + /// + [HttpGet] + public ActionResult FormPeople() + { + return View(); } #endregion @@ -71,8 +80,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var FillinFromData = fillinFromIBLL.GetFillinFromEntity( keyValue ); - var jsonData = new { + var FillinFromData = fillinFromIBLL.GetFillinFromEntity(keyValue); + var jsonData = new + { FillinFrom = FillinFromData, }; return Success(jsonData); @@ -105,10 +115,14 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { FillinFromEntity entity = strEntity.ToObject(); - fillinFromIBLL.SaveEntity(keyValue,entity); + if (entity.State == 0) + { + entity.State = 1; + } if (string.IsNullOrEmpty(keyValue)) { } + fillinFromIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } #endregion 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 896991833..8a73f7255 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 @@ -23,40 +23,11 @@ var bootstrap = function ($, learun) { var Cycles = $("#FillingCycle").lrselectGet(); if (Cycles != null && Cycles != "" && Cycles != undefined && Cycles == 2) { $('#FillingTime').lrDataItemSelect({ code: 'CycleTime' }); - } + } else { + $('#FillingTime').lrDataItemSelect({ code: 'undefined' }); + } } }); - - //$('#FillingTime').lrDataItemSelect({ code: 'CycleTime' }); - - //$('#City').lrselect({ - // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_CITY', - // param: { strWhere: " cparent= 650000 " }, - // value: 'ccode', - // text: 'cname', - // maxHeight: 200, - // select: function (item) { - // var Citys = $("#City").lrselectGet(); - // if (Citys != null && Citys != "" && Citys != undefined) { - // $('#Area').lrselectRefresh({ - // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', - // param: { strWhere: " 1=1 and aparent in (" + Citys + ")" }, - // value: "acode", - // text: "aname", - // maxHeight: 200 - // }); - // } else { - // $('#Area').lrselectRefresh({ - // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', - // param: { strWhere: " 1=1 and aparent ='' " }, - // value: "acode", - // text: "aname", - // maxHeight: 200 - // }); - // } - // } - //}) - //$("#Area").lrselect(); }, initData: function () { if (!!keyValue) { 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 new file mode 100644 index 000000000..191e9a33b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.cshtml @@ -0,0 +1,43 @@ +@{ + ViewBag.Title = "质量目标管理体系指标模块"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
工作模块*
+ +
+
+
项目名称*
+ +
+
+
序      号*
+ +
+
+
填报部门*
+
+
+
+
填报周期
+
+
+
+
填报时间
+
+
+
+
填报人*
+
+
+
+
备      注
+ +
+ +
+@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 new file mode 100644 index 000000000..788f0154b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormPeople.js @@ -0,0 +1,83 @@ +/* * 版 本 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 () { + console.log($('#FillingDept').lrDataSourceSelect); + $('#FillingDept').lrDataSourceSelect({ + code: 'classdata', + value: 'id', + text: 'name', + select: function (item) { + var DeptCode = $('#FillingDept').lrselectGet(); + if (DeptCode != null && DeptCode != "" && DeptCode != undefined) { + $('#FillingPeople').lrDataSourceSelect({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=teacheruserdata', + value: 'f_userid', + text: 'f_realname', + param: { strWhere: " 1=1 and f_encode ='' " }, + }); + } + } + + }); + $("#FillingPeople").lrselect(); + $('#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'); + } + }; + // 保存数据 + 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 51a6045c6..a722abf2d 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 @@ -44,7 +44,7 @@  删除  撤回  设置公式 -  设置周期 + @* 设置周期*@  设置填报人  隐藏  导入 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 094639ee4..5d8695d6a 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 @@ -18,9 +18,6 @@ var bootstrap = function ($, learun) { }, 220, 400); $('#FillingCycle').lrDataItemSelect({ code: 'ThisCycle' }); $('#FillingPeople').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); - if (true) { - - } // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -113,20 +110,20 @@ var bootstrap = function ($, learun) { }); } }); - //设置周期 - $('#lr_cycle').on('click', function () { + //设置填报人 + $('#lr_people').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { var RStatus = $('#gridtable').jfGridValue('State'); - if (RStatus !== 0) { - learun.alert.warning("当前项不能设置周期!"); + if (RStatus !== 1) { + learun.alert.warning("当前项不能设置填报人!"); return false; } learun.layerForm({ id: 'form', - title: '设置周期', - url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/Form?keyValue=' + keyValue, - width: 500, + title: '设置填报人', + url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/FormPeople?keyValue=' + keyValue, + width: 600, height: 400, callBack: function (id) { return top[id].acceptClick(refreshGirdData); @@ -134,24 +131,6 @@ var bootstrap = function ($, learun) { }); } }); - //设置填报人 - $('#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.layerConfirm('是否确认提交该项!', function (res) { - if (res) { - learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Repair/DoSubmit', { keyValue: keyValue }, function () { - refreshGirdData(); - }); - } - }); - } - }); //隐藏撤下 $('#lr_hide').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); @@ -235,11 +214,9 @@ var bootstrap = function ($, learun) { if (cellvalue === 0) { return '草稿'; } else if (cellvalue === 1) { - return '待设置周期'; + 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 d7e595e09..6b3cbb6d9 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 @@ -956,6 +956,7 @@ + @@ -7317,6 +7318,7 @@ + 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 20bb24c89..b55082d8c 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 @@ -38,7 +38,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 公式 ///
[Column("FORMULA")] - public decimal? Formul { get; set; } + public string Formul { get; set; } /// /// 结果 ///