|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2019-07-17 11:20
- * 描 述:新生录取管理
- */
- var acceptClick, getParam;
-
- var selectedItem = {};
- var keyValue = request('keyValue');
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- $('.lr-form-wrap').lrscroll();
- page.bind();
- //page.initTree();
- //page.initGird();
- },
- bind: function () {
- var loginInfo = learun.clientdata.get(['userinfo']);
- $('#isAllocation').lrRadioCheckbox({
- type: 'radio',
- code: 'YesOrNoBit',
- default: 1,
- });
- $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
- page.search(queryJson);
- }, 220, 400);
- $('#Gender').lrDataItemSelect({ code: 'usersexbit' });
- if (loginInfo.account == "System") {
- $('#ClassNo').lrselect({
- value: "classno",
- text: "classname",
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=jyClassInfo',
- param: { code: "jyClassInfo" },
- });
- } else {
- $('#ClassNo').lrselect({
- value: "classno",
- text: "classname",
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=jyClassInfo',
- param: { code: "jyClassInfo", strWhere: "classdiredctorno='" + loginInfo.account + "'" },
- });
- }
-
- $("#btn_search").on("click", function () {
- var classNo = $("#ClassNo").lrselectGet();
- var gender = $("#Gender").lrselectGet();
- page.initTree(classNo, gender);
- page.initGird();
-
- });
- $("#btn_Apply").on("click", function () {
- if (selectedItem.Name) {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- var stuName = $("#gridtable").jfGridValue('StuName');
- if (stuName) {
- learun.layerConfirm('是否确认将 [' + stuName + '] 分配到宿舍 [' + selectedItem.Name + ']',
- function (res) {
- if (res) {
- learun.postForm(
- top.$.rootUrl + '/EducationalAdministration/StuEnroll/AllocationDormitory',
- { dormitoryNo: selectedItem.ID, stuId: keyValue, dormitoryName: selectedItem.Name },
- function () {
- //page.search(getParam());
- $("[data-value|='" + selectedItem.ID + "']").html(selectedItem.OldName + "(" + stuName + ")");
- page.search(getParam());
- });
- }
- }
- );
-
- } else {
- learun.alert.warning("您没有选中任何项,请选中后再操作!");
- }
-
- } else {
- learun.alert.warning("请选择要分配的床位");
- }
-
- });
-
- },
- //初始化左侧树
- initTree: function (classNo, gender) {
- // 初始化左侧树形数据
- $('#dataTree').lrtree({
- url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetBedTree?ClassNo=' + classNo + '&Gender=' + gender,
- nodeClick: function (item) {
-
-
- selectedItem.ID = item.value;
- if (item.text.indexOf('床') > 0) {
- selectedItem.Name = item.parent.text + item.text;
- selectedItem.OldName = item.text;
- } else {
- selectedItem.Name = "";
- selectedItem.OldName = "";
- }
- }
- });
- },
- // 初始化列表
- initGird: function () {
-
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetPageList',
- headData: [
- { label: "学生报名号", name: "RegistrationNo", width: 100, align: "left" },
- { label: "姓名", name: "StuName", width: 100, align: "left" },
- {
- label: "性别", name: "Gender", width: 100, align: "left", formatter: function (value) {
- return value == "1" ? "男" : "女";
-
- }
- },
- {
- label: "民族", name: "Nationals", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'National',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- { label: "出生年月", name: "Birthday", width: 100, align: "left", formatter: function (val) { return val.substring(0, 10); } },
- {
- 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: "DormitoryName", width: 180, align: "left" },
- { label: "身份证", name: "IDCard", width: 150, align: "left" },
- {
- label: "届别", name: "FreshType", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'timeType',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- {
- label: "户别", name: "ResidenceType", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'HouseholdCategory',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- {
- label: "考生类别", name: "StuType", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'stuType',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- { label: "户口地", name: "ResidenceAddress", width: 100, align: "left" },
- { label: "非京籍报考类", name: "NonNative", width: 100, align: "left" },
- { label: "学籍所在学校", name: "FromSchool", width: 100, align: "left" },
- { label: "家庭住址", name: "HomeAddress", width: 100, align: "left" },
- { label: "第一监护人", name: "FirstGuardian", width: 100, align: "left" },
- { label: "与被监护人关系", name: "FirstRelationship", width: 100, align: "left" },
- { label: "工作单位", name: "FirstUnits", width: 100, align: "left" },
- { label: "联系电话", name: "FirstMobile", width: 100, align: "left" },
- { label: "第二监护人", name: "SecondGuardian", width: 100, align: "left" },
- { label: "与被监护人关系", name: "SecondRelationship", width: 100, align: "left" },
- { label: "工作单位", name: "SecondUnits", width: 100, align: "left" },
- { label: "联系电话", name: "SecondMobile", width: 100, align: "left" },
- { label: "接收通知书地址", name: "Acceptance", width: 100, align: "left" },
- { label: "收件人", name: "Recipient", width: 100, align: "left" },
- { label: "邮政编码", name: "ZipCode", width: 100, align: "left" },
- { label: "既往病史", name: "MedicalHistory", width: 100, align: "left" },
- { label: "加分照顾对象", name: "AdditionalCare", width: 100, align: "left" },
- { label: "录取专业代码", name: "MajorNo", width: 100, align: "left" },
- { label: "录取专业名称", name: "MajorName", width: 100, align: "left" },
- {
- label: "录取方式", name: "Admissions", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'enrollType',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- { label: "准考证号", name: "ExamRegistration", width: 100, align: "left" },
- ],
- mainId: '',
- isPage: true
- });
- page.search(getParam());
-
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
-
- };
- getParam = function () {
- var classNo = $("#ClassNo").lrselectGet();
- var gender = $("#Gender").lrselectGet();
- var isAllocationDormitory = $("#isAllocation").find('input:checked').val();
- var param = {
- ClassNo: classNo,
- Gender: gender,
- IsAllocationDormitory: isAllocationDormitory
- };
- return param;
-
- };
-
- // 保存数据
- acceptClick = function (callBack) {
- if (!$('body').lrValidform()) {
- return false;
- }
- var postData = {
- strEntity: JSON.stringify($('body').lrGetFormData())
- };
- $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/SaveForm?keyValue=' + keyValue, postData, function (res) {
- // 保存成功后才回调
- if (!!callBack) {
- callBack();
- }
- });
- };
- page.init();
- }
|