<%@ Page Language="C#" AutoEventWireup="true" debug="true" Inherits="WinLibClass.Form.Admin.Work.OrderForm.UI_List"  CodePage="65001" PathLevel="1" PageFileFlag="Order_UI_List" PageFileTitle="订单管理" DataBindingType="1" PageFlagId="1" %>

<%@ Register TagPrefix="Site" TagName="Menu" Src="../WUC/Site_Menu.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<Site:Menu id="menu_headtitle" runat="server" Flag="HeadTitle" CurrentPageTitle = "订单管理" />
<Site:Menu id="menu_headjs" runat="server" Flag="HeadJs" PathLevel="1" />
<Site:Menu id="menu_headcss" runat="server" Flag="HeadCss" PathLevel="1" />
<script type="text/javascript" src="/PaiPaiJS/UserPicNoteShow.js?t=2010"></script>
<script>
//Common.EditFunction("POST")
//Common.EditDialogClose()
function SetOperateState(id){
	var __content ='<div class="DeleteConfirmBox">状态更新为单向处理,处理后将不能恢复!<br /><br />你确认更新该订单的处理状态吗?</div>'
	Common.Confirm("work_order_ui_list", "订单恢复", __content,function(){Set_State_Yes(id);});
}
//删除
function Del_Info(id){
	Common.ConfirmDelete("work_order_ui_list","订单删除","", function(){ Del_Info_Yes(id);},null);
}
//OperateType:0-state,1-del
function Set_State_Yes(id){
	jQuery.ajax({
		type: "POST",url: "../index.aspx?s=/Admin/Work_Order_Set_State",
		data:{"Oid":id,"OperateType":0},cache: false,
		success: function(msg){location.replace(location.href);}
	});
}
function Del_Info_Yes(id){
	jQuery.ajax({
		type: "POST",url: "../index.aspx?s=/Admin/Work_Order_Delete",
		data:{"Oid":id,"OperateType":1},cache: false,
		success: function(msg){location.replace(location.href);}
	});
}
//晒图管理
function UserPicNote_Edit_Info(id,UserId,OrderFormType,_gameType)
{
	//var _url = "../index.aspx?s=/Admin/User_Note_Add&IsAdd=0";
	var _url ="../UserPicNote/update.aspx";
	var _data ={"infoId":id,"GameType":_gameType,"UserId":UserId,"OrderFormType":OrderFormType,"PageUrlType":1};
	Common.EditFunction("POST",_url,_data,"work_order_ui_list","编辑晒图信息",'SaveInfoSub')	
	//将本行设置为选中颜色
	//SetActive(id);
}
/////////////////////////////////////////////////////////////////////
function PicManage(id,OrderFormType,GameType){
//	SetActive(id);
	if(id<1){alert("暂无晒图信息，请先保存晒图信息后再管理晒图图片。");return false;}
	//quitScreenMask();
	var fileId = "";
	switch(OrderFormType)
	{
		//case 0:fileId = 0;break;//
		//case 0:fileId = 0;break;//
		//case 0:fileId = 0;break;//
		case 1:fileId = "_4";break;//Vendue=1,
		case 3:fileId = "_5";break;//SafeBuy=3,
		case 5:fileId = "_6";break;//SecondGame = 5,
		case 6:fileId = "_7";break;//SecondGameSafeBuy = 6,
		case 7:fileId = "_8";break;//Game3 = 7,
		case 8:fileId = "_9";break;//Game3SafeBuy = 8,
		case 9:fileId = "_10";break;//Game4 = 9,
		case 10:fileId = "_11";break;//Game4SafeBuy = 10,
		default:fileId = "-1";break;//
	}
	if(fileId=="-1"){alert("订单类型无效.");return ;}
	else{	
		var _url ="../PicManage/List"+ fileId +".aspx";
		var _data ={"infoId":id,"GameType":_gameType,"UserId":UserId,"OrderFormType":OrderFormType,"PageUrlType":1};
		Common.EditFunction("POST",_url,_data,"Div_PicManage","编辑晒图信息",'');
	}
}

<%/* 发货管理-----------------------------------------------------------------------*/%>

//编辑
function Edit_GoodsCurrencyLog(OrderFormId,id)
{
//ID 不是物流ID,切记
	$.ajax({
		type: "POST",
		url:"../GoodsCurrencyLog/Update.aspx?IsAdd=1",
		data:{"OrderFormId":OrderFormId,"UrlReferrerType":1},
		cache: false,
		success: function(msg){
			Common.EditDialg ("GoodsCurrencyLog","物流公司 - 编辑",msg);
			Common.EditDialgAddButtonEvent("GoodsCurrencyLog",'确定',SaveSub);
		}
	});
	//将本行设置为选中颜色
	SetActive(id);
}

//物流公司的选择
function FirmSelectDlg(id)
{
	$.ajax({
		type:"POST",
		url: "../Dialog/DlgFirm.aspx",
		data:{"id":id},
		cache: false,
		success: function(msg){
			Common.EditDialg ("DlgFirmList","物流公司 - 选择",msg);
			Common.EditDialgAddButtonEvent("DlgFirmList",'',null);
		}
	});
}

//订单的选择
function UserOrderFormSelectDlg(sid){
	$.ajax({
		type:"POST",
		url: "../Dialog/DlgUserOrderForm.aspx",
		data:{"strFormId":sid,"IsAdd":0},
		cache: false,
		success: function(msg){
			Common.EditDialg ("DlgUserOrderForm","订单 - 选择",msg);
			//Common.EditDialgAddButtonEvent("DlgUserOrderForm",'',null);
			Common.EditDialgAddButtonEvent("DlgUserOrderForm",'确定',FormSelectSub);
		}
	});
}


//会员收货地址的选择
function UserAddressSelectDlg(id,uid){
	$.ajax({
		type:"POST",
		url: "../Dialog/UserAddress.aspx",
		data:{"id":id,"Uid":uid},
		cache: false,
		success: function(msg){
			Common.EditDialg ("DlgUserAddress","收货地址 - 选择",msg);
			Common.EditDialgAddButtonEvent("DlgUserAddress",'确定',UserAddressSelectSub);
		}
	});
}


</script>

</head>
<body>

<Site:Menu id="menu_topmenu" runat="server" Flag="TopMenu"  />
<div class1="wrap" id="wrap">
	<Site:Menu id="Wuc_LeftMenu" runat="server" Flag="LeftMenu" PageFileFlag="Menu_A_1_2" PathLevel="1" />	
	<div class1="mainbox" class="MainBox W1100 ">

		<div class="PGTitle LH30 ">
			<div class="W200 FL MGL10 FWB FS12"><%=PageTitleTip%></div>
			<div class="ChileMenu1 FL FS12">
				<A href="?<%=_UrlParamString%>&IsPayed=0" <%=(IsPayed==0?"class=\"select\"":"")%> >未支付</A>
				<A href="?<%=_UrlParamString%>&IsPayed=1" <%=(IsPayed==1?"class=\"select\"":"")%> >已支付</A>
				<A href="?<%=_UrlParamString%>&IsPayed=-1" <%=(IsPayed==-1?"class=\"select\"":"")%>>已取消</A>
			</div>
			<div class="Clear"></div>
		</div>

		<div class="ContBox MGT10 " >
			
			<!-- 内容区 -->
			<table class="Table FS12 " >
			<tr>
				<TH class="Hide" style="width:50px">ID</TH>
				<TH style="width:50px">期号</TH>
				<TH style1="width:200px">产品</TH>
				<TH style="width:70px">会员</TH>
				<TH style="width:120px">购物方式</TH>
				<TH style="width:150px">使用点数:<br /><%=WinLibClass.Config.Global.WebSiteConfig.PointName_1%>/<%=WinLibClass.Config.Global.WebSiteConfig.PointName_2%>/<%=WinLibClass.Config.Global.WebSiteConfig.PointName_3%></TH>
				<TH style="width:80px">实际付款</TH>
				<TH style="width:70px">创建时间</TH>
				<TH style="width:120px">订单处理状态</TH>
				<TH style="width:70px">处理时间</TH>
				<!--
				<TH style="width:120px">处理状态GetOrderFormTypeName</TH>-->
				<TH style="width:60px">晒图</TH>
				<TH style="width:60px">操作</TH>
			</tr>

			<asp:Repeater id="rpList" runat="server">
			<ItemTemplate>

			<tr id="tr_<%#Eval("VendueId")%>" title="订单号：<%#Eval("OrderFormId")%>">

					<td class="Hide"><%#Eval("ID")%></td>
					<td><%#Eval("VendueId")%></td>
					<TD><%#Eval("ProductName")%></td>
					<td title="会员编号:<%#Eval("Userid")%>"><%#Eval("UserNickName")%></td>	
					<td><%#GetOrderFormTypeName(Eval("OrderFormType"))%> <font class="Hide"><%# DV.ModeType(DV.Eval(Eval("ModeType")),Eval("GameType"))%></font></td>
					<td> <font color="green"><%# Eval("point1")%></font> / <font color="#663355"><%# Eval("point2")%></font> / <font color="#ff44dd"><%# Eval("point3")%></font> </td>	
					<td style="color:#ee0000">&yen;<%# WinLibClass.Common.Utils2.SetMoneyFormat(Eval("RealPayPrice"))%></td>
					<td><%#Eval("CreateTime","{0:yyyy-MM-dd HH:mm:ss}")%></td>		
					<td id="TdOrderCheck_<%#Eval("id")%>"><%#GetValidateState(0,Eval("IsChecked"),Eval("IsCancel"),Eval("UpdateTime"),Eval("id"))%></td>
					<td><%#Eval("OperateTime","{0:yyyy-MM-dd HH:mm:ss}")%></td>				

					
					<td><a onclick="UserPicNote_Edit_Info(<%#Eval("VendueId")%>,<%#Eval("UserId")%>,<%#Eval("OrderFormType")%>,<%#Eval("GameType")%>);">管理</a></td>		
					<td>
						<%#GetButton(Eval("id"),Eval("OperateType"),Eval("IsChecked"),Eval("IsCancel"))%>
						<a href="javascript:;" onclick="Edit_GoodsCurrencyLog('<%#Eval("OrderFormId")%>',<%#Eval("VendueId")%>);"><%#GetState(Eval("IsChecked"),Eval("IsCancel"))==1?"发货管理":""%></a>
					</td>
			</tr>
			</ItemTemplate>
			</asp:Repeater>
			<TR>

			</TR>

			</table>
			
			
			
			
			
			
			
			
		</div>
		<div  class="ContBox" >
			<div class="page" style="margin-left:-13px;"><%=strPageInfo%>    </div>		
		</div>


	</div>
</div>
<div class="clear"></div>
<Site:Menu id="menu_foot" runat="server" Flag="Foot"   />
</body>
</html>
