buli
2023-04-21 43fdbff49764d55c7b3a19a1d6e7d8aeb62072ef
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
import { LightningElement,wire,api,track } from 'lwc';
import { CurrentPageReference } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
import init from '@salesforce/apex/LexArriveGoodsMainController.init';
import searchConsumableorderdetails from '@salesforce/apex/LexArriveGoodsMainController.searchConsumableorderdetails';
 
export default class LexArriveGoodsMain extends NavigationMixin(LightningElement) {
    //页面基础变量
    @track agencyProType;
    @track category1;
    @track cate2;
    // @track eSetId;
    @track accountId;
    @track title = [];
    @track raesList = [];
    @track userWorkLocation;
    @track totalNum;
    @track orderNumberArrived;
    @track deliveryDetailCount;
    @track orderNumberNotarrive;
    @track moreThanSevenDays;
    @track showSpinner = true;
    @track showPage = true;
 
    //获取参数
    // @wire(CurrentPageReference)
    // getStateParameters(currentPageReference) {
    //     console.log('CurrentPageReference');
    //     if (currentPageReference) {
    //         this.eSetId = currentPageReference.state?.ESetid;
    //     }
    // }
   
    //初始化
    connectedCallback(){
        init()
            .then(result=>{
                if(result.result == 'Success'){
                    this.agencyProType = result.agencyProType;
                    this.accountId = result.accountId;
                    this.title = result.title;
                    this.raesList = result.raesList;
                    this.userWorkLocation = result.userWorkLocation;
                    this.totalNum = result.totalNum;
                    this.orderNumberArrived = result.orderNumberArrived;
                    this.deliveryDetailCount = result.deliveryDetailCount;
                    this.orderNumberNotarrive = result.orderNumberNotarrive;
                    this.moreThanSevenDays = result.moreThanSevenDays;
                    this.showSpinner = false;
                    this.showPage = true;
                }else{
                    this.showSpinner = false;
                    console.log("Error:"+result.errorMsg);
                    this.showMyToast('初始化页面失败',result.errorMsg,'error');
                }
            })
    }
 
    //消耗品订单名称变更
    category1Change(event){
        this.category1 = event.detail.value;
    }
    
    //最新发货日期变更
    cate2Change(event){
        this.cate2 = event.detail.value;
    }
    
    //检索
    search(){
        
    }
    
    //清空搜索框
    clear(){
        
    }
 
    //入库
    orderArrive(){
    
    }
    
    //返品
    orderReturn(){
        
    }
 
    showMyToast(title,message,variant){
        const evt = new ShowToastEvent({
           title : title,
           message: message,
           variant: variant
        });
        this.dispatchEvent(evt);
    }
}