www.gusucode.com > 2030网博士成品网站管理系统 PHP网站源码程序 > 2030/dingcan/admin/js/orderyun.js

    

$(document).ready(function(){
	
	//指定配送员
	$("#setpsy").click(function(){
		var orderid=$("#orderid")[0].value;
		var psy=$("#peisongyuan_"+orderid)[0].value;
		
		if(psy==""){
			alert("请选择配送员");
			return false;
		}
				
		$.ajax({
			type: "POST",
			url: "post.php",
			data: "act=orderpeisong&orderid="+orderid+"&psy="+psy,
			success: function(msg){
				if(msg=="OK"){
					$("#setpsyinfo").html("<img src='images/err_ok.gif' border='0' />&nbsp;&nbsp;指定配送员操作成功");
				}else if(msg=="1001"){
					alert("请选择配送员");
					return false;
				}else{
					alert(msg);
					return false;
				}
			}
		});

	});
	
	
	//配送完成确认
	$("#doyun").click(function(){
		
		var orderid=$("#orderid")[0].value;
		var psyid="peisongyuan_"+orderid;
		var psy=$("#"+psyid)[0].value;
		
		if(psy==""){
			alert("请选择配送员");
			return false;
		}
	
		$.ajax({
			type: "POST",
			url: "post.php",
			data: "act=orderpeisong2&orderid="+orderid+"&psy="+psy,
			success: function(msg){
				if(msg=="OK"){
					alert('订单配送成功');
					$("#order_"+orderid).remove();
					$("#doyuninfo").html("<img src='images/err_ok.gif' border='0' />&nbsp;&nbsp;订单配送成功");
				}else if(msg=="1001"){
					alert("请选择配送员");
					return false;
				}else{
					alert(msg);
					return false;
				}
			}
		});
	
	});
	
	
	
});