|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2020-12-17 14:29
- * 描 述:人才培养方案
- */
- 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);
- //学年
- $('#AcademicYearNo').lrselect({
- placeholder: "请选择学年",
- allowSearch: true,
- url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
- value: 'value',
- text: 'text'
- });
- //学期
- $('#Semester').lrselect({
- placeholder: "请选择学年",
- allowSearch: true,
- url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester',
- value: 'value',
- text: 'text'
- });
- $('#DeptNo').lrDataSourceSelect({
- code: 'CdDeptInfo', value: 'deptno', text: 'deptname', select: function (item) {
- if (item) {
- $('#MajorNo').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
- param: { strWhere: "deptno='" + item.deptno + "' AND CheckMark=1" }
- });
- } else {
- $('#MajorNo').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
- param: { strWhere: "CheckMark=1" }
- });
- }
- }
- });
- $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/EATalentTrain/Form',
- width: 800,
- height: 600,
- 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/EATalentTrain/Form?keyValue=' + keyValue,
- width: 800,
- height: 600,
- 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/EATalentTrain/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/EATalentTrain/GetPageList',
- headData: [
- { label: "学年", name: "AcademicYearNo", width: 100, align: "left" },
- { label: "学期", name: "Semester", width: 100, align: "left" },
- {
- 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: "EntranceRequire", width: 150, align: "left" },
- { label: "修业年限", name: "YearLimit", width: 100, align: "left" },
- ],
- mainId: 'Id',
- isPage: true
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- $('#gridtable').jfGridSet('reload');
- };
- page.init();
- }
|