|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2020-11-27 10:05
- * 描 述:学生请假管理
- */
- 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);
- $('#LeaveType').lrDataItemSelect({ code: 'LeaveType' });
- $('#CheckStatus').lrDataItemSelect({ code: 'LeaveCheck' });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/Form',
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- var status = $('#gridtable').jfGridValue('CheckStatus');
- if (status == "1" || status == "2") {
- learun.alert.warning("该项已审核无法编辑!");
- return false;
- }
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/Form?keyValue=' + keyValue,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- var status = $('#gridtable').jfGridValue('CheckStatus');
- if (status == "1") {
- learun.alert.warning("该项已审核通过无法删除!");
- return false;
- }
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/GetPageList',
- headData: [
- {
- label: "审核状态", name: "CheckStatus", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'LeaveCheck',
- callback: function (_data) {
- callback(_data.text ? _data.text : "申请中");
- }
- });
- }
- },
- { label: "审核备注", name: "CheckRemark", width: 100, align: "left" },
- { label: "审核时间", name: "CheckTime", width: 130, align: "left" },
- {
- label: "审核人", name: "CheckUserNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
- key: value,
- keyId: 'empno',
- callback: function (_data) {
- callback(_data['empname']);
- }
- });
- }
- },
- {
- label: "请假类型", name: "LeaveType", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'LeaveType',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- { label: "开始时间", name: "StartTime", width: 100, align: "left" },
- { label: "结束时间", name: "EndTime", width: 100, align: "left" },
- { label: "请假天数", name: "LeaveDay", width: 100, align: "left" },
- { label: "请假事由", name: "LeaveReason", width: 100, align: "left" },
- { label: "学号", name: "CreateUserNo", width: 100, align: "left" },
- { label: "姓名", name: "CreateUserName", width: 100, align: "left" },
- { label: "申请时间", name: "CreateTime", width: 130, align: "left" },
- {
- 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: "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: "ClassDiredctorNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
- key: value,
- keyId: 'empno',
- callback: function (_data) {
- callback(_data['empname']);
- }
- });
- }
- },
- {
- label: "辅导员", name: "ClassTutorNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
- key: value,
- keyId: 'empno',
- callback: function (_data) {
- callback(_data['empname']);
- }
- });
- }
- },
-
- ],
- mainId: 'Id',
- isPage: true,
- sord: 'CreateTime desc'
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- param.StuNo = learun.clientdata.get(['userinfo']).account;
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- $('#gridtable').jfGridSet('reload');
- };
- page.init();
- }
|