<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ include file="../language.jsp" %>

<script src="../scripts/itsm/security/organizationMain.js?random=<%=new java.util.Date().getTime()%>"></script>

<div class="loading" id="organizationMain_loading"><img src="../images/icons/loading.gif" /></div>

<!-- 树形主面板开始-->
<div id="organizationMain_content" class="easyui-panel content" fit="true"  border="none">


<div class="easyui-layout" id="organization_Layout" fit="true">


<div id="organization_jsp_holidayTab_tempHTML"></div>


<sec:authorize url="/pages/organization!updateOrg.action">

<div region="west" id="organzationWest" split="true" title="<fmt:message key="title.orgSettings.currentOrg" />" style="width:300px;">


<!-- 修改开始 -->


<div id="editOrgDiv" class="lineTableBgDiv">
<form id="editCurrentOrgForm">

		<table style="width:100%" class="lineTable" cellspacing="1">

	<tr>
		<td style="width: 25%; height: 32px;"><fmt:message key="label.orgSettings.orgType" /></td>
		<td style="width: 75%">
		<select id="edit_actionType" name="actionType" style="width: 96%">
			<option value="inner"><fmt:message key="label.orgSettings.orgInner" /></option>
			<option value="services"><fmt:message key="label.orgSettings.orgService" /></option>
		</select></td>
	</tr>




	<tr>
		<td style="height: 32px">
		<div id="orgNameDiv"><fmt:message key="label.orgSettings.orgName" /></div>
		</td>
		<td><input id="edit_orgName" name="organizationDto.orgName" class="easyui-validatebox input" required="true"/></td>
	</tr>

	<tr>
		<td style="height: 32px"><fmt:message key="label.orgSettings.orgPhone" /></td>
		<td>
			<input id="edit_officePhone" name="organizationDto.officePhone" class="easyui-validatebox input" validType="phone" required="true" />
		</td>
	</tr>
	
	<tr>
		<td style="height: 32px"><fmt:message key="label.orgSettings.orgFax" /></td>
		<td><input id="edit_officeFax" name="organizationDto.officeFax" class="easyui-validatebox input" validType="phone"/></td>
	</tr>

	<tr>
		<td style="height: 32px"><fmt:message key="label.orgSettings.orgEmail" /></td>
		<td><input id="edit_email" name="organizationDto.email" class="easyui-validatebox input" validType="email" /></td>
	</tr>

	<tr>
		<td style="height: 32px"><fmt:message key="label.orgSettings.orgAddress" /></td>
		<td><input id="edit_address" name="organizationDto.address" style="width: 96%" /></td>
	</tr>
	
	
	<tr>
		<td style="height: 32px"><fmt:message key="label.orgSettings.orgInchargeName" /></td>
		<td>
		
		<input id="organizationDto_personInChargeName" style="width:60%" /> &nbsp;<a id="organizationDto_personInChargeName_choose"><fmt:message key="label.org.choosePersonInCharge" /></a>
		
		<input type="hidden" name="organizationDto.personInChargeNo" id="organizationDto_personInChargeNo"/>
		
		</td>
	</tr>
	


	<tr>
		<td colspan="2" style="padding-top:10px; padding-bottom:10px">
		<input id="edit_orgNo" type="hidden" name="organizationDto.orgNo" /> 
		<input id="edit_parentOrgNo" type="hidden" name="organizationDto.parentOrgNo" value="-1" /> 
		<input type="hidden" name="doTag" value="edit" /> 
		<input type="hidden" id="edit_orgType" name="orgType" value="company" />


		<div id="edit_org">
		
		 
		 <a href="javascript:void(0)" class="easyui-linkbutton" icon="icon-save" id="mergeCurrentOrgBtn"><fmt:message key="common.save" /></a>
		
		
		
		
			</div>
		</td>
	</tr>

</table>

</form>

</div>


<!-- 修改结束 -->


</div>

 </sec:authorize>




<div region="center" id="organCenter">


<div class="easyui-tabs" fit="true" id="organizationMainTab" border="false">


<!-- 新增编辑面板 start -->

<sec:authorize url="/pages/organization!save.action">

<div title="<fmt:message key="title.orgSettings.childrenOrg" />" style="padding:3px">





		<div id="addOrgDiv" class="easyui-panel" title="<fmt:message key="title.orgSettings.addOrg" />" minimizable="false" maximizable="false" closable="false" style="padding:0px; background: #fafafa;">

		<!-- 新增开始 -->
		<form id="addChildForm" style="margin:0px">


		<div class="lineTableBgDiv">
		<table style="width:100%" class="lineTable" cellspacing="1">


			<tr>
				<td style="width:15%"><fmt:message key="label.orgSettings.orgType" /></td>
				<td style="width:85%">
					<select id="add_actionType" name="actionType" style="width:96%" onchange="selectAction()">
							<option value="inner"><fmt:message key="label.orgSettings.orgInner" /></option>
							<option value="services"><fmt:message key="label.orgSettings.orgService" /></option>
					</select>
				</td>
			</tr>

			<tr>
				<td>
				<div><fmt:message key="label.orgSettings.orgName" /></div>
				</td>
				<td><input name="organizationDto.orgName" id="addChild_orgName" class="easyui-validatebox input" required="true"/></td>
			</tr>

			<tr>
				<td><fmt:message key="label.orgSettings.orgPhone" /></td>
				<td><input  name="organizationDto.officePhone" id="addChild_officePhone" class="easyui-validatebox input" validType="phone"  required="true" /></td>
			</tr>
			
			<tr>
				<td><fmt:message key="label.orgSettings.orgFax" /></td>
				<td><input name="organizationDto.officeFax" id="addChild_officeFax" class="easyui-validatebox input" validType="phone" /></td>
			</tr>


			<tr>
				<td><fmt:message key="label.orgSettings.orgEmail" /></td>
				<td><input name="organizationDto.email" id="addChild_email" class="easyui-validatebox input" validType="email"/></td>
			</tr>

			<tr>
				<td><fmt:message key="label.orgSettings.orgAddress" /></td>
				<td>
				<input name="organizationDto.address" id="addChild_address" class="input" /></td>
			</tr>
			
			<tr>
				<td><fmt:message key="label.orgSettings.orgInchargeName" /></td>
				<td>
					<input id="organizationDto_personInChargeName_add" style="width:60%" />
					&nbsp;<a id="organizationDto_personInChargeName_add_choose"><fmt:message key="label.org.choosePersonInCharge" /></a>
					
					<input type="hidden" name="organizationDto.personInChargeNo" id="organizationDto_personInChargeNo_add"/>
					
				</td>
			</tr>



			<tr>
				<td colspan="2" style="padding-top:10px; padding-bottom:10px;">
				<input type="hidden" name="doTag" value="add" /> 
				<input type="hidden" value="1" id="add_parentOrgNo" name="organizationDto.parentOrgNo" />
				
				
				<a href="javascript:void(0)" class="easyui-linkbutton" icon="icon-ok" id="saveCurrentOrgBtn"><fmt:message key="common.save" /></a>
	
				
				</td>
			</tr>

		</table>

	</div>

		</form>


		</div>




</div>

</sec:authorize>



<!-- OrgGrid start -->


<sec:authorize url="/pages/organization!find.action">
<div title="<fmt:message key="title.orgSettings.gridView" />" style="padding: 3px;">

<!-- 列表start -->

<table id="orgGrid"></table>
<div id="orgGridPager"></div>


<div style="display:none" id="orgGridAction"><a href="javascript:editOrganizationOpenWindow()" title="<fmt:message key="title.orgSettings.editOrg" />"><img src="../images/icons/edit.gif"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:deleteOrg()"><img src="../images/icons/delete.gif"/></a></div>





<div id="orgGridToolbar" style="display: none">
<sec:authorize url="/pages/organization!save.action">
<a class="easyui-linkbutton" plain="true" icon="icon-add" id="organizationGrid_add"><fmt:message key="common.add" /></a>
</sec:authorize>

 <sec:authorize url="/pages/organization!updateOrg.action">
<a class="easyui-linkbutton" plain="true" icon="icon-edit" id="organizationGrid_edit"><fmt:message key="common.edit" /></a> 
</sec:authorize>


 <sec:authorize url="/pages/organization!remove.action">
<a class="easyui-linkbutton" plain="true" icon="icon-cancel" id="organizationGrid_delete"><fmt:message key="common.delete" /></a> 
</sec:authorize>

<a class="easyui-linkbutton" plain="true" icon="icon-search" id="organizationGrid_search"><fmt:message key="common.search" /></a>

 
&nbsp;&nbsp;<a id="organizationImport"><fmt:message key="label.dc.import" /></a>
&nbsp;|&nbsp;<a id="organizationExport"><fmt:message key="label.dc.export" /></a>

</div>

</div>

</sec:authorize>


<sec:authorize url="/pages/serviceTime!saveOrgUpdate.action">
	<div title="<fmt:message key="title.orgSettings.serviceTime" />" id="serviceTimeDiv" style="padding:3px">
	
	
	<!-- 服务时间设置  -->
	<form style="padding:0px;margin:0px">
	
	<div title="<fmt:message key="title.orgSettings.workTime" />" class="easyui-panel" style="height:auto">
	
	
	    	<table width="100%">
	    	
			<tr>
			<td style="width:100%;height:32px" id="fullDayTd">
				<div style="border:#99bbe8 1px solid;padding:5px;height:19px">
				<input type="radio" name="alldaylabel" value="true" id="fullday" checked/><fmt:message key="label.orgSettings.allDay" />
				</div>
			</td>
			<td rowspan="2" style="width:50%;line-height:32px;" >
			
			<div id="setTime" style="border:#99bbe8 1px solid;padding-left:5px;display:none">
			
			<fmt:message key="label.orgSettings.startTime" />
	            	<select name="serviceTimeDTO.startHour" id="serviceTimeDTO_startHour">
	                    	<option>0</option>
	                        <option>1</option>
	                        <option>2</option>
	                        <option>3</option>
	                        <option>4</option>
	                        <option>5</option>
	                        <option>6</option>
	                        <option>7</option>
	                        <option>8</option>
	                        <option selected="selected">9</option>
	                        <option>10</option>
	                        <option>11</option>
	                        <option>12</option>
	                        <option>13</option>
	                        <option>14</option>
	                        <option>15</option>
	                        <option>16</option>
	                        <option>17</option>
	                        <option>18</option>
	                        <option>19</option>
	                        <option>20</option>
	                        <option>21</option>
	                        <option>22</option>
	                        <option>23</option>
	                    </select>&nbsp;<fmt:message key="label.orgSettings.hour" />&nbsp;&nbsp;
	                    <select name="serviceTimeDTO.startMinute" id="serviceTimeDTO_startMinute">
	                    	<option>0</option>
	                        <option>5</option>
	                        <option>10</option>
	                        <option>15</option>
	                        <option>20</option>
							<option>25</option>
	                        <option>30</option>
	                        <option>35</option>
	                        <option>40</option>
	                        <option>45</option>
							<option>50</option>
	                        <option>55</option>
	                 </select>&nbsp;<fmt:message key="label.orgSettings.minute" />
	                 
	            	<br>
	            	<fmt:message key="label.orgSettings.endTime" />
	            	
	            	<select name="serviceTimeDTO.endHour" id="serviceTimeDTO_endHour">
	                    	<option>0</option>
	                        <option>1</option>
	                        <option>2</option>
	                        <option>3</option>
	                        <option>4</option>
	                        <option>5</option>
	                        <option>6</option>
	                        <option>7</option>
	                        <option>8</option>
	                        <option>9</option>
	                        <option>10</option>
	                        <option>11</option>
	                        <option>12</option>
	                        <option>13</option>
	                        <option>14</option>
	                        <option>15</option>
	                        <option>16</option>
	                        <option selected="selected">17</option>
	                        <option>18</option>
	                        <option>19</option>
	                        <option>20</option>
	                        <option>21</option>
	                        <option>22</option>
	                        <option>23</option>
	                    </select>&nbsp;<fmt:message key="label.orgSettings.hour" />&nbsp;&nbsp;
	                    <select name="serviceTimeDTO.endMinute" id="serviceTimeDTO_endMinute">
	                    	<option selected="selected">0</option>
	                        <option>05</option>
	                        <option>10</option>
	                        <option>15</option>
	                        <option>20</option>
							<option>25</option>
	                        <option>30</option>
	                        <option>35</option>
	                        <option>40</option>
	                        <option>45</option>
							<option>50</option>
	                        <option>55</option>
	                    </select>&nbsp;<fmt:message key="label.orgSettings.minute" />
			
			
			
			</div>
			
			</td>
			
			</tr>
			<tr>
			<td>
			<div style="border:#99bbe8 1px solid;padding:5px;height:19px">
			<input type="radio"  name="alldaylabel" value="false" id="diyday" /><fmt:message key="label.orgSettings.selectWorkTime" />
			</div>
			
			</td>
			</tr>
	
	
	        </table>
	
	
	</div>
	
	
	<div style="height:3px"></div>
	
	
	<div title="<fmt:message key="title.orgSettings.workDay" />" class="easyui-panel" style="height:auto">
	
	    <table width="100%">
	    	<tr height="10px"></tr>
	    	<tr>
	        	<td><input type="checkbox" name="serviceTimeDTO.monday" id="serviceTimeDTO_monday" value="false" checked="checked"/><fmt:message key="label.orgSettings.monday" /></td>
	            <td><input type="checkbox" name="serviceTimeDTO.tuesday" id="serviceTimeDTO_tuesday" value="false" checked="checked"/><fmt:message key="label.orgSettings.tuesday" /></td>
	            <td><input type="checkbox" name="serviceTimeDTO.wednesday" id="serviceTimeDTO_wednesday" value="false" checked="checked"/><fmt:message key="label.orgSettings.wednesday" /></td>
	            <td><input type="checkbox" name="serviceTimeDTO.thursday" id="serviceTimeDTO_thursday" value="false" checked="checked"/><fmt:message key="label.orgSettings.thursday" /></td>
	            <td><input type="checkbox" name="serviceTimeDTO.friday" id="serviceTimeDTO_friday" value="false" checked="checked"/><fmt:message key="label.orgSettings.friday" /></td>
	        </tr>
	        <tr>
	        	<td><input type="checkbox" name="serviceTimeDTO.saturday" id="serviceTimeDTO_saturday" value="false" /><fmt:message key="label.orgSettings.saturday" /></td>
	            <td><input type="checkbox" name="serviceTimeDTO.sunday" id="serviceTimeDTO_sunday" value="false" /><fmt:message key="label.orgSettings.sunday" /></td>
	            <td></td>
	            <td></td>
	            <td></td>
	
	        </tr>
	
	        <tr>
	        <td colspan="5" style="height:50px">
	        
	        <input type="hidden" name="serviceTimeDTO.allday" id="serviceTimeDTO_allday"/>
	        <input type="hidden" name="serviceTimeDTO.sid" id="serviceTimeDTO_sid"/>
	        <input type="hidden" name="serviceTimeDTO.orgNo" id="serviceTime_orgNo"/>
	        
	        <div id="saveOrUpdateServiceTimeBtnDiv">
	         
	        <a class="easyui-linkbutton" icon="icon-save" id="serviceTime_save"><fmt:message key="common.save" /></a>
	        </div>
	        
	        </td>
	        
	        </tr>
	    </table>
	</div>
	
	
	</form>
	
	</div>
</sec:authorize>




<div title="<fmt:message key="title.orgSettings.holiday" />" style="padding:3px">

	<!-- 新增节假日  -->
	<table id="holidayGrid"></table>
	<div id="holidayGridPager"></div>
	<div id="holidayGridToolbar" style="display: none">
	<sec:authorize url="/pages/holiday!addHoliday.action">
	<a class="easyui-linkbutton" plain="true" icon="icon-add" id="holidayGrid_add"><fmt:message key="common.add" /></a>
	</sec:authorize>
	<sec:authorize url="/pages/holiday!updateHoliday.action">
	<a class="easyui-linkbutton" plain="true" icon="icon-edit" id="holidayGrid_edit"><fmt:message key="common.edit" /></a> 
	</sec:authorize>
	<a class="easyui-linkbutton" plain="true" icon="icon-cancel" id="holidayGrid_delete"><fmt:message key="common.delete" /></a> 
	</div>

</div>



<sec:authorize url="SetOrgRole_Res">
<div title="<fmt:message key="title.orgSettings.role" />" style="padding:3px">
	<div id="orgRoleDiv" title="<fmt:message key="title.orgSettings.role" />" class="easyui-panel" fit="ture" >
		<form>
		<div class="lineTableBgDiv">
			<table style="width:100%" class="lineTable" cellspacing="1"></table>
		</div>
		</form>
	</div>
</div>
</sec:authorize>



</div>


</div>



<!-- 分类树开始-->
<sec:authorize url="/pages/organization!find.action">
<div region="east" id="organizationEast" title="<fmt:message key="title.orgSettings.orgList" />" split="true" style="width: 260px; padding: 5px; background: #ffffee">
<div id="orgTreeDIV"></div>
</div>
</sec:authorize>
<!-- 分类树结束 -->

</div>






<!-- 树形主面板结束-->




<div id="addHolidayWindow" class="easyui-window" closed="true" collapsible="false" minimizable="false" maximizable="false" modal="true" title="<fmt:message key="title.orgSettings.addHoliday" />"
style="width:350px; height:auto">

<form id="holidayForm">
	<div class="lineTableBgDiv">
			<table style="width:100%" class="lineTable" cellspacing="1">
	
			<tr>
			<td style="width:20%"><fmt:message key="label.orgSettings.holidayDate" /></td>
			<td style="width:80%">
				<input id="hoilday_hdate" name="holidayDTO.hdate" class="easyui-datebox" required="true" style="width:80px;cursor:pointer" readonly/>
				&nbsp;<fmt:message key="label.orgSettings.holidayTo" />&nbsp;
				<input id="hoilday_hedate" name="holidayDTO.hedate" class="easyui-datebox" required="true" validType="DateComparison['hoilday_hdate']" style="width:80px;cursor:pointer" readonly/>
			</td>
			</tr>
			
			<tr>
			<td><fmt:message key="label.orgSettings.holidayDescription" /></td>
			<td>
				<textarea id="hoilday_hdesc" name="holidayDTO.hdesc" class="easyui-validatebox input" required="true" style="height:60px"></textarea>
			</td>
			</tr>
			
			<tr>
			<td></td>
			<td style="padding-top:10px">
			
			<input type="hidden" id="hoilday_hid" name="holidayDTO.hid" />
			<input type="hidden" id="hoilday_orgNo" name="holidayDTO.orgNo" />
			
			<a class="easyui-linkbutton" icon="icon-ok" id="holidayGrid_save" ><fmt:message key="common.save" /></a>
			</td>
			</tr>
			
			</table>
	</div>
</form>

</div>











<!-- 机构列表视图 -->
<div id="searchOrg_win" class="easyui-window" closed="true" collapsible="false" minimizable="false" maximizable="false" modal="false" title="<fmt:message key="title.orgSettings.searchOperation" />" style="width: 350px; height:auto">

<form id="searchOrganizationForm" >
<div class="lineTableBgDiv">
	<table style="width:100%" class="lineTable" cellspacing="1">
	<tr>
		<td style="width:20%"><fmt:message key="label.orgSettings.orgName" /></td>

		<td style="width:80%"><input
			id="search_organizationQueryDto_orgName"
			name="organizationQueryDto.orgName" class="input"  /></td>
	</tr>
	<tr>
		<td><fmt:message key="label.orgSettings.orgPhone" /></td>
		<td><input id="search_organizationQueryDto_officePhone"
			name="organizationQueryDto.officePhone" class="input"  /></td>
	</tr>

	<tr>
		<td><fmt:message key="label.orgSettings.orgAddress" /></td>
		<td><input id="search_organizationQueryDto_address"
			name="organizationQueryDto.address" class="input" /></td>
	</tr>

	<tr>
		<td colspan="2">
		<a id="searchOrgBtn_OK" class="easyui-linkbutton" icon="icon-search"><fmt:message key="common.search" /></a>
		</td>
	</tr>
</table>
</div>

</form>

</div>


<!-- 新增编辑机构 -->
<div id="organizationWindow" class="easyui-window" closed="true" collapsible="false" minimizable="false" maximizable="false" modal="true" title="<fmt:message key="title.orgSettings.addOrg" />" style="width: 500px; height:auto">

	<form id="organizationWindowForm">
	
		<div class="lineTableBgDiv">
			<table style="width:100%" class="lineTable" cellspacing="1">
		
			<tr>
				<td style="width:20%"><fmt:message key="label.orgSettings.ownerOrg" /></td>
				<td style="width:80%">
					<input value="<fmt:message key="label.orgSettings.ownerOrgAlert" />" class="choose" id="orgWindow_parentOrgName" />
				</td>
			</tr>
		
			<tr>
				<td><fmt:message key="label.orgSettings.orgType" /></td>
				<td>
					<select id="orgWindow_orgType" name="actionType" style="width: 100%">
						<option value="inner"><fmt:message key="label.orgSettings.orgInner" /></option>
						<option value="services"><fmt:message key="label.orgSettings.orgService" /></option>
					</select>
				</td>
			</tr>
		
			<tr>
				<td><fmt:message key="label.orgSettings.orgName" /></td>
				<td><input id="orgWindow_orgName" name="organizationDto.orgName" class="easyui-validatebox input" required="true"  /></td>
			</tr>
		
			<tr>
				<td><fmt:message key="label.orgSettings.orgPhone" /></td>
				<td><input id="orgWindow_officePhone" name="organizationDto.officePhone" class="easyui-validatebox input" validType="phone" required="true"/></td>
			</tr>
			
			<tr>
				<td><fmt:message key="label.orgSettings.orgFax" /></td>
				<td><input id="orgWindow_officeFax" name="organizationDto.officeFax" class="easyui-validatebox input" validType="phone" /></td>
			</tr>
		

		
			<tr>
				<td><fmt:message key="label.orgSettings.orgEmail" /></td>
				<td><input id="orgWindow_email" name="organizationDto.email" class="easyui-validatebox input" validType="email" /></td>
			</tr>
		
			<tr>
				<td><fmt:message key="label.orgSettings.orgAddress" /></td>
				<td><input id="orgWindow_address" name="organizationDto.address" class="input" /></td>
			</tr>
			
			<tr>
				<td><fmt:message key="label.orgSettings.orgInchargeName" /></td>
				<td>
					<input id="organizationDto_personInChargeName_gridAdd" style="width:60%" />
					&nbsp;<a id="organizationDto_personInChargeName_gridAdd_choose"><fmt:message key="label.org.choosePersonInCharge" /></a>
					<input type="hidden" name="organizationDto.personInChargeNo" id="organizationDto_personInChargeNo_gridAdd"/>
				</td>
			</tr>
		
			<tr>
				<td colspan="2">
				<input type="hidden" name="doTag" id="owDoTag" value="add"> 
				<input type="hidden" value="1" id="orgWindow_parentOrgNo" name="organizationDto.parentOrgNo" /> 
				<input type="hidden" name="organizationDto.orgNo" id="orgWindow_orgNo">
				<a id="saveOrganizationBtn" class="easyui-linkbutton" icon="icon-ok"><fmt:message key="common.save" /></a>
				</td>
			</tr>
		
		</table>
		</div>
	</form>

</div>








<!-- 选择树-->
<div id="selectTree" class="easyui-window" closed="true"
	collapsible="false" minimizable="false" maximizable="false"
	modal="true" title="<fmt:message key="title.orgSettings.chooseCompany" />"
	style="width: 250px; height: 350px; padding: 10px; line-height: 20px;">

<div id="selectTreeDIV"></div>

</div>







 <!-- 导出隐藏信息 -->
    <div style="display: none;">
	   <form action="organization!exportOrganization.action" id="exportOrganizationForm" method="post">
	     <table>
	     <tr>
			<td>						
				<input id="exportOrganization_orgName" name="organizationQueryDto.orgName"/>
				<input id="exportOrganization_officePhone" name="organizationQueryDto.officePhone"/>
				<input id="exportOrganization_address" name="organizationQueryDto.address"/>
				
				<input id="exportOrganization_sidx" name="sidx"/>
				<input id="exportOrganization_sord" name="sord"/>
				<input id="exportOrganization_page" name="page"/>
				<input id="exportOrganization_rows" name="rows"/>
			</td>
		</tr>
	     </table>
	   </form>
    </div>









</div>



