7121e3a322fe4af00aa89aab0016d67906600b44.svn-base 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. /**
  2. *
  3. * @returns {___anonymous_MakeshiftSite}
  4. * @author lenovo
  5. * @date 2015/09/17 09:50
  6. */
  7. MakeshiftSite = function() {
  8. /**定义变量**/
  9. var _this = this;
  10. _this.listGrid = null;//数据列表
  11. $queryForm = null;//查询区域的表单
  12. $searchHandler = null;//查询按钮
  13. _this.loadParams = null;//列表加载参数
  14. /**私有方法**/
  15. /***新增信息***/
  16. _this.addForm = function(){
  17. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/report/settlements/SiteAddEdit.jsp?fd_id=");
  18. };
  19. /***修改信息***/
  20. _this.editForm = function(){
  21. var rows = _this.listGrid.getSelectedRows();
  22. var rowsLength = rows.length;
  23. if (rowsLength == 0) {
  24. top.Dialog.alert("请选中要修改的记录!");
  25. return;
  26. } else if (rowsLength > 1) {
  27. top.Dialog.alert("请选中一条要修改的记录!");
  28. return;
  29. } else {
  30. var fd_id = _this.listGrid.getSelectedRow().FD_OBJECTID381;
  31. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/report/settlements/SiteAddEdit.jsp?fd_id="+fd_id);
  32. }
  33. };
  34. /***删除信息***/
  35. _this.del = function(){
  36. var rows = _this.listGrid.getSelectedRows();
  37. var rowsLength = rows.length;
  38. if (rowsLength == 0) {
  39. top.Dialog.alert("请选中要删除的记录!");
  40. return;
  41. }
  42. var ids = "";
  43. for ( var i = 0; i < rowsLength; i++) {
  44. ids += rows[i].FD_OBJECTID381 + ",";
  45. }
  46. var url = $.pathname() +"/ws/crud/CRUDService/delete/";
  47. var params = {
  48. objectIDs : ids,
  49. classid : 381
  50. };
  51. top.Dialog.confirm("确定要删除吗?|删除", function() {
  52. $.request.del(url,params,function(result){
  53. if (result.Msg.sucsess == true) {
  54. top.Dialog.alert("删除成功!");
  55. // 刷新表格数据
  56. _this.listGrid.loadData();
  57. } else {
  58. top.Dialog.alert("删除失败!");
  59. }
  60. });
  61. });
  62. };
  63. /****查看详细信息****/
  64. _this.showInfo = function(){
  65. var rows = _this.listGrid.getSelectedRows();
  66. var rowsLength = rows.length;
  67. if (rowsLength == 0) {
  68. top.Dialog.alert("请选中要查看的记录!");
  69. return;
  70. } else if (rowsLength > 1) {
  71. top.Dialog.alert("请选中一条要查看的记录!");
  72. return;
  73. } else {
  74. var fd_id = _this.listGrid.getSelectedRow().FD_OBJECTID381;
  75. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/report/settlements/SiteInfo.jsp?fd_id="+fd_id);
  76. }
  77. };
  78. //************************************************************************************************************************************************/
  79. //查询
  80. function search(obj){
  81. $queryForm.serialize();
  82. var queryParams = getQueryFormParams($queryForm);
  83. var params = concatJson({}, [_this.loadParams,queryParams]);
  84. _this.listGrid.setOptions( {
  85. params : params
  86. });
  87. //页号重置为1
  88. _this.listGrid.setNewPage(1);
  89. _this.listGrid.loadData();//加载数据
  90. }
  91. //************************************************************************************************************************************************/
  92. return {
  93. init : function() {
  94. $queryForm = $("#queryForm");
  95. /**绑定查询面板的按钮点击事件**/
  96. $searchHandler = $("#searchHandler");//查询按钮
  97. $searchHandler.bind('click',function(){
  98. search();
  99. });
  100. //定义列表加载参数
  101. _this.loadParams = {
  102. listId : '381',
  103. condition : 'is_del=0'
  104. };
  105. /**grid载入数据(定义数据列表)**/
  106. _this.listGrid = $("#maingrid").quiGrid({
  107. //title : "临时场所管理数据列表",
  108. columns : [
  109. {
  110. name : 'FD_OBJECTID381',
  111. display : '主键',
  112. align : 'center',
  113. hide : true
  114. },
  115. {
  116. name : 'SETTLEMENTS_NAME_381',
  117. display : '名称',
  118. align : 'center',
  119. width: "10%"
  120. },
  121. {
  122. name : 'PLACE_381',
  123. display : '地点',
  124. align : 'center',
  125. width: "10%"
  126. },
  127. {
  128. name : 'NUMBER_OF_PLACEMENT_381',
  129. display : '安置人数',
  130. align : 'center',
  131. width: "10%"
  132. },
  133. {
  134. name : 'NUMBER_OF_TENTS_381',
  135. display : '帐篷数量',
  136. align : 'center',
  137. width: "10%"
  138. },
  139. {
  140. name : 'TEMPORARY_ELECTRICITY_LOAD_381',
  141. display : '临时用电负荷',
  142. align : 'center',
  143. width: "10%"
  144. },
  145. {
  146. name : 'PLACE_TYPES_381_SHOW',//类型
  147. display : '临时场所类型',
  148. align : 'center',
  149. width: "10%"
  150. },
  151. {
  152. name : 'POWER_SUPPLY_MODE_381',
  153. display : '供电方式',
  154. align : 'center',
  155. width: "10%"
  156. },
  157. {
  158. name : 'EQUIPMENT_NUMBER_381',
  159. display : '照明设备数量',
  160. align : 'center',
  161. width: "10%"
  162. },
  163. {
  164. name : 'UNATTENDED_HEAD_381',
  165. display : '值守人员',
  166. align : 'center',
  167. width: "10%"
  168. },
  169. {
  170. name : 'TELEPHONE_381',
  171. display : '电话',
  172. align : 'center',
  173. width: "10%"
  174. }],
  175. url : $.pathname() + '/ws/crud/CRUDService/queryQui',
  176. params : _this.loadParams,
  177. //排序字段
  178. sortName:'UPDATEDATE',
  179. sortOrder:"DESC",
  180. rownumbers : true,
  181. checkbox : true,
  182. height : "100%",
  183. width : "100%",
  184. pageSize : 10,
  185. percentWidthMode : true,
  186. toolbar : {
  187. items : [ {
  188. text : '新增',
  189. click : _this.addForm,
  190. iconClass : 'icon_add'
  191. }, {
  192. line : true
  193. }, {
  194. text : '修改',
  195. click : _this.editForm,
  196. iconClass : 'icon_edit'
  197. }, {
  198. line : true
  199. }, {
  200. text : '删除',
  201. click : _this.del,
  202. iconClass : 'icon_delete'
  203. }, {
  204. line : true
  205. }, {
  206. text : '查看',
  207. click : _this.showInfo,
  208. iconClass : 'icon_view'
  209. } ]
  210. }
  211. });
  212. }
  213. };
  214. }();
  215. $(function() {
  216. MakeshiftSite.init();
  217. });