From 4d9a1d16bc354427e119c7e58916bde0258e1e93 Mon Sep 17 00:00:00 2001
From: zhangli <1109134334@qq.com>
Date: Fri, 18 Feb 2022 14:28:33 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=86=E9=85=8D=E5=AE=BF=E8=88=8D=E3=80=90?=
=?UTF-8?q?=E6=9C=AA=E5=AE=8C=E6=88=90=E3=80=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/AccommodationController.cs | 11 +-
.../Views/Accommodation/FormRoom.cshtml | 26 ++++
.../Views/Accommodation/FormRoom.js | 116 ++++++++++++++++++
.../Views/Accommodation/IndexDistribution.js | 54 ++++++--
.../Learun.Application.Web.csproj | 2 +
5 files changed, 197 insertions(+), 12 deletions(-)
create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.cshtml
create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs
index 64c1ec87e..c191c64f6 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs
@@ -217,7 +217,16 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
{
return View();
}
-
+ ///
+ /// 分配宿舍
+ ///
+ ///
+ [HttpGet]
+ public ActionResult FormRoom()
+ {
+ return View();
+ }
+
#endregion
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.cshtml
new file mode 100644
index 000000000..ebff84bf6
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.cshtml
@@ -0,0 +1,26 @@
+
+@{
+ ViewBag.Title = "FormClass";
+ Layout = "~/Views/Shared/_Form.cshtml";
+}
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js")
+
+
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
new file mode 100644
index 000000000..028955da9
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js
@@ -0,0 +1,116 @@
+/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
+ * Copyright (c) 2013-2018 北京泉江科技有限公司
+ * 创建人:超级管理员
+ * 日 期:2019-04-26 15:02
+ * 描 述:学生宿舍管理
+ */
+var acceptClick;
+var Class = request('Class');
+var keyValue = request('keyValue');
+var arr = [];
+var bootstrap = function ($, learun) {
+ "use strict";
+ var page = {
+ init: function () {
+ $('.lr-form-wrap').lrscroll();
+ page.bind();
+ page.initData();
+ },
+ bind: function () {
+ //$('.Student').lrselect({
+ // value: "stuid",
+ // text: "stuname",
+ // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
+ // param: { code: "StuInfoBasic", strWhere: "ClassNo='" + Class + "'" },
+ // select: function (item) {
+ // if (item) {
+ // console.log(item);
+ // $.each(arr,
+ // function(index, value) {
+ // console.log('arr_index',value);
+ // console.log('arr_index',value);
+ // });
+ // }
+
+ // }
+ //});
+ },
+ initData: function () {
+ if (!!keyValue) {
+ $.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/GetBedListByRoomId?RoomId=' + keyValue, function (data) {
+ var html = '';
+ for (var i = 0; i < data.length; i++) {
+ html += '';
+
+ //$('#' + data[i].ID).lrselectRefresh({
+ // value: "stuid",
+ // text: "stuname",
+ // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
+ // param: { code: "StuInfoBasic", strWhere: "ClassNo='" + Class + "'" },
+ // select: function (item) {
+ // if (item) {
+ // console.log(item);
+ // $.each(arr,
+ // function (index, value) {
+ // console.log('arr_index', value);
+ // console.log('arr_index', value);
+ // });
+ // }
+
+ // }
+ //});
+ $('#' + data[i].ID).lrselectSet(data[i].StudentID);
+
+ arr.push({ ID: data[i].ID, StudentID: data[i].StudentID });
+ }
+ $('#content').html(html);
+ $('.Student').lrselect({
+ value: "stuid",
+ text: "stuname",
+ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
+ param: { code: "StuInfoBasic", strWhere: "ClassNo='" + Class + "'" },
+ select: function (item) {
+ if (item) {
+ console.log(item);
+ $.each(arr,
+ function (index, value) {
+ console.log('arr_index', value);
+ console.log('arr_index', value);
+ });
+ }
+
+ }
+ });
+
+ });
+ }
+ },
+ };
+ // 保存数据
+ acceptClick = function (callBack) {
+ if (!$('body').lrValidform()) {
+ return false;
+ }
+ var postData = {
+ strEntity: JSON.stringify($('body').lrGetFormData())
+ };
+ $.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/SaveDeptClass?type=2&keyValue=' + keyValue, postData, function (res) {
+ // 保存成功后才回调
+ if (!!callBack) {
+ callBack();
+ }
+ });
+ };
+ page.init();
+}
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 86bfb5bce..430a002e6 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
@@ -62,10 +62,10 @@ var bootstrap = function ($, learun) {
//});
$('#NoDistribution').lrRadioCheckbox({
- type: 'checkbox',
+ type: 'checkbox',
code: 'NoDistribution'
});
-
+
$('#Distribution').lrRadioCheckbox({
type: 'checkbox',
code: 'NoDistribution'
@@ -260,13 +260,14 @@ var bootstrap = function ($, learun) {
if (arr.some(x => x != '4')) {
return learun.alert.warning("只能选择宿舍进行分配!");
}
- var arrDept = Dept.split(',');
+ var arrDept = Dept.split(',');
+ if (arrDept.some(function (value, index) {
+ return value.length === 0;
+ })) {
+ return learun.alert.warning("选中记录包含未分配系的数据!");
+ }
+
if (keyValue.indexOf(',') > 0) {
- if (arrDept.some(function(value, index) {
- return value.length == 0;
- })) {
- return learun.alert.warning("选中记录包含未分配专业的数据!");
- }
if (arrDept.some(function (value, index) {
return value != arrDept[0];
})) {
@@ -274,7 +275,7 @@ var bootstrap = function ($, learun) {
}
}
learun.layerForm({
- id: 'formDept',
+ id: 'formClass',
title: '分配专业班级',
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormClass?keyValue=' + keyValue + '&Dept=' + arrDept[0],
width: 400,
@@ -284,6 +285,36 @@ var bootstrap = function ($, learun) {
}
});
});
+
+
+ //分配宿舍
+ $("#lr_Bed").on("click", function () {
+ var keyValue = $('#gridtable').jfGridValue('ID');
+ var BuildType = $('#gridtable').jfGridValue('BuildType');
+ var Name = $('#gridtable').jfGridValue('Name');
+ var Class = $('#gridtable').jfGridValue('Class');
+ var arr = BuildType.split(',');
+ if (arr.some(x => x != '4')) {
+ return learun.alert.warning("只能选择宿舍进行分配!");
+ }
+ if (keyValue.indexOf(',') != -1) {
+ return learun.alert.warning("只能选择一条记录进行分配!");
+ }
+ if (Class.length == 0) {
+ return learun.alert.warning("请先分配班级!");
+ }
+ learun.layerForm({
+ id: 'formRoom',
+ title: '分配宿舍--' + Name,
+ url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormRoom?keyValue=' + keyValue + '&Class=' + Class,
+ width: 600,
+ height: 400,
+ callBack: function (id) {
+ return top[id].acceptClick(refreshGirdData);
+ }
+ });
+ });
+
},
//初始化左侧树
initTree: function () {
@@ -396,7 +427,8 @@ var bootstrap = function ($, learun) {
callback(_data['classname']);
}
});
- } },
+ }
+ },
{
label: "寝室类型", name: "RoomType", width: 100, align: "left",
formatter: function (value, row) {
@@ -559,7 +591,7 @@ var bootstrap = function ($, learun) {
},
search: function (param) {
//console.log(param);
-
+
param = param || {};
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
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 b836e691e..30f9f4240 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
@@ -1300,6 +1300,7 @@
+
@@ -7582,6 +7583,7 @@
+