From d3e4451e36fbe25da4427bccd4e6b41aefd473c8 Mon Sep 17 00:00:00 2001
From: binxie <137736985@qq.com>
Date: 星期一, 26 六月 2023 14:53:16 +0800
Subject: [PATCH] newclass0626formate
---
force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page | 82 +++++++++++++++++++++++++++++++----------
1 files changed, 62 insertions(+), 20 deletions(-)
diff --git a/force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page b/force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page
index c4a7688..eaa5ffe 100644
--- a/force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page
+++ b/force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page
@@ -3,7 +3,7 @@
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
- <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script>
+ <apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
<style>
.disabledbutton {
pointer-events: none;
@@ -11,13 +11,30 @@
}
</style>
<script>
+ AWSService.sfSessionId = '{!GETSESSIONID()}';
//Initial Required Information
var staticResources = JSON.parse('{!staticResource}');
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
+ var staticResourcesV2 = JSON.parse('{!staticResourceV2}');
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
var requiredFieldAPIList = JSON.parse('{!requiredFieldAPIListStr}');
var fieldAPIToLabelMap = JSON.parse('{!fieldAPIToLabelMapStr}');
var VLookUpFields = new Set(['Consum_Apply__c','Consum_Apply_Equipment_Set__c','Asset__c','Canceled__c','DeliverySlip__c','Return_DeliverySlip__c']);
var userVLookUpFields = ['Follower_User__c','Consum_Assign_Person__c','Asset_Center_Confirm_Staff__c','Return_Operator__c','Return_wh_chenk_staff__c','Cancel_Mem__c','Lost_item_check_staff__c','Lost_item_check_staff_Final__c'];
var redirectMode = 'Save';
+
+ function EditButton(isDisabled){
+ var topele = document.getElementById('topButtonRow');
+ var bottomele = document.getElementById('bottomButtonRow');
+
+ if (isDisabled) {
+ topele.classList.add("disabledbutton");
+ bottomele.classList.add("disabledbutton");
+ }else {
+ topele.classList.remove("disabledbutton");
+ bottomele.classList.remove("disabledbutton");
+ }
+ }
//Redirect Required Parameter
var redirectCallBack = function redirectCallBack(sfId, errorMessage) {
@@ -36,7 +53,8 @@
//Query Required Parameter
var queryBack = function queryBack(data) {
console.log('data = ' + data);
- document.querySelector("[data-id='Trial_User__c']").value = data.object.trialUser;
+ if(document.querySelector("[data-id='Trial_User__c']"))
+ document.querySelector("[data-id='Trial_User__c']").value = data.object.trialUser;
unblockUI();
};
@@ -48,14 +66,18 @@
console.log('Result from AWS' + JSON.stringify(r));
console.log('payloadJson=' + JSON.stringify(payloadJson));
payloadJson.Trial_User__c = r.object[0].trialUser;
- payloadJson.Trial_User_Encrypt__c = r.object[0].trialUserEncrypt;
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
+ //payloadJson.Trial_User_Encrypt__c = r.object[0].trialUserEncrypt;
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
payloadJson.AWS_Data_Id__c = '{!AWSDataId}';
if (isNewMode || {!isCloneMode}) {
payloadJson.AWS_Data_Id__c = r.object[0].dataId;
} else {
payloadJson.AWS_Data_Id__c = '{!AWSDataId}';
}
- debugger
+ if('{!rtTypeId}'){
+ payloadJson.RecordTypeId = '{!rtTypeId}';//Add by zhj for Record Type Issue 20220421
+ }
return payloadJson;
}
@@ -125,7 +147,8 @@
result[userVLookUpFields[i]] = userVlookUpNodeValue;
}
}
- result.Consum_Apply_Equipment_Set__c = document.querySelector('[data-id=Consum_Apply_Equipment_Set__c]').textContent;
+ debugger
+ //result.Consum_Apply_Equipment_Set__c = document.querySelector('[data-id=Consum_Apply_Equipment_Set__c]').textContent; //zhj MEBG 鏂版柟妗堟敼閫� 2022-12-02
console.log(JSON.stringify(result));
return result;
}
@@ -141,20 +164,28 @@
let obj = JSON.parse(payloadForNewPI);
obj[0].dataId = '{!AWSDataId}';
let payloadForNewPIJson = JSON.stringify(obj);
- AWSService.update(staticResources.updateUrl, consumApplyJson, payloadForNewPIJson, controllerSaveMethod, staticResources.token, staticResources.transactionUrl, false, insertOrUpdateBack, redirectCallBack);
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
+ //AWSService.update(staticResources.updateUrl, consumApplyJson, payloadForNewPIJson, controllerSaveMethod, staticResources.token, staticResources.transactionUrl, false, insertOrUpdateBack, redirectCallBack);
+ AWSService.update(staticResourcesV2.updateUrl, consumApplyJson, payloadForNewPIJson, controllerSaveMethod, staticResources.token, staticResources.transactionUrl, false, insertOrUpdateBack, redirectCallBack);
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
}
//Insert Sensitive Information to AWS
function NewPIToAWS(consumApplyJson, payloadForNewPI) {
let controllerSaveMethod = '{!$RemoteAction.NewConsumApplyEquipSetDetailController.saveConsumApply}';
- AWSService.insert(staticResources.newUrl, consumApplyJson, payloadForNewPI, controllerSaveMethod, staticResources.token, staticResources.transactionUrl, true, insertOrUpdateBack, redirectCallBack);
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
+ //AWSService.insert(staticResources.newUrl, consumApplyJson, payloadForNewPI, controllerSaveMethod, staticResources.token, staticResources.transactionUrl, true, insertOrUpdateBack, redirectCallBack);
+ AWSService.insert(staticResourcesV2.newUrl, consumApplyJson, payloadForNewPI, controllerSaveMethod, staticResources.token, staticResources.transactionUrl, true, insertOrUpdateBack, redirectCallBack);
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
}
//Check Required Fields
function checkRequiredFieldMsg(formData) {
let blankRequiredFields = '';
for (i = 0; i < requiredFieldAPIList.length; i++) {
- if (formData[requiredFieldAPIList[i]]) {
+ if (formData[requiredFieldAPIList[i]] && !VLookUpFields.has(requiredFieldAPIList[i])) {
+ continue;
+ }else if(VLookUpFields.has(requiredFieldAPIList[i]) && formData[requiredFieldAPIList[i]] != '000000000000000'){
continue;
} else {
if (blankRequiredFields == '') {
@@ -170,6 +201,8 @@
//Base Process
function saveConsumApplyProcess(saveMode) {
+ EditButton(true);
+
redirectMode = saveMode;
console.log('redirectMode' + redirectMode);
hiddenErrorMsgNode();
@@ -198,16 +231,17 @@
//Alert Error Message
function alertErrorMessage(errorMsg) {
- let errorMsgNode = document.getElementById("page:form:msgContent");
+ let errorMsgNode = document.getElementById("page:form:block:msgContent");
errorMsg = '閿欒锛氭棤鏁堟暟鎹��' + '\n' + errorMsg;
errorMsgNode.innerText = errorMsg;
errorMsgNode.className = 'pbError';
unblockUI();
+ EditButton(false);
}
//Hide Error Message
function hiddenErrorMsgNode() {
- let errorMsgNode = document.getElementById("page:form:msgContent");
+ let errorMsgNode = document.getElementById("page:form:block:msgContent");
errorMsgNode.innerText = '';
errorMsgNode.className = '';
}
@@ -233,11 +267,7 @@
<div class="ptBreadcrumb"></div>
</div>
<apex:form id="form">
- <!-- Error Msg-->
- <apex:outputPanel id="errorMsg">
- <apex:pageMessages id="msgContent" escape="false" />
- </apex:outputPanel>
- <apex:pageblock >
+ <apex:pageblock id="block">
<div class="pbHeader">
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
@@ -246,7 +276,7 @@
<img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
<h2 class="mainTitle">鑰楁潗澶囧搧閰嶅涓�瑙堟槑缁嗙紪杈�</h2>
</td>
- <td class="pbButton" id="topButtonRow">
+ <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
<input class="btn" type="Button" value="淇濆瓨" onclick="saveConsumApplyProcess('Save')" />
<input class="btn" type="Button" value="淇濆瓨骞舵柊寤�" onclick="saveConsumApplyProcess('SaveAndNew')" />
<apex:commandButton action="{!cancel}" value="鍙栨秷" />
@@ -255,14 +285,24 @@
</tbody>
</table>
</div>
+ <!-- Error Msg-->
+ <div style="text-align: center;">
+ <apex:outputPanel id="errorMsg">
+ <apex:pageMessages id="msgContent" escape="false" />
+ </apex:outputPanel>
+ </div>
<!-- Iterate the layoutSections, which is a list of sections -->
<apex:repeat value="{!layoutSections}" var="layoutSection">
<apex:pageBlockSection title="{!layoutSection.name}" collapsible="{!layoutSection.allowCollapse}" columns="{!layoutSection.columns}">
<!--Each section has layoutFields, let's iterate them as well-->
<apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
- <apex:inputField html-data-id="{!layoutField.fieldAPI}" value="{!Consum_Apply_Equipment_Set_Detail__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
+ <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Consum_Apply_Equipment_Set_Detail__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}"
required="{!layoutField.isRequired}" />
+ <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Consum_Apply_Equipment_Set_Detail__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&¬(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}"
+ required="{!layoutField.isRequired}" />
+ <apex:outputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Consum_Apply_Equipment_Set_Detail__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&¬(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}"
+ />
<apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
</apex:pageblocksectionitem>
</apex:repeat>
@@ -298,8 +338,10 @@
blockme();
QueryConsumApplyFromAWS();
};
- document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton");
-
+ //document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton");
+
+ document.getElementById('topButtonRow').style = '';
+聽 聽 聽 聽 聽 聽 聽document.getElementById('bottomButtonRow').style = '';
//zhj 2022/04/11 start
// jQuery(".lookupInput").each(function(i,e){
// let je =jQuery(e).find('input');
@@ -339,7 +381,7 @@
<tr>
<td class="pbTitle">
<img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" /> </td>
- <td class="pbButtonb" id="bottomButtonRow">
+ <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
<input class="btn" type="Button" value="淇濆瓨" onclick="saveConsumApplyProcess('Save')" />
<input class="btn" type="Button" value="淇濆瓨骞舵柊寤�" onclick="saveConsumApplyProcess('SaveAndNew')" />
<apex:commandButton action="{!cancel}" value="鍙栨秷" />
--
Gitblit v1.9.1