19626
2023-09-09 e14d6d0619330cad423f06493e3aa2371faa2a8f
force-app/main/default/pages/AssetModifyBelongs.page
@@ -1,12 +1,122 @@
<apex:page standardController="AssetModifyBelongsChange__c" extensions="AssetModifyBelongsController" showHeader="false" sidebar="false" id="allPage" action="{!init}" title="最终用户变更申请" lightningStylesheets="true">
<apex:page standardController="AssetModifyBelongsChange__c"  extensions="AssetModifyBelongsController" showHeader="false" sidebar="false" id="allPage" action="{!init}" title="最终用户变更申请" lightningStylesheets="true">
<apex:slds />
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:stylesheet value="{!URLFOR($Resource.StyleUtilCss)}"/>
<apex:includeScript value="{!$Resource.SLDSDynamicLookupScript}"/>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/>
<script>
             //2023 08 30 张赫阳 PIPL页面改造 start
        var AWSDataId = '';
        //2023 08 30 张赫阳 PIPL页面改造 end
        let inputHiddenId='allPage:allForm:AccountField__c';
        //2023 08 30 张赫阳 PIPL页面改造 start
        function Query2(){
        }
        let newSearchContactWindow = null;
        function searchContact() {
                    let accountValue = '{!ambc.AccountField__c}';
                    let searchContactKeyWord = document.getElementById("allPage:allForm:allBlock:searchBlock:OEC").value;
                    let responsibleNodeId = document.getElementById("allPage:allForm:AccountField__c").value;
                    let ObjectType = 'Account';
                    let FieldNameList = '姓名,Id';
                    let FieldApiNameList = 'Name,Id';
                    let QueryFieldName = '姓名';
                    let QueryFieldApiName = 'Name';
                    let QuertLimit='recordTypeId in '+
                    '(\\\'01210000000Qfmb\\\',\\\'01210000000QfmR\\\',\\\'01210000000QfmM\\\',\\\'01210000000QfmH\\\''+
                    ',\\\'01210000000QfmC\\\',\\\'01210000000Qfm7\\\',\\\'01210000000Qfm2\\\',\\\'01210000000QemQ\\\')';
                    // let QuertLimit='';
                    console.log(accountValue);
                    if (accountValue != '000000000000000') {
                        let baseUrl = "/apex/SearchContactPageLWC";
                        let suffixUrl = "?contactId=" + responsibleNodeId + "&accountId=" + accountValue+"&searchContactKeyWord=" + searchContactKeyWord+"&Type=OFS" + '&ObjectType=' + ObjectType + '&FieldNameList=' + FieldNameList + '&FieldApiNameList=' + FieldApiNameList + '&QueryFieldName=' + QueryFieldName + '&QueryFieldApiName=' + QueryFieldApiName + '&QuertLimit=' + encodeURI(QuertLimit) + '&inputHiddenId=' +inputHiddenId;
                        let newSearchContactParam = 'height=600,width=800,left=100,top=100,dialogHide=true,resizable=no,scrollbars=yes,toolbar=no,status=no';
                        newSearchContactWindow = window.open(baseUrl + suffixUrl, 'Popup', newSearchContactParam);
                        if (window.focus) {
                            newSearchContactWindow.focus();
                        }
                        return false;
                    } else {
                        alertErrorMessage('请先选择医院名');
                    }
        }
        function closePopupWindow() {
            console.log('close1');
            if (null != newSearchContactWindow) {
                newSearchContactWindow.close();
            }
            console.log('close2');
            let contactInfoStr = document.getElementById('allPage:allForm:AccountField__c').value;
            console.log('closePopup:' + contactInfoStr);
            let contactInfo = JSON.parse(contactInfoStr);
            document.getElementById("allPage:allForm:allBlock:searchBlock:OEC").value = contactInfo.Name;
            document.getElementById(document.getElementById("allPage:allForm:allBlock:searchBlock:OEC").id + '_lkold').value = contactInfo.Name;
            document.getElementById(document.getElementById("allPage:allForm:allBlock:searchBlock:OEC").id + '_lkid').value = contactInfo.Id;
            document.getElementById('allPage:allForm:AccountField__c').value = contactInfo.Id;
            AWSDataId = contactInfo.AWSDataId;
            console.log('AWSDataId = ' + AWSDataId);
        }
        j$(function(){
            Query2();
            replaceSearchContactLookup();
        })
        function replaceSearchContactLookup() {
            console.log('enter replaceSearchContactLookup');
            document.getElementById("allPage:allForm:allBlock:searchBlock:OEC").parentNode.children[2].removeAttribute("href");
            console.log(document.getElementById("allPage:allForm:allBlock:searchBlock:OEC"));
            document.getElementById("allPage:allForm:allBlock:searchBlock:OEC").parentNode.children[2].onclick = function() {
                searchContact();
            };
        }
//2023 08 30 张赫阳 PIPL页面改造 end
function cg(){
    var input=document.getElementById("allPage:allForm:allBlock:searchBlock:OEC");
    // console.log(cam);
    // console.log(document.getElementById("allPage:allForm:allBlock:searchBlock:OEC_lkid"));
    // console.log(cam.classList.add("slds-lookup__menu"));
    // input.classList.add("slds-form-element_stacked");
    // console.log(input);
              // 获取inputField组件
    // let td = document.querySelector("td[colspan='4']");
    // let input = td[1].querySelector("input[id$='OEC']");
    console.log(input);
    input.classList.add("slds-input");
    input.style.boxShadow = "0 2px 3px #F7F7F7";
  input.addEventListener('click', (event) => {
  // 阻止默认弹出默认搜索框
  event.preventDefault();
  // 弹出层元素
  const popup = input.querySelector('.lookupInput');
  // 添加Lightning样式类
  popup.classList.add('slds-dropdown');
  popup.classList.add('slds-combobox');
  // 输入框
  const searchInput = popup.querySelector('input');
  searchInput.classList.add('slds-input');
  // 调整DOM结构
  // ......
  // 删除默认样式
  popup.classList.remove('xx-class');
  // 设置CSS样式
  searchInput.style.boxShadow = '0 2px 3px #f7f7f7';
  // 弹出层显示
  popup.style.display = 'block';
});
};
function ClearJs(){
    blockme();
    document.getElementById("allPage:allForm:allBlock:searchBlock:text1").value = "";
@@ -127,7 +237,7 @@
    }
</style>
    <apex:form id="allForm">
        <apex:inputHidden value="{!ambc.AccountField__c}" id="AccountField__c" />
        <apex:actionFunction name="save" action="{!save}" rerender="editAble,ConsumableorderdetailsSection, message,editAble" onComplete="unblockUI();CheckStatusAfter();">
        </apex:actionFunction>
        <apex:actionFunction name="Sorder" action="{!Sorder}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter();init();">
@@ -252,7 +362,7 @@
                            id="val1" style="width:200px"/>
                            </td>
                            <td align="left"><div id="seachdiv">合同编码精确查询<apex:inputCheckbox value="{!checkexact}" id="RowCheckbox"/></div></td>
                            <td><apex:commandButton value="保有设备搜索" style="width: 120px;" onclick="searchProductJs('0');return false;" /></td>
                            <td><apex:commandButton value="保有设备搜索" style="width: 120px;padding-right: 10px" onclick="searchProductJs('0');return false;" /></td>
                            <td><input type="button" value="清空" style="width: 100px;" onclick="ClearJs();return false;" class="btn"/></td>
                            <td/>
                        </tr>
@@ -262,7 +372,16 @@
                        <tr>
                            <td colspan="3"/>
                            <td colspan="4" style="height:50px;">&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;原客户:<apex:outputField value="{!ambc.rawAccount__c}"/></td>
                            <td colspan="4">目标客户:<apex:inputField id="OEC" value="{!ambc.AccountField__c}" style="height:25px;width:200px"/></td>
                            <!-- <td colspan="4">目标客户:<apex:inputField  id="OEC" value="{!ambc.AccountField__c}"  style="height:25px;width:200px"/></td> -->
                            <td colspan="4" style="height:50px;display: flex;flex-direction:column;justify-content:center;">
                                <div style="display: flex;flex-direction:row;justify-content:flex-start;">
                                    <div style="height:50px;display: flex;flex-direction:column;justify-content:center;">目标客户:</div>
                                    <div style="height:50px;display: flex;flex-direction:column;justify-content:center;padding-bottom: 10px">
                                        <c:SLDSDynamicLookup SLDSResourceName="{!$Resource.SLDS}" ObjectApiName="Account" DisplayFieldApiNames="Name" DisplayFieldsPattern="Name"  LabelName="Name" SetValueToField="{!ambc.AccountField__c}" setStyleCss="width:300px;"/>
                                    </div>
                                </div>
                            </td>
                        </tr>
                       
                        <tr  >