import { LightningElement,wire,track,api} from 'lwc';
|
import { getRecord } from 'lightning/uiRecordApi';
|
import { updateRecord } from 'lightning/uiRecordApi';
|
import { NavigationMixin } from 'lightning/navigation';
|
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
|
import { getObjectInfo } from 'lightning/uiObjectInfoApi';
|
import { createRecord } from 'lightning/uiRecordApi';
|
import { refreshApex } from '@salesforce/apex';
|
import { reduceErrors } from 'c/ldsUtils';
|
import { FlowAttributeChangeEvent } from 'lightning/flowSupport';
|
import { CurrentPageReference } from "lightning/navigation";
|
import { CloseActionScreenEvent } from 'lightning/actions';
|
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
|
import { OutputField } from 'lightning/uiRecordApi';
|
import init from '@salesforce/apex/lexRepPAEDecisionRecordController.init';
|
|
export default class lexRepPAEDecisionRecord extends LightningElement {
|
@api recordId;
|
@track buttonStyle;
|
isLoading = false;
|
rdRecord = {
|
PAE_reappear_confirm__c:'',
|
PAE_ConfirmationDate__c:'',
|
PAE_Authenticator__c:'',
|
PAEDetail_DetermineResults__c:''
|
|
};
|
isASRCDecision = false;
|
isASACDecision = true;
|
rdDate;
|
rdUser;
|
Title;
|
buttonshow = false;
|
buttonshow1 = false;
|
buttonshow2 = false;
|
OCSM_QARA;
|
repa = '1';
|
ReportId = '1';
|
|
|
|
get reappearConfirmStyle() {
|
return `color: ${this.rdRecord.PAE_reappear_confirm__c === '未确认' ? 'red' : ''}; font-weight: ${this.rdRecord.PAE_reappear_confirm__c === '未确认' ? '800' : 'normal'};`;
|
}
|
|
get reappearConfirmValue() {
|
return this.rdRecord.PAE_reappear_confirm__c;
|
}
|
|
handleClick() {
|
const event = new CustomEvent('intakeclick');
|
this.dispatchEvent(event);
|
}
|
@wire(CurrentPageReference)
|
getStateParameters(currentPageReference) {
|
if (currentPageReference) {
|
const urlValue = currentPageReference.state.recordId;
|
if (urlValue) {
|
let str = `${urlValue}`;
|
this.recordId = str;
|
}
|
}
|
}
|
|
connectedCallback() {
|
init().then(result =>{
|
if (this.isASRCDecision == true && this.isASACDecision == false) {
|
this.rdDate = result.RCDate;
|
this.rdUser = result.RAtor;
|
}
|
if (this.isASRCDecision == false && this.isASACDecision == true) {
|
this.rdDate = result.OCSMDate;
|
this.rdUser = result.OCSMuser;
|
}
|
this.rdRecord.PAE_reappear_confirm__c = '未确认';
|
this.rdRecord.PAE_ConfirmationDate__c =new Date();;
|
this.rdRecord.PAE_Authenticator__c = '黄千龙';
|
this.rdRecord.PAEDetail_DetermineResults__c = 'nonPAE';
|
this.verificButton();
|
}).catch(error => {
|
console.log("error");
|
console.log(error.message());
|
});
|
|
}
|
|
verificButton(){
|
if (this.isASACDecision && this.rdRecord.PAE_reappear_confirm__c == '未确认') {
|
this.buttonshow = true;
|
}
|
if (this.isASACDecision && this.repa !=null ) {
|
this.buttonshow1 = true;
|
}
|
if ((this.OCSM_QARA == '1' && this.isASRCDecision && this.repa !=null)|| (this.isASRCDecision && this.ReportId !=null)) {
|
this.buttonshow2 = true;
|
}
|
this.buttonStyle = this.rdRecord.PAE_reappear_confirm__c === '未确认'
|
? 'margin-left: 30px; float: right; color: red;'
|
: 'margin-left: 30px; float: right;';
|
if (this.isASRCDecision == true) {
|
this.Title = 'Intake universal code 编辑画面';
|
}
|
if (this.isASACDecision == true) {
|
this.Title = 'Final universal code 编辑画面';
|
}
|
|
}
|
}
|