diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/VehicleInfoController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/VehicleInfoController.cs index 6a806e308..7fd9efd8c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/VehicleInfoController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/VehicleInfoController.cs @@ -26,7 +26,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -35,8 +35,27 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult IndexBF() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult FormBF() + { + return View(); + } + #endregion #region 获取数据 @@ -71,8 +90,9 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var VehicleInfoData = vehicleInfoIBLL.GetVehicleInfoEntity( keyValue ); - var jsonData = new { + var VehicleInfoData = vehicleInfoIBLL.GetVehicleInfoEntity(keyValue); + var jsonData = new + { VehicleInfo = VehicleInfoData, }; return Success(jsonData); @@ -93,6 +113,19 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers vehicleInfoIBLL.DeleteEntity(keyValue); return Success("删除成功!"); } + + /// + /// 报废 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult UpdateStatus(string keyValue,string Status) + { + vehicleInfoIBLL.UpdateStatus(keyValue, Status); + return Success("操作成功!"); + } /// /// 保存实体数据(新增、修改) /// @@ -105,7 +138,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { VehicleInfoEntity entity = strEntity.ToObject(); - vehicleInfoIBLL.SaveEntity(keyValue,entity); + vehicleInfoIBLL.SaveEntity(keyValue, entity); if (string.IsNullOrEmpty(keyValue)) { } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/Form.cshtml index d0c11387b..fb225ad56 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/Form.cshtml @@ -47,10 +47,10 @@
审批文号*
-
+ @*
车辆状态*
-
+
*@
备注
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/FormBF.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/FormBF.cshtml new file mode 100644 index 000000000..b48f39df4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/FormBF.cshtml @@ -0,0 +1,15 @@ +@{ + ViewBag.Title = "车辆信息管理"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
报废时间*
+ +
+
+
报废原因*
+ +
+
+@Html.AppendJsFile("/Areas/CustomFunction/Views/VehicleInfo/FormBF.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/FormBF.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/FormBF.js new file mode 100644 index 000000000..20668d196 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/FormBF.js @@ -0,0 +1,51 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-07-21 15:32 + * 描 述:车辆信息管理 + */ +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 + '/CustomFunction/VehicleInfo/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()) + }; + $.lrSaveForm(top.$.rootUrl + '/CustomFunction/VehicleInfo/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/Index.cshtml index b1d2856da..d5519ae91 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/Index.cshtml @@ -43,10 +43,11 @@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/Index.js index 320e1e29d..54af67708 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/Index.js @@ -56,13 +56,27 @@ var bootstrap = function ($, learun) { if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/CustomFunction/VehicleInfo/DeleteForm', { keyValue: keyValue}, function () { + learun.deleteForm(top.$.rootUrl + '/CustomFunction/VehicleInfo/DeleteForm', { keyValue: keyValue }, function () { refreshGirdData(); }); } }); } }); + // 报废 + $('#lr_bf').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认报废该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/CustomFunction/VehicleInfo/UpdateStatus', { keyValue: keyValue, Status: '2' }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 打印 $('#lr_print').on('click', function () { $('#gridtable').jqprintTable(); @@ -73,51 +87,68 @@ var bootstrap = function ($, learun) { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/CustomFunction/VehicleInfo/GetPageList', headData: [ - { label: "品牌型号", name: "BrandModel", width: 100, align: "left"}, - { label: "车辆类型", name: "Type", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'vehicleType', - callback: function (_data) { - callback(_data.text); - } - }); - }}, - { label: "号牌号码", name: "PlateNum", width: 100, align: "left"}, - { label: "发动机号", name: "EngineNum", width: 100, align: "left"}, - { label: "车辆识别码", name: "IdenCode", width: 100, align: "left"}, - { label: "文本框排气量", name: "AirDisplacement", width: 100, align: "left"}, + { label: "品牌型号", name: "BrandModel", width: 100, align: "left" }, + { + label: "车辆类型", name: "Type", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'vehicleType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "号牌号码", name: "PlateNum", width: 100, align: "left" }, + { label: "发动机号", name: "EngineNum", width: 100, align: "left" }, + { label: "车辆识别码", name: "IdenCode", width: 100, align: "left" }, + { label: "文本框排气量", name: "AirDisplacement", width: 100, align: "left" }, { label: "入户时间", name: "EntryTime", width: 100, align: "left", - formatter: function(value) { - return learun.formatDate(value,'yyyy-MM-dd'); + formatter: function (value) { + return learun.formatDate(value, 'yyyy-MM-dd'); + } + }, + { label: "座位数", name: "SeatNum", width: 100, align: "left" }, + { label: "颜色", name: "Colour", width: 100, align: "left" }, + { + label: "使用部门", name: "UseDeptId", width: 100, align: "left", + 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: "ApprovalNum", width: 100, align: "left" }, + { + label: "车辆状态", name: "Status", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'VehicleStatus', + callback: function (_data) { + callback(_data.text); + } + }); } }, - { label: "座位数", name: "SeatNum", width: 100, align: "left"}, - { label: "颜色", name: "Colour", width: 100, align: "left"}, - { label: "使用部门", name: "UseDeptId", width: 100, align: "left"}, - { label: "审批文号", name: "ApprovalNum", width: 100, align: "left"}, - { label: "车辆状态", name: "Status", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'VehicleStatus', - callback: function (_data) { - callback(_data.text); - } - }); - }}, - { label: "备注", name: "Remark", width: 100, align: "left"}, + { label: "备注", name: "Remark", width: 100, align: "left" }, ], - mainId:'Id', + mainId: 'Id', isPage: true }); page.search(); }, search: function (param) { param = param || {}; - $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + param.Status = '1'; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/IndexBF.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/IndexBF.cshtml new file mode 100644 index 000000000..63b9ffc48 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/IndexBF.cshtml @@ -0,0 +1,56 @@ +@{ + ViewBag.Title = "车辆信息管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
品牌型号
+ +
+
+
车辆类型
+
+
+
+
号牌号码
+ +
+
+
发动机号
+ +
+
+
车辆识别码
+ +
+
+
座位数
+ +
+
+
+
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/CustomFunction/Views/VehicleInfo/IndexBF.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/IndexBF.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/IndexBF.js new file mode 100644 index 000000000..dff943aef --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/VehicleInfo/IndexBF.js @@ -0,0 +1,132 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-07-21 15:32 + * 描 述:车辆信息管理 + */ +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); + }, 320, 400); + $('#Type').lrDataItemSelect({ code: 'vehicleType' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/CustomFunction/VehicleInfo/FormBF?keyValue=' + keyValue, + width: 600, + height: 350, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/CustomFunction/VehicleInfo/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/CustomFunction/VehicleInfo/GetPageList', + headData: [ + { label: "品牌型号", name: "BrandModel", width: 100, align: "left" }, + { + label: "车辆类型", name: "Type", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'vehicleType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "号牌号码", name: "PlateNum", width: 100, align: "left" }, + { label: "发动机号", name: "EngineNum", width: 100, align: "left" }, + { label: "车辆识别码", name: "IdenCode", width: 100, align: "left" }, + { label: "文本框排气量", name: "AirDisplacement", width: 100, align: "left" }, + { + label: "入户时间", name: "EntryTime", width: 100, align: "left", + formatter: function (value) { + return learun.formatDate(value, 'yyyy-MM-dd'); + } + }, + { label: "座位数", name: "SeatNum", width: 100, align: "left" }, + { label: "颜色", name: "Colour", width: 100, align: "left" }, + { + label: "使用部门", name: "UseDeptId", width: 100, align: "left", + 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: "ApprovalNum", width: 100, align: "left" }, + { + label: "车辆状态", name: "Status", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'VehicleStatus', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'Id', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.Status = '2'; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} 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 eaf76fc5e..c42d1ddf4 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 @@ -950,6 +950,8 @@ + + @@ -7295,6 +7297,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/VehicleInfo/VehicleInfoBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/VehicleInfo/VehicleInfoBLL.cs index 63e2f837b..bcc92b9e7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/VehicleInfo/VehicleInfoBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/VehicleInfo/VehicleInfoBLL.cs @@ -93,7 +93,25 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } } } - + + public void UpdateStatus(string keyValue, string Status) + { + try + { + vehicleInfoService.UpdateStatus(keyValue, Status); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 保存实体数据(新增、修改) /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/VehicleInfo/VehicleInfoEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/VehicleInfo/VehicleInfoEntity.cs index c3162e2b9..7bbcc49e6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/VehicleInfo/VehicleInfoEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/VehicleInfo/VehicleInfoEntity.cs @@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction /// 日 期:2021-07-21 15:32 /// 描 述:车辆信息管理 ///
- public class VehicleInfoEntity + public class VehicleInfoEntity { #region 实体成员 /// @@ -128,7 +128,8 @@ namespace Learun.Application.TwoDevelopment.CustomFunction public void Create() { this.Id = Guid.NewGuid().ToString(); - this.CreateTime=DateTime.Now; + this.Status = "1"; + this.CreateTime = DateTime.Now; var userInfo = LoginUserInfo.Get(); this.CreateUserId = userInfo.userId; this.CreateUserName = userInfo.realName; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/VehicleInfo/VehicleInfoIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/VehicleInfo/VehicleInfoIBLL.cs index c0a472f13..310d46b1a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/VehicleInfo/VehicleInfoIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/VehicleInfo/VehicleInfoIBLL.cs @@ -37,6 +37,12 @@ namespace Learun.Application.TwoDevelopment.CustomFunction /// 主键 void DeleteEntity(string keyValue); /// + /// 报废 + /// + /// + /// + void UpdateStatus(string keyValue, string Status); + /// /// 保存实体数据(新增、修改) /// /// 主键 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/VehicleInfo/VehicleInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/VehicleInfo/VehicleInfoService.cs index da2711df9..86780f09c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/VehicleInfo/VehicleInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/VehicleInfo/VehicleInfoService.cs @@ -82,6 +82,12 @@ namespace Learun.Application.TwoDevelopment.CustomFunction dp.Add("SeatNum", "%" + queryParam["SeatNum"].ToString() + "%", DbType.String); strSql.Append(" AND t.SeatNum Like @SeatNum "); } + if (!queryParam["Status"].IsEmpty()) + { + dp.Add("Status", queryParam["Status"].ToString(), DbType.String); + strSql.Append(" AND t.Status= @Status "); + } + // return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); } catch (Exception ex) @@ -148,6 +154,25 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } } + public void UpdateStatus(string keyValue, string Status) + { + try + { + this.BaseRepository("CollegeMIS") + .ExecuteBySql($"update VehicleInfo set [Status]='{Status}' where Id='{keyValue}'"); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } /// /// 保存实体数据(新增、修改) ///