|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2019-05-24 15:40
- * 描 述:学生请假记录
- */
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- "use strict";
- var startTime;
- var endTime;
- var page = {
- init: function () {
- page.initGird();
- page.bind();
- },
- bind: function () {
- page.search();
- // 时间搜索框
- $('#datesearch').lrdate({
- dfdata: [
- { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
- { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
- { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
- { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }
- ],
- // 月
- mShow: false,
- premShow: false,
- // 季度
- jShow: false,
- prejShow: false,
- // 年
- ysShow: false,
- yxShow: false,
- preyShow: false,
- yShow: false,
- // 默认
- dfvalue: '1',
- selectfn: function (begin, end) {
- startTime = begin;
- endTime = end;
- page.search();
- }
- });
- $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
- page.search(queryJson);
- }, 220, 400);
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/StuAttendanceLeave/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)) {
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/StuAttendanceLeave/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)) {
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuAttendanceLeave/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- //审核
- $("#lr_check").on('click', function () {
- var keyValue = $("#gridtable").jfGridValue('ID');
- if (learun.checkrow(keyValue)) {
- var check = $("#gridtable").jfGridValue('IsCheck');
- if (check == "1") {
- learun.alert.warning("该项已审核同意!");
- return false;
- } else {
- learun.layerForm({
- id: 'checkform',
- title: '审核',
- url: top.$.rootUrl + '/EducationalAdministration/StuAttendanceLeave/CheckForm?keyValue=' + keyValue,
- width: 1200,
- height: 800,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
-
- }
- }
-
- })
- // 打印
- $('#lr_print').on('click', function () {
- $('#gridtable').jqprintTable();
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/StuAttendanceLeave/GetPageList',
- headData: [
- { label: "申请时间", name: "UpdateDate", width: 100, align: "left" },
- {
- label: "审核状态", name: "IsCheck", 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: "TecRemark", width: 100, align: "left" },
- {
- 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: "AcademicYearNo", width: 100, align: "left" },
- { label: "学期", name: "Semester", width: 100, align: "left" },
- { label: "学号", name: "StuNo", width: 100, align: "left" },
- { label: "姓名", name: "StuName", width: 100, align: "left" },
- { label: "年级", name: "Grade", width: 100, align: "left" },
- { label: "系所码", name: "DeptNo", width: 100, align: "left" },
- { label: "系名", name: "DeptName", width: 100, align: "left" },
- { label: "专业码", name: "MajorNo", width: 100, align: "left" },
- { label: "专业名", name: "MajorName", width: 100, align: "left" },
- { label: "所在行政班号 ", name: "ClassNo", width: 100, align: "left" },
- { label: "班级名称", name: "ClassName", width: 100, align: "left" },
- { label: "课程号", name: "LessonNo", width: 100, align: "left" },
- { label: "课程名称", name: "LessonName", width: 100, align: "left" },
- { label: "课程类别码", name: "LessonSortNo", width: 100, align: "left" },
- { label: "课程类别", name: "LessonSortName", width: 100, align: "left" },
- { label: "原上课日期", name: "LessonDate", width: 100, align: "left" },
- { label: "上课时间", name: "LessonTime", width: 100, align: "left" },
- { label: "教师号", name: "EmpNo", width: 100, align: "left" },
- { label: "备注", name: "Remark", width: 100, align: "left" },
- ],
- mainId: 'ID',
- isPage: true,
- sord: 'UpdateDate desc'
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- param.StartTime = startTime;
- param.EndTime = endTime;
- param.ClassManagerNo = learun.clientdata.get(['userinfo']).account;
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|