diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js index ee92b9db6..c92f06f29 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js @@ -7,6 +7,7 @@ var acceptClick; var Class = request('Class'); var keyValue = request('keyValue'); +var Sex = request('Sex'); var arr = []; var bootstrap = function ($, learun) { "use strict"; @@ -39,7 +40,13 @@ var bootstrap = function ($, learun) { if (!!keyValue) { $.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/GetBedListByRoomId?RoomId=' + keyValue, function (data) { $('#content').html(''); - + var strWhere = " ClassNo='" + Class + "'"; + if (Sex == '0') { + strWhere += " and GenderNo=0"; + } + else if (Sex == '1') { + strWhere += " and GenderNo=1"; + } for (var i = 0; i < data.length; i++) { var html = ''; html += '
'; @@ -60,7 +67,7 @@ var bootstrap = function ($, learun) { value: "stuid", text: "stuname", url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', - param: { code: "StuInfoBasic", strWhere: "ClassNo='" + Class + "'" }, + param: { code: "StuInfoBasic", strWhere: strWhere }, select: function (item) { // console.log(item); var stuid = ''; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js index ff87bf30a..0837a154c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js @@ -184,8 +184,7 @@ var bootstrap = function ($, learun) { //批量添加宿舍 $("#lr_dormitoryAdd").on("click", function () { var keyvalue1 = $("#gridtable").jfGridValue("ID"); - //console.log(selectedParent.ChildType); - if (selectedParent.BuildType == "1") { + if (selectedParent.ChildType == "2") { var keyValue = selectedParent.ID; learun.layerForm({ id: 'form', @@ -248,7 +247,7 @@ var bootstrap = function ($, learun) { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { if (keyValue.indexOf(',') != -1) { - learun.alert.warning("只能选择一条记录!"); + learun.alert.warning("只能选择一条记录进行编辑!"); return false; } learun.layerForm({ @@ -265,21 +264,7 @@ var bootstrap = function ($, learun) { }); - - //分类管理 - $("#lr_Classify").on("click", function () { - learun.layerForm({ - id: 'indexClassify', - title: '分类管理', - url: top.$.rootUrl + '/LogisticsManagement/Accommodation/IndexClassify', - width: 1200, - height: 780, - //btn:null, - callBack: function (id) { - return top[id].acceptClick(refreshGirdData); - } - }); - }); + }, //初始化左侧树 initTree: function () { @@ -382,25 +367,14 @@ var bootstrap = function ($, learun) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', key: value, - keyId: 'majorno', + keyId: 'id', callback: function (_data) { callback(_data['majorname']); } }); } }, - { - label: "班级", name: "Class", 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: "Class", width: 100, align: "left" }, { label: "寝室类型", name: "RoomType", width: 100, align: "left", formatter: function (value, row) { @@ -444,7 +418,7 @@ var bootstrap = function ($, learun) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic', key: value, - keyId: 'stuno', + keyId: 'stuid', callback: function (_data) { callback(_data['stuname']); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js index c926eb781..3ddb84289 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js @@ -290,6 +290,7 @@ var bootstrap = function ($, learun) { //分配宿舍 $("#lr_Bed").on("click", function () { var keyValue = $('#gridtable').jfGridValue('ID'); + var Sex = $('#gridtable').jfGridValue('Sex'); var BuildType = $('#gridtable').jfGridValue('BuildType'); var Name = $('#gridtable').jfGridValue('Name'); var Class = $('#gridtable').jfGridValue('Class'); @@ -306,7 +307,7 @@ var bootstrap = function ($, learun) { learun.layerForm({ id: 'formRoom', title: '分配宿舍--' + Name, - url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormRoom?keyValue=' + keyValue + '&Class=' + Class, + url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormRoom?keyValue=' + keyValue + '&Class=' + Class + '&Sex=' + Sex, width: 600, height: 400, callBack: function (id) { @@ -338,261 +339,273 @@ var bootstrap = function ($, learun) { if (item.text.indexOf("室") > -1) { selectedParent.ChildType = "5"; } - page.initGird(); - page.search({ ParentID: item.value }); + var param = {}; + + if (item.title == '1') + param.ApartmentId = item.value; + else if (item.title == '2') + param.UnitId = item.value; + else if (item.title == '3') + param.FloorId = item.value; + + //page.initGird(); + //page.search({ ParentID: item.value }); + page.search(param); } }); }, // 初始化列表 initGird: function () { - $("#gridtable").empty(); - $("#gridtable")[0].dfop = undefined; - if (selectedParent.BuildType == undefined || selectedParent.BuildType === "3") { - //宿舍数据 - $('#gridtable').jfGrid({ - url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', - headData: [ - { label: "名称", name: "Name", width: 100, align: "left" }, - { - label: "宿舍楼", name: "ApartmentName", width: 100, align: "left" - }, - { - label: "单元", name: "UnitName", width: 100, align: "left" - }, - { - label: "楼层", name: "FloorName", width: 100, align: "left" - }, - //{ - // label: "学生", name: "StudentID", 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: 'stuid', - // callback: function (_data) { - // callback(_data['stuname']); - // } - // }); - // } - //}, - { label: "位置", name: "Address", width: 100, align: "left" }, - { - label: "校区", name: "Campus", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', - key: value, - keyId: 'f_companyid', - callback: function (_data) { - callback(_data['f_fullname']); - } - }); - } - }, - { - label: "系", name: "Dept", 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: "Major", 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: "Class", 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: "RoomType", width: 100, align: "left", - formatter: function (value, row) { - if (value) { - return value + '人寝'; - } else { - return ''; + //宿舍数据 + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', + headData: [ + { label: "名称", name: "Name", width: 100, align: "left" }, + { + label: "宿舍楼", name: "ApartmentName", width: 100, align: "left" + }, + { + label: "单元", name: "UnitName", width: 100, align: "left" + }, + { + label: "楼层", name: "FloorName", width: 100, align: "left" + }, + //{ + // label: "学生", name: "StudentID", 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: 'stuid', + // callback: function (_data) { + // callback(_data['stuname']); + // } + // }); + // } + //}, + { label: "位置", name: "Address", width: 100, align: "left" }, + { + label: "校区", name: "Campus", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', + key: value, + keyId: 'f_companyid', + callback: function (_data) { + callback(_data['f_fullname']); } - } - }, - { label: "入住人数", name: "CheckInStu", width: 100, align: "left" }, - { - label: "性别", name: "Sex", width: 100, align: "left", - formatter: function (callback, value, row, op, $cell) { - if (value == '0') - return '女'; - else if (value == '1') - return '男'; - else - return ''; - } - }, - { label: "负责人", name: "Functionary", width: 100, align: "left" }, - { label: "负责人电话", name: "Phone", width: 100, align: "left" }, - { label: "备注", name: "Remark", width: 100, align: "left" }, - ], - mainId: 'ID', - isPage: true, - isMultiselect: true, - sidx: 'CheckInStu asc,ApartmentId asc,UnitId asc ,FloorId asc ', - //sord: 'ASC', - isSubGrid: true, // 是否有子表 - subGridExpanded: function (subContentId, rowItem) { - $('#' + subContentId).jfGrid({ - url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetBedListByRoomId?RoomId=' + rowItem.ID, - headData: [ - { label: "名称", name: "Name", width: 100, align: "left" }, - { - label: "学生", name: "StudentID", 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: 'stuid', - callback: function (_data) { - callback(_data['stuname']); - } - }); - } - }, - ], - mainId: 'ID', - isPage: false, - //sidx: 'DNo', - //sord: 'ASC', - }); - //var param; - //param = param || {}; - //param.ParentID = rowItem.Id; - $('#' + subContentId).jfGridSet('reload'); + }); + } }, - subGridHeight: 250, - }); - } else { - //lrAuthorizeJfGridLei - $('#gridtable').jfGrid({ - url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', - headData: [ - { label: "名称", name: "Name", width: 100, align: "left" }, - { - label: "宿舍楼", name: "ApartmentName", width: 100, align: "left" - }, - { - label: "单元", name: "UnitName", width: 100, align: "left" - }, - { - label: "楼层", name: "FloorName", width: 100, align: "left" - }, - //{ - // label: "学生", name: "StudentID", 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: 'stuid', - // callback: function (_data) { - // callback(_data['stuname']); - // } - // }); - // } - //}, - { label: "位置", name: "Address", width: 100, align: "left" }, - { - label: "校区", name: "Campus", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', - key: value, - keyId: 'f_companyid', - callback: function (_data) { - callback(_data['f_fullname']); - } - }); + { + label: "系", name: "Dept", 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: "Major", 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: "Class", 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: "RoomType", width: 100, align: "left", + formatter: function (value, row) { + if (value) { + return value + '人寝'; + } else { + return ''; } - }, - //{ - // label: "系", name: "Dept", 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: "Major", 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: 'id', - // callback: function (_data) { - // callback(_data['majorname']); - // } - // }); - // } - //}, - //{ label: "班级", name: "Class", width: 100, align: "left" }, - //{ - // label: "性别", name: "Sex", width: 100, align: "left", - // formatterAsync: function (callback, value, row, op, $cell) { - // learun.clientdata.getAsync('dataItem', { - // key: value, - // code: 'usersex', - // callback: function (_data) { - // callback(_data.text); - // } - // }); - // } - //}, - { label: "负责人", name: "Functionary", width: 100, align: "left" }, - { label: "负责人电话", name: "Phone", width: 100, align: "left" }, - { label: "备注", name: "Remark", width: 100, align: "left" }, - ], - mainId: 'ID', - isPage: true, - //isMultiselect: true - //sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', - //sord: 'ASC', - }); - } + } + }, + { label: "入住人数", name: "CheckInStu", width: 100, align: "left" }, + { + label: "性别", name: "Sex", width: 100, align: "left", + formatter: function (value, row) { + if (value == '0') + return '女'; + else if (value == '1') + return '男'; + else + return ''; + } + }, + { label: "负责人", name: "Functionary", width: 100, align: "left" }, + { label: "负责人电话", name: "Phone", width: 100, align: "left" }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'ID', + isPage: true, + isMultiselect: true, + sidx: 'CheckInStu asc,ApartmentId asc,UnitId asc ,FloorId asc ', + //sord: 'ASC', + isSubGrid: true, // 是否有子表 + subGridExpanded: function (subContentId, rowItem) { + $('#' + subContentId).jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetBedListByRoomId?RoomId=' + rowItem.ID, + headData: [ + { label: "名称", name: "Name", width: 100, align: "left" }, + { + label: "学生", name: "StudentID", 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: 'stuid', + callback: function (_data) { + callback(_data['stuname']); + } + }); + } + }, + ], + mainId: 'ID', + isPage: false, + //sidx: 'DNo', + //sord: 'ASC', + }); + //var param; + //param = param || {}; + //param.ParentID = rowItem.Id; + $('#' + subContentId).jfGridSet('reload'); + }, + subGridHeight: 250, + }); + + + //$("#gridtable").empty(); + //$("#gridtable")[0].dfop = undefined; + //if (selectedParent.BuildType == undefined || selectedParent.BuildType === "3") { + + //} else { + // //lrAuthorizeJfGridLei + // $('#gridtable').jfGrid({ + // url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', + // headData: [ + // { label: "名称", name: "Name", width: 100, align: "left" }, + // { + // label: "宿舍楼", name: "ApartmentName", width: 100, align: "left" + // }, + // { + // label: "单元", name: "UnitName", width: 100, align: "left" + // }, + // { + // label: "楼层", name: "FloorName", width: 100, align: "left" + // }, + // //{ + // // label: "学生", name: "StudentID", 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: 'stuid', + // // callback: function (_data) { + // // callback(_data['stuname']); + // // } + // // }); + // // } + // //}, + // { label: "位置", name: "Address", width: 100, align: "left" }, + // { + // label: "校区", name: "Campus", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', + // key: value, + // keyId: 'f_companyid', + // callback: function (_data) { + // callback(_data['f_fullname']); + // } + // }); + // } + // }, + // //{ + // // label: "系", name: "Dept", 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: "Major", 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: 'id', + // // callback: function (_data) { + // // callback(_data['majorname']); + // // } + // // }); + // // } + // //}, + // //{ label: "班级", name: "Class", width: 100, align: "left" }, + // //{ + // // label: "性别", name: "Sex", width: 100, align: "left", + // // formatterAsync: function (callback, value, row, op, $cell) { + // // learun.clientdata.getAsync('dataItem', { + // // key: value, + // // code: 'usersex', + // // callback: function (_data) { + // // callback(_data.text); + // // } + // // }); + // // } + // //}, + // { label: "负责人", name: "Functionary", width: 100, align: "left" }, + // { label: "负责人电话", name: "Phone", width: 100, align: "left" }, + // { label: "备注", name: "Remark", width: 100, align: "left" }, + // ], + // mainId: 'ID', + // isPage: true, + // //isMultiselect: true + // //sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', + // //sord: 'ASC', + // }); + //} + - //page.search(); }, search: function (param) { - //console.log(param); - param = param || {}; + param.SqlParameter = " AND t.BuildType ='4' "; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs index cc25a058c..5aebff156 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs @@ -68,10 +68,10 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName dp.Add("ParentID", queryParam["ParentID"].ToString(), DbType.String); strSql.Append(" AND t.ParentID =@ParentID "); } - else - { - strSql.Append(" AND t.BuildType ='4' "); - } + //else + //{ + // strSql.Append(" AND t.BuildType ='4' "); + //} if (!queryParam["ApartmentId"].IsEmpty()) { @@ -170,6 +170,12 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName strSql.Append(" AND t.CheckInStu>0 "); } } + + if (!queryParam["SqlParameter"].IsEmpty()) + { + strSql.Append(queryParam["SqlParameter"].ToString()); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination).OrderBy(a => a.Name).ThenBy(a => a.Name).ToList(); } catch (Exception ex)