From e19c35a6d99fd792106d925ae03e8ae3cef3f6b3 Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期三, 20 四月 2022 16:44:06 +0800
Subject: [PATCH] Insert log issue
---
force-app/main/default/pages/XinDailyReport.page | 159 ++++++++++++++++++++++++++--------------------------
1 files changed, 80 insertions(+), 79 deletions(-)
diff --git a/force-app/main/default/pages/XinDailyReport.page b/force-app/main/default/pages/XinDailyReport.page
index 07d4934..82c4800 100644
--- a/force-app/main/default/pages/XinDailyReport.page
+++ b/force-app/main/default/pages/XinDailyReport.page
@@ -62,6 +62,7 @@
var tempActId = '';
var tempRecordTypeName = '';
var tempBtnIdHidden = '';
+ var OPDId = '';
var tempRedId = '';
var tempReportId = '';
var hiddenDivShowFlg = false;
@@ -69,79 +70,79 @@
sforce.connection.sessionId = '{!$Api.Session_ID}';
//Add By Li Jun 20220225 for PIPL Start
- AWSService.sfSessionId = '{!GETSESSIONID()}';
- var staticResources = JSON.parse('{!staticResource}');
- var contactAWSIds = JSON.parse('{!contactAWSIds}');
- console.log('contactAWSIds:'+JSON.stringify(contactAWSIds));
- var sfIdToContactInfo = {};
- function preparePayloadForSearchContact(){
- let searchPayload = new Object();
- searchPayload.dataIds = contactAWSIds;
- searchPayload.contactName = '';
- return JSON.stringify(searchPayload);
- }
+ // AWSService.sfSessionId = '{!GETSESSIONID()}';
+ // var staticResources = JSON.parse('{!staticResource}');
+ // var contactAWSIds = JSON.parse('{!contactAWSIds}');
+ // console.log('contactAWSIds:'+JSON.stringify(contactAWSIds));
+ // var sfIdToContactInfo = {};
+ // function preparePayloadForSearchContact(){
+ // let searchPayload = new Object();
+ // searchPayload.dataIds = contactAWSIds;
+ // searchPayload.contactName = '';
+ // return JSON.stringify(searchPayload);
+ // }
- function refreshContactAll(){
- let contactIdsFromSF = [];
- // let allSizeForAct =document.getElementById('Page:mainForm:idDayEdit:AllSize').value;
- let allSizeForAct = j$(escapeVfId('idActSize')).value();
- console.log('allSizeForAct:'+allSizeForAct);
- for(let i=0;i<allSizeForAct;i++){
- for(let j=1;j<6;j++){
- let contactIdForVis = document.getElementById("Page:mainForm:idDayEdit:idActivities:"+i+":idVisitor"+j+"_IdHidden").value;
- contactIdsFromSF.push(contactIdForVis);
- }
- };
- sforce.connection.sessionId = '{!GETSESSIONID()}';
- var condition = '';
- for(var i=0;i<contactIdsFromSF.length;i++){
- if(contactIdsFromSF[i] != ''){
- condition += "," + "\'"+contactIdsFromSF[i]+"\'";
- }
- }
- condition = condition.substr(1);
- console.log('condition = ' + condition);
- var record = sforce.connection.query("select AWS_Data_Id__c from Contact where id in("+condition+")");
- var records = record.getArray("records");
- for(var i =0;i<records.length;i++){
- contactAWSIds.push(records[i].AWS_Data_Id__c);
- }
- searchContactAll();
- }
- function searchContactAll(){
- let data = preparePayloadForSearchContact();
- let searchCallBack = function searchCallBack(result){
- let contacts = result.object;
- if(contacts == null){
- return;
- }
- for(var i=0;i<contacts.length;i++){
- let temp = {}
- temp.lastName = contacts[i].lastName?contacts[i].lastName:'';
- if(contacts[i].sfRecordId){
- sfIdToContactInfo[contacts[i].sfRecordId] = temp;
- }
- }
- console.log('AWS Result:'+JSON.stringify(sfIdToContactInfo));
- // let allSizeForAct =document.getElementById('Page:mainForm:idDayEdit:AllSize').value;
- let allSizeForAct = j$(escapeVfId('idActSize')).value();
- console.log('Act size:'+allSizeForAct);
- for(let i=0;i<allSizeForAct;i++){
- for(let j=1;j<6;j++){
- let contactIdForVis = document.getElementById("Page:mainForm:idDayEdit:idActivities:"+i+":idVisitor"+j+"_IdHidden").value;
- if(contactIdForVis){
- console.log('SFId for Contact:'+contactIdForVis);
- if(sfIdToContactInfo.hasOwnProperty(contactIdForVis)){
- document.getElementById("Page:mainForm:idDayEdit:idActivities:"+i+":idVisitor"+j).value = sfIdToContactInfo[contactIdForVis].lastName;
- }
- }else{
- document.getElementById("Page:mainForm:idDayEdit:idActivities:"+i+":idVisitor"+j).value = '';
- }
- }
- }
- };
- AWSService.search(staticResources.searchUrl,data,searchCallBack,staticResources.token);
- }
+ // function refreshContactAll(){
+ // let contactIdsFromSF = [];
+ // // let allSizeForAct =document.getElementById('Page:mainForm:idDayEdit:AllSize').value;
+ // let allSizeForAct = j$(escapeVfId('idActSize')).value();
+ // console.log('allSizeForAct:'+allSizeForAct);
+ // for(let i=0;i<allSizeForAct;i++){
+ // for(let j=1;j<6;j++){
+ // let contactIdForVis = document.getElementById("Page:mainForm:idDayEdit:idActivities:"+i+":idVisitor"+j+"_IdHidden").value;
+ // contactIdsFromSF.push(contactIdForVis);
+ // }
+ // };
+ // sforce.connection.sessionId = '{!GETSESSIONID()}';
+ // var condition = '';
+ // for(var i=0;i<contactIdsFromSF.length;i++){
+ // if(contactIdsFromSF[i] != ''){
+ // condition += "," + "\'"+contactIdsFromSF[i]+"\'";
+ // }
+ // }
+ // condition = condition.substr(1);
+ // console.log('condition = ' + condition);
+ // var record = sforce.connection.query("select AWS_Data_Id__c from Contact where id in("+condition+")");
+ // var records = record.getArray("records");
+ // for(var i =0;i<records.length;i++){
+ // contactAWSIds.push(records[i].AWS_Data_Id__c);
+ // }
+ // searchContactAll();
+ // }
+ // function searchContactAll(){
+ // let data = preparePayloadForSearchContact();
+ // let searchCallBack = function searchCallBack(result){
+ // let contacts = result.object;
+ // if(contacts == null){
+ // return;
+ // }
+ // for(var i=0;i<contacts.length;i++){
+ // let temp = {}
+ // temp.lastName = contacts[i].lastName?contacts[i].lastName:'';
+ // if(contacts[i].sfRecordId){
+ // sfIdToContactInfo[contacts[i].sfRecordId] = temp;
+ // }
+ // }
+ // console.log('AWS Result:'+JSON.stringify(sfIdToContactInfo));
+ // // let allSizeForAct =document.getElementById('Page:mainForm:idDayEdit:AllSize').value;
+ // let allSizeForAct = j$(escapeVfId('idActSize')).value();
+ // console.log('Act size:'+allSizeForAct);
+ // for(let i=0;i<allSizeForAct;i++){
+ // for(let j=1;j<6;j++){
+ // let contactIdForVis = document.getElementById("Page:mainForm:idDayEdit:idActivities:"+i+":idVisitor"+j+"_IdHidden").value;
+ // if(contactIdForVis){
+ // console.log('SFId for Contact:'+contactIdForVis);
+ // if(sfIdToContactInfo.hasOwnProperty(contactIdForVis)){
+ // document.getElementById("Page:mainForm:idDayEdit:idActivities:"+i+":idVisitor"+j).value = sfIdToContactInfo[contactIdForVis].lastName;
+ // }
+ // }else{
+ // document.getElementById("Page:mainForm:idDayEdit:idActivities:"+i+":idVisitor"+j).value = '';
+ // }
+ // }
+ // }
+ // };
+ // AWSService.search(staticResources.searchUrl,data,searchCallBack,staticResources.token);
+ // }
//Add By Li Jun 20220225 for PIPL End
//window.document.onkeydown= onKeyEvent;
function initSetPage() {
@@ -1157,7 +1158,7 @@
<th>{!$Label.Free_Input} <apex:inputField id="idFree_Input__c" value="{!a.act.Free_Input__c}" onClick="if(vpChack({!a.index})) return false;setVisitorPlaceDisabled();"/> </th>
</tr>
<tr>
- <th>鎷滆鐩殑</th>
+ <th >鎷滆鐩殑</th>
<td></td>
<apex:outputPanel rendered="{!IF(reportOwner.Job_Category__c == '閿�鍞湇鍔�', 'true', 'false')}" layout="none">
<td colspan="3"><span><div class="requiredInput"><div class="requiredBlock"></div><apex:inputField id="idActivityPurposeFSEDiv" value="{!a.act.Activity_PurposeFSE__c}" ></apex:inputField>
@@ -1338,23 +1339,23 @@
<td><input type="button" class="btn" id="idOpds{!a.index}" name="reportBtn" value="鏂板缓OPD璁″垝" style="width:110px" onclick="addOpdNew('{!a.index}', '{!a.act.Id}');"/></td>
<!--SWAG-BUF6R8 20201020 youchang end -->
<td> </td>
- <td><input type="button" class="{!If(a.act.OPD_ID__c != '' || a.act.OPDPlan_Flag__c,'btnRed','btn')}" id="idOPD{!a.index}" name="reportBtn" value="{!$Label.OPD_Taiwan}" style="width:110px;{!If(a.act.OPD_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','OPD','idOPD_IdHidden','idOPD','{!report.id}');"/><apex:inputText id="idOPD_IdHidden" value="{!a.act.OPD_ID__c}" style="display:none" disabled="true"/></td>
+ <td><input type="button" class="{!If(a.act.OPD_ID__c != '' || a.act.OPDPlan_Flag__c,'btnRed','btn')}" id="idOPD{!a.index}" name="reportBtn" value="{!$Label.OPD_Taiwan}" style="width:110px;{!If(a.act.OPD_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','OPD','idOPD_IdHidden','idOPD','{!report.id}','{!a.act.Opd_Plan__c}');"/><apex:inputText id="idOPD_IdHidden" value="{!a.act.OPD_ID__c}" style="display:none" disabled="true"/></td>
<!-- <td><input type="button" class="{!If(a.act.OPD_ID__c != '','btnRed','btn')}" id="idOPD{!a.index}" name="reportBtn" value="{!$Label.OPD_Taiwan}" style="width:110px;{!If(a.act.OPD_ID__c != '','color:red;','color:black;')}" onclick="selectOPDSISReportType('{!a.index}','{!a.act.id}','OPD','idOPD_IdHidden','idOPD','{!report.id}');"/><apex:inputText id="idOPD_IdHidden" value="{!a.act.OPD_ID__c}" style="display:none" disabled="true"/></td> -->
<td> </td>
- <td><input type="button" class="{!If(a.act.NTC_ID__c != '','btnRed','btn')}" id="idNTC{!a.index}" name="reportBtn" value="NTC/CDS鍩硅" style="width:110px;{!If(a.act.NTC_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','NTC','idNTC_IdHidden','idNTC','{!report.id}');"/><apex:inputText id="idNTC_IdHidden" value="{!a.act.NTC_ID__c}" style="display:none" disabled="true"/></td>
+ <td><input type="button" class="{!If(a.act.NTC_ID__c != '','btnRed','btn')}" id="idNTC{!a.index}" name="reportBtn" value="NTC/CDS鍩硅" style="width:110px;{!If(a.act.NTC_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','NTC','idNTC_IdHidden','idNTC','{!report.id}','{!a.act.Opd_Plan__c}');"/><apex:inputText id="idNTC_IdHidden" value="{!a.act.NTC_ID__c}" style="display:none" disabled="true"/></td>
<td> </td>
- <td><input type="button" class="{!If(a.act.OnCall_ID__c != '','btnRed','btn')}" id="idONCALL{!a.index}" name="reportBtn" value="ON CALL" style="width:110px;{!If(a.act.OnCall_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','On_Call','idONCALL_IdHidden','idONCALL','{!report.id}');"/><apex:inputText id="idONCALL_IdHidden" value="{!a.act.OnCall_ID__c}" style="display:none" disabled="true"/></td>
+ <td><input type="button" class="{!If(a.act.OnCall_ID__c != '','btnRed','btn')}" id="idONCALL{!a.index}" name="reportBtn" value="ON CALL" style="width:110px;{!If(a.act.OnCall_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','On_Call','idONCALL_IdHidden','idONCALL','{!report.id}','{!a.act.Opd_Plan__c}');"/><apex:inputText id="idONCALL_IdHidden" value="{!a.act.OnCall_ID__c}" style="display:none" disabled="true"/></td>
<td> </td>
- <td><input type="button" class="{!If(a.act.ReportAccompanied_ID__c != '','btnRed','btn')}" id="idReportAccompanied{!a.index}" name="reportBtn" value="{!$Label.Report_Accompanied}" style="width:110px;{!If(a.act.ReportAccompanied_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','Visit_With','idReportAccompanied_IdHidden','idReportAccompanied','{!report.id}');"/><apex:inputText id="idReportAccompanied_IdHidden" value="{!a.act.ReportAccompanied_ID__c}" style="display:none" disabled="true"/></td>
+ <td><input type="button" class="{!If(a.act.ReportAccompanied_ID__c != '','btnRed','btn')}" id="idReportAccompanied{!a.index}" name="reportBtn" value="{!$Label.Report_Accompanied}" style="width:110px;{!If(a.act.ReportAccompanied_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','Visit_With','idReportAccompanied_IdHidden','idReportAccompanied','{!report.id}','{!a.act.Opd_Plan__c}');"/><apex:inputText id="idReportAccompanied_IdHidden" value="{!a.act.ReportAccompanied_ID__c}" style="display:none" disabled="true"/></td>
<td> </td>
- <td><input type="button" class="{!If(a.act.CityStatus_ID__c != '','btnRed','btn')}" id="idCityStatus{!a.index}" name="reportBtn" value="{!$Label.City_Status_Report}" style="width:110px;{!If(a.act.CityStatus_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','MarketCondition','idCityStatus_IdHidden','idCityStatus','{!report.id}');"/><apex:inputText id="idCityStatus_IdHidden" value="{!a.act.CityStatus_ID__c}" style="display:none" disabled="true"/></td>
+ <td><input type="button" class="{!If(a.act.CityStatus_ID__c != '','btnRed','btn')}" id="idCityStatus{!a.index}" name="reportBtn" value="{!$Label.City_Status_Report}" style="width:110px;{!If(a.act.CityStatus_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','MarketCondition','idCityStatus_IdHidden','idCityStatus','{!report.id}','{!a.act.Opd_Plan__c}');"/><apex:inputText id="idCityStatus_IdHidden" value="{!a.act.CityStatus_ID__c}" style="display:none" disabled="true"/></td>
<td> </td>
<!-- <td>
<input type="button" class="{!If(a.act.Claim_ID__c != '','btnRed','btn')}" id="idClaim{!a.index}" name="reportBtn" value="{!$Label.Claim_Input}" style="width:110px;{!If(a.act.Claim_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','Complaint','idClaim_IdHidden','idClaim','{!report.id}');"/>
<apex:inputText id="idClaim_IdHidden" value="{!a.act.Claim_ID__c}" style="display:none" disabled="true"/>
</td> -->
<td> </td>
- <td><input type="button" class="{!If(a.act.Conflict_ID__c != '','btnRed','btn')}" id="idConflict{!a.index}" name="reportBtn" value="{!$Label.Competitor_Information}" style="width:110px;{!If(a.act.Conflict_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','Competitor','idConflict_IdHidden','idConflict','{!report.id}');"/><apex:inputText id="idConflict_IdHidden" value="{!a.act.Conflict_ID__c}" style="display:none" disabled="true"/></td>
+ <td><input type="button" class="{!If(a.act.Conflict_ID__c != '','btnRed','btn')}" id="idConflict{!a.index}" name="reportBtn" value="{!$Label.Competitor_Information}" style="width:110px;{!If(a.act.Conflict_ID__c != '','color:red;','color:black;')}" onclick="openPDNew('{!a.index}','{!a.act.id}','Competitor','idConflict_IdHidden','idConflict','{!report.id}','{!a.act.Opd_Plan__c}');"/><apex:inputText id="idConflict_IdHidden" value="{!a.act.Conflict_ID__c}" style="display:none" disabled="true"/></td>
</tr>
<tr>
<td style="text-align:left;"><apex:commandButton styleClass="idSaveComment" value="{!$Label.SaveComment}" onclick="blockme();" style="width:80px" action="{!saveComment}" rerender="dummy" disabled="{!ministerCommentEditFlg && managerCommentEditFlg}"/></td>
--
Gitblit v1.9.1