FUYU
2023-12-18 b329ab986e250bb27e46ace97cf208f3b26d145a
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import { getRecord } from 'lightning/uiRecordApi';
import init from '@salesforce/apex/lexCopyToBaseController.init';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class lexCopyToBase extends NavigationMixin(LightningElement) {
    @api recordId;
    dateF;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
        if (currentPageReference) {
          const urlValue = currentPageReference.state.recordId;
          if (urlValue) {
            let str = `${urlValue}`;
            this.recordId = str;
          }
        }
    }
    connectedCallback(){
      Promise.all([
          loadStyle(this, lwcCSS)
      ]);
      init({
          recordId: this.recordId
      }).then(result=>{
          this.dateF = result;
          this.createOPDFromRentalApply().then(res=>{
            this.dispatchEvent(new CloseActionScreenEvent());
          });
      });
    }
    async createOPDFromRentalApply(){
      let tt='dd';
          const data = encodeDefaultFieldValues({
              Lead_CreateBy__c:'',
              Lead_CreateDate__c:'',
              Estimation_No__c:'',
              Estimation_Name__c:'',
              Estimation_List_Price__c:'',
              Agency1__c:'',
              Sales_Contract_No__c:'',
              Agency2__c:'',
              Bid_Publish_Date__c:'',
              Bidding_Company__c:'',
              Bidding_No__c:'',
              Bidding_Project_Name__c:'',
              Bidding_Content__c:'',
              Bid_Planned_Date__c:'',
              Closing_Bid_Company__c:'',
              Closing_Bid_Price__c:'',
              Opp_Confirmation_Day__c:'',
              Last_Follow_Up_Date__c:'',
              Estimation_Proposal_Date__c:'',
              Authorized_Date__c:'',
              Autholization_Activated_Date__c:'',
              Bid_Date__c:'',
              Closing_Bid_Date__c:'',
              Assistant_Applied_Date__c:'',
              Contract_DB_SalesDept_complite_day__c:'',
              Contract_DB_complite_day__c:'',
              Agency_Contract_Date1__c:'',
              SAP_Send_OK_Date__c:'',
              Sales_Shop_Hospital_Contract__c:'',
              Forecast_Collect_Money__c:'',
              Contract_Invalid_Date__c:'',
              Next_action__c:'',
              Follow_up_comment__c:'',
              Xin_Gross_Follow_Num__c:'',
              OPD1__c:'',
              Num_Of_OPD__c:'',
              OPD_SIS_collect_evaluation_sight__c:'',
              Detail_Suggestion__c:'',
              Num_Of_NTC__c:'',
              Deleted_Reason__c:'',
              Lost_Opportunity_Date__c:'',
              opp14:'',
              Request_quotation_update__c:'',
              old_Oppo_No__c:'',
              Oppor_Number_Report__c:'',
              Manager_name_text__c:'',
              Sales_assistant_name_text__c:'',
              Sales_window_text__c:'',
              If_Authorizing__c:'',
        Opportunity_No__c:'',
        Collect_Customer_sign__c:'',
        Estimation_Decision__c:'',
        SAP_Send_OK__c:'',
        Authorized_DB_No__c:'',
        NotesApprovedNo__c:'',
        is_CheckTarget_TF__c:'',
        Whether_FALSE_order__c:'',
        Stock_apply_status__c:'',
        Stock_apply_time__c:'',
        Stock_apply_passtime__c:'',
        Stock_cancel_reason__c:'',
        Stock_cancel_reason_text__c:'',
        Stock_Confrim_Date__c:'',
        Last_opportunity_file__c:'',
        Application_Amount_Submit__c:'',
        Agency_Opportunity__c:'',
        Budget_Amount_Approval__c:'',
        Hospital_Budget__c:'',
        Key_tipics_last_update_day__c:'',
        Lead_Num__c:'',
        opp6:'',
        opp17:'',
        Other_Society__c:'',
        Contract_DB_Finalcomplite_day__c:'',
        Contract_Authorize_Lock__c:'',
        Old_Opportunity_ID__c:'',
        LeadSource:'',
        Authorized_Finish_Sales__c:'',
        IsAuthorized__c:'',
      });
      console.log(this.dateF+","+data);
      this[NavigationMixin.Navigate]({
          type: 'standard__objectPage',
          attributes: {
              objectApiName: 'Opportunity', // 要新建的对象API
              actionName: 'new',
          },
          state:{
              nooverride: '1',
              defaultFieldValues:this.dateF+","+data
          }
      });
    }
}