buli
2023-06-05 cb95755fe8496d8af6d40b05c4bbd4b6df2e77ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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 编辑画面';
        }
 
    }
}