96ed12d8475251d99cb25b727af2801d5a6a1e7e.svn-base 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140
  1. var clickNum = 0;
  2. laws = function() {
  3. /** 定义变量* */
  4. var _this = this;
  5. _this.listGrid = null;// 数据列表
  6. //_this.searchPanel = null; // 查询面板
  7. $queryForm = null;// 查询区域表单
  8. $searchButt = null;// 查询按钮
  9. $more = null; // 更多
  10. _this.loadParams = null;// 列表加载参数
  11. //取登录人应急角色
  12. var Roleid = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids() + ",";
  13. var roleidTemp =Roleid.split(",");
  14. var flag="0";
  15. /** *新增信息** */
  16. _this.addForm = function() {
  17. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_add.jsp");
  18. };
  19. /** *修改、删除信息 各级单位的超级管理员可以修改表单信息。湛江局许永山提的建议 2016-05-31** */
  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. for(var i=0; i< roleidTemp.length; i++){
  31. if(roleidTemp[i]=="R002105430200"){
  32. flag="1";
  33. }
  34. }
  35. if(rows[0].COLUMN_3_243=="1"&&flag=="0"){
  36. top.Dialog.alert("发布后的记录不能够修改!");
  37. return;
  38. }
  39. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  40. if(getUser_id!=rows[0].TYPEIN_PEOPLE_243&&flag=="0"){
  41. top.Dialog.alert("只能修改自己上传的文件!");
  42. return;
  43. }
  44. var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  45. if(rows[0].UNITE_243 != dpids){
  46. top.Dialog.alert("只能修改本级单位的文件!");
  47. return;
  48. }
  49. var fd_id = rows[0].FD_OBJECTID243;
  50. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_edit.jsp?"+fd_id);
  51. }
  52. };
  53. /** *删除信息** */
  54. _this.del = function(){
  55. var rows = _this.listGrid.getSelectedRows();
  56. var rowsLength = rows.length;
  57. if (rowsLength == 0) {
  58. top.Dialog.alert("请选中要删除的记录!");
  59. return;
  60. }
  61. for(var i=0; i< roleidTemp.length; i++){
  62. if(roleidTemp[i]=="R002105430200"){
  63. flag="1";
  64. }
  65. }
  66. var ids = "";
  67. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  68. var flag1 = false;
  69. for ( var i = 0; i < rowsLength; i++) {
  70. ids += rows[i].FD_OBJECTID243 + ",";
  71. if(rows[i].COLUMN_3_243=="1"&&flag=="0"){
  72. if(rowsLength==1){
  73. top.Dialog.alert("您选中的记录已发布,不能删除!");
  74. }else{
  75. top.Dialog.alert("您选中的记录中有已发布的,不能删除!");
  76. }
  77. return;
  78. }
  79. if(getUser_id!=rows[i].TYPEIN_PEOPLE_243&&flag=="0"){
  80. if(rowsLength==1){
  81. top.Dialog.alert("您只能删除您自己上传的文件记录!");
  82. }else{
  83. top.Dialog.alert("您只能删除您自己上传的文件记录!");
  84. }
  85. return;
  86. }
  87. var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  88. if(rows[i].UNITE_243 != dpids){
  89. top.Dialog.alert("只能删除本级单位的文件!");
  90. return;
  91. }
  92. $.ajax({
  93. url : $.pathname() + '/ws/crud/CRUDService/getDataById/',
  94. type : 'post',
  95. timeout : 60000,
  96. data : { classid : '800', objectID : rows[i].UNITE_243 },
  97. async:false, //异步
  98. dataType : 'json',
  99. success : function(data){
  100. if(data.DEPT_LEVEL_800<dept_level){
  101. flag1 = true;
  102. }
  103. },
  104. error : function(e){
  105. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  106. }
  107. });
  108. }
  109. if(flag1){
  110. top.Dialog.alert("不能删除上级的记录!");
  111. return;
  112. }else{
  113. top.Dialog.confirm("确定要删除吗?|删除", function() {
  114. // 删除记录
  115. $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
  116. "objectIDs" : ids,
  117. classid : 243
  118. }, function(result) {
  119. if (result.Msg.sucsess == true) {
  120. $.messager.alert("删除成功",null,null,null,1);
  121. // 刷新表格数据
  122. _this.listGrid.rend();
  123. } else {
  124. top.Dialog.alert("删除失败!");
  125. }
  126. }, "json");
  127. });
  128. }
  129. };
  130. /** **查看详细信息*** */
  131. _this.show = function() {
  132. var rows = _this.listGrid.getSelectedRows();
  133. var rowsLength = rows.length;
  134. if (rowsLength == 0) {
  135. top.Dialog.alert("请选中要查看的记录!");
  136. return;
  137. } else if (rowsLength > 1) {
  138. top.Dialog.alert("请选中一条要查看的记录!");
  139. return;
  140. } else {
  141. var fd_id = _this.listGrid.getSelectedRow().FD_OBJECTID243;
  142. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_view.jsp?"+fd_id);
  143. }
  144. };
  145. //点击主键跳转详细信息页面
  146. _this.openDetail = function(rowindex) {
  147. var row = _this.listGrid.getRow(rowindex);
  148. var fd_id = row.FD_OBJECTID243;
  149. // $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_view.jsp?"+fd_id);
  150. $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/laws/laws_view.jsp?"+fd_id);
  151. };
  152. /** **历史版本*** */
  153. _this.onhistory = function() {
  154. var rows = _this.listGrid.getSelectedRows();
  155. if(rows.length==0){
  156. top.Dialog.alert("请选择一条记录");
  157. return;
  158. }
  159. if(rows.length>1){
  160. top.Dialog.alert("只能选择一条记录");
  161. return;
  162. }
  163. //上一个版本的预案ID
  164. // var fd_id = rows[0].OBJ_FIRST_243;
  165. var fd_id = rows[0].FD_OBJECTID243;
  166. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_version.jsp?"+fd_id);
  167. };
  168. /** 切换显示法律法规* */
  169. _this.showSameLevel = function() {
  170. var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  171. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+"";
  172. if(zTreeCompId == ""){
  173. top.Dialog.alert("请在左侧菜单选择单位再查看法律法规!");
  174. return;
  175. }
  176. var condition = "";
  177. clickNum++;
  178. if(zTreeCompId==dpids){//点击本单位时
  179. //condition = "is_del='0' and(COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE in (select dept_id from SYS_DEPARTMENT where is_del ='0' and dept_type='1' start with dept_id='"+dpids+"' connect by prior parent_id = dept_id)";
  180. if(clickNum % 2 !=0){
  181. $("#10007").addClass("blue");
  182. $("#10007 span").text("查看本级单位法律法规(含下级)");
  183. condition = "is_del='0' and(COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE ='"+dpids+"' ";
  184. }else{
  185. $("#10007").removeClass("blue");
  186. $("#10007 span").text("查看本级单位法律法规");
  187. condition = "is_del='0' and(COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE IN(select dept_id from sys_department where dept_path like '%"+dpids+"%' and dept_type='1')";
  188. }
  189. }else{
  190. if(clickNum % 2 !=0){
  191. $("#10007").addClass("blue");
  192. $("#10007 span").text("查看本级单位法律法规(含下级)");
  193. condition = "is_del='0' and COLUMN_3='1' and UNITE='"+zTreeCompId+"' ";
  194. }else{
  195. $("#10007").removeClass("blue");
  196. $("#10007 span").text("查看本级单位法律法规");
  197. condition = "is_del='0' and COLUMN_3='1' and UNITE IN ( select dept_id from sys_department where dept_path like '%"+zTreeCompId+"%' and dept_type='1')";
  198. }
  199. }
  200. // 当登录人单位 是地级市或者县级市时 点击省公司或者其上级单位 只显示那一级的本级的数据 不显示同级数据
  201. if((dept_level>2 && treeNode.id==parent_Id)||(dept_level>2 && zTreeCompId=="C984DC9C294A486096C25FAA78C99AED")){
  202. if(zTreeCompId==dpids){
  203. condition = "is_del='0' and(COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE ='"+dpids+"' ";
  204. }else{
  205. condition = "is_del='0' and COLUMN_3='1' and UNITE='"+zTreeCompId+"'";
  206. }
  207. }
  208. listGrid.setOptions({//重置加载列表的参数
  209. params : {
  210. "listId" :'243' ,
  211. "condition" : condition,
  212. direction:'DESC',
  213. sort: 'UPDATEDATE'
  214. }
  215. });
  216. listGrid.rend();
  217. }
  218. /** **导出*** */
  219. _this.exportTotalData = function() {
  220. var rows = _this.listGrid.getSelectedRows();
  221. var rowsLength = rows.length;
  222. if (rowsLength == 0) {
  223. top.Dialog.confirm("是否导出所有的文件信息?|是", function() {
  224. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+"";
  225. var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  226. var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
  227. var loadParams ={
  228. "listId" :'243' ,
  229. // "condition" : "is_del='0' and(COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE in (select dept_id from SYS_DEPARTMENT where is_del ='0' and dept_type='1' start with dept_id='"+dpids+"' connect by prior parent_id = dept_id) ",
  230. "condition" : "is_del='0' and(COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE ='"+dpids+"' ",
  231. direction:'DESC',
  232. sort: 'UPDATEDATE'
  233. };
  234. excelExport(243,loadParams,"应急制度文件信息","IS_DEL,UPDATEDATE,FD_OBJECTID,COLUMN_1,COLUMN_2,COLUMN_3,COLUMN_4,OBJ_FIRST,VERSION,TYPEIN_PEOPLE_PHONE_NUM");
  235. });
  236. return;
  237. }
  238. var ids = "";
  239. for ( var i = 0; i < rowsLength; i++) {
  240. ids += "'"+rows[i].FD_OBJECTID243+"'" + ",";
  241. }
  242. var temp = ids.substring(0,ids.length-1);
  243. var condition = " IS_DEL='0' ";
  244. condition += " AND FD_OBJECTID IN (" + temp + ") " ; //'%" +name+"%';
  245. var sql = {
  246. "listId" :'243' ,
  247. "condition" : condition,
  248. direction:'DESC',
  249. sort: 'UPDATEDATE'
  250. };
  251. excelExport(243,sql,"应急制度文件","IS_DEL,UPDATEDATE,FD_OBJECTID,COLUMN_1,COLUMN_2,COLUMN_3,COLUMN_4,OBJ_FIRST,VERSION,TYPEIN_PEOPLE_PHONE_NUM");
  252. };
  253. /** 导入 */
  254. _this.showImportDialog = function() {
  255. window.location.href="laws-import.jsp";
  256. };
  257. /************************************** **下载*** *************************************************/
  258. _this.onDownLoad = function() {
  259. //批量打包下载
  260. var FD_OBJECTID = "";
  261. var rows = _this.listGrid.getSelectedRows();
  262. if(rows.length==0){
  263. top.Dialog.alert("请选择一条记录");
  264. return;
  265. }
  266. for (var i = 0; i < rows.length; i++) {
  267. var FD_OBJECTID1= rows[i].FD_OBJECTID243;//预案的主键
  268. FD_OBJECTID += "'"+FD_OBJECTID1+"'" + ",";//预案的主键(复数)
  269. }
  270. var temp = FD_OBJECTID.substring(0,FD_OBJECTID.length-1);
  271. //发送请求,获取文件名的集合。
  272. var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getPlanFile/';
  273. var params = {
  274. fileId : temp
  275. };
  276. var SAVENAME1="";
  277. var NAME1 = "";
  278. var FILEEXT1="";
  279. $.ajax({
  280. url : url,
  281. type : 'post',
  282. timeout : 60000,
  283. data : params,
  284. dataType : 'json',
  285. success : function(data){
  286. var dataLenth = data.rows.length;
  287. var filenames="";
  288. var downfilename = "";
  289. for (var i = 0; i < dataLenth; i++) {
  290. SAVENAME1= data.rows[i].SAVENAME;
  291. NAME1= data.rows[i].NAME;
  292. FILEEXT1= data.rows[i].FILEEXT;
  293. filenames +=SAVENAME1 + "." + FILEEXT1 + ";";
  294. downfilename+=NAME1 + "." + FILEEXT1 + ";";
  295. }
  296. var filenames1 = filenames.substring(0,filenames.length-1);
  297. filenames = decodeURI(filenames1);
  298. var downfilename1 = downfilename.substring(0,downfilename.length-1);
  299. downfilename = decodeURI(downfilename1);
  300. showFile(filenames1,downfilename1);
  301. //alert(downfilename1+"============"+filenames1);
  302. //返回回调打包下载的函数,拼传给回调函数的filenames,downfilename
  303. },
  304. error : function(e){
  305. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  306. }
  307. });
  308. };
  309. function showFile(downfilename,filenames){
  310. var url = "/nwyj/page/business/am/org/query/getZipFile.jsp?downfilename="+downfilename+"&filenames="+filenames;
  311. window.open(url);
  312. }
  313. /****************************************************end******************************************************/
  314. /** **统计*** */
  315. _this.sum = function() {
  316. window.location.href="laws_poll.jsp";
  317. };
  318. // 查询
  319. // function search() {
  320. //
  321. // if($("#LAWS_REGULATIONS_NAME_243").val()=="法律法规"){
  322. // $("#LAWS_REGULATIONS_NAME_243").val("");
  323. // }
  324. // $queryForm.serialize();
  325. // var $comp_id = $("#selectConditions").find(".UNITE");
  326. // var loadParams11;
  327. // //判断是否有用单位做查询条件
  328. // if(!!$comp_id.prop("outerHTML")){
  329. //
  330. // loadParams11 = {
  331. // "listId" : '243',
  332. // "condition" : " IS_DEL='0' AND COLUMN_3='1' ",
  333. // direction:'DESC',
  334. // sort: 'UPDATEDATE'
  335. // };
  336. // }else{
  337. //
  338. // loadParams11 = $.extend({},_this.loadParams,loadParams);
  339. // }
  340. // var searchCondition = getSelectCon(conditionData);
  341. // var queryParams = getQueryFormParams($queryForm);
  342. // var params=$.extend({},loadParams11,queryParams);// 默认
  343. // params.condition = searchCondition.condition + params.condition;
  344. // _this.exportParams = params;
  345. // _this.listGrid.setOptions( {
  346. // params : params
  347. // });
  348. // _this.listGrid.rend();//加载数据
  349. // }
  350. function search(){
  351. if($("#LAWS_REGULATIONS_NAME").val()=="法律法规"){
  352. $("#LAWS_REGULATIONS_NAME").val("");
  353. }
  354. var name = $("#LAWS_REGULATIONS_NAME").val();
  355. //部门id
  356. var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  357. //登录人ID
  358. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+"";
  359. //父部门id
  360. var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
  361. $queryForm.serialize();
  362. var $comp_id = $("#selectConditions").find(".UNITE");
  363. var loadParams11;
  364. //判断是否有用单位做查询条件
  365. if(!!$comp_id.prop("outerHTML")){
  366. if(name!=""){
  367. loadParams11 = {
  368. "listId" : '243',
  369. "condition" : " IS_DEL='0' AND (COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and (ISSUE_ORGANIZATION like '%"+name+"%' or LAWS_REGULATIONS_NAME like '%"+name+"%' or ISSUE_ARTICLE_NUM like '%"+name+"%' or ISSUE_DATE like '%"+name+"%' or IMPLEMENT_DATE like '%"+name+"%' or DESCRIPTION like '%"+name+"%')",
  370. direction:'DESC',
  371. sort: 'UPDATEDATE'
  372. };
  373. }else{
  374. loadParams11 = {
  375. "listId" : '243',
  376. "condition" : " IS_DEL='0' AND (COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) ",
  377. direction:'DESC',
  378. sort: 'UPDATEDATE'
  379. };
  380. }
  381. }else{
  382. if(name==""){
  383. loadParams11 = $.extend({},_this.loadParams,loadParams);
  384. }else{
  385. loadParams11 = {
  386. "listId" : '243',
  387. "condition" : " is_del='0' and (COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE in (select dept_id from SYS_DEPARTMENT where is_del ='0' and dept_type='1' start with dept_id='"+dpids+"' connect by prior parent_id = dept_id) and (ISSUE_ORGANIZATION like '%"+name+"%' or LAWS_REGULATIONS_NAME like '%"+name+"%' or ISSUE_ARTICLE_NUM like '%"+name+"%' or ISSUE_DATE like '%"+name+"%' or IMPLEMENT_DATE like '%"+name+"%' or DESCRIPTION like '%"+name+"%')",
  388. direction:'DESC',
  389. sort: 'UPDATEDATE'
  390. };
  391. }
  392. }
  393. var searchCondition = getSelectCon(conditionData);
  394. var ff = searchCondition.condition.split("and");
  395. var queryParams = getQueryFormParams($queryForm);
  396. var params=$.extend({},loadParams11,queryParams);// 默认
  397. params.condition = searchCondition.condition + params.condition;
  398. _this.exportParams = params;
  399. _this.listGrid.setOptions( {
  400. params : params
  401. });
  402. _this.listGrid.rend();//加载数据
  403. };
  404. _this.searchHandler2 = function(){
  405. if($("#LAWS_REGULATIONS_NAME").val()=="请输入法律法规名称"){
  406. $("#LAWS_REGULATIONS_NAME").val("");
  407. }
  408. //部门id
  409. var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  410. //登录人ID
  411. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+"";
  412. //父部门id
  413. var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
  414. var name = $("#LAWS_REGULATIONS_NAME").val();
  415. var TAKE_DATE1 = $('#TAKE_DATE1').val();
  416. var TAKE_DATE2 = $('#TAKE_DATE2').val();
  417. var ISSUE_DATE1 = $('#ISSUE_DATE1').val();
  418. var ISSUE_DATE2 = $('#ISSUE_DATE2').val();
  419. var ISSUE_ORGANIZATION = $("#ISSUE_ORGANIZATION").val();
  420. var condition = "";
  421. if(zTreeCompId=="" || zTreeCompId==dpids){
  422. if(clickNum % 2 !=0){
  423. condition = "is_del='0' and(COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE ='"+dpids+"' ";
  424. }else{
  425. condition = "is_del='0' and(COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE IN(select dept_id from sys_department where dept_path like '%"+dpids+"%' and dept_type='1') ";
  426. }
  427. }else{
  428. if(clickNum % 2 !=0){
  429. condition = "is_del='0' and COLUMN_3='1' and UNITE='"+zTreeCompId+"' ";
  430. }else{
  431. condition = "is_del='0' and COLUMN_3='1' and UNITE IN(select dept_id from sys_department where dept_path like '%"+zTreeCompId+"%' and dept_type='1') ";
  432. }
  433. }
  434. if(name!=""){
  435. condition += " AND LAWS_REGULATIONS_NAME LIKE '%" +name+"%'";
  436. }
  437. if(ISSUE_ORGANIZATION!=""){
  438. condition += " AND ISSUE_ORGANIZATION LIKE '%" +ISSUE_ORGANIZATION+"%'";
  439. }
  440. /***************时间*******************/
  441. if((TAKE_DATE1!=""&&TAKE_DATE2=="")||(TAKE_DATE1==""&&TAKE_DATE2!="")){
  442. top.Dialog.alert("发布日期的开始日期或结束日期不能为空");
  443. return;
  444. }else if(TAKE_DATE1>TAKE_DATE2){
  445. top.Dialog.alert("发布日期的开始日期不能晚于结束日期");
  446. return;
  447. }else if(TAKE_DATE1!=""&&TAKE_DATE2!=""){
  448. condition += " AND ISSUE_DATE BETWEEN '"+TAKE_DATE1+"' AND '"+TAKE_DATE2+"' ";
  449. }
  450. if((ISSUE_DATE1!=""&&ISSUE_DATE2=="")||(ISSUE_DATE1==""&&ISSUE_DATE2!="")){
  451. top.Dialog.alert("实施日期的开始日期或结束日期不能为空");
  452. return;
  453. }else if(ISSUE_DATE1>ISSUE_DATE2){
  454. top.Dialog.alert("实施日期的开始日期不能晚于结束日期");
  455. return;
  456. }else if(ISSUE_DATE1!=""&&ISSUE_DATE2!=""){
  457. condition += " AND IMPLEMENT_DATE BETWEEN '"+ISSUE_DATE1+"' AND '"+ISSUE_DATE2+"' ";
  458. }
  459. /****************复选框查询******************/
  460. //分类
  461. var CLASSES = "";
  462. $("input:checkbox[name=CLASSES]").each(function(){
  463. if($(this).attr("checked")){
  464. if($(this).val()=="0000"){
  465. CLASSES += " CLASSES = '1' or CLASSES = '2' or CLASSES = '3' or CLASSES = '4' or CLASSES = '5' or ";
  466. }else{
  467. CLASSES += "CLASSES = '" + $(this).val() +"' or ";
  468. }
  469. }
  470. });
  471. if(CLASSES!=""){
  472. CLASSES = CLASSES.substring(0,CLASSES.lastIndexOf("or"));
  473. condition += " and ("+CLASSES+") ";
  474. }
  475. //状态
  476. var STATE = "";
  477. $("input:checkbox[name=STATE]").each(function(){
  478. if($(this).attr("checked")){
  479. if($(this).val()=="0000"){
  480. STATE += " STATE = '1' or STATE = '2' or STATE = '3' or STATE = '4' or STATE = '5' or ";
  481. }else{
  482. STATE += "STATE = '" + $(this).val() +"' or ";
  483. }
  484. }
  485. });
  486. if(STATE!=""){
  487. STATE = STATE.substring(0,STATE.lastIndexOf("or"));
  488. condition += " and ("+STATE+") ";
  489. }
  490. //发布情况
  491. var COLUMN_3 = "";
  492. $("input:checkbox[name=COLUMN_3]").each(function(){
  493. if($(this).attr("checked")){
  494. if($(this).val()=="0000"){
  495. COLUMN_3 += " COLUMN_3 = '1' or COLUMN_3 = '0' or ";
  496. }else{
  497. COLUMN_3 += "COLUMN_3 = '" + $(this).val() +"' or ";
  498. }
  499. }
  500. });
  501. if(COLUMN_3!=""){
  502. COLUMN_3 = COLUMN_3.substring(0,COLUMN_3.lastIndexOf("or"));
  503. condition += " and ("+COLUMN_3+") ";
  504. }
  505. // $queryForm.serialize();
  506. // var $comp_id = $("#selectConditions").find(".UNITE");
  507. // var loadParams11;
  508. // //判断是否有用单位做查询条件
  509. // if(!!$comp_id.prop("outerHTML")){
  510. // if(name!=""){
  511. // loadParams11 = {
  512. // "listId" : '243',
  513. // "condition" : " IS_DEL='0' AND COLUMN_3='1' and (ISSUE_ORGANIZATION like '%"+name+"%' or LAWS_REGULATIONS_NAME like '%"+name+"%' or ISSUE_ARTICLE_NUM like '%"+name+"%' or ISSUE_DATE like '%"+name+"%' or IMPLEMENT_DATE like '%"+name+"%' or DESCRIPTION like '%"+name+"%')",
  514. // direction:'DESC',
  515. // sort: 'UPDATEDATE'
  516. // };
  517. // }else{
  518. // loadParams11 = {
  519. // "listId" : '243',
  520. // "condition" : " IS_DEL='0' AND COLUMN_3='1' ",
  521. // direction:'DESC',
  522. // sort: 'UPDATEDATE'
  523. // };
  524. // }
  525. // }else{
  526. // if(name==""){
  527. // loadParams11 = $.extend({},_this.loadParams,loadParams);
  528. // }else{
  529. // loadParams11 = {
  530. // "listId" : '243',
  531. // "condition" : " is_del='0' and (COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE in (select dept_id from SYS_DEPARTMENT where is_del ='0' and dept_type='1' start with dept_id='"+dpids+"' connect by prior parent_id = dept_id) and (ISSUE_ORGANIZATION like '%"+name+"%' or LAWS_REGULATIONS_NAME like '%"+name+"%' or ISSUE_ARTICLE_NUM like '%"+name+"%' or ISSUE_DATE like '%"+name+"%' or IMPLEMENT_DATE like '%"+name+"%' or DESCRIPTION like '%"+name+"%')",
  532. // direction:'DESC',
  533. // sort: 'UPDATEDATE'
  534. // };
  535. // }
  536. //
  537. // }
  538. // var searchCondition = getSelectCon(conditionData);
  539. // var queryParams = getQueryFormParams($queryForm);
  540. // var params=$.extend({},loadParams11,queryParams);// 默认
  541. // params.condition = searchCondition.condition + params.condition;
  542. // _this.exportParams = params;
  543. // _this.listGrid.setOptions( {
  544. // params : params
  545. // });
  546. _this.listGrid.setOptions({//重置加载列表的参数
  547. params : {
  548. "listId" :'243' ,
  549. "condition" : condition,
  550. direction:'DESC',
  551. sort: 'UPDATEDATE'
  552. }
  553. });
  554. _this.listGrid.rend();//加载数据
  555. };
  556. function more() {
  557. $('#moreDiv').toggle(400,function(){
  558. // $("#emptyCondition").click();
  559. // $(parent.document.body).find("#frmright").height($(window.document.body).height()+30);
  560. // setHt();
  561. checkAndSetHeight();//changeFormat.js
  562. });
  563. }
  564. function setHt(){
  565. /* alert($("#layout1 .padding_right5").height())
  566. alert($("#layout1 .selDiv").height());
  567. alert($(".l-layout-left").height()); */
  568. var leftHeight = $(".layout_content").height()+70;
  569. var rightHeight = $("#layout1 .padding_right5").height()+$("#layout1 #moreDiv").height()+70;
  570. var height = leftHeight>rightHeight?leftHeight:rightHeight;
  571. $(top.document.body).find("#frmright").height($(window.document.body).height(height)+30);
  572. }
  573. /*// 更多
  574. function more() {
  575. $('#moreDiv').toggle();
  576. $(parent.document.body).find("#frmright").height($(window.document.body).height());
  577. }*/
  578. /*************************************************************************************************/
  579. //发布 单一
  580. _this.fabu = function(data) {
  581. var row = _this.listGrid.getRow(data);
  582. var fd_id = row.FD_OBJECTID243+",";
  583. //只能发布自己上传的文件
  584. var userId = row.TYPEIN_PEOPLE_243;
  585. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  586. if(getUser_id!=userId){
  587. top.Dialog.alert("只能发布自己上传的文件!");
  588. return;
  589. }
  590. top.Dialog.confirm("确定要发布吗?|发布", function() {
  591. // 发布规范文件
  592. $.post($.pathname() +"/ws/LAWSPOLL/LawsService/LawsFabu/", {
  593. fd_id : fd_id,
  594. }, function(result) {
  595. if (result.Msg.sucsess == true) {
  596. top.Dialog.alert("发布成功",null,null,null,1);
  597. // 刷新表格数据
  598. _this.listGrid.rend();
  599. } else {
  600. top.Dialog.alert("发布失败!");
  601. }
  602. }, "json");
  603. });
  604. };
  605. //发布 批量
  606. _this.onPublish = function() {
  607. var rows = _this.listGrid.getSelectedRows();
  608. var rowsLength = rows.length;
  609. if (rowsLength == 0) {
  610. top.Dialog.alert("请选中要发布的记录!");
  611. return;
  612. }
  613. var ids = "";
  614. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  615. for ( var i = 0; i < rowsLength; i++) {
  616. ids += rows[i].FD_OBJECTID243 + ",";
  617. if(rows[i].COLUMN_3_243=="1"){
  618. if(rowsLength==1){
  619. top.Dialog.alert("您选中的记录已经发布!");
  620. }else{
  621. top.Dialog.alert("您选中的记录有已经发布的!");
  622. }
  623. return;
  624. }
  625. if(getUser_id!=rows[i].TYPEIN_PEOPLE_243){
  626. if(rowsLength==1){
  627. top.Dialog.alert("您选中的记录不是您自己上传的文件记录,请选择您自己上传的文件记录!");
  628. }else{
  629. top.Dialog.alert("您选中的记录有不是您自己上传的文件记录,请选择您自己上传的文件记录!");
  630. }
  631. return;
  632. }
  633. }
  634. top.Dialog.confirm("确定要发布吗?|发布", function() {
  635. $.post($.pathname() +"/ws/LAWSPOLL/LawsService/LawsFabu/", {
  636. fd_id : ids,
  637. }, function(result) {
  638. if (result.Msg.sucsess == true) {
  639. $.messager.alert("发布成功",null,null,null,-1);
  640. // 刷新表格数据
  641. _this.listGrid.rend();
  642. } else {
  643. top.Dialog.alert("发布失败!");
  644. }
  645. }, "json");
  646. });
  647. };
  648. //共享 单一
  649. _this.gongxiang = function(data) {
  650. var row = _this.listGrid.getRow(data);
  651. var fd_id = row.FD_OBJECTID243+",";
  652. //只能共享以及发布的文件
  653. if(row.COLUMN_3_243!="1"){
  654. top.Dialog.alert("只能共享已经发布的文件!");
  655. return;
  656. }
  657. //只能共享自己上传的文件
  658. // var userId = row.TYPEIN_PEOPLE_243;
  659. // var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  660. // if(getUser_id!=userId){
  661. // top.Dialog.alert("只能共享自己上传的文件!");
  662. // return;
  663. // }
  664. if(dept_level!="1"){
  665. if(dept_level!="2"){
  666. top.Dialog.alert("只有省级用户才能共享!");
  667. return;
  668. }else{
  669. var userDept_id = row.UNITE_243;
  670. var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  671. if(userDept_id==dpids){
  672. top.Dialog.alert("省公司的文件只有网公司有权决定是否共享!");
  673. return;
  674. }
  675. }
  676. }
  677. top.Dialog.confirm("确定要共享吗?|共享", function() {
  678. // 发布规范文件
  679. $.post($.pathname() +"/ws/LAWSPOLL/LawsService/LawsShare/", {
  680. fd_id : fd_id,
  681. }, function(result) {
  682. if (result.Msg.sucsess == true) {
  683. top.Dialog.alert("共享成功",null,null,null,1);
  684. // 刷新表格数据
  685. _this.listGrid.rend();
  686. } else {
  687. top.Dialog.alert("共享失败!");
  688. }
  689. }, "json");
  690. });
  691. };
  692. //共享 批量
  693. _this.publicShare = function() {
  694. var rows = _this.listGrid.getSelectedRows();
  695. var rowsLength = rows.length;
  696. if (rowsLength == 0) {
  697. top.Dialog.alert("请选中要共享的记录!");
  698. return;
  699. }
  700. var ids = "";
  701. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  702. for ( var i = 0; i < rowsLength; i++) {
  703. ids += rows[i].FD_OBJECTID243 + ",";
  704. if(rows[i].COLUMN_4_243=="1"){
  705. if(rowsLength==1){
  706. top.Dialog.alert("您选中的记录已经共享!");
  707. }else{
  708. top.Dialog.alert("您选中的记录有已经共享的!");
  709. }
  710. return;
  711. }
  712. if(rows[i].COLUMN_3_243!="1"){
  713. if(rowsLength==1){
  714. top.Dialog.alert("您选中的记录还没有发布!");
  715. }else{
  716. top.Dialog.alert("您选中的记录中有还没有发布的!");
  717. }
  718. return;
  719. }
  720. if(getUser_id!=rows[i].TYPEIN_PEOPLE_243){
  721. if(rowsLength==1){
  722. top.Dialog.alert("您选中的记录不是您自己上传的文件记录,请选择您自己上传的文件记录!");
  723. }else{
  724. top.Dialog.alert("您选中的记录有不是您自己上传的文件记录,请选择您自己上传的文件记录!");
  725. }
  726. return;
  727. }
  728. }
  729. top.Dialog.confirm("确定要共享吗?|共享", function() {
  730. $.post($.pathname() +"/ws/LAWSPOLL/LawsService/LawsShare/", {
  731. fd_id : ids,
  732. }, function(result) {
  733. if (result.Msg.sucsess == true) {
  734. $.messager.alert("共享成功",null,null,null,-1);
  735. // 刷新表格数据
  736. _this.listGrid.rend();
  737. } else {
  738. top.Dialog.alert("共享失败!");
  739. }
  740. }, "json");
  741. });
  742. };
  743. //撤销共享
  744. _this.gongxiang1 = function(data){
  745. var row = _this.listGrid.getRow(data);
  746. var fd_id = row.FD_OBJECTID243+",";
  747. //只能撤销自己上传的文件
  748. var userId = row.TYPEIN_PEOPLE_243;
  749. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  750. if(getUser_id!=userId){
  751. top.Dialog.alert("只能撤销自己上传的文件!");
  752. return;
  753. }
  754. top.Dialog.confirm("确定要撤销共享吗?|撤销", function() {
  755. // 发布规范文件
  756. $.post($.pathname() +"/ws/LAWSPOLL/LawsService/noLawsShare/", {
  757. fd_id : fd_id,
  758. }, function(result) {
  759. if (result.Msg.sucsess == true) {
  760. top.Dialog.alert("撤销成功",null,null,null,1);
  761. // 刷新表格数据
  762. _this.listGrid.rend();
  763. } else {
  764. top.Dialog.alert("撤销失败!");
  765. }
  766. }, "json");
  767. });
  768. };
  769. //撤销发布
  770. _this.noPublish = function() {
  771. var rows = _this.listGrid.getSelectedRows();
  772. var rowsLength = rows.length;
  773. if (rowsLength == 0) {
  774. top.Dialog.alert("请选中要撤销的记录!");
  775. return;
  776. } else if (rowsLength > 1) {
  777. top.Dialog.alert("请选中一条要撤销的记录!");
  778. return;
  779. }
  780. var ids = "";
  781. var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  782. for ( var i = 0; i < rowsLength; i++) {
  783. if(rows[i].UNITE_243 != dpids){
  784. top.Dialog.alert("只能撤销本级单位的文件!");
  785. return;
  786. }
  787. ids += rows[i].FD_OBJECTID243 + ",";
  788. if(rows[i].COLUMN_3_243!="1"){
  789. top.Dialog.alert("您选中的记录还没有发布!");
  790. return;
  791. }
  792. }
  793. top.Dialog.confirm("确定要撤销发布吗?|撤销", function() {
  794. $.post($.pathname() +"/ws/LAWSPOLL/LawsService/noLawsFabu/", {
  795. fd_id : ids,
  796. }, function(result) {
  797. if (result.Msg.sucsess == true) {
  798. $.messager.alert("撤销成功",null,null,null,-1);
  799. // 刷新表格数据
  800. _this.listGrid.rend();
  801. } else {
  802. top.Dialog.alert("撤销失败!");
  803. }
  804. }, "json");
  805. });
  806. };
  807. /*************************************************************************************************/
  808. return {
  809. init : function() {
  810. $queryForm = $("#queryForm");
  811. /** 绑定查询面板的按钮点击事件* */
  812. // $searchButt = $("#searchButt");// 查询按钮
  813. // $searchButt.bind('click', function() {
  814. // search();
  815. // });
  816. // $searchButt = $("#searchButt");// 更多查询按钮
  817. // $searchButt.live('click', function() {
  818. // search();
  819. // });
  820. $searchOne = $("#searchOne");//查询图标绑定查询事件
  821. $searchOne.bind('click', function() {
  822. searchHandler2();
  823. });
  824. /** 绑定更多的按钮点击事件 */
  825. $more = $("#more"); // 更多按钮
  826. $more.bind('click', function() {
  827. more();
  828. });
  829. //部门id
  830. var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  831. //取得用户真实姓名
  832. var realname = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  833. //登录人ID
  834. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+"";
  835. //登陆用户的单位名称
  836. var corp_name = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  837. //父部门id
  838. var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
  839. $("body").eq(0).showLoading();
  840. // 列表加载参数
  841. _this.loadParams = {
  842. listId : '243',
  843. direction:'DESC',
  844. sort: 'EMC_AM_LAWS_REGULATIONS.UPDATEDATE',
  845. //sublist:' left join ECM_EM_TREATED_HUMAN',
  846. //subCondition:' on ECM_EM_PUBLISH_ALERT_NOTICE.FD_OBJECTID=ECM_EM_TREATED_HUMAN.BUSINESS_ID ',
  847. //condition : " EMC_AM_LAWS_REGULATIONS.is_del='0' "
  848. // condition : "is_del='0' and(COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE in (select dept_id from SYS_DEPARTMENT where is_del ='0' and dept_type='1' start with dept_id='"+dpids+"' connect by prior parent_id = dept_id)"
  849. condition : "is_del='0' and(COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE ='"+dpids+"' "
  850. };
  851. var roleCons = roleButtonArr();
  852. /** grid载入数据* */
  853. var toolBarOpt1 = {
  854. items : [ {text : '新增',click : 'addForm',iconClass : 'add1_tem',id : 'wjxz'},
  855. {text : '删除',click : 'del',iconClass : 'delete_tem',id : 'wjsc'},
  856. {text : '修改',click : 'editForm',iconClass : 'update_tem',id : 'wjxg'},
  857. // {text : '查看',click : 'show',iconClass : 'view_tem',id : '10003'},
  858. // {text : '历史版本',click:"onhistory",iconClass: 'history_tem',id:"10201" },
  859. {text : '导入', click: "showImportDialog", iconClass: 'import_tem' ,id:"wjdr"},
  860. {text : '导出',click:"exportTotalData",iconClass: 'export_tem',id:"10006"},
  861. // {text : '下载',click:"onDownLoad",iconClass: 'download_tem',id:"10007" },
  862. {text : '汇总',click: "sum", iconClass: 'poll_tem' ,id:"10200"},
  863. // {text : '发布',click: "onPublish", iconClass: 'release_tem' ,id:"wjfb"},
  864. //{text : '共享',click: "publicShare", iconClass: 'share_tem' ,id:"10200"},
  865. {text : '撤销',click: "noPublish", iconClass: 'retract_tem' ,id:"10215"},
  866. {text : '查看本级单位法律法规',click: "showSameLevel", iconClass: 'poll_tem' ,id:"10007"}
  867. ],
  868. roleCons:roleCons
  869. };
  870. var grid_option1={
  871. columns : [
  872. {display : '名称', name : 'LAWS_REGULATIONS_NAME_243', align : 'left',width : "15%",isPrimaryKey:true,
  873. // render : function(rowdata, value) {
  874. // return '<a href="javascript:void(0)" '
  875. // + 'onclick=jumpPage("'
  876. // + rowdata.FD_OBJECTID243
  877. // +'")>'+ rowdata.LAWS_REGULATIONS_NAME_243 +'</a>';
  878. // }
  879. render : function(rowdata, rowindex, value, column) {
  880. return "<a href='javascript:;' style='width:100%;height:100%;display:block' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
  881. }
  882. },
  883. {display : '颁布机构', name : 'ISSUE_ORGANIZATION_243', align : 'center',width : "15%",showTitle:true},
  884. {display : '颁布文号', name : 'ISSUE_ARTICLE_NUM_243', align : 'center',width : "10%",showTitle:true},
  885. {display : '发布日期', name : 'ISSUE_DATE_243', align : 'center',width : "10%",showTitle:true},
  886. {display : '填写人员', name : 'TYPEIN_PEOPLE_243_SHOW', align : 'center',width : "10%",showTitle:true},
  887. // {display : '录入人联系方式', name : 'TYPEIN_PEOPLE_PHONE_NUM_243',align : 'center',width : "10%",showTitle:true},
  888. {display : '实施日期', name : 'IMPLEMENT_DATE_243', align : 'center',width : "10%",showTitle:true} ,
  889. {display : '单位', name : 'UNITE_243_SHOW', align : 'center',width : "10%",showTitle:true} ,
  890. // {display : '部门', name : 'DEPT_243_SHOW', align : 'center',width : "10%",showTitle:true} ,
  891. {display : '状态', name : 'STATE_243_SHOW', align : 'center',width : "5%",showTitle:true},
  892. { display: '附件', isAllowHide: false, align: 'center', width:"5%",
  893. render: function (rowdata, rowindex, value, column){
  894. //判断是否有上传附件
  895. var fujian = '';
  896. if(ontest(rowdata.FD_OBJECTID_243)){
  897. fujian = '<span class="sendup_leaf hand" title="有附件" onclick="showFile(' + rowindex + ')"></span>';
  898. }else{
  899. fujian = '<span title="没附件" style="color: red">没有附件</span>';
  900. }
  901. return fujian;
  902. }
  903. },
  904. {display : '操作', isAllowHide: false, align : 'center', width:'10%',
  905. render: function (rowdata, rowindex, value, column){
  906. //判断是否已经发布。取发布的状态,如果已经发布为“1”;未发布为“0”
  907. var fabu='';//fabu
  908. if(rowdata.COLUMN_3_243=="1"){
  909. fabu = '<span class="fashang_07 hand" title="发布" onclick="fabu1()"></span>';
  910. }else{
  911. fabu = '<span class="fashang_06 hand" title="发布" onclick="fabu(' + rowindex + ')"></span>';
  912. }
  913. //判断是否已经共享。取共享的状态,如果已经共享为“1”;未共享为“0”
  914. var gongxiang='';
  915. if(rowdata.COLUMN_4_243=="1"){
  916. gongxiang = '<span class="share_07 hand" title="撤销共享" onclick="gongxiang1(' + rowindex + ')"></span>';
  917. }else{
  918. gongxiang = '<span class="share_03 hand" title="共享" onclick="gongxiang(' + rowindex + ')"></span>';
  919. }
  920. return fabu + gongxiang;
  921. }
  922. }],
  923. /* detail: {
  924. //onShowDetail: showFlow,
  925. height: 'auto'
  926. },*/
  927. pageSize : 10,
  928. rownumbers : true,
  929. checkbox : true,
  930. percentWidthMode : true,
  931. onAfterShowData:function(data){
  932. setHt();
  933. }
  934. };
  935. var options1={
  936. url :'/nwyj/ws/crud/CRUDService/queryQui',
  937. params: _this.loadParams,
  938. height: '100%',
  939. width:"100%",
  940. gridOptions:grid_option1,
  941. singleRecodeOptions:{a:"aa"},
  942. paperOpration:{showInput:"true"},
  943. toolBarOptions:toolBarOpt1
  944. };
  945. _this.listGrid=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
  946. $("body").eq(0).hideLoading();
  947. }
  948. };
  949. }();
  950. $(function() {
  951. laws.init();
  952. // getCompName();
  953. /*$("#UNITE").OrgSel({selectedMulti : true,loadCorp:"loadCorp",setMulti : {
  954. "Y" : "s",
  955. "N" : ""
  956. }});*/
  957. getDeptLevel();
  958. });
  959. //判断是否有附件
  960. function ontest(id){
  961. var bean = false;
  962. $.ajax({
  963. url : $.pathname() +"/ws/DrillCount/DrillCountService/getIsNoFile/",
  964. type : 'post',
  965. timeout : 60000,
  966. data : { fd_id : id },
  967. dataType : 'json',
  968. async:false,//返回值时注意同步异步问题,此时是同步状态
  969. success : function(result){
  970. if (result.Msg.sucsess == true) {
  971. bean = true;
  972. }
  973. },
  974. error : function(e){
  975. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  976. }
  977. });
  978. return bean;
  979. }
  980. /**************2016-09-10 唐群胜 获取登陆人的级别*****************/
  981. var dept_level="";
  982. function getDeptLevel(){
  983. var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  984. $.ajax({
  985. url : $.pathname()+ "/ws/planService/PlanService/getDeptLevel",
  986. type : 'post',
  987. timeout : 60000,
  988. data : {id:dpids},
  989. dataType : 'text',
  990. success : function(data){
  991. dept_level=data;
  992. }
  993. });
  994. }
  995. //单击跳转
  996. function jumpPage(fd_id){
  997. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_view.jsp?"+fd_id);
  998. }
  999. function showPrimaryKey(obj,index){
  1000. var fd_id = obj.FD_OBJECTID243;
  1001. // $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_view.jsp?"+fd_id);
  1002. $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/laws/laws_view.jsp?"+fd_id);
  1003. }
  1004. function getCompName(){
  1005. var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  1006. var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getresourXj/';
  1007. var params = {
  1008. id : deptId,
  1009. value:"UNITE",
  1010. flag:"1"
  1011. };
  1012. $.ajax({
  1013. url : url,
  1014. type : 'post',
  1015. timeout : 60000,
  1016. data : params,
  1017. dataType : 'json',
  1018. success : function(data){
  1019. var conditionData3 = JSON.stringify(data);
  1020. var test = eval("("+conditionData3+")");
  1021. if(conditionData3!='{"list":[{"name":"查询单位","className":"UNITE","equalType":"equal","list":[]}]}'){
  1022. conditionData.list.push(test.list[0]);
  1023. }
  1024. createConditionsDom(conditionData);
  1025. $(".item").unbind("click").bind("click",bindSelectOne);
  1026. },
  1027. error : function(e){
  1028. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  1029. }
  1030. });
  1031. }
  1032. function fabu1(){
  1033. top.Dialog.alert("该文件已经发布!");
  1034. }
  1035. //清空
  1036. function resetSearch(){
  1037. $('#LAWS_REGULATIONS_NAME').val("");
  1038. $('#ISSUE_ORGANIZATION').val("");
  1039. $('#TAKE_DATE1').val("");
  1040. $('#TAKE_DATE2').val("");
  1041. $('#ISSUE_DATE1').val("");
  1042. $('#ISSUE_DATE2').val("");
  1043. $("input:checkbox[name=CLASSES]").attr("checked",false);
  1044. $("input:checkbox[name=STATE]").attr("checked",false);
  1045. $("input:checkbox[name=COLUMN_3]").attr("checked",false);
  1046. }
  1047. $.messager=top.Dialog;