|
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- var startTime;
- var endTime;
- var page = {
- init: function () {
- page.bind();
- },
- loadData: function (param) {
- $.lrSetFormWithParam(top.$.rootUrl + '/PersonnelManagement/TimeTable/GetData', param,
- function (data) {
- console.log(data);
- // 数据处理
- var html = '';
- var weekLists = data.weekList;
- for (var i = 1; i < 11; i++) {
- (function (arg) {
- var args = arg - 1;
- var datas = flogs(arg, weekLists, 'time');
- html += ' <tr><td>' + arg + '节</td>';
- if (datas) {
- var lists = datas.list;
- html += tdHandles(lists);
- } else {
- html += tdHandle(arg);
- }
- html += '</tr>';
- })(i); //调用时参数
- }
- $('.personT').text(data.schoolName);
- $('.perSemester').html('老师名称:' + data.teacherName+ '<span>' + data.semester +'</span>');
- $('.perFestivalsBox table').html(html);
- $(".leave").on('click', function () {
- var $this = $(this);
- var lessonNo = $this.attr("lessonno");
- var lessonTime = $this.attr("lessonTime");
- var lessonDate = $this.attr("lessonDate");
- var academicyear = $this.attr("academicyear");
- var semester = $this.attr("semester");
- var empNo = $this.attr("empNo");
- var classRoomNo = $this.attr("classRoomNo");
- var lessonSortNo = $this.attr("lessonSortNo");
- var teachClassNo = $this.attr("teachClassNo");
-
-
-
- learun.layerForm({
- id: 'form',
- title: '请假申请',
- url: top.$.rootUrl + '/PersonnelManagement/TimeTable/Leave?lessonNo=' + lessonNo + '&lessonTime=' + lessonTime + '&lessonDate=' + lessonDate + '&empNo=' + empNo + '&academicyear=' + academicyear + '&semester=' + semester + '&classRoomNo=' + classRoomNo + '&lessonSortNo=' + lessonSortNo + '&teachClassNo=' + teachClassNo,
- width: 600,
- height: 600,
- callBack: function (id) {
- return top[id].acceptClick(change($this));
- }.bind(this)
- });
-
- });
-
- function flogs(num, data, obj) {
- var flog = false;
- $.each(data,
- function (i, n) {
- if (n[obj] == num) {
- flog = n;
- return;
- }
- })
- return flog;
- }
-
- //某节课空
- function tdHandle() {
- var html = '';
- for (var j = 0; j < 7; j++) {
- html += '<td><div></div><div></div><div></div></td>';
- }
- return html;
- }
-
- //某节课不空
- function tdHandles(lists) {
- var html = '';
- for (var k = 1; k < 8; k++) {
- (function (arg) {
- var args = arg - 1;
- var datas = flogs(arg, lists, 'day');
- if (datas) {
- html += '<td class="active"><div>课程:' +
- datas.curriculum +
- '</div>' +
- //'<div>教师:' +
- //datas.teacher +
- //'</div>' +
- '<div>班级:' +
- datas.className +
- '</div>' +
- '<div>教室:' +
- datas.classRoom;
- var loginInfo = learun.clientdata.get(['userinfo']);
- if (loginInfo.Description == "学生") {
- if (datas.leaveType == 1) {
- if (datas.checkType == 1) {
- html += '</div><span>请假通过</span></td>';
- } else if (datas.checkType == 2) {
- html += '</div><span>请假未通过</span></td>';
- } else {
- html += '</div><span>请假申请中</span></td>';
- }
-
- } else {
- html += '</div><span class="leave" lessonNo="' + datas.lessonNo + '" lessonTime="' + datas.lessonTime + '" lessonDate="' + datas.lessonDate + '" lessonName="' + datas.curriculum + '" empNo="' + datas.empno + '" academicyear="' + datas.academicyear + '" semester="' + datas.semester + '" lessonSortNo="' + datas.lessonSortNo + '" classRoomNo="' + datas.classRoomNo + '" teachClassNo="' + datas.teachClassNo + '">请假</span></td>';
- }
- }
-
- html += "</td>";
- } else {
- html += '<td><div></div><div></div><div></div></td>';
- }
- })(k);
- }
- return html;
- }
- });
- },
- bind: function () {
- $('#datesearch').lrdate({
- dfdata: [
- {
- name: '上周',
- begin: function () { return learun.getTime(7); },
- end: function () {
- return learun.getTime(1);
- }
- },
- {
- name: '本周',
- begin: function () { return learun.getTime(0); },
- end: function () {
- return learun.getTime(-6);
- }
- },
- {
- name: '下周',
- begin: function () { return learun.getTime(-7); },
- end: function () {
- return learun.getTime(-13);
- }
- }],
- // 月
- mShow: false,
- premShow: false,
- // 季度
- jShow: false,
- prejShow: false,
- // 年
- ysShow: false,
- yxShow: false,
- preyShow: false,
- yShow: false,
- // 默认
- dfvalue: 'currentWeek',
- selectfn: function (begin, end) {
- startTime = begin;
- endTime = end;
- page.search();
- }
- });
- $('#perBtn').on('click',
- function () {
- AddPrintContent();
- });
- var LODOP, P_ID = "", TaskID1, TaskID2, t, waiting = false, c = 0, loop = 0; //声明为全局变量
-
- function AddPrintContent() {
- var myHtml = myHtml = $('.personalBox').html();
- var strBodyStyle = "<style>" + document.getElementById("style1").innerHTML + "</style>";
- var strFormHtml = strBodyStyle + "<body>" + myHtml + "</body>";
-
- LODOP = getLodop();
- LODOP.PRINT_INIT("个人授课表");
- LODOP.SET_PRINT_PAGESIZE(2, 0, 0, "A4");
-
- LODOP.SET_PRINT_MODE("PRINT_DUPLEX", 2);
- LODOP.SET_PRINT_MODE("PRINT_DEFAULTSOURCE", 7);
-
- LODOP.ADD_PRINT_HTM(10, 10, '284mm', '185mm', strFormHtml);
- //打印预览
- LODOP.SET_SHOW_MODE("LANDSCAPE_DEFROTATED", 1); //横向时的正向显示
- var TaskID1 = LODOP.PREVIEW();
- // 直接打印
- // var TaskID1=LODOP.PRINT();
-
- }
- },
- search: function (param) {
- param = param || {};
- param.StartTime = startTime;
- param.EndTime = endTime;
- page.loadData(param);
- }
- };
- page.init();
- change = function (obj) {
- obj.off("click");
-
- };
- };
|