0eab44fc40e976f003366d0492c0e3719a3c2441.svn-base 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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/page/business/em/warningDuty/DutyPlanAddEdit.js"></script>
  9. <style type="text/css">
  10. .dept_con{
  11. padding-left: 130px;
  12. }
  13. .dept_con_div div{
  14. display: inline-block;
  15. }
  16. .linDao_con {
  17. margin-left: 50px;
  18. }
  19. .pointer{
  20. cursor: pointer;
  21. }
  22. </style>
  23. <script type="text/javascript">
  24. var eventId = "<%=request.getParameter("eventId")%>";
  25. var fd_id = "<%=request.getParameter("fd_id")%>";
  26. var pageType = "<%=request.getParameter("pageType")%>";
  27. var noticeId = "<%=request.getParameter("noticeId")%>";
  28. //单位id
  29. var unitId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  30. //单位名称
  31. var unitName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  32. //父部门id
  33. //部门id
  34. var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  35. //部门名称
  36. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
  37. //父部门id
  38. var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
  39. var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  40. //取得用户真实名字
  41. var realName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  42. var dateSkin="blue";
  43. function initComplete(){
  44. //获取当前主题风格,用于设置日期控件的皮肤
  45. try {
  46. dateSkin=themeColor;
  47. }
  48. catch(e){}
  49. //自定义点击触发日期控件
  50. document.getElementById('START_DATE_310').onfocus=function(){
  51. var endtimeTf=$dp.$('END_DATE_310');
  52. WdatePicker({
  53. skin:dateSkin,onpicked:function(){endtimeTf.focus();},minDate:'%y-%M-%d',maxDate:'#F{$dp.$D(\'END_DATE_310\')}'
  54. });
  55. }
  56. document.getElementById('END_DATE_310').onfocus=function(){
  57. //这里设置了最大日期为当前日期,如果不需要则把maxDate:'%y-%M-%d'去掉
  58. WdatePicker({skin:dateSkin,minDate:'#F{$dp.$D(\'START_DATE_310\')}'});
  59. }
  60. }
  61. $(function(){
  62. $("#goback").hover(function(){
  63. $(this).attr("src","/nwyj/images/temp/back_hover.png");
  64. },function(){
  65. $(this).attr("src","/nwyj/images/temp/back.png");
  66. });
  67. if(pageType==0 || pageType==1){//返回预警通知单任务清单页面
  68. $("#goback").parent().hide();
  69. }
  70. $("#EVENT_ID_310").initYewuSelect("363","FD_OBJECTID","EVENT_NAME"," EVENT_STATE='1' and IS_DEL='0' and ISSUE_UNITE_ID='"+unitId+"' order by updatedate desc"); //事件
  71. $("#EVENT_ID_310").setValue(eventId);
  72. var dutyJson = [
  73. {"key":"1","value":"1"},
  74. {"key":"2","value":"2"},
  75. {"key":"3","value":"3"},
  76. {"key":"4","value":"4"}]
  77. $("#DUTY_NUM_310").data("data",dutyJson);
  78. $("#DUTY_NUM_310").render();
  79. var deptJson = [{"id":"R002105430213","name":"专业管理部门(安全监管部)"},
  80. {"id":"R002105430210","name":"专业管理部门(系统运行部)"},
  81. {"id":"R002105430211","name":"专业管理部门(生产设备部)"},
  82. {"id":"R002105430212","name":"专业管理部门(市场营销部)"}];
  83. $(".dept_con_div_div").live("click",function(){
  84. var is_checked = $(this).find("input").attr("checked");
  85. if(is_checked=="checked"){
  86. $(this).next().show();
  87. }else{
  88. $(this).next().find("input").attr("checked",false);
  89. $(this).next().hide();
  90. }
  91. })
  92. //修改表单
  93. if(!(fd_id=="null"||fd_id=="")){
  94. $("#titleShow").text("修改值班安排任务");
  95. var $parent = $("#EARLY_WARNING_NAME_310").parent();
  96. $parent.empty().append('<input name="EARLY_WARNING_NAME_310" class="validate[required]" id="EARLY_WARNING_NAME_310" type="text" value="" readonly="readonly" style="width:78%;">');
  97. $("#EARLY_WARNING_NAME_310").render();
  98. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  99. var params = {
  100. classid : '310',
  101. objectID : fd_id
  102. };
  103. $.ajax({
  104. url : url,
  105. type : 'post',
  106. data : params,
  107. dataType : 'json',
  108. async : false,
  109. success : function(data){
  110. $('#editForm').ajaxWrite({data:data});
  111. $("#classId_dom").val(310);
  112. var duty_dept_id = data.WAIT_INPUT_DUTY_DEPT_ID_310;
  113. var per_dept_id = data.WAIT_INPUT_LINGDAO_DEPT_ID_310;
  114. creatDeptCon(deptJson,duty_dept_id,per_dept_id);
  115. },
  116. error : function(e){
  117. top.Dialog.alert("加载数据出错!");
  118. }
  119. });
  120. }else{//新增
  121. creatDeptCon(deptJson);
  122. $("#titleShow").text("新增值班安排任务");
  123. $("#INPUT_PER_NAME_310").val(realName);
  124. $("#INPUT_PER_ID_310").val(userId);
  125. $("#INPUT_PER_UNIT_NAME_310").val(unitName);
  126. $("#INPUT_PER_UNIT_ID_310").val(unitId);
  127. $("#INPUT_PER_DEPT_NAME_310").val(deptName);
  128. $("#INPUT_PER_DEPT_ID_310").val(deptId);
  129. }
  130. });
  131. //获取当前时间:年月日
  132. function getTime(){
  133. var now=allGetServerTime();
  134. var year = now.getFullYear();
  135. var month=now.getMonth()+1;
  136. if(month>=1&&month<=9){
  137. month = "0"+month;
  138. }
  139. //获取日期
  140. var day=now.getDate();
  141. if(day>=1&&day<=9){
  142. day = "0"+day;
  143. }
  144. var currenttime = year+"-"+month+"-"+day;
  145. return currenttime;
  146. };
  147. //获得当前系统时间:年月日时分秒
  148. function getDateTime(){
  149. var s="";
  150. var d = allGetServerTime();
  151. var vYear = d.getFullYear();
  152. var vMon = d.getMonth() + 1;
  153. var vDay = d.getDate();
  154. var h = d.getHours();
  155. var m = d.getMinutes();
  156. var se = d.getSeconds();
  157. 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);
  158. return s;
  159. }
  160. function creatDeptCon(data,duty_dept_id,per_dept_id){
  161. var con = $("#dept_con");
  162. for (var i = 0; i < data.length; i++) {
  163. var id = data[i].id;
  164. var name = data[i].name;
  165. if(id=="R002105430213"){
  166. con.append("<div class='dept_con_div'>"+
  167. "<div class='dept_con_div_div'><input type='checkbox' name='DUTY_DEPT_ID' checked='checked' disabled='true' id='dept_id_"+id+"' value='"+id+"'/>"+
  168. "<label for='dept_id_"+id+"' class='pointer'>"+name+"</label></div>"+
  169. "<div class='linDao_con' id='linDao_con_"+id+"'><input type='checkbox' checked='checked' disabled='true' name='LINGDAO_DEPT_ID' id='lingDao_id_"+id+"' value='"+id+"'/>"+
  170. "<label for='lingDao_id_"+id+"' class='pointer'>需要安排带班领导</label></div>"+
  171. "</div>");
  172. }else{
  173. var isCheck = "";
  174. var isCheck1 = "";
  175. var isShow = "style='display:none;'";
  176. if(duty_dept_id && duty_dept_id.indexOf(id)>-1){
  177. isCheck = "checked='checked'";
  178. isShow = "";
  179. }
  180. if(per_dept_id && per_dept_id.indexOf(id)>-1){
  181. isCheck1 = "checked='checked'";
  182. }
  183. con.append("<div class='dept_con_div'>"+
  184. "<div class='dept_con_div_div'><input type='checkbox' "+isCheck+" name='DUTY_DEPT_ID' id='dept_id_"+id+"' value='"+id+"'/>"+
  185. "<label for='dept_id_"+id+"' class='pointer'>"+name+"</label></div>"+
  186. "<div class='linDao_con' id='linDao_con_"+id+"' "+isShow+"><input type='checkbox' "+isCheck1+" name='LINGDAO_DEPT_ID' id='lingDao_id_"+id+"' value='"+id+"'/>"+
  187. "<label for='lingDao_id_"+id+"' class='pointer'>需要安排带班领导</label></div>"+
  188. "</div>");
  189. }
  190. }
  191. }
  192. </script>
  193. </head>
  194. <body class="bd" align="center" >
  195. <div id="formContent" class="d_ground">
  196. <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>
  197. <form id="editForm">
  198. <input name="classid" id='classId_dom' value="310" type="hidden" />
  199. <input name="FD_OBJECTID310" value="" type="hidden">
  200. <input name="RELEASE_STATE_310" id="RELEASE_STATE_310" value="0" type="hidden">
  201. <input name="INPUT_PER_NAME_310" id="INPUT_PER_NAME_310" type="hidden">
  202. <input name="INPUT_PER_ID_310" id="INPUT_PER_ID_310" type="hidden">
  203. <input name="INPUT_PER_UNIT_NAME_310" id="INPUT_PER_UNIT_NAME_310" type="hidden">
  204. <input name="INPUT_PER_UNIT_ID_310" id="INPUT_PER_UNIT_ID_310" type="hidden">
  205. <input name="INPUT_PER_DEPT_NAME_310" id="INPUT_PER_DEPT_NAME_310" type="hidden">
  206. <input name="INPUT_PER_DEPT_ID_310" id="INPUT_PER_DEPT_ID_310" type="hidden">
  207. <input name="WAIT_INPUT_DUTY_DEPT_NAME_310" id="WAIT_INPUT_DUTY_DEPT_NAME_310" type="hidden">
  208. <input name="WAIT_INPUT_LINGDAO_DEPT_NAME_310" id="WAIT_INPUT_LINGDAO_DEPT_NAME_310" type="hidden">
  209. <input name="WAIT_INPUT_LINGDAO_DEPT_ID_310" id="WAIT_INPUT_LINGDAO_DEPT_ID_310" type="hidden">
  210. <input name="WAIT_INPUT_DUTY_DEPT_ID_310" id="WAIT_INPUT_DUTY_DEPT_ID_310" type="hidden">
  211. <!-- 保存和重置 -->
  212. <div class="button_jl">
  213. <input value="保存" type="button"id="save" />&nbsp;&nbsp;
  214. <input value="保存并发布" type="button"id="saveAndRelease" />&nbsp;&nbsp;
  215. <input value="重置" type="button" onclick="formReset()"/>&nbsp;&nbsp;&nbsp;&nbsp;
  216. </div><br />
  217. <fieldset class="fieldset">
  218. <legend class="legend">基本信息:</legend>
  219. <table class="add_table_style" >
  220. <tr>
  221. <td width="15%" align="right" ><span class="star">*</span>任务名称:</td>
  222. <td width="35%" >
  223. <input name="PLAN_NAME_310" class="validate[required]" id="PLAN_NAME_310" type="text" value="" maxlength="100" style="width:78%;">
  224. </td>
  225. <td align="right" width="15%" >事件名称:</td>
  226. <td width="35%">
  227. <select class=" selectWidth " swidth="78%" id="EVENT_ID_310" name="EVENT_ID_310" prompt="请选择" >
  228. </select>
  229. </td>
  230. </tr>
  231. <tr>
  232. <td align="right" ><span class="star">*</span>值班开始日期:</td>
  233. <td >
  234. <input type="text" id="START_DATE_310" readOnly="readOnly" style="width:78%" name="START_DATE_310" class="dateIcon validate[required]" dateFmt="yyyy-MM-dd" />
  235. </td>
  236. <td width="10%" align="right" ><span class="star">*</span>值班截止日期:</td>
  237. <td >
  238. <input type="text" id="END_DATE_310" readOnly="readOnly" style="width:78%" name="END_DATE_310" class="dateIcon validate[required]" dateFmt="yyyy-MM-dd" />
  239. </td>
  240. </tr>
  241. <tr>
  242. <td align="right" width="15%" ><span class="star">*</span>每天:</td>
  243. <td width="35%">
  244. <select class="validate[required] selectWidth " swidth="20%" id="DUTY_NUM_310" name="DUTY_NUM_310" >
  245. </select>
  246. <span> 个班次</span>
  247. </td>
  248. <td width="15%" align="right" ><span class="star">*</span>值班开始时间:</td>
  249. <td width="35%" >
  250. <input type="text" id="START_TIME_310" readOnly="readOnly" style="width:78%" name="START_TIME_310" class="validate[required] date" dateFmt="HH:mm" />
  251. </td>
  252. </tr>
  253. <tr>
  254. <td align="left" width="100%" colspan="4"><span class="star">*</span>需要安排值班的部门:</td>
  255. </tr>
  256. <tr>
  257. <td align="left" width="100%" colspan="4">
  258. <div id='dept_con' class='dept_con'>
  259. </div>
  260. </td>
  261. </tr>
  262. </table>
  263. </fieldset>
  264. </form>
  265. </div>
  266. </body>