65231773177431f95743fb26f07012e702142750.svn-base 35 KB

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