FUYU
2023-05-19 559771a80cf779dc13a84ecd2f178e6ca5a8353a
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,6 +62,7 @@
            var tempActId = '';
            var tempRecordTypeName = '';
            var tempBtnIdHidden = '';
            var OPDId = ''; //2022-4-17 yjk 将OPDID带上
            var tempRedId = '';
            var tempReportId = '';
            var hiddenDivShowFlg = false;
@@ -80,6 +81,34 @@
                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){
@@ -95,7 +124,8 @@
                        }                    
                    }
                    console.log('AWS Result:'+JSON.stringify(sfIdToContactInfo));
                    let allSizeForAct =document.getElementById('Page:mainForm:idDayEdit:AllSize').value;
                    // 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++){
@@ -105,7 +135,9 @@
                                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 = '';
                            }
                        }
                    }                                       
                };
@@ -599,7 +631,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
@@ -1126,7 +1160,7 @@
                                        <th>{!$Label.Free_Input}&nbsp;&nbsp;<apex:inputField id="idFree_Input__c" value="{!a.act.Free_Input__c}" onClick="if(vpChack({!a.index})) return false;setVisitorPlaceDisabled();"/>&nbsp;&nbsp;</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>
@@ -1201,9 +1235,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>使用报告书 &nbsp;&nbsp; <apex:inputField value="{!a.act.UseReport__c}"></apex:inputField>&nbsp;&nbsp;<apex:inputHidden id="EventCSLAInfoId" value="{!a.act.SLAReportInfo__c}" />
                                        <!-- 2022-06-17 yjk -->
                                        <!-- <th>使用报告书 &nbsp;&nbsp; <apex:inputField value="{!a.act.UseReport__c}"></apex:inputField>&nbsp;&nbsp;<apex:inputHidden id="EventCSLAInfoId" value="{!a.act.SLAReportInfo__c}" />
                                        <apex:inputHidden id="isDisabledVisitorPlace" value="{!a.isDisabledVisitorPlace}" />
                                        </th>
                                        -->
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
@@ -1227,9 +1263,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>&nbsp;</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;">使用报告书 &nbsp;&nbsp; <apex:inputField value="{!a.act.UseReport__c}"></apex:inputField>&nbsp;&nbsp;<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>
@@ -1307,23 +1347,26 @@
                                    <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>&nbsp;</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>
                                        <!-- //2022-4-17 yjk 将OPDID带上 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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</td>
                                        <!-- //2022-4-17 yjk 将OPDID带上 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"/>
                                        </td> -->
                                        <td>&nbsp;</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>
@@ -1624,7 +1667,7 @@
                                <td>&nbsp;</td>
                                <td><apex:commandButton value="{!$Label.Add_Line}" id="idAddAct" action="{!addActivity}" 
                                    reRender="Activities,idAddActPanel" onClick="blockme();"
                                     onComplete="bindAllDoubleTap();setVisitorPlaceDisabled();unblockUI();initSetPage();"
                                     onComplete="bindAllDoubleTap();setVisitorPlaceDisabled();unblockUI();initSetPage();refreshContactAll();"
                                     style="width:100px;display:{!IF(actSize>14,'none','')}"/></td>
                                <th>&nbsp;</th>
                                <td>&nbsp;</td>
@@ -1710,6 +1753,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)}">
@@ -1731,7 +1775,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>