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); } }