|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2021-05-11 14:32
- * 描 述:库房的房间号
- */
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- page.initGird();
- page.bind();
- },
- bind: function () {
- //$('#StorageId').lrselect({
- // type: 'tree',
- // allowSearch: true,
- // url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetTree',
- // param: {},
- // select: function (val) {
- // console.log(val);
- // var storageId = "";
- // if (val) {
- // storageId = val.value;
- // }
- // $('#RCode').lrselectRefresh({
- // url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetListForStorageId?storageId=' + storageId,
- // text: "RCode",
- // value: "RId"
- // });
- // }
- //});
- ////房间
- //$('#RCode').lrselect({ value: 'RId', text: 'RCode' });
- $('#REnabled').lrDataItemSelect({ code: 'YesOrNoBit' });
- // 初始化左侧树形数据
- $('#dataTree').lrtree({
- url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetTree',
- nodeClick: function (item) {
- page.search({ StorageId: item.value });
- }
- });
- $('#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 + '/AssetManagementSystem/AssStorageRoom/Form',
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('RId');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/Form?keyValue=' + keyValue,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('RId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/DeleteForm', { keyValue: keyValue}, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 打印
- $('#lr_print').on('click', function () {
- $('#gridtable').jqprintTable();
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/AssetManagementSystem/AssStorageRoom/GetPageList',
- headData: [
- //{ label: "名称", name: "RName", width: 100, align: "left"},
- { label: "房间号", name: "RCode", width: 100, align: "left"},
- { label: "房间功能", name: "RFunction", width: 100, align: "left"},
- { label: "房间面积", name: "RArea", width: 100, align: "left" },
- {
- label: "房间状态", name: "REnabled", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'RoomState',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- { label: "楼宇名称", name: "StorageId", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op,$cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_StorageData',
- key: value,
- keyId: 'sid',
- callback: function (_data) {
- callback(_data['sname']);
- }
- });
- }
- },
-
- ],
- mainId:'RId',
- isPage: true,
- sidx: 'RCode',
- sord: 'ASC'
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- $('#gridtable').jfGridSet('reload');
- };
- page.init();
- }
|