You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

705 lines
32 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-04-26 15:02
  5. * 描 述:学生宿舍管理
  6. */
  7. var refreshGirdData;
  8. var selectedParent = {};
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. page.initTree();
  14. page.initGird();
  15. page.search({ ParentID: '' });
  16. page.bind();
  17. },
  18. bind: function () {
  19. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  20. page.search(queryJson);
  21. }, 420, 400);
  22. //宿舍楼
  23. $('#ApartmentId').lrselect({
  24. allowSearch: true,
  25. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DormitoryInfo',
  26. param: { strWhere: " BuildType='1' " },
  27. value: "id",
  28. text: "name",
  29. select: function (item) {
  30. if (!!item) {
  31. //单元
  32. $('#UnitId').lrselectRefresh({
  33. allowSearch: true,
  34. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DormitoryInfo',
  35. param: { strWhere: " BuildType='2' and ApartmentId='" + item.id + "'" },
  36. value: "id",
  37. text: "name",
  38. select: function (item) {
  39. if (!!item) {
  40. //楼层
  41. $('#FloorId').lrselectRefresh({
  42. allowSearch: true,
  43. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DormitoryInfo',
  44. param: { strWhere: " BuildType='3' and UnitId='" + item.id + "'" },
  45. value: "id",
  46. text: "name"
  47. });
  48. }
  49. }
  50. });
  51. }
  52. }
  53. });
  54. $('#UnitId').lrselect({ allowSearch: true });
  55. $('#FloorId').lrselect({ allowSearch: true });
  56. $('#Sex').lrDataItemSelect({ code: 'usersex' });
  57. //.lrRadioCheckbox({
  58. // type: 'radio',
  59. // code: 'usersex',
  60. //});
  61. $('#NoDistribution').lrRadioCheckbox({
  62. type: 'checkbox',
  63. code: 'NoDistribution'
  64. });
  65. $('#Distribution').lrRadioCheckbox({
  66. type: 'checkbox',
  67. code: 'NoDistribution'
  68. });
  69. $('#Class').lrselect({
  70. value: "classno",
  71. text: "classname"
  72. });
  73. $('#Dept').lrselect({
  74. value: "deptno",
  75. text: "deptname",
  76. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  77. select: function (item) {
  78. if (item) {
  79. $('#Major').lrselectRefresh({
  80. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  81. param: { code: "CdMajorInfo", strWhere: "DeptNo='" + item.deptno + "'" }
  82. });
  83. }
  84. else {
  85. $('#Major').lrselectRefresh({
  86. url: "",
  87. data: []
  88. });
  89. }
  90. $('#Class').lrselectRefresh({
  91. url: "",
  92. data: []
  93. });
  94. }
  95. });
  96. $('#Major').lrselect({
  97. value: "majorno",
  98. text: "majorname",
  99. select: function (item) {
  100. if (item) {
  101. $('#Class').lrselectRefresh({
  102. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  103. param: { code: "bjsj", strWhere: "DeptNo='" + item.deptno + "' and majorno='" + item.majorno + "'" }
  104. });
  105. }
  106. }
  107. });
  108. $('#Major').on("click",
  109. function () {
  110. var data = $('#Dept').lrselectGet();
  111. if (!data) {
  112. learun.alert.error('请先选择系');
  113. }
  114. });
  115. $('#Class').on("click",
  116. function () {
  117. var data1 = $('#Dept').lrselectGet();
  118. var data2 = $('#Major').lrselectGet();
  119. if (!data1 || !data2) {
  120. learun.alert.error('请先选择系和专业');
  121. }
  122. });
  123. $('#MainClass').lrselect({
  124. data: [{ text: "是", value: "0" }, { text: "否", value: "1" }],
  125. text: "text",
  126. value: "value"
  127. })
  128. // 刷新
  129. $('#lr_refresh').on('click', function () {
  130. location.reload();
  131. });
  132. // 新增
  133. $('#lr_add').on('click', function () {
  134. var url = "";
  135. if (selectedParent.ID != null) {
  136. url = top.$.rootUrl + '/LogisticsManagement/Accommodation/Form?ParentID=' + selectedParent.ID + '&ParentName=' + selectedParent.Name;
  137. } else {
  138. return learun.alert.warning("请选择上级!");
  139. //url = top.$.rootUrl + '/LogisticsManagement/Accommodation/Form';
  140. }
  141. learun.layerForm({
  142. id: 'form',
  143. title: '新增',
  144. url: url,
  145. width: 900,
  146. height: 550,
  147. callBack: function (id) {
  148. return top[id].acceptClick(refreshGirdData);
  149. }
  150. });
  151. });
  152. // 编辑
  153. $('#lr_edit').on('click', function () {
  154. var keyValue = $('#gridtable').jfGridValue('ID');
  155. if (learun.checkrow(keyValue)) {
  156. if (keyValue.indexOf(',') != -1) {
  157. learun.alert.warning("只能选择一条记录进行编辑!");
  158. return false;
  159. }
  160. learun.layerForm({
  161. id: 'form',
  162. title: '编辑',
  163. url: top.$.rootUrl + '/LogisticsManagement/Accommodation/Form?keyValue=' + keyValue,
  164. width: 900,
  165. height: 550,
  166. callBack: function (id) {
  167. return top[id].acceptClick(refreshGirdData);
  168. }
  169. });
  170. }
  171. });
  172. // 删除
  173. $('#lr_delete').on('click', function () {
  174. var keyValue = $('#gridtable').jfGridValue('ID');
  175. if (learun.checkrow(keyValue)) {
  176. learun.layerConfirm('是否确认删除该项!', function (res) {
  177. if (res) {
  178. learun.deleteForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/DeleteForm', { keyValue: keyValue }, function () {
  179. refreshGirdData();
  180. });
  181. }
  182. });
  183. }
  184. });
  185. //批量添加宿舍
  186. $("#lr_dormitoryAdd").on("click", function () {
  187. var keyvalue1 = $("#gridtable").jfGridValue("ID");
  188. if (selectedParent.ChildType == "2") {
  189. var keyValue = selectedParent.ID;
  190. learun.layerForm({
  191. id: 'form',
  192. title: '批量添加宿舍',
  193. url: top.$.rootUrl + '/LogisticsManagement/Accommodation/DormitoryAdd?keyValue=' + keyValue,
  194. width: 600,
  195. height: 400,
  196. callBack: function (id) {
  197. return top[id].acceptClick(refreshGirdData);
  198. }
  199. });
  200. }
  201. else {
  202. learun.alert.warning("请选择楼");
  203. }
  204. });
  205. // 打印
  206. $('#lr_print').on('click', function () {
  207. $('#gridtable').jqprintTable();
  208. });
  209. //刷新左侧的树
  210. $("#tree_refresh").on("click", function () {
  211. page.initTree();
  212. });
  213. //分配系
  214. $("#lr_Dept").on("click", function () {
  215. var keyValue = $('#gridtable').jfGridValue('ID');
  216. var BuildType = $('#gridtable').jfGridValue('BuildType');
  217. var Dept = $('#gridtable').jfGridValue('Dept');
  218. var arr = BuildType.split(',');
  219. if (arr.some(x => x != '4')) {
  220. return learun.alert.warning("只能选择宿舍进行分配!");
  221. }
  222. if (keyValue.indexOf(',') > 0) {
  223. var arrDept = Dept.split(',');
  224. for (var i = 0; i < arrDept.length; i++) {
  225. if (arrDept[i].length >= 1) {
  226. learun.alert.warning("选中记录包含已分配的数据!");
  227. return false;
  228. }
  229. }
  230. }
  231. learun.layerForm({
  232. id: 'formDept',
  233. title: '分配系部',
  234. url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormDept?keyValue=' + keyValue,
  235. width: 400,
  236. height: 300,
  237. callBack: function (id) {
  238. return top[id].acceptClick(refreshGirdData);
  239. }
  240. });
  241. });
  242. //分配专业和班级
  243. $("#lr_Class").on("click", function () {
  244. var keyValue = $('#gridtable').jfGridValue('ID');
  245. var BuildType = $('#gridtable').jfGridValue('BuildType');
  246. var Dept = $('#gridtable').jfGridValue('Dept');
  247. var arr = BuildType.split(',');
  248. if (arr.some(x => x != '4')) {
  249. return learun.alert.warning("只能选择宿舍进行分配!");
  250. }
  251. var arrDept = Dept.split(',');
  252. if (arrDept.some(function (value, index) {
  253. return value.length === 0;
  254. })) {
  255. return learun.alert.warning("选中记录包含未分配系的数据!");
  256. }
  257. if (keyValue.indexOf(',') > 0) {
  258. if (arrDept.some(function (value, index) {
  259. return value != arrDept[0];
  260. })) {
  261. return learun.alert.warning("选中记录包含多种专业的数据,不可批量分配班级!");
  262. }
  263. }
  264. learun.layerForm({
  265. id: 'formClass',
  266. title: '分配专业班级',
  267. url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormClass?keyValue=' + keyValue + '&Dept=' + arrDept[0],
  268. width: 400,
  269. height: 300,
  270. callBack: function (id) {
  271. return top[id].acceptClick(refreshGirdData);
  272. }
  273. });
  274. });
  275. //分配宿舍
  276. $("#lr_Bed").on("click", function () {
  277. var keyValue = $('#gridtable').jfGridValue('ID');
  278. var Sex = $('#gridtable').jfGridValue('Sex');
  279. var BuildType = $('#gridtable').jfGridValue('BuildType');
  280. var Name = $('#gridtable').jfGridValue('Name');
  281. var Class = $('#gridtable').jfGridValue('Class');
  282. var arr = BuildType.split(',');
  283. if (arr.some(x => x != '4')) {
  284. return learun.alert.warning("只能选择宿舍进行分配!");
  285. }
  286. if (keyValue.indexOf(',') != -1) {
  287. return learun.alert.warning("只能选择一条记录进行分配!");
  288. }
  289. if (Class.length == 0) {
  290. return learun.alert.warning("请先分配班级!");
  291. }
  292. learun.layerForm({
  293. id: 'formRoom',
  294. title: '分配宿舍--' + Name,
  295. url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormRoom?keyValue=' + keyValue + '&Class=' + Class + '&Sex=' + Sex,
  296. width: 600,
  297. height: 400,
  298. callBack: function (id) {
  299. return top[id].acceptClick(refreshGirdData);
  300. }
  301. });
  302. });
  303. //分配主宿舍
  304. $("#lr_MainC").on("click", function () {
  305. var keyValue = $('#gridtable').jfGridValue('ID');
  306. var BuildType = $('#gridtable').jfGridValue('BuildType');
  307. var Dept = $('#gridtable').jfGridValue('Dept');
  308. var arr = BuildType.split(',');
  309. var Class = $('#gridtable').jfGridValue('Class');
  310. var arrClass = Class.split(',');
  311. if (keyValue.indexOf(',') != -1) {
  312. return learun.alert.warning("只能选择一条记录进行分配!");
  313. }
  314. if (arrClass.length <= 1) {
  315. return learun.alert.warning("只能设置分配多个班级的宿舍!");
  316. }
  317. if (arr.some(x => x != '4')) {
  318. return learun.alert.warning("只能选择宿舍进行分配!");
  319. }
  320. var arrDept = Dept.split(',');
  321. if (arrDept.some(function (value, index) {
  322. return value.length === 0;
  323. })) {
  324. return learun.alert.warning("选中记录包含未分配系的数据!");
  325. }
  326. if (keyValue.indexOf(',') > 0) {
  327. if (arrDept.some(function (value, index) {
  328. return value != arrDept[0];
  329. })) {
  330. return learun.alert.warning("选中记录包含多种专业的数据,不可批量分配班级!");
  331. }
  332. }
  333. learun.layerForm({
  334. id: 'formDept',
  335. title: '分配主班级',
  336. url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormMainClass?keyValue=' + keyValue + '&Dept=' + arrDept[0] + '&Class=' + Class,
  337. width: 400,
  338. height: 300,
  339. callBack: function (id) {
  340. return top[id].acceptClick(refreshGirdData);
  341. }
  342. });
  343. });
  344. },
  345. //初始化左侧树
  346. initTree: function () {
  347. // 初始化左侧树形数据
  348. $('#dataTree').lrtree({
  349. url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetTree',
  350. nodeClick: function (item) {
  351. selectedParent.ID = item.value;
  352. selectedParent.Name = item.text;
  353. selectedParent.BuildType = item.title;
  354. if (item.parent) {
  355. if (!item.parent.parentId) {
  356. selectedParent.ChildType = "2";
  357. } else {
  358. selectedParent.ChildType = "0";
  359. }
  360. }
  361. else {
  362. selectedParent.ChildType = "1";
  363. }
  364. if (item.text.indexOf("室") > -1) {
  365. selectedParent.ChildType = "5";
  366. }
  367. var param = {};
  368. if (item.title == '1')
  369. param.ApartmentId = item.value;
  370. else if (item.title == '2')
  371. param.UnitId = item.value;
  372. else if (item.title == '3')
  373. param.FloorId = item.value;
  374. //page.initGird();
  375. //page.search({ ParentID: item.value });
  376. page.search(param);
  377. }
  378. });
  379. },
  380. // 初始化列表
  381. initGird: function () {
  382. //宿舍数据
  383. $('#gridtable').jfGrid({
  384. url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList',
  385. headData: [
  386. { label: "名称", name: "Name", width: 100, align: "left" },
  387. {
  388. label: "宿舍楼", name: "ApartmentName", width: 100, align: "left"
  389. },
  390. {
  391. label: "单元", name: "UnitName", width: 100, align: "left"
  392. },
  393. {
  394. label: "楼层", name: "FloorName", width: 100, align: "left"
  395. },
  396. //{
  397. // label: "学生", name: "StudentID", width: 100, align: "left",
  398. // formatterAsync: function (callback, value, row, op, $cell) {
  399. // learun.clientdata.getAsync('custmerData', {
  400. // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
  401. // key: value,
  402. // keyId: 'stuid',
  403. // callback: function (_data) {
  404. // callback(_data['stuname']);
  405. // }
  406. // });
  407. // }
  408. //},
  409. { label: "位置", name: "Address", width: 100, align: "left" },
  410. {
  411. label: "校区", name: "Campus", width: 100, align: "left",
  412. formatterAsync: function (callback, value, row, op, $cell) {
  413. learun.clientdata.getAsync('custmerData', {
  414. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company',
  415. key: value,
  416. keyId: 'f_companyid',
  417. callback: function (_data) {
  418. callback(_data['f_fullname']);
  419. }
  420. });
  421. }
  422. },
  423. {
  424. label: "系", name: "Dept", width: 100, align: "left",
  425. formatterAsync: function (callback, value, row, op, $cell) {
  426. learun.clientdata.getAsync('custmerData', {
  427. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  428. key: value,
  429. keyId: 'deptno',
  430. callback: function (_data) {
  431. callback(_data['deptname']);
  432. }
  433. });
  434. }
  435. },
  436. {
  437. label: "专业", name: "Major", width: 100, align: "left",
  438. formatterAsync: function (callback, value, row, op, $cell) {
  439. learun.clientdata.getAsync('custmerData', {
  440. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  441. key: value,
  442. keyId: 'majorno',
  443. callback: function (_data) {
  444. callback(_data['majorname']);
  445. }
  446. });
  447. }
  448. },
  449. {
  450. label: "分配班级", name: "Class", width: 120, align: "left",
  451. formatterAsync: function (callback, value, row, op, $cell) {
  452. if (value && value.indexOf(',') != -1) {
  453. var content = '';
  454. var texts = value.split(',');
  455. for (var i = 0; i < texts.length; i++) {
  456. learun.clientdata.getAsync('custmerData',
  457. {
  458. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  459. key: texts[i],
  460. keyId: 'classno',
  461. callback: function (_data) {
  462. content += _data['classname'] + ',';
  463. }
  464. });
  465. }
  466. content = content.substring(0, content.length - 1);
  467. callback(content);
  468. } else {
  469. learun.clientdata.getAsync('custmerData',
  470. {
  471. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  472. key: value,
  473. keyId: 'classno',
  474. callback: function (_data) {
  475. callback(_data['classname']);
  476. }
  477. });
  478. }
  479. }
  480. },
  481. {
  482. label: "主班级", name: "MainClass", width: 100, align: "left",
  483. formatterAsync: function (callback, value, row, op, $cell) {
  484. learun.clientdata.getAsync('custmerData', {
  485. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  486. key: value,
  487. keyId: 'classno',
  488. callback: function (_data) {
  489. callback(_data['classname']);
  490. }
  491. });
  492. }
  493. },
  494. {
  495. label: "寝室类型", name: "RoomType", width: 100, align: "left",
  496. formatter: function (value, row) {
  497. if (value) {
  498. return value + '人寝';
  499. } else {
  500. return '';
  501. }
  502. }
  503. },
  504. { label: "入住人数", name: "CheckInStu", width: 100, align: "left" },
  505. {
  506. label: "性别", name: "Sex", width: 100, align: "left",
  507. formatter: function (value, row) {
  508. if (value == '0')
  509. return '女';
  510. else if (value == '1')
  511. return '男';
  512. else
  513. return '';
  514. }
  515. },
  516. { label: "负责人", name: "Functionary", width: 100, align: "left" },
  517. { label: "负责人电话", name: "Phone", width: 100, align: "left" },
  518. { label: "备注", name: "Remark", width: 100, align: "left" },
  519. ],
  520. mainId: 'ID',
  521. isPage: true,
  522. isMultiselect: true,
  523. sidx: 'CheckInStu asc,ApartmentId asc,UnitId asc ,FloorId asc ',
  524. //sord: 'ASC',
  525. isSubGrid: true, // 是否有子表
  526. subGridExpanded: function (subContentId, rowItem) {
  527. $('#' + subContentId).jfGrid({
  528. url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetBedListByRoomId?RoomId=' + rowItem.ID,
  529. headData: [
  530. { label: "名称", name: "Name", width: 100, align: "left" },
  531. {
  532. label: "学生", name: "StudentID", width: 100, align: "left",
  533. formatterAsync: function (callback, value, row, op, $cell) {
  534. learun.clientdata.getAsync('custmerData', {
  535. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
  536. key: value,
  537. keyId: 'stuno',
  538. callback: function (_data) {
  539. callback(_data['stuname']);
  540. }
  541. });
  542. }
  543. },
  544. ],
  545. mainId: 'ID',
  546. isPage: false,
  547. //sidx: ' CAST(REPLACE(Name,\'床\',\'\') as int)'
  548. });
  549. //var param;
  550. //param = param || {};
  551. //param.ParentID = rowItem.Id;
  552. $('#' + subContentId).jfGridSet('reload');
  553. },
  554. subGridHeight: 250,
  555. });
  556. //$("#gridtable").empty();
  557. //$("#gridtable")[0].dfop = undefined;
  558. //if (selectedParent.BuildType == undefined || selectedParent.BuildType === "3") {
  559. //} else {
  560. // //lrAuthorizeJfGridLei
  561. // $('#gridtable').jfGrid({
  562. // url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList',
  563. // headData: [
  564. // { label: "名称", name: "Name", width: 100, align: "left" },
  565. // {
  566. // label: "宿舍楼", name: "ApartmentName", width: 100, align: "left"
  567. // },
  568. // {
  569. // label: "单元", name: "UnitName", width: 100, align: "left"
  570. // },
  571. // {
  572. // label: "楼层", name: "FloorName", width: 100, align: "left"
  573. // },
  574. // //{
  575. // // label: "学生", name: "StudentID", width: 100, align: "left",
  576. // // formatterAsync: function (callback, value, row, op, $cell) {
  577. // // learun.clientdata.getAsync('custmerData', {
  578. // // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
  579. // // key: value,
  580. // // keyId: 'stuid',
  581. // // callback: function (_data) {
  582. // // callback(_data['stuname']);
  583. // // }
  584. // // });
  585. // // }
  586. // //},
  587. // { label: "位置", name: "Address", width: 100, align: "left" },
  588. // {
  589. // label: "校区", name: "Campus", width: 100, align: "left",
  590. // formatterAsync: function (callback, value, row, op, $cell) {
  591. // learun.clientdata.getAsync('custmerData', {
  592. // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company',
  593. // key: value,
  594. // keyId: 'f_companyid',
  595. // callback: function (_data) {
  596. // callback(_data['f_fullname']);
  597. // }
  598. // });
  599. // }
  600. // },
  601. // //{
  602. // // label: "系", name: "Dept", width: 100, align: "left",
  603. // // formatterAsync: function (callback, value, row, op, $cell) {
  604. // // learun.clientdata.getAsync('custmerData', {
  605. // // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  606. // // key: value,
  607. // // keyId: 'deptno',
  608. // // callback: function (_data) {
  609. // // callback(_data['deptname']);
  610. // // }
  611. // // });
  612. // // }
  613. // //},
  614. // //{
  615. // // label: "专业", name: "Major", width: 100, align: "left",
  616. // // formatterAsync: function (callback, value, row, op, $cell) {
  617. // // learun.clientdata.getAsync('custmerData', {
  618. // // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  619. // // key: value,
  620. // // keyId: 'id',
  621. // // callback: function (_data) {
  622. // // callback(_data['majorname']);
  623. // // }
  624. // // });
  625. // // }
  626. // //},
  627. // //{ label: "班级", name: "Class", width: 100, align: "left" },
  628. // //{
  629. // // label: "性别", name: "Sex", width: 100, align: "left",
  630. // // formatterAsync: function (callback, value, row, op, $cell) {
  631. // // learun.clientdata.getAsync('dataItem', {
  632. // // key: value,
  633. // // code: 'usersex',
  634. // // callback: function (_data) {
  635. // // callback(_data.text);
  636. // // }
  637. // // });
  638. // // }
  639. // //},
  640. // { label: "负责人", name: "Functionary", width: 100, align: "left" },
  641. // { label: "负责人电话", name: "Phone", width: 100, align: "left" },
  642. // { label: "备注", name: "Remark", width: 100, align: "left" },
  643. // ],
  644. // mainId: 'ID',
  645. // isPage: true,
  646. // //isMultiselect: true
  647. // //sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ',
  648. // //sord: 'ASC',
  649. // });
  650. //}
  651. },
  652. search: function (param) {
  653. param = param || {};
  654. param.SqlParameter = " AND t.BuildType ='4' ";
  655. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  656. }
  657. };
  658. refreshGirdData = function () {
  659. //page.initTree();
  660. if (!!selectedParent.ID) {
  661. //var param = { ParentID: selectedParent.ID };
  662. //$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  663. page.initTree();
  664. page.search({ ParentID: selectedParent.ID });
  665. } else {
  666. page.initTree();
  667. page.search();
  668. }
  669. };
  670. page.init();
  671. }