<apex:page standardController="DiscountProductApplication__c" extensions="DiscountProductApplicationController" action="{!init}" showHeader="false" sidebar="true" id="dpaPage" title="特价产品申请信息">
|
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/>
|
<apex:includeScript value="/soap/ajax/29.0/connection.js"/>
|
<apex:includeScript value="/soap/ajax/29.0/apex.js"/>
|
<script>
|
function setFocusOnLoad() {}
|
function bodyOnLoad(){setFocusOnLoad();}
|
function searchAimsAccount1(){
|
// openPopup('/apex/searchAimsAccount?accId={!dpa.RawAccount__c }', 'setsearch', 800, 600, 'width=900,height=600,scrollbars=yes,toolbar=no,status=no,directories=no,menubar=no,resizable=1', true);
|
var flag = {!ispage};
|
if (flag == true) {
|
// var accid = j$(escapeVfId('dpaPage:dpaForm:dpaBlock:rawAccountId_lkid')).value();
|
var accid = j$(escapeVfId('dpaPage:dpaForm:dpaBlock:rawAccountId')).value();
|
openPopup('/apex/searchAimsAccount?accName='+accid, 'setsearch', 800, 600, 'width=900,height=600,scrollbars=yes,toolbar=no,status=no,directories=no,menubar=no,resizable=1', true);
|
}else{
|
openPopup('/apex/searchAimsAccount?accId={!dpa.RawAccount__c }', 'setsearch', 800, 600, 'width=900,height=600,scrollbars=yes,toolbar=no,status=no,directories=no,menubar=no,resizable=1', true);
|
}
|
|
}
|
|
function checkAll() {
|
blockme();
|
selectedSize = 0;
|
var productCount = j$(escapeVfId('dpaPage:dpaForm:ConsumableorderdetailsSection:unCheckedDpadCount')).value();
|
if (j$(escapeVfId('checker')).attr('checked') == 'checked') {
|
for (var i = 0; i < productCount; i++) {
|
j$(escapeVfId('dpaPage:dpaForm:ConsumableorderdetailsSection:Product2List:' + i + ':variableinfo' + ':Product2Check')).attr('checked',true);
|
selectedSize ++;
|
//alert(selectedSize);
|
}
|
} else {
|
//var outer = 0;
|
for (var i = 0; i < productCount; i++) {
|
//outer = Math.floor(i / 1000);
|
j$(escapeVfId('dpaPage:dpaForm:ConsumableorderdetailsSection:Product2List:' + i + ':variableinfo' + ':Product2Check')).attr('checked',false);
|
//selectedSize --;
|
}
|
}
|
}
|
|
// function pdValue(j){
|
// var z;
|
// var a = j.id;
|
// var i=a.substring(0,a.lastIndexOf(':'));
|
// z = parseFloat(j$(escapeVfId(i+':ProductDiscount')).value());
|
// if(isNaN(z)){z=0.00;}
|
// var y = parseFloat(j$(escapeVfId(i+':ProductDiscountmoney')).value());
|
|
// if(y == null || (y != z && z!=null&&z!=0&&z!='')){
|
// j$(escapeVfId(i+':variableinfo:Product2Check')).attr('checked',true);
|
// }else{
|
// j$(escapeVfId(i+':variableinfo:Product2Check')).attr('checked',false);
|
// }
|
// }
|
function pdValue(j){
|
var a = j.id;
|
var i=a.substring(0,a.lastIndexOf(':'));
|
var strz = j$(escapeVfId(i+':ProductDiscount')).value();
|
strz = strz.replace(',','');
|
var z = parseFloat(strz+"");
|
console.log('z:'+z);
|
console.log('strz:'+strz);
|
|
var strOldValue = j$(escapeVfId(i+':ProductDiscountmoney')).value();
|
|
var oldValue = parseFloat(strOldValue);
|
console.log('oldValue:'+oldValue);
|
if (isNaN(z) && isNaN(oldValue)) {
|
j$(escapeVfId(i+':variableinfo:Product2Check')).attr('checked',false);
|
|
}else{
|
if (z != oldValue) {
|
console.log('12');
|
j$(escapeVfId(i+':variableinfo:Product2Check')).attr('checked',true);
|
}else if (z == oldValue) {
|
j$(escapeVfId(i+':variableinfo:Product2Check')).attr('checked',false);
|
}
|
}
|
|
|
|
|
}
|
function SearchJs(){
|
|
}
|
|
//add by rentx 2021-2-20
|
function searchAccount() {
|
// body...
|
openPopup('/apex/searchAccount', 'setsearch', 800, 600, 'width=900,height=600,scrollbars=yes,toolbar=no,status=no,directories=no,menubar=no,resizable=1', true);
|
}
|
|
function searchFn() {
|
blockme();
|
search();
|
j$(escapeVfId("dpaPage:dpaForm:dpaBlock:tempid")).val('tempId');
|
// j$(escapeVfId('dpaPage:dpaForm:dpaBlock:tempid')).value() = 'tempid';
|
|
}
|
|
//add by rentx 2021-2-20
|
</script>
|
|
<apex:form id="dpaForm" >
|
<apex:actionFunction name="search" action="{!searchAllProduct2}" oncomplete="unblockUI();" reRender="ConsumableorderdetailsSection,message" />
|
<apex:pageBlock title="特价产品申请信息" id="dpaBlock" >
|
<apex:pageBlockButtons location="top" >
|
<apex:commandButton value="保存" disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" onclick="blockme();" style="margin-left:30px;width:100px" action="{!savesaveDiscountProduct}" onComplete="unblockUI();CheckStatusAfter();" reRender="ConsumableorderdetailsSection,message"/>
|
</apex:pageBlockButtons>
|
<table style="width: 900px;margin: auto;">
|
<tr>
|
<td align="right" >经销商:</td>
|
<td align="left">
|
<!-- //update by rentx 2021-2-22 start -->
|
<apex:outputField rendered="{!!isPage}" value="{!dpa.RawAccount__c}" style="width:300px"/>
|
<apex:inputField id="rawAccountId" rendered="{!isPage}" required="true" value="{!dpa.RawAccount__c}" />
|
<!-- //update by rentx 2021-2-22 end -->
|
</td>
|
|
<td/>
|
<td align="right">医院:
|
</td>
|
<td width="100px"><apex:inputText id="AimsAccount" disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" style="width:150px" value="{!AimsAccount}" onclick="searchAimsAccount1()"
|
onfocus="if (j$(escapeVfId('dpaPage:dpaForm:dpaBlock:tempid')).value() != 'tempId' && j$(escapeVfId('dpaPage:dpaForm:dpaBlock:tempid')).value() != '') {searchFn()}" />
|
</td>
|
<td style="display:none"><apex:inputText style="display:none" id="AimsAccountId" value="{!AimsAccountId}"/></td>
|
<td style="display:none"><apex:inputText style="display:none" value="{!dpa.ApplicationStatus__c }"/></td>
|
<apex:inputHidden id="tempid" value="{!tempVal}"/>
|
|
<td>
|
<!-- <apex:commandButton value="保存" disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" onclick="blockme();" style="margin-left:30px;width:180px" action="{!savesaveDiscountProduct}" onComplete="unblockUI();CheckStatusAfter();" reRender="ConsumableorderdetailsSection,message"/> -->
|
<!-- <apex:commandButton value="保存" disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" onclick="blockme();saveAimsAccountId();" style="margin-left:30px;width:180px" action="{!savesaveDiscountProduct}" onComplete="unblockUI();CheckStatusAfter();" reRender="ConsumableorderdetailsSection,message"/> -->
|
</td>
|
<!-- <td/> -->
|
</tr>
|
<tr style="height: 10px" />
|
<tr>
|
<td align="right" >产品名称:</td>
|
<td align="left"><apex:inputText disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" value="{!text1}" style="width:300"/>
|
</td>
|
<td/>
|
<td align="right" >产品编码:</td>
|
<td align="left"><apex:inputText disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" value="{!text2}" style="width:150px"/>
|
</td>
|
|
<td><apex:commandButton value="检索" disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" onclick="blockme();" style="margin-left:30px;width:100px" action="{!searchAllProduct2}" oncomplete="unblockUI();" reRender="ConsumableorderdetailsSection,message"/>
|
</td>
|
</tr>
|
</table>
|
</apex:pageBlock>
|
|
<apex:outputPanel id="message" >
|
<apex:pageMessages />
|
</apex:outputPanel>
|
<apex:pageBlock title="特价产品明细" id="ConsumableorderdetailsSection">
|
<input type="hidden" id="dpaPage:dpaForm:ConsumableorderdetailsSection:unCheckedDpadCount" value="{!unCheckedDpadCount}" />
|
|
<table class="list" border="0" cellpadding="0" cellspacing="0">
|
<colgroup>
|
<col width="4%" />
|
<col width="34%" />
|
<col width="9%" />
|
<col width="9%" />
|
<col width="9%" />
|
<col width="9%" />
|
<col width="9%" />
|
<col width="9%" />
|
<col width="8%" />
|
</colgroup>
|
<tr class="headerRow">
|
|
<apex:variable var="" value="" >
|
<th type='checkbox' onClick='checkAll()'>
|
<input disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" type='checkbox' onClick='checkAll()' id='checker'/>选择</th>
|
</apex:variable>
|
|
<!-- update by rentx 2021-01-17 -->
|
<!-- <th>产品检索用</th> -->
|
<th>产品名称</th>
|
<!-- update by rentx 2021-01-17 -->
|
|
<th>产品编码</th>
|
<th>NMPA状态</th>
|
<!-- <th>内贸定价(RMB)</th>
|
<th>外贸定价(USD)</th> -->
|
<th>第2分类</th>
|
<th>第3分类</th>
|
<th>第4分类</th>
|
<th>第5分类</th>
|
<th>产品特价</th>
|
</tr>
|
<apex:repeat value="{!DiscountProductApplicationDetailList}" var="dpad" id="Product2List">
|
<tr class="dataRow">
|
<apex:variable var="v" value="" id="variableinfo">
|
<td>
|
<apex:inputCheckbox value="{!dpad.check}" disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" onclick="CheckSize(this);" id="Product2Check"/>
|
<apex:inputHidden value="{!dpad.dp.id}"/>
|
</td>
|
</apex:variable>
|
<td class="dataCell" style="display:none">{!dpad.pr2.id}</td>
|
<td class="dataCell">{!dpad.pr2.Name__c}</td>
|
<td class="dataCell">{!dpad.pr2.OT_CODE_Text__c}</td>
|
<td class="dataCell">{!dpad.pr2.SFDA_Status__c}</td>
|
<!-- <td class="dataCell">{!dpad.pr2.Intra_Trade_List_RMB__c}</td>
|
<td class="dataCell">{!dpad.pr2.Foreign_Trade_List_US__c}</td> -->
|
<td class="dataCell">{!dpad.pr2.Category2__c}</td>
|
<td class="dataCell">{!dpad.pr2.Category3__c}</td>
|
<td class="dataCell">{!dpad.pr2.Category4__c}</td>
|
<td class="dataCell">{!dpad.pr2.Category5__c}</td>
|
<td class="dataCell">
|
<apex:inputField rendered="{!IF(dpa.ApplicationStatus__c='草案中' || dpa.ApplicationStatus__c='',true,false)}" onblur="pdValue(this)" id="ProductDiscount" value="{!dpad.dp.ProductDiscount__c}" style="width: 100px;"/>
|
<apex:outputField rendered="{!IF(dpa.ApplicationStatus__c !='草案中' && dpa.ApplicationStatus__c !='',true,false)}" value="{!dpad.dp.ProductDiscount__c}" />
|
<apex:inputHidden id="ProductDiscountmoney" value="{!dpad.dismoney}"/>
|
</td>
|
</tr>
|
</apex:repeat>
|
</table>
|
</apex:pageBlock>
|
</apex:form>
|
</apex:page>
|