|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2024-03-25 17:45
- * 描 述:班级人数日报表
- */
- var acceptClick;
- var keyValue = request('keyValue');
- var type = request('type');//copy代表复制,checkedit代表专业部编辑
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- $('.lr-form-wrap').lrscroll();
- page.bind();
- page.initData();
- if (type == "checkedit") {
- //日期、专业部、年级、班级无法编辑
- $("#Date").attr("readonly", "readonly");
- $("#DeptNo").attr("readonly", "readonly");
- $("#Grade").attr("readonly", "readonly");
- $("#Class").attr("readonly", "readonly");
- }
- },
- bind: function () {
- $('#Date').val(getnow());
- if (type == "checkedit") {
- $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
- $('#Grade').lrselect({
- url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear',
- value: 'value',
- text: 'text'
- });
- } else {
- $('#DeptNo').lrselect({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
- value: "deptno",
- text: "deptname",
- param: { strWhere: "1=1" },
- select: function (item) {
- var Grades = $("#Grade").lrselectGet();
- if (Grades != null && Grades != "" && Grades != "undefined") {
- if (item) {
- $('#Class').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: { strWhere: "deptno='" + item.deptno + "' AND CheckMark=1 AND Grade='" + Grades + "' order by classno desc" }
- });
- } else {
- $('#Class').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
- });
- }
- } else {
- if (item) {
- $('#Class').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: { strWhere: "deptno='" + item.deptno + "' AND CheckMark=1 order by classno desc" }
- });
- } else {
- $('#Class').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
- });
- }
- }
- }
- });
- $('#Grade').lrselect({
- url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear',
- value: 'value',
- text: 'text',
- select: function (item) {
- var DeptNo = $("#DeptNo").lrselectGet();
- if (DeptNo != null && DeptNo != "" && DeptNo != "undefined") {
- if (item) {
- $('#Class').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: {
- strWhere: "deptno='" + DeptNo + "' AND CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
- }
- });
- } else {
- $('#Class').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
- });
- }
- } else {
- if (item) {
- $('#Class').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: {
- strWhere: "CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
- }
- });
- } else {
- $('#Class').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
- });
- }
- }
-
- }
- });
- }
- $('#Class').lrselect({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" },
- value: "classno",
- text: "classname"
- });
- },
- initData: function () {
- if (!!keyValue) {
- $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuArriveSchool/GetFormData?keyValue=' + keyValue, function (data) {
- for (var id in data) {
- if (!!data[id].length && data[id].length > 0) {
- $('#' + id ).jfGridSet('refreshdata', data[id]);
- }
- else {
- $('[data-table="' + id + '"]').lrSetFormData(data[id]);
- }
- if (type == "copy") {
- $('#Date').val(getnow());
- var timer = setTimeout(function () {
- $('#Class').lrselectSet(data[id].Class);
- clearTimeout(timer);
- }, 2000);
- }
- }
- });
- }
- }
- };
- // 保存数据
- acceptClick = function (callBack) {
- if (!$('body').lrValidform()) {
- return false;
- }
- if (type == "copy") {
- keyValue = "";
- }
- var postData = {
- strEntity: JSON.stringify($('body').lrGetFormData())
- };
- $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuArriveSchool/SaveForm?keyValue=' + keyValue, postData, function (res) {
- // 保存成功后才回调
- if (!!callBack) {
- callBack();
- }
- });
- };
- page.init();
-
- }
- function getnow() {
- var date = new Date();
- var result = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
- return result;
- };
|