<apex:page Controller="AgencyCampaignController" 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 refreshPageSizeJs() {
|
refreshPageSize();
|
}
|
//function makecontactJs() {
|
// makecontact();
|
//}
|
//function deleteJs(line) {
|
//blockme();
|
// deleteLine(line);
|
//}
|
function checkAll() {
|
var productCount = j$(escapeVfId('allPage:allForm:productInfoSection:productRecoedsCount')).value();
|
if (j$(escapeVfId('checker')).attr('checked') == 'checked') {
|
//console.log(productCount);
|
for (var i = 0; i < productCount; i++) {
|
j$(escapeVfId('allPage:allForm:productInfoSection:productInfoListview:' + i + ':consumablesCountproRowCheckbox')).attr('checked',true);
|
}
|
} else {
|
for (var i = 0; i < productCount; i++) {
|
j$(escapeVfId('allPage:allForm:productInfoSection:productInfoListview:' + i + ':consumablesCountproRowCheckbox')).attr('checked',false);
|
}
|
}
|
}
|
|
function contactCheckAll() {
|
var productCount = j$(escapeVfId('lineInfoListSize')).value();
|
if (j$(escapeVfId('contactChecker')).attr('checked') == 'checked') {
|
//console.log(productCount);
|
for (var i = 0; i < productCount; i++) {
|
j$(escapeVfId('allPage:allForm:contactInfoSection:BlockTablefill:' + i + ':contactRowCheckbox')).attr('checked',true);
|
}
|
} else {
|
for (var i = 0; i < productCount; i++) {
|
j$(escapeVfId('allPage:allForm:contactInfoSection:BlockTablefill:' + i + ':contactRowCheckbox')).attr('checked',false);
|
}
|
}
|
}
|
|
function fillJs() {
|
var cnt = {!productRecoedsCount};
|
var value_one = j$(escapeVfId('allPage:allForm:productInfoSection:BlockTablefill:0:Special_Campaign_Price')).value();
|
var value_ogl = j$(escapeVfId('allPage:allForm:productInfoSection:BlockTablefill:0:OrderGoods_Limit')).value();
|
var value_sec = j$(escapeVfId('allPage:allForm:productInfoSection:BlockTablefill:0:Campaign_StartDate')).value();
|
var value_the = j$(escapeVfId('allPage:allForm:productInfoSection:BlockTablefill:0:Campaign_EndDate')).value();
|
for (var i = 0; i < cnt; i++) {
|
if(j$(escapeVfId('allPage:allForm:productInfoSection:productInfoListview:' + i + ':consumablesCountproRowCheckbox')).attr('checked') == 'checked'){
|
document.getElementById('allPage:allForm:productInfoSection:productInfoListview:' + i + ':inputSCP').value = value_one;
|
document.getElementById('allPage:allForm:productInfoSection:productInfoListview:' + i + ':inputOGL').value = value_ogl;
|
document.getElementById('allPage:allForm:productInfoSection:productInfoListview:' + i + ':inputCSC').value = value_sec;
|
document.getElementById('allPage:allForm:productInfoSection:productInfoListview:' + i + ':inputCEC').value = value_the;
|
|
}//else{
|
// document.getElementById('allPage:allForm:productInfoSection:productInfoListview:' + i + ':inputSCP').value = '';
|
// document.getElementById('allPage:allForm:productInfoSection:productInfoListview:' + i + ':inputCSC').value = '';
|
// document.getElementById('allPage:allForm:productInfoSection:productInfoListview:' + i + ':inputCEC').value = '';
|
//}
|
}
|
}
|
|
function ComputePrice(j) {
|
var z
|
var a = j.id;
|
var i=a.substring(0,a.lastIndexOf(':'));
|
z = parseFloat(j$(escapeVfId(i+':inputSCP')).value());
|
if(isNaN(z)){z=0.00;}
|
if(z!=null&&z!=0&&z!=''){
|
j$(escapeVfId(i+':consumablesCountproRowCheckbox')).attr('checked',true);
|
}else{
|
j$(escapeVfId(i+':consumablesCountproRowCheckbox')).attr('checked',false);
|
}
|
}
|
|
|
function saveJs() {
|
blockme();
|
//beforeSaveJs();
|
save();
|
}
|
|
function searchHospitalJs() {
|
blockme();
|
searchHospital();
|
}
|
|
//function showParentManagementCodeJs(){
|
// showParentManagementCode();
|
//}
|
|
function showcategory2Js() {
|
showcategory2();
|
}
|
|
function showcategory3Js() {
|
showcategory3();
|
}
|
function showcategory4Js() {
|
showcategory4();
|
}
|
function showcategory5Js() {
|
showcategory5();
|
}
|
|
</script>
|
<style>
|
.dateFormat {
|
display: none;
|
}
|
</style>
|
<apex:form id="allForm">
|
<!--<apex:actionFunction name="deleteLine" action="{!deleteLine}" rerender="contactInfoSection, message">
|
<apex:param name="firstParam" assignTo="{!lineNo}" value="" />
|
</apex:actionFunction>
|
<apex:actionFunction name="showParentManagementCode" action="{!showParentManagementCode}" rerender="searchBlock" />
|
<apex:actionFunction name="makecontact" action="{!makecontact}" rerender="contactInfoSection, message" />-->
|
<apex:actionFunction name="refreshPageSize" action="{!refreshPageSize}" status="fetchStatus" reRender="productInfoSection" />
|
<apex:actionFunction name="save" action="{!save}" rerender="message" onComplete="unblockUI();">
|
</apex:actionFunction>
|
<apex:actionFunction name="showcategory2" action="{!showcategory2}" rerender="searchBlock, message">
|
</apex:actionFunction>
|
<apex:actionFunction name="showcategory3" action="{!showcategory3}" rerender="searchBlock, message">
|
</apex:actionFunction>
|
<apex:actionFunction name="showcategory4" action="{!showcategory4}" rerender="searchBlock, message">
|
</apex:actionFunction>
|
<apex:actionFunction name="showcategory5" action="{!showcategory5}" rerender="searchBlock, message">
|
</apex:actionFunction>
|
<apex:actionFunction name="searchHospital" action="{!searchHospital}" rerender="productInfoSection, message" onComplete="unblockUI();">
|
</apex:actionFunction>
|
<apex:outputPanel id="allPanel">
|
<apex:outputPanel id="message">
|
<apex:pageMessages />
|
</apex:outputPanel>
|
<apex:pageBlock id="searchBlock">
|
<table>
|
<colgroup>
|
<col width="50px"/>
|
<col width="100px"/>
|
<col width="60px"/>
|
<col width="20px"/>
|
<col width="100px"/>
|
<col width="60px"/>
|
<col width="20px"/>
|
<col width="100px"/>
|
<col width="60px"/>
|
<col width="20px"/>
|
<col width="100px"/>
|
<col width="60px"/>
|
<col width="20px"/>
|
<col width="100px"/>
|
<col width="60px"/>
|
<col width="20px"/>
|
<col width="80px"/>
|
</colgroup>
|
<tr>
|
<td align="right"></td>
|
<td align="right">促销编码:</td>
|
<td style="text-align:left; width:70px;" colspan = "2">
|
<apex:outputField value="{!consumable_P.Name}"/>
|
</td>
|
<!--<td align="right">经销商名称:</td>
|
<td style="text-align:left; width:70px;" colspan = "3">
|
<apex:inputField value="{!dpc.Agent_Ref__c}" onchange="showParentManagementCodeJs();return false;"/>
|
</td>
|
<td align="right" colspan = "3">经销商合同名称:</td>
|
<td style="text-align:left; width:70px;" colspan = "4">
|
<apex:selectList value="{!accContact}" size="1" style="width:150px" ><apex:selectOptions value="{!accContactList}"/></apex:selectList>
|
</td>
|
<td align="right"><apex:commandButton value="追加" style="width: 100px;" onclick="makecontactJs();return false;" /></td>-->
|
</tr>
|
<tr>
|
<td colspan = "16" style="height: 10px"></td>
|
</tr>
|
<tr>
|
<td align="right"></td>
|
<td align="right">第1分类:</td>
|
<td style="text-align:left; width:70px;">
|
<apex:selectList id="StateMaster" value="{!category1}" size="1" style="width:90px" onchange="showcategory2Js();return false;">
|
<apex:selectOptions value="{!category1OptionList}"/>
|
</apex:selectList>
|
</td>
|
<td/>
|
<td align="right">第2分类:</td>
|
<td style="text-align:left; width:70px;"><apex:selectList value="{!category2}" size="1" style="width:90px" onchange="showcategory3Js();return false;"><apex:selectOptions value="{!category2OptionList}"/></apex:selectList>
|
</td>
|
<td/>
|
<td align="right">第3分类:</td>
|
<td style="text-align:left; width:70px;"><apex:selectList value="{!category3}" size="1" style="width:90px" onchange="showcategory4Js();return false;"><apex:selectOptions value="{!category3OptionList}"/></apex:selectList>
|
</td>
|
<td/>
|
<td align="right">第4分类:</td>
|
<td style="text-align:left; width:70px;"><apex:selectList value="{!category4}" size="1" style="width:90px" onchange="showcategory5Js();return false;" ><apex:selectOptions value="{!category4OptionList}"/></apex:selectList>
|
</td>
|
<td/>
|
<td align="right">第5分类:</td>
|
<td style="text-align:left; width:70px;"><apex:selectList value="{!category5}" size="1" style="width:90px"><apex:selectOptions value="{!category5OptionList}"/></apex:selectList>
|
</td>
|
<td align="right" rowspan = "3"><apex:commandButton value="检索" style="width: 100px;" onclick="searchHospitalJs();return false;" /></td>
|
</tr>
|
<tr>
|
<td colspan = "15" style="height: 10px"></td>
|
</tr>
|
<tr>
|
<td align="right"></td>
|
<td align="right">关键字:</td>
|
<td style="text-align:left; width:70px;" colspan = "3">
|
<apex:inputText value="{!keyword}"/>
|
<c:helpicon helpText="可以使用关键字检索产品型号和产品名称。"/>
|
</td>
|
<td align="right" >特约店产品</td>
|
<td align="left"><apex:inputCheckbox value="{!Pro2DealerFlag}" id="Pro2DealerFlag" style="width:20px"/>
|
</td>
|
</tr>
|
</table>
|
</apex:pageBlock>
|
|
<!--<apex:pageBlock title="合同信息" id="contactInfoSection">
|
<apex:pageBlockTable value="{!lineInfoList}" var="a" id="BlockTablefill">
|
<apex:column headerValue="经销商名称" >
|
<apex:outputField value="{!a.accountIn.Agent_Ref__c}" style="width: 80px;" id="Agent_Ref"/>
|
</apex:column>
|
<apex:column headerValue="经销商合同名称" >
|
<apex:outputField value="{!a.accountIn.Name}" style="width: 80px;" id="contactName"/>
|
</apex:column>
|
<apex:column headerValue="操作" >
|
<apex:commandButton onclick="deleteJs({!a.line});return false;" value="删除" style="margin-left:30px;width:100px" rerender="dummy"/>
|
</apex:column>
|
</apex:pageBlockTable>
|
</apex:pageBlock>-->
|
|
|
<apex:pageBlock title="合同信息" id="contactInfoSection">
|
<!--<apex:inputHidden id="contactInfoCount" value="{!lineInfoListSize}"/>-->
|
<input type="hidden" id="lineInfoListSize" value="{!lineInfoListSize}" />
|
<table class="list" border="0" cellpadding="0" cellspacing="0" style="width: 100%">
|
<colgroup>
|
<col width="10%" />
|
<col width="40%" />
|
<col width="40%" />
|
</colgroup>
|
<tr class="headerRow">
|
<th><input type='checkbox' onClick='contactCheckAll()' id='contactChecker'/>选择</th>
|
<th>经销商名称</th>
|
<th>经销商合同名称</th>
|
</tr>
|
<apex:repeat value="{!lineInfoList}" var="records" id="BlockTablefill">
|
<tr class="dataRow">
|
<td>
|
<apex:inputCheckbox value="{!records.check}" id="contactRowCheckbox"/>
|
</td>
|
<td class="dataCell">
|
<apex:outputField value="{!records.accountIn.Agent_Ref__c}"/>
|
</td>
|
<td class="dataCell">
|
<apex:outputField value="{!records.accountIn.Name}"/>
|
</td>
|
</tr>
|
</apex:repeat>
|
</table>
|
</apex:pageBlock>
|
|
|
|
|
|
|
|
<apex:pageBlock title="产品信息" id="productInfoSection">
|
<apex:pageBlockButtons location="top" >
|
<apex:commandButton onclick="saveJs();" value="保存" style="margin-left:30px;width:100px" rerender="dummy" />
|
</apex:pageBlockButtons>
|
<apex:outputPanel style="float:right;" >
|
<apex:pageBlockTable value="{!dpc}" var="a" id="BlockTablefill">
|
<apex:column headerValue="促销价格" >
|
<apex:inputField value="{!a.Special_Campaign_Price__c}" style="width: 80px;" id="Special_Campaign_Price"/>
|
</apex:column>
|
<apex:column headerValue="促销数量" >
|
<apex:inputField value="{!a.OrderGoods_Limit__c}" style="width: 80px;" id="OrderGoods_Limit"/>
|
</apex:column>
|
<apex:column headerValue="促销开始日">
|
<apex:inputField value="{!a.Campaign_StartDate__c}" style="width: 80px;" id="Campaign_StartDate"/>
|
</apex:column>
|
<apex:column headerValue="促销结束日">
|
<apex:inputField value="{!a.Campaign_EndDate__c}" style="width: 80px;" id="Campaign_EndDate"/>
|
</apex:column>
|
<apex:column >
|
<apex:commandButton onclick="fillJs();" value="批量应用" style="margin-left:30px;width:100px" rerender="dummy" />
|
</apex:column>
|
</apex:pageBlockTable>
|
</apex:outputPanel>
|
|
<apex:inputHidden id="productRecoedsCount" value="{!productRecoedsCount}"/>
|
<table class="list" border="0" cellpadding="0" cellspacing="0" style="width: 100%">
|
<colgroup>
|
<col width="6%" />
|
<col width="30%" />
|
<col width="8%" />
|
<col width="8%" />
|
<col width="8%" />
|
<col width="8%" />
|
<col width="8%" />
|
<col width="8%" />
|
<col width="8%" />
|
<col width="8%" />
|
</colgroup>
|
<tr class="headerRow">
|
<th><input type='checkbox' onClick='checkAll()' id='checker'/>选择</th>
|
<th>产品名称</th>
|
<th>第1分类</th>
|
<th>第2分类</th>
|
<th>第3分类</th>
|
<th>第4分类</th>
|
<th>第5分类</th>
|
<th>促销价格</th>
|
<th>促销数量</th>
|
<th>促销开始日</th>
|
<th>促销结束日</th>
|
|
</tr>
|
<apex:repeat value="{!productInfoListview}" var="records" id="productInfoListview">
|
<tr class="dataRow">
|
<td>
|
<apex:inputCheckbox value="{!records.check}" id="consumablesCountproRowCheckbox"/>
|
</td>
|
<td class="dataCell">
|
<apex:outputField value="{!records.pro.Name__c}"/>
|
</td>
|
<td class="dataCell">
|
<apex:outputField value="{!records.pro.Category1__c}"/>
|
</td>
|
<td class="dataCell">
|
<apex:outputField value="{!records.pro.Category2__c}"/>
|
</td>
|
<td class="dataCell">
|
<apex:outputField value="{!records.pro.Category3__c}"/>
|
</td>
|
<td class="dataCell">
|
<apex:outputField value="{!records.pro.Category4__c}"/>
|
</td>
|
<td class="dataCell">
|
<apex:outputField value="{!records.pro.Category5__c}"/>
|
</td>
|
<td class="dataCell">
|
<apex:inputField onblur="ComputePrice(this)" value="{!records.dealerPro.Special_Campaign_Price__c}" style="width: 80px;" id="inputSCP"/>
|
</td>
|
<td class="dataCell">
|
<apex:inputField value="{!records.dealerPro.OrderGoods_Limit__c}" style="width: 80px;" id="inputOGL"/>
|
</td>
|
<td class="dataCell">
|
<apex:inputField value="{!records.dealerPro.Campaign_StartDate__c}" style="width: 80px;" id="inputCSC"/>
|
</td>
|
<td class="dataCell">
|
<apex:inputField value="{!records.dealerPro.Campaign_EndDate__c}" style="width: 80px;" id="inputCEC"/>
|
</td>
|
</tr>
|
</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>
|