|
- var refreshGirdData;
- var StuId;
- 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);
- $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
- $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' });
- $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- $("#lr_photo").on('click', function () {
- StuId = $("#gridtable").jfGridValue('StuId');
- if (learun.checkrow(StuId)) {
- takeImg();
- }
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/Form',
- width: 800,
- height: 600,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- if (learun.checkrow(keyValue)) {
- if (keyValue.indexOf(',') != -1) {
- learun.alert.warning("只能选择一条记录进行编辑!");
- return;
- }
- var CheckMark = $('#gridtable').jfGridValue('CheckMark');
- if (CheckMark === "1") {
- learun.alert.warning("当前项目已审核不能编辑!");
- return;
- }
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/Form?keyValue=' + keyValue,
- width: 800,
- height: 600,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- if (learun.checkrow(keyValue)) {
- var CheckMark = $('#gridtable').jfGridValue('CheckMark');
- if (CheckMark.indexOf('1') != -1) {
- learun.alert.warning("选中记录中包含已审核项目,已审核不能删除!");
- return;
- }
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- //查看
- $('#lr_view').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- if (learun.checkrow(keyValue)) {
- if (keyValue.indexOf(',') != -1) {
- learun.alert.warning("只能选择一条记录进行查看!");
- return;
- }
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/FormView?keyValue=' + keyValue,
- width: 1162,
- height: 600,
- btn: null
- });
- }
- });
- // 打印
- $('#lr_print').on('click', function () {
- $('#gridtable').jqprintTable();
- });
- //审核
- $('#check').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- if (learun.checkrow(keyValue)) {
- var CheckMark = $('#gridtable').jfGridValue('CheckMark');
- if (CheckMark.indexOf('1') != -1) {
- learun.alert.warning("选中记录中包含已审核项目!");
- return;
- }
- learun.layerConfirm('是否确认审核该项?', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/Check', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- //去审
- $('#uncheck').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- if (learun.checkrow(keyValue)) {
- var CheckMark = $('#gridtable').jfGridValue('CheckMark');
- var CheckMarkArr = CheckMark.split(',');
- if ($.inArray('0', CheckMarkArr) != -1 || $.inArray('', CheckMarkArr) != -1) {
- learun.alert.warning("选中记录中包含未审核项目!");
- return;
- }
- learun.layerConfirm('是否确认取消审核该项?', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/UnCheck', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- //审核全部
- $('#checkall').on('click', function () {
- learun.layerConfirm('是否确认全部审核?', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/CheckAll', {}, function () {
- refreshGirdData();
- });
- }
- });
- });
- //生成帐号
- $('#lr_generate').on('click', function () {
- learun.layerConfirm('是否确认生成帐号?', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/Generate', {}, function () {
- refreshGirdData();
- });
- }
- });
- });
-
- $('#lr_update').on('click', function () {
- learun.layerConfirm('是否确认更新帐号?', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/UpdateAccount', {}, function () {
- refreshGirdData();
- })
- }
- })
- })
-
- //查看异动
- $("#lr_searchChange").on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- if (learun.checkrow(keyValue)) {
- if (keyValue.indexOf(',') != -1) {
- learun.alert.warning("只能选择一条记录!");
- return;
- }
- learun.layerForm({
- id: 'form',
- title: '异动记录',
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic_ChangeLog/Index?keyValue=' + keyValue,
- width: 800,
- height: 600,
- btn: null
- });
- }
-
- })
- //同步照片
- $('#lr_synPhoto').on('click', function () {
- learun.loading(true, '正在同步,请稍后')
- learun.httpAsync('get', top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/SynPhoto', {}, function (res) {
- learun.loading(false)
- })
-
- })
-
- //打印简历表
- $('#lr_printInfo').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- if (learun.checkrow(keyValue)) {
- if (keyValue.indexOf(',') != -1) {
- learun.alert.warning("只能选择一条记录进行查看!");
- return;
- }
- learun.layerForm({
- id: 'print',
- title: '学生简历表',
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/Print?keyValue=' + keyValue,
- width: 1100,
- height: 800,
- btn: null
- });
- }
- });
- // 同步系部
- $('#lr_syn').on('click', function () {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/SyncDept', function () {
- refreshGirdData();
- });
- });
- // 同步专业
- $('#lr_synmajor').on('click', function () {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/SyncMajor', function () {
- refreshGirdData();
- });
- });
-
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetPageList',
- headData: [
- { label: "学号", name: "StuNo", width: 100, align: "left" },
- { label: "学籍号", name: "StuCode", width: 100, align: "left" },
- { label: "姓名", name: "StuName", width: 100, align: "left" },
- {
- label: "性别", name: "GenderNo", width: 80, align: "left",
- formatter: function (cellvalue) {
- return cellvalue == true ? "男" : "女";
- }
- },
- { label: "出生日期", name: "Birthday", width: 100, align: "left" },
- { label: "身份证号", name: "IdentityCardNo", width: 100, align: "left" },
- {
- label: "民族", name: "NationalityNo", 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: "PartyFaceNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'BCdPartyFace',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- {
- 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: "Grade", width: 100, align: "left" },
- {
- label: "学制", name: "EduSystem", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'EduSystem',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- {
- label: "身体状态", name: "HealthStatus", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'QRCodeHealthStatus',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- {
- label: "学习形式", name: "StudyModality", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'StudyModality',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- { label: "报到日期", name: "RegisterDate", width: 100, align: "left" },
- { label: "入学年月", name: "EntranceDate", width: 100, align: "left" },
- { label: "余额", name: "Balance", width: 100, align: "left" },
- { label: "通信地址", name: "MailAddress", width: 100, align: "left" },
- { label: "联系电话", name: "mobile", width: 100, align: "left" },
- { label: "户口所在地", name: "FatherUnit", width: 100, align: "left" },
- { label: "档案所在地", name: "MatherUnit", width: 100, align: "left" },
- {
- label: "异动状态", name: "AbmormityMoveMark", width: 80, align: "center",
- formatter: function (cellvalue) {
- return cellvalue == "1" ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
- }
- },
- {
- label: "审核状态", name: "CheckMark", width: 80, align: "center",
- formatter: function (cellvalue) {
- return cellvalue == "1" ? "<span class=\"label label-success\">已审核</span>" : "<span class=\"label label-danger\">未审核</span>";
- }
- },
- {
- label: '开户银行', name: 'DepositBank', width: 100, align: "center",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'DepositBank',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- { label: '银行卡账号', name: 'BankCard', width: 150, align: "center" },
- { label: '开户银行位置', name: 'BankLocation', width: 200, align: "center" },
- ],
- mainId: 'StuId',
- isPage: true,
- isMultiselect: true,
- //onSelectRow: function (rowdata) {
- // if (rowdata.CheckMark == "1") {
- // $("#check").hide();
- // $("#uncheck").show();
- // $("#lr_edit").hide();
- // $("#lr_delete").hide();
- // } else {
- // $("#uncheck").hide();
- // $("#check").show();
- // $("#lr_edit").show();
- // $("#lr_delete").show();
- // }
- //}
-
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|