From c51e03fbf2f6633d8e88aeec9dcb8df13524df8f Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期四, 13 七月 2023 12:00:06 +0800
Subject: [PATCH] backup0713
---
force-app/main/default/pages/XinDailyReport.page | 183 +++++++++++++++++++++++++--------------------
1 files changed, 100 insertions(+), 83 deletions(-)
diff --git a/force-app/main/default/pages/XinDailyReport.page b/force-app/main/default/pages/XinDailyReport.page
index 82c4800..63a1aa5 100644
--- a/force-app/main/default/pages/XinDailyReport.page
+++ b/force-app/main/default/pages/XinDailyReport.page
@@ -7,8 +7,8 @@
<apex:includeScript value="{!URLFOR($Resource.jquerysuggestjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.XinDailyReportTuning2Js)}"/>
<apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/>
- <apex:includeScript value="/soap/ajax/29.0/connection.js"/>
- <apex:includeScript value="/soap/ajax/29.0/apex.js"/>
+ <apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
+ <apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
<!-- Add By Li Jun for PIPL 20220225 -->
<apex:includeScript value="{!URLFOR($Resource.AWSService, 'AWSService.js') }" />
<script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script>
@@ -62,7 +62,7 @@
var tempActId = '';
var tempRecordTypeName = '';
var tempBtnIdHidden = '';
- var OPDId = '';
+ var OPDId = ''; //2022-4-17 yjk 灏哋PDID甯︿笂
var tempRedId = '';
var tempReportId = '';
var hiddenDivShowFlg = false;
@@ -70,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() {
@@ -226,6 +226,7 @@
strPage = '/apex/Xin_SearchVisitorPlace?r=' + encodeURI(ros);
options = {minchars:3, minwords:2, resultsClass:'visitorplace_results'};
}
+
else if(vl == '璨╁2搴�'){
strPage = '/apex/Xin_SearchVisitorPlace_Sales?r=' + encodeURI(ros) + '&d=' + j$(escapeVfId('Page:mainForm:idDayEdit:idReportDate')).value();
options = {minchars:3, minwords:2, resultsClass:'visitorplace_results'};
@@ -241,7 +242,9 @@
else {}
jQuery(escapeVfId(str)).unbind();
if (strPage != null) {
+
jQuery(escapeVfId(str)).suggest(strPage,options);
+
}
}catch(e){
alert(e);
@@ -631,7 +634,9 @@
var EsetId = document.getElementById("Page:mainForm:idDayEdit:idActivities:"+outO.id.substring(0,1)+":idRelOpp"+indexNumber+"HiddenId").value;
var Name = document.getElementById("Page:mainForm:idDayEdit:idActivities:"+outO.id.substring(0,1)+":idRelOpp"+indexNumber+"Hidden").value;
//Related_Opportunity1_ID__c
- window.open("/apex/EnquiryDetails?EsetId="+EsetId+"&indexNumber="+indexNumber,'_blank','width=500px,height=420px');
+ // 璇环杩涘彛璁鸿瘉 ssm 20220823 璋冩暣椤甸潰瀹藉害 500 --> 550 start
+ window.open("/apex/EnquiryDetails?EsetId="+EsetId+"&indexNumber="+indexNumber,'_blank','width=550px,height=420px');
+ // 璇环杩涘彛璁鸿瘉 ssm 20220823 end
}
//2021-11-24 yjk 澧炲姞璇环澶卞崟鎸夐挳 start
@@ -1107,7 +1112,8 @@
<th>{!$Label.Classification_Visited}</th>
<td> </td>
- <td><span><div class="requiredInput"><div class="requiredBlock"></div><apex:inputField id="idVisitorDiv" value="{!a.act.Activity_Type2__c}" >
+ <td><span><div class="requiredInput"><div class="requiredBlock"></div>
+ <apex:inputField id="idVisitorDiv" value="{!a.act.Activity_Type2__c}" >
<apex:actionSupport event="onchange" onsubmit="blockme();vpClear1({!a.index}); return false;"/>
<apex:actionSupport event="onclick" onsubmit="vpChack({!a.index});return false;" />
<!-- <apex:actionSupport event="onfocus" onsubmit="vpChack({!a.index});return false;" />-->
@@ -1116,10 +1122,11 @@
</div></span><apex:inputField id="idVisitorDivBefore" value="{!a.act.Activity_Type2_Before__c}" style="display:none"></apex:inputField></td>
- <td> </td>
+ <td> </td>
<th><apex:outputLabel value="{!$Label.Visit_Location}" onclick="openVisitorPlace({!a.index});" /></th>
<td> </td>
- <td colspan="7"><apex:inputField id="idVisitorPlace" value="{!a.act.Location__c}" onblur="vpClear2_delay({!a.index});" onfocus="setVisitorPlace({!a.index});" style="width:97%" />
+ <td colspan="7">
+ <apex:inputField id="idVisitorPlace" value="{!a.act.Location__c}" onblur="vpClear2_delay({!a.index});" onfocus="setVisitorPlace({!a.index});" style="width:97%" />
<apex:inputText id="idVisitorPlace2" value="{!a.act.Visitor_Place_Free__c}" style="width:97%; display:none" />
<apex:inputHidden id="idVisitorPlaceId" value="{!a.act.whatid__c}" />
<apex:inputHidden id="idVisitorPlaceHidden" value="{!a.act.Location__c}" />
@@ -1233,9 +1240,11 @@
<!-- <td>
<apex:inputField id="idRelService2" onfocus="setRelServiceId({!a.index},'idRelService2','idRelService2Id');" ondblclick="setRelServiceId2({!a.index},'idRelService2Id');" onchange="resetValue('Page:mainForm:idDayEdit:idActivities:{!a.index}:idRelService2');" value="{!a.act.Related_Service2__c}" style="width:100px;" /><apex:inputHidden id="idRelService2Id" value="{!a.act.Related_Service2_ID__c}" /><apex:inputHidden id="idRelService2Hidden" value="{!a.act.Related_Service2__c}" /><apex:inputHidden id="idRelService2HiddenId" value="{!a.act.Related_Service2_ID__c}" />
</td> -->
- <th>浣跨敤鎶ュ憡涔� <apex:inputField value="{!a.act.UseReport__c}"></apex:inputField> <apex:inputHidden id="EventCSLAInfoId" value="{!a.act.SLAReportInfo__c}" />
+ <!-- 2022-06-17 yjk -->
+ <!-- <th>浣跨敤鎶ュ憡涔� <apex:inputField value="{!a.act.UseReport__c}"></apex:inputField> <apex:inputHidden id="EventCSLAInfoId" value="{!a.act.SLAReportInfo__c}" />
<apex:inputHidden id="isDisabledVisitorPlace" value="{!a.isDisabledVisitorPlace}" />
</th>
+ -->
</tr>
<tr>
<td> </td>
@@ -1259,9 +1268,13 @@
<input type="button" id="{!a.index}:idRelOpp4LoseBtn" class="btn" value="澶卞崟" onclick="loseEnquiry(this);" style="width: 35px; cursor: default; border-color: rgb(196, 196, 196); color: #909090; background-position: 0px -90px;" disabled="disabled" />
</td>
<td> </td>
- <td colspan="4"><input type="button" id="{!a.index}:idRelOpp5Btn" class="btn" value="璇环鏇存柊" onclick="enquiryPage(this);" style="width: 63px; cursor: default; border-color: rgb(196, 196, 196); color: #909090; background-position: 0px -90px;" disabled="disabled" />
+ <td colspan="2"><input type="button" id="{!a.index}:idRelOpp5Btn" class="btn" value="璇环鏇存柊" onclick="enquiryPage(this);" style="width: 63px; cursor: default; border-color: rgb(196, 196, 196); color: #909090; background-position: 0px -90px;" disabled="disabled" />
<input type="button" id="{!a.index}:idRelOpp5LoseBtn" class="btn" value="澶卞崟" onclick="loseEnquiry(this);" style="width: 35px; cursor: default; border-color: rgb(196, 196, 196); color: #909090; background-position: 0px -90px;" disabled="disabled" />
</td>
+ <!-- 2022-06-17 yjk -->
+ <th colspan="2" style="text-align: right;padding-right: 10px;">浣跨敤鎶ュ憡涔� <apex:inputField value="{!a.act.UseReport__c}"></apex:inputField> <apex:inputHidden id="EventCSLAInfoId" value="{!a.act.SLAReportInfo__c}" />
+ <apex:inputHidden id="isDisabledVisitorPlace" value="{!a.isDisabledVisitorPlace}" />
+ </th>
<td><input type="button" id="{!a.index}:idRelService1Btn" class="btn" value="淇℃伅鏇存柊" onclick="slaInfoPage('{!a.act.Id}','{!a.index}')" style="width: 100px; cursor: default; border-color: rgb(196, 196, 196); color: #909090; background-position: 0px -90px;" disabled="disabled" /></td>
</tr>
@@ -1339,7 +1352,8 @@
<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}','{!a.act.Opd_Plan__c}');"/><apex:inputText id="idOPD_IdHidden" value="{!a.act.OPD_ID__c}" style="display:none" disabled="true"/></td>
+ <!-- //2022-4-17 yjk 灏哋PDID甯︿笂 start -->
+ <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}','{!a.act.Opd_Plan__c}');"/><apex:inputText id="idNTC_IdHidden" value="{!a.act.NTC_ID__c}" style="display:none" disabled="true"/></td>
@@ -1350,6 +1364,8 @@
<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}','{!a.act.Opd_Plan__c}');"/><apex:inputText id="idCityStatus_IdHidden" value="{!a.act.CityStatus_ID__c}" style="display:none" disabled="true"/></td>
<td> </td>
+
+ <!-- //2022-4-17 yjk 灏哋PDID甯︿笂 end -->
<!-- <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"/>
@@ -1742,6 +1758,7 @@
<div id="glayLayer" ></div>
<div id="divOPD" style="display:none;">
<table style="font-size:16px; font-weight:bold; width:100%">
+
<tr><td colspan="{!if(reportOwner.Job_Category__c=='閿�鍞帹骞�',3,4)}" style="text-align:center; font-size: 20px;">璇烽�夋嫨鎶ヨ〃绫诲瀷</td></tr>
<tr height="20px"></tr>
<apex:outputPanel layout="none" rendered="{!if(reportOwner.Job_Category__c=='閿�鍞帹骞�',false,true)}">
@@ -1763,7 +1780,7 @@
<!-- //2021/01/27 liying start SWAG-BXL6KU -->
<apex:outputPanel layout="none" rendered="{!if(reportOwner.Job_Category__c=='閿�鍞帹骞�',true,false)}">
<tr>
- <td width="33.3%" style="text-align:center;"><input type="radio" name="OPD/SIS" value="SIS" onclick="changeOPDSISRecordName(this.value);" checked="checked" />OPD</td>
+ <td width="33.3%" style="text-align:center;"><input type="radio" name="OPD/SIS" value="SIS" checked="checked" onclick="changeOPDSISRecordName(this.value);"/>OPD</td>
<td width="33.3%" style="text-align:center;"><input type="radio" name="OPD/SIS" value="SIS_ET" onclick="changeOPDSISRecordName(this.value);"/>SIS-ET</td>
<td width="33.3%" style="text-align:center;"><input type="radio" name="OPD/SIS" value="SIS_ENG" onclick="changeOPDSISRecordName(
this.value);"/>SIS-ENG</td>
--
Gitblit v1.9.1