|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2019-11-20 11:37
- * 描 述:行为规范日考核
- */
- 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);
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- $('#EDept').lrselect({
- value: "deptno",
- text: "deptname",
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
- select: function (item) {
- if (item) {
- $('#EMajor').lrselectRefresh({
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
- param: { code: "CdMajorInfo", strWhere: "DeptNo='" + item.deptno + "'" }
- });
- }
- else {
- $('#EMajor').lrselectRefresh({
- url: "",
- data: []
- });
- }
- $('#EClass').lrselectRefresh({
- url: "",
- data: []
- });
- }
- });
- $('#EMajor').lrselect({
- value: "majorno",
- text: "majorname",
- select: function (item) {
- if (item) {
- $('#EClass').lrselectRefresh({
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
- param: { code: "bjsj", strWhere: "DeptNo='" + item.deptno + "' and majorno='" + item.majorno + "'" }
- });
- }
-
- }
- });
-
-
- $('#EMajor').on("click",
- function () {
- var data = $('#EDept').lrselectGet();
- if (!data) {
- learun.alert.error('请先选择系');
- }
- });
- $('#EClass').on("click",
- function () {
- var data1 = $('#EDept').lrselectGet();
- var data2 = $('#EMajor').lrselectGet();
- if (!data1 || !data2) {
- learun.alert.error('请先选择系和专业');
- }
- });
- $('#EClass').lrselect({
- value: "classno",
- text: "classname"
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/EvaCodeOfContuct/Form',
- width: 600,
- height: 500,
- 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/EvaCodeOfContuct/Form?keyValue=' + keyValue,
- width: 600,
- height: 500,
- 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/EvaCodeOfContuct/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/EvaCodeOfContuct/GetPageList',
- headData: [
- {
- label: "院系", name: "EDept", 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: "EMajor", 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: "EClass", 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: "ClassTeach", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
- key: value,
- keyId: 'f_encode',
- callback: function (_data) {
- callback(_data['f_realname']);
- }
- });
- }
- },
- {
- label: "辅导员", name: "CoachTeach", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
- key: value,
- keyId: 'f_encode',
- callback: function (_data) {
- callback(_data['f_realname']);
- }
- });
- }
- },
- { label: "学号", name: "StuNo", width: 100, align: "left" },
- { label: "姓名", name: "StuName", width: 100, align: "left" },
- { label: "电话", name: "Mobile", width: 100, align: "left" },
- { label: "违纪行为地点", name: "EAddress", width: 200, align: "left" },
- { label: "分数", name: "Fraction", width: 100, align: "left" },
- { label: "日期", name: "Data", width: 130, align: "left" },
- { label: "备注", name: "Remark", width: 100, align: "left" },
- ],
- mainId: 'ID',
- isPage: true
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|