123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005 |
- $(function(){
-
- //**加载下拉框的值*//*
- //突发事件类型
- $('#BYSUNESS_TYPE_214').initCanstSelect('BM_BYSUNESS_TYPE');
- var fd_id = (window.location.href).split('?')[1];
- $('#fileDiv').newAsyncFileUpload("",fd_id,1);
-
- $("#INS_UNITS_2141").OrgSel({valuetype:"renyuanguangli"});//归口部门
- $("#show_INS_UNITS_2141").attr("class","validate[functionCall[func1|* 不能选择本部]]");
-
- var AreaSql = "select FD_CODE,PARENT_ID,FD_DESCRIPTION from BM_MAPVALUECANST where FD_TYPE = 'BM_YAXHLB'";
- //细化类别
- var treeUrl = $.pathname() + '/ws/sys/constantService/getTreeCanst/';
- var params = {
- sql:AreaSql
- };
- $.ajax({
- url : treeUrl,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- async: false,
- success : function(data){
-
- $("#PLAN_REFINE_CATEGORY1_214").data("data",data[0].constlist);
- $("#PLAN_REFINE_CATEGORY1_214").render();
- }});
-
- $abc = $("#PLAN_REFINE_CATEGORY1_214");
- $abc.bind('change',function(){
- test();
- });
-
- $("#goback").hover(function(){
- $(this).attr("src","/nwyj/images/temp/back_hover.png");
- },function(){
- $(this).attr("src","/nwyj/images/temp/back.png");
- });
- });
- function func1(){
- if($("#INS_UNITS_2141").val()=="benbu999"){
- return true;
- }
- return false;
- }
- //包含的突发事件类型要能够自动匹配突发事件类型伊瑚bug2716
- function initComplete(){
-
- //绑定change事件
-
- $("#PLAN_REFINE_CATEGORY1_214").bind("change",function(){
-
- if(!$(this).attr("relValue")){
-
- top.Dialog.alert("请选择突发事件类型!");
-
- }else{
- //取父节点的ID,跟局父节点的ID给突发事件类型重新赋值。
- var node=$(this).data("selectedNode");
- if(node.parentId=="0"){
- $("#BYSUNESS_TYPE_214").setValue("105");
- }else if(node.parentId=="1"){
- $("#BYSUNESS_TYPE_214").setValue("106");
- }else if(node.parentId=="2"){
- $("#BYSUNESS_TYPE_214").setValue("107");
- }else if(node.parentId=="3"){
- $("#BYSUNESS_TYPE_214").setValue("108");
- }else if(node.parentId=="20"){
- $("#BYSUNESS_TYPE_214").setValue("109");
- }
- }
-
- });
-
- }
-
-
-
- // 修订页面的附件有误导,选择修订后应该将之前的附件隐藏 刘主管提的
- function changeFile(){
- var changeValue =$("#PLAN_STURTS_214").val();
- //修订或者修正状态下隐藏前面的附件。
- if(changeValue=="2"||changeValue=="3"){
- $(".div1").hide();
- }else{
- $(".div1").show();
- }
- }
- function getUserInfo(userID){
-
- var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
- var params = {
- classid : '880',
- objectID : userID
- };
-
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
- var MOBILE = data.MOBILE_880; //手机
- var COMPANY_ID = data.COMPANY_ID_880_SHOW;//所属单位
- var ORG_ID = data.ORG_ID_880_SHOW;//所属部门
- var userName = data.REAL_NAME_880;
-
- $("#ENTERING_214_SHOW").html(userName);
- $("#ENTERING_TEL_214").html(MOBILE);
-
- $("#INS_UNITS_214_SHOW").html(ORG_ID);
-
- },
- error : function(e){
- top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
-
- var nn = "";
-
- //如果是总体预案,设置突发事件类型为不可用
- function setSelectDisabled3(obj){
- //如果时候总体预案,设置突发事件类型为不可用,包含的突发事件为所有
- var selectValue = $(obj).val();
- changeValue = selectValue;
-
- if(changeValue=="102"){
-
- //如果是总体预案,设置突发事件类型为不可用
- //如果是总体预案,设置突发事件类型为不可用
- $("#BYSUNESS_TYPE_214").attr("selectedValue","109");
- $("#BYSUNESS_TYPE_214").attr("class","");
- $("#BYSUNESS_TYPE_214").attr("disabled",true);
- $("#BYSUNESS_TYPE_214").render();
- //总体预案包含的突发事件类型为所有
-
- $("#PLAN_REFINE_CATEGORY1_214").attr("multiMode","true");
-
- /***************控制IE8报错的问题 选择为总体预案时 start---********************/
- $("#PLAN_REFINE_CATEGORY1_214").attr("class","selectTree ");
- //$("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue","0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18");
- /***************控制IE8报错的问题 选择为总体预案时 end---********************/
-
- //2016-05-27湛江局许永山说总体预案是综合类的。
- $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue","19");
-
- $("#PLAN_REFINE_CATEGORY1_214").attr("disabled",true);
- $("#PLAN_REFINE_CATEGORY1_214").render();
- //归口部门为必输字段
- $("#INS_UNITS_214").attr("class","validate[required]");
- $("#INS_UNITS_214").attr("selectedValue","112");
- $("#INS_UNITS_214").attr("disabled",true);
- $("#INS_UNITS_214").render();
- //预案编码为必输
- $('#PLAN_NO_214').attr("disabled",false);
- $('#PLAN_NO_214').val("");
- }else if(changeValue=="103"){
-
- //突发事件类型可用、必输
- $("#BYSUNESS_TYPE_214").attr("disabled",false);
- $("#BYSUNESS_TYPE_214").attr("class","validate[required]");
- $("#BYSUNESS_TYPE_214").render();
-
- var bysunessValue = $('#BYSUNESS_TYPE_214').val();
- //包含的突发事件可用、必输
- //reInitCategory(bysunessValue);
-
- $("#PLAN_REFINE_CATEGORY1_214").attr("disabled",false);
- $("#PLAN_REFINE_CATEGORY1_214").attr("class","selectTree validate[required]");
-
- $("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue",nn);
- $("#PLAN_REFINE_CATEGORY1_214").attr("multiMode","false");
-
- $("#PLAN_REFINE_CATEGORY1_214").render();
-
- /********中山局现场培训后修改,中山局提出归口部门用组织机构***********/
- /*//归口部门
- $("#INS_UNITS_214").attr("disabled",false);
- $("#INS_UNITS_214").attr("class","validate[required]");
- //$("#INS_UNITS_214").attr("selectedValue","");
- $("#INS_UNITS_214").render();*/
-
- //预案编码为必输
- $('#PLAN_NO_214').attr("disabled",false);
- $('#PLAN_NO_214').val("");
- }else if(changeValue=="104"||changeValue=="105"){//突发事件类型可用、必输
- $("#BYSUNESS_TYPE_214").attr("disabled",false);
- $("#BYSUNESS_TYPE_214").attr("class","validate[required]");
- //$("#BYSUNESS_TYPE_214").attr("selectedValue","");
- $("#BYSUNESS_TYPE_214").render();
- //包含的突发事件可用、必输
- $("#PLAN_REFINE_CATEGORY1_214").attr("disabled",false);
- $("#PLAN_REFINE_CATEGORY1_214").attr("class","selectTree validate[required]");
- //$("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue","");
- $("#PLAN_REFINE_CATEGORY1_214").attr("multiMode","true");
- $("#PLAN_REFINE_CATEGORY1_214").render();
-
- /********中山局现场培训后修改,中山局提出归口部门用组织机构***********/
- //归口部门
- /*$("#INS_UNITS_214").attr("disabled",false);
- $("#INS_UNITS_214").attr("class","validate[required]");
- //$("#INS_UNITS_214").attr("selectedValue","");
- $("#INS_UNITS_214").render();*/
- //预案编码为必输
- $('#PLAN_NO_214').attr("disabled",false);
- $('#PLAN_NO_214').val("");
- }else if(changeValue=="106"){
- $("#BYSUNESS_TYPE_214").attr("disabled",true);
- $("#BYSUNESS_TYPE_214").attr("class","");
- //$("#BYSUNESS_TYPE_214").attr("selectedValue","");
- $("#BYSUNESS_TYPE_214").render();
- //包含的突发事件可用、必输
- $("#PLAN_REFINE_CATEGORY1_214").attr("disabled",true);
- $("#PLAN_REFINE_CATEGORY1_214").attr("class","selectTree ");
- //$("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue","");
- $("#PLAN_REFINE_CATEGORY1_214").attr("multiMode","true");
- $("#PLAN_REFINE_CATEGORY1_214").render();
-
- /********中山局现场培训后修改,中山局提出归口部门用组织机构***********/
- //归口部门
- /*$("#INS_UNITS_214").attr("disabled",true);
- $("#INS_UNITS_214").attr("class","");
- //$("#INS_UNITS_214").attr("selectedValue","");
- $("#INS_UNITS_214").render();*/
- //预案编码为必输
- //$('#PLAN_NO_214').val(" ");
- $('#PLAN_NO_214').attr("disabled","disabled");
- //$('#PLAN_NO_214').attr("class","");
-
- }
- }
-
-
- //重新获取包含的突发事件过滤,不需要所有的都加载。
- function reInitCategory(){
- //取突发事件类型的值
- var bysunes = $('#BYSUNESS_TYPE_214').val();
- if(bysunes==""){
- top.Dialog.alert("请选择突发事件类型!");
- return;
- };
- //定义转换突发事件类型的变量,因为当时存入库表的时候没有考虑周全,需要转换。
- var parnet_id = "";
- if(bysunes=="105"){
- parnet_id = "0";
- }else if(bysunes=="106"){
- parnet_id = "1";
- }else if(bysunes=="107"){
- parnet_id = "2";
- }else if(bysunes=="108"){
- parnet_id = "3";
- }
-
- //var AreaSql = "select FD_CODE,PARENT_ID,FD_DESCRIPTION from BM_MAPVALUECANST where FD_TYPE = 'BM_YAXHLB' and parent_id = '"+parnet_id+"'";
-
- //细化类别
- //var treeUrl = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/reInitCategory';
-
- var AreaSql = "select FD_CODE,PARENT_ID,FD_DESCRIPTION from BM_MAPVALUECANST where FD_TYPE = 'BM_YAXHLB' and parent_id = '"+parnet_id+"'";
- //细化类别
- var treeUrl = $.pathname() + '/ws/sys/constantService/getTreeCanst/';
-
-
- var params = {
- sql:AreaSql
- };
- $.ajax({
- url : treeUrl,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- async: false,
- success : function(data){
-
- $("#PLAN_REFINE_CATEGORY1_214").data("data",data[0].constlist);
- $("#PLAN_REFINE_CATEGORY1_214").render();
- $("#PLAN_REFINE_CATEGORY1_214").attr("relValue","");
- // mydata = data[0].constlist;
- }});
-
- }
-
- //单位ID
- var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- var parent_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+""; //登录人ID
- var time = "";
- var PLAN_BIAOZHI="";
- var UPLOAND_FLAG="";
- var PLAN_VERSION_REMARK="";
-
- //修改表单信息,获取记录
- if((window.location.href).indexOf('?')>-1){
- var fd_id = (window.location.href).split('?')[1];
- var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
- var params = {
- classid : '214',
- objectID : fd_id
- };
-
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
- $('#fillForm').ajaxWrite({data:data});
- $('#fillForm input[name="classid"]').val('214');
- nn = data.PLAN_REFINE_CATEGORY_214;
- PLAN_BIAOZHI = data.PLAN_BIAOZHI_214;
- var UPDATEDATE_214 = data.UPDATEDATE_214;
- $("#UPDATEDATE_214").html(UPDATEDATE_214);
-
- $("#show_INS_UNITS_2141").val(data.INS_UNITS_214_SHOW);
-
-
- var userID = data.ENTERING_214;
- getUserInfo(userID);
- $("#UNITS_214_DIV_SHOW").html(data.UNITS_214_SHOW);
- //$("#PLAN_REFINE_CATEGORY1_214").render();
-
- var PLAN_TYPE_214 = data.PLAN_TYPE_214;
- /* if(PLAN_TYPE_214=="102"){
- $("#BYSUNESS_TYPE_214").attr("class","");
- $("#BYSUNESS_TYPE_214").attr("disabled",true);
- $("#BYSUNESS_TYPE_214").render();
- }else{
- $("#BYSUNESS_TYPE_214").attr("class","validate[required]");
- $("#BYSUNESS_TYPE_214").attr("disabled",false);
- $("#BYSUNESS_TYPE_214").render();
- }*/
-
- if(PLAN_TYPE_214=="102"){
- //如果是总体预案,设置突发事件类型为不可用
- $("#BYSUNESS_TYPE_214").attr("class","");
- $("#BYSUNESS_TYPE_214").attr("disabled",true);
- $("#BYSUNESS_TYPE_214").render();
- //总体预案包含的突发事件类型为所有
- //PLAN_REFINE_CATEGORY1_214
- $("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue",nn);
- //$("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue","0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18");
- $("#PLAN_REFINE_CATEGORY1_214").attr("class","selectTree");
- $("#PLAN_REFINE_CATEGORY1_214").attr("disabled",true);
- $("#PLAN_REFINE_CATEGORY1_214").render();
-
- /********中山局现场培训后修改,中山局提出归口部门用组织机构***********/
- /*$("#INS_UNITS_214").attr("class","validate[required]");
- $("#INS_UNITS_214").attr("selectedValue","112");
- $("#INS_UNITS_214").attr("disabled",true);
- $("#INS_UNITS_214").render();*/
- }else
- /*{
- $("#BYSUNESS_TYPE_214").attr("class","validate[required]");
- $("#BYSUNESS_TYPE_214").attr("disabled",false);
- $("#BYSUNESS_TYPE_214").render();
- //非总体预案设置包含的突发事件类型为自己手动选择
- $("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue","");
- $("#PLAN_REFINE_CATEGORY1_214").render();
- }*/
-
- //选择专项预案的时候包含的突发事件只能选择一个,包含的突发事件类型为必输项
- if(PLAN_TYPE_214=="103"){
- //如果是专项预案,设置包含的突发事件类型只能选择一个
- //reInitCategory();
- $("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue",nn);
- $("#PLAN_REFINE_CATEGORY1_214").attr("multiMode","false");
- $("#PLAN_REFINE_CATEGORY1_214").render();
-
- /********中山局现场培训后修改,中山局提出归口部门用组织机构***********/
- /*$("#INS_UNITS_214").attr("class","validate[required]");
- $("#INS_UNITS_214").attr("disabled",false);
- $("#INS_UNITS_214").render();*/
-
- }else
- /*{
- $("#PLAN_REFINE_CATEGORY1_214").attr("multiMode","true");
- $("#PLAN_REFINE_CATEGORY1_214").render();
- }*/
-
- //如果是政府预案,预案编码、责任部门不需要填写,包含的突发事件不需要填写。
- if(PLAN_TYPE_214=="106"){
- $("#BYSUNESS_TYPE_214").attr("disabled",true);
- $("#BYSUNESS_TYPE_214").attr("class","");
- $("#BYSUNESS_TYPE_214").attr("selectedValue","");
- $("#BYSUNESS_TYPE_214").render();
-
- /********中山局现场培训后修改,中山局提出归口部门用组织机构***********/
- //归口部门
- /*$("#INS_UNITS_214").attr("disabled",true);
- $("#INS_UNITS_214").attr("class","");
- $("#INS_UNITS_214").attr("selectedValue","");
- $("#INS_UNITS_214").render();*/
-
- //包含的突发事件
- $("#PLAN_REFINE_CATEGORY1_214").attr("disabled",true);
- $('#PLAN_REFINE_CATEGORY1_214').attr("class","selectTree ");
- $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue","");
- $("#PLAN_REFINE_CATEGORY_214").attr("multiMode","true");
- $("#PLAN_REFINE_CATEGORY1_214").render();
- $("#PLAN_NO_214").attr("disabled",true);
- $('#PLAN_NO_214').val(" ");
-
- }else{
- //reInitCategory();
- /********中山局现场培训后修改,中山局提出归口部门用组织机构***********/
- /*$("#INS_UNITS_214").attr("disabled",false);
- $("#INS_UNITS_214").attr("class","validate[required]");
- $("#INS_UNITS_214").render();*/
-
- $("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue",nn);
- $("#PLAN_REFINE_CATEGORY1_214").attr("class","selectTree validate[required]");
- $("#PLAN_REFINE_CATEGORY1_214").render();
-
- $("#PLAN_NO_214").attr("disabled",false);
- $("#PLAN_NO_214").addClass("class","validate[required]");
- }
-
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
-
-
-
- var file ="";
-
- //取系统时间:年月日时分秒
- var date = allGetServerTime();
- var seperator1 = "";
- var seperator2 = "";
- var month = date.getMonth() + 1;
- var strDate = date.getDate();
- if (month >= 1 && month <= 9) {
- month = "0" + month;
- }
- if (strDate >= 0 && strDate <= 9) {
- strDate = "0" + strDate;
- }
- time = date.getFullYear() + seperator1 + month + seperator1 + strDate
- + "" + date.getHours() + seperator2 + date.getMinutes()
- + seperator2 + date.getSeconds();
-
- //删除原来信息
- function del(){
- // 删除记录
- $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
- "objectIDs" : fd_id,
- classid : 214
- }, function(result) {
- if (result.Msg.sucsess == true) {
- //$.messager.alert("废止上一版本预案",null,null,null,1);
- // 刷新表格数据
- //g.loadData();
- } else {
- top.Dialog.alert("废止失败!");
- }
- }, "json");
- }
-
- function feizhicexiao(num){
- $.post($.pathname() +"/ws/EmcPlan/EmgencyPlanService/feizhichexiao/", {
- "id" : fd_id,
- "num" : num
- }, function(result) {
- if (result.Msg.sucsess == true) {
- if(num=="4"){
- $.messager.alert("废止成功",null,null,null,-1);
- }else{
- $.messager.alert("撤销成功",null,null,null,-1);
- }
- var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlan.jsp";
- top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- return;
- } else {
- top.Dialog.alert("操作失败!");
- }
- }, "json");
- }
- var temp = "";
- function test(){
- var getValue = $("#PLAN_REFINE_CATEGORY1_214").attr('relValue');
- if(getValue=="0"||getValue=="1"||getValue=="2"||getValue=="3"||getValue=="20"){
- top.Dialog.alert('选择具体的预案!');
- $("#PLAN_REFINE_CATEGORY1_214").resetValue();
- return;
- }else{
- if(getValue=="4"||getValue=="5"||getValue=="6"||getValue=="7"||getValue=="21"||getValue=="23"){
- temp = "106";
- }else if(getValue=="9"||getValue=="10"||getValue=="11"){
- temp = "105";
- }else if(getValue=="8"||getValue=="18"){
- temp = "107";
- }else if(getValue=="22"||getValue=="25"){
- temp = "109";
- }else{
- temp = "108";
- }
- }
- }
-
- //表单验证
- function validateForm(containerId){
- // test();
- var plantype = $("#PLAN_TYPE_214").val();//预案类型
- var ywfl = $("#BYSUNESS_TYPE_214").val();//突发事件类型
-
- var category = $("#PLAN_REFINE_CATEGORY_214").attr('relValue');//包含的突发事件
- /********中山局现场培训后修改,中山局提出归口部门用组织机构***********/
- var unit = $("#INS_UNITS_2141").val();//责任部门
- var name = $("#PLAN_NAME_214").val();//预案名称
- var plannmo = $("#PLAN_NO_214").val();//预案编码
- var takeDate = $("#TAKE_DATE_214").val();//颁布日期
- var makeDate = $("#ISSUE_DATE_214").val();//实施日期
- // var syfw = $("#SYFW_214").val();//简要说明
- if(plantype=="103"){
- test();
- }
-
-
- var valid = $(containerId).validationEngine({returnIsValid: true});
- if(valid == true){
- //时间判断
-
- if(makeDate!=""&&makeDate!=null&&makeDate!=undefined){
- if(makeDate<takeDate){
- top.Dialog.alert("实施日期不能比颁布日期提前!");
- return;
- }
- }
-
- var change = $('#CHANGE_TYPE').val();
- if(change=="111"){
- var ids = (window.location.href).split('?')[1];
- top.Dialog.confirm("确定要撤销吗?|撤销", function() {
- // 删除记录
- $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
- "objectIDs" : ids,
- classid : 214
- }, function(result) {
- if (result.Msg.sucsess == true) {
- //$.messager.alert("撤销成功",null,null,null,1);
- goBack();
- } else {
- top.Dialog.alert("删除失败!");
- }
- }, "json");
-
- });
- return;
- }else{
- var flag = false;
- var obj = document.getElementsByName("uploaderFileName");
- for(var i =0;i<obj.length;i++){
- if(obj[i].id.length<30){
- flag = true;
- }
- }
- var zhuangtai=$("#PLAN_STURTS_214").attr('relValue');
- if(zhuangtai=="2"||zhuangtai=="3"){
- if(!flag){
- top.Dialog.alert("请选择上传的文件!");
- return;
- }
-
- //先删除原来记录。
- del();
- $("#fd_id214").val("");
- if(unit!=""){
- $("#INS_UNITS_214").val(unit);
- }
- //再新增记录
- add();
-
- }else if(zhuangtai=="5"){
-
- top.Dialog.confirm("确定要撤销吗?|撤销", function() {
- // 删除记录
- $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
- "objectIDs" : fd_id,
- classid : 214
- }, function(result) {
- if (result.Msg.sucsess == true) {
- // $.messager.alert("撤销成功",null,null,null,-1);
- feizhicexiao("5");
- // var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlan.jsp";
- // top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- // return;
- } else {
- top.Dialog.alert("撤销失败!");
- return;
- }
- }, "json");
-
- });
- }else if(zhuangtai=="4"){
-
- top.Dialog.confirm("确定要废止吗?|废止", function() {
- // 删除记录
- $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
- "objectIDs" : fd_id,
- classid : 214
- }, function(result) {
- if (result.Msg.sucsess == true) {
- // $.messager.alert("废止成功",null,null,null,-1);
- feizhicexiao("4");
- // var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlan.jsp";
- // top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- // return;
- } else {
- top.Dialog.alert("废止失败!");
- return;
- }
- }, "json");
-
- });
- }else{
- //变更类型
- $('#CHANGE_TYPE_214').val(110);
- //单位ID
- $("#UNITS_214").val(parent_id);
- //发布状态、上报状态写死为0
- if(unit!=""){
- $("#INS_UNITS_214").val(unit);
- }
- edit();
- }
- }
- //取上传附件容器的值,如果为空,则为单纯修改预案基本信息。如不为空,则为修订预案,重新上传预案。
-
- }else{
-
- if(plantype==""){
- top.Dialog.alert('请选择预案类型!');
- return;
- }
- var PLAN_TYPE_214 =$("#PLAN_TYPE_214").val();
- if(PLAN_TYPE_214=="103"){
- if(ywfl==""){
- top.Dialog.alert('请选择突发事件类型!');
- return;
- }
- }
- if(plantype!="106"){
- if(category==""){
- top.Dialog.alert('请选择包含的突发事件!');
- return;
- }
- }
- //责任部门
- /*if(PLAN_TYPE_214!="106"){
- if(unit==""){
- top.Dialog.alert('请选择归口部门!');
- return;
- }
- }*/
- if(unit=="benbu999"){
- top.Dialog.alert('归口部门不能为本部!');
- return;
- }
- //预案名称
- if(name==""){
- top.Dialog.alert('预案名称填写不正确,请按要求填写!');
- return;
- }
- //预案编码
- if(PLAN_TYPE_214!="106"){
- if(plannmo==""){
- top.Dialog.alert('预案编码填写不正确,请按要求填写!');
- return;
- }
- }
- //颁布日期
- if(takeDate==""){
- top.Dialog.alert('颁布日期,请按要求填写!');
- return;
- }
- if(makeDate==""){
- top.Dialog.alert('实施日期,请按要求填写!');
- return;
- }
- // if(syfw==""){
- // top.Dialog.alert('简要说明填写不正确,请按要求填写!');
- // return;
- // }
- // if(explain==""){
- // top.Dialog.alert('简要说明填写不正确,请按要求填写!');
- // return;
- // }
-
- top.Dialog.alert('请检查标红输入框!');
- return;
- }
- }
-
- function redPlanDeptp(data){
-
- diag = new top.Dialog();// 定义一个窗口对象
- diag.Title = "选择关联的专项预案";// 窗口标题
- diag.URL = $.pathname() +"/page/business/am/contingencyPlan/PlanGuanlian.jsp?"+data;// 窗口对应的页面
- diag.Height = 500;
- diag.Width =600;
- diag.ShowOkButton=false;// 不显示确认按钮
- diag.ShowCancelButton=false;// 不显示取消按钮
- diag.ButtonAlign="center";// 按钮居中
- diag.show();// 显示窗口
- }
-
- //取复选框勾选的值
- var strRO="";
- function add(containerId){
-
- /* //取文件的名称
- var obj = document.getElementsByName("uploaderFileName");
- var objtemp = obj[0].value;
- //取文件的类型
- var objType = document.getElementsByName("uploaderFileExt");
- var objTypetemp = objType[0].value;
-
- //alert("文件名是:" + objtemp +"."+ objTypetemp);
- file = objtemp +"."+ objTypetemp;
- //将更新时间字段的name替换一下
- $("#UPDATEDATE_214").attr("name","PLAN_ID_214");
- test();
- //var file = $("#uploaderFileName").val();
- var ldot = file.lastIndexOf(".");
- var type ="."+ file.substring(ldot + 1);
- var pos=file.lastIndexOf("\\");
- var filename = file.substring(pos+1,ldot);
-
- //**将部门预案和专项、总体预案进行绑定,用COLUMN_1的字段。将专项、总体预案ID存到COLUMN_1这个字段里。以备后面所用。*//*
- //取勾选的预案ID
- // var selectNodesRO = $("#selectTree5-1").data("selectedNodes");
- // for(var i=0;i<selectNodesRO.length;i++){
- // strRO += selectNodesRO[i].id;
- // }
- var tempFile = file.split(",");
- if(tempFile.length>1){
- top.Dialog.alert("只允许上传一个附件,请检查是否只上传了一个附件。");
- return;
- }
-
- if(file.length>200){
- top.Dialog.alert("您上传的附件名称太长,请重命名后上传。");
- return;
- }*/
-
- //取文件的名称
- var files = document.getElementsByName("uploaderFileName");
- //取文件的类型
- var filetype = document.getElementsByName("uploaderFileExt");
- /* if(files.length>0){
- for(var i=0 ;i<files.length;i++ ){
- var d = filetype[i].value;
- if(d!="doc"&&d!="pdf"&&d!="zip"&&d!="docx"){
- top.Dialog.alert('您上传的文件格式不合法,请上传.doc、.pdf或.zip格式的文件!');
- return;
- }
- }
- }*/
-
-
- //取系统时间
- var date = allGetServerTime();
- var seperator1 = "";
- var seperator2 = "";
- var month = date.getMonth() + 1;
- var strDate = date.getDate();
- if (month >= 1 && month <= 9) {
- month = "0" + month;
- }
- if (strDate >= 0 && strDate <= 9) {
- strDate = "0" + strDate;
- }
- var PLAN_EN_TIME_214 = date.getFullYear() + "-" + month +"-" + strDate;
-
-
- //删除上一版本上传的文件
- var fdobj = document.getElementsByName("uploaderFileObjectid");
-
- for(var i=fdobj.length; i>0; i--){
- var id = fdobj[0].id;
- id = id.replace("uploaderFileObjectid","");
-
- //大于30说明是从数据库查出来的附件
- if(id.length==30){
- $("#uploaderFileObjectid"+id).remove();
- $("#uploaderFileRealName"+id).remove();
- $("#uploaderFileName"+id).remove();
- $("#uploaderFileExt"+id).remove();
- }
- }
- $('#DZ_FILE_214').val(PLAN_EN_TIME_214);
- $("#COLUMN_1_214").val();
- $("#UNITS_214").val(parent_id);
- $("#REMARK1_214").val(getUser_id);
- var name = $("#PLAN_NAME_214").val();//预案名称
- $("#VERSION_214").val(name+time+"版本");
- //存上一个预案的主键 PLAN_BIAOZHI_214
- if(PLAN_BIAOZHI=="0"){
- $("#PLAN_BIAOZHI_214").val(fd_id);
- }else{
- $("#PLAN_BIAOZHI_214").val(PLAN_BIAOZHI);
- }
- var plantype = $("#PLAN_TYPE_214").val();
- if(plantype=="103"){
- $("#BYSUNESS_TYPE_214").val(temp);
- }
- $("#UPLOAND_FLAG_214").val("1");
- $("#PLAN_VERSION_REMARK_214").val(fd_id);
- var category = $("#PLAN_REFINE_CATEGORY1_214").attr('relValue');
- $("#PLAN_REFINE_CATEGORY_214").val(category);
-
- var $form=$("#fillForm");
- var formValue = $form.serialize();
- var url = $.pathname() +"/ws/uploadForm/FileUpDownService/asyncFileUpLoad";
- $.request.add(url,formValue,function(data){
- var plantype = $("#PLAN_TYPE_214").val();//预案类型
- if(plantype=="103"){
- top.Dialog.confirm("要绑定该预案吗?|绑定", function() {
- var fd_id1 = data.Msg.objectID;
- var category = $("#PLAN_REFINE_CATEGORY_214").val();//包含的突发事件
- var url = "";
- if(PLAN_BIAOZHI=="0"){
- url = "/nwyj/page/business/am/contingencyPlan/"+"PlanNexus.jsp?"+fd_id1+"?"+fd_id+"?"+category+"?"+name;
- }else{
- url = "/nwyj/page/business/am/contingencyPlan/"+"PlanNexus.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?"+category+"?"+name;
- }
- window.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- },function(){
- top.Dialog.alert("修改成功!");
- goBack();
- });
- }else{
- top.Dialog.alert("修改成功!");
- goBack();
- }
-
- });
- // var $form=$("#fillForm");
- // var url = $.pathname() +"/ws/uploadForm/FileUpDownService/fileUpLoad";
- // fileToSaveAdd($form,null,null,url);
- // }else{
- // top.Dialog.alert('请检查标红输入框!');
- // };
- }
-
- //预案修订的情况下调用新增的方法:
- function fileToSaveAdd($form,listGrid,msg,url){
- showProgressBar("正在提交中...");
- //表单异步提交处理
- $form.ajaxSubmit({
- type: 'post',
- url:url,
- //表单提交成功后的回调
- success: function(responseText, statusText, xhr, $form){
- responseText = eval('('+responseText+')');
- closeProgress();
- top.Dialog.alert("修改成功!",null,null,null,-1);
- // if(msg!=undefined){
- // if(responseText.info == 'success')
- // top.Dialog.alert(msg+'成功!');//弹出提示
- // else
- // top.Dialog.alert(msg+'失败!');//弹出提示
- // }else{
- // if(responseText.info == 'success')
- // top.Dialog.alert('添加成功!');//弹出提示
- // else
- // top.Dialog.alert('添加失败!');//弹出提示
- // }
- goBack();
- }
- });
- }
-
- //修改
- function edit(){
- var plantype = $("#PLAN_TYPE_214").val();
- if(plantype=="103"){
- test();
- $("#BYSUNESS_TYPE_214").val(temp);
- }
- var category = $("#PLAN_REFINE_CATEGORY1_214").attr('relValue');
- var COLUMN_1_214 = $("#redAlert").val();
- $("#COLUMN_1_214").val(COLUMN_1_214);
-
- $("#PLAN_REFINE_CATEGORY_214").val(category);
- $("#UPLOAND_FLAG_214").val("0");
- //上一个版本的预案的ID
- $("#PLAN_VERSION_REMARK_214").val(fd_id);
- $("#UPDATEDATE_214").attr("name","PLAN_ID_214");
- $("#PLAN_REFINE_CATEGORY").val();
-
-
- var formValue = $('#fillForm').serialize();
- var url = $.pathname() + '/ws/uploadForm/FileUpDownService/asyncFileUpLoad';
- $.ajax({
- url : url,
- type : 'post',
- data : formValue,
- dataType : 'text',
- timeout : 60000,
- success : function(data){
- var plantype = $("#PLAN_TYPE_214").val();//预案类型
- if(plantype=="103"){
- top.Dialog.confirm("要绑定该预案吗?|绑定", function() {
- var name = $("#PLAN_NAME_214").val();//预案名称
- var category = $("#PLAN_REFINE_CATEGORY_214").val();//包含的突发事件
- var url = "/nwyj/page/business/am/contingencyPlan/"+"PlanNexus.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?"+category+"?"+name;
- window.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- },function(){
- top.Dialog.alert("修改成功!");
- goBack();
- });
- }else{
- top.Dialog.alert("修改成功!");
- goBack();
- }
- },
- error : function(){
- $.messager.alert('操作失败');
- }
- });
- }
- /* //取表单里的值,如果都不等于空,证明该表单被修改过。离开的时候给出提示。
- function getValueGoBack(){
- var PLAN_NAME_214 = $("#PLAN_NAME_214").val();
- var PLAN_NO_214 = $("#PLAN_NO_214").val();
- var PLAN_TYPE_214 =$("#PLAN_TYPE_214").val();
- var PLAN_REFINE_CATEGORY_214 = $("#PLAN_REFINE_CATEGORY1_214").attr('relValue');
- var INS_UNITS_214 = $("#INS_UNITS_214").val();
- var redAlert = $("#redAlert").val();
- var SYFW_214 = $("#SYFW_214").val();
- var CHANGE_EXPLAIN_214 = $("#CHANGE_EXPLAIN_214").val();
- var TAKE_DATE_214 = $("#TAKE_DATE_214").val();
- var CHANGE_TYPE = $("#CHANGE_TYPE").val();
-
- var totalValue = CHANGE_TYPE + PLAN_NAME_214 + PLAN_NO_214 + PLAN_TYPE_214 + PLAN_REFINE_CATEGORY_214 + INS_UNITS_214 + redAlert + SYFW_214 + CHANGE_EXPLAIN_214 + TAKE_DATE_214 ;
-
-
- if(totalValue==totalValue1){
- var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlan.jsp";
- window.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- }else{
- top.Dialog.confirm("您已经修改了表单,是否需要离开?|离开", function() {
- var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlan.jsp";
- window.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- });
- }
- }*/
-
- //返回
- function goBack(){
- var backId = (window.location.href).split('?')[2];
- if(backId=="ZX"){
- var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlanZX.jsp";
- window.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- }else{
- var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlan.jsp";
- window.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- };
- }
-
- //重置
- function resetSearch(){
- document.location.reload();
- }
- $.messager=top.Dialog;
|