123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- //部门id
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- //父部门id
- var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParnet_ids();
-
-
-
- //加载信息
- $(function(){
- //应急预案获取
- $("#MEET_EMERGENCIES_PLAN_365").initYewuSelect("214","FD_OBJECTID","PLAN_NAME");
- //初始化预警范围下拉框
- var deptUrl = $.pathname() + '/ws/dept/DeptService/getDepartTree';
- $.post(deptUrl,{id:parentId,name:''},function(data){
- $("#EARLY_WARNING_AREA_OBJ_365").data("data",data);
- $("#EARLY_WARNING_AREA_OBJ_365").render();
- }, "json");
-
- //加载附件样式
- $('#fileDiv').getUploadFileContent();
-
- //修改表单信息,获取记录
- if((window.location.href).indexOf('?')>-1){
- var fd_id = (window.location.href).split('?')[1];
- getFileList(fd_id);//加载附件调用的方法
- $('#fileListLegend').css("display","block");
- $('#fileList').css("display","block");
- var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
- var params = {
- classid : '365',
- objectID : fd_id
- };
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){//alert(JSON.stringify(data));
- $('#fillForm').ajaxWrite({data:data});//var name = data.list[0].value;//alert("name=" + name);
- $('#fillForm input[name="classid"]').val('365');//alert(data.EARLY_WARNING_PROPERTY_365);
- $('#fillForm input[name="EARLY_WARNING_PROPERTY_365"]').val(data.EARLY_WARNING_PROPERTY_365);//alert(data.CURRENT_EW_LEVEL_365);//获取字段-本次预警级别的值
- //复选框的方法
- level();
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- });
-
- //两个预警级别的复选框获取值的方法
- function level(){
- //预警性质
- if($("#temp1").val() == "初次发布"){
- $("#EARLY_WARNING_PROPERTY_365").attr('checked','checked');
- $("#EARLY_WARNING_PROPERTY_365").attr("disabled",true);//初次发布禁用
- $("#WETHER_EW_ADJUST_365").attr("disabled",true);//是否预警调整禁用
- $("#last1").attr("disabled",true);//上次预警单号禁用
- $("#last2").attr("disabled",true);//上次级别禁用
- $("#last2").render();
- }
- //是否预警调整
- if($("#temp2").val() == "是"){
- $("#WETHER_EW_ADJUST_365").attr('checked','checked');
- $("#WETHER_EW_ADJUST_365").attr("disabled",true);//是否预警调整禁用
- $("#EARLY_WARNING_PROPERTY_365").attr("disabled",true);//初次预警禁用
- }
- }
-
- //返回主页面
- function goBack() {
- //获取iframe中的元素值
- var iframe =parent.document.getElementsByName("frmright")[0];
- iframe.src = "/nwyj/page/business/em/alert/notice/manage.html";
- }
-
- //保存方法
- function saveAlertNotice(){
- /***修改信息***/
- var fd_id;
- var valid = $('#fillForm').validationEngine({returnIsValid: true});//表单验证
- if(valid){
- var myDate=allGetServerTime() ;
- showProgressBar("正在提交中...");
-
- //获取预警范围的值
- $("#EARLY_WARNING_AREA_365").val($("#EARLY_WARNING_AREA_OBJ_365").attr("relText"));
- var myDate=allGetServerTime() ;
- $("#classid").val("365");
- var formValue = $("#fillForm").serialize();
- fileToSave($('#fillForm'),null,null);//保存的方法
- }
- }
-
- //保存附件
- function fileToSave($form,listGrid,msg){
- showProgressBar("正在提交中...");
- //表单异步提交处理
- $form.ajaxSubmit({
- type: 'post',
- url:$.pathname() +"/ws/uploadForm/FileUpDownService/fileUpLoad",
- //表单提交成功后的回调
- success: function(responseText, statusText, xhr, $form){
- responseText = eval('('+responseText+')');
- goBack();
- closeProgress();
-
- 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('保存失败!');//弹出提示
- }
- //listGrid.setNewPage(1);//页号设置为第一页
- //listGrid.loadData();//刷新列表
- }
- });
- }
|