From 4420517bbbffea48cabe7a7dcdf2e1c4b440fc85 Mon Sep 17 00:00:00 2001
From: GWY <guweiyi@prec-tech.com>
Date: 星期一, 30 五月 2022 16:15:26 +0800
Subject: [PATCH] 两个LS特殊条件在说明的增减
---
force-app/main/default/pages/NEWCreateSWOQuote.page | 92 +++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 87 insertions(+), 5 deletions(-)
diff --git a/force-app/main/default/pages/NEWCreateSWOQuote.page b/force-app/main/default/pages/NEWCreateSWOQuote.page
index 7835391..6278a46 100644
--- a/force-app/main/default/pages/NEWCreateSWOQuote.page
+++ b/force-app/main/default/pages/NEWCreateSWOQuote.page
@@ -7,8 +7,88 @@
<apex:includeScript value="{!URLFOR($Resource.SWOJS)}"/>
<apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
<apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
+<apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
<script type="text/javascript">
+ // 20220311 PI鏀归�� by Bright start
+ AWSService.sfSessionId = '{!GETSESSIONID()}';
+ var staticResource = JSON.parse('{!staticResource}');
+ var contactstaticResource = JSON.parse('{!contactstaticResource}');
+ var aws_data = {};
+
+ function Decrypt(r,dataIds,callback){
+ if (!(dataIds && dataIds.length)) {
+ if(callback)callback();
+ return;
+ }
+
+ let Foo = function(){
+ for (const id of dataIds) {
+ if (aws_data.hasOwnProperty(id)) {
+ let d = aws_data[id];
+ let $e =j$("[aws-id='"+d.dataId+ "']");
+ $e.each((i,e)=>{
+ j$(e).html(d[j$(e).attr("aws-api")]);
+ })
+
+ }
+ }
+ if(callback)callback();
+ }
+ let ids = [];
+ for (const id of dataIds) {
+ if (!aws_data.hasOwnProperty(id)) {
+ ids.push(id);
+ }
+ }
+ if (ids.length > 0) {
+
+ AWSService.search(r.searchUrl,JSON.stringify({
+ "dataIds":ids
+ }),function(data){
+
+ if(data.object && data.object.length > 0){
+
+ for(let d of data.object){
+ if(d.dataId){
+ aws_data[d.dataId] = d;
+ }
+ }
+ Foo();
+ }else{
+ if(callback)callback();
+ }
+ },r.token);
+ }else{
+ Foo();
+ }
+ }
+
+ function DecryptAll(callback){
+ let dataIds1 = [];
+ j$('[aws-id][aws-obj="Contact"]').each((i,e)=>{
+ let v = j$(e).attr('aws-id');
+ if (v) {
+ dataIds1.push(v);
+ }
+ });
+ Decrypt(contactstaticResource,dataIds1,callback);
+
+ let dataIds2 = [];
+ j$('[aws-id][aws-obj="Quotes__c"]').each((i,e)=>{
+ let v = j$(e).attr('aws-id');
+ if (v) {
+ dataIds2.push(v);
+ }
+ });
+ Decrypt(staticResource,dataIds2,callback);
+ }
+
+ j$(function(){
+ DecryptAll();
+
+ })
+ // 20220311 PI鏀归�� by Bright end
</script>
<style type="text/css">
.Page{
@@ -133,7 +213,9 @@
<tr>
<td colspan="2" align="left" ><apex:inputField id="CURRENCY" value="{!QuotesPage.CURRENCY__c}" style="width: 56%"/></td>
- <td colspan="2" align="left" ><apex:outputField value="{!QuotesPage.CONTACT_NAME__c}" style="width: 63%"/></td>
+ <td colspan="2" align="left" >
+ <a href="/{!QuotesPage.CONTACT_NAME__c}" aws-obj="Contact" aws-api="lastName" aws-id="{!QuotesPage.CONTACT_NAME__r.AWS_Data_Id__c}">{!QuotesPage.CONTACT_NAME__r.Name}</a>
+ </td>
<td colspan="2"/>
<td colspan="2" class="title1">Summary</td>
<td/>
@@ -154,7 +236,7 @@
<td colspan="2" align="left" ><apex:outputField id="COMPANY" value="{!QuotesPage.COMPANY__c}"/>
<!-- <apex:outputLink value="/{!QuotesPage.COMPANYId__c}" target="LINK_{!QuotesPage.COMPANYId__c}" ><c:PDFWbr targetStr="{!QuotesPage.COMPANYName__c}"/></apex:outputLink> -->
</td>
- <td align="left" ><apex:outputField id="CONTACT_PHONE" value="{!QuotesPage.CONTACT_PHONE__c}"/></td>
+ <td align="left" ><apex:outputField html-aws-obj="Quotes__c" html-aws-api="contactPhone" html-aws-id="{!QuotesPage.AWS_Data_Id__c}" id="CONTACT_PHONE" value="{!QuotesPage.CONTACT_PHONE__c}"/></td>
<td colspan="3"/>
<td class="title2">{!$ObjectType.Quotes__c.fields.DISCOUNT__c.label}</td>
<td class="title2" align="left" ><apex:outputField value="{!QuotesPage.DISCOUNT__c}" style="width: 62%"/></td>
@@ -445,8 +527,8 @@
<td align="left" >{!$ObjectType.Quotes__c.fields.SHIP_TO__c.label}</td>
</tr>
<tr>
- <td colspan="2" align="left" ><apex:inputField id="BILL_TO" value="{!QuotesPage.BILL_TO__c }" style="width: 90%;height: 80PX"/></td>
- <td colspan="2" align="left" ><apex:inputField id="SHIP_TO" value="{!QuotesPage.SHIP_TO__c}" style="width: 90%;height: 80PX"/></td>
+ <td colspan="2" align="left" ><apex:inputField html-aws-obj="Quotes__c" html-aws-api="billTo" html-aws-id="{!QuotesPage.AWS_Data_Id__c}" id="BILL_TO" value="{!QuotesPage.BILL_TO__c }" style="width: 90%;height: 80PX"/></td>
+ <td colspan="2" align="left" ><apex:inputField html-aws-obj="Quotes__c" html-aws-api="shipTo" html-aws-id="{!QuotesPage.AWS_Data_Id__c}" id="SHIP_TO" value="{!QuotesPage.SHIP_TO__c}" style="width: 90%;height: 80PX"/></td>
</tr>
<tr>
<td colspan="9"> <hr/></td>
@@ -867,7 +949,7 @@
<td><apex:outputText value="{!mail.haveAtt}" /></td>
<td>
<apex:repeat value="{!mail.attList}" var="att" id="lines">
- <apex:outputLink value="/{!att.Id}" target="LINK_{!att.Id}"><c:PDFWbr targetStr="{!att.Name}" /></apex:outputLink>
+ <apex:outputLink value="/{!att.Id}" target="LINK_{!att.Id}"><c:PDFWbr targetStr="{!att.FileName__c}" /></apex:outputLink>
<br/>
</apex:repeat>
</td>
--
Gitblit v1.9.1