<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<%@ include file="/WEB-INF/include/common.jsp"%>
<script type="text/javascript">
	$(function() {
		//定义页面元素
		var operate = '${requestScope.operate}';
		$('#detailTabs').tabs('disableTab', 1); 
		var unEditableAttributes =  ${requestScope.unEditableAttributes};
		var stockRightTransferDetailData = '${requestScope.stockRightTransferDetailData}';
		
		$.StockRightTransferDetailEdit = new $.AbstractEdit({
			entity : "StockRightTransferDetail",
			formId : "stockRightTransferDetailForm",
			operate : operate,
			id : "stockRightTransferDetailId"
		});
		//扩展或重写方法
		$.fn.extend($.StockRightTransferDetailEdit, {
			
		});
		$.StockRightTransferDetailEdit.init();
		disabledAttributes($("#body1"),unEditableAttributes);
		if (!$.isEmpty(stockRightTransferDetailData)) {
			$.StockRightTransferDetailEdit.fillData(stockRightTransferDetailData);
			
			
		}

		$("#saveStockRightTransferDetailBtn").click($.proxy($.StockRightTransferDetailEdit.save,$.StockRightTransferDetailEdit));
	});
</script>
</head>
<body style="overflow-y: hidden" fit="true" scroll="no" id="body">
	<div id="detailTabs" class="easyui-tabs">
		<div title="基本信息" id="body1">
			<form id="stockRightTransferDetailForm" method="post">
			<input type="hidden" name="stockRightTransferId"></input>
			<input type="hidden" name="stockRightTransferDetailId" value="${stockRightTransferDetailData.stockRightTransferDetailId}"></input>
			<input type="hidden" name="relationedCustomerId"></input>
			<input type="hidden" name="toRelationedCustomerId"></input>
			<input type="hidden" name="itemId"></input>
			<label id="stockRightTransferDetailData" style="display: none;">${stockRightTransferDetailData}</label>
			<table style="width: 100%">
				<tr id="transferTypeTr">
					<td><div class="star">*</div>转移类型</td>
					<td>
					    <select id="transferTypeSel" name="transferType" class="easyui-combobox" style="width: 155px" data-options="required:true">
						    ${transferType}
					    </select>
					</td>
				</tr>
				
				<tr id="scanIMEITr">
					<td>SN扫描类型</td>
					<td>
					    <select class="easyui-combobox" name="scanType" style="width: 155px"
							data-options="editable:false,panelHeight:'auto'">
								${scanType}
						</select>
					</td>

					<td>列表:</td>
					<td><textarea class="easyui-validatebox" id="snList" name="snList"/>
					</td>
				</tr>
				
				<tr id="relationedCustomerIdTr">
					<td><div class="star">*</div>货主关系人:</td>
					<td>
					    <input myType="easyui-combobox" name="relationedCustomerId" id="relationedCustomerId" required="true"></input>
					    <input type="hidden" id="relationedCustomerCode" name="relationedCustomerCode"/>
					    <input type="hidden" id="relationedCustomerName" name="relationedCustomerName"/>
					    <input type="hidden" id="relationedCustomerAlias" name="relationedCustomerAlias"/>
					</td>
				</tr>
				
				<tr id="noScanIMEITr">
					<td><div class="star">*</div>原产品形态:</td>
					<td>
					    <select class="easyui-combobox" name="normalFlag"
							style="width: 155px" data-options="required:true,editable:true">
								<c:forEach var="item" items="${normalFlagList}">
									<option value="${item.normalFlag}">${item.normalFlag}</option>
								</c:forEach>
						</select>
					</td>

					<td>原批次:</td>
					<td><input class="easyui-validatebox" name="lotNumber" /></td>

					<td>原生产日期:</td>
					<td><input class="easyui-datebox" name="produceDate" /></td>
				</tr>
				
				<tr id="noScanIMEITr1">
					<td><div class="star">*</div>商品:</td>
					<td>
					    <input myType="easyui-combogrid" name="itemId" id="itemId"></input>
					    <input type="hidden" name="itemName"></input>
				        <input type="hidden" name="itemCode"></input>
					</td>

					<td><div class="star">*</div>转移数量:</td>
					<td><input class="easyui-validatebox" id="stockRightQuantity" name="stockRightQuantity"/></td>

					<td>自动完成:</td>
					<td><input class="easyui-validatebox" name="autoCompleteFlag"
						type="checkbox" /></td>
				</tr>
				
				<tr>
					<td><div class="star">*</div>转入货主:</td>
					<td>
					    <input myType="easyui-combobox" style="width: 155px" id="toCustomerId" name="toCustomerId" required="true"></input>
						<input type="hidden" id="toCustomerCode" name="toCustomerCode"/>
					    <input type="hidden" id="toCustomerName" name="toCustomerName"/>					    
					    <input type="hidden" id="toCustomerAlias" name="toCustomerAlias"/>
					</td>
					<td><div class="star">*</div>转入货主关系人:</td>
					<td>
						<input myType="easyui-combobox" style="width: 155px" id="toRelationedCustomerId" name="toRelationedCustomerId" required="true"></input>
					    <input type="hidden" id="toRelationedCustomerCode" name="toRelationedCustomerCode"/>
					    <input type="hidden" id="toRelationedCustomerName" name="toRelationedCustomerName"/>
					    <input type="hidden" id="toRelationedCustomerAlias" name="toRelationedCustomerAlias"/>
					</td>
				</tr>
				<tr>
					<td><div class="star">*</div>产品形态:</td>
					<td>
					    <select class="easyui-combobox" name="toNormalFlag"
							style="width: 155px" data-options="required:true,editable:true">
								<c:forEach var="item" items="${normalFlagList}">
									<option value="${item.normalFlag}">${item.normalFlag}</option>
								</c:forEach>
						</select>
					</td>

					<td>新批次:</td>
					<td><input class="easyui-validatebox" name="toLotNumber" /></td>

					<td>新生产日期:</td>
					<td><input class="easyui-datebox" name="toProduceDate" /></td>
				</tr>
				<tr>
					<td colspan="6" align="center"><a href="#" icon="icon-save"
						id="saveStockRightTransferDetailBtn" class="easyui-linkbutton">提交</a>&nbsp;<a
						href="#" icon="icon-save" id="colseDetailBtn"
						class="easyui-linkbutton" onclick="$('#detailWindow').window('close')">关闭</a>
					</td>
				</tr>
			</table>				
			</form>
		</div>
		
		
		
		
		
		
		<!-- start 明细下的处理明细 -->
		<div title="处理明细">
			<div id="toolbar" style="padding: 5px; border: 1px solid #ddd;" />
			<a id="addHandeleDetailBtn" href="#" class="easyui-linkbutton"
				data-options="iconCls:'icon-add'">新增</a> <a
				id="removeHandleDetailBtn" href="#" class="easyui-linkbutton"
				data-options="iconCls:'icon-remove'">删除</a>
			<table id="handeleDetailList" >
				<thead>
					<tr>
						<th data-options="field:'id',checkbox:true">编码</th>
						<th data-options="field:'locationName',align:'center',width:100">储位</th>
						<th data-options="field:'itemCode',align:'center',width:100">产品代码</th>
						<th data-options="field:'itemName',align:'center',width:100">产品名称</th>
						<th data-options="field:'normalFlag',align:'center',width:100">产品形态</th>
						<th data-options="field:'stockRightQuantity',align:'center',width:100">数量</th>
						<th data-options="field:'toLocationName',align:'center',width:100">新储位</th>
						<th data-options="field:'locationContainerId',align:'center',width:100">库存明细编码</th>
						<th data-options="field:'toLotNumber',align:'center',width:100">SN明细</th>
					</tr>
				</thead>
			</table>
			<!-- 选择具体处理明细页面 -->
			<div style="display: none;">
				<div id="addHandleDetail">
					<form id="locationContainerSearchForm" action="#" method="post">
						<table width="100%">
							<tr>
								<td><label for="inventoryAttributeTransferId"
									style="vertical-align: middle">储位:</label>
								</td>
								<td><input class="easyui-validatebox" type="text"
									style="vertical-align: middle" name="queryLocationName" />
								</td>
								<td><label for="transferTime"
									style="vertical-align: middle">数量:</label></td>
								<td><input class="easyui-validatebox" type="text"
									style="vertical-align: middle" name="queryQuantity" />
								</td>
								<td align="right" colspan="3"><a
									id="locationContainerSearch" href="#" class="easyui-linkbutton"
									data-options="iconCls:'icon-search'">查询</a>
								</td>
							</tr>
						</table>
					</form>

					<div style="padding: 5px; border: 1px solid #ddd;" />
					<a id="submitHandeleDetailBtn" href="#" class="easyui-linkbutton">确认</a>
					<a href="#" class="easyui-linkbutton"
						onclick="$('#addHandleDetail').window('close')">关闭</a>

					<table id="locationContainerList" >
						<thead>
							<tr>
								<th data-options="field:'ck',checkbox:true">主键</th>
								<th data-options="field:'id'">库存明细号</th>
								<th data-options="field:'itemCode',align:'center',width:100">商品代码</th>
								<th data-options="field:'itemName',align:'center',width:180">商品名称</th>
								<th data-options="field:'locationName',align:'center',width:85">储位</th>
								<th data-options="field:'zoneName',align:'center',width:80">库区</th>
								<th data-options="field:'lotNumber',align:'center',width:45">批次</th>
								<th data-options="field:'normalFlag',align:'center',width:80">产品形态</th>
								<th data-options="field:'quantity',align:'center',width:60">数量</th>
								<th
									data-options="field:'usableQuantity',align:'center',width:65">可用库存</th>
								<th
									data-options="field:'frozoneQuantity',align:'center',width:65">冻结数量</th>
								<th
									data-options="field:'lockRemainningQuantity',align:'center',width:65">锁定数量</th>
								<th data-options="field:'warehouseName',align:'center',width:90">仓库</th>
								<th data-options="field:'customerName',align:'center',width:90">货主</th>
								<th
									data-options="field:'relationedCustomerName',align:'center',width:90">货主关系人</th>								
							</tr>
						</thead>
					</table>
				</div>
			</div>
			<!-- 填充数量和新储位 -->
			<div style="display: none;">
				<form id="finalDealHandeleDetail">
					<input type="hidden" name="operate" /> <input type="hidden"
						name="id" />
					<table style="width: 100%">
						<tr>
							<td>库存明细编号:</td>
							<td><input class="easyui-validatebox"
								name="locationContainerId" disabled="disabled" /></td>
							<td>储位:</td>
							<td><input class="easyui-validatebox" name="locationName"
								/></td>
						</tr>

						<tr>
							<td>产品代码:</td>
							<td><input class="easyui-validatebox" name="itemCode"
								/></td>
							<td>产品名称:</td>
							<td><input class="easyui-validatebox" name="itemName"
								/></td>
						</tr>

						<tr>
							<td><div class="star">*</div>转移数量:</td>
							<td>
<!-- 							    <input class="easyui-validatebox" id="transferQuantityValidate" name="transferQuantity" -->
<!-- 							        data-options="required: true,validType:'validateQuantity[5,12]'"/>   -->
							    <input class="easyui-validatebox" id="transferQuantityValidate" name="transferQuantity"/>  
							</td>
							<td>新储位:</td>
							<td>
							    <input myType="easyui-combogrid" name="toLocationId" id="toLocationId"></input>
							</td>
						</tr>
						<tr>
							<td colspan="4" align="center"><a href="#" icon="icon-save"
								id="submitHandleDetailBtn" class="easyui-linkbutton">提交</a>&nbsp;<a
								href="#" icon="icon-save" id="colseDetailBtn"
								class="easyui-linkbutton"
								onclick="$('#finalDealHandeleDetail').window('close')">关闭</a></td>
						</tr>
					</table>
				</form>
			</div>
		</div>
		<!-- end 明细下的处理明细 -->
	</div>
</body>
</html>