<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<%@ Register TagPrefix="alicmsUC" TagName="Ime" Src="../../ime.dwt.ascx"%>
<%@ Register TagPrefix="alicmsUC" TagName="LanguageMenu" Src="../../language_menu.dwt.ascx"%>
<!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>
<!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加运费模板</title>
<link rel="stylesheet" type="text/css" href="<%=CommonPath%>jquery/themes/lightness/all.css" />
<ali:Comment><link rel="stylesheet" type="text/css" href="../../S01/CHS/css/common.css" /></ali:Comment>
<link rel="stylesheet" href="<%=CssPath%>common.css" />
<alicmsUC:Ime Ime="true" Eot="true" runat="server" />
<style>
table.deliver{display:none;width:700px;background:#fff}
table.deliver caption{border:1px solid #fff;line-height:32px}
table.deliver input{border:1px solid #7f9db9;height:15px;line-height:15px;padding:1px 2px;width:40px}
table.deliver i{font-style:normal}
table.deliver thead th,table.deliver td{text-align:center}
table.deliver tbody th{font-weight:normal;background:#c8e3ff}
table.deliver th,table.deliver td{}
table.deliver tfoot td{text-align:left}
table.deliver a{margin:0 5px}
table.deliver tbody th div{margin:5px;width:100%;overflow:hidden;color:#333}
table.deliver tbody th div span{float:left;margin:0 5px;white-space:nowrap}

/* 选择地区对话框 */
#region-dialog{display:none}
#region-dialog table{width:100%;background:#fff}
#region-dialog tr{background:#c8e3ff}
#region-dialog th{width:60px;height:28px;line-height:28px}
#region-dialog dl{margin:0}
#region-dialog dt{float:left;position:relative;margin:0 8px}
#region-dialog dd{display:none;float:left;margin:0;border:1px solid #f7e4a5;width:100%;text-align:left;text-indent:20px;background:#fffec6}
#region-dialog input{margin:0 2px}
#region-dialog button{border:0;padding:3px;cursor:pointer;background:none}

/* 批量操作对话框 */
#batch-dialog{display:none}
#batch-dialog div{margin:5px 0}
#batch-dialog input{border:1px solid #7f9db9;height:15px;line-height:15px;padding:1px 0;width:60px}
</style>
<script>
var _page = 'freight_template_add',
	_lang = '<%=ContentLang%>',
	_webPath = '<%=WebPath%>',
	_imagePath = '<%=ImagePath%>',
	_lang_working = '正在操作...',
	_lang_operation_fail = '操作失败！',
	_lang_operation_success = '操作成功！',
	_lang_name_empty = '名称不能空！',
	_lang_not_set = '-- 未指定 --',
	_lang_select_region = '选择',
	_lang_delete = '删除',
	_lang_start_incorrect = '起始数量不正确！',
	_lang_start_fee_incorrect = '起始费用不正确！',
	_lang_plus_incorrect = '增加数量不正确！',
	_lang_plus_fee_incorrect = '增加费用不正确！',
	_lang_region_empty = '请选择货物所在地！',
	_lang_deliver_method_empty = '请设置运送方式！',
	_lang_deliver_region_empty = '请选择运送地区!';
</script>
</head>
<body>
<div class="WhiteHeader">
	<div class="Left"><img src="<%=ImagePath%>close_frame.gif" /></div>
	<div class="Title">添加运费模板</div>
	<div class="Right">
		<alicmsUC:LanguageMenu runat="server" />
		<img height="15" src="<%=ImagePath%>dropdown.gif" /> 语言：<%=CurrentLanguage%>
	</div>
</div>
<div class="Block">
	<ul class="TabMenu">
		<li class="Left"></li>
		<li class="Middle"><a href="../freight_template/list.aspx?Lang=<%=ContentLang%>">运费模板列表</a></li>
		<li class="Right"></li>
		<li class="Left Selected"></li>
		<li class="Middle Selected">添加运费模板</li>
		<li class="Right Selected"></li>
	</ul>
	<ul class="Title">
		<li class="Left"></li>
		<li class="Middle"></li>
		<li class="Right"></li>
	</ul>
	<form>
		<table border="0" cellpadding="4" cellspacing="1">
			<tfoot>
				<tr><td colspan="2"><input type="submit" value="添加" /></td></tr>
			</tfoot>
			<tbody>
				<tr>
					<th width="140">名称：</th>
					<td><input type="text" name="Name" size="50" maxlength="255" class="Text <%=ContentLang%>Font" /></td>
				</tr>
				<tr>
					<th>货物地址：</th>
					<td id="region">
						<select class="<%=ContentLang%>Font">
							<option value="">未指定</option>
							<ali:List Object="Region" Condition="ParentID IS NULL">
								<ali:Record>
									<option value="<%=ID%>"><%=Name%></option>
								</ali:Record>
							</ali:List>
						</select>
					</td>
				</tr>
				<tr>
					<th>承担方式：</th>
					<td>
						<label><input type="radio" name="Bear" value="BuyerCustom" checked="checked" />买家承担（自定义）</label>
						<label><input type="radio" name="Bear" value="Buyer" />买家承担（运费到付）</label>
						<label><input type="radio" name="Bear" value="Seller" />卖家承担</label>
					</td>
				</tr>
				<tr>
					<th>计价方式：</th>
					<td>
						<label><input type="radio" name="Method" value="Number" checked="checked" />按<b data-unit="件">件数</b></label>
						<label><input type="radio" name="Method" value="Weight" />按<b data-unit="kg">重量</b></label>
						<label><input type="radio" name="Method" value="Volume" />按<b data-unit="m³">体积</b></label>
					</td>
				</tr>
				<tr>
					<th rowspan="4">运送方式：</th>
					<td>除指定地区外，其余地区的运费采用“默认运费”</td>
				</tr>
				<tr>
					<td>
						<label><input type="checkbox" value="Express" /> 快递</label>
						<table class="deliver">
							<caption>默认运费：<input type="text" data-name="Start" value="1" /><b>件</b>内，<input type="text" data-name="StartFee" />元，每增加<input type="text" data-name="Plus" value="1" /><b>件</b>，增加运费<input type="text" data-name="PlusFee" />元</caption>
							<thead>
								<tr>
									<th width="40"><input type="checkbox" /></th>
									<th>运送到</th>
									<th width="80">首件（<b>件</b>）</th>
									<th width="80">首费（元）</th>
									<th width="80">续件（<b>件</b>）</th>
									<th width="80">续费（元）</th>
									<th width="50">操作</th>
								</tr>
							</thead>
							<tbody></tbody>
							<tfoot>
								<tr>
									<td colspan="7"><a href="" data-operation="AddDeliver">为指定地区城市设置运费</a><a href="" data-operation="BatchOperation" data-id="0">批量设置</a><a href="" data-operation="BatchDelete">批量删除</a></td>
								</tr>
							</tfoot>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<label><input type="checkbox" value="EMS" /> EMS</label>
						<table class="deliver">
							<caption>默认运费：<input type="text" data-name="Start" value="1" /><b>件</b>内，<input type="text" data-name="StartFee" />元，每增加<input type="text" data-name="Plus" value="1" /><b>件</b>，增加运费<input type="text" data-name="PlusFee" />元</caption>
							<thead>
								<tr>
									<th width="40"><input type="checkbox" /></th>
									<th>运送到</th>
									<th width="80">首件（<b>件</b>）</th>
									<th width="80">首费（元）</th>
									<th width="80">续件（<b>件</b>）</th>
									<th width="80">续费（元）</th>
									<th width="50">操作</th>
								</tr>
							</thead>
							<tbody></tbody>
							<tfoot>
								<tr>
									<td colspan="7"><a href="" data-operation="AddDeliver">为指定地区城市设置运费</a><a href="" data-operation="BatchOperation" data-id="1">批量设置</a><a href="" data-operation="BatchDelete">批量删除</a></td>
								</tr>
							</tfoot>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<label><input type="checkbox" value="Post" /> 平邮</label>
						<table class="deliver">
							<caption>默认运费：<input type="text" data-name="Start" value="1" /><b>件</b>内，<input type="text" data-name="StartFee" />元，每增加<input type="text" data-name="Plus" value="1" /><b>件</b>，增加运费<input type="text" data-name="PlusFee" />元</caption>
							<thead>
								<tr>
									<th width="40"><input type="checkbox" /></th>
									<th>运送到</th>
									<th width="80">首件（<b>件</b>）</th>
									<th width="80">首费（元）</th>
									<th width="80">续件（<b>件</b>）</th>
									<th width="80">续费（元）</th>
									<th width="50">操作</th>
								</tr>
							</thead>
							<tbody></tbody>
							<tfoot>
								<tr>
									<td colspan="7"><a href="" data-operation="AddDeliver">为指定地区城市设置运费</a><a href="" data-operation="BatchOperation" data-id="2">批量设置</a><a href="" data-operation="BatchDelete">批量删除</a></td>
								</tr>
							</tfoot>
						</table>
					</td>
				</tr>
			</tbody>
		</table>
	</form>
	<div class="Footer"></div>
</div>
<div id="region-dialog" title="选择地区">
	<ali:List Object="Region" Condition="ParentID IS NULL">
		<table>
			<ali:Record>
				<tr>
					<th><label><input type="checkbox" value="<%=ID%>" data-is-city="<%=IsCity%>" /><%=Name%></label></th>
					<td>
						<%If !Convert.ToBoolean(IsCity)%>
							<ali:List Object="Region" Condition="ParentID=ID">
								<ali:Record>
									<dl>
										<dt><label><input type="checkbox" value="<%=ID%>" data-is-city="<%=IsCity%>" /><%=Name%></label><button>&or;</button></dt>
										<dd>
											<%If !Convert.ToBoolean(IsCity)%>
												<ali:List Object="Region" Condition="IsCity=true and ParentID=ID">
													<ali:Record>
														<label><input type="checkbox" value="<%=ID%>" data-is-city="<%=IsCity%>" /><%=Name%></label>
													</ali:Record>
												</ali:List>
											<%EndIf%>
										</dd>
									</dl>								
								</ali:Record>
							</ali:List>
						<%EndIf%>
					</td>
				</tr>
			</ali:Record>
		</table>
	</ali:List>
</div>
<div id="batch-dialog" title="批量设置">
	<div>默认运费：<input type="text" data-name="Start" value="1" /><b>件</b>内，<input type="text" data-name="StartFee" />元，每增加<input type="text" data-name="Plus" value="1" /><b>件</b>，增加运费<input type="text" data-name="PlusFee" />元</div>
	<div><button type="button">确定</button></div>
</div>
<script type="text/javascript" src="<%=CommonPath%>jquery/core.js"></script>
<script type="text/javascript" src="<%=CommonPath%>jquery/ui.js"></script>
<script src="<%=CommonPath%>json2.js"></script>
<script type="text/javascript" src="<%=CommonPath%>utility.js"></script>
<script type="text/javascript" src="<%=CommonPath%>aliui/ali.min.js"></script>
<script type="text/javascript" src="<%=JsPath%>global.js"></script>
<script type="text/javascript" src="<%=ModuleJsPath%>module.js"></script>
</body>
</html>