123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537 |
- <%@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/scripts/business/em/report/utils.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/business/em/report/checkTime.js"></script>
- <script type="text/javascript" src="<%=path%>/scripts/business/am/org/maintenance/orgSel.js"></script>
- <script type="text/javascript" src="<%=path%>/scripts/freamwork/com/sinosoft/system/invoking/invoking.js"></script>
-
- <link href="/nwyj/scripts/showLoading/showLoading.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="/nwyj/scripts/showLoading/jquery.showLoading.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/business/em/response/report/reportInputPlan/ReportInputPlanAddEdit.js"></script>
- <style type="text/css">
- #tbsj input{
- margin-right: 5px;
- }
- </style>
- <script type="text/javascript">
- var fd_id = "<%=request.getParameter("fd_id")%>";
- var isAlert = "<%=request.getParameter("isAlert")%>";
- var warningId = "<%=request.getParameter("warningId")%>";
- var warningNum = "<%=request.getParameter("warningNum")%>";
- //取得用户真实名字
- var realName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
- //部门id
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- //部门名称
- var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
- //父部门id
- var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
- var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- //用于判断该预警编号是否已添加过填报要求
- //用于判断该预警编号是否已添加过填报要求
- var _is_add = false;
- //保存预警名称编号json
- //var earlywa;
- var roles = "";
- //用于确定日期比较结果
- var is_ok_time = true;
- var reportTypeJson = {"list":[
- { "value":"3", "key":"应急工作专报"},
- { "value":"4", "key":"应急工作动态"}]};
- var CorpArea = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- $(function(){
- $("#goback").hover(function(){
- $(this).attr("src","/nwyj/images/temp/back_hover.png");
- },function(){
- $(this).attr("src","/nwyj/images/temp/back.png");
- });
-
- //$("#REPORT_TYPE_320").bind("change",check_add);
- $("#WRITE_DEPT_ID_320").OrgSel({selectedMulti : true,loadId_in:CorpArea,loadCorp:"loadCorp",setMulti : {
- "Y" : "s",
- "N" : ""
- }});
- //获取报告角色
- roles = getReportRole();
-
- //修改表单
- if(!(fd_id=="null"||fd_id=="")){
- $("#titleShow").text("修改响应报告填报要求");
- /* var alerttUrl = $.pathname() + '/ws/plan/ReportInputPlanService/getReportInputPlanAlert/';
- var alertParams = {
- "unitId" : deptId,
- "is_alert" : "1"
- }
- $.post(alerttUrl,alertParams,function(data){
- $("#EARLY_WARNING_NAME_320").data("data",data);
- $("#EARLY_WARNING_NAME_320").render();
- }, "json"); */
- var $parent = $("#EARLY_WARNING_NAME_320").parent();
- // $("#EARLY_WARNING_NAME_320").remove();
- $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%;">');
- $("#EARLY_WARNING_NAME_320").render();
-
- $("#EARLY_WARNING_NAME_320").attr("disabled","disabled");
- //隐藏预警名称
- /* $("#EARLY_WARNING_NAME_320").parent().hide();
- $("#EARLY_WARNING_NAME_320").parent().prev("td").hide();
- $("#EARLY_WARNING_ID_320").parent().attr("colspan","3");
- $("#EARLY_WARNING_ID_320").width("84%"); */
- //预警类别
- //$('#REPORT_TYPE_320').initCanstSelect('BM_ReportInputState');
- $('#REPORT_TYPE_320').data("data",reportTypeJson);
- $('#REPORT_TYPE_320').render();
- var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
- var params = {
- classid : '320',
- objectID : fd_id
- };
- $.request.query(url,params,function(data){
- var temp = "";
- if(data.WRITE_DATE_TYPE_320=="临时性"){
- temp = data.TEMPORARY_TIME_320;
- $("input:radio[name=WRITE_DATE_TYPE_320]").eq(1).attr("checked",true);
- change('temporary');
- }else{
- temp = data.CIRCLE_TIME_320;
- $("input:radio[name=WRITE_DATE_TYPE_320]").eq(0).attr("checked",true);
- change('round');
- }
- if(temp.length-1==temp.lastIndexOf(";")){
- temp = temp.substring(0, temp.length-2);
- }
- var timeArr = temp.split(";");
- for(var i=0;i<timeArr.length;i++){
- if(i!=0){
- $("#addBtn").click();
- }
- $("#time"+i).val(timeArr[i]);
- }
-
- $('#editForm').ajaxWrite({data:data});
- $("#show_WRITE_DEPT_ID_320").val(data.WRITE_DEPT_NAME_320);
- $("#WRITE_DEPT_ID_320").val(data.WRITE_DEPT_ID_320);
- $("#WRITE_DEPT_ID_320_show").val(data.WRITE_DEPT_NAME_320);
- $("#USER_ID_320").val(data.USER_ID_320);
- if(data.REPORT_TYPE_320 == 4){
- $("#tbbm").hide();
- }
- });
- }else{//新增
- $("#titleShow").text("添加响应报告填报要求");
- $("#WRITER_320").val(realName);
- $("#INPUT_DEPT_320").val(deptId);
- $("#WRITE_TIME_320").val(getDateTime());
- $("#USER_ID_320").val(userId);
- change('round');
- var alerttUrl = $.pathname() + '/ws/plan/ReportInputPlanService/getReportInputPlanAlert/';
- $.post(alerttUrl,{unitId : deptId,is_alert : 1},function(data){
- $("#EARLY_WARNING_NAME_320").data("data",data);
- $("#EARLY_WARNING_NAME_320").render();
- $("#EARLY_WARNING_NAME_320").setValue(warningNum);
- getSelectedItem();
- }, "json");
- //预警类别
- //$('#REPORT_TYPE_320').initCanstSelect('BM_ReportInputState');
- $('#REPORT_TYPE_320').data("data",reportTypeJson);
- $('#REPORT_TYPE_320').render();
- }
-
- });
- //置换周期性、临时性
- function change(obj){
- if(obj=="round"){
- $("#addTime").html("");
- var $td=$('<td class="circle_type" colspan="3" fixedCellHeight="true"></td>');
- var $date = $('<input type="text" class="date validate[required] round" id="time0" style="width:200px;" dateFmt="HH:mm" readOnly="readOnly"/>');
- var $add = $('<input type="button" id="addBtn" value="增加"/>');
- var $delete = $('<input type="button" id="addBtn" onclick="deleteTime()" value="删除"/>');
- $add.bind("click",addTime);
- $td.append($date);
- $td.append($add);
- $td.append($delete);
- $("#addTime").append('<td width="15%" align="right" class="circle_type "><span class="star">*</span>每日:</td>');
- $("#addTime").append($td);
- $add.render();
- $delete.render();
- $date.render();
- }
- if(obj=="temporary"){
-
-
- $("#addTime").html("");
- var $td=$('<td class="temporary_type" colspan="3" fixedCellHeight="true"></td>');
- var $date = $('<input type="text" class="date validate[required] temporary" id="time0" style="width:200px;" dateFmt="yyyy-MM-dd HH:mm" readOnly="readOnly"/>');
- var $add = $('<input type="button" id="addBtn" value="增加"/>');
- var $delete = $('<input type="button" id="addBtn" onclick="deleteTime()" value="删除"/>');
- $add.bind("click",addTime);
- $td.append($date);
- $td.append($add);
- $td.append($delete);
- $("#addTime").append('<td width="15%" align="right" class="temporary_type "><span class="star">*</span>填报时间:</td>');
- $("#addTime").append($td);
- $add.render();
- $delete.render();
- $date.render();
-
-
- }
- }
- var timeindex = 0;
- function addTime(){
-
- var obj = getTimeId();
- if(checkTimeAdd("addTime",obj,timeindex)){
- timeindex++;
- var obj = getTimeId();
- var $date = "";
- if(obj=="round"){
- $date = $('<input type="text" id="time'+timeindex+'" class="date validate[required] round" style="width:200px;" dateFmt="HH:mm" readOnly="readOnly"/>');
- }else{
- $date = $('<input type="text" id="time'+timeindex+'" class="date validate[required] temporary" style="width:200px;" dateFmt="yyyy-MM-dd HH:mm" readOnly="readOnly"/>');
- }
- $("#addBtn").before($date);
- $date.render();
- //$("#addBtn").render();
- //$("#addTime").render();
- }
- }
- function deleteTime(){
- var $date = $("#addTime").find(".date");
- if($date.length==1){
- return;
- }else{
- $date.last().remove();
- timeindex--;
- }
- }
- function getTimeId(){
- var $radio = $("#int :radio");
- var obj = "";
- for(var i=0;i<$radio.length;i++){
- if($radio.eq(i).attr("checked")=="checked"){
- obj = $radio.eq(i).attr("id");
- }
- }
-
- return obj;
- }
-
- //获取选中项
- function getSelectedItem(){
- var value = $("#EARLY_WARNING_NAME_320").val();
- if(value){
- $("#EARLY_WARNING_ID_320").val(value);
- $("#PROGRAMME_NAME_320").val(deptName+"_"+value+"响应报告填报要求");
- $("#EARLY_WARNING_320").val($("#EARLY_WARNING_NAME_320").attr("relText"));
- }else{
- $("#EARLY_WARNING_ID_320").val("");
- $("#PROGRAMME_NAME_320").val("");
- }
-
- var node = $("#EARLY_WARNING_NAME_320").data("selectedNode");
- if(node.report_type==4){
- reportTypeJson = {"list":[
- { "value":"3", "key":"应急工作专报"}]};
- }else if(node.report_type==3){
- reportTypeJson = {"list":[
- { "value":"4", "key":"应急工作简报"}]};
- }else{
- reportTypeJson = {"list":[
- { "value":"3", "key":"应急工作专报"},
- { "value":"4", "key":"应急工作简报"}]};
- }
- $('#REPORT_TYPE_320').data("data",reportTypeJson);
- $('#REPORT_TYPE_320').render();
-
- var area_id = node.EARLY_WARNING_AREA_ID;
- var area_name = node.EARLY_WARNING_AREA_NAME;
- $("#show_WRITE_DEPT_ID_320").val(area_name);
- $("#WRITE_DEPT_ID_320").val(area_id);
- $("#WRITE_DEPT_ID_320_show").val(area_name);
- //check_add()
- }
- function check_add(){
- _is_add = false;
- if(fd_id=="null"||fd_id==""){
- var alertId = $("#EARLY_WARNING_ID_320").val();
- var report_type_id = $("input[name=REPORT_TYPE_320]").val();
- if(earlywa){
- for(var i = 0; i < earlywa.rows.length;i++){
- if(earlywa.rows[i].EARLY_WARNING_ID_320==alertId && report_type_id!="" && earlywa.rows[i].REPORT_TYPE_320.indexOf(report_type_id)>=0){
- _is_add = true;
- }
- }
- }
- if(_is_add){
- top.Dialog.alert("不能重复添加响应填报要求,请重新选择!");
- }
- }
- }
- //判定时间
- function checkTime(){
-
- var star = $("#beginTime").val();
- var end = $("#endTime").val();
-
- if(star&&end&&(star>end)){
- top.Dialog.alert("截止日期不能小于起始日期");
- return false;
- }else{
- return true;
- }
-
-
-
- }
- //判断起始时间和截止时间不能小于当前时间
- function decideTime(){
- var star = $("#beginTime").val();
- var end = $("#endTime").val();
-
-
-
- if(star&&end&&(getTime()>star||getTime()>end)){
- top.Dialog.alert("起始日期或截止日期不能小于当前日期");
- return false;
- }else if(star&&(getTime()>star)){
- top.Dialog.alert("起始日期不能小于当前日期");
- return false;
- }
- else{
- return true;
- }
-
- }
- //获取当前时间:年月日
- 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 getVal(){
- $int=$("#int").find("input");
-
- for(var i=0;i<$int.length;i++){
- if($int.eq(i).attr("checked")=="checked"){
- return $int.eq(i).val();
- }
- }
- }
- //检查时间
- function checkTimes(){
- var obj = getTimeId();
- var timeStr = "";
- var startTime = $("#beginTime").val();
- var endTime = $("#endTime").val();
- var $date = $("#addTime").find(".date");
- var timeType = "HH:mm";
- if(obj=="temporary"){
- timeType = "yyyy-MM-dd HH:mm";
- }
- for(var i=0;i<$date.length;i++){
- var time = $date.eq(i).val().trim();
- if(obj=="temporary"){
- var time1 = time.substring(0,10);
- if(startTime&&endTime&&(time1<startTime||time1>endTime)){
- top.Dialog.alert("填报时间要在起始日期和截止日期之间");
- return false;
- }else if(startTime&&(time1<startTime)){
- top.Dialog.alert("填报时间不能小于起始日期");
- return false;
- }
- }
-
- timeStr +=time+';';
-
-
- }
- timeStr = timeStr.substring(0, timeStr.lastIndexOf(";"));
- //timeStrSort(timeStr,"esc",";",timeType)该方法在/nwyj/scripts/freamwork/com/sinosoft/common/common.js中
- //第一个参数为要排序的字符串,第二个参数为倒序或顺序:esc,desc;第三个参数为timeStr中每个时间元素的分割符号;第四个参数为timeStr中元素的时间类型:yyyy-MM-dd HH:mm或HH:mm
- timeStr = timeStrSort(timeStr,"esc",";",timeType);
- if(obj=="temporary"){
- $("#TEMPORARY_TIME_320").val(timeStr);
- }else{
- $("#CIRCLE_TIME_320").val(timeStr);
- }
- return true;
- }
- //改变报告类别时,
- function changeReportType(){
- var reportType = $("#REPORT_TYPE_320").val();
- if(reportType == 3){//应急工作专报
- var value = $("#EARLY_WARNING_NAME_320").val();
- $("#PROGRAMME_NAME_320").val(deptName+"_"+value+"专报填报要求");
-
- var node = $("#EARLY_WARNING_NAME_320").data("selectedNode");
-
- var area_id = node.EARLY_WARNING_AREA_ID;
- var area_name = node.EARLY_WARNING_AREA_NAME;
- $("#show_WRITE_DEPT_ID_320").val(area_name);
- $("#WRITE_DEPT_ID_320").val(area_id);
- $("#WRITE_DEPT_ID_320_show").val(area_name);
-
- $("#tbbm").show();
- }else{//应急工作简报
- var value = $("#EARLY_WARNING_NAME_320").val();
- $("#PROGRAMME_NAME_320").val(deptName+"_"+value+"工作动态填报要求");
-
- $("#tbbm").hide();
- $("#WRITE_DEPT_ID_320").val(roles.split(";")[0]);
- $("#WRITE_DEPT_ID_320_show").val(roles.split(";")[1]);
- $("#show_WRITE_DEPT_ID_320").val(roles.split(";")[1]);
- }
- }
-
- function getReportRole(){
- var rol_name = "";
- var roleid = "";
- $.ajax({
- url : $.pathname() + '/ws/qrps/QueryReportProgrammeService/loadJBRole',
- type : 'post',
- timeout : 15000,
- dataType : 'json',
- data:{"corpId":deptId},
- async:false,
- success : function(data) {
- for (var i = 0; i < data.length; i++) {
- rol_name += data[i].ROLE_NAME+",";
- roleid += data[i].ROLE_ID+",";
- }
- },
- error : function(e) {
- $.messager.alert('访问服务失败!');
- }
- });
- if(rol_name.lastIndexOf(",")==rol_name.length-1){
- rol_name = rol_name.substring(0,rol_name.length-1);
- }
- if(roleid.lastIndexOf(",")==roleid.length-1){
- roleid = roleid.substring(0,roleid.length-1);
- }
- return roleid + ";" + rol_name;
- }
-
- </script>
- </head>
- <body class="bd" align="center" >
- <div id="formContent" class="d_ground">
- <div class="title" align="center"><a href="javascript:;"><img id='goback' title="返回" class="back" title="返回" align="left" alt="返回" title="返回" src="/nwyj/images/temp/back.png" ></img></a><font class="title_font" id="titleShow"></font></div>
- <form id="editForm">
- <input name="classid" value="320" type="hidden" />
- <input type="hidden" name="FD_OBJECTID320" value=""/>
- <input name="WRITE_DEPT_NAME_320" id="WRITE_DEPT_NAME_320" type="hidden">
- <input name="IS_RELEASE_320" id="IS_RELEASE_320" value="0" type="hidden">
- <input name="WRITER_320" id="WRITER_320" value="0" type="hidden">
- <input name="WRITE_TIME_320" id="WRITE_TIME_320" type="hidden">
- <input name="INPUT_DEPT_320" id="INPUT_DEPT_320" type="hidden">
- <input id="IS_ALERT_320" name="IS_ALERT_320" value="1" type="hidden"/>
- <input id="EARLY_WARNING_320" name="EARLY_WARNING_320" value="" type="hidden"/>
- <input id="TEMPORARY_TIME_320" name="TEMPORARY_TIME_320" value="" type="hidden"/>
- <input id="CIRCLE_TIME_320" name="CIRCLE_TIME_320" value="" type="hidden"/>
- <input id="USER_ID_320" name="USER_ID_320" value="" type="hidden"/>
- <input name="EARLY_WARNING_ID_320" type="hidden" id="EARLY_WARNING_ID_320"/>
- <!-- 保存和重置 -->
- <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 align="right" width="15%" ><span class="star">*</span>响应编号:</td>
- <td width="35%"><select class="validate[required] selectWidth " swidth="78%"
- id="EARLY_WARNING_NAME_320" name="EARLY_WARNING_NAME_320" prompt="请选择" onchange="getSelectedItem();">
- </select></td>
- <!-- <td width="15%" align="right"><span class="star">*</span>应急响应编号:</td>
- <td width="35%" ><input name="EARLY_WARNING_ID_320" class="validate[required]"
- id="EARLY_WARNING_ID_320" readonly="readonly" type="text" value="" maxlength=""
- style="width:90%"></td> -->
- <td width="15%" align="right" ><span class="star">*</span>填报要求名称:</td>
- <td width="35%" ><input name="PROGRAMME_NAME_320" class="validate[required]"
- id="PROGRAMME_NAME_320" type="text" value="" maxlength="80"
- style="width:78%"></td>
- </tr>
- <tr>
- <td align="right" ><span class="star">*</span>报告类别:</td>
- <td >
- <!-- <div name="REPORT_TYPE_320" class="selectTree validate[required] selectWidth " swidth="78%" id="REPORT_TYPE_320" multiMode="true" onchange="check_add();">
- </div> -->
- <select class="validate[required] selectWidth " swidth="78%"
- id="REPORT_TYPE_320" name="REPORT_TYPE_320" prompt="请选择" onchange="changeReportType();">
- </select>
- </td>
- <td></td>
- <td></td>
- </tr>
- <tr id="tbbm">
- <td align="right" ><span class="star">*</span>填报单位:</td>
- <td colspan="3"><div id="WRITE_DEPT_ID_320" allclickset="1" ></div></td>
- </tr>
- <tr>
- <td align="right" ><span class="star">*</span>起始日期:</td>
- <td ><input type="text" id="beginTime" readOnly="readOnly" style="width:78%"
- name="START_TIME_320" class="date validate[required]" dateFmt="yyyy-MM-dd" onchange="checkdate()"/></td>
- <td width="10%" align="right" >截止日期:</td>
- <td ><input type="text" id="endTime" readOnly="readOnly" style="width:78%"
- name="EXPIRATION_DATE_320" class="date" dateFmt="yyyy-MM-dd" onchange="checkdate()"/> </td>
- </tr>
- <tr>
- <td align="right" ><span class="star">*</span>填报时间表:</td>
- <td colspan="3" id="int">
- <input type="radio" value="周期性" id="round" checked="checked" name="WRITE_DATE_TYPE_320" onclick="change('round');">
- <label for="round">周期性</label>
- <input type="radio" value="临时性" id="temporary" name="WRITE_DATE_TYPE_320" onclick="change('temporary');">
- <label for="temporary" >临时性</label>
- <!-- <input type="radio" id="male-1" name="WRITE_DATE_TYPE_320" value="周期性" checked="checked"/>
- <label for="male-1" class="hand">周期性</label>
- <input type="radio" id="female-1" name="WRITE_DATE_TYPE_320" value="临时性"/>
- <label for="female-1" class="hand">临时性</label> -->
- </td>
- </tr>
- <tr id="addTime"></tr>
- </table>
- </fieldset>
- </form>
- </div>
- </body>
|