123
chenjingwu
2024-04-11 02d2d2591403e313e78c03905716c585ceed2965
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
import { LightningElement,wire,track } from 'lwc';
import { CurrentPageReference } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
import init from '@salesforce/apex/LexArriveGoodsController.init';
 
export default class LexArriveGoods extends NavigationMixin(LightningElement) {
    //页面变量
    @track arrType;
    @track eSetId;
    @track returnFLGbln = false;
    @track saveFLGbln = false;
    @track barcode;
    @track accountId;
    @track accountName;
    @track userProType;
    @track userProTypestr;
    @track productType;
    @track engFlag = false;
    @track etFlag = false;
    @track userWorkLocation;
    @track inventoryOrderId;
    @track returnOrderId;
    @track arriveId;
    @track productList;
    @track orderProductCunMap;
    @track orderProductArrivedCunMap;
    @track orderWantArriveCunMap;
    @track overOrderCunMap;
    @track overOrderBARcodeCunMap;
    @track showSpinner = true;
    @track showPage = true;
    //消耗品订单
    @track coc;
    //本次到货产品汇总
    @track detailsSummary;
    //到货明细
    @track consumableorderdetailsRecordsview;
    //返品明细
    @track showGoodsofReturnList;
    //入库明细
    @track consumableInventory;
    //错误明细
    @track consumableorderdetailsRecordserror;
 
    //本次到货产品汇总cols
    @track currentArrProdCols = [
        {label:'产品型号' , field:'assetModelNo', hideDefaultActions: true},
        {label:'产品名称' , field:'prodName', hideDefaultActions: true},
        {label:'到货数量' , field:'arrivedCount', hideDefaultActions: true},
        {label:'到货金额' , field:'arriveAmount', hideDefaultActions: true}
    ];
    //到货明细cols
    @track arrDetailCols = [
        {label:'消耗品名称' , field:'prodName', hideDefaultActions: true},
        {label:'规格' , field:'productPackingListManual', hideDefaultActions: true},
        {label:'CFDA状态' , field:'status', hideDefaultActions: true},
        {label:'注册证编码号' , field:'reportProductApprobation', hideDefaultActions: true},
        {label:'注册证效期' , field:'ReportProductExpirationDate', hideDefaultActions: true},
        {label:'BarCode' , field:'barCode', hideDefaultActions: true}
    ];
    //返品明细cols
    get returnDetailCols(){
        var cols = [];
        cols.push({label:'出库单' , field:'orderNo', hideDefaultActions: true});
        cols.push({label:'出库日' , field:'prodOutDate', hideDefaultActions: true});
        cols.push({label:'消耗品名称' , field:'prodName', hideDefaultActions: true});
        cols.push({label:'出库目的' , field:'summonsForDirctionDet', hideDefaultActions: true});
        cols.push({label:'客户名' , field:'hospitalName', hideDefaultActions: true});
        cols.push({label:'经销商' , field:'orderDealer', hideDefaultActions: true});
        cols.push({label:'BarCode' , field:'barCode', hideDefaultActions: true});
        cols.push({label:'使用期限' , field:'sterilizationLimit', hideDefaultActions: true});
        cols.push({label:'单位' , field:'boxPiece', hideDefaultActions: true});
        cols.push({label:'返品数量' , field:'returnCount', hideDefaultActions: true});
        cols.push({label:'返品原因' , field:'returnReason', hideDefaultActions: true});
        return cols;
    }
    //入库明细cols
    get inDetailCols(){
        var cols = [];
        cols.push({label:'消耗品名称' , field:'prodName', hideDefaultActions: true});
        cols.push({label:'BarCode' , field:'barCodeNo', hideDefaultActions: true});
        cols.push({label:'使用期限' , field:'sterilizationlimitDate', hideDefaultActions: true});
        cols.push({label:'serialNoorLotNo' , field:'serialNoorLotNo', hideDefaultActions: true});
        cols.push({label:'tracingCode' , field:'tracingCodeNo', hideDefaultActions: true});
        if(ReturnFLGbln){
            cols.push({label:'返品原因' , field:'ReturnReason', hideDefaultActions: true});
        }
        return cols;
    }
    //错误明细cols
    @track errorDetailCols = [
        {label:'消耗品订单' , field:'consumableOrderMinor', hideDefaultActions: true},
        {label:'消耗品名称' , field:'prodName', hideDefaultActions: true},
        {label:'BarCode' , field:'barCode', hideDefaultActions: true},
        {label:'单位' , field:'boxPiece', hideDefaultActions: true},
        {label:'数量' , field:'intMark', hideDefaultActions: true},
        {label:'错误原因' , field:'ErrorReason', hideDefaultActions: true}
    ];
 
    // 获取参数
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
        console.log('CurrentPageReference');
        if (currentPageReference) {
            this.arrType = currentPageReference.state?.ArrType;
            this.eSetId = currentPageReference.state?.ESetId;
        }
    }
 
    get showOrderDetail(){
        if(this.eSetId != '' && this.eSetId != null){
            return true;
        }else{
            return false;
        }
    }
 
    //初始化
    connectedCallback(){
        init({arrTypeStr:this.arrType, eSetIdStr:this.eSetId})
        .then(result=>{
            if(result.result == 'Success'){
                this.accountId = result.accountId;
                this.accountName = result.accountName;
                this.userProType = result.userProType;
                this.userProTypestr = result.userProTypestr;
                this.productType = result.productType;
                this.saveFLGbln = result.saveFLGbln;
                this.returnFLGbln = result.returnFLGbln;
                this.engFlag = result.engFlag;
                this.etFlag = result.etFlag;
                this.userWorkLocation = result.userWorkLocation;
                this.productList = result.productList;
                this.orderProductCunMap = result.orderProductCunMap;
                this.orderProductArrivedCunMap = result.orderProductArrivedCunMap;
                this.orderWantArriveCunMap = result.orderWantArriveCunMap;
                this.overOrderCunMap = result.overOrderCunMap;
                this.overOrderBARcodeCunMap = result.overOrderBARcodeCunMap;
                this.coc = result.coc;
            }else{
                this.showMyToast('初始化页面失败',result.errorMsg,'error');
            }
        })
        .catch(error=>{
            this.showMyToast('初始化页面失败',error,'error');
        })
    }
 
    //barcode change
    barcodeChange(event){
        this.barcode = event.detail.value;
    }
 
    //根据barcode搜索
    barcodeEntrys(){
 
    }
 
    showMyToast(title,message,variant){
        const evt = new ShowToastEvent({
           title : title,
           message: message,
           variant: variant
        });
        this.dispatchEvent(evt);
    }
}