123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title></title>
- <%@include file="../../../include.jsp" %>
- <script type="text/javascript" src="/nwyj/page/business/am/warningDuty/DutyPlanAddEdit.js"></script>
- <style type="text/css">
- .dept_con{
- padding-left: 130px;
- }
- .dept_con_div div{
- display: inline-block;
- }
- .linDao_con {
- margin-left: 50px;
- }
- .pointer{
- cursor: pointer;
- }
- </style>
- <script type="text/javascript">
- var eventId = "<%=request.getParameter("eventId")%>";
- var fd_id = "<%=request.getParameter("fd_id")%>";
- var pageType = "<%=request.getParameter("pageType")%>";
- var noticeId = "<%=request.getParameter("noticeId")%>";
- //单位id
- var unitId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- //单位名称
- var unitName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
- //父部门id
- //部门id
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- //部门名称
- var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
- //父部门id
- var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
-
- var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- //取得用户真实名字
- var realName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
-
-
- var dateSkin="blue";
- function initComplete(){
- //获取当前主题风格,用于设置日期控件的皮肤
- try {
- dateSkin=themeColor;
- }
- catch(e){}
- //自定义点击触发日期控件
- document.getElementById('START_DATE_315').onfocus=function(){
- var endtimeTf=$dp.$('END_DATE_315');
- WdatePicker({
- skin:dateSkin,onpicked:function(){endtimeTf.focus();},maxDate:'#F{$dp.$D(\'END_DATE_315\')}'
- });
- }
-
- document.getElementById('END_DATE_315').onfocus=function(){
- //这里设置了最大日期为当前日期,如果不需要则把maxDate:'%y-%M-%d'去掉
- WdatePicker({skin:dateSkin,minDate:'#F{$dp.$D(\'START_DATE_315\')}'});
- }
- }
-
-
-
- $(function(){
-
- $("#goback").hover(function(){
- $(this).attr("src","/nwyj/images/temp/back_hover.png");
- },function(){
- $(this).attr("src","/nwyj/images/temp/back.png");
- });
-
-
- $("#EVENT_ID_315").initYewuSelect("363","FD_OBJECTID","EVENT_NAME"," EVENT_STATE='0' and IS_DEL='0' order by updatedate desc"); //事件
- $("#EVENT_ID_315").setValue(eventId);
- var dutyJson = [
- {"key":"1","value":"1"},
- {"key":"2","value":"2"},
- {"key":"3","value":"3"},
- {"key":"4","value":"4"}]
- $("#DUTY_NUM_315").data("data",dutyJson);
- $("#DUTY_NUM_315").render();
- var deptJson = getDutyDept();
- $(".dept_con_div_div").live("click",function(){
- var is_checked = $(this).find("input").attr("checked");
- if(is_checked=="checked"){
- $(this).next().show();
- }else{
- $(this).next().find("input").attr("checked",false);
- $(this).next().hide();
- }
- })
-
- //修改表单
- if(!(fd_id=="null"||fd_id=="")){
- $("#titleShow").text("修改值班安排任务");
- var $parent = $("#EARLY_WARNING_NAME_315").parent();
- $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%;">');
- $("#EARLY_WARNING_NAME_315").render();
- var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
- var params = {
- classid : '315',
- objectID : fd_id
- };
- $.ajax({
- url : url,
- type : 'post',
- data : params,
- dataType : 'json',
- async : false,
- success : function(data){
- $('#editForm').ajaxWrite({data:data});
- $("#classId_dom").val(315);
- var duty_dept_name = data.WAIT_INPUT_DUTY_DEPT_NAME_315;
- var per_dept_name = data.WAIT_INPUT_LINGDAO_DEPT_NAME_315;
- creatDeptCon(deptJson,duty_dept_name,per_dept_name);
- },
- error : function(e){
- top.Dialog.alert("加载数据出错!");
- }
- });
- }else{//新增
- creatDeptCon(deptJson);
- $("#titleShow").text("新增值班安排任务");
- $("#INPUT_PER_NAME_315").val(realName);
- $("#INPUT_PER_ID_315").val(userId);
- $("#INPUT_PER_UNIT_NAME_315").val(unitName);
- $("#INPUT_PER_UNIT_ID_315").val(unitId);
- $("#INPUT_PER_DEPT_NAME_315").val(deptName);
- $("#INPUT_PER_DEPT_ID_315").val(deptId);
- }
-
-
- });
-
- //获取当前时间:年月日
- function getTime(){
- var now=allGetServerTime();
- var year = now.getFullYear();
- var month=now.getMonth()+1;
- if(month>=1&&month<=9){
- month = "0"+month;
- }
- //获取日期
- var day=now.getDate();
- if(day>=1&&day<=9){
- day = "0"+day;
- }
- var currenttime = year+"-"+month+"-"+day;
-
- return currenttime;
- };
- //获得当前系统时间:年月日时分秒
- function getDateTime(){
- var s="";
- var d = allGetServerTime();
- var vYear = d.getFullYear();
- var vMon = d.getMonth() + 1;
- var vDay = d.getDate();
- var h = d.getHours();
- var m = d.getMinutes();
- var se = d.getSeconds();
- 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);
- return s;
- }
- function creatDeptCon(data,duty_dept_name,per_dept_name){
- var con = $("#dept_con");
- for (var i = 0; i < data.length; i++) {
- var id = i;
- var name = data[i].DEPT_NAME;
- if(name.indexOf("安全监管")>-1){
- con.prepend("<div class='dept_con_div'>"+
- "<div class='dept_con_div_div'><input type='checkbox' name='DUTY_DEPT_ID' checked='checked' disabled='true' id='dept_id_"+id+"' value='"+id+"'/>"+
- "<label for='dept_id_"+id+"' class='pointer'>"+name+"</label></div>"+
- "<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+"'/>"+
- "<label for='lingDao_id_"+id+"' class='pointer'>需要安排带班领导</label></div>"+
- "</div>");
- }else{
- var isCheck = "";
- var isCheck1 = "";
- var isShow = "style='display:none;'";
- if(per_dept_name && per_dept_name.indexOf(name)>-1){
- isCheck = "checked='checked'";
- isShow = "";
- }
- if(per_dept_name && per_dept_name.indexOf(name)>-1){
- isCheck1 = "checked='checked'";
- }
- con.append("<div class='dept_con_div'>"+
- "<div class='dept_con_div_div'><input type='checkbox' "+isCheck+" name='DUTY_DEPT_ID' id='dept_id_"+id+"' value='"+id+"'/>"+
- "<label for='dept_id_"+id+"' class='pointer'>"+name+"</label></div>"+
- "<div class='linDao_con' id='linDao_con_"+id+"' "+isShow+"><input type='checkbox' "+isCheck1+" name='LINGDAO_DEPT_ID' id='lingDao_id_"+id+"' value='"+id+"'/>"+
- "<label for='lingDao_id_"+id+"' class='pointer'>需要安排带班领导</label></div>"+
- "</div>");
- }
- }
-
- }
- /**
- 通过单位id获取该单位需要值班部门
- **/
- function getDutyDept(){
- var params = {
- corp_id:unitId,
- name:"AM"
- };
- var result;
- $.ajax({
- url : $.pathname() + '/ws/wduty/WarningDutyService/getDutyDept/',
- type : 'post',
- timeout : 15000,
- data : params,
- async:false,
- dataType : 'json',
- success : function(data){
- result = data;
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- return result;
- }
- </script>
- </head>
-
- <body class="bd" align="center" >
- <div id="formContent" class="d_ground">
- <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>
- <form id="editForm">
- <input name="classid" id='classId_dom' value="315" type="hidden" />
- <input name="FD_OBJECTID315" value="" type="hidden">
- <input name="RELEASE_STATE_315" id="RELEASE_STATE_315" value="0" type="hidden">
- <input name="INPUT_PER_NAME_315" id="INPUT_PER_NAME_315" type="hidden">
- <input name="INPUT_PER_ID_315" id="INPUT_PER_ID_315" type="hidden">
- <input name="INPUT_PER_UNIT_NAME_315" id="INPUT_PER_UNIT_NAME_315" type="hidden">
- <input name="INPUT_PER_UNIT_ID_315" id="INPUT_PER_UNIT_ID_315" type="hidden">
- <input name="INPUT_PER_DEPT_NAME_315" id="INPUT_PER_DEPT_NAME_315" type="hidden">
- <input name="INPUT_PER_DEPT_ID_315" id="INPUT_PER_DEPT_ID_315" type="hidden">
- <input name="WAIT_INPUT_DUTY_DEPT_NAME_315" id="WAIT_INPUT_DUTY_DEPT_NAME_315" type="hidden">
- <input name="WAIT_INPUT_LINGDAO_DEPT_NAME_315" id="WAIT_INPUT_LINGDAO_DEPT_NAME_315" type="hidden">
- <input name="WAIT_INPUT_LINGDAO_DEPT_ID_315" id="WAIT_INPUT_LINGDAO_DEPT_ID_315" type="hidden">
- <input name="WAIT_INPUT_DUTY_DEPT_ID_315" id="WAIT_INPUT_DUTY_DEPT_ID_315" type="hidden">
- <!-- 保存和重置 -->
- <div class="button_jl">
- <input value="保存" type="button"id="save" />
- <input value="保存并发布" type="button"id="saveAndRelease" />
- <input value="重置" type="button" onclick="formReset()"/>
- </div><br />
-
- <fieldset class="fieldset">
- <legend class="legend">基本信息:</legend>
- <table class="add_table_style" >
- <tr>
- <td width="15%" align="right" ><span class="star">*</span>任务名称:</td>
- <td width="35%" >
- <input name="PLAN_NAME_315" class="validate[required]" id="PLAN_NAME_315" type="text" value="" maxlength="100" style="width:78%;">
- </td>
- <td align="right" width="15%" >事件名称:</td>
- <td width="35%">
- <select class=" selectWidth " swidth="78%" id="EVENT_ID_315" name="EVENT_ID_315" prompt="请选择" >
- </select>
- </td>
- </tr>
- <tr>
- <td align="right" ><span class="star">*</span>值班开始日期:</td>
- <td >
- <input type="text" id="START_DATE_315" readOnly="readOnly" style="width:78%" name="START_DATE_315" class="dateIcon validate[required]" dateFmt="yyyy-MM-dd" />
- </td>
- <td width="10%" align="right" ><span class="star">*</span>值班截止日期:</td>
- <td >
- <input type="text" id="END_DATE_315" readOnly="readOnly" style="width:78%" name="END_DATE_315" class="dateIcon validate[required]" dateFmt="yyyy-MM-dd" />
- </td>
- </tr>
- <tr>
- <td align="right" width="15%" ><span class="star">*</span>每天:</td>
- <td width="35%">
- <select class="validate[required] selectWidth " swidth="20%" id="DUTY_NUM_315" name="DUTY_NUM_315" >
- </select>
- <span> 个班次</span>
- </td>
- <td width="15%" align="right" ><span class="star">*</span>值班开始时间:</td>
- <td width="35%" >
- <input type="text" id="START_TIME_315" readOnly="readOnly" style="width:78%" name="START_TIME_315" class="validate[required] date" dateFmt="HH:mm" />
- </td>
- </tr>
- <tr>
- <td align="left" width="100%" colspan="4"><span class="star">*</span>需要安排值班的部门:</td>
- </tr>
- <tr>
- <td align="left" width="100%" colspan="4">
- <div id='dept_con' class='dept_con'>
- </div>
- </td>
- </tr>
- </table>
- </fieldset>
- </form>
- </div>
- </body>
|