| | |
| | | label: '出库日', |
| | | fieldName: 'Outbound_Date__c', |
| | | type: 'date', |
| | | initialWidth: 100, |
| | | initialWidth: 130, |
| | | hideDefaultActions: true, |
| | | sortable: true |
| | | }, |
| | |
| | | target: '_blank' |
| | | }, |
| | | hideDefaultActions: true, |
| | | initialWidth: 225, |
| | | sortable: true |
| | | }, |
| | | { |
| | |
| | | initialWidth: 200 |
| | | } |
| | | ]; |
| | | |
| | | const editColumns = [ |
| | | { |
| | | label: '出库日', |
| | | fieldName: 'Outbound_Date__c', |
| | | type: 'date', |
| | | hideDefaultActions: true, |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: '出库单号', |
| | | fieldName: 'url', |
| | | type: 'url', |
| | | typeAttributes: { |
| | | label: { |
| | | fieldName: 'Name' |
| | | }, |
| | | target: '_blank' |
| | | }, |
| | | hideDefaultActions: true, |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: '客户名', |
| | | fieldName: 'ShipmentAccount__c', |
| | | hideDefaultActions: true, |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: '科室', |
| | | fieldName: 'Order_ForCustomerText__c', |
| | | hideDefaultActions: true |
| | | }, |
| | | { |
| | | label: '出库单状态', |
| | | fieldName: 'SummonsStatus_c__c', |
| | | hideDefaultActions: true, |
| | | sortable: true, |
| | | initialWidth: 100 |
| | | }, |
| | | { |
| | | label: '开票状态', |
| | | fieldName: 'Billed_Status__c', |
| | | hideDefaultActions: true, |
| | | sortable: true, |
| | | initialWidth: 100 |
| | | }, |
| | | { |
| | | label: '未发票金额(元)', |
| | | fieldName: 'InvoiceNotPro_money__c', |
| | | hideDefaultActions: true, |
| | | initialWidth: 150 |
| | | }, |
| | | { |
| | | label: '创建日期', |
| | | fieldName: 'CreatedDate', |
| | | hideDefaultActions: true, |
| | | sortable: true |
| | | }, |
| | | // { |
| | | // label: '单位', |
| | | // hideDefaultActions: true, |
| | | // type:'customUnit', |
| | | // }, |
| | | // { |
| | | // label: '出货数量', |
| | | // hideDefaultActions: true, |
| | | // type:'customShipment', |
| | | |
| | | // }, |
| | | // { |
| | | // label: '出货单价(元)', |
| | | // hideDefaultActions: true, |
| | | // type:'customShipmentUnitPrice', |
| | | |
| | | // } |
| | | ]; |
| | | export default class LexSaleAndDelivery extends NavigationMixin(LightningElement) { |
| | | columns = columns; |
| | | @track isShowSpinner = true; |
| | |
| | | @track userWorkLocation = ''; |
| | | @track showTable = false; |
| | | @track hidecheckboxcolumn = true; |
| | | stylesLoaded = false; |
| | | |
| | | //排序 |
| | | defaultSortDirection = 'asc'; |
| | | sortDirection = 'asc'; |
| | | sortedBy; |
| | | |
| | | |
| | | stylesLoaded = false; |
| | | 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((r) => { |
| | |
| | | |
| | | } else { |
| | | console.log('r = ' + JSON.stringify(r)) |
| | | this.showToast('Error', r.msg); |
| | | this.showMyToast('初始化失败', r.msg,'Error'); |
| | | } |
| | | }).catch((error) => { |
| | | console.log('error = ' + JSON.stringify(error)) |
| | | this.showMyToast('错误', '初始化失败','Error'); |
| | | }) |
| | | } |
| | | |
| | | renderedCallback() { |
| | | debugger |
| | | 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"); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | //新建出库单 |
| | | neworderhead() { |
| | |
| | | this.data[i]['url'] = '/s/lexsummonscreat?ESetid=' + this.data[i].Id; |
| | | } |
| | | this.message = r.msg; |
| | | if (this.message == '没有搜索到相关出库单。') { |
| | | this.showToast('Error', this.message); |
| | | if (this.message == '没有搜索到相关出库单') { |
| | | this.showMyToast('搜索失败', this.message,'Error'); |
| | | } else { |
| | | this.showToast('Success', this.message); |
| | | this.showMyToast('搜索成功', this.message,'Success'); |
| | | } |
| | | this.isShowSpinner = false; |
| | | //this.isCssLoaded = true |
| | | this.showTable = true; |
| | | } else { |
| | | this.showToast('Error', r.msg); |
| | | this.showMyToast('错误', r.msg,'Error'); |
| | | } |
| | | }).catch((error) => { |
| | | console.log('error = ' + JSON.stringify(error)) |
| | |
| | | this.data[i]['url'] = '/s/lexsummonscreat?ESetid=' + this.data[i].Id; |
| | | } |
| | | this.message = r.msg; |
| | | if (this.message == '没有搜索到相关出库单。') { |
| | | this.showToast('Error', this.message); |
| | | if (this.message == '没有搜索到相关出库单') { |
| | | this.showMyToast('搜索失败', this.message,'Error'); |
| | | } else { |
| | | this.showToast('Success', this.message); |
| | | this.showMyToast('搜索成功', this.message,'Success'); |
| | | } |
| | | this.isShowSpinner = false; |
| | | this.showTable = true; |
| | | } else { |
| | | this.showToast('Error', r.msg); |
| | | this.showMyToast('搜索失败', r.msg,'Error'); |
| | | } |
| | | }).catch((error) => { |
| | | console.log('error = ' + JSON.stringify(error)) |
| | | this.showMyToast('搜索失败', '搜索还没出库的出库单出错','Error'); |
| | | }) |
| | | } |
| | | |
| | |
| | | this.data[i]['url'] = '/s/lexsummonscreat?ESetid=' + this.data[i].Id; |
| | | } |
| | | this.message = r.msg; |
| | | if (this.message == '没有搜索到相关出库单。') { |
| | | this.showToast('Error', this.message); |
| | | if (this.message == '没有搜索到相关出库单') { |
| | | this.showMyToast('搜索失败', this.message,'Error'); |
| | | } else { |
| | | this.showToast('Success', this.message); |
| | | this.showMyToast('搜索成功', this.message,'Success'); |
| | | } |
| | | this.isShowSpinner = false; |
| | | this.showTable = true; |
| | | } else { |
| | | this.showToast('Error', r.msg); |
| | | this.showMyToast('搜索失败', r.msg,'Error'); |
| | | } |
| | | }).catch((error) => { |
| | | console.log('error = ' + JSON.stringify(error)) |
| | | this.showMyToast('搜索失败', '搜索已出库已开票的出库单出错','Error'); |
| | | }) |
| | | } |
| | | |
| | |
| | | this.data[i]['url'] = '/s/lexsummonscreat?ESetid=' + this.data[i].Id; |
| | | } |
| | | this.message = r.msg; |
| | | if (this.message == '没有搜索到相关出库单。') { |
| | | this.showToast('Error', this.message); |
| | | if (this.message == '没有搜索到相关出库单') { |
| | | this.showMyToast('搜索失败', this.message,'Error'); |
| | | } else { |
| | | this.showToast('Success', this.message); |
| | | this.showMyToast('搜索成功', this.message,'Success'); |
| | | } |
| | | this.isShowSpinner = false; |
| | | this.showTable = true; |
| | | } else { |
| | | this.showToast('Error', r.msg); |
| | | this.showMyToast('搜索失败', r.msg,'Error'); |
| | | } |
| | | }).catch((error) => { |
| | | console.log('error = ' + JSON.stringify(error)) |
| | | this.showMyToast('搜索失败', '搜索失败','Error'); |
| | | }) |
| | | } |
| | | |
| | |
| | | }); |
| | | } |
| | | |
| | | showToast(type, msg) { |
| | | showMyToast(title, message, variant) { |
| | | this.isShowSpinner = false; |
| | | const event = new ShowToastEvent({ |
| | | title: type, |
| | | variant: type, |
| | | message: msg |
| | | }); |
| | | this.dispatchEvent(event); |
| | | console.log('show custom message'); |
| | | var iconName = ''; |
| | | var content = ''; |
| | | if (variant.toLowerCase() == '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); |
| | | } |
| | | |
| | | @track isModalOpen = false; |