/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) * Copyright (c) 2013-2018 北京泉江科技有限公司 * 创建人:超级管理员 * 日 期:2019-01-22 10:53 * 描 述:系部信息管理 */ 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(); }); // 新增 $('#lr_add').on('click', function () { learun.layerForm({ id: 'form', title: '新增', url: top.$.rootUrl + '/EducationalAdministration/CdDept/Form', width: 600, height: 400, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); }); // 编辑 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('DeptId'); if (learun.checkrow(keyValue)) { if (keyValue.indexOf(',') != -1) { learun.alert.warning("只能选择一条记录进行编辑!"); return; } learun.layerForm({ id: 'form', title: '编辑', url: top.$.rootUrl + '/EducationalAdministration/CdDept/Form?keyValue=' + keyValue, width: 600, height: 400, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); } }); // 删除 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('DeptId'); if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/CdDept/DeleteForm', { keyValue: keyValue }, function () { refreshGirdData(); }); } }); } }); }, // 初始化列表 initGird: function () { $('#gridtable').jfGrid({ url: top.$.rootUrl + '/EducationalAdministration/CdDept/GetPageList', headData: [ { label: "系部名称", name: "DeptName", width: 100, align: "left" }, { label: "系部编号", name: "DeptNo", width: 100, align: "left" }, { label: "校区", name: "F_SchoolId", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', key: value, keyId: 'f_companyid', callback: function (_data) { callback(_data['f_fullname']); } }); } }, { label: "名称缩写", name: "DeptShortName", width: 100, align: "left" }, { label: "英文名称", name: "DeptEnBrief", width: 100, align: "left" }, { label: "排序号", name: "DeptSort", width: 100, align: "left" }, { label: "系部负责人", name: "DeptDirector", 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: "DeptpSychology", 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: "DeptSubsidizer", 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']); } }); } }, ], mainId: 'DeptId', isMultiselect: true, isPage: true, sidx: 'DeptSort', sord: 'ASC' }); page.search(); }, search: function (param) { param = param || {}; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { page.search(); }; page.init(); }