| | |
| | | import initNotArrDetAll from '@salesforce/apex/LexConsumableGoodsInfo.initNotArrDetAll'; |
| | | import initMoreThan7 from '@salesforce/apex/LexConsumableGoodsInfo.initMoreThan7'; |
| | | import initMoreThan7All from '@salesforce/apex/LexConsumableGoodsInfo.initMoreThan7All'; |
| | | //table css |
| | | import { loadStyle } from "lightning/platformResourceLoader"; |
| | | import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable"; |
| | | |
| | | export default class LexArriveGoodsMain extends NavigationMixin(LightningElement) { |
| | | //页面基础变量 |
| | |
| | | @track showPage = false; |
| | | @track showPop = false; |
| | | @track popTitle; |
| | | stylesLoaded = false; |
| | | //是否一直显示提示 |
| | | @track isNoteStay = true; |
| | | |
| | | @track colms = [ |
| | | // {label:'消耗品订单名称',fieldName:'Name'}, |
| | |
| | | type: 'Title', |
| | | recordId: { fieldName: "Id" } |
| | | }, |
| | | hideDefaultActions: true,initialWidth:180}, |
| | | hideDefaultActions: true,initialWidth:200}, |
| | | {label:'SAP合同号',fieldName:'ContractNo__c',hideDefaultActions: true}, |
| | | {label:'订单总数', |
| | | type: "customOutputGood", |
| | |
| | | type: 'TotalNum', |
| | | recordId: { fieldName: "Id" } |
| | | }, |
| | | hideDefaultActions: true}, |
| | | hideDefaultActions: true, initialWidth: 100}, |
| | | {label:'已到货数量', |
| | | type: "customOutputGood", |
| | | typeAttributes: { |
| | |
| | | type: 'ArrDet', |
| | | recordId: { fieldName: "Id" } |
| | | }, |
| | | hideDefaultActions: true}, |
| | | hideDefaultActions: true, initialWidth: 110}, |
| | | {label:'待系统操作入库数量', |
| | | type: "customOutputGood", |
| | | typeAttributes: { |
| | |
| | | type: 'DeliveryDet', |
| | | recordId: { fieldName: "Id" } |
| | | }, |
| | | hideDefaultActions: true}, |
| | | hideDefaultActions: true, initialWidth: 180}, |
| | | {label:'还没发货数量', |
| | | type: "customOutputGood", |
| | | typeAttributes: { |
| | |
| | | type: 'NotArrDet', |
| | | recordId: { fieldName: "Id" } |
| | | }, |
| | | hideDefaultActions: true}, |
| | | hideDefaultActions: true, initialWidth: 120}, |
| | | {label:'发货七天还未到货数', |
| | | type: "customOutputGood", |
| | | typeAttributes: { |
| | |
| | | type: 'MoreThan7', |
| | | recordId: { fieldName: "Id" } |
| | | }, |
| | | hideDefaultActions: true}, |
| | | {label:'最新发货日期',fieldName:'Shipment_date__c',hideDefaultActions: true}, |
| | | {label:'首次发货日期',fieldName:'First_Delivery__c',hideDefaultActions: true} |
| | | hideDefaultActions: true, initialWidth: 180}, |
| | | {label:'最新发货日期',fieldName:'Shipment_date__c',hideDefaultActions: true, initialWidth: 140}, |
| | | {label:'首次发货日期',fieldName:'First_Delivery__c',hideDefaultActions: true, initialWidth: 140} |
| | | ]; |
| | | |
| | | @track colms2 = [ |
| | | {label:'产品型号',fieldName:'prodModel',hideDefaultActions: true}, |
| | | {label:'数量',fieldName:'recordCount',hideDefaultActions: true} |
| | | {label:'数量',fieldName:'recordCount',type:'number',hideDefaultActions: true,cellAttributes: { alignment: "right" }} |
| | | ]; |
| | | |
| | | //获取参数 |
| | |
| | | // } |
| | | // } |
| | | |
| | | renderedCallback(){ |
| | | if (!this.stylesLoaded) { |
| | | Promise.all([loadStyle(this, WrappedHeaderTable)]) |
| | | .then(() => { |
| | | console.log("Custom styles loaded"); |
| | | this.stylesLoaded = true; |
| | | }) |
| | | .catch((error) => { |
| | | console.error("Error loading custom styles"); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | //初始化 |
| | | connectedCallback(){ |
| | | init() |
| | | .then(result=>{ |
| | | this.isNoteStay = result.isNoteStay; |
| | | if(result.result == 'Success'){ |
| | | this.agencyProType = result.agencyProType; |
| | | this.accountId = result.accountId; |
| | |
| | | initTotalNum({ordId:recordId, type:'all'}) |
| | | .then(result=>{ |
| | | if(result.result == 'Success'){ |
| | | this.recordList = result.recordList; |
| | | // this.recordList = result.recordList; |
| | | var dataStr = JSON.stringify(result.recordList); |
| | | this.recordList = JSON.parse(dataStr); |
| | | console.log('data:'+JSON.stringify(this.recordList)); |
| | | this.showPop = true; |
| | | }else{ |
| | |
| | | initArrDetAll({type:'all'}) |
| | | .then(result=>{ |
| | | if(result.result == 'Success'){ |
| | | this.recordList = result.recordList; |
| | | // this.recordList = result.recordList; |
| | | var dataStr = JSON.stringify(result.recordList); |
| | | this.recordList = JSON.parse(dataStr); |
| | | console.log('data:'+JSON.stringify(this.recordList)); |
| | | this.showPop = true; |
| | | }else{ |
| | |
| | | |
| | | //检索 |
| | | search(){ |
| | | this.showSpinner = true; |
| | | searchConsumableorderdetails({ |
| | | category1Str:this.category1, |
| | | cate2Str:this.cate2, |
| | |
| | | userWorkLocationStr:this.userWorkLocation, |
| | | agencyProTypeStr:this.agencyProType}) |
| | | .then(result=>{ |
| | | this.showSpinner = false; |
| | | if(result.result == 'Success'){ |
| | | this.raesList = result.raesList; |
| | | this.raesList.push({Id:'1',Name:'订单明细汇总',Total_num__c:this.totalNum,OrderNumber_arrived__c:this.orderNumberArrived,Delivery_detail_count__c:this.deliveryDetailCount,OrderNumber_notarrive__c:this.orderNumberNotarrive,More_than_seven_days__c:this.moreThanSevenDays}); |
| | |
| | | |
| | | //清空搜索框 |
| | | clear(){ |
| | | this.showSpinner = true; |
| | | this.category1 = ''; |
| | | this.cate2 = null; |
| | | searchConsumableorderdetails({ |
| | |
| | | userWorkLocationStr:this.userWorkLocation, |
| | | agencyProTypeStr:this.agencyProType}) |
| | | .then(result=>{ |
| | | this.showSpinner = false; |
| | | if(result.result == 'Success'){ |
| | | this.raesList = result.raesList; |
| | | this.raesList.push({Id:'1',Name:'订单明细汇总',Total_num__c:this.totalNum,OrderNumber_arrived__c:this.orderNumberArrived,Delivery_detail_count__c:this.deliveryDetailCount,OrderNumber_notarrive__c:this.orderNumberNotarrive,More_than_seven_days__c:this.moreThanSevenDays}); |
| | |
| | | } |
| | | |
| | | showMyToast(title,message,variant){ |
| | | const evt = new ShowToastEvent({ |
| | | title : title, |
| | | message: message, |
| | | variant: variant |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | console.log('show custom message'); |
| | | var iconName = ''; |
| | | var content = ''; |
| | | if(variant == 'success'){ |
| | | iconName = 'utility:check'; |
| | | }else{ |
| | | iconName = 'utility:error'; |
| | | } |
| | | if(message != ''){ |
| | | content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>'; |
| | | }else{ |
| | | content = '<h2><strong>'+title+'<strong/></h2>'; |
| | | } |
| | | this.template.querySelector('c-common-toast'). |
| | | showToast(variant,content,iconName,10000); |
| | | // var mode; |
| | | // if(this.isNoteStay){ |
| | | // mode ='sticky'; |
| | | // }else{ |
| | | // mode = 'dismissable'; |
| | | // } |
| | | // const evt = new ShowToastEvent({ |
| | | // title: title, |
| | | // message: message, |
| | | // variant: variant, |
| | | // mode: mode |
| | | // }); |
| | | // this.dispatchEvent(evt); |
| | | } |
| | | } |