| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397 | 
							- /**
 
-  * 理货延续
 
-  * 
 
-  */
 
- $.namespace("lhyx.detail");
 
- lhyx.detail.selData=null;
 
- lhyx.detail.szdData=null;
 
- lhyx.detail.gk = null;
 
- lhyx.detail.gq = null;
 
- lhyx.detail.taskKey=null;
 
- lhyx.detail.init = function() {
 
- 	initgkSelect('gksel', '', lhyx.detail.szdData,'showgq', 300);
 
- 	initgqSelect('gqsel','','','',null,300);
 
- 	initzyqSelect('zyqsel','','',null,300);
 
- }
 
- function showRy() {
 
- 	$('#selectrydiv').fadeIn(100);
 
- 	$('#selectry2div').slideDown(0);
 
- }
 
- function showYj() {
 
- 	$('#selectyjdiv').fadeIn(100);
 
- 	$('#selectyj2div').slideDown(0);
 
- }
 
- lhyx.detail.delData=function(data){
 
- 	$.confirm({
 
- 	    title: '确认框',
 
- 	    content: '确认删除吗',
 
- 	    confirm: function(){
 
- 	    	 $.post($.app + "/lhyx/delete", {
 
-                  id : data
 
-              }, function(data) {
 
-                  if (data.success) {
 
-                 	 $.alert({
 
-                 		    title: '提示',
 
-                 		    content: '删除成功',
 
-                 		    confirm: function(){
 
-                 		    	location.href=$.app+'/lhyx/main';
 
-                 		    }
 
-                 	 });
 
-                  } else {
 
-                 	 $.alert({
 
-              		    title: '提示',
 
-              		    content: data.message,
 
-              		    confirm: function(){
 
-              		        
 
-              		    }
 
-              	 });
 
-                  }
 
-              }, "json");
 
- 	    },
 
- 	    cancel: function(){
 
- 	    }
 
- 	});
 
- }
 
- function guanbitcpop() {
 
- 	$('.theme-popover-mask-tc').fadeOut(100);
 
- 	$('.theme-popover-tc').slideUp(0);
 
- }
 
- function showgk() {
 
- 	initgqSelect('gqsel', '', '', '', 'showzyq', 300);
 
- 	initgkSelect('gksel', '', xkzsq.detail.szdData, "showgq", 300);
 
- }
 
- function showgq() {
 
- 	initgqSelect('gqsel', '', xkzsq.detail.szdData, $('.gkselectpicker')
 
- 			.val(), null, 300);
 
- }
 
- lhyx.detail.bgdzChe = function(){
 
- 	if($('#bgdzChe').is(':checked')){
 
- 		$("#xbgdz").removeAttr("readonly"); 
 
- 	}else{
 
- 		 $("#xbgdz").attr({ readonly: 'true' });
 
- 		 $('#xbgdz').val('');
 
- 	}
 
- }
 
- lhyx.detail.fddbrChe = function(){
 
- 	if($('#fddbrChe').is(':checked')){
 
- 		$("#xfddbr").removeAttr("readonly"); 
 
- 	}else{
 
- 		 $("#xfddbr").attr({ readonly: 'true' });
 
- 		 $('#xfddbr').val('');
 
- 	}
 
- }
 
- vae=function(a,b){
 
- 	if(isEmpty(a.val())){
 
- 		ts(b+"不能为空",a);
 
- 		return false;
 
- 		}
 
- 	return true;
 
- };
 
- // 保存
 
- lhyx.detail.save = function(){
 
- 	
 
- 	//验证必填字段是否为空
 
- 	if(vae($('#addform input[name=jyrmc]'),"港口经营人名称")==false){return false;}
 
- 	if (vae($('#addform input[name=lxr]'), "联系人") == false) {
 
- 		return false;
 
- 	}
 
- 	
 
- 	$(".btn").attr("disabled",true);
 
- 	 $.ajax({
 
-          url:$.app+"/lhyx/save",
 
-          data:$("#addform").serialize(),
 
-          type:"post",
 
-          dataType:"json",
 
-          success:function(data){// ajax返回的数据
 
- 	           if (data.success) {
 
- 	        	   $.alert({
 
- 						title : '提示',
 
- 						content : '操作成功',
 
- 						confirm : function() {
 
- 							 location.href=$.app+'/lhyx/main';
 
- 						}
 
- 					});
 
- 		       		
 
- 	           }else{
 
- 		           	$.alert({
 
- 		       		    title: '提示',
 
- 		       		    content: data.message,
 
- 		       		    confirm: function(){
 
- 		       		    	$(".btn").attr("disabled",false);
 
- 		       		    }
 
- 		           	});
 
- 	           }
 
- 	     }
 
-     }); 
 
- }
 
- //保存
 
- lhyx.detail.saveTb = function(){
 
- 	
 
- 	//验证必填字段是否为空
 
- 	if(vae($('#addform input[name=jyrmc]'),"港口经营人名称")==false){return false;}
 
- 	if (vae($('#addform input[name=lxr]'), "联系人") == false) {
 
- 		return false;
 
- 	}
 
- 	
 
- 	$(".btn").attr("disabled",true);
 
- 	 $.ajax({
 
-          url:$.app+"/lhyx/saveTb",
 
-          data:$("#addform").serialize(),
 
-          type:"post",
 
-          dataType:"json",
 
-          success:function(data){// ajax返回的数据
 
- 	           if (data.success) {
 
- 	        	   $.alert({
 
- 						title : '提示',
 
- 						content : '操作成功',
 
- 						confirm : function() {
 
- 							 location.href=$.app+'/lhyx/main';
 
- 						}
 
- 					});
 
- 		       		
 
- 	           }else{
 
- 		           	$.alert({
 
- 		       		    title: '提示',
 
- 		       		    content: data.message,
 
- 		       		    confirm: function(){
 
- 		       		    	$(".btn").attr("disabled",false);
 
- 		       		    }
 
- 		           	});
 
- 	           }
 
- 	     }
 
-     }); 
 
- }
 
- //保存
 
- lhyx.detail.submit = function(){
 
- 	if (isEmpty($('#userids').val())) {
 
- 		$.alert({
 
- 			title : '提示',
 
- 			content : "请选择人员办理!!!",
 
- 			confirm : function() {
 
- 				$(".btn").attr("disabled", false);
 
- 			}
 
- 		});
 
- 		return false;
 
- 	}
 
- 	
 
- 	//验证必填字段是否为空
 
- 	if(vae($('#addform input[name=jyrmc]'),"港口经营人名称")==false){return false;}
 
- 	//验证必填字段是否为空
 
- 	if(vae($('#addform input[name=jyrmc]'),"港口经营人名称")==false){return false;}
 
- 	if (vae($('#addform input[name=lxr]'), "联系人") == false) {
 
- 		return false;
 
- 	}
 
- 	
 
- 	$(".btn").attr("disabled",true);
 
- 	 $.ajax({
 
- 		url:$.app+"/lhyx/submit",
 
- 	    data:$("#addform").serialize(),
 
- 		type : "post",
 
- 		dataType : "json",
 
-          success:function(data){// ajax返回的数据
 
- 	           if (data.success) {
 
- 	        	   $.alert({
 
- 						title : '提示',
 
- 						content : '操作成功',
 
- 						confirm : function() {
 
- 							 location.href=$.app+'/lhyx/main';
 
- 						}
 
- 					});
 
- 	           }else{
 
- 		           	$.alert({
 
- 		       		    title: '提示',
 
- 		       		    content: data.message,
 
- 		       		    confirm: function(){
 
- 		       		    	$(".btn").attr("disabled",false);
 
- 		       		    }
 
- 		           	});
 
- 	           }
 
- 	     }
 
-     }); 
 
- }
 
- // 返回
 
- lhyx.detail.back = function(){
 
- 	
 
- 	location.href=$.app+'/lhyx/main';
 
-    		
 
- }
 
- // 保存附件
 
- lhyx.detail.submitFile = function(id){
 
- 	 $('#addform').form('submit', {
 
- 		 url :$.app + '/lhyx/saveFile',
 
- 	        onSubmit : function() {
 
- 	        },
 
- 	        success : function(data, status) {
 
- 	        	 var file = $('#fjid'+id);
 
- 	             file.after(file.clone().val(""));
 
- 	             file.remove();
 
- 	             if (data) {
 
- 	            	 data = data.replace("<audio controls=\"controls\" style=\"display: none;\"></audio>","");
 
- 	                 data = $.parseJSON(data);
 
- 	             }
 
- 	             if (data.success) {
 
- 	 				var accContect = data.attrs.acc.fjmc;
 
- 					var fjid = data.attrs.acc.fjid;
 
- 					var accid = data.attrs.acc.id;
 
- 					var str = "<tr align='center'>";
 
- 					str =str +"<td style='width:40%'>"+ "<input value='"
 
- 							+ accid
 
- 							+ "' name='accid' type='hidden'>"
 
- 							+ "<a class='main_title' href='/jsjy/accessory/download?id="
 
- 							+ fjid + "'> " + accContect + "</a>" +"</td>";
 
- 					
 
- 					str =str+"<td style='width:15%'>"+ '<a class="btn btn-default btn-xs" href="#" onclick="lhyx.detail.delFj(\''
 
- 							+ accid
 
- 							+ '\','
 
- 							+ '$(this)'
 
- 							+ ')">删除</a>' +"</td></tr>";
 
- 					$('#tableId').append(str);
 
- 	             }
 
- 	             else {
 
- 	                 $.messager.showError(data.message);
 
- 	             }
 
- 	        }
 
- 	    });
 
- }
 
-  
 
- // 删除accid 附件关联ID,id 是第几行附件
 
- lhyx.detail.delFj = function(accid,tr){
 
- 	$.confirm({
 
- 	    title: '确认框',
 
- 	    content: '确认删除吗',
 
- 	    confirm: function(){
 
- 	    	 $.post($.app + "/lhyx/delFj", {
 
-                  ids : accid
 
-              }, function(data) {
 
-                  if (data.success) {
 
-                 	 $(tr).parent().parent().remove();
 
-                  } else {
 
-                 	 $.alert({
 
-              		    title: '提示',
 
-              		    content: data.message,
 
-              		    confirm: function(){
 
-              		    }
 
-              	 });
 
-                  }
 
-              }, "json");
 
- 	    },
 
- 	    cancel: function(){
 
- 	    }
 
- 	});
 
- }
 
- lhyx.detail.audit=function(auditpass,id){
 
- 	if (auditpass == "Y" && lhyx.detail.taskKey != 'ldpz') {
 
- 		if (isEmpty($('#userids').val())) {
 
- 			$.alert({
 
- 				title : '提示',
 
- 				content : "请选择人员办理!!!",
 
- 				confirm : function() {
 
- 					$(".btn").attr("disabled", false);
 
- 				}
 
- 			});
 
- 			return false;
 
- 		}
 
- 	}
 
- 	var shyj=$('#yj').val();
 
- 	
 
- 	var audit;
 
- 	if(auditpass=="Y"){
 
- 		audit=true;
 
- 	}else{
 
- 		audit=false;
 
- 	}
 
- 	$.post($.app + "/lhyx/audit", {
 
- 		id:id,
 
-         shyj:shyj,
 
-         flag:audit,
 
-         userids:$('#userids').val()
 
-     }, function(data) {
 
-     	if (data.success) {
 
-     		
 
-     		 	$.alert({
 
-            		    title: '提示',
 
-            		    content: '操作成功',
 
-            		    confirm: function(){
 
-            		    	location.href=$.app+'/lhyx/main';
 
-            		    }
 
-                	});
 
-           
 
-        }else {
 
-            	$.alert({
 
-        		    title: '提示',
 
-        		    content: data.message,
 
-        		    confirm: function(){
 
-        		    	
 
-        		    }
 
-            	});
 
-        }
 
-     	
 
-     }, "json");
 
- }
 
- lhyx.detail.submitAudit=function(){
 
- 	if (isEmpty($('#userids').val())) {
 
- 		$.alert({
 
- 			title : '提示',
 
- 			content : "请选择人员办理!!!",
 
- 			confirm : function() {
 
- 				$(".btn").attr("disabled", false);
 
- 			}
 
- 		});
 
- 		return false;
 
- 	}
 
- 	 $.ajax({
 
-          url:$.app + "/lhyx/submitAudit",
 
-          data:$("#addform").serialize(),
 
-          type:"post",
 
-          dataType:"json",
 
-          success:function(data){// ajax返回的数据
 
-         	 if (data.success) {
 
-      		 	$.alert({
 
-             		    title: '提示',
 
-             		    content: '操作成功',
 
-             		    confirm: function(){
 
-             		    	location.href=$.app+'/lhyx/main';
 
-             		    }
 
-                 	});
 
-             }else {
 
-                 	$.alert({
 
-             		    title: '提示',
 
-             		    content: data.message,
 
-             		    confirm: function(){
 
-             		    	
 
-             		    }
 
-                 	});
 
-             }
 
- 	     }
 
-     }); 
 
- }
 
 
  |