b93a41036275f235f2b921547101ed31198b5ab2.svn-base 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title></title>
  7. <%@include file="../../../../../include.jsp" %>
  8. <script type="text/javascript" src="/nwyj/scripts/business/em/report/utils.js"></script>
  9. <script type="text/javascript" src="/nwyj/scripts/business/em/report/checkTime.js"></script>
  10. <script type="text/javascript" src="<%=path%>/scripts/business/am/org/maintenance/orgSel.js"></script>
  11. <!--引用资源文件,JS CSS-->
  12. <link href="/nwyj/scripts/showLoading/showLoading.css" rel="stylesheet" type="text/css" />
  13. <script type="text/javascript" src="/nwyj/scripts/showLoading/jquery.showLoading.js"></script>
  14. <script type="text/javascript" src="/nwyj/scripts/business/em/alert/report/reportInputPlan/ReportInputPlanAddEdit.js"></script>
  15. <script type="text/javascript" src="<%=path%>/scripts/freamwork/com/sinosoft/system/invoking/invoking.js"></script>
  16. <style type="text/css">
  17. #tbsj input{
  18. margin-right: 5px;
  19. }
  20. </style>
  21. <script type="text/javascript">
  22. var fd_id = "<%=request.getParameter("fd_id")%>";
  23. var isAlert = "<%=request.getParameter("isAlert")%>";
  24. var warningId = "<%=request.getParameter("warningId")%>";
  25. var warningNum = "<%=request.getParameter("warningNum")%>";
  26. //取得用户真实名字
  27. var realName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  28. //部门id
  29. var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  30. //部门名称
  31. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  32. //父部门id
  33. var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
  34. var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  35. //用于判断该预警编号是否已添加过填报要求
  36. var _is_add = false;
  37. //保存预警名称编号json
  38. //var earlywa;
  39. //用于确定日期比较结果
  40. var is_ok_time = true;
  41. //报告类别
  42. var reportlb = "";
  43. /*
  44. var reportTypeJson = {"treeNodes":[
  45. { "id":"0","name":"全选","open":"true","clickExpand":true},
  46. { "id":"1","parentId":"0", "name":"预警行动信息报告"},
  47. { "id":"2","parentId":"0", "name":"预警总结报告"}]}; */
  48. var reportTypeJson = [{ "value":"1", "key":"预警行动信息报告"}];
  49. //页面初始化
  50. var CorpArea = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  51. $(function(){
  52. $("#goback").hover(function(){
  53. $(this).attr("src","/nwyj/images/temp/back_hover.png");
  54. },function(){
  55. $(this).attr("src","/nwyj/images/temp/back.png");
  56. });
  57. $("#WRITE_DEPT_ID_320").OrgSel({selectedMulti : true,loadId_in:CorpArea,loadCorp:"loadCorp",setMulti : {
  58. "Y" : "s",
  59. "N" : ""
  60. }});
  61. //修改表单
  62. if(!(fd_id=="null"||fd_id=="")){
  63. $("#titleShow").text("修改预警报告填报要求");
  64. /* var alerttUrl = $.pathname() + '/ws/plan/ReportInputPlanService/getReportInputPlanAlert/';
  65. $.post(alerttUrl,{unitId : deptId,is_alert : 0},function(data){
  66. $("#EARLY_WARNING_NAME_320").data("data",data);
  67. $("#EARLY_WARNING_NAME_320").render();
  68. }, "json");
  69. $("#EARLY_WARNING_NAME_320").attr("disabled","disabled"); */
  70. var $parent = $("#EARLY_WARNING_NAME_320").parent();
  71. // $("#EARLY_WARNING_NAME_320").remove();
  72. $parent.empty().append('<input name="EARLY_WARNING_NAME_320" class="validate[required]" id="EARLY_WARNING_NAME_320" type="text" value="" readonly="readonly" style="width:78%;">');
  73. $("#EARLY_WARNING_NAME_320").render();
  74. //预警类别
  75. //$('#REPORT_TYPE_320').initCanstSelect('BM_AlertRespReportInputState');
  76. $('#REPORT_TYPE_320').data("data",reportTypeJson);
  77. $('#REPORT_TYPE_320').render();
  78. //周期时间
  79. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  80. var params = {
  81. classid : '320',
  82. objectID : fd_id
  83. };
  84. $.request.query(url,params,function(data){
  85. var temp = "";
  86. if(data.WRITE_DATE_TYPE_320=="临时性"){
  87. temp = data.TEMPORARY_TIME_320;
  88. $("input:radio[name=WRITE_DATE_TYPE_320]").eq(1).attr("checked",true);
  89. change('temporary');
  90. }else{
  91. temp = data.CIRCLE_TIME_320;
  92. $("input:radio[name=WRITE_DATE_TYPE_320]").eq(0).attr("checked",true);
  93. change('round');
  94. }
  95. if(temp.length-1==temp.lastIndexOf(";")){
  96. temp = temp.substring(0, temp.length-2);
  97. }
  98. var timeArr = temp.split(";");
  99. for(var i=0;i<timeArr.length;i++){
  100. if(i!=0){
  101. $("#addBtn").click();
  102. }
  103. $("#time"+i).val(timeArr[i]);
  104. }
  105. $('#editForm').ajaxWrite({data:data});
  106. //reportlb = data.REPORT_TYPE_320;
  107. $("#show_WRITE_DEPT_ID_320").val(data.WRITE_DEPT_NAME_320);
  108. $("#WRITE_DEPT_ID_320").val(data.WRITE_DEPT_ID_320);
  109. $("#WRITE_DEPT_ID_320_show").val(data.WRITE_DEPT_NAME_320);
  110. $("#USER_ID_320").val(data.USER_ID_320);
  111. });
  112. }else{//新增
  113. $("#titleShow").text("添加预警报告填报要求");
  114. $("#WRITER_320").val(realName);
  115. $("#INPUT_DEPT_320").val(deptId);
  116. $("#WRITE_TIME_320").val(getDateTime());
  117. $("#USER_ID_320").val(userId);
  118. change('round');
  119. //createMeiRi();
  120. var alerttUrl = $.pathname() + '/ws/plan/ReportInputPlanService/getReportInputPlanAlert/';
  121. $.post(alerttUrl,{unitId : deptId,is_alert : 0},function(data){
  122. $("#EARLY_WARNING_NAME_320").data("data",data);
  123. $("#EARLY_WARNING_NAME_320").render();
  124. $("#EARLY_WARNING_NAME_320").setValue(warningNum);
  125. getSelectedItem();
  126. }, "json");
  127. /***
  128. 单位部门树形结构
  129. */
  130. /* var deptUrl = $.pathname() + '/ws/dept/DeptService/getDepartTree';
  131. $.post(deptUrl,{id:parentId,name:''},function(data){
  132. $("#dept_name").data("data",data);
  133. $("#dept_name").render();
  134. }, "json"); */
  135. //预警类别
  136. //$('#REPORT_TYPE_320').initCanstSelect('BM_AlertRespReportInputState');
  137. $('#REPORT_TYPE_320').data("data",reportTypeJson);
  138. $('#REPORT_TYPE_320').render();
  139. }
  140. });
  141. //置换周期性、临时性
  142. function change(obj){
  143. if(obj=="round"){
  144. $("#addTime").html("");
  145. var $td=$('<td class="circle_type" colspan="3" fixedCellHeight="true"></td>');
  146. var $date = $('<input type="text" class="date validate[required] round" id="time0" style="width:230.9px;" dateFmt="HH:mm" readOnly="readOnly"/>');
  147. var $add = $('<input type="button" id="addBtn" value="增加"/>');
  148. var $delete = $('<input type="button" id="addBtn" onclick="deleteTime()" value="删除"/>');
  149. $add.bind("click",addTime);
  150. $td.append($date);
  151. $td.append($add);
  152. $td.append($delete);
  153. $("#addTime").append('<td width="15%" align="right" class="circle_type "><span class="star">*</span>每日:</td>');
  154. $("#addTime").append($td);
  155. $add.render();
  156. $delete.render();
  157. $date.render();
  158. }
  159. if(obj=="temporary"){
  160. $("#addTime").html("");
  161. var $td=$('<td class="temporary_type" colspan="3" fixedCellHeight="true"></td>');
  162. var $date = $('<input type="text" class="date validate[required] temporary" id="time0" style="width:230.9px;" dateFmt="yyyy-MM-dd HH:mm" readOnly="readOnly"/>');
  163. var $add = $('<input type="button" id="addBtn" value="增加"/>');
  164. var $delete = $('<input type="button" id="addBtn" onclick="deleteTime()" value="删除"/>');
  165. $add.bind("click",addTime);
  166. $td.append($date);
  167. $td.append($add);
  168. $td.append($delete);
  169. $("#addTime").append('<td width="15%" align="right" class="temporary_type "><span class="star">*</span>填报时间:</td>');
  170. $("#addTime").append($td);
  171. $add.render();
  172. $delete.render();
  173. $date.render();
  174. }
  175. }
  176. var timeindex = 0;
  177. function addTime(){
  178. var obj = getTimeId();
  179. if(checkTimeAdd("addTime",obj,timeindex)){
  180. timeindex++;
  181. var obj = getTimeId();
  182. var $date = "";
  183. if(obj=="round"){
  184. $date = $('<input type="text" id="time'+timeindex+'" class="date validate[required] round" style="width:230.9px;" dateFmt="HH:mm" readOnly="readOnly" />');
  185. }else{
  186. $date = $('<input type="text" id="time'+timeindex+'" class="date validate[required] temporary" style="width:230.9px;" dateFmt="yyyy-MM-dd HH:mm" readOnly="readOnly"/>');
  187. }
  188. $("#addBtn").before($date);
  189. $date.render();
  190. $("#addBtn").render();
  191. $("#addTime").render();
  192. }
  193. resetThisHeight();
  194. }
  195. function resetThisHeight(){
  196. $(top.document.body).find("#frmright").height($(window.document.body).height());
  197. }
  198. function deleteTime(){
  199. var $date = $("#addTime").find(".date");
  200. if($date.length==1){
  201. return;
  202. }else{
  203. $date.last().remove();
  204. timeindex--;
  205. }
  206. }
  207. function getTimeId(){
  208. var $radio = $("#int :radio");
  209. var obj = "";
  210. for(var i=0;i<$radio.length;i++){
  211. if($radio.eq(i).attr("checked")=="checked"){
  212. obj = $radio.eq(i).attr("id");
  213. }
  214. }
  215. return obj;
  216. }
  217. //获取选中项
  218. function getSelectedItem(){
  219. var value = $("#EARLY_WARNING_NAME_320").val();
  220. if(value){
  221. $("#EARLY_WARNING_ID_320").val(value);
  222. $("#PROGRAMME_NAME_320").val(deptName+"_"+value+"预警行动信息报告填报要求");
  223. $("#EARLY_WARNING_320").val($("#EARLY_WARNING_NAME_320").attr("relText"));
  224. }else{
  225. $("#EARLY_WARNING_ID_320").val("");
  226. $("#PROGRAMME_NAME_320").val("");
  227. }
  228. var node = $("#EARLY_WARNING_NAME_320").data("selectedNode");
  229. if(node && node.report_type==1){
  230. reportTypeJson = [{ "value":"1", "key":"预警行动信息报告"}];
  231. }
  232. $('#REPORT_TYPE_320').data("data",reportTypeJson);
  233. $('#REPORT_TYPE_320').render();
  234. var area_id = node.EARLY_WARNING_AREA_ID;
  235. var area_name = node.EARLY_WARNING_AREA_NAME;
  236. $("#show_WRITE_DEPT_ID_320").val(area_name);
  237. $("#WRITE_DEPT_ID_320").val(area_id);
  238. $("#WRITE_DEPT_ID_320_show").val(area_name);
  239. //check_add()
  240. }
  241. /* function check_add(){
  242. _is_add = false;
  243. if(fd_id=="null"||fd_id==""){
  244. var alertId = $("#EARLY_WARNING_ID_320").val();
  245. var report_type_id = $("input[name=REPORT_TYPE_320]").val();
  246. if(earlywa){
  247. for(var i = 0; i < earlywa.rows.length;i++){
  248. if(earlywa.rows[i].EARLY_WARNING_ID_320==alertId && report_type_id!="" && earlywa.rows[i].REPORT_TYPE_320.indexOf(report_type_id)>=0){
  249. _is_add = true;
  250. }
  251. }
  252. }
  253. if(_is_add){
  254. top.Dialog.alert("不能重复添加预警填报要求,请重新选择!");
  255. }
  256. }
  257. } */
  258. //改变报告类别时,
  259. function changeReportType(){
  260. var reportType = $("#REPORT_TYPE_320").val();
  261. if(reportType == 1){//预警行动信息报告
  262. var value = $("#EARLY_WARNING_NAME_320").val();
  263. $("#PROGRAMME_NAME_320").val(deptName+"_"+value+"预警行动信息报告填报要求");
  264. }
  265. }
  266. //检查日期
  267. /* function checkdate(){
  268. is_ok_time = true;
  269. var begintimestr = $("#beginTime").val();
  270. var endtimestr = $("#endTime").val();
  271. if(begintimestr=="" || endtimestr==""){
  272. return;
  273. }
  274. var begintime = stringToDate(begintimestr);//该方法在common.js中
  275. var engtime = stringToDate(endtimestr);
  276. if(begintime > engtime){
  277. is_ok_time = false;
  278. }
  279. } */
  280. //判定时间
  281. function checkTime(){
  282. var star = $("#beginTime").val();
  283. var end = $("#endTime").val();
  284. if(star&&end&&(star>end)){
  285. top.Dialog.alert("截止日期不能小于起始日期");
  286. return false;
  287. }else{
  288. return true;
  289. }
  290. }
  291. //判断起始时间和截止时间不能小于当前时间
  292. function decideTime(){
  293. var star = $("#beginTime").val();
  294. var end = $("#endTime").val();
  295. if(star&&end&&(getTime()>star||getTime()>end)){
  296. top.Dialog.alert("起始日期或截止日期不能小于当前日期");
  297. return false;
  298. }else if(star&&(getTime()>star)){
  299. top.Dialog.alert("起始日期不能小于当前日期");
  300. return false;
  301. }
  302. else{
  303. return true;
  304. }
  305. }
  306. //获取当前时间:年月日
  307. function getTime(){
  308. var now=allGetServerTime();
  309. var year = now.getFullYear();
  310. var month=now.getMonth()+1;
  311. if(month>=1&&month<=9){
  312. month = "0"+month;
  313. }
  314. //获取日期
  315. var day=now.getDate();
  316. if(day>=1&&day<=9){
  317. day = "0"+day;
  318. }
  319. var currenttime = year+"-"+month+"-"+day;
  320. return currenttime;
  321. };
  322. //获得当前系统时间:年月日时分秒
  323. function getDateTime(){
  324. var s="";
  325. var d = allGetServerTime();
  326. var vYear = d.getFullYear();
  327. var vMon = d.getMonth() + 1;
  328. var vDay = d.getDate();
  329. var h = d.getHours();
  330. var m = d.getMinutes();
  331. var se = d.getSeconds();
  332. s=vYear+"-"+(vMon<10 ? "0" + vMon : vMon)+"-"+(vDay<10 ? "0"+ vDay : vDay)+" "+(h<10 ? "0"+ h : h)+":"+(m<10 ? "0" + m : m)+":"+(se<10 ? "0" +se : se);
  333. return s;
  334. }
  335. //获取时间框的值
  336. function getVal(){
  337. $int=$("#int").find("input");
  338. for(var i=0;i<$int.length;i++){
  339. if($int.eq(i).attr("checked")=="checked"){
  340. return $int.eq(i).val();
  341. }
  342. }
  343. }
  344. //检查时间
  345. function checkTimes(){
  346. var obj = getTimeId();
  347. var timeStr = "";
  348. var startTime = $("#beginTime").val();
  349. var endTime = $("#endTime").val();
  350. var $date = $("#addTime").find(".date");
  351. var timeType = "HH:mm";
  352. if(obj=="temporary"){
  353. timeType = "yyyy-MM-dd HH:mm";
  354. }
  355. for(var i=0;i<$date.length;i++){
  356. var time = $date.eq(i).val().trim();
  357. if(obj=="temporary"){
  358. var time1 = time.substring(0,10);
  359. if(startTime&&endTime&&(time1<startTime||time1>endTime)){
  360. top.Dialog.alert("填报时间要在起始日期和截止日期之间");
  361. return false;
  362. }else if(startTime&&(time1<startTime)){
  363. top.Dialog.alert("填报时间不能小于起始日期");
  364. return false;
  365. }
  366. }
  367. timeStr +=time+';';
  368. }
  369. timeStr = timeStr.substring(0, timeStr.lastIndexOf(";"));
  370. //timeStrSort(timeStr,"esc",";",timeType)该方法在/nwyj/scripts/freamwork/com/sinosoft/common/common.js中
  371. //第一个参数为要排序的字符串,第二个参数为倒序或顺序:esc,desc;第三个参数为timeStr中每个时间元素的分割符号;第四个参数为timeStr中元素的时间类型:yyyy-MM-dd HH:mm或HH:mm
  372. timeStr = timeStrSort(timeStr,"esc",";",timeType);
  373. if(obj=="temporary"){
  374. $("#TEMPORARY_TIME_320").val(timeStr);
  375. }else{
  376. $("#CIRCLE_TIME_320").val(timeStr);
  377. }
  378. return true;
  379. }
  380. </script>
  381. </head>
  382. <body class="bd" align="center" >
  383. <div id="formContent" class="d_ground">
  384. <div class="title" align="center"><a href="javascript:;"><img id='goback' class="back" title="返回" align="left" alt="返回" src="/nwyj/images/temp/back.png" ></img></a><font class="title_font" id="titleShow"></font></div>
  385. <form id="editForm">
  386. <input name="classid" value="320" type="hidden" />
  387. <input type="hidden" name="FD_OBJECTID320" value=""/>
  388. <input name="IS_RELEASE_320" id="IS_RELEASE_320" value="0" type="hidden">
  389. <input name="WRITE_DEPT_NAME_320" id="WRITE_DEPT_NAME_320" type="hidden">
  390. <input name="WRITER_320" id="WRITER_320" value="0" type="hidden">
  391. <input name="WRITE_TIME_320" id="WRITE_TIME_320" type="hidden">
  392. <input name="INPUT_DEPT_320" id="INPUT_DEPT_320" type="hidden">
  393. <input id="IS_ALERT_320" name="IS_ALERT_320" value="0" type="hidden"/>
  394. <input id="EARLY_WARNING_320" name="EARLY_WARNING_320" value="" type="hidden"/>
  395. <input id="TEMPORARY_TIME_320" name="TEMPORARY_TIME_320" value="" type="hidden"/>
  396. <input id="CIRCLE_TIME_320" name="CIRCLE_TIME_320" value="" type="hidden"/>
  397. <input id="USER_ID_320" name="USER_ID_320" value="" type="hidden"/>
  398. <input name="EARLY_WARNING_ID_320" type="hidden" id="EARLY_WARNING_ID_320"/>
  399. <!-- 保存和重置 -->
  400. <div class="button_jl">
  401. <input value="保存" type="button"id="save" />&nbsp;&nbsp;
  402. <input value="保存并发布" type="button"id="saveAndRelease" />&nbsp;&nbsp;
  403. <input value="重置" type="button" onclick="formReset()"/>&nbsp;&nbsp;&nbsp;&nbsp;
  404. </div><br />
  405. <fieldset class="fieldset">
  406. <legend class="legend">基本信息:</legend>
  407. <table class="add_table_style" >
  408. <tr>
  409. <td align="right" width="15%" ><span class="star">*</span>预警编号:</td>
  410. <td width="35%"><select class="validate[required] selectWidth " swidth="78%"
  411. id="EARLY_WARNING_NAME_320" name="EARLY_WARNING_NAME_320" prompt="请选择" onchange="getSelectedItem();">
  412. </select></td>
  413. <!-- <td width="15%" align="right"><span class="star">*</span>应急预警编号:</td>
  414. <td width="35%" ><input name="EARLY_WARNING_ID_320" class="validate[required]"
  415. id="EARLY_WARNING_ID_320" readonly="readonly" type="text" value="" maxlength=""
  416. style="width:90%"></td> -->
  417. <td width="15%" align="right" ><span class="star">*</span>填报要求名称:</td>
  418. <td width="35%" ><input name="PROGRAMME_NAME_320" class="validate[required]"
  419. id="PROGRAMME_NAME_320" type="text" value="" maxlength="80"
  420. style="width:78%;"></td>
  421. </tr>
  422. <tr>
  423. <td align="right" ><span class="star">*</span>报告类别:</td>
  424. <td ><select name="REPORT_TYPE_320" class="validate[required] selectWidth " swidth="78%"
  425. id="REPORT_TYPE_320" prompt="请选择" onchange="changeReportType();">
  426. </div></td>
  427. <td></td>
  428. <td></td>
  429. </tr>
  430. <tr>
  431. <td align="right" ><span class="star">*</span>填报单位:</td>
  432. <td colspan="3"><div id="WRITE_DEPT_ID_320" allclickset="1" ></div></td>
  433. </tr>
  434. <tr>
  435. <td align="right" ><span class="star">*</span>起始日期:</td>
  436. <td ><input type="text" id="beginTime" readOnly="readOnly" style="width:78%"
  437. name="START_TIME_320" class="date validate[required]" dateFmt="yyyy-MM-dd" onchange="checkdate()"/></td>
  438. <td width="10%" align="right" >截止日期:</td>
  439. <td ><input type="text" id="endTime" readOnly="readOnly" style="width:78%"
  440. name="EXPIRATION_DATE_320" class="date" dateFmt="yyyy-MM-dd" onchange="checkdate()"/> </td>
  441. </tr>
  442. <tr>
  443. <td align="right"><span class="star" >*</span>填报时间表:</td>
  444. <td id="int">
  445. <input type="radio" value="周期性" id="round" checked="checked" name="WRITE_DATE_TYPE_320" onclick="change('round');">
  446. <label for="round">周期性</label>
  447. <input type="radio" value="临时性" id="temporary" name="WRITE_DATE_TYPE_320" onclick="change('temporary');">
  448. <label for="temporary" >临时性</label>
  449. <!-- <input type="radio" id="male-1" name="WRITE_DATE_TYPE_320" value="周期性" checked="checked"/>
  450. <label for="male-1" class="hand">周期性</label>
  451. <input type="radio" id="female-1" name="WRITE_DATE_TYPE_320" value="临时性"/>
  452. <label for="female-1" class="hand">临时性</label> -->
  453. </td>
  454. <td></td>
  455. <td></td>
  456. </tr>
  457. <tr id="addTime"></tr>
  458. </table>
  459. </fieldset>
  460. </form>
  461. </div>
  462. </body>