<apex:page controller="RepairRenewalController" showHeader="false" sidebar="false" action="{!init}" title="维修续借" lightningStylesheets="true">
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<apex:stylesheet value="{!URLFOR($Resource.StyleUtilCss)}"/><!-- 20230525 ljh lightning  -->
<apex:includeScript value="{!URLFOR($Resource.SelectFieldJs)}"/>
	<style>
		.bPageBlock .detailList .labelCol {
			width: 7%;
		}
		.bPageBlock .detailList .dataCol {
			width: 20%;
		}
		body .bPageBlock .detailList .labelCol{
			width: 7% !important;
		}
		body .bPageBlock .detailList .labelCol select{
			min-width: 50px !important;
		}
		body .detailList .dataCol select{
			min-width: 80px;
		}
		body .detailList .dataCol input[type="text"]{
			min-width: 160px;
		}
	</style>
	<apex:form id="allForm">
		<!-- <apex:pageBlock title="" id="allBlock" rendered="true"> -->
		<apex:outputPanel id="message">
			<apex:pageMessages />
		</apex:outputPanel>
		<apex:outputPanel id="pageallPanel">
        <apex:pageBlock id="searchBlock" tabStyle="Report">
            <apex:pageBlockSection title="维修续借" id="mainSection" columns="3" collapsible="false" >
				<apex:outputField value="{!raObj.Routine_Check_Person__c}" />
				<apex:inputField value="{!raObj.Routine_Check_Status__c}" />
				<apex:outputField value="{!raObj.Routine_Check_Day__c}" />
				<apex:pageBlockSectionItem >
					<apex:outputLabel value="新修理单" />
					<!-- <apex:inputField value="{!raObj.Repair__c}" id="newRepair"/> -->
					<apex:inputField style="width:180px;" id="newRepair"  value="{!raObj.Repair__c}"   onChange="" />
				</apex:pageBlockSectionItem>
			</apex:pageBlockSection>

			<apex:pageBlockSection columns="3">
				<apex:pageBlockSectionItem />
				<apex:pageBlockSectionItem >
					<apex:commandButton value="续借" action="{!doRenewal}" onclick="blockme();" rerender="allForm" oncomplete="unblockUI();" />
					<apex:commandButton value="取消" onclick="javascript:window.opener=null;window.open('','_self');window.close();"/>
				</apex:pageBlockSectionItem>
				<!-- <apex:pageBlockSectionItem >
					<apex:commandButton value="取消" onclick="window.close()"/>
				</apex:pageBlockSectionItem> -->	
			</apex:pageBlockSection>
        </apex:pageBlock>
	    </apex:outputPanel>
	</apex:form>
	<script type="text/javascript">
	//标准控件弹出页面修改 start
        //查询参数列表
        let SelectFieldParamList=[
            {
                //原apex:inputField的id值，需要在页面上获取
                inputFieldId : 'j_id0:allForm:searchBlock:mainSection:j_id36:newRepair',
                //查找字段所在对象
                ObjectType : 'Rental_Apply__c',
                //查找字段的api名称
                QueryFieldApiName : 'Repair__c',
                //查找字段的查找对象
                SelectObj : 'Repair__c',
                //搜索时使用的字段
                SelectFld : 'Name',

				setVal :'{!raObj.Hospital_ID__c}',

            },
        ]

        //初始化
        resetOpenPage(SelectFieldParamList);
         function unblockUI(){
            j$("#sbArea").fadeOut(500, function(){
                j$("#sbArea").remove();
            });
            resetOpenPage(SelectFieldParamList);
        }
	</script>
</apex:page>