<%@ Page language="c#" Codebehind="RepairDetail.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.RepairDetail" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<!--#include file="inc/head.inc"-->
		<title>RepairDetail</title>
		<style type="text/css">
		    table.tableBorder {border:1px solid #bababa;}
		    table td.left {width:80px;}
		    .underline { text-decoration:underline;}
		</style>
		<script type="text/javascript">
		    $(document).ready(function(){
		        $('input[@name=rblConfirm]').click(function(){
		            var isConfirm = $(this).val();
		            $.ajax({
		                url:'RepairDetail.aspx?NoCopyRight=1&type=ajax&Action=ChangeConfirm&ID=<%=Request.QueryString["ID"] %>&IsConfirm='+isConfirm,
		                success:function(data){
		                    if(!checkLoginStatus(data)){return false;}
		                    if(data>0){
		                        if(isConfirm==1){
		                            alert('已将状态设置为审批通过');
		                        }else{
		                            alert('已将状态设置为审批不通过');
		                        }
		                    };
		                },
		                error:function(){alert('error');}
		            });
		        });
		        
		        $('#cbFinished').click(function(){
		            setVisible();
		        });
		        
		        function setVisible(){
		            if($('#cbFinished').attr('checked')){
		                $('#shipping').show();
		            }else{
		                $('#shipping').hide();
		            }
		        };
		        setVisible();
		    });
		    
		    function checkLoginStatus(data){
                var result = true;
                if(data.indexOf('<!DOCTYPE') != -1){
                    result = false;
                    alert('身份已过期,请重新登陆!');
                };
                return result;
            };
		</script>
	</head>
	<body>
	    <div class="frame">
	        <div class="frame_content">
		        <form id="Form1" method="post" runat="server">
			        <table class="ptable" cellSpacing="0" cellPadding="0" width="98%" align="center">
				        <tr>
				            <th class="tl" colspan="2">用户申请返修信息</th>
				        </tr>
				        <tr>
					        <th class="tl">订单号：</th>
					        <td class="tr">
						        <asp:Label id="lbOrderNo" runat="server"></asp:Label></td>
				        </tr>
				        <tr>
					        <th class="tl">商品编号：</th>
					        <td class="tr">
						        <asp:Label id="lbProductNo" runat="server"></asp:Label></td>
				        </tr>
				        <tr>
					        <th class="tl">商品名称：</th>
					        <td class="tr">
						        <asp:Label id="lbProductName" runat="server"></asp:Label></td>
				        </tr>
				        <tr>
					        <th class="tl">返修类型：</th>
					        <td class="tr">
						        <asp:Label id="lbRepairType" runat="server"></asp:Label></td>
				        </tr>
				        <tr>
					        <th class="tl">会员帐号：</th>
					        <td class="tr">
						        <asp:Label id="lbMemberName" runat="server"></asp:Label></td>
				        </tr>
				        <tr>
					        <th class="tl">申请时间：</th>
					        <td class="tr">
						        <asp:Label id="lbAddTime" runat="server"></asp:Label></td>
				        </tr>
				        <tr>
					        <th class="tl">备注：</th>
					        <td class="tr">
						        <asp:Label id="lbMemberRemark" runat="server"></asp:Label></td>
				        </tr>
				        <tr>
					        <th class="tl">审批状态：</th>
					        <td class="tr">
					            <asp:RadioButtonList id="rblConfirm" runat="server" RepeatDirection="Horizontal">
							        <asp:ListItem Value="1">审批通过</asp:ListItem>
							        <asp:ListItem Value="-1">审批不通过</asp:ListItem>
						        </asp:RadioButtonList>
						    </td>
				        </tr>
			        </table>
			        <%if (detail.IsConfirm == 1 && detail.MemberShipStatus == 1){%>
			        <br />
			        <table class="ptable" cellSpacing="0" cellPadding="0" width="98%" align="center">
				        <tr>
					        <th class="tl" colspan="4">用户发货信息</th>
				        </tr>
				        <tr>
					        <th class="tl">配送方式：</th>
					        <td class="tr"><asp:Label id="lbUserShipName" runat="server"></asp:Label></td>
					        <th class="tl">配送费用：</th>
					        <td class="tr"><asp:Label id="lbUserShipPrice" runat="server"></asp:Label></td>
				        </tr>
				        <tr>
					        <th class="tl">物流单号：</th>
					        <td class="tr"><asp:Label id="lbUserShipNo" runat="server"></asp:Label></td>
					        <th class="tl">邮政编码：</th>
					        <td class="tr"><asp:Label id="lbUserShipPostalCode" runat="server"></asp:Label></td>
				        </tr>
				        <tr>
					        <th class="tl">配送地址：</th>
					        <td class="tr" colspan="3"><asp:Label id="lbUserShipAddress" runat="server"></asp:Label></td>
				        </tr>
				        <tr>
					        <th class="tl" colspan="4">用户信息</th>
				        </tr>
				        <tr>
					        <th class="tl">姓名：</th>
					        <td class="tr"><asp:Label id="lbUserName" runat="server"></asp:Label></td>
					        <th class="tl">联系电话：</th>
					        <td class="tr"><asp:Label id="lbUserPhone" runat="server"></asp:Label></td>
				        </tr>
				        <tr>
					        <th class="tl">地址：</th>
					        <td class="tr"><asp:Label id="lbUserAddress" runat="server"></asp:Label></td>
					        <th class="tl">邮政编码：</th>
					        <td class="tr"><asp:Label id="lbUserPostalCode" runat="server"></asp:Label></td>
				        </tr>
				        <tr>
				            <th class="tl"></th>
				            <td class="tr" colspan="3"><asp:checkbox id="cbxReceived" runat="server" Text="已收到返修货物"></asp:checkbox><asp:Button id="btnChangeReceiveStatus" OnClick="btnChangeReceiveStatus_Click" runat="server" Text="保存" CssClass="inputbtn"></asp:Button></td>
				        </tr>
			        </table>
			        <%} %>
			        
			        <%if (detail.IsConfirm == 1 && detail.MemberShipStatus == 1 && detail.AdminShipStatus > 0){%>
			        <br />
			        <asp:checkbox id="cbFinished" runat="server" Text="返修完成,填写发货信息"></asp:checkbox>
			        <table class="ptable" cellSpacing="0" cellPadding="0" width="98%" align="center" style="display:none;" id="shipping">
						<tr>
							<th colspan="2"></th>
						</tr>
						<tr>
							<th class="tl">收货人姓名：</th>
							<td class="tr"><asp:TextBox id="txtUserReceiveName" runat="server"></asp:TextBox></td>
			                <th class="tl">配送方式：</th>
			                <td class="tr"><asp:TextBox id="txtAdminShipName" runat="server"></asp:TextBox></td>	
						</tr>
						<tr>
							<th class="tl">联系电话：</th>
							<td class="tr"><asp:TextBox id="txtUserReceivePhone" runat="server"></asp:TextBox></td>
			                <th class="tl">物流单号：</th>
			                <td class="tr"><asp:TextBox id="txtAdminShipNo" runat="server"></asp:TextBox></td>
						</tr>
						<tr>
							<th class="tl">收货地址：</th>
							<td class="tr"><asp:TextBox id="txtUserReceiveAddress" runat="server" Columns="50"></asp:TextBox></td>
							<th class="tl">配送费用：</th>
							<td class="tr"><asp:TextBox id="txtAdminShipPrice" runat="server"></asp:TextBox></td>
						</tr>
						<tr>
							<th class="tl">邮政编码：</th>
							<td class="tr" colspan="3"><asp:TextBox id="txtUserReceivePost" runat="server"></asp:TextBox></td>
						</tr>
						<tr>
						    <th class="tl">备注：</th>
						    <td class="tr" colspan="3">
						        <asp:TextBox id="txtAdminRemark" runat="server" TextMode="multiLine" Rows="5" Columns="80"></asp:TextBox>
						    </td>
						</tr>
						<tr>
							<th class="tl"></th>
							<td class="tr" colspan="3">
								<asp:Button id="btnSubmitShip" OnClick="btnSubmitShip_Click" runat="server" Text="发货" CssClass="inputbtn"></asp:Button></td>
						</tr>
					</table>
			        <%} %>
		        </form>
	        </div>
        </div>
		
	</body>
</html>
