|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2019-11-19 16:03
- * 描 述:会议室管理
- */
- 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);
- $("#Status").lrDataItemSelect({ code: 'EnableStatus' });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/PersonnelManagement/ConferenceRoom/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 + '/PersonnelManagement/ConferenceRoom/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 + '/PersonnelManagement/ConferenceRoom/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 启用
- $('#lr_enable').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('ID');
- if (learun.checkrow(keyValue)) {
- var Status = $('#gridtable').jfGridValue('Status');
- if (Status == "1") {
- learun.alert.warning("当前项已启用!");
- return false;
- }
- learun.layerConfirm('是否确认启用该项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/PersonnelManagement/ConferenceRoom/DoEnable', { keyValue: keyValue, status: "1" }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 禁用
- $('#lr_disable').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('ID');
- if (learun.checkrow(keyValue)) {
- var Status = $('#gridtable').jfGridValue('Status');
- if (Status != "1") {
- learun.alert.warning("当前项未启用!");
- return false;
- }
- learun.layerConfirm('是否确认禁用该项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/PersonnelManagement/ConferenceRoom/DoEnable', { keyValue: keyValue, status: "0" }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/PersonnelManagement/ConferenceRoom/GetPageList',
- headData: [
- { label: "场地名称", name: "Name", width: 200, align: "left" },
- { label: "地点", name: "Address", width: 200, align: "left" },
- {
- label: "状态", name: "Status", width: 100, align: "left", formatter: function (cellvalue) {
- return cellvalue == 1 ? "启用" : "禁用";
- }
- },
- { label: "可容纳人数", name: "Scale", width: 100, align: "left" },
- { label: "添加时间", name: "CreateTime", width: 100, align: "left" },
- ],
- mainId: 'ID',
- isPage: true,
- sidx: 'CreateTime desc'
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|