From aebb2c4ece794a9fe486328c042e3dcd33f0ccd5 Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期四, 25 四月 2024 15:23:43 +0800
Subject: [PATCH] 123

---
 force-app/main/default/pages/AssetModifyBelongs.page |  183 ++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 154 insertions(+), 29 deletions(-)

diff --git a/force-app/main/default/pages/AssetModifyBelongs.page b/force-app/main/default/pages/AssetModifyBelongs.page
index e6f577c..57b81d8 100644
--- a/force-app/main/default/pages/AssetModifyBelongs.page
+++ b/force-app/main/default/pages/AssetModifyBelongs.page
@@ -1,14 +1,126 @@
-<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 = "";
     document.getElementById("allPage:allForm:allBlock:searchBlock:val1").value = "";
-    
     searchConsumableorderdetails();
 }
 var selectedSize = 0;
@@ -125,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();">
@@ -136,7 +248,7 @@
         </apex:actionFunction>
          <apex:actionFunction name="DelConsumable" action="{!DelConsumable}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter()">
         </apex:actionFunction>
-        <apex:actionFunction name="uploadingAttachmentJs" action="{!uploadingAttachment}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter()">
+        <apex:actionFunction name="uploadingAttachmentJs" action="{!uploadingAttachmentLightning}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter()">
         </apex:actionFunction>
         <apex:actionFunction name="returnChangePage" action="{!returnChangePage}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter()">
         </apex:actionFunction>
@@ -145,12 +257,11 @@
         </apex:actionFunction>
         <!-- <apex:actionFunction name="UnabletoEdit" action="{!UnabletoEdit}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI()">
         </apex:actionFunction> -->
-
         <apex:outputPanel id="allPanel">
             <apex:pageBlock id="allBlock" >
                 <apex:pageBlock id="EDCline_1" >
+                    <apex:commandButton style="display:none"/>
                     <apex:commandButton onclick="EditConsumable();"   value="缂栬緫" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!!(editAble)}"  disabled="{!IF(ambc.Change_status__c='宸叉彁浜�'||ambc.Change_status__c='鎵瑰噯'||ambc.Change_status__c='椹冲洖',true,false)}"/>
-                   
                     <apex:commandButton onclick="SorderJs();"         value="鎻愪氦璁㈠崟" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!!(editAble )}" disabled="{!IF(ambc.Change_status__c='宸叉彁浜�'||ambc.Change_status__c='鎵瑰噯',true,false)}"/>
                     <apex:commandButton onclick="saveJs();"           value="淇濆瓨鍙樻洿鐢宠鍗�" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!IF((editAble) && ambc.Change_status__c !='椹冲洖',true,false)}" />
                     <apex:commandButton onclick="saveJs();"           value="淇濆瓨鍙樻洿鐢宠鍗�" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!IF(ambc.Change_status__c='椹冲洖' && editAble,true,false)}" />
@@ -170,7 +281,7 @@
                             <col width="300px"/>
                         </colgroup>
 
-                        <tr>
+                        <tr style='line-height: 25px;'>
                             <td align="right" >鐢宠鍗曠紪鐮侊細</td>
                             <td align="left" ><apex:outputField id="OrderCode_out"  value="{!ambc.Name}" style="width:300px"/></td>
                             <td/>
@@ -178,7 +289,7 @@
                             <td align="left" ><apex:outputField id="OrderStatus_out" value="{!ambc.Change_status__c}" style="width:100px"/></td>
                             <td/>
                         </tr>
-                        <tr>
+                        <tr  style='line-height: 25px;'>
                             <td align="right" >鍘熷鎴凤細</td>
                             <td align="left" ><apex:outputField value="{!ambc.rawAccount__r.Name}"/></td>
                             <td/>
@@ -187,7 +298,7 @@
                             <td/>
                         </tr> 
                         
-                        <tr>
+                        <tr  style='line-height: 25px;'>
                             <apex:outputPanel rendered="{!checkUser}">
                                 <td align="right" >SPO琛ㄥ崟鍙凤細</td>
                                 <td align="left" ><apex:outputField value="{!ambc.SPOLink__c}"/></td>
@@ -200,7 +311,7 @@
                             </td>
                             <!-- CHAN-B9B68N Stop -->
                         </tr>
-                        <tr>
+                        <tr  style='line-height: 25px;'>
                             <td align="right">澶囨敞锛�</td>
                              <td align="left"><apex:outputField value="{!ambc.remark__c}" style="width:200px"/></td>
                             <!-- LZHU-BPJ8DF 20200513  Start -->
@@ -212,7 +323,7 @@
                             <!--  LZHU-BPJ8DF 20200513 End -->
                         </tr>
                         <!-- WLIG-BS7B4T ---20200806---update By rentongxiao---Start -->
-                        <tr>
+                        <tr  style='line-height: 25px;'>
                             <td align="right">鍏变韩锛�</td>
                              <td align="left"><apex:outputField value="{!ambc.share__c}" style="width:50px"/></td>
                             <td/>
@@ -223,8 +334,8 @@
                 <apex:pageBlock id="searchBlock" rendered="{!editAble}">
                     <table>
                         <colgroup>
-                            <col width="10px"/>
-                            <col width="10px"/>
+                            <col width="0px"/>
+                            <col width="0px"/>
                             <col width="60px"/>
                             <col width="85px"/>
                             <col width="60px"/>
@@ -241,17 +352,17 @@
                             <td align="right"></td>
                             <td></td>
                             <td/>
-                            <td align="right">閫夋嫨鏉′欢锛�</td>
+                            <td align="right">&nbsp;&nbsp;&nbsp;閫夋嫨鏉′欢锛�</td>
                             <td>
                              <apex:selectList value="{!text1}" id="text1" size="1" style="width:90px"><apex:selectOptions value="{!textOpts}"/>
                             </apex:selectList>
                             </td>                           
                             <td>
                             <apex:inputText value="{!val1}"
-                            id="val1" style="width:100px"/>
+                            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: 100px;" 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>
@@ -260,14 +371,23 @@
                         </tr>
                         <tr>
                             <td colspan="3"/>
-                            <td colspan="4">&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="width:200px"/></td>
+                            <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" 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  >
                             <apex:outputPanel rendered="{!checkUser}">
                                 <td colspan="3"/>
-                                <td colspan="4">SPO琛ㄥ崟鍙凤細<apex:inputText value="{!ambc.SPOLink__c}" style="width:200px"/></td>
+                                <td colspan="4">&nbsp;&nbsp;&nbsp;SPO琛ㄥ崟鍙凤細<apex:inputText value="{!ambc.SPOLink__c}" style="width:200px"/></td>
                             </apex:outputPanel>
                             <!-- CHAN-B9B68N Start -->
                             <td  colspan="4">鍙樻洿鍘熷洜锛�<!-- <apex:selectList value="{!ambc.ChangeReason__c}" id="changeReason01" size="1" style="width:204px"><apex:selectOptions value="{!changeReasonOpts}"/> --><apex:inputField value="{!ambc.ChangeReason__c}"></apex:inputField>
@@ -278,18 +398,19 @@
                         </tr>
                          <tr>
                             <td colspan="3"/>
-                                <td colspan="4">&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
-                                    &nbsp;澶囨敞锛�<apex:inputText value="{!ambc.remark__c}" style="width:200px"/></td>
+                            
+                                <td colspan="4" style="height:50px;">&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                    &nbsp;&nbsp;澶囨敞锛�<apex:inputText value="{!ambc.remark__c}" style="width:200px"/></td>
                              <!-- LZHU-BPJ8DF 20200513  Start -->
-                            <td colspan="4">鍙樻洿璁惧鎬绘暟锛�<apex:outputField value="{!ambc.DetailCnt__c}"/></td>
+                                <td colspan="4" style="height:50px;">鍙樻洿璁惧鎬绘暟锛�<apex:outputField value="{!ambc.DetailCnt__c}"/></td>
                             <!--  LZHU-BPJ8DF 20200513 End -->
-                        </tr>
+                            </tr>
                         <!-- WLIG-BS7B4T ---20200806---update By rentongxiao---Start -->
                          <tr>
                             <!-- 鍏变韩瀛楁鐨勫洖鏄� -->
                              <td colspan="3"/>
                                 <td colspan="4">&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
-                                    &nbsp;鍏变韩锛�<apex:inputCheckbox value="{!ambc.share__c}" style="width:50px"/>
+                                    &nbsp;&nbsp;&nbsp;鍏变韩锛�<apex:inputCheckbox value="{!ambc.share__c}" style="height:20px;width:20px"/>
                                 </td>
                                 <td colspan="4"></td>
                         </tr>
@@ -301,6 +422,7 @@
                  </apex:outputPanel>
                 <apex:pageBlock title="淇濇湁璁惧鎵�灞炲彉鏇存槑缁�" id="ConsumableorderdetailsSection">
                 <input type="hidden" id="allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsCount" value="{!ConsumableorderdetailsviewCount}" />
+                <input type="hidden" id="allPage:allForm:allBlock:ConsumableorderdetailsSection:Id" value="{!Id}" />
                     <table class="list" border="0" cellpadding="0" cellspacing="0">
                         <tr class="headerRow">
                             <apex:variable var="v" value="" rendered="{!editAble}">
@@ -339,20 +461,22 @@
                     </table>
 
                 </apex:pageBlock>
+                
                 <!-- CHAN-BC6BV2 XHL AddStart 20190522 -->
-                <apex:pageBlock title="闄勪欢" id="accessory" rendered="{!isShow}">
+                <apex:pageBlock title="鏂囦欢" id="accessory" rendered="{!isShow}">
                 
                     <apex:pageBlockButtons location="top">
-                        <apex:commandButton value="闄勪欢涓婁紶"  onclick="uploadingAttachmentJs();" disabled="{!IF(ambc.Change_status__c='宸叉彁浜�'||ambc.Change_status__c='鎵瑰噯',true,false)}"/>
+                        <apex:commandButton value="鏂囦欢涓婁紶"  onclick="uploadingAttachmentJs();" disabled="{!IF(ambc.Change_status__c='宸叉彁浜�'||ambc.Change_status__c='鎵瑰噯',true,false)}"/>
                     </apex:pageBlockButtons>
-                    <apex:pageBlockTable value="{!attachments}" var="attachment" >
+                    
+                    <apex:pageBlockTable value="{!contents}" var="attachment" >
                         
                         
                         <apex:column headerValue="鏍囬" style="width: 33%">
-                            <apex:outputField value="{!attachment.Name}"/>
+                            <apex:outputField value="{!attachment.Title}"/>
                         </apex:column>
                         <apex:column headerValue="涓婃淇敼鏃堕棿" style="width: 33%">
-                            <apex:outputField value="{!attachment.CreatedDate}"/>
+                            <apex:outputField value="{!attachment.ContentModifiedDate}"/>
                         </apex:column>
                         <apex:column headerValue="鍒涘缓浜�" style="width: 33%">
                             <apex:outputField value="{!attachment.OwnerId}"/>
@@ -365,5 +489,6 @@
         </apex:outputPanel>
     </apex:form>
 <script>
+
 </script>
 </apex:page>
\ No newline at end of file

--
Gitblit v1.9.1