61865ae572535f0428a25d50df7298feb727dbf5.svn-base 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. /**
  2. * 功能:
  3. *
  4. *
  5. * @author
  6. * @date 2015/09/14
  7. */
  8. PesInput = function() {
  9. /**定义变量**/
  10. var _this = this;
  11. _this.listGrid = null;// 数据列表
  12. var g = null;//数据列表
  13. $searchPanel = null; //查询面板
  14. $queryForm = null;//查询区域表单
  15. $searchButt = null;//查询按钮
  16. $more = null; //更多
  17. //loadParams = null;//列表加载参数
  18. _this.loadParams=null;
  19. var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  20. var CorpArea = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  21. var roleids = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
  22. /**私有方法**/
  23. //8F6F2D6B24494CB6B1F1E0931E7AF87D UNIT CorpArea=="8F6F2D6B24494CB6B1F1E0931E7AF87D"&&
  24. /***新增信息***/
  25. addForm = function(){
  26. if(roleids.indexOf("R002105430210")>-1 && "8F6F2D6B24494CB6B1F1E0931E7AF87D"==CorpArea){
  27. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/report/operation/OperationAddEdit.jsp?fd_id=");
  28. }else{
  29. top.Dialog.alert("只有省公司系统部人员可以填报操作!");
  30. return;
  31. };
  32. };
  33. /***修改信息***/
  34. editForm = function(){
  35. var rows = g.getSelectedRows();
  36. var rowsLength = rows.length;
  37. if (rowsLength == 0) {
  38. top.Dialog.alert("请选中要修改的记录!");
  39. return;
  40. } else if (rowsLength > 1) {
  41. top.Dialog.alert("请选中一条要修改的记录!");
  42. return;
  43. } else if(rows[0].WRITER_ID_360!=userId){
  44. top.Dialog.alert("只有本人填报的才可以修改操作!");
  45. }else {
  46. var fd_id = g.getSelectedRow().FD_OBJECTID360;
  47. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/report/operation/OperationAddEdit.jsp?fd_id="+fd_id);
  48. }
  49. };
  50. /***删除信息***/
  51. del = function(){
  52. var rows = g.getSelectedRows();
  53. var rowsLength = rows.length;
  54. if (rowsLength == 0) {
  55. top.Dialog.alert("请选中要删除的记录!");
  56. return;
  57. }
  58. var ids = "";
  59. for ( var i = 0; i < rowsLength; i++) {
  60. ids += rows[i].FD_OBJECTID360 + ",";
  61. }
  62. var url = $.pathname() +"/ws/crud/CRUDService/delete/";
  63. var params = {
  64. objectIDs : ids,
  65. classid : 360
  66. };
  67. top.Dialog.confirm("确定要删除吗?|删除", function() {
  68. $.request.del(url,params,function(result){
  69. if (result.Msg.sucsess == true) {
  70. top.Dialog.alert("删除成功!");
  71. // 刷新表格数据
  72. g.rend();
  73. } else {
  74. top.Dialog.alert("删除失败!");
  75. }
  76. });
  77. });
  78. };
  79. //发布
  80. Publish = function() {
  81. var row = g.getSelectedRows();
  82. var fd_id = row[0].FD_OBJECTID360+",";
  83. //只能发布自己上传的文件
  84. var userId = row[0].WRITER_ID_360;
  85. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  86. if(getUser_id!=userId){
  87. top.Dialog.alert("只能发布自己上传的文件!");
  88. return;
  89. }
  90. top.Dialog.confirm("确定要发布吗?|发布", function() {
  91. // 发布规范文件
  92. $.post($.pathname() +"/ws/getPulish/OperationService/OPerationPublish/", { fd_id : fd_id, }, function(result) {
  93. if (result.Msg.sucsess == true) {
  94. top.Dialog.alert("发布成功",null,null,null,1);
  95. // 刷新表格数据
  96. g.rend();
  97. } else {
  98. top.Dialog.alert("发布失败!");
  99. }
  100. }, "json");
  101. });
  102. };
  103. //查询//=================================================================================================================================================================
  104. function search(obj){
  105. //去掉水印
  106. if($("#SEASON_360").val()=="请输入季度"){
  107. $("#SEASON_360").val("");
  108. }
  109. $("#queryForm").serialize();
  110. //获取选中的值
  111. var searchCondition = getSelectCon(conditionData);
  112. var queryParams = getQueryFormParams($("#queryForm"));
  113. var params=$.extend({},_this.loadParams,queryParams);
  114. //与之前参数条件拼接
  115. params.condition = searchCondition.condition + params.condition;
  116. _this.listGrid.setOptions({"params":params});
  117. //加载数据
  118. _this.listGrid.rend();
  119. }
  120. //更多
  121. function more(){
  122. // $("#OPER_NAME_398").val("");
  123. // $("#START_OPER_TIME_398").resetValue();
  124. // $("#END_OPER_TIME_398").resetValue();
  125. $('#moreTable').toggle(200,function(){
  126. $("emptyCondition").click();
  127. $(parent.document.body).find("#frmright").height($(window.document.body).height());
  128. });
  129. }
  130. //点击主键跳转详细信息页面
  131. _this.openDetail = function(rowindex) {
  132. var row = _this.listGrid.getRow(rowindex);
  133. var fd_id = row.FD_OBJECTID360;
  134. $('#frmright', window.parent.document).attr('src',$.pathname()+'/page/business/em/report/operation/OperationInfo.jsp?fd_id='+fd_id);
  135. };
  136. return {
  137. init : function() {
  138. $queryForm = $("#queryForm");
  139. /**绑定查询面板的按钮点击事件**/
  140. $searchButt = $("#searchButt");//查询按钮
  141. $("#SEASON_360").keydown(function(event){
  142. if(event.keyCode == 13){
  143. search();
  144. }
  145. });
  146. $searchButt.bind('click',function(){
  147. search();
  148. });
  149. $searchButt.live('click',function(){
  150. search();
  151. });
  152. /**绑定更多的按钮点击事件*/
  153. $more = $("#more"); //更多按钮
  154. $more.bind('click',function(){
  155. more();
  156. });
  157. //获得面板对象
  158. $searchPanel = $("#searchPanel");
  159. //列表加载参数
  160. var grid_option1={
  161. columns : [
  162. {
  163. name : 'FD_OBJECTID360',
  164. display : '主键',
  165. align : 'center',
  166. hide : true
  167. },
  168. {
  169. name : 'SEASON_360_SHOW',
  170. display : '季度',
  171. align : 'center',
  172. width: "10%",
  173. showTitle:true,
  174. isSort : false,
  175. isPrimaryKey:true,
  176. render : function(rowdata, rowindex, value, column) {
  177. return "<a href='javascript:;' style='width:100%;height:100%;display:block' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
  178. }
  179. },
  180. {
  181. name : 'YEAR_360',
  182. display : '年度',
  183. align : 'center',
  184. width: "20%"
  185. },
  186. {
  187. name : 'WRITER_360',
  188. display : '填报人',
  189. align : 'center',
  190. width: "10%"
  191. },
  192. {
  193. name : 'WRITER_UNIT_360_SHOW',
  194. display : '填报部门',
  195. align : 'center',
  196. width: "20%"
  197. },
  198. {
  199. name : 'WRITER_IME_360',
  200. display : '填报时间',
  201. align : 'center',
  202. width: "20%"
  203. },
  204. {
  205. name : 'STATE_360_SHOW',
  206. display : '状态',
  207. align : 'center',
  208. width: "18%"
  209. }],
  210. rownumbers:true,
  211. checkbox:true,
  212. usePager:true,
  213. pageSize : 10,
  214. percentWidthMode : true,
  215. };
  216. //查询出该角色权限下的所有按钮ID roleButtonArr()方法需引入/nwyj/scripts/freamwork/com/sinosoft/common/common.js
  217. var roleCons = roleButtonArr();
  218. var toolBarOpt1={
  219. items: [
  220. {text : '新增',click : 'addForm',iconClass : 'add1_tem' ,id:"10tjlz"},
  221. {text : '删除',click : 'del',iconClass : 'delete_tem',id:"10sc"},
  222. {text : '修改',click : 'editForm',iconClass : 'update_tem',id:"10xg"},
  223. {text : '发布',click : 'Publish',iconClass : 'view_tem' ,id:"10102"}],
  224. roleCons:roleCons};
  225. _this.loadParams = {listId : '360',
  226. direction:'DESC',
  227. sort: 'UPDATEDATE',
  228. condition : "is_del=0"
  229. };
  230. var options1={
  231. url :'/nwyj/ws/crud/CRUDService/queryQui',
  232. params: _this.loadParams,
  233. width:960,
  234. gridOptions:grid_option1,
  235. singleRecodeOptions:{a:"aa"},
  236. paperOpration:{showInput:"true"},
  237. toolBarOptions:toolBarOpt1
  238. };
  239. _this.listGrid=g=gridAndSingleRecode=$("#dataGrid").quickgridAndSingleRecode(options1);
  240. g.rend();
  241. }
  242. };
  243. }();
  244. $(function() {
  245. PesInput.init();
  246. });
  247. function showPrimaryKey(obj,index){
  248. var fd_id = obj.FD_OBJECTID360;
  249. $('#frmright', window.parent.document).attr('src',$.pathname()+'page/business/em/report/operation/OperationInfo.jsp?fd_id='+fd_id);
  250. }