<apex:page controller="StraightBackAddressControllerX" action="{!init}" showHeader="false" sidebar="true" id="allPage" title="测试自定义页面01">
|
<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 type="text/javascript">
|
var winHeigth = window.availHeight;//浏览器高度
|
var winWidth = window.availWidth;//浏览器宽度
|
//$("body").css("heigth",winHeigth);
|
|
window.onload = () => {
|
document.getElementById("tab02").style.height = document.body.offsetHeight/2*1.3+'px';
|
firstCheckBox();
|
}
|
//编辑按钮
|
function onEditorJs(ObjId){
|
onEditor(ObjId);
|
}
|
//复制按钮
|
function onCopyJs(ObjId){
|
onCopy(ObjId);
|
}
|
|
//重新刷新列表数据
|
function refreshData(){
|
window.location.reload();
|
}
|
//保存方法
|
function savaJs(){
|
blockme();
|
save();
|
}
|
|
//复选框选中修理单中已保存的收货地址
|
function firstCheckBox(){
|
var Repair_Address_ID = '{!Repair_Address_ID}';
|
var lawtable = document.getElementById("tableHeader_L");//获取id为tableHeader_L的table
|
var rows = lawtable.rows;//获取所有行
|
for(var i=1; i < rows.length; i++){
|
var InputObj = rows[i].cells[0].getElementsByTagName("input")[0];
|
if(InputObj.value == Repair_Address_ID){
|
InputObj.checked = true;
|
}
|
}
|
}
|
//复选框选中触发事件
|
function onCheckBoxJd(obj,checkId){
|
//如果为true,那么其他的所有复选框必须为不选择状态
|
if(obj.checked){
|
var lawtable = document.getElementById("tableHeader_L");//获取id为tableHeader_L的table
|
var rows = lawtable.rows;//获取所有行
|
for(var i=1; i < rows.length; i++){
|
var InputObj = rows[i].cells[0].getElementsByTagName("input")[0];
|
if(obj != InputObj){
|
InputObj.checked = false;
|
}
|
}
|
}
|
}
|
//采用按钮
|
function onAdoptJs(){
|
var lawtable = document.getElementById("tableHeader_L");//获取id为tableHeader_L的table
|
var rows = lawtable.rows;//获取所有行
|
for(var i=1; i < rows.length; i++){
|
var InputObj = rows[i].cells[0].getElementsByTagName("input")[0];
|
if(InputObj.checked){
|
adoptSave(InputObj.value+"");
|
// closeandreloadJs();
|
}
|
}
|
redirectPag();
|
}
|
//待开发 关闭当前窗口,并刷新父方法
|
function closeandreloadJs(){
|
//window.open('https://ocsm--stagefull.my.salesforce.com/a0J1m000000h0hT');
|
//window.opener.top.location.reload();
|
//window.top.close();
|
blockme();
|
redirectPag();
|
}
|
//刷新当前页面
|
function refreshJs(){
|
window.location.reload();
|
}
|
</script>
|
<apex:form id="allForm">
|
<!-- <div id="tab01"> -->
|
<apex:actionFunction name="init" action="{!init}" rerender="oppBlock1,message" onComplete="unblockUI();"></apex:actionFunction>
|
<apex:actionFunction name="redirectPag" action="{!redirectPag}" rerender="oppBlock1,message" onComplete="unblockUI();"></apex:actionFunction>
|
<apex:actionFunction name="searchBtn" action="{!searchBtn}" rerender="oppBlock1,message" onComplete="unblockUI();"></apex:actionFunction>
|
<apex:actionFunction name="adoptSave" action="{!adoptSave}" rerender="oppBlock2" onComplete="unblockUI();redirectPag();">
|
<apex:param name="adoptId" assignTo="{!adoptId}" value="" />
|
</apex:actionFunction>
|
<apex:actionFunction name="save" action="{!save}" rerender="true" onComplete="refreshJs();"></apex:actionFunction>
|
<apex:actionFunction name="onEditor" action="{!onEditor}" rerender="oppBlock2" onComplete="unblockUI();">
|
<apex:param name="UpdId" assignTo="{!UpdId}" value="" />
|
</apex:actionFunction>
|
<apex:actionFunction name="onCopy" action="{!onCopy}" rerender="oppBlock2" onComplete="unblockUI();">
|
<apex:param name="UpdId" assignTo="{!UpdId}" value="" />
|
</apex:actionFunction>
|
<apex:pageBlock id="searchBlock" tabStyle="Report">
|
<table style="border-bottom-width: 0px; font-size:12px;width:100%">
|
<tr>
|
<td style="width: 10%">
|
<font>类 型 </font>
|
<apex:selectList id="numtextA1Id" value="{!numtextA1}" size="1" style="width:110px">
|
<apex:selectOptions value="{!optionType}"/>
|
</apex:selectList>
|
</td>
|
<td style="width: 15%">
|
<font>客 户 名 </font>
|
<apex:inputText id="txtNameId" value="{!txtName}"/>
|
</td>
|
<td style="width: 15%">
|
<font>地 址 </font>
|
<apex:inputText id="txtAddressId" value="{!txtAddress}"/>
|
</td>
|
<td style="width: 10%">
|
<apex:commandButton action="{!searchBtn}" rendered="true" value="检索" style="width:60px;background:#98c1fbf7"/>
|
|
<apex:commandButton onclick="onAdoptJs();" rendered="true" value="采用" style="width:60px;background:#98c1fbf7"/>
|
</td>
|
<td style="width: 50%">
|
|
</td>
|
</tr>
|
</table>
|
</apex:pageBlock>
|
<apex:outputPanel id="message">
|
<apex:pageMessages />
|
</apex:outputPanel>
|
<!-- </div> -->
|
<div id="tab02" style="overflow-x: auto; overflow-y: auto;">
|
<apex:pageBlock id="oppBlock1" tabStyle="Report">
|
<apex:pageblocksection title="列表" id="edmpdDetails" rendered="true" columns="1" >
|
<apex:outputPanel >
|
<table class="list" style="border-bottom-width: 0px; font-size:11px; border-spacing:0;" border="" id="tableHeader_L" >
|
<thead>
|
<tr class="headerRow" height="30px" align="center">
|
<!--标题 -->
|
<td style="">选择</td>
|
<td style="">类型</td>
|
<td style="">客户名</td>
|
<td style="">联系人</td>
|
<td style="">电话</td>
|
<td style="">省</td>
|
<td style="">市</td>
|
<td style="">详细地址</td>
|
<td style="">
|
|
</td>
|
</tr>
|
</thead>
|
<tbody>
|
<apex:repeat value="{!tableData}" var="or" id="oppTable">
|
<tr>
|
<td align="center">
|
<input type="checkbox" name="vehicle" onclick="onCheckBoxJd(this,'{!or.address.id}');" value="{!or.address.id}" />
|
</td>
|
<td align="center">
|
<apex:outputText value="{!or.address.Address_Classification__c}" />
|
</td>
|
<td align="center">
|
<apex:outputText value="{!or.address.Customer__r.Name}" />
|
</td>
|
<td align="center">
|
<apex:outputText value="{!or.address.Contacts__r.Name}" />
|
</td>
|
<td align="center">
|
<apex:outputText value="{!or.address.Telephone__c}" />
|
</td>
|
<td align="center">
|
<apex:outputText value="{!or.address.Province__r.Name}" />
|
</td>
|
<td align="center">
|
<apex:outputText value="{!or.address.City__r.name}" />
|
</td>
|
<td align="center">
|
<apex:outputText value="{!or.address.Detailed_Address__c}" />
|
</td>
|
<td align="center" style="width:100px">
|
<apex:commandButton value=" 编辑 " onclick="onEditorJs('{!or.address.id}');return false;" style="background:#98c1fbf7"/>
|
<apex:commandButton value=" 复制 " onclick="onCopyJs('{!or.address.id}');return false;" style="background: #98c1fbf7;"/>
|
</td>
|
</tr>
|
</apex:repeat>
|
</tbody>
|
</table>
|
</apex:outputPanel>
|
</apex:pageblocksection>
|
</apex:pageBlock>
|
</div>
|
<div id="tab03">
|
<apex:pageBlock id="oppBlock2" tabStyle="Report">
|
<apex:pageblocksection title="编辑地址" id="UpdAddressId" rendered="true" columns="4">
|
<apex:inputfield value="{!insUpdData.Address_Classification__c}" required="false" id="Address_Classification__c" />
|
<apex:inputfield value="{!insUpdData.Customer__c}" id="Customer__r_Name" required="false"/>
|
<apex:inputfield value="{!insUpdData.Contacts__c}" id="Contacts__c" required="false"/>
|
<apex:inputfield value="{!insUpdData.Create_Contacts__c}" id="Create_Contacts__c" />
|
|
<apex:inputfield value="{!insUpdData.Province__c}" id="Province__r_Name" />
|
<apex:inputfield value="{!insUpdData.City__c}" id="City__r_name" />
|
<apex:inputfield value="{!insUpdData.Telephone__c}" id="Telephone__c" />
|
<apex:pageblockSectionItem />
|
<apex:inputfield value="{!insUpdData.Detailed_Address__c}" id="Detailed_Address__c" style="colspan:2"/>
|
</apex:pageblocksection>
|
<div style="text-align: center;">
|
<apex:commandButton value="保存" onclick="savaJs();return false;" rendered="true" />
|
</div>
|
</apex:pageBlock>
|
</div>
|
</apex:form>
|
<script type="javascript/text">
|
|
</script>
|
</apex:page>
|