<apex:page Controller="AgencyHospitalLinkController" sidebar="false" id="allPage" action="{!init}">
|
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/>
|
<script>
|
/*function ClearJs(){
|
blockme();
|
document.getElementById("allPage:allForm:allBlock:searchBlock:StateMaster").value = "";
|
document.getElementById("allPage:allForm:allBlock:searchBlock:CityMaster").value = "";
|
document.getElementById("allPage:allForm:allBlock:searchBlock:OCMCategory").value = "";
|
searchHospital();
|
}*/
|
var selectedSize = 0;
|
var pageLimit = {!pagesize};
|
function checkAll() {
|
selectedSize = 0;
|
var productCount = j$(escapeVfId('allPage:allForm:HospitalInfoSection:hospitalInfoRecoedsviewCount')).value();
|
if (j$(escapeVfId('checker')).attr('checked') == 'checked') {
|
for (var i = 0; i < productCount; i++) {
|
if(selectedSize >= pageLimit){
|
window.alert("所选医院不能超过500条");
|
return;
|
}
|
j$(escapeVfId('allPage:allForm:HospitalInfoSection:HospitalInfoListview:' + i + ':consumablesCountproRowCheckbox')).attr('checked',true);
|
selectedSize ++;
|
}
|
} else {
|
for (var i = 0; i < productCount; i++) {
|
j$(escapeVfId('allPage:allForm:HospitalInfoSection:HospitalInfoListview:' + i + ':consumablesCountproRowCheckbox')).attr('checked',false);
|
}
|
}
|
}
|
|
// 用于选择对应的经销商对象,ET特约店对象,ENG特约店对象
|
// selfId为触发该方法的选择框的id
|
// sonId为每行选择框的id
|
function checkAllOther(selfId,sonId) {
|
selectedSize = 0;
|
// 获取当前页总条数
|
var productCount = j$(escapeVfId('allPage:allForm:HospitalInfoSection:hospitalInfoRecoedsviewCount')).value();
|
// 如果当前选择框取消选中,将其以下的所有选择框取消选择
|
if (j$(escapeVfId(selfId)).attr('checked') != 'checked') {
|
for (var i = 0; i < productCount; i++) {
|
// 拿到每一行对应的选择框进行取消选择
|
var listId = 'allPage:allForm:HospitalInfoSection:HospitalInfoListview:' + i + ':'+sonId;
|
j$(escapeVfId(listId)).attr('checked',false);
|
}
|
return;
|
}
|
|
// checker是名称为选择的选择框的id
|
// 如果该选择框被选中,代表全选
|
if (j$(escapeVfId('checker')).attr('checked') == 'checked') {
|
// 拿到每一条数据
|
for (var i = 0; i < productCount; i++) {
|
if(selectedSize >= pageLimit){
|
window.alert("所选医院不能超过500条");
|
return;
|
}
|
// 将对应的其他对象下的选择框选中
|
j$(escapeVfId('allPage:allForm:HospitalInfoSection:HospitalInfoListview:' + i + ':'+sonId)).attr('checked',true);
|
selectedSize ++;
|
}
|
} else {
|
// 没有全选的情况下,判断每个选择框是否选中
|
for (var i = 0; i < productCount; i++) {
|
// 拿到每一个对应的选择框的id
|
var listId = 'allPage:allForm:HospitalInfoSection:HospitalInfoListview:' + i + ':'+sonId;
|
// 根据医院名称是否勾选对其他对象的选择框进行对应勾选
|
if (j$(escapeVfId('allPage:allForm:HospitalInfoSection:HospitalInfoListview:' + i + ':consumablesCountproRowCheckbox')).attr('checked') == 'checked') {
|
j$(escapeVfId(listId)).attr('checked',true);
|
}else{
|
j$(escapeVfId(listId)).attr('checked',false);
|
}
|
}
|
}
|
}
|
|
function CheckSize(j){
|
var a = j.id;
|
var productCount = j$(escapeVfId(a)).attr('checked');
|
if (productCount == 'checked') {
|
if(selectedSize >= pageLimit){
|
window.alert("所选医院不能超过500条");
|
j$(escapeVfId(a)).attr('checked',false);
|
return;
|
}
|
selectedSize ++;
|
} else {
|
selectedSize --;
|
}
|
//alert(selectedSize);
|
}
|
|
function checkhospitalInfo(){
|
CheckHospitalInfo();
|
}
|
|
function saveJs() {
|
// var delAgencyLinkSize = j$(escapeVfId('allPage:allForm:HospitalInfoSection:delAgencyLinkSize')).value();
|
//if(delAgencyLinkSize > 0){
|
// if(window.confirm("所选医院有在其他经销商下的,确认保存吗?")){
|
// blockme();
|
// save();
|
// }
|
//}else{
|
blockme();
|
save();
|
//}
|
|
}
|
|
function refreshPageSizeJs() {
|
refreshPageSize();
|
}
|
|
function searchHospitalJs() {
|
blockme();
|
searchHospital();
|
}
|
|
function showCity() {
|
cityload();
|
}
|
|
</script>
|
<apex:form id="allForm">
|
<apex:actionFunction name="refreshPageSize" action="{!refreshPageSize}" status="fetchStatus" reRender="HospitalInfoSection" />
|
<apex:actionFunction name="save" action="{!save}" rerender="HospitalInfoSection, message" onComplete="unblockUI();">
|
</apex:actionFunction>
|
<apex:actionFunction name="CheckHospitalInfo" action="{!CheckHospitalInfo}" rerender="HospitalInfoSection,message" onComplete="saveJs();">
|
</apex:actionFunction>
|
<apex:actionFunction name="cityload" action="{!cityload}" rerender="searchBlock">
|
</apex:actionFunction>
|
<apex:actionFunction name="searchHospital" action="{!searchHospital}" rerender="HospitalInfoSection, message" onComplete="unblockUI();">
|
</apex:actionFunction>
|
<apex:outputPanel id="allPanel">
|
|
<apex:pageBlock id="searchBlock">
|
<table>
|
<colgroup>
|
<col width="60px"/>
|
<col width="100px"/>
|
<col width="170px"/>
|
<col width="15px"/>
|
<col width="50px"/>
|
<col width="170px"/>
|
<col width="15px"/>
|
<col width="80px"/>
|
<col width="170px"/>
|
<col width="15px"/>
|
<col width="50px"/>
|
<col width="170px"/>
|
<col width="10px"/>
|
</colgroup>
|
<tr>
|
<td/>
|
<td align="right">医院名:</td>
|
<td>
|
<apex:inputtext id="hosptial_name" value="{!category1}" style="width:170px"/>
|
</td>
|
<td/>
|
<td align="right">省:</td>
|
<td style="text-align:left;">
|
<apex:selectList id="StateMaster" value="{!area}" size="1" style="width:170px" onchange="showCity();return false;">
|
<apex:selectOptions value="{!areaOpts}"/>
|
</apex:selectList>
|
</td>
|
<td/>
|
<td align="right">市:</td>
|
<td style="text-align:left;"><apex:selectList id="CityMaster" value="{!city}" size="1" style="width:170px"><apex:selectOptions value="{!cityOpts}"/></apex:selectList>
|
</td>
|
<td/>
|
<td align="right">区县:</td>
|
<td>
|
<apex:inputtext id="town" value="{!category3}" style="width:170px"/>
|
<!--<apex:selectList id="OCMCategory" value="{!category3}" size="1" style="width:170px"><apex:selectOptions value="{!ocmOpts}"/></apex:selectList>-->
|
</td>
|
<td/>
|
<td align="right"></td>
|
<td><apex:commandButton value="搜索" style="width: 100px;" onclick="searchHospitalJs();return false;" /></td>
|
<!-- <td><input type="button" value="清空" style="width: 100px;" onclick="ClearJs()" class="btn"/></td> -->
|
<td/>
|
</tr>
|
</table>
|
</apex:pageBlock>
|
|
<!-- <apex:outputPanel id="messageText">
|
<table>
|
<tr>
|
<td>
|
<div id="ErrorName" style="color: red;font-weight: bold;" >{!alertMessage}</div>
|
</td>
|
</tr>
|
</table>
|
</apex:outputPanel> -->
|
<apex:outputPanel id="message">
|
<apex:pageMessages />
|
</apex:outputPanel>
|
|
<apex:pageBlock title="医院信息" id="HospitalInfoSection">
|
<apex:pageBlockButtons location="top">
|
全部保存<apex:inputCheckbox value="{!allSave}" id="allSave" style="width:20px"/>
|
<apex:commandButton onclick="checkhospitalInfo();return false;" value="保存" style="margin-left:30px;width:100px" rerender="dummy" rendered="true" />
|
</apex:pageBlockButtons>
|
<input type="hidden" id="allPage:allForm:HospitalInfoSection:hospitalInfoRecoedsviewCount" value="{!hospitalInfoRecoedsviewCount}" />
|
<!-- <apex:inputHidden id="hospitalInfoRecoedsviewCount" value="{!hospitalInfoRecoedsviewCount}"/> -->
|
<!-- <apex:inputHidden id="delAgencyLinkSize" value="{!delAgencyLinkSize}"/> -->
|
<table class="list" border="0" cellpadding="0" cellspacing="0">
|
<tr class="headerRow">
|
<apex:variable var="v" value="">
|
<th><input type='checkbox' onClick='checkAll()' id='checker'/>选择</th>
|
</apex:variable>
|
<th>医院名称</th>
|
<th>医院管理编码</th>
|
<th>省</th>
|
<th>市</th>
|
<th>区县</th>
|
<th><input type='checkbox' onClick='checkAllOther("checkerag","Agency_Campaign")' id='checkerag'/>{!$ObjectType.Agency_Hospital_Link__c.fields.Agency_Campaign_Obj__c.label}</th>
|
<th><input type='checkbox' onClick='checkAllOther("checkerET","AgencyHos_ET")' id='checkerET'/>{!$ObjectType.Agency_Hospital_Link__c.fields.AgencyHos_ET__c.label}</th>
|
<th><input type='checkbox' onClick='checkAllOther("checkerENG","AgencyHos_ENG")' id='checkerENG'/>{!$ObjectType.Agency_Hospital_Link__c.fields.AgencyHos_ENG__c.label}</th>
|
</tr>
|
|
<apex:repeat value="{!hospitalInfoRecordsview}" var="records" id="HospitalInfoListview">
|
<!-- <apex:repeat value="{!m}" var="records" id="ConsumableorderdetailsTable"> -->
|
<tr class="dataRow">
|
<td>
|
<apex:inputCheckbox value="{!records.check}" onclick="CheckSize(this);" id="consumablesCountproRowCheckbox"/>
|
<apex:inputCheckbox value="{!records.oldCheck}" id="proRowOldCheckbox" style="display:none"/>
|
</td>
|
<td class="dataCell">
|
<apex:outputText value="{!records.acc1.Name}"/>
|
</td>
|
<td class="dataCell">{!records.acc1.Management_Code__c}</td>
|
<td class="dataCell">{!records.acc1.State_Master__r.Name}</td>
|
<td class="dataCell">{!records.acc1.City_Master__r.Name}</td>
|
<td class="dataCell">{!records.acc1.Town__c}</td>
|
<td class="dataCell">
|
<apex:inputField value="{!records.esd.Agency_Campaign_Obj__c}" id="Agency_Campaign"/>
|
</td>
|
<td class="dataCell">
|
<apex:inputField value="{!records.esd.AgencyHos_ET__c}" id="AgencyHos_ET"/>
|
</td>
|
<td class="dataCell">
|
<apex:inputField value="{!records.esd.AgencyHos_ENG__c}" id="AgencyHos_ENG"/>
|
</td>
|
</tr>
|
<!-- </apex:repeat> -->
|
</apex:repeat>
|
</table>
|
|
<table style="width: 100%">
|
<tr>
|
<td>
|
<!-- Page X of Y -->
|
<!-- PageNumber:当前页面所在位置,ResultSize:记录总条数,PageSize:每页记录条数 -->
|
<apex:outputText value="{!(currentpage * pagesize)+1-pagesize}-{!IF((currentpage * pagesize)>totalcount, totalcount,
|
(currentpage * pagesize))} 共 {!totalcount} 个" />
|
</td>
|
<td align="center">
|
<div class="paginator line1">
|
<span class="prevNextLinks">
|
<span class="prevNext">
|
<apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection" action="{!moveToFirst}" oncomplete="refreshPageSizeJs();" title="首页" >
|
<img src="/s.gif" title="首页" alt="首页" class="{!if((hasPrevious),'first','firstoff')}"/>
|
</apex:commandLink>
|
</span>
|
<span class="prevNext">
|
<apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection" action="{!moveToPrevious}" oncomplete="refreshPageSizeJs();" title="上一页">
|
<img src="/s.gif" title="上一页" alt="上一页" class="{!if((hasPrevious),'prev','prevoff')}"/>上一页
|
</apex:commandLink>
|
</span>
|
<!-- -->
|
<span class="prevNext" >
|
<apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection" action="{!moveToNext}" oncomplete="refreshPageSizeJs();" title="下一页">下一页
|
<img src="/s.gif" title="下一页" alt="下一页" class="{!if((hasNext),'next','nextoff')}"/>
|
</apex:commandLink>
|
</span>
|
<span class="prevNext">
|
<apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection" action="{!moveToLast}" oncomplete="refreshPageSizeJs();" title="尾页">
|
<img src="/s.gif" title="尾页" alt="尾页" class="{!if((hasNext),'last','lastoff')}"/>
|
</apex:commandLink>
|
</span>
|
</span>
|
</div>
|
</td>
|
<td align="right" width="20%">
|
</td>
|
</tr>
|
</table>
|
|
|
</apex:pageBlock>
|
|
</apex:outputPanel>
|
</apex:form>
|
</apex:page>
|