diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Acc_GoodsDemageController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Acc_GoodsDemageController.cs index 732d6edc0..770cd848a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Acc_GoodsDemageController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Acc_GoodsDemageController.cs @@ -3,6 +3,7 @@ using System.Data; using Learun.Application.TwoDevelopment.LogisticsManagement; using System.Web.Mvc; using System.Collections.Generic; +using System; namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers { @@ -102,6 +103,10 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { Acc_GoodsDemageEntity entity = strEntity.ToObject(); + var loginUserInfo = LoginUserInfo.Get(); + entity.F_CreateAccount = loginUserInfo.account; + entity.F_CreateUserId = loginUserInfo.userId; + entity.F_CreateDate = DateTime.Now; acc_GoodsDemageIBLL.SaveEntity(keyValue,entity); return Success("保存成功!"); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Acc_GoodsDemage/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Acc_GoodsDemage/Form.cshtml index 5eecaed4b..c4871677f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Acc_GoodsDemage/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Acc_GoodsDemage/Form.cshtml @@ -3,33 +3,44 @@ Layout = "~/Views/Shared/_Form.cshtml"; }
-
-
宿舍楼
-
+
+
+
宿舍楼
+
+
+
+
单元
+
+
+
+
楼层
+
+
+
+
宿舍*
+
+
+ +
+
专业部*
+
+
+
+
专业*
+
+
+
+
班级*
+
+
-
-
单元
-
+
+
损坏描述*
+
-
-
楼层
-
-
-
-
宿舍
-
-
-
-
物品
- -
-
-
价格
- -
-
-
破坏者
-
+
+
图片上传*
+
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Acc_GoodsDemage/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Acc_GoodsDemage/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Acc_GoodsDemage/Form.js index a511ed37a..ae6ea56dd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Acc_GoodsDemage/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Acc_GoodsDemage/Form.js @@ -8,6 +8,7 @@ var acceptClick; var keyValue = request('keyValue'); var bootstrap = function ($, learun) { "use strict"; + var selectedRow = learun.frameTab.currentIframe().selectedRow; var page = { init: function () { $('.lr-form-wrap').lrscroll(); @@ -49,39 +50,64 @@ var bootstrap = function ($, learun) { } } }); - $('#RId').lrselect({ text: 'name', value: 'id', allowSearch: true - }) - $('#DeangeUserr').lrGirdSelect({ - url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=StuInfoBasic', - selectWord: 'stuno', - value: 'stuno', - text: 'stuname', - headData: - [ - { label: "学号", name: "stuno", width: 100, align: "left" }, - { label: "姓名", name: "stuname", width: 100, align: "left" }, - { - label: "班级", name: "classno", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', - key: value, - keyId: 'classno', - callback: function (_data) { - callback(_data['classname']); - } - }); - } - }, - ], + }); + + $('#DeptNo').lrselect({ + allowSearch: true, + value: "deptno", + text: "deptname", + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', + select: function (item) { + if (item) { + $('#MajorNo').lrselectRefresh({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" } + }); + } else { + $('#MajorNo').lrselectRefresh({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { strWhere: "1=1 AND CheckMark=1" } + }); + } + + } + }); + $('#MajorNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + value: "majorno", + text: "majorname", + param: { strWhere: "1=1 AND CheckMark=1" }, select: function (item) { - $("#DeangeUserr").val(item.stuno); + if (item) { + $('#ClassNo').lrselectRefresh({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1" } + }); + } else { + $('#ClassNo').lrselectRefresh({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "1=1 AND CheckMark=1" } + }); + } } }); + $('#ClassNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "1=1 AND CheckMark=1" }, + value: "classno", + text: "classname" + }); + $('#Files').lrUploader(); }, initData: function () { if (!!keyValue) { @@ -96,6 +122,9 @@ var bootstrap = function ($, learun) { } }); } + if (!!selectedRow) { + $('#form').lrSetFormData(selectedRow); + } } }; // 保存数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Acc_GoodsDemage/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Acc_GoodsDemage/Index.cshtml index 8f206f4f2..d174946cf 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Acc_GoodsDemage/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Acc_GoodsDemage/Index.cshtml @@ -2,21 +2,49 @@ ViewBag.Title = "物品损坏管理"; Layout = "~/Views/Shared/_Index.cshtml"; } -
+
+
+
+
+
+
+
+
+
专业部
+
+
+
+
专业
+
+
+
+
班级
+
+
+
+
学生姓名
+ +
+
+
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Acc_GoodsDemage/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Acc_GoodsDemage/Index.js index ace713e42..fb8928268 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Acc_GoodsDemage/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Acc_GoodsDemage/Index.js @@ -4,27 +4,113 @@ * 日 期:2020-08-11 16:55 * 描 述:物品损坏管理 */ +var selectedRow; var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; + var startTime; + var endTime; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + // 时间搜索框 + $('#datesearch').lrdate({ + dfdata: [ + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + dfvalue: '1', + selectfn: function (begin, end) { + startTime = begin; + endTime = end; + page.search(); + } + }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); + $('#DeptNo').lrselect({ + allowSearch: true, + value: "deptno", + text: "deptname", + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', + select: function (item) { + if (item) { + $('#MajorNo').lrselectRefresh({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" } + }); + } else { + $('#MajorNo').lrselectRefresh({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { strWhere: "1=1 AND CheckMark=1" } + }); + } + + } + }); + $('#MajorNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + value: "majorno", + text: "majorname", + param: { strWhere: "1=1 AND CheckMark=1" }, + select: function (item) { + if (item) { + $('#ClassNo').lrselectRefresh({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1" } + }); + } else { + $('#ClassNo').lrselectRefresh({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "1=1 AND CheckMark=1" } + }); + } + } + }); + $('#ClassNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "1=1 AND CheckMark=1" }, + value: "classno", + text: "classname" + }); + // 新增 $('#lr_add').on('click', function () { + selectedRow = null; learun.layerForm({ id: 'form', title: '新增', url: top.$.rootUrl + '/LogisticsManagement/Acc_GoodsDemage/Form', - width: 600, - height: 400, + width: 800, + height: 600, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } @@ -32,14 +118,15 @@ var bootstrap = function ($, learun) { }); // 编辑 $('#lr_edit').on('click', function () { + selectedRow = null; var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { learun.layerForm({ id: 'form', title: '编辑', url: top.$.rootUrl + '/LogisticsManagement/Acc_GoodsDemage/Form?keyValue=' + keyValue, - width: 600, - height: 400, + width: 800, + height: 600, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } @@ -59,12 +146,70 @@ var bootstrap = function ($, learun) { }); } }); + + // 快速新增 + $('#lr_addQuickly').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + selectedRow = $('#gridtable').jfGridGet('rowdata'); + //console.log(selectedRow); + learun.layerForm({ + id: 'form', + title: '快速新增', + url: top.$.rootUrl + '/LogisticsManagement/Acc_GoodsDemage/Form', + width: 800, + height: 600, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); }, // 初始化列表 initGird: function () { - $('#gridtable').lrAuthorizeJfGrid({ + $('#gridtable').jfGrid({ url: top.$.rootUrl + '/LogisticsManagement/Acc_GoodsDemage/GetPageList', headData: [ + { + label: "专业部", name: "DeptNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + key: value, + keyId: 'deptno', + callback: function (_data) { + callback(_data['deptname']); + } + }); + } + }, + { + label: "专业", name: "MajorNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'majorno', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { + label: "班级", name: "ClassNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: value, + keyId: 'classno', + callback: function (_data) { + callback(_data['classname']); + } + }); + } + }, { label: "宿舍楼", name: "Dormitory", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { @@ -105,7 +250,7 @@ var bootstrap = function ($, learun) { } }, { - label: "宿舍", name: "RId", width: 100, align: "left", + label: "寝室号", name: "RId", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_RoomData', @@ -117,22 +262,21 @@ var bootstrap = function ($, learun) { }); } }, - { label: "物品", name: "Goods", width: 100, align: "left" }, - { label: "价格", name: "Price", width: 100, align: "left" }, { - label: "破坏者", name: "DeangeUserr", width: 100, align: "left", + label: "学生姓名", name: "F_CreateAccount", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic', key: value, keyId: 'stuno', callback: function (_data) { - console.log(_data,123) callback(_data['stuname']); } }); } }, + { label: "损坏描述", name: "DamageDescribe", width: 250, align: "left" }, + { label: "日期", name: "F_CreateDate", width: 100, align: "left" }, ], mainId: 'ID', isPage: true @@ -141,6 +285,8 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + param.StartTime = startTime; + param.EndTime = endTime; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Acc_GoodsDemage/Acc_GoodsDemageEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Acc_GoodsDemage/Acc_GoodsDemageEntity.cs index 8c872d68b..1257cb8a5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Acc_GoodsDemage/Acc_GoodsDemageEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Acc_GoodsDemage/Acc_GoodsDemageEntity.cs @@ -40,10 +40,35 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement [Column("RID")] public string RId { get; set; } /// - /// 内容说明 + /// 系 /// - [Column("GOODS")] - public string Goods { get; set; } + [Column("DEPTNO")] + public string DeptNo { get; set; } + /// + /// 专业 + /// + [Column("MAJORNO")] + public string MajorNo { get; set; } + /// + /// 班级 + /// + [Column("CLASSNO")] + public string ClassNo { get; set; } + /// + /// 损坏说明 + /// + [Column("DAMAGEDESCRIBE")] + public string DamageDescribe { get; set; } + /// + /// 图片上传 + /// + [Column("FILES")] + public string Files { get; set; } + /// + /// 创建人编号 + /// + [Column("F_CREATEACCOUNT")] + public string F_CreateAccount { get; set; } /// /// 创建人 /// @@ -54,16 +79,6 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement /// [Column("F_CREATEDATE")] public DateTime? F_CreateDate { get; set; } - /// - /// 价格 - /// - [Column("PRICE")] - public string Price { get; set; } - /// - /// 破坏者 - /// - [Column("DEANGEUSERR")] - public string DeangeUserr { get; set; } #endregion #region 扩展操作 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Acc_GoodsDemage/Acc_GoodsDemageService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Acc_GoodsDemage/Acc_GoodsDemageService.cs index 6054350d3..9741d3de3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Acc_GoodsDemage/Acc_GoodsDemageService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Acc_GoodsDemage/Acc_GoodsDemageService.cs @@ -29,22 +29,39 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement try { var strSql = new StringBuilder(); - strSql.Append("SELECT "); - strSql.Append(@" - t.ID, - t.Dormitory, - t.Unit, - t.Floor, - t.RId, - t.Goods, - t.Price, - t.DeangeUserr - "); + strSql.Append("SELECT t.* "); strSql.Append(" FROM Acc_GoodsDemage t "); + strSql.Append(" left join StuInfoBasic s on t.F_CreateAccount=s.StuNo "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数 var dp = new DynamicParameters(new { }); + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) + { + dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); + dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); + strSql.Append(" AND ( t.F_CreateDate >= @startTime AND t.F_CreateDate <= @endTime ) "); + } + if (!queryParam["DeptNo"].IsEmpty()) + { + dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); + strSql.Append(" AND t.DeptNo = @DeptNo "); + } + if (!queryParam["MajorNo"].IsEmpty()) + { + dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String); + strSql.Append(" AND t.MajorNo = @MajorNo "); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + strSql.Append(" AND t.ClassNo = @ClassNo "); + } + if (!queryParam["StuName"].IsEmpty()) + { + dp.Add("StuName", "%"+queryParam["StuName"].ToString()+"%", DbType.String); + strSql.Append(" AND s.StuName like @StuName "); + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); } catch (Exception ex)