| | |
| | | //table css |
| | | import { loadStyle } from "lightning/platformResourceLoader"; |
| | | import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable"; |
| | | import LexConInvoiceViewReport from '@salesforce/label/c.LexConInvoiceViewReport'; |
| | | |
| | | const hospitalColumns = [ |
| | | { |
| | |
| | | hideDefaultActions: true, |
| | | wrapText: true, |
| | | cellAttributes: { alignment: 'right' }, |
| | | |
| | | type: "number", |
| | | typeAttributes: { |
| | | minimumFractionDigits: 2, |
| | |
| | | label: "产品型号", |
| | | fieldName: "esdAssetModelNo", |
| | | hideDefaultActions: true, |
| | | wrapText: true, |
| | | }, |
| | | { |
| | | label: "规格", |
| | |
| | | }, |
| | | { |
| | | label: "开票单位", |
| | | //fieldName: "esdInvoiceUnit", |
| | | hideDefaultActions: true, |
| | | type: "customUnit", |
| | | typeAttributes: { |
| | | unitValue: { fieldName: "unitValue" }, |
| | | unitOptions: { fieldName: "unitOptions" }, |
| | | recordId: { fieldName: "recordId" }, |
| | | isDisabled: { fieldName: "isDisabled" }, |
| | | }, |
| | | }, |
| | | { |
| | |
| | | fieldName: "invoiceAllprice", |
| | | hideDefaultActions: true, |
| | | type: "number", |
| | | initialWidth: 150, |
| | | typeAttributes: { |
| | | minimumFractionDigits: 2, |
| | | }, |
| | | }, |
| | | ] |
| | | const customLabel = { |
| | | LexConInvoiceViewReport |
| | | } |
| | | export default class LexConInvoiceView extends NavigationMixin(LightningElement) { |
| | | |
| | | @track label=customLabel; |
| | | invoiceColumns = invoiceColumns; |
| | | detailsColumns = detailsColumns; |
| | | @track outboundColumns = [ |
| | |
| | | this.detailsData[i]['esdInvoicedProcount'] = this.detailsData[i].esd.Invoiced_Procount__c; |
| | | this.detailsData[i]['esdInvoiceProNotCount'] = this.detailsData[i].esd.InvoiceProNot_count__c; |
| | | //开票单位 |
| | | this.detailsData[i]['unitValue'] = this.detailsData[i].esd.Invoice_Unit__c; |
| | | //this.detailsData[i].esd.Box_Piece__c |
| | | //this.detailsData[i]['unitValue'] = this.detailsData[i].esd.Invoice_Unit__c; |
| | | this.detailsData[i]['unitValue'] = this.detailsData[i].esd.Box_Piece__c; |
| | | console.log('unitValue = ' + this.detailsData[i]['unitValue']); |
| | | this.detailsData[i]['recordId'] = this.detailsData[i].esd.Id; |
| | | //disabled="{!IF(records.esd.Box_Piece__c =='个' || (records.esd.Box_Piece__c =='盒' && records.Packing_list_manual ==1),true,false)}" |
| | | //this.detailsData[i]['isDisabled'] = (this.detailsData[i].esd.Box_Piece__c == '个' || (this.detailsData[i].esd.Box_Piece__c =='盒' && this.detailsData[i].Packing_list_manual ==1)) ? true:false; |
| | | this.detailsData[i]['isDisabled'] = true; |
| | | let unitOptions = []; |
| | | for (var key in this.detailsData[i].Invoice_UnitOptsMap) { |
| | | let unitOption = {}; |
| | |
| | | this.isChange = r.entity.isChange; |
| | | this.ExistOutbound = r.entity.ExistOutbound; |
| | | this.outboundData = r.entity.invoiceOrderRecoeds; |
| | | console.log('this.outboundData = ' + JSON.stringify(this.outboundData)) |
| | | this.done = r.entity.done; |
| | | this.accountid = r.entity.accountid; |
| | | this.userWorkLocation = r.entity.userWorkLocation; |
| | |
| | | SaveJs() { |
| | | this.isShowSpinner = true; |
| | | let cloneData = this.outboundData |
| | | |
| | | debugger |
| | | const selectedRows = this.template.querySelector("[data-field='outbound']").getSelectedRows(); |
| | | console.log('selectedRows = ' + JSON.stringify(selectedRows)); |
| | | |
| | | for (var i in cloneData) { |
| | | let b = false; |
| | | for (var j in selectedRows) { |
| | | if (cloneData[i].esd.Id == selectedRows[j].esd.Id) { |
| | | b = true; |
| | | cloneData[i].check = true; |
| | | } |
| | | } |
| | | if(!b){ |
| | | cloneData[i].check = false; |
| | | } |
| | | delete cloneData[i].esdOutboundDate; |
| | | delete cloneData[i].esdNameUrl; |
| | | delete cloneData[i].esdName; |
| | |
| | | InvoiceorderSearchJs() { |
| | | this.isShowSpinner = true; |
| | | |
| | | debugger |
| | | let cloneData = this.outboundData |
| | | const selectedRows = this.template.querySelector("[data-field='outbound']").getSelectedRows(); |
| | | console.log('selectedRows ' + JSON.stringify(selectedRows)); |
| | | for (var i in cloneData) { |
| | | let b = false; |
| | | for (var j in selectedRows) { |
| | | if (cloneData[i].esd.Id == selectedRows[j].esd.Id) { |
| | | b = true; |
| | | cloneData[i].check = true; |
| | | } |
| | | } |
| | | if(!b){ |
| | | cloneData[i].check = false; |
| | | } |
| | | delete cloneData[i].esdOutboundDate; |
| | | delete cloneData[i].esdNameUrl; |
| | | delete cloneData[i].esdName; |
| | |
| | | console.log('this.HospitalInfo = ' + this.HospitalInfo); |
| | | console.log('SecondDealer = ' + this.secondaryDistributor); |
| | | console.log('invoiceOrderRecoedsLwc = ' + JSON.stringify(cloneData)); |
| | | |
| | | InvoiceorderSearch({ |
| | | cocLwc: this.coc, |
| | | invoiceIdLwc: this.invoiceId, |
| | |
| | | console.log("r = " + JSON.stringify(r)); |
| | | if (r.status == "Success") { |
| | | this.outboundData = r.entity.invoiceOrderRecoeds; |
| | | console.log('this.outboundData = ' + JSON.stringify(this.outboundData)); |
| | | let index = 0; |
| | | this.selectedRows = []; |
| | | for (var i in this.outboundData) { |
| | | |
| | | if(this.outboundData[i].check) |
| | | this.selectedRows.push(this.outboundData[i].esd.Id) |
| | | this.outboundData[i].Id = this.outboundData[i].esd.Id; |
| | | this.outboundData[i]['esdOutboundDate'] = this.outboundData[i].esd.Outbound_Date__c; |
| | | this.outboundData[i]['esdNameUrl'] = '/s/lexsummonscreat?ESetid=' + this.outboundData[i].esd.Id; |
| | | this.outboundData[i]['esdName'] = this.outboundData[i].esd.Name; |
| | |
| | | //计算发票票面金额 |
| | | this.sumPrice += this.outboundData[i].needInvoiceCount; |
| | | } |
| | | console.log('this.selectedRows = ' + JSON.stringify(this.selectedRows)) |
| | | this.isShowSpinner = false; |
| | | } else { |
| | | this.showMyToast('搜索失败', r.msg, 'Error'); |
| | |
| | | } |
| | | |
| | | getSelectedRows(event) { |
| | | console.log("getSelectedRows "); |
| | | for (var i in this.outboundData) { |
| | | this.outboundData[i].check = false; |
| | | } |
| | | const selectedRows = event.detail.selectedRows; |
| | | for (var i in this.outboundData) { |
| | | for (var j in selectedRows) { |
| | | if (this.outboundData[i].esd.Id == selectedRows[j].esd.Id) { |
| | | //this.outboundData[i].check = !this.outboundData[i].check; |
| | | this.outboundData[i].check = true; |
| | | } |
| | | } |
| | | } |
| | | console.log('this.outboundData = ' + JSON.stringify(this.outboundData)); |
| | | // console.log("getSelectedRows "); |
| | | // for (var i in this.outboundData) { |
| | | // this.outboundData[i].check = false; |
| | | // } |
| | | // const selectedRows = event.detail.selectedRows; |
| | | // for (var i in this.outboundData) { |
| | | // for (var j in selectedRows) { |
| | | // if (this.outboundData[i].esd.Id == selectedRows[j].esd.Id) { |
| | | // //this.outboundData[i].check = !this.outboundData[i].check; |
| | | // this.outboundData[i].check = true; |
| | | // } |
| | | // } |
| | | // } |
| | | // console.log('this.outboundData = ' + JSON.stringify(this.outboundData)); |
| | | } |
| | | |
| | | deleteButtonJs() { |
| | |
| | | |
| | | openReportJs() { |
| | | console.log("openReportJs"); |
| | | //let url = "/report/00O100000058VzB?fv1=" + this.OrderCode; |
| | | let reportUrl = this.label.LexConInvoiceViewReport; |
| | | let reportFilters = '[{"operator":"equals","value":"' + this.OrderCode + '","column":"FK_NAME"}]'; |
| | | let url = "/report/00O0l000000zaGcEAI?reportFilters=" + encodeURIComponent(reportFilters); |
| | | console.log('reportUrl = ' + reportUrl); |
| | | let url = "/report/"+ reportUrl +"?reportFilters=" + encodeURIComponent(reportFilters); |
| | | this[NavigationMixin.Navigate]({ |
| | | type: "standard__webPage", |
| | | attributes: { |
| | |
| | | contentVersionId: recordId |
| | | }).then(result => { |
| | | if (result.result == 'Success') { |
| | | this.showMyToast('成功', '删除成功', 'Success'); |
| | | this.showMyToast('删除成功', '', 'Success'); |
| | | if (this.fileData.length == 1) |
| | | window.location.reload(); |
| | | else |