b0fb14ef423f6d01b1fa09bc76d439970e0c2091.svn-base 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. //部门id
  2. var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  3. //取得用户真实姓名
  4. var realname = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  5. //获取用户的Id
  6. var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  7. //部门名称
  8. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
  9. //父部门id
  10. var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
  11. var g;
  12. var sql_condition = "";
  13. // 初始化函数
  14. function initComplete() {
  15. //给初始化表格添加加载条件
  16. var initCondition="IS_DEL=0";
  17. // 列表加载参数
  18. loadParams = {
  19. "listId" : '232',
  20. "condition" : initCondition
  21. };
  22. initGrid();
  23. }
  24. // 加载树
  25. function initGrid() {
  26. g = $("#mainGrid").quiGrid({
  27. columns : [ {
  28. display : '序号',
  29. name : 'FD_OBJECTID232',
  30. hide : true
  31. }, {
  32. display : '通知标题',
  33. name : 'NOTICE_TITLE_232',
  34. align : 'center',
  35. width : "15%"
  36. }, {
  37. display : '所属单位',
  38. name : 'DEPT_ID_232_SHOW',
  39. align : 'center',
  40. width : "15%"
  41. }, {
  42. display : '通知类别',
  43. name : 'NOTICE_CLASSIFY_232_SHOW',
  44. align : 'center',
  45. width : "25%"
  46. }, {
  47. display : '发布日期',
  48. name : 'NOTICE_PUBLISH_DATE_232',
  49. align : 'center',
  50. width : "15%"
  51. }, {
  52. display : '发布人',
  53. name : 'PUBLISH_MAN_232_SHOW',
  54. align : 'center',
  55. width : "15%"
  56. }, {
  57. display : '通知状态',
  58. name : 'FILE_STATUS_232_SHOW',
  59. align : 'center',
  60. width : "15%"
  61. } ],
  62. url : $.pathname() + '/ws/crud/CRUDService/queryQui',
  63. params : loadParams,
  64. sortName : 'UPDATEDATE_232 ',
  65. sortOrder : 'desc nulls last',
  66. rownumbers : true,
  67. checkbox : true,
  68. height : "100%",
  69. width : "100%",
  70. pageSize : 10,
  71. percentWidthMode : true,
  72. // 顶部图标按钮栏
  73. toolbar : {
  74. items : [ {
  75. text : '新增',
  76. click : onAdd,
  77. iconClass : 'icon_add',
  78. disabled : false
  79. }, {
  80. line : true
  81. }, {
  82. text : '修改',
  83. click : onEdit,
  84. iconClass : 'icon_edit',
  85. disabled : false
  86. }, {
  87. line : true
  88. }, {
  89. text : '删除',
  90. click : onDelete,
  91. iconClass : 'icon_delete',
  92. disabled : false
  93. }, {
  94. line : true
  95. }, {
  96. text : '查看详情',
  97. click : onView,
  98. iconClass : 'icon_view',
  99. disabled : false
  100. }
  101. ]
  102. }
  103. });
  104. }
  105. //查询
  106. function searchHandel() {
  107. var condition = "";
  108. var search_value = $("#searchinput").val().trim();
  109. var patt= /[@#\$%\^&\*\~\<\>\)\(\{\}\[\]\`\/\\\'\"\;\:\:\;\!\¥\=\-\\\,\。\·\!]+/g;
  110. if(patt.test(search_value)){
  111. top.Dialog.alert("请输入合法字符");
  112. return;
  113. }
  114. if(!patt.test(search_value)){
  115. condition += ("(" + " NOTICE_TITLE LIKE '%" + search_value + "%'"
  116. /*+ " OR SUP_UNIT LIKE '%" + search_value + "%'"*/
  117. + " OR NOTICE_PUBLISH_DATE LIKE '%" + search_value + "%')");
  118. condition += "AND IS_DEL=0 ";
  119. }
  120. if (search_value == "") {
  121. condition +="AND IS_DEL=0 ";
  122. }
  123. g.setOptions({// 重置加载列表的参数
  124. params : {
  125. "listId" : '232',
  126. "condition" : condition
  127. }
  128. });
  129. sql_condition = condition;
  130. g.setNewPage(1);
  131. g.loadData();// 刷新列表
  132. }
  133. // 点击新增触发方法
  134. function onAdd() {
  135. // 跳转页面
  136. var iframe = parent.document.getElementById("frmright");
  137. iframe.src = "business/am/noticeFile/notice-file-modify.html";
  138. }
  139. // 点击修改按钮触发方法
  140. function onEdit() {
  141. var rows = g.getSelectedRows();
  142. if (rows.length == 0) {
  143. top.Dialog.alert("请选择一条记录");
  144. return;
  145. }
  146. if (rows.length > 1) {
  147. top.Dialog.alert("只能选择一条记录");
  148. return;
  149. }
  150. var fd_id = rows[0].FD_OBJECTID232;
  151. var iframe = parent.document.getElementsByName("frmright")[0];
  152. iframe.src = "business/am/noticeFile/notice-file-modify.html?" + fd_id;
  153. }
  154. // 删除按钮点击事件
  155. function onDelete() {
  156. var rows = g.getSelectedRows();
  157. var rowsLength = rows.length;
  158. if (rowsLength == 0) {
  159. top.Dialog.alert("请选中要删除的记录!");
  160. return;
  161. }
  162. var ids = "";
  163. for (var i = 0; i < rowsLength; i++) {
  164. ids += rows[i].FD_OBJECTID232 + ",";
  165. }
  166. top.Dialog.confirm("确定要删除吗?|删除", function() {
  167. // 删除记录
  168. $.post($.pathname() + "/ws/crud/CRUDService/delete/", {
  169. "objectIDs" : ids,
  170. classid : 232
  171. }, function(result) {
  172. if (result.Msg.sucsess == true) {
  173. top.Dialog.alert("删除成功", null, null, null, 1);
  174. // 刷新表格数据
  175. g.loadData();
  176. } else {
  177. top.Dialog.alert("删除失败");
  178. }
  179. }, "json");
  180. });
  181. }
  182. function onView(){
  183. var rows = g.getSelectedRows();
  184. if (rows.length == 0) {
  185. top.Dialog.alert("请选择一条记录");
  186. return;
  187. }
  188. if (rows.length > 1) {
  189. top.Dialog.alert("只能选择一条记录");
  190. return;
  191. }
  192. var fd_id = rows[0].FD_OBJECTID232;
  193. var iframe = parent.document.getElementById("frmright");
  194. iframe.src = "business/am/noticeFile/notice-file-info.html?" + fd_id;
  195. }