338457415ec25a884390438a254b2498ca5d33ea.svn-base 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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/am/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_315').onfocus=function(){
  51. var endtimeTf=$dp.$('END_DATE_315');
  52. WdatePicker({
  53. skin:dateSkin,onpicked:function(){endtimeTf.focus();},maxDate:'#F{$dp.$D(\'END_DATE_315\')}'
  54. });
  55. }
  56. document.getElementById('END_DATE_315').onfocus=function(){
  57. //这里设置了最大日期为当前日期,如果不需要则把maxDate:'%y-%M-%d'去掉
  58. WdatePicker({skin:dateSkin,minDate:'#F{$dp.$D(\'START_DATE_315\')}'});
  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. $("#EVENT_ID_315").initYewuSelect("363","FD_OBJECTID","EVENT_NAME"," EVENT_STATE='0' and IS_DEL='0' order by updatedate desc"); //事件
  68. $("#EVENT_ID_315").setValue(eventId);
  69. var dutyJson = [
  70. {"key":"1","value":"1"},
  71. {"key":"2","value":"2"},
  72. {"key":"3","value":"3"},
  73. {"key":"4","value":"4"}]
  74. $("#DUTY_NUM_315").data("data",dutyJson);
  75. $("#DUTY_NUM_315").render();
  76. var deptJson = getDutyDept();
  77. $(".dept_con_div_div").live("click",function(){
  78. var is_checked = $(this).find("input").attr("checked");
  79. if(is_checked=="checked"){
  80. $(this).next().show();
  81. }else{
  82. $(this).next().find("input").attr("checked",false);
  83. $(this).next().hide();
  84. }
  85. })
  86. //修改表单
  87. if(!(fd_id=="null"||fd_id=="")){
  88. $("#titleShow").text("修改值班安排任务");
  89. var $parent = $("#EARLY_WARNING_NAME_315").parent();
  90. $parent.empty().append('<input name="EARLY_WARNING_NAME_315" class="validate[required]" id="EARLY_WARNING_NAME_315" type="text" value="" readonly="readonly" style="width:78%;">');
  91. $("#EARLY_WARNING_NAME_315").render();
  92. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  93. var params = {
  94. classid : '315',
  95. objectID : fd_id
  96. };
  97. $.ajax({
  98. url : url,
  99. type : 'post',
  100. data : params,
  101. dataType : 'json',
  102. async : false,
  103. success : function(data){
  104. $('#editForm').ajaxWrite({data:data});
  105. $("#classId_dom").val(315);
  106. var duty_dept_name = data.WAIT_INPUT_DUTY_DEPT_NAME_315;
  107. var per_dept_name = data.WAIT_INPUT_LINGDAO_DEPT_NAME_315;
  108. creatDeptCon(deptJson,duty_dept_name,per_dept_name);
  109. },
  110. error : function(e){
  111. top.Dialog.alert("加载数据出错!");
  112. }
  113. });
  114. }else{//新增
  115. creatDeptCon(deptJson);
  116. $("#titleShow").text("新增值班安排任务");
  117. $("#INPUT_PER_NAME_315").val(realName);
  118. $("#INPUT_PER_ID_315").val(userId);
  119. $("#INPUT_PER_UNIT_NAME_315").val(unitName);
  120. $("#INPUT_PER_UNIT_ID_315").val(unitId);
  121. $("#INPUT_PER_DEPT_NAME_315").val(deptName);
  122. $("#INPUT_PER_DEPT_ID_315").val(deptId);
  123. }
  124. });
  125. //获取当前时间:年月日
  126. function getTime(){
  127. var now=allGetServerTime();
  128. var year = now.getFullYear();
  129. var month=now.getMonth()+1;
  130. if(month>=1&&month<=9){
  131. month = "0"+month;
  132. }
  133. //获取日期
  134. var day=now.getDate();
  135. if(day>=1&&day<=9){
  136. day = "0"+day;
  137. }
  138. var currenttime = year+"-"+month+"-"+day;
  139. return currenttime;
  140. };
  141. //获得当前系统时间:年月日时分秒
  142. function getDateTime(){
  143. var s="";
  144. var d = allGetServerTime();
  145. var vYear = d.getFullYear();
  146. var vMon = d.getMonth() + 1;
  147. var vDay = d.getDate();
  148. var h = d.getHours();
  149. var m = d.getMinutes();
  150. var se = d.getSeconds();
  151. 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);
  152. return s;
  153. }
  154. function creatDeptCon(data,duty_dept_name,per_dept_name){
  155. var con = $("#dept_con");
  156. for (var i = 0; i < data.length; i++) {
  157. var id = i;
  158. var name = data[i].DEPT_NAME;
  159. if(name.indexOf("安全监管")>-1){
  160. con.prepend("<div class='dept_con_div'>"+
  161. "<div class='dept_con_div_div'><input type='checkbox' name='DUTY_DEPT_ID' checked='checked' disabled='true' id='dept_id_"+id+"' value='"+id+"'/>"+
  162. "<label for='dept_id_"+id+"' class='pointer'>"+name+"</label></div>"+
  163. "<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+"'/>"+
  164. "<label for='lingDao_id_"+id+"' class='pointer'>需要安排带班领导</label></div>"+
  165. "</div>");
  166. }else{
  167. var isCheck = "";
  168. var isCheck1 = "";
  169. var isShow = "style='display:none;'";
  170. if(per_dept_name && per_dept_name.indexOf(name)>-1){
  171. isCheck = "checked='checked'";
  172. isShow = "";
  173. }
  174. if(per_dept_name && per_dept_name.indexOf(name)>-1){
  175. isCheck1 = "checked='checked'";
  176. }
  177. con.append("<div class='dept_con_div'>"+
  178. "<div class='dept_con_div_div'><input type='checkbox' "+isCheck+" name='DUTY_DEPT_ID' id='dept_id_"+id+"' value='"+id+"'/>"+
  179. "<label for='dept_id_"+id+"' class='pointer'>"+name+"</label></div>"+
  180. "<div class='linDao_con' id='linDao_con_"+id+"' "+isShow+"><input type='checkbox' "+isCheck1+" name='LINGDAO_DEPT_ID' id='lingDao_id_"+id+"' value='"+id+"'/>"+
  181. "<label for='lingDao_id_"+id+"' class='pointer'>需要安排带班领导</label></div>"+
  182. "</div>");
  183. }
  184. }
  185. }
  186. /**
  187. 通过单位id获取该单位需要值班部门
  188. **/
  189. function getDutyDept(){
  190. var params = {
  191. corp_id:unitId,
  192. name:"AM"
  193. };
  194. var result;
  195. $.ajax({
  196. url : $.pathname() + '/ws/wduty/WarningDutyService/getDutyDept/',
  197. type : 'post',
  198. timeout : 15000,
  199. data : params,
  200. async:false,
  201. dataType : 'json',
  202. success : function(data){
  203. result = data;
  204. },
  205. error : function(e){
  206. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  207. }
  208. });
  209. return result;
  210. }
  211. </script>
  212. </head>
  213. <body class="bd" align="center" >
  214. <div id="formContent" class="d_ground">
  215. <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>
  216. <form id="editForm">
  217. <input name="classid" id='classId_dom' value="315" type="hidden" />
  218. <input name="FD_OBJECTID315" value="" type="hidden">
  219. <input name="RELEASE_STATE_315" id="RELEASE_STATE_315" value="0" type="hidden">
  220. <input name="INPUT_PER_NAME_315" id="INPUT_PER_NAME_315" type="hidden">
  221. <input name="INPUT_PER_ID_315" id="INPUT_PER_ID_315" type="hidden">
  222. <input name="INPUT_PER_UNIT_NAME_315" id="INPUT_PER_UNIT_NAME_315" type="hidden">
  223. <input name="INPUT_PER_UNIT_ID_315" id="INPUT_PER_UNIT_ID_315" type="hidden">
  224. <input name="INPUT_PER_DEPT_NAME_315" id="INPUT_PER_DEPT_NAME_315" type="hidden">
  225. <input name="INPUT_PER_DEPT_ID_315" id="INPUT_PER_DEPT_ID_315" type="hidden">
  226. <input name="WAIT_INPUT_DUTY_DEPT_NAME_315" id="WAIT_INPUT_DUTY_DEPT_NAME_315" type="hidden">
  227. <input name="WAIT_INPUT_LINGDAO_DEPT_NAME_315" id="WAIT_INPUT_LINGDAO_DEPT_NAME_315" type="hidden">
  228. <input name="WAIT_INPUT_LINGDAO_DEPT_ID_315" id="WAIT_INPUT_LINGDAO_DEPT_ID_315" type="hidden">
  229. <input name="WAIT_INPUT_DUTY_DEPT_ID_315" id="WAIT_INPUT_DUTY_DEPT_ID_315" type="hidden">
  230. <!-- 保存和重置 -->
  231. <div class="button_jl">
  232. <input value="保存" type="button"id="save" />&nbsp;&nbsp;
  233. <input value="保存并发布" type="button"id="saveAndRelease" />&nbsp;&nbsp;
  234. <input value="重置" type="button" onclick="formReset()"/>&nbsp;&nbsp;&nbsp;&nbsp;
  235. </div><br />
  236. <fieldset class="fieldset">
  237. <legend class="legend">基本信息:</legend>
  238. <table class="add_table_style" >
  239. <tr>
  240. <td width="15%" align="right" ><span class="star">*</span>任务名称:</td>
  241. <td width="35%" >
  242. <input name="PLAN_NAME_315" class="validate[required]" id="PLAN_NAME_315" type="text" value="" maxlength="100" style="width:78%;">
  243. </td>
  244. <td align="right" width="15%" >事件名称:</td>
  245. <td width="35%">
  246. <select class=" selectWidth " swidth="78%" id="EVENT_ID_315" name="EVENT_ID_315" prompt="请选择" >
  247. </select>
  248. </td>
  249. </tr>
  250. <tr>
  251. <td align="right" ><span class="star">*</span>值班开始日期:</td>
  252. <td >
  253. <input type="text" id="START_DATE_315" readOnly="readOnly" style="width:78%" name="START_DATE_315" class="dateIcon validate[required]" dateFmt="yyyy-MM-dd" />
  254. </td>
  255. <td width="10%" align="right" ><span class="star">*</span>值班截止日期:</td>
  256. <td >
  257. <input type="text" id="END_DATE_315" readOnly="readOnly" style="width:78%" name="END_DATE_315" class="dateIcon validate[required]" dateFmt="yyyy-MM-dd" />
  258. </td>
  259. </tr>
  260. <tr>
  261. <td align="right" width="15%" ><span class="star">*</span>每天:</td>
  262. <td width="35%">
  263. <select class="validate[required] selectWidth " swidth="20%" id="DUTY_NUM_315" name="DUTY_NUM_315" >
  264. </select>
  265. <span> 个班次</span>
  266. </td>
  267. <td width="15%" align="right" ><span class="star">*</span>值班开始时间:</td>
  268. <td width="35%" >
  269. <input type="text" id="START_TIME_315" readOnly="readOnly" style="width:78%" name="START_TIME_315" class="validate[required] date" dateFmt="HH:mm" />
  270. </td>
  271. </tr>
  272. <tr>
  273. <td align="left" width="100%" colspan="4"><span class="star">*</span>需要安排值班的部门:</td>
  274. </tr>
  275. <tr>
  276. <td align="left" width="100%" colspan="4">
  277. <div id='dept_con' class='dept_con'>
  278. </div>
  279. </td>
  280. </tr>
  281. </table>
  282. </fieldset>
  283. </form>
  284. </div>
  285. </body>