buli
2023-07-11 0c4796706fc9473d069b620321a54b20a119906c
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
import { LightningElement, track, wire } from 'lwc';
import init from '@salesforce/apex/ContractdetailpdfController.init';
const columns = [
    { label: 'Item_Order__c', fieldName: 'Item_Order__c' },
    { label: 'Asset_Model_No_forPrint__c', fieldName: 'Asset_Model_No_forPrint__c' },
    { label: 'NameForPrintDelimiter__c', fieldName: 'NameForPrintDelimiter__c' },
    { label: 'NameForPrint__c', fieldName: 'NameForPrint__c' },
    { label: 'ApprobationNo_c', fieldName: 'ApprobationNo_c' },
    { label: 'ProduceCompany_c', fieldName: 'ProduceCompany_c' },
    { label: 'SalesPackagingUnit_c', fieldName: 'SalesPackagingUnit_c' },
    { label: 'PackingListManual_c', fieldName: 'PackingListManual_c' },
    { label: 'qli.Quantity', fieldName: 'qli.Quantity' },
    { label: 'qli.GuaranteePeriod__c', fieldName: 'qli.GuaranteePeriod__c' },
    { label: 'qli.DeliveryDate__c', fieldName: 'qli.DeliveryDate__c', type: 'date'  }
    // { label: 'Website', fieldName: 'Asset_Model_No_forPrint__c', type: 'url' },
    // { label: 'Phone', fieldName: 'phone', type: 'phone' },
    // { label: 'Balance', fieldName: 'amount', type: 'currency' },
    // { label: 'CloseAt', fieldName: 'closeAt', type: 'date' },
];
export default class lexContractdetailpdf extends LightningElement {
    items = [];
    data=[];
    Contract_Detail_Title="标题";
    columns=columns ;
    params={
        trade:false,
        PurchaseType:false
    };
    connectedCallback() {
        init().then(res=>{
            console.log("res:");
            console.log(res);
            this.data=res;
            this.items=res;
        })
    }
    generateData( amountOfRecords ) {
        return [...Array(amountOfRecords)].map((_, index) => {
            return {
                name: `Name (${index})`,
                website: 'www.salesforce.com',
                amount: Math.floor(Math.random() * 100),
                phone: `${Math.floor(Math.random() * 9000000000) + 1000000000}`,
                closeAt: new Date(
                    Date.now() + 86400000 * Math.ceil(Math.random() * 20)
                ),
            };
        });
    }
}