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 7ce53cbba..16a6c6840 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 @@ -35,6 +35,10 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult FormIndex() { + var logininfo = LoginUserInfo.Get(); + ViewBag.userId = logininfo.userId; + ViewBag.isSystem = logininfo.isSystem; + ViewBag.departmentId = logininfo.departmentId; return View(); } /// 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 cb0386b77..248bd084a 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 @@ -19,7 +19,7 @@ var bootstrap = function ($, learun) { $('#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' }); + //$('#FillingPeople').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); $('#FillingCycle').lrDataItemSelect({ code: 'ThisCycle', select: function (item) { 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 index 1a7752e20..cbb15f0ad 100644 --- 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 @@ -2,7 +2,12 @@ ViewBag.Title = "质量目标管理体系指标模块"; Layout = "~/Views/Shared/_Index.cshtml"; } -
+ +
@@ -39,4 +44,4 @@
-@Html.AppendJsFile("/Areas/EducationalAdministration/Views/FillinFrom/Index.js") +@Html.AppendJsFile("/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.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 index ed4d37c55..a26ebe995 100644 --- 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 @@ -17,7 +17,7 @@ var bootstrap = function ($, learun) { page.search(queryJson); }, 220, 400); $('#FillingCycle').lrDataItemSelect({ code: 'ThisCycle' }); - $('#FillingPeople').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); + //$('#FillingPeople').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -92,31 +92,6 @@ 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("已提交!"); - // // 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'); @@ -224,6 +199,8 @@ var bootstrap = function ($, learun) { return '待设置填报人'; } else if (cellvalue === 2) { return '待设置公式'; + } else if (cellvalue === 3) { + return '待填报'; } else { return '已完成'; } @@ -238,6 +215,10 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + param.IsFlag = 0; + param.userId = userId; + param.isSystem = isSystem; + param.departmentId = departmentId; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; 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 3999d8690..b64b2eb66 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 @@ -17,7 +17,7 @@ var bootstrap = function ($, learun) { 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')); + $('#lrTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); $('#FillingDept').lrDataSourceSelect({ code: 'classdata', value: 'id', @@ -29,7 +29,8 @@ var bootstrap = function ($, learun) { url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=teacheruserdata', value: 'f_userid', text: 'f_realname', - param: { strWhere: " 1=1 and f_departmentid in ('" + DeptCode + "')" } + param: { strWhere: " 1=1 and f_departmentid in ('" + DeptCode + "')" }, + maxHeight: 200, }); } } @@ -62,7 +63,7 @@ var bootstrap = function ($, learun) { }); } $('#State').val('0'); - $('#IsFlag').val('0'); + $('#IsFlag').val('0'); } }; // 保存数据 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 index c12cb9011..efe440d30 100644 --- 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 @@ -42,7 +42,8 @@ var bootstrap = function ($, learun) { url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=teacheruserdata', value: 'f_userid', text: 'f_realname', - param: { strWhere: " 1=1 and f_departmentid in ('" + DeptCode + "')" } + param: { strWhere: " 1=1 and f_departmentid in ('" + DeptCode + "')" }, + maxHeight: 200 }); } } 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 index 0f523b937..ea397eff4 100644 --- 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 @@ -19,7 +19,7 @@ var bootstrap = function ($, learun) { $('#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' }); + //$('#FillingPeople').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); $('#FillingCycle').lrDataItemSelect({ code: 'ThisCycle', select: function (item) { @@ -47,8 +47,6 @@ var bootstrap = function ($, learun) { } $('#State').val('0'); $('#IsFlag').val('0'); - - } }; // 保存数据 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 ae1347785..c7da98c2f 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 @@ -17,7 +17,7 @@ var bootstrap = function ($, learun) { page.search(queryJson); }, 220, 400); $('#FillingCycle').lrDataItemSelect({ code: 'ThisCycle' }); - $('#FillingPeople').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); + //$('#FillingPeople').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -223,6 +223,17 @@ var bootstrap = function ($, learun) { } }, { label: "备注", name: "Demo", width: 300, align: "center" }, + { + label: "隐藏/撤下", name: "IsFlag", width: 150, align: "center", + formatter: function (cellvalue) { + if (cellvalue === 0) { + return '显示'; + } else if (cellvalue === 1) { + return '隐藏'; + } + } + }, + ], mainId: 'Id', isPage: true diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/QualityReportController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/QualityReportController.cs index 990cb74f6..ffe5b7396 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/QualityReportController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/QualityReportController.cs @@ -145,6 +145,18 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers return Success("操作成功!"); } + /// + /// 删除 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + fualityReportChildIBLL.DeleteEntity(keyValue); + + return Success("删除成功!"); + } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.js index 755d1076f..a5a0c9c03 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/FormulaMain/Index.js @@ -89,11 +89,11 @@ var bootstrap = function ($, learun) { url: top.$.rootUrl + '/LR_Desktop/FormulaMain/GetPageList', headData: [ { label: "名称", name: "Name", width: 150, align: "left" }, - { label: "公式", name: "Result", width: 250, align: "left" }, + { label: "公式", name: "Result", width: 350, align: "left" }, { label: "排序", name: "Sort", width: 100, align: "left" }, { label: "描述", name: "Desc", width: 200, align: "left" }, { - label: "状态", name: "IsEnable", width: 100, align: "left", + label: "启用", name: "IsEnable", width: 100, align: "left", formatter: function (cellvalue) { return cellvalue == 1 ? "" : ""; } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Form.js index 08f3f57d8..bb185a4fe 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Form.js @@ -35,7 +35,7 @@ var bootstrap = function ($, learun) { initData: function () { if (!!keyValue) { $.lrSetForm(top.$.rootUrl + '/LR_Desktop/QualityReport/GetFormData?keyValue=' + keyValue, function (data) { - + $('#content').html(''); for (var i = 0; i < data.length; i++) { var id = data[i].Id; @@ -87,8 +87,10 @@ var bootstrap = function ($, learun) { if (!$('body').lrValidform()) { return false; } - console.log('save', arr); - //return; + if (arr.count <= 0) { + return learun.alert.warning('请设置上报数据!'); + } + var postData = { list: arr //JSON.stringify($('body').lrGetFormData()) }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Index.js index 26eabb64a..c8fd4ae38 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Index.js @@ -119,20 +119,20 @@ var bootstrap = function ($, learun) { }); } }, - { - 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: "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', diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.cshtml index 6d82e8b47..5025d0c9b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.cshtml @@ -23,8 +23,10 @@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.js index ae95729b7..685ac95c1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.js @@ -20,6 +20,23 @@ var bootstrap = function ($, learun) { $('#lr_refresh').on('click', function () { location.reload(); }); + + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('fid'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/LR_Desktop/QualityReport/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); // 查看 $('#lr_view').on('click', function () { var keyValue = $('#gridtable').jfGridValue('fid'); @@ -52,6 +69,25 @@ var bootstrap = function ($, learun) { }); } }); + + //删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status == 1) { + return learun.alert.warning('该项已提交,不可删除!'); + } + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/LR_Desktop/QualityReport/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 打印 $('#lr_print').on('click', function () { $('#gridtable').jqprintTable(); 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 b13845e7a..7c8135b75 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 @@ -73,6 +73,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("FillingPeople", queryParam["FillingPeople"].ToString(), DbType.String); strSql.Append(" AND t.FillingPeople = @FillingPeople "); } + if (!queryParam["IsFlag"].IsEmpty()) + { + dp.Add("IsFlag", queryParam["IsFlag"].ToString(), DbType.String); + strSql.Append(" AND t.IsFlag = @IsFlag "); + } + if (!queryParam["userId"].IsEmpty() && !queryParam["isSystem"].ToBool() && !queryParam["departmentId"].IsEmpty()) + { + if (queryParam["isSystem"].ToBool() == false) + { + + } + //queryParam["userId"].ToString() != "System" && + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildBLL.cs index 9b79ede31..7b941026d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildBLL.cs @@ -209,6 +209,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildService.cs index 1bf626fe0..1407828e7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildService.cs @@ -164,6 +164,11 @@ where a.Id='{keyValue}' order by b.Sort"; int mouth = DateTime.Now.Month - 1; var entity = this.BaseRepository("CollegeMIS").FindEntity(x => x.Id == keyValue); + if (string.IsNullOrEmpty(entity.Formula)) + { + return "请先设置公式!"; + } + if (entity.FillingCycle == "1") { //填报周期--月(每月) @@ -220,12 +225,18 @@ where a.Id='{keyValue}' order by b.Sort";         /// 主键 public void DeleteEntity(string keyValue) { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); try { - this.BaseRepository("CollegeMIS").Delete(t => t.Id == keyValue); + db.Delete(t => t.Id == keyValue); + var sql = $"delete from QualityReportChild where MainId='{keyValue}'"; + db.ExecuteBySql(sql); + + db.Commit(); } catch (Exception ex) { + db.Rollback(); if (ex is ExceptionEx) { throw;