From 1b214a96d371ce90578fb7d6c14eecfcba5f87f0 Mon Sep 17 00:00:00 2001
From: 涂煌豪 <tuhuanghao@prec-tech.com>
Date: 星期一, 11 四月 2022 18:52:32 +0800
Subject: [PATCH] Sfdc2PoContactBatch修改
---
force-app/main/default/pages/BMEWorkPage.page | 194 ++++++++++++++++++++++++++++++++++++-----------
1 files changed, 147 insertions(+), 47 deletions(-)
diff --git a/force-app/main/default/pages/BMEWorkPage.page b/force-app/main/default/pages/BMEWorkPage.page
index c602afe..0c53143 100644
--- a/force-app/main/default/pages/BMEWorkPage.page
+++ b/force-app/main/default/pages/BMEWorkPage.page
@@ -5,6 +5,12 @@
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<apex:includeScript value="{!URLFOR($Resource.BmeWorkJs)}"/>
+
+<!-- 20220222 PI鏀归�� by Bright--start -->
+<apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
+<script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script>
+<!-- 20220222 PI鏀归�� by Bright--end -->
+
<style>
td .dateFormat {
display: none;
@@ -83,6 +89,11 @@
}
body .pbBody table.list tr.headerRow td.col_Scroll {width:0px; padding:0px; border-width:0px;}
body .pbBody table.list tr.dataRow td.col_Scroll {width:0px; padding:0px; border-width:0px;}
+
+.decrypt{position: absolute;top: 0;left: 100%;display: none;text-align: left;
+ padding-left: 5px;}
+a:hover .decrypt{display: block;width: 100px}
+
</style>
<script type="text/javascript">
var heightAjustment = 120;
@@ -96,14 +107,14 @@
</script>
</head>
<apex:form id="allForm">
- <apex:actionFunction name="saveAndSearch" action="{!save}" rerender="allPanel" oncomplete="unblockUI();">
+ <apex:actionFunction name="saveAndSearch" action="{!save}" rerender="allPanel" oncomplete="afterSaveAndSearch();">
<apex:param name="firstParam" assignTo="{!saveType}" value="" />
</apex:actionFunction>
<apex:actionFunction name="saveAndSort" action="{!save}" rerender="allPanel" oncomplete="unblockUI();">
<apex:param name="firstParam" assignTo="{!saveType}" value="" />
<apex:param name="secondParam" assignTo="{!sortKey}" value="" />
</apex:actionFunction>
- <apex:actionFunction name="searchOpp" action="{!chick}" rerender="allPanel" oncomplete="unblockUI();"/>
+ <apex:actionFunction name="searchOpp" action="{!chick}" rerender="allPanel" oncomplete="afterSearchOpp();"/>
<apex:actionFunction name="sortTable" action="{!sortTable}" rerender="allPanel" oncomplete="unblockUI();">
<apex:param name="firstParam" assignTo="{!sortKey}" value="" />
</apex:actionFunction>
@@ -113,7 +124,7 @@
<tr>
<td width="150px">
<apex:commandButton onclick="blockme()" oncomplete="unblockUI();" action="{!save}" value="淇濆瓨" style="height:30px;width:50px;"/>
- <apex:commandButton value="妫�绱�" onclick="searchOppJs_Account_copy();return false;" style="height:30px;width:70px;"/>
+ <apex:commandButton value="妫�绱�" onclick="NewSearch();return false;" style="height:30px;width:70px;"/>
</td>
<td width="1000px">
<apex:pageMessages />
@@ -149,10 +160,11 @@
<apex:selectList value="{!numtextC1}" size="1" style="width:110px"><apex:selectOptions value="{!textOpts02}"/></apex:selectList>
</td>
<td width="130px">
- <apex:selectList value="{!numtextC2}" size="1" style="width:110px"><apex:selectOptions value="{!equalOpts}"/></apex:selectList>
+ <apex:selectList value="{!numtextC2}" size="1" style="width:110px"><apex:selectOptions value="{!equalOpts2}"/></apex:selectList>
</td>
<td width="200px">
- <apex:inputText style="width:150px" value="{!numtextC}"/>
+ <apex:inputHidden id="AwsDataIds" value="{!AwsDataIds}"/>
+ <apex:inputText id="numtextC" style="width:150px" value="{!numtextC}"/>
</td>
<td width="200px">
<font>鏁� 鎹� 瀛� 娈� </font>
@@ -165,7 +177,7 @@
<apex:inputText style="width:150px" value="{!numtextD}"/>
</td>
<td width="230px">鏄剧ず
- <apex:selectList value="{!limits}" size="1" onchange="searchOppJs_Account_copy();return false;">
+ <apex:selectList value="{!limits}" size="1" onchange="NewSearch();return false;">
<apex:selectOptions value="{!limitOpts}"/></apex:selectList>銆�鏉℃暟鎹�
</td>
</tr>
@@ -245,8 +257,10 @@
<apex:outputField value="{!or.con.CampaignOwnerName__c}" />
</apex:outputLink>
</td>
- <td align="center">
- <apex:outputField value="{!or.Agcmmc.Contact__c}"/>
+ <td align="center" >
+
+ <a style="position: relative" href="/{!or.con.Id}" aws-data-id="{!or.con.AWS_Data_Id__c}" title=""><span>{!or.con.MedicalStaff_Full_name__c}</span><span class="decrypt"></span></a>
+
</td>
<td>
<apex:outputField value="{!or.con.Accountid}"/>
@@ -304,45 +318,131 @@
</div>
</apex:outputPanel>
</apex:pageBlock>
-<script type="text/javascript">
-j$(function() {
- var tableWidth = 0;
- j$('body .pbBody table#tableHeader tr.headerRow td').each(function() {
- var colClass = getColClassName(this);
- if (colClass != 'col_Scroll') {
- var headerCol = j$('body .pbBody table.list tr.headerRow td.' + colClass);
- tableWidth += headerCol.width();
- }
- });
- j$('table#tableData').css('width', (tableWidth + 2) + 'px');
- j$('table#tableHeader').css('width', (tableWidth + 2) + 'px');
- // list 銇� headerRow 銇� td銇� toggleWidth() 銈掕拷鍔�
- bindTdToggleWidth();
-});
-var elements = document.getElementsByTagName("select");
-for (i = 0; i < elements.length; i++) {
- var id = elements[i].id;
- if (id.length > 5 && id.substring(id.length - 5, id.length) == 'mlktp') {
- elements[i].style.display = "none";
- }
-}
-var tbl_l = document.getElementById("tableData_L");
-var input_l = tbl_l.getElementsByTagName("input");
-for (i = 0; i < input_l.length; i++) {
- var id = input_l[i].id + '_lkid';
- if (document.getElementById(id) != null) {
- input_l[i].style.width = "75%";
- }
-}
-var tbl = document.getElementById("tableData");
-var input = tbl.getElementsByTagName("input");
-for (i = 0; i < input.length; i++) {
- var id = input[i].id + '_lkid';
- if (document.getElementById(id) != null) {
- input[i].style.width = "75%";
- }
-}
-</script>
+ <script type="text/javascript">
+ j$(function() {
+ var tableWidth = 0;
+ j$('body .pbBody table#tableHeader tr.headerRow td').each(function() {
+ var colClass = getColClassName(this);
+ if (colClass != 'col_Scroll') {
+ var headerCol = j$('body .pbBody table.list tr.headerRow td.' + colClass);
+ tableWidth += headerCol.width();
+ }
+ });
+ j$('table#tableData').css('width', (tableWidth + 2) + 'px');
+ j$('table#tableHeader').css('width', (tableWidth + 2) + 'px');
+ // list 銇� headerRow 銇� td銇� toggleWidth() 銈掕拷鍔�
+ bindTdToggleWidth();
+ });
+ var elements = document.getElementsByTagName("select");
+ for (i = 0; i < elements.length; i++) {
+ var id = elements[i].id;
+ if (id.length > 5 && id.substring(id.length - 5, id.length) == 'mlktp') {
+ elements[i].style.display = "none";
+ }
+ }
+ var tbl_l = document.getElementById("tableData_L");
+ var input_l = tbl_l.getElementsByTagName("input");
+ for (i = 0; i < input_l.length; i++) {
+ var id = input_l[i].id + '_lkid';
+ if (document.getElementById(id) != null) {
+ input_l[i].style.width = "75%";
+ }
+ }
+ var tbl = document.getElementById("tableData");
+ var input = tbl.getElementsByTagName("input");
+ for (i = 0; i < input.length; i++) {
+ var id = input[i].id + '_lkid';
+ if (document.getElementById(id) != null) {
+ input[i].style.width = "75%";
+ }
+ }
+
+ AWSService.sfSessionId = '{!GETSESSIONID()}';
+ var staticResource = JSON.parse('{!staticResource}');
+
+ document.body.onload = function(){
+ NewSearch();
+ }
+ var awsdata_map={};
+ function NewSearch(){
+
+ // 濡傛灉鏈夊~鍐欏鍚嶏紝鍏堝幓aws鏌ヨ锛屽啀鐢╝wsdataid鏌ヨ鍚庡彴锛屽鏋滄病鏈夊~鍐欑洿鎺ユ煡璇㈠悗鍙�
+ awsdata_map={};
+ let e = document.getElementById("allPage:allForm:searchBlock:numtextC");
+ if(e && e.value){
+ blockme();
+ AWSService.search(staticResource.searchUrl,JSON.stringify({
+ "contactName":e.value
+ }),function(data){
+ unblockUI();
+ if(data.object && data.object.length > 0){
+ let aws_data_ids = [];
+ for(let d of data.object){
+ if(d.dataId){
+ awsdata_map[d.dataId] = d;
+ aws_data_ids.push(d.dataId);
+ }
+ }
+ document.getElementById("allPage:allForm:searchBlock:AwsDataIds").value = aws_data_ids.join(";");
+ }else{
+ document.getElementById("allPage:allForm:searchBlock:AwsDataIds").value = new Date().getTime();
+ }
+ searchOppJs_Account_copy();
+ },staticResource.token);
+ }else{
+ searchOppJs_Account_copy();
+ }
+
+ }
+
+ function afterSearchOpp(){
+ DecryptContactName(()=>unblockUI());
+ }
+
+ function afterSaveAndSearch(){
+ DecryptContactName(()=>unblockUI());
+ }
+
+ function DecryptContactName(callback){
+
+ let no_in_ids = [];
+ j$("[aws-data-id]").each(function(i,e){
+ let id = e.getAttribute("aws-data-id");
+ if(!(id && awsdata_map.hasOwnProperty(id))){
+ no_in_ids.push(id);
+ }
+ });
+ if(no_in_ids.length>0){
+ AWSService.search(staticResource.searchUrl,JSON.stringify({
+ "dataIds":no_in_ids
+ }),function(data){
+ if(data.object && data.object.length > 0){
+ for(let d of data.object){
+ if(d.dataId){
+ awsdata_map[d.dataId] = d;
+ }
+ }
+ }
+ BindToTile();
+ if(callback)callback();
+ },staticResource.token);
+ }
+ else{
+ BindToTile();
+ if(callback)callback();
+ }
+ }
+
+ function BindToTile(){
+ j$("[aws-data-id]").each(function(i,e){
+ let id = e.getAttribute("aws-data-id");
+ if(id && awsdata_map.hasOwnProperty(id) && awsdata_map[id].medicalStaffFullName){
+ j$(e).find(".decrypt").html(awsdata_map[id].medicalStaffFullName);
+ }
+ });
+ }
+
+ </script>
</apex:outputPanel>
</apex:form>
</apex:page>
\ No newline at end of file
--
Gitblit v1.9.1