From 2f183a6b0a83ec3f7d35375d5d25d200efc2a3e1 Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期二, 19 四月 2022 18:46:18 +0800
Subject: [PATCH] 20220419FixIssue
---
force-app/main/default/pages/NewRepair.page | 68 ++++++++++++++++++++++++++++------
1 files changed, 56 insertions(+), 12 deletions(-)
diff --git a/force-app/main/default/pages/NewRepair.page b/force-app/main/default/pages/NewRepair.page
index 3cafc75..642fc66 100644
--- a/force-app/main/default/pages/NewRepair.page
+++ b/force-app/main/default/pages/NewRepair.page
@@ -30,14 +30,26 @@
//Redirect Required Parameter
var redirectCallBack = function redirectCallBack(sfId, errorMessage) {
- if (sfId) {
- if (redirectMode == 'Save') {
- window.open('/' + sfId, '_self');
- } else if (redirectMode == 'SaveAndNew') {
- window.open('/setup/ui/recordtypeselect.jsp?ent=' + '{!sobjectId}' + '&retURL=/' + '{!sobjectPrefix}' + '/o&save_new_url=/' + '{!sobjectPrefix}' + '/e?retURL=%2F' + '{!sobjectPrefix}' + '%2Fo', '_self');
- }
- } else {
- // alert(errorMessage);
+ if(sfId){
+ Visualforce.remoting.Manager.invokeAction(
+ 'NewRepairController.EncryptUpdate', // example
+ sfId,
+ function (result, event) {
+ console.log(result);
+ if(result.message){
+ alert(result.message);
+ }
+ if (redirectMode == 'Save') {
+ window.open('/' + sfId, '_self');
+ } else if (redirectMode == 'SaveAndNew') {
+ window.open('/setup/ui/recordtypeselect.jsp?ent=' + '{!sobjectId}' + '&retURL=/' + '{!sobjectPrefix}' + '/o&save_new_url=/' + '{!sobjectPrefix}' + '/e?retURL=%2F' + '{!sobjectPrefix}' + '%2Fo', '_self');
+ }
+
+ },
+ { escape: true }
+ );
+
+ }else{
alertErrorMessage(errorMessage);
}
}
@@ -211,6 +223,10 @@
if(e){
result.Repair_Determine_result_ConfirmationUser__c = e.value;
}
+ //鏈慨鐞嗗綊杩樼悊鐢�
+ if(api_id_map['Return_Without_Repair_Reason__c']){
+ result.Return_Without_Repair_Reason__c = document.getElementById(api_id_map['Return_Without_Repair_Reason__c']).value!='_\x01_'?document.getElementById(api_id_map['Return_Without_Repair_Reason__c']).value:'';
+ }
console.log(JSON.stringify(result));
return result;
}
@@ -348,7 +364,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="saveRepairProcess('Save')" />
<input class="btn" type="Button" value="淇濆瓨骞舵柊寤�" onclick="saveRepairProcess('SaveAndNew')" />
<apex:commandButton action="{!cancel}" value="鍙栨秷" />
@@ -369,8 +385,12 @@
<!--Each section has layoutFields, let's iterate them as well-->
<apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
- <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Repair__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
+ <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Repair__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}"
required="{!layoutField.isRequired}" />
+ <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Repair__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="{!Repair__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&¬(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}"
+ />
<apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
</apex:pageblocksectionitem>
</apex:repeat>
@@ -429,7 +449,10 @@
unblockUI();
};
if(document.querySelector("[data-id='OwnerId']") != null)
- document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton");
+ document.querySelector("[data-id='OwnerId']").classList.add("disabledbutton");
+
+ document.getElementById('topButtonRow').style = '';
+聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 document.getElementById('bottomButtonRow').style = '';
let previous_value = {};
jQuery(".lookupInput input").each(function(i,e){
@@ -448,6 +471,27 @@
}
})
})
+
+ //缁翠慨涓績
+ if('{!workLocationSelect}' != ''){
+ let wlNode = document.getElementById(api_id_map['work_location_select__c']);
+ if(wlNode){
+ wlNode.removeAttribute("disabled")
+ var o = new Option()
+ o.text = '{!workLocationSelect}'
+ wlNode.options.add(o)
+ wlNode.value = '{!workLocationSelect}'
+ }
+ }
+
+ //濡傛灉浠庢姤淇瓙鍗曡繃鏉ワ紝闇�瑕佽В瀵嗘姤淇汉
+ if('{!RepairSubOrderAWSDataId}' != ''){
+ var staticResourceRepairSubOrder = JSON.parse('{!staticResourceRepairSubOrder}');
+ let queryBackRepairSubOrder = function queryBackRepairSubOrder(data) {
+ document.querySelector("[data-id='RepairApplicant__c']").value = data.object.repairApplicantName;
+ };
+ AWSService.query(staticResourceRepairSubOrder.queryUrl, '{!RepairSubOrderAWSDataId}', queryBackRepairSubOrder, staticResourceRepairSubOrder.token);
+ }
// jQuery(".lookupInput").each(function(i,e){
// let je =jQuery(e).find('input');
@@ -486,7 +530,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="saveRepairProcess('Save')" />
<input class="btn" type="Button" value="淇濆瓨骞舵柊寤�" onclick="saveRepairProcess('SaveAndNew')" />
<apex:commandButton action="{!cancel}" value="鍙栨秷" />
--
Gitblit v1.9.1