/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 * 创建人:超级管理员 * 日 期:2021-12-16 10:14 * 描 述:长阳迎新 */ 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); }, 220, 400); $('#Sex').lrDataItemSelect({ code: 'usersex' }); //$('#MajorOne').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'id', text: 'majorname' }); //$('#MajorTwo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'id', text: 'majorname' }); //$('#MajorThree').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'id', text: 'majorname' }); $('#MajorNo').lrselect({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', value: 'majorno', text: 'majorname', maxHeight: 200, select: function (item) { var classNo = $("#MajorNo").lrselectGet(); if (classNo != null && classNo != "" && classNo != undefined) { $('#ClassNo').lrselectRefresh({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: " 1=1 and majorno in (" + classNo + ")" }, value: "classno", text: "classname", maxHeight: 200 }); } else { $('#ClassNo').lrselectRefresh({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: " 1=1 and majorno ='' " }, value: "classno", text: "classname", maxHeight: 200 }); } } }) $("#ClassNo").lrselect(); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); //分班--选择班级 $('#lr_divide').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); //审核分班状态 var ClassStatus = $('#gridtable').jfGridValue('ClassStatus'); if (ClassStatus.indexOf('1') != -1) { learun.alert.warning("选中记录包含审核通过的数据!"); return; } var MajorNos = $('#gridtable').jfGridValue('MajorNo'); var arrayList = MajorNos.split(','); var res = true; for (var i = 0; i < arrayList.length; i++) { if (arrayList[0] == arrayList[i]) { MajorNos = arrayList[0]; res = true; } else { res = false; } } if (res) { learun.layerForm({ id: 'classform', title: '选择班级', url: top.$.rootUrl + '/EducationalAdministration/StuVolunteer/ClassForm?keyValue=' + keyValue + '&MajorNo=' + MajorNos, width: 400, height: 300, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); } else { learun.alert.warning("请选择相同专业学生进行分班!"); return; } }); }, // 初始化列表 initGird: function () { $('#gridtable').jfGrid({ url: top.$.rootUrl + '/EducationalAdministration/StuVolunteer/GetPageList', headData: [ { label: "学生姓名", name: "StuName", width: 100, align: "left" }, { label: "性别", name: "Sex", width: 80, 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: "ExamNo", width: 150, align: "left" }, { label: "中考总分", name: "StuScore", width: 100, align: "left" }, { label: "身份证号", name: "CardNo", width: 150, align: "left" }, //{ // label: "第一意向", name: "MajorOne", 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: "MajorTwo", 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: "MajorThree", 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: "MajorNo", width: 150, 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: "MajorStatus", width: 100, align: "left", formatter: function (cellvalue) { return cellvalue == 1 ? "已审核" : "未审核"; } }, { label: "班级", name: "ClassNo", width: 150, 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: "ClassStatus", width: 100, align: "left", formatter: function (cellvalue) { return cellvalue == 1 ? "审核通过" : cellvalue == 0 ? "待审核" : ""; } }, { label: "学号", name: "StuNo", width: 150, align: "left" }, { label: "备注", name: "Demo", width: 100, align: "left" }, ], mainId: 'ID', isPage: true, rows: 100, isMultiselect: true }); page.search(); }, search: function (param) { param = param || {}; param.SqlParameter = " and IsEnroll=1 and EnrollStatus=1 and MajorStatus=1"; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { $('#gridtable').jfGridSet('reload'); }; page.init(); }