<apex:page id="Page" Controller="SWOSearchProductContaroller" 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']");
|
|
|
for(var i=0; i<checklist.length; i++){
|
|
if (checklist[i].checked) {
|
|
hasCheckedCnt++;
|
if (nextLine < QuoteEntryMaxLine) {
|
|
SetProductId(nextLine, i);
|
nextLine++;
|
} else {
|
return false;
|
}
|
}
|
}
|
if (hasCheckedCnt == 0) {
|
alert(top.window.opener.Error_Message34);
|
return false;
|
}
|
top.window.close();
|
}
|
|
function setProductOne(lineno, i) {
|
SetProductId(lineno, i);
|
window.opener.doReroad();
|
top.window.close();
|
}
|
|
function doSearch() {
|
blockme();
|
serProduct.call();
|
}
|
|
function SetProductId(lineno, i) {
|
var ProductName = j$(escapeVfId("Page:allForm:allBlock:ProductList:theTable_content:"+ i +":ProductName")).text();
|
var productId = j$(escapeVfId("Page:allForm:allBlock:ProductList:theTable_content:"+ i +":productId")).text();
|
var ProductCode = j$(escapeVfId("Page:allForm:allBlock:ProductList:theTable_content:"+ i +":ProductCode")).text();
|
var Description = j$(escapeVfId("Page:allForm:allBlock:ProductList:theTable_content:"+ i +":Description")).value();
|
|
if (Description.indexOf(";") != -1) {
|
var array = Description.split(";");
|
Description = '';
|
for (var i = 0; i <array.length; i++) {
|
if (array[i] != '') {
|
Description += array[i] + ';\n';
|
}
|
}
|
}
|
var PART_NUMBER = j$(escapeVfId("Page:allForm:allBlock:ProductList:theTable_content:"+ i +":PART_NUMBER")).text();
|
var ProductInventory = j$(escapeVfId("Page:allForm:allBlock:ProductList:theTable_content:"+ i +":ProductInventory")).text();
|
|
var type = j$(escapeVfId("type")).value();
|
|
if ("Quotes" == type) {
|
window.opener.j$(escapeVfId("Page:allForm:allBlock:ProductInfoList:theTable_content:" + lineno + ":ProductName")).val(ProductName);
|
window.opener.j$(escapeVfId("Page:allForm:allBlock:ProductInfoList:theTable_content:" + lineno + ":productId")).val(productId);
|
window.opener.j$(escapeVfId("Page:allForm:allBlock:ProductInfoList:theTable_content:" + lineno + ":ProductCode")).text(ProductCode);
|
window.opener.j$(escapeVfId("Page:allForm:allBlock:ProductInfoList:theTable_content:" + lineno + ":Description")).val(Description);
|
window.opener.j$(escapeVfId("Page:allForm:allBlock:ProductInfoList:theTable_content:" + lineno + ":PART_NUMBER")).text(PART_NUMBER);
|
window.opener.j$(escapeVfId("Page:allForm:allBlock:ProductInfoList:theTable_content:" + lineno + ":ProductInventory")).text(ProductInventory);
|
window.opener.j$(escapeVfId("Page:allForm:allBlock:ProductInfoList:theTable_content:" + lineno + ":quantity")).val(1);
|
}else{
|
window.opener.j$(escapeVfId("Page:mainForm:diagnosisList:" + lineno + ":Name")).val(ProductName);
|
window.opener.j$(escapeVfId("Page:mainForm:diagnosisList:" + lineno + ":partNumber")).val(ProductCode);
|
window.opener.j$(escapeVfId("Page:mainForm:diagnosisList:" + lineno + ":productId")).val(productId);
|
window.opener.j$(escapeVfId("Page:mainForm:diagnosisList:" + lineno + ":description")).val(Description);
|
}
|
|
}
|
|
</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="allForm">
|
<apex:actionFunction action="{!serProduct}" name="serProduct" reRender="ProductList,message1" oncomplete="unblockUI();"/>
|
<input type="hidden" id="type" value="{!type}"/>
|
<!-- <apex:actionFunction name="save" action="{!save}" rerender="allForm" onComplete="unblockUI();refreshPage();closeJs();"></apex:actionFunction> -->
|
<!-- <input type="hidden" id="baseUrl" value="{!baseUrl}"/> -->
|
<apex:pageBlock title="Product" id="allBlock">
|
<apex:pageblocksection columns="1" id="ProductList">
|
<apex:outputPanel >
|
<DIV style="OVERFLOW-Y: hidden; OVERFLOW-X:auto;width:1260px">
|
|
<div id="ProductList:tablediv" style="OVERFLOW-X: hidden; OVERFLOW-Y:auto;width:1800px; height:400px">
|
|
<apex:pageBlock id="idSearchSetProduct" title="{!$Label.Product_Search}">
|
<!-- <table width="900" border="0" style="background-color:#DCDCDC"> -->
|
<table width="900" border="0" >
|
|
<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>
|
|
<td> <apex:commandButton value="{!$Label.Add_Product}" style="width:100px;float:right;" rerender="dummy" onclick="setProductList();return false;"/></td>
|
</tr>
|
<!-- <tr>
|
<td style="border-bottom: 1px solid #888;" colspan="15"> </td>
|
</tr> -->
|
</table>
|
</apex:pageBlock>
|
<table id="theTable_header" border="0" style ="width:1800px;text-align: center;" styleClass="list">
|
<thead>
|
<tr>
|
<th>{!$Label.Search_Result}</th>
|
</tr>
|
<tr>
|
<td style ="width: 1%;text-align: center" scope="col">选择</td>
|
<td style ="width: 1%;text-align: center" scope="col">No</td>
|
|
|
|
<td style ="width: 10%;text-align: center" scope="col">ProductName</td>
|
|
<td style ="width: 10%;text-align: center" scope="col">OTCode</td>
|
<td style ="width: 10%;text-align: center" scope="col">DESCRIPTION</td>
|
<!-- <td style ="width: 10%;;text-align: center" scope="col">Part Number</td>
|
<td style ="width: 10%;;text-align: center" scope="col">库存</td> -->
|
</tr>
|
</thead>
|
</table>
|
|
<apex:dataTable value="{!productInfoList}" var="ProductInfo" id="theTable_content" border="0"
|
style="width:1800px;border-bottom-width: 0px; font-size:11px; border-spacing:0;text-align: left;" styleClass="list">
|
<apex:column style="width: 2.3%" >
|
|
<input type="checkbox" name="checklist" value="" />
|
</apex:column>
|
<apex:column style="width: 1%">
|
<apex:outputText value="{!ProductInfo.lineNumber}" id="lineNumber" style="resize:vertical;width: 95%"/>
|
</apex:column>
|
|
|
<apex:column style="width: 10%">
|
<apex:outputText value="{!ProductInfo.productPage.Name}" id="ProductName" style="resize:vertical;width: 95%"/>
|
<apex:outputText id="productId" value="{!ProductInfo.productId}" style="display: none;"/>
|
</apex:column>
|
<apex:column style="width: 10%">
|
<!-- <c:PDFWbr targetStr="{!ProductInfo.productPage.ProductCode}" id="ProductCode"/> -->
|
<apex:outputText value="{!ProductInfo.productPage.ProductCode}" id="ProductCode" style="resize:vertical;width: 95%"/>
|
</apex:column>
|
<apex:column style="width: 10%">
|
<!-- <c:PDFWbr targetStr="{!ProductInfo.productPage.Description}" id="Description"/> -->
|
<apex:outputField value="{!ProductInfo.productPage.Description}" id="Description" style="resize:vertical;width: 95%"/>
|
</apex:column>
|
<!-- <apex:column style="width: 10%">
|
|
<apex:outputText value="{!ProductInfo.productPage.PART_NUMBER__c}" id="PART_NUMBER" style="resize:vertical;width: 95%"/>
|
</apex:column>
|
|
<apex:column style="width: 10%">
|
|
<apex:outputText value="{!ProductInfo.productPage.ProductInventory__c}" id="ProductInventory" style="resize:vertical;width: 95%"/>
|
</apex:column> -->
|
|
</apex:dataTable>
|
</div>
|
</DIV>
|
</apex:outputPanel>
|
</apex:pageblocksection>
|
</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>
|