<apex:page Controller="TydelikeACController" sidebar="false" action="{!init}" id="Page">
|
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.NewQuoteEntryJS)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
|
<script type="text/javascript">
|
function searchTy1(){
|
blockme();
|
searchTy();
|
}
|
function OfSkrap(linenum) {
|
var accName = j$(escapeVfId('Page:mainForm:lines:' + linenum + ':aCName')).value();
|
if(accName != ''){
|
if(confirm('客户已经选择,请问真的删除吗?')==true){
|
/*check();*/
|
blockme();
|
setOfSkrapBtn();
|
}
|
}else {
|
if(confirm('是否删除?')==true){
|
/*check();*/
|
blockme();
|
setOfSkrapBtn();
|
}
|
}
|
}
|
function OfSkrap1() {
|
var bon = 0;
|
var bom = 0;
|
var tysize = j$(escapeVfId('linesize')).value();
|
for (var i = 0; i < tysize; i++) {
|
if (j$(escapeVfId('Page:mainForm:lines:' + i + ':aCbon')).attr('checked') == 'checked' &&
|
j$(escapeVfId('Page:mainForm:lines:' + i + ':aCName')).value() != '') {
|
bon += 1;
|
}
|
if (j$(escapeVfId('Page:mainForm:lines:' + i + ':aCbon')).attr('checked') == 'checked'){
|
bom += 1;
|
}
|
}
|
if (bom == 0) {
|
alert('您没有选择需要批量删除的记录');
|
}else if (bon == 0) {
|
if(confirm('是否批量删除?')==true){
|
blockme();
|
setOfSkrapBtn();
|
for (var i = 0; i < tysize; i++) {
|
j$(escapeVfId('Page:mainForm:lines:' + i + ':aCbon')).attr("checked",false);
|
}
|
}else {
|
for (var i = 0; i < tysize; i++) {
|
j$(escapeVfId('Page:mainForm:lines:' + i + ':aCbon')).attr("checked",false);
|
}
|
}
|
}else {
|
if (bon == 1 && bom == 1) {
|
if(confirm('客户已经选择,请问真的批量删除吗?')==true){
|
blockme();
|
setOfSkrapBtn();
|
}else {
|
for (var i = 0; i < tysize; i++) {
|
j$(escapeVfId('Page:mainForm:lines:' + i + ':aCbon')).attr("checked",false);
|
}
|
}
|
}else {
|
alert('客户已经选择,且记录多于一条,不能批量删除');
|
for (var i = 0; i < tysize; i++) {
|
j$(escapeVfId('Page:mainForm:lines:' + i + ':aCbon')).attr("checked",false);
|
}
|
}
|
}
|
}
|
function gespoel() {
|
window.top.location.reload();
|
}
|
function setall(linenum) {
|
j$(escapeVfId('Page:mainForm:lines:' + linenum + ':aCbon')).attr("checked",true);
|
}
|
function setall1(linenum) {
|
j$(escapeVfId('Page:mainForm:lines:' + linenum + ':aCbon')).attr("checked",false);
|
}
|
function breakId(linenum) {
|
var baseUrl = '{!baseUrl}';
|
var accName = j$(escapeVfId('Page:mainForm:lines:' + linenum + ':aCName')).value();
|
var tycoId = j$(escapeVfId('Page:mainForm:lines:' + linenum + ':cooid')).value();
|
var tyacId = j$(escapeVfId('Page:mainForm:lines:' + linenum + ':acoid')).value();
|
if (tycoId == '') {
|
alert('没有可合并的联系人');
|
}else if (accName == '') {
|
alert('没有选择需要合并联系人的客户');
|
}else{
|
var url = baseUrl +'/apex/TydelikeCon?' +
|
'accName=' + encodeURIComponent(accName) +
|
'&tyacId=' + encodeURIComponent(tyacId) +
|
'&tycoId=' + encodeURIComponent(tycoId);
|
window.top.location.href = url;
|
}
|
|
}
|
function createId(linenum) {
|
var baseUrl = '{!baseUrl}';
|
var tycoId = j$(escapeVfId('Page:mainForm:lines:' + linenum + ':cooid')).value();
|
var tyacId = j$(escapeVfId('Page:mainForm:lines:' + linenum + ':acoid')).value();
|
if (tycoId == '') {
|
var url = baseUrl +'/apex/TydelikeAcc?' +
|
'tyacId=' + encodeURIComponent(tyacId);
|
window.top.location.href = url;
|
}else {
|
var url = baseUrl +'/apex/TydelikeAcc?' +
|
'tyacId=' + encodeURIComponent(tyacId) +
|
'&tycoId=' + encodeURIComponent(tycoId);
|
window.top.location.href = url;
|
}
|
|
}
|
|
</script>
|
|
<style type="text/css">
|
div#iframelike {
|
color: #fff;
|
height: 300px;
|
overflow: auto;
|
}
|
div#iframelikeheader {
|
color: #fff;
|
height: 23px;
|
overflow: auto;
|
}
|
.errorMessage{
|
font-size: 15px;
|
color:#FF0000;
|
}
|
input {
|
font-size: 10.5px;
|
}
|
body {
|
font-size: 10.5px;
|
}
|
|
hr {
|
height: 15px;
|
color: #fff;
|
margin: 0px;
|
padding: 0px;
|
border: 0px;
|
}
|
|
</style>
|
|
<apex:form id="mainForm">
|
<apex:actionFunction name="setOfSkrapBtn" action="{!setOfSkrapBtn}" onComplete="unblockUI();gespoel();" rerender="mainForm,message,allPanel"></apex:actionFunction>
|
<apex:actionFunction name="searchTy" action="{!searchTy}" onComplete="unblockUI();" rerender="mainForm,message,allPanel"></apex:actionFunction>
|
<div style="width: 100%">
|
<div class="errorMessage" style="margin-left: 39%">
|
<span id="errorMessage">{!errorMessage}</span>
|
</div>
|
</div>
|
<input type="hidden" id='linesize' value="{!datalineSize}"/>
|
<apex:outputPanel id="allPanel">
|
|
<table style="width:1280px;" border="0">
|
<tr>
|
<td style="text-align:right;width:35px;">联系人</td>
|
<td class="dataCell" style="text-align:center;width:150px;">
|
<apex:inputText id="tycontactname" style="width:90%;text-align:center;" value="{!tycontactname}"/>
|
</td>
|
|
<td style="text-align:right;width:40px;">客户名称</td>
|
<td class="dataCell" style="text-align:center;width:150px;">
|
<apex:inputText id="tycountname" style="width:90%;text-align:center;" value="{!tycountname}"/>
|
</td>
|
|
<td style="text-align:right;width:20px;">城市</td>
|
<td class="dataCell" style="text-align:center;width:60px;">
|
<apex:inputText id="tycountcity" style="width:85%;text-align:center;" value="{!tycountcity}"/>
|
</td>
|
|
<td class="dataCell" style="text-align:left;width:50px;">
|
<apex:commandButton onclick="searchTy1();return false;" value="检索" rerender="mainForm">
|
</apex:commandButton>
|
</td>
|
<td class="dataCell" style="text-align:center;width:560px;"></td>
|
|
<td class="dataCell" style="text-align:right;width:30px;">
|
<apex:commandButton onclick="OfSkrap1();return false;" value="批量删除" rerender="mainForm">
|
</apex:commandButton>
|
</td>
|
</tr>
|
</table>
|
|
<table style="width:1300px;" border="0">
|
<tr>
|
<th style="text-align:center;width:10px;"> 批量</th>
|
<th style="text-align:center;width:210px;">{!$ObjectType.TydelikeAccount__c.fields.Name.label}</th>
|
<th style="text-align:center;width:70px;">{!$ObjectType.TydelikeAccount__c.fields.TyCity__c.label}</th>
|
<th style="text-align:center;width:150px;">{!$ObjectType.TydelikeAccount__c.fields.TyAddress__c.label}</th>
|
<th style="text-align:center;width:75px;">{!$ObjectType.TydelikeAccount__c.fields.TyPostCode__c.label}</th>
|
<th style="text-align:center;width:80px;">{!$ObjectType.TydelikeContact__c.fields.Name.label}</th>
|
<th style="text-align:center;width:150px;">{!$ObjectType.TydelikeContact__c.fields.TyAddress__c.label}</th>
|
<th style="text-align:center;width:75px;">{!$ObjectType.TydelikeContact__c.fields.TyPostcode__c.label}</th>
|
<th style="text-align:center;width:120px;">{!$ObjectType.TydelikeContact__c.fields.TyPhoneD__c.label}</th>
|
<th style="text-align:center;width:190px;">{!$ObjectType.TydelikeAccount__c.fields.Account1__c.label}</th>
|
<th style="text-align:center;width:120px;">操 作</th>
|
</tr>
|
</table>
|
|
<div id="iframelike" style="width:1338px;">
|
<table class="list" style="border-bottom-width: 0px; font-size:11px; border-spacing:0; width:1200px; border-collapse: collapse; table-layout: fixed;" border="0">
|
<apex:repeat value="{!dataLines}" var="line" id="lines">
|
<apex:outputPanel layout="none" rendered="{!IF(line.tyacof == true || line.tycoof == true, false, true)}">
|
<tr>
|
<apex:inputHidden id="acoid" value="{!line.tyacId}"/>
|
<apex:inputHidden id="cooid" value="{!line.tycoId}"/>
|
<apex:inputHidden id="tynum" value="{!line.lineNum}"/>
|
<apex:inputHidden id="accfs" value="{!line.tyacof}"/>
|
<apex:inputHidden id="acofs" value="{!line.tycoof}"/>
|
<apex:inputHidden id="acFax" value="{!line.tycofax}"/>
|
<apex:inputHidden id="baseUrl" value="{!baseUrl}"/>
|
<td class="dataCell" style="text-align:center;width:30px;">
|
<apex:inputCheckbox id="aCbon" style="width:25px;text-align:center;" value="{!line.bondel}"/>
|
</td>
|
<td class="dataCell" style="text-align:center;width:200px;">
|
<apex:outputText id="tAName" style="width:90%;text-align:center;" value="{!line.tyacName}"/>
|
</td>
|
|
<td class="dataCell" style="text-align:center;width:75px;">
|
<apex:outputText id="tACity" style="width:90%;text-align:center;" value="{!line.tyaccity}"/>
|
</td>
|
|
<td class="dataCell" style="text-align:center;width:140px;">
|
<apex:outputText id="tAAddress" style="width:90%;text-align:center;" value="{!line.tyacadd}"/>
|
</td>
|
|
<td class="dataCell" style="text-align:center;width:70px;">
|
<apex:outputText id="tAPostCode" style="width:90%;text-align:center;" value="{!line.tyacpost}"/>
|
</td>
|
|
<td class="dataCell" style="text-align:center;width:80px;">
|
<apex:outputText id="tYName" style="width:90%;text-align:center;" value="{!line.tycoName}"/>
|
</td>
|
|
<td class="dataCell" style="text-align:center;width:145px;">
|
<apex:outputText id="tYAddress" style="width:90%;text-align:center;" value="{!line.tycoadd}"/>
|
</td>
|
|
<td class="dataCell" style="text-align:center;width:70px;">
|
<apex:outputText id="tYPostcode" style="width:90%;text-align:center;" value="{!line.tycopost}"/>
|
</td>
|
|
<td class="dataCell" style="text-align:center;width:110px;">
|
<apex:outputText id="tYPhoneD" style="width:90%;text-align:center;" value="{!line.tycophone}"/>
|
</td>
|
|
<td class="dataCell" style="text-align:center;width:190px;">
|
<apex:inputField id="aCName" style="width:160px;text-align:left;" value="{!tya.Account1__c}"/>
|
</td>
|
|
<td class="dataCell" style="text-align:center;width:28px;">
|
<apex:commandButton value="合并" onclick="breakId({!line.lineNum}); return false;">
|
</apex:commandButton>
|
</td>
|
|
<td class="dataCell" style="text-align:center;width:28px;">
|
<apex:commandButton value="创建" onclick="createId({!line.lineNum}); return false;">
|
</apex:commandButton>
|
</td>
|
|
<td class="dataCell" style="text-align:center;width:28px;">
|
<apex:commandButton onclick="setall({!line.lineNum}); OfSkrap({!line.lineNum}); setall1({!line.lineNum}); return false;" value="删除" rerender="mainForm">
|
</apex:commandButton>
|
</td>
|
|
</tr>
|
</apex:outputPanel>
|
</apex:repeat>
|
</table>
|
</div>
|
</apex:outputPanel>
|
</apex:form>
|
</apex:page>
|