<apex:page id="Page" Controller="SearchProductController" sidebar="false" showHeader="false" 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.connection20)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
|
|
<script>
|
var QuoteEntryMaxLine = 150;
|
|
function setProductList() {
|
var nextLine = top.window.opener.getLastLineNoNext(window.opener.document);
|
var hasCheckedCnt = 0;
|
var checklist = j$("input[name='checklist']");
|
|
// var is_hidden_all = j$(escapeVfId("isHiddenAllsearch")).val();
|
//alert('is_hidden_all=====>'+ is_hidden_all);
|
|
for(var i=0; i<checklist.length; i++){
|
if (checklist[i].checked) {
|
hasCheckedCnt++;
|
if (nextLine < QuoteEntryMaxLine) {
|
SetProductId(nextLine, i);
|
nextLine++;
|
} else {
|
//alert('Over Max Line ' + QuoteEntryMaxLine);
|
return false;
|
}
|
}
|
}
|
if (hasCheckedCnt == 0) {
|
alert(top.window.opener.Error_Message34);
|
return false;
|
}
|
window.opener.doReroad();
|
top.window.close();
|
}
|
|
function setProductOne(lineno, i) {
|
SetProductId(lineno, i);
|
window.opener.doReroad();
|
top.window.close();
|
}
|
|
function doSearch() {
|
blockme();
|
serContact.call();
|
}
|
|
function SetProductId(lineno, i) {
|
|
var ProductCode = j$(escapeVfId("Page:mainForm:idSearchSetProduct:idRezultVisitor:"+ i +":ProductCode")).text();
|
if (ProductCode.indexOf('0000000000') == 0) {
|
ProductCode = ProductCode.substring(10);
|
}
|
var ProductECCode = j$(escapeVfId("Page:mainForm:idSearchSetProduct:idRezultVisitor:"+ i +":ProductECCode")).text();
|
var name = j$(escapeVfId("Page:mainForm:idSearchSetProduct:idRezultVisitor:"+ i +":Name")).text();
|
|
var PbeId = j$(escapeVfId("Page:mainForm:idSearchSetProduct:idRezultVisitor:"+ i +":hidId")).text();
|
var pId = j$(escapeVfId("Page:mainForm:idSearchSetProduct:idRezultVisitor:"+ i +":pId")).text();
|
//XHL-20190428-UpdateStart
|
// var productSet = j$(escapeVfId("Page:mainForm:idSearchSetProduct:productSet")).val();
|
// var productSetLabel = j$(escapeVfId("Page:mainForm:idSearchSetProduct:productSet") + ' option:selected').text();
|
//XHL-20190428-UpdateEnd
|
var salesprice = j$(escapeVfId("Page:mainForm:idSearchSetProduct:idRezultVisitor:"+ i +":Salesprice")).text();
|
var salespriceA = j$(escapeVfId("Page:mainForm:idSearchSetProduct:idRezultVisitor:"+ i +":SalespriceA")).text();
|
var salespriceB = j$(escapeVfId("Page:mainForm:idSearchSetProduct:idRezultVisitor:"+ i +":SalespriceB")).text();
|
var salespriceC = j$(escapeVfId("Page:mainForm:idSearchSetProduct:idRezultVisitor:"+ i +":SalespriceC")).text();
|
var pm = j$(escapeVfId("Page:mainForm:idSearchSetProduct:idRezultVisitor:"+ i +":ProductModel")).text();
|
var productDescription = j$(escapeVfId("Page:mainForm:idSearchSetProduct:idRezultVisitor:"+ i +":ProductDescription")).text();
|
var salespriceR = j$(escapeVfId("Page:mainForm:idSearchSetProduct:idRezultVisitor:"+ i +":SalespriceR")).text();
|
var hiddenflg = j$(escapeVfId("Page:mainForm:idSearchSetProduct:idRezultVisitor:"+ i +":Hiddenflg")).text();
|
var is_hidden_all = j$(escapeVfId("isHiddenAllsearch")).val();
|
var specialDealer = j$(escapeVfId("specialDealer")).val();
|
//alert('Salesprice=====>'+ salesprice);
|
var openFlag = j$(escapeVfId("openFlag")).val();
|
if (openFlag == 'opp') {
|
window.opener.j$(escapeVfId("allPage:allForm:allBlock:records:" + (lineno - 1) + ":product")).val(name);
|
window.opener.j$(escapeVfId("allPage:allForm:allBlock:records:" + (lineno - 1) + ":productId")).val(pId);
|
window.opener.j$(escapeVfId("allPage:allForm:allBlock:records:" + (lineno - 1) + ":isProductModel")).val(pm);
|
window.opener.j$(escapeVfId("allPage:allForm:allBlock:records:"+ (lineno - 1) +":price0")).val(salesprice);
|
window.opener.j$(escapeVfId("allPage:allForm:allBlock:records:"+ (lineno - 1) +":unitPrice")).val(salespriceR);
|
window.opener.j$(escapeVfId("allPage:allForm:allBlock:records:"+ (lineno - 1) +":hiddenflg")).val(hiddenflg);
|
window.opener.j$(escapeVfId("allPage:allForm:allBlock:records:"+ (lineno - 1) +":description")).val(productDescription);
|
window.opener.j$(escapeVfId("allPage:allForm:allBlock:records:"+ (lineno - 1) +":productCode")).text(ProductCode);
|
window.opener.j$(escapeVfId("allPage:allForm:allBlock:records:"+ (lineno - 1) +":productCodeHidden")).val(ProductCode);
|
window.opener.j$(escapeVfId("allPage:allForm:allBlock:records:"+ (lineno - 1) +":productEC")).text(ProductECCode);
|
window.opener.j$(escapeVfId("allPage:allForm:allBlock:records:"+ (lineno - 1) +":productECHidden")).val(ProductECCode);
|
if (specialDealer == 'true') {
|
window.opener.j$(escapeVfId("isHiddenAll")).val(is_hidden_all);
|
}
|
|
|
} else {
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":indexNo")).text(parseInt(lineno)+1);
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":ProductName")).val(name);
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":ProductCode")).text(ProductCode);
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":ProductCodeHidden")).val(ProductCode);
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":ProductEC")).text(ProductECCode);
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":ProductECHidden")).val(ProductECCode);
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":PbeId")).val(PbeId);
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":ProId")).val(pId);
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":UnitPrice")).val(salespriceR);
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":hiddenflg")).val(hiddenflg);
|
//window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":UnitPriceHidden")).val(salesprice);
|
//XHL-20190428-UpdateStart
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":Set")).text('{!$Label.SingleProduct}');
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":SetName")).val('{!$Label.SingleProduct}');
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":SingleProduct")).val('true');
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":hidSet")).val('{!$Label.SingleProduct}');
|
//XHL-20190428-UpdateEnd
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":price0")).val(salesprice);
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":price1")).val(salespriceA);
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":price2")).val(salespriceB);
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":price3")).val(salespriceC);
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":Distingush")).val(null);
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":isProductModel")).val(pm);
|
window.opener.j$(escapeVfId("Page:mainForm:block:lists:"+ lineno +":Description")).val(productDescription);
|
|
if (specialDealer == 'true') {
|
window.opener.j$(escapeVfId("isHiddenAll")).val(is_hidden_all);
|
}
|
}
|
|
}
|
|
</script>
|
|
<style type="text/css">
|
div#iframelike {
|
color: #fff;
|
height: 300px;
|
overflow-y: auto;
|
overflow-x: hidden;
|
}
|
</style>
|
<apex:outputPanel id="all">
|
<apex:outputPanel id="message1">
|
<apex:messages styleClass="editListError"/>
|
</apex:outputPanel>
|
<apex:form id="mainForm">
|
|
<apex:actionFunction action="{!serContact}" name="serContact" reRender="mainForm,message1" oncomplete="unblockUI();"/>
|
|
<input type="hidden" id="openFlag" value="{!openFlag}"/>
|
<input type="hidden" value="{!is_hidden_all}" id="isHiddenAllsearch"/>
|
<input type="hidden" value="{!specialDealer}" id="specialDealer"/>
|
<apex:pageBlock id="idSearchSetProduct" title="{!$Label.Product_Search}">
|
<table width="900" border="0" style="background-color:#DCDCDC">
|
<colgroup>
|
<col width="12" />
|
<col width="20" />
|
<col width="20" />
|
<col width="200" />
|
<col width="20" />
|
<col width="100" />
|
<col width="120" />
|
<col width="208" />
|
</colgroup>
|
<tr>
|
<td> </td>
|
<th>{!$Label.Search_Condition}</th>
|
<td> </td>
|
<th>{!$Label.Asset_No}</th>
|
<td> </td>
|
<td> </td>
|
<td> </td>
|
<td> </td>
|
</tr>
|
<tr>
|
<td> </td>
|
<td> </td>
|
<td> </td>
|
<td><apex:inputText id="searchName" value="{!SearchName}" style="width:200px" required="false"/></td>
|
<td><apex:commandButton value="{!$Label.Search}" onclick="doSearch();return false;" style="width:100px" /></td>
|
<!-- XHL-20190428-UpdateStart -->
|
<!-- <th style="text-align:right;width:90px;"><apex:outputLabel value="{!$ObjectType.QuoteLineItem.fields.Set__c.label}" rendered="{!oppflg}"/></th>
|
<td><apex:selectList id="productSet" value="{!productSetVal}" rendered="{!oppflg}" size="1" style="width:100px;float:right;">
|
<apex:selectOptions value="{!productSet}"/>
|
</apex:selectList>
|
</td> -->
|
<!-- XHL-20190428-UpdateEnd -->
|
<td> <apex:commandButton value="{!$Label.Add_Product}" rendered="{!oppflg}" style="width:100px;float:right;" disabled="{!Hascl}" rerender="dummy" onclick="setProductList();return false;"/></td>
|
</tr>
|
<tr>
|
<td style="border-bottom: 1px solid #888;" colspan="15"> </td>
|
</tr>
|
</table>
|
<table width="900" border="0" style="background-color:#DCDCDC">
|
<tr>
|
<td width="12"> </td>
|
<th valign="top">{!$Label.Search_Result}</th>
|
<td width="20"> </td>
|
<td>
|
<table border="0">
|
<tr>
|
<td>
|
<div id="iframelike" style="width:800px">
|
<apex:pageBlockTable id="idRezultVisitor" value="{!cl}" var="c" border="1" columns="7" columnsWidth="25px,125px,125px,90px,95px,130,210px">
|
|
<apex:column style="width:15px;" >
|
<apex:outputText style="display: none;" id="hidId" value="{!c.pbeId}"/>
|
<apex:outputText style="display: none;" id="pId" value="{!c.pbe.Product__c}"/>
|
<apex:facet name="header">{!$Label.Selected}</apex:facet>
|
<input type="checkbox" name="checklist" value="" style="width:10px;"/>
|
</apex:column>
|
|
<apex:column >
|
<apex:facet name="header">{!$ObjectType.Product_Search__c.fields.name.label}</apex:facet>
|
<apex:outputText style="display: none;" id="Name" value="{!c.pbe.Name}" />
|
<apex:outputLink id="NameLink" value="#" onclick="setProductOne('{!lineno}','{!c.idx}');return false;">{!c.pbe.Name}</apex:outputLink>
|
</apex:column>
|
|
<apex:column >
|
<apex:facet name="header">{!$ObjectType.Product_Search__c.fields.ProductCode__c.Label}</apex:facet>
|
<apex:outputField id="ProductCode" value="{!c.pbe.ProductCode__c}" />
|
</apex:column>
|
|
<apex:column >
|
<apex:facet name="header">{!$ObjectType.Product_Search__c.fields.Product_ECCode__c.Label}</apex:facet>
|
<apex:outputField id="ProductECCode" value="{!c.pbe.Product_ECCode__c}" />
|
</apex:column>
|
|
<apex:column >
|
<apex:facet name="header">{!$ObjectType.Product_Search__c.fields.ProductModels1__c.Label}</apex:facet>
|
<apex:outputField id="ProductModels" value="{!c.pbe.ProductModels1__c}" />
|
<apex:outputText id="ProductModel" value="{!c.pbe.ProductModels1__c}" style="display: none;"/>
|
</apex:column>
|
|
<apex:column >
|
<apex:facet name="header">{!$ObjectType.PricebookEntry.fields.SalesPrice__c.label}</apex:facet>
|
<apex:outputText id="SalespriceR" value="{!c.salespriceR}" />
|
<apex:outputText id="Salesprice" value="{!c.salesprice}" style="display: none;"/>
|
<apex:outputText id="SalespriceA" value="{!c.salespriceA}" style="display: none;"/>
|
<apex:outputText id="SalespriceB" value="{!c.salespriceB}" style="display: none;"/>
|
<apex:outputText id="SalespriceC" value="{!c.salespriceC}" style="display: none;"/>
|
<apex:outputText id="Hiddenflg" value="{!c.hiddenflg}" style="display: none;"/>
|
</apex:column>
|
|
<!-- <apex:column >
|
<apex:facet name="header">{!$ObjectType.PricebookEntry.fields.Pricebook2Id.label}</apex:facet>
|
<apex:outputText id="Pricebook" value="{!c.pbId}" />
|
</apex:column> -->
|
|
<apex:column >
|
<apex:facet name="header">{!$ObjectType.Product_Search__c.fields.ProductDescription__c.label}</apex:facet>
|
<apex:outputField id="ProductDescription" value="{!c.pbe.ProductDescription__c}" />
|
</apex:column>
|
|
|
</apex:pageBlockTable>
|
</div>
|
</td>
|
</tr>
|
</table>
|
</td>
|
</tr>
|
</table>
|
</apex:pageBlock>
|
</apex:form>
|
</apex:outputPanel>
|
<script type="text/javascript">
|
// フォーカスセット
|
j$(escapeVfId('Page:mainForm:idSearchSetProduct:searchName'))[0].focus();
|
j$(escapeVfId('Page:mainForm:idSearchSetProduct:searchName')).val(j$(escapeVfId('Page:mainForm:idSearchSetProduct:searchName')).val());
|
|
</script>
|
|
</apex:page>
|