From 0322be4676d296a6f14f513a8b761226b9f7acd8 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 1 Jun 2021 10:18:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BF=E5=AE=A2=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AE=A1=E6=A0=B8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/VisitorInfoController.cs | 21 ++++++-- .../Views/VisitorInfo/ExamineForm.cshtml | 13 +++++ .../Views/VisitorInfo/ExamineForm.js | 54 +++++++++++++++++++ .../Views/VisitorInfo/Index.js | 35 +++++++----- .../Learun.Application.Web.csproj | 2 + .../VisitorInfo/VisitorInfoBLL.cs | 4 +- .../VisitorInfo/VisitorInfoEntity.cs | 8 +++ .../VisitorInfo/VisitorInfoIBLL.cs | 2 +- .../VisitorInfo/VisitorInfoService.cs | 4 +- 9 files changed, 119 insertions(+), 24 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/VisitorInfo/ExamineForm.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/VisitorInfo/ExamineForm.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/VisitorInfoController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/VisitorInfoController.cs index 97267c714..897bb1f9e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/VisitorInfoController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/VisitorInfoController.cs @@ -50,7 +50,16 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers { return View(); } - + /// + /// + /// + /// + [HttpGet] + public ActionResult ExamineForm() + { + return View(); + } + #endregion #region 获取数据 @@ -171,11 +180,13 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers /// [HttpPost] [AjaxOnly] - public ActionResult Check(string keyValue) + public ActionResult Check(string keyValue,string strEntity) { - var keyValueArr = keyValue.Split(','); - var keyValues = "'" + string.Join("','", keyValueArr) + "'"; - visitorInfoIBLL.Check(keyValues); + //var keyValueArr = keyValue.Split(','); + //var keyValues = "'" + string.Join("','", keyValueArr) + "'"; + VisitorInfoEntity entity = strEntity.ToObject(); + + visitorInfoIBLL.Check(keyValue, entity.VExamineRemarks); return Success("审核成功!"); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/VisitorInfo/ExamineForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/VisitorInfo/ExamineForm.cshtml new file mode 100644 index 000000000..7fc3c045d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/VisitorInfo/ExamineForm.cshtml @@ -0,0 +1,13 @@ +@{ + ViewBag.Title = "访客管理"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+ +
+
备注
+ +
+ +
+@Html.AppendJsFile("/Areas/PersonnelManagement/Views/VisitorInfo/ExamineForm.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/VisitorInfo/ExamineForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/VisitorInfo/ExamineForm.js new file mode 100644 index 000000000..6ecfa1890 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/VisitorInfo/ExamineForm.js @@ -0,0 +1,54 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-05-17 10:11 + * 描 述:访客管理 + */ +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 () { + + + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/VisitorInfo/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]); + } + } + }); + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + learun.postForm(top.$.rootUrl + '/PersonnelManagement/VisitorInfo/Check?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/VisitorInfo/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/VisitorInfo/Index.js index 8062dd991..7e6d1b6cb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/VisitorInfo/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/VisitorInfo/Index.js @@ -84,7 +84,7 @@ var bootstrap = function ($, learun) { if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/VisitorInfo/DeleteForm', { keyValue: keyValue}, function () { + learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/VisitorInfo/DeleteForm', { keyValue: keyValue }, function () { refreshGirdData(); }); } @@ -98,19 +98,27 @@ var bootstrap = function ($, learun) { //审核 $('#lr_lock').on('click', function () { var keyValue = $('#gridtable').jfGridValue('VID'); + if (keyValue.indexOf(',') > 0) { + learun.alert.warning("只能选中一条记录审核!"); + return; + } if (learun.checkrow(keyValue)) { var VState = $('#gridtable').jfGridValue('VState'); if (VState.indexOf('1') != -1) { learun.alert.warning("选中记录中包含已审核项目!"); return; } - learun.layerConfirm('是否确认审核该项?', function (res) { - if (res) { - learun.postForm(top.$.rootUrl + '/PersonnelManagement/VisitorInfo/Check', { keyValue: keyValue }, function () { - refreshGirdData(); - }); + learun.layerForm({ + id: 'form', + title: '审核', + url: top.$.rootUrl + '/PersonnelManagement/VisitorInfo/ExamineForm?keyValue=' + keyValue, + width: 550, + height: 330, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); } }); + } }); //去审 @@ -119,7 +127,6 @@ var bootstrap = function ($, learun) { if (learun.checkrow(keyValue)) { var VState = $('#gridtable').jfGridValue('VState'); var VStateArr = VState.split(','); - console.log("VStateArr", VStateArr); if ($.inArray('0', VStateArr) != -1 || $.inArray('', VStateArr) != -1) { learun.alert.warning("选中记录中包含未审核项目!"); return; @@ -159,20 +166,20 @@ var bootstrap = function ($, learun) { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/PersonnelManagement/VisitorInfo/GetPageList', headData: [ - { label: "姓名", name: "VName", width: 100, align: "left"}, - { label: "手机号", name: "VPhone", width: 100, align: "left"}, - { label: "申请理由", name: "VReasons", width: 100, align: "left"}, - { label: "来访目的", name: "VObjective", width: 100, align: "left"}, + { label: "姓名", name: "VName", width: 100, align: "left" }, + { label: "手机号", name: "VPhone", width: 100, align: "left" }, + { label: "申请理由", name: "VReasons", width: 100, align: "left" }, + { label: "来访目的", name: "VObjective", width: 100, align: "left" }, { label: "备注", name: "VRemarks", width: 100, align: "left" }, { - label: "审核标志", name: "VState", width: 80, align: "left", + label: "状态", name: "VState", width: 80, align: "left", formatter: function (cellvalue) { return cellvalue == 1 ? "已审核" : "未审核"; } } ], - mainId:'VID', + mainId: 'VID', isPage: true, isMultiselect: true, }); @@ -181,7 +188,7 @@ var bootstrap = function ($, learun) { param = param || {}; param.StartTime = startTime; param.EndTime = endTime; - $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { 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 aab1bbe16..a73327708 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 @@ -1415,6 +1415,7 @@ + @@ -7288,6 +7289,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/VisitorInfo/VisitorInfoBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/VisitorInfo/VisitorInfoBLL.cs index 272ca7c10..6b47de810 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/VisitorInfo/VisitorInfoBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/VisitorInfo/VisitorInfoBLL.cs @@ -191,11 +191,11 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// 去审 ///
/// - public void Check(string keyValues) + public void Check(string keyValues,string VExamineRemarks) { try { - visitorInfoService.Check(keyValues); + visitorInfoService.Check(keyValues, VExamineRemarks); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/VisitorInfo/VisitorInfoEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/VisitorInfo/VisitorInfoEntity.cs index 69cd24cac..f234c10c7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/VisitorInfo/VisitorInfoEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/VisitorInfo/VisitorInfoEntity.cs @@ -44,6 +44,14 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement ///
[Column("VREMARKS")] public string VRemarks { get; set; } + + /// + /// 审核备注 + /// + [Column("VEXAMINEREMARKS")] + public string VExamineRemarks { get; set; } + + /// /// 申请时间 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/VisitorInfo/VisitorInfoIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/VisitorInfo/VisitorInfoIBLL.cs index 3d79712c4..f594f2457 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/VisitorInfo/VisitorInfoIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/VisitorInfo/VisitorInfoIBLL.cs @@ -60,7 +60,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// 审核 /// /// - void Check(string keyValues); + void Check(string keyValues,string VExamineRemarks); /// /// 生成账号 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/VisitorInfo/VisitorInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/VisitorInfo/VisitorInfoService.cs index d9ddbea68..322f813b3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/VisitorInfo/VisitorInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/VisitorInfo/VisitorInfoService.cs @@ -233,11 +233,11 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// /// 审核 /// - public void Check(string keyValues) + public void Check(string keyValues, string VExamineRemarks) { try { - string sql = $"update VisitorInfo set VState=1 where VID in ({keyValues})"; + string sql = $"update VisitorInfo set VState=1,VExamineRemarks='{VExamineRemarks}' where VID in ('{keyValues}')"; this.BaseRepository("CollegeMIS").ExecuteBySql(sql); } catch (Exception ex)