| | |
| | | fieldName: "Name__c", |
| | | hideDefaultActions: true, |
| | | initialWidth: 250, |
| | | wrapText: true, |
| | | }, |
| | | { |
| | | label: "规格", |
| | |
| | | { |
| | | label: "出货单价(元)", |
| | | fieldName: "Shipment_amount__c", |
| | | type: "number", |
| | | typeAttributes: { |
| | | minimumFractionDigits: 2, |
| | | }, |
| | | initialWidth: 150, |
| | | hideDefaultActions: true, |
| | | }, |
| | |
| | | }, |
| | | hideDefaultActions: true, |
| | | wrapText: true, |
| | | initialWidth: 240 |
| | | }, |
| | | { |
| | | label: "单位", |
| | |
| | | fieldName: "Bar_Code__c", |
| | | hideDefaultActions: true, |
| | | wrapText: true, |
| | | initialWidth: 500 |
| | | }, |
| | | { |
| | | label: "使用期限", |
| | |
| | | @track isBarcode = true; |
| | | @track isShowInformation = true; |
| | | @track isShowOutboundProductDetails = false; |
| | | @track showAttPop = false; |
| | | @track showPopSpinner = false; |
| | | |
| | | //disable按钮 |
| | | @track isEditDisabled = false; |
| | |
| | | content; |
| | | MAX_FILE_SIZE = 1500000; |
| | | |
| | | get acceptedFormats() { |
| | | return [".xlsx"]; |
| | | } |
| | | |
| | | //InvoiceProNotLabel RrturnProLabel InvoicedLabel |
| | | @wire(getObjectInfo, { objectApiName: OPPORTUNITY_OBJECT }) |
| | | oppInfo({ data, error }) { |
| | |
| | | console.log("r = " + JSON.stringify(r)); |
| | | |
| | | if (r.status == "Success") { |
| | | |
| | | this.OECId = r.entity.HospitalInfo == null ? '' : r.entity.HospitalInfo; |
| | | console.log("this.OECId = " + this.OECId); |
| | | this.ConsumableOut_report = r.entity.ConsumableOut_report; |
| | |
| | | } |
| | | // this.data[i]["shipmentNumber"] = 0; |
| | | // this.data[i]["shippingUnitPrice"] = 0.0; |
| | | //this.data[i]["shipmentNumber"] = this.data[i].orderdetails1["Shipment_Count__c"] == 0 ? '' : this.data[i].orderdetails1["Shipment_Count__c"]; |
| | | //this.data[i]["shippingUnitPrice"] = this.data[i].orderdetails1["Delivery_List_RMB__c"] == 0 ? '' : this.data[i].orderdetails1["Delivery_List_RMB__c"]; |
| | | this.data[i]["shipmentNumber"] = this.data[i].orderdetails1["Shipment_Count__c"]; |
| | | this.data[i]["shippingUnitPrice"] = this.data[i].orderdetails1["Delivery_List_RMB__c"]; |
| | | |
| | |
| | | } |
| | | } |
| | | //如果EditAble==false,删除 出货金额(元) 有效期内库存(盒) 有效期内库存(个) 3列 展示 还没发票数量 返品数量 已发票数量 |
| | | //type : "number", |
| | | // typeAttributes:{ |
| | | // minimumFractionDigits:2, |
| | | // }, |
| | | if (!this.EditAble) { |
| | | let object1 = { |
| | | label: this.InvoiceProNotLabel, |
| | | fieldName: "InvoiceProNot_count__c", |
| | | type: "number", |
| | | typeAttributes: { |
| | | minimumFractionDigits: 2, |
| | | }, |
| | | hideDefaultActions: true, |
| | | }; |
| | | let object2 = { |
| | |
| | | let object3 = { |
| | | label: this.InvoicedLabel, |
| | | fieldName: "Invoiced_Procount__c", |
| | | type: "number", |
| | | typeAttributes: { |
| | | minimumFractionDigits: 2, |
| | | }, |
| | | hideDefaultActions: true, |
| | | }; |
| | | this.editColumns.push(object1); |
| | |
| | | JSON.stringify(this.secondaryDistributorOptions) |
| | | ); |
| | | this.HospitalName = r.entity.HospitalName; |
| | | this.sumPrice = r.entity.sumPrice + "元"; |
| | | this.sumPrice = r.entity.sumPrice.toFixed(2) + "元"; |
| | | this.isShowSpinner = false; |
| | | this.showTable = true; |
| | | console.log("ESetid = " + this.ESetid); |
| | |
| | | console.log("r = " + JSON.stringify(r)); |
| | | this.showToast("Error", r.msg); |
| | | } |
| | | }).catch((error) => { |
| | | console.log("error = " + JSON.stringify(error)); |
| | | }); |
| | | } |
| | | |
| | |
| | | this.ForDealerText = ""; |
| | | this.isDisabledForDealerText = true; |
| | | this.isDisabledSecondaryDistributor = true; |
| | | this.isMutualTransferGoods = false; |
| | | break; |
| | | case "医院试用": |
| | | this.isDisabledHospitalName = false; |
| | |
| | | this.ForCustomerText = value; |
| | | break; |
| | | case "sumPrice": |
| | | this.sumPrice = value; |
| | | this.sumPrice = value.toFixed(2); |
| | | break; |
| | | case "NoConfirmedPrice": |
| | | this.NoConfirmedPrice = !this.NoConfirmedPrice; |
| | |
| | | this.Category3 = value; |
| | | //调用后台显示第四五分类 |
| | | this.showAllCate(); |
| | | if(this.Category3 == ''){ |
| | | if (this.Category3 == '') { |
| | | this.Category4 = ''; |
| | | this.Category5 = ''; |
| | | } |
| | |
| | | this.Category4 = value; |
| | | //调用后台显示第五分类 |
| | | this.showCate(); |
| | | if(this.Category4 == ''){ |
| | | if (this.Category4 == '') { |
| | | this.Category5 = ''; |
| | | } |
| | | break; |
| | |
| | | } |
| | | } |
| | | |
| | | showAllCate(){ |
| | | showAllCate() { |
| | | console.log('showAllCate') |
| | | categoryAllload({ |
| | | category3Lwc : this.Category3 |
| | | category3Lwc: this.Category3 |
| | | }).then((r) => { |
| | | r = JSON.parse(JSON.stringify(r)); |
| | | console.log("r = " + JSON.stringify(r)); |
| | |
| | | object["value"] = key; |
| | | this.category5Options.push(object); |
| | | } |
| | | }else { |
| | | } else { |
| | | console.log("r = " + JSON.stringify(r)); |
| | | this.showToast("Error", r.msg); |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | showCate(){ |
| | | showCate() { |
| | | console.log('showAllCate') |
| | | categoryload({ |
| | | category3Lwc : this.Category3, |
| | | category4Lwc : this.Category4 |
| | | category3Lwc: this.Category3, |
| | | category4Lwc: this.Category4 |
| | | }).then((r) => { |
| | | r = JSON.parse(JSON.stringify(r)); |
| | | console.log("r = " + JSON.stringify(r)); |
| | |
| | | object["value"] = key; |
| | | this.category5Options.push(object); |
| | | } |
| | | }else { |
| | | } else { |
| | | console.log("r = " + JSON.stringify(r)); |
| | | this.showToast("Error", r.msg); |
| | | } |
| | |
| | | searchProductJs() { |
| | | this.isShowSpinner = true; |
| | | //this.showTable = false; |
| | | //查询有哪些选择了的然后check |
| | | const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows(); |
| | | console.log('selectedRows = ' + selectedRows); |
| | | for (var i in this.data) { |
| | | this.data[i]["check"] = false; |
| | | } |
| | | for (var i in this.data) { |
| | | for (var j in selectedRows) { |
| | | if (this.data[i].Id == selectedRows[j].Id) { |
| | | this.data[i]["check"] = true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | let cloneData = this.data; |
| | | for (var i in cloneData) { |
| | |
| | | unitOptions.push(unitOption); |
| | | } |
| | | tempData[i]["unitOptions"] = unitOptions; |
| | | tempData[i]["unitValue"] = unitOptions[0].value; |
| | | tempData[i]["unitValue"] = tempData[i]["unitValue"] == null ? unitOptions[0].value : tempData[i]["unitValue"]; |
| | | if (this.EditAble) { |
| | | tempData[i].orderdetails1["Box_Piece__c"] = tempData[i].orderdetails1["Box_Piece__c"] == null ? unitOptions[0].value : tempData[i].orderdetails1["Box_Piece__c"]; |
| | | tempData[i].orderdetails1["Shipment_Count__c"] = tempData[i].orderdetails1["Shipment_Count__c"] == null ? 0 : tempData[i].orderdetails1["Shipment_Count__c"]; |
| | | tempData[i].orderdetails1["Delivery_List_RMB__c"] = tempData[i].orderdetails1["Delivery_List_RMB__c"] == null ? 0.0 : tempData[i].orderdetails1["Delivery_List_RMB__c"]; |
| | | } else { |
| | | tempData[i]["InvoiceProNot_count__c"] = |
| | | tempData[i].orderdetails1.InvoiceProNot_count__c; |
| | | tempData[i]["RrturnPro_count__c"] = |
| | | tempData[i].orderdetails1.RrturnPro_count__c; |
| | | tempData[i]["Invoiced_Procount__c"] = |
| | | tempData[i].orderdetails1.Invoiced_Procount__c; |
| | | } |
| | | tempData[i]["shipmentNumber"] = tempData[i].orderdetails1["Shipment_Count__c"]; |
| | | tempData[i]["shippingUnitPrice"] = tempData[i].orderdetails1["Delivery_List_RMB__c"]; |
| | | |
| | | tempData[i]["recordId"] = tempData[i].Prod.Id; |
| | | tempData[i]["Id"] = tempData[i].Prod.Id; |
| | | tempData[i]["Name__c"] = tempData[i].Prod.Name__c; |
| | |
| | | tempData[i]["Category4__c"] = tempData[i].Prod.Category4__c; |
| | | tempData[i]["Category5__c"] = tempData[i].Prod.Category5__c; |
| | | tempData[i]["Box_Piece__c"] = tempData[i].orderdetails1.Box_Piece__c; |
| | | tempData[i]["shipmentNumber"] = tempData[i].orderdetails1.Shipment_Count__c; |
| | | tempData[i]["shippingUnitPrice"] = tempData[i].orderdetails1.Delivery_List_RMB__c; |
| | | console.log( |
| | | "shippingUnitPrice = " + tempData[i]["shippingUnitPrice"] |
| | | ); |
| | | tempData[i]["shipmentAmount"] = tempData[i].orderdetails1.Shipment_amount__c; |
| | | tempData[i]["Shipment_amount__c"] = tempData[i].orderdetails1.Shipment_amount__c; |
| | | tempData[i]["Shipment_Count__c"] = tempData[i].orderdetails1.Shipment_Count__c; |
| | | |
| | | if (tempData[i]["shippingUnitPrice"] && tempData[i]["shipmentNumber"]) |
| | | tempData[i]["shipmentAmount"] = this.amend( |
| | | tempData[i]["shipmentNumber"], |
| | | tempData[i]["shippingUnitPrice"], |
| | | "*" |
| | | ); |
| | | |
| | | if (tempData[i]['check']) { |
| | | this.selectedRows.push(tempData[i].Id); |
| | | } |
| | | |
| | | } |
| | | // for (var i in tempData) { |
| | | // let unitOptions = []; |
| | | // for (var key in tempData[i].boxorpieceMap) { |
| | | // let unitOption = {}; |
| | | // unitOption["label"] = tempData[i].boxorpieceMap[key]; |
| | | // unitOption["value"] = key; |
| | | // unitOptions.push(unitOption); |
| | | // } |
| | | // tempData[i]["unitOptions"] = unitOptions; |
| | | // tempData[i]["unitValue"] = unitOptions[0].value; |
| | | // tempData[i]["recordId"] = tempData[i].Prod.Id; |
| | | // tempData[i]["Id"] = tempData[i].Prod.Id; |
| | | // tempData[i]["Name__c"] = tempData[i].Prod.Name__c; |
| | | // tempData[i]["SFDA_Status__c"] = tempData[i].Prod.SFDA_Status__c; |
| | | // tempData[i]["Category3__c"] = tempData[i].Prod.Category3__c; |
| | | // tempData[i]["Category4__c"] = tempData[i].Prod.Category4__c; |
| | | // tempData[i]["Category5__c"] = tempData[i].Prod.Category5__c; |
| | | // tempData[i]["Box_Piece__c"] = tempData[i].orderdetails1.Box_Piece__c; |
| | | // tempData[i]["shipmentNumber"] = tempData[i].orderdetails1.Shipment_Count__c; |
| | | // tempData[i]["shippingUnitPrice"] = tempData[i].orderdetails1.Delivery_List_RMB__c; |
| | | // console.log( |
| | | // "shippingUnitPrice = " + tempData[i]["shippingUnitPrice"] |
| | | // ); |
| | | // if (tempData[i]["shippingUnitPrice"] && tempData[i]["shipmentNumber"]) |
| | | // tempData[i]["shipmentAmount"] = this.amend( |
| | | // tempData[i]["shipmentNumber"], |
| | | // tempData[i]["shippingUnitPrice"], |
| | | // "*" |
| | | // ); |
| | | // } |
| | | this.data = tempData; |
| | | console.log("this.data = " + JSON.stringify(this.data)); |
| | | //this.showTable = true; |
| | | this.isShowSpinner = false; |
| | | }else { |
| | | } else { |
| | | console.log("r = " + JSON.stringify(r)); |
| | | this.showToast("Error", r.msg); |
| | | } |
| | |
| | | this.data[i].orderdetails1["Shipment_Count__c"] = Number( |
| | | numberDetail.data.shipmentnumber |
| | | ); |
| | | console.log( |
| | | "this.data[i].shipmentNumber = " + this.data[i].shipmentNumber |
| | | ); |
| | | } |
| | | } |
| | | this.ComputePrice( |
| | |
| | | this.data[i].orderdetails1["Delivery_List_RMB__c"] = Number( |
| | | priceDetail.data.shipmentunitprice |
| | | ); |
| | | console.log( |
| | | "this.data[i].shippingUnitPrice = " + this.data[i].shippingUnitPrice |
| | | ); |
| | | } |
| | | } |
| | | this.ComputePrice( |
| | |
| | | for (var i in this.data) { |
| | | if (this.data[i].shipmentAmount) sumPrice += this.data[i].shipmentAmount; |
| | | } |
| | | this.sumPrice = sumPrice + "元"; |
| | | this.sumPrice = sumPrice.toFixed(2) + "元"; |
| | | //存下选择行,不会被清空 |
| | | this.selectedRows = []; |
| | | for (var i in this.data) { |
| | | if (this.data[i].check) { |
| | | this.selectedRows.push(this.data[i].Id); |
| | | } |
| | | } |
| | | if (this.selectedRows.indexOf(this.data[index].Id) == -1) |
| | | this.selectedRows.push(this.data[index].Id); |
| | | // this.selectedRows = []; |
| | | // for (var i in this.data) { |
| | | // if (this.data[i].check) { |
| | | // this.selectedRows.push(this.data[i].Id); |
| | | // } |
| | | // } |
| | | this.data = [...this.data]; |
| | | this.selectedRows = [...this.selectedRows] |
| | | console.log("this.selectedRows = " + JSON.stringify(this.selectedRows)); |
| | | console.log("this.data = " + JSON.stringify(this.data)); |
| | | } |
| | |
| | | } |
| | | |
| | | getSelectedRows(event) { |
| | | const selectedRows = event.detail.selectedRows; |
| | | console.log("this.selectedRows = " + this.selectedRows); |
| | | for (var i in this.data) { |
| | | this.data[i]["check"] = false; |
| | | let selectedRowsEvent = event.detail.selectedRows; |
| | | this.selectedRows = []; |
| | | for (var i in selectedRowsEvent) { |
| | | this.selectedRows.push(selectedRowsEvent[i].Id) |
| | | } |
| | | for (var i in this.data) { |
| | | for (var j in selectedRows) { |
| | | if (this.data[i].Id == selectedRows[j].Id) { |
| | | this.data[i]["check"] = true; |
| | | } |
| | | } |
| | | } |
| | | // const selectedRows = event.detail.selectedRows; |
| | | // console.log("this.selectedRows = " + this.selectedRows); |
| | | // for (var i in this.data) { |
| | | // this.data[i]["check"] = false; |
| | | // } |
| | | // for (var i in this.data) { |
| | | // for (var j in selectedRows) { |
| | | // if (this.data[i].Id == selectedRows[j].Id) { |
| | | // this.data[i]["check"] = true; |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | saveConfirmJs() { |
| | |
| | | |
| | | saveConfirm() { |
| | | this.isShowSpinner = true; |
| | | |
| | | //查询有哪些选择了的然后check |
| | | const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows(); |
| | | console.log('selectedRows = ' + selectedRows); |
| | | for (var i in this.data) { |
| | | this.data[i]["check"] = false; |
| | | } |
| | | for (var i in this.data) { |
| | | for (var j in selectedRows) { |
| | | if (this.data[i].Id == selectedRows[j].Id) { |
| | | this.data[i]["check"] = true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | let cloneData = this.data; |
| | | for (var i in cloneData) { |
| | | cloneData[i]["Name"] = cloneData[i].Name__c; |
| | |
| | | cocLwc: this.cocLwc, |
| | | hospitalInfoLwc: this.OECId, |
| | | hospitalNameLwc: this.HospitalName, |
| | | secondaryDistributor: this.secondaryDistributor, |
| | | secondaryDistributorLwc: this.secondaryDistributor, |
| | | pageRecordsLwc: cloneData, |
| | | accountid: this.accountid, |
| | | ESetId: this.ESetid, |
| | | accountidLwc: this.accountid, |
| | | ESetIdLwc: this.ESetid, |
| | | consumableproductdetailsRecordsLwc: this.consumableproductdetailsRecords, |
| | | }) |
| | | .then((r) => { |
| | | r = JSON.parse(JSON.stringify(r)); |
| | | console.log("r = " + JSON.stringify(r)); |
| | | |
| | | if (r.status == "Success") { |
| | | let url = "/lexsummonscreat?ESetid=" + r.entity.ESetId; |
| | | this[NavigationMixin.Navigate]({ |
| | | type: "standard__webPage", |
| | | attributes: { |
| | | url: url, |
| | | }, |
| | | }); |
| | | } else { |
| | | console.log("r.msg = " + r.msg); |
| | | this.showToast("Error", r.msg); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.log("error = " + JSON.stringify(error)); |
| | | }); |
| | | agencyProTypeLwc: this.agencyProType, |
| | | userWorkLocationLwc: this.userWorkLocation |
| | | }).then((r) => { |
| | | r = JSON.parse(JSON.stringify(r)); |
| | | console.log("r = " + JSON.stringify(r)); |
| | | debugger |
| | | if (r.status == "Success") { |
| | | let url = "/lexsummonscreat?ESetid=" + r.entity.ESetId; |
| | | this[NavigationMixin.Navigate]({ |
| | | type: "standard__webPage", |
| | | attributes: { |
| | | url: url, |
| | | }, |
| | | }); |
| | | } else { |
| | | console.log("r.msg = " + r.msg); |
| | | this.showToast("Error", r.msg); |
| | | } |
| | | }).catch((error) => { |
| | | console.log("error = " + JSON.stringify(error)); |
| | | }); |
| | | } |
| | | |
| | | //打印指示单 |
| | |
| | | console.log("openReportJs"); |
| | | var reportId = this.ESetid; |
| | | reportId = reportId.substring(0, 15); |
| | | let url = "/report/00O100000058VzB?fv1=" + reportId; |
| | | let reportFilters = '[{"operator":"equals","value":"' + reportId + '","column":"FK_CUSTENT_ID"}]'; |
| | | let url = "/report/00O0l000000zZtpEAE?reportFilters=" + encodeURIComponent(reportFilters); |
| | | console.log("url = " + url); |
| | | this[NavigationMixin.Navigate]({ |
| | | type: "standard__webPage", |
| | |
| | | this.showToast("Error", "文件过大"); |
| | | return; |
| | | } |
| | | this.showLoadingSpinner = true; |
| | | this.showPopSpinner = true; |
| | | this.fileReader = new FileReader(); |
| | | |
| | | this.fileReader.onloadend = () => { |
| | |
| | | base64Data: encodeURIComponent(this.fileContents), |
| | | }) |
| | | .then((r) => { |
| | | this.showPopSpinner = false; |
| | | r = JSON.parse(JSON.stringify(r)); |
| | | console.log("r = " + JSON.stringify(r)); |
| | | this.showLoadingSpinner = false; |
| | | this.closePop(); |
| | | this.showToast("Success", "上传成功"); |
| | | this.getFiles(); |
| | | }) |
| | | .catch((error) => { |
| | | this.showPopSpinner = false; |
| | | console.log("error = " + error.message); |
| | | this.showToast("Error", "上传失败"); |
| | | }); |
| | |
| | | |
| | | GoodsDeliveryJs() { |
| | | this.isShowSpinner = true; |
| | | |
| | | //查询有哪些选择了的然后check |
| | | const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows(); |
| | | console.log('selectedRows = ' + selectedRows); |
| | | for (var i in this.data) { |
| | | this.data[i]["check"] = false; |
| | | } |
| | | for (var i in this.data) { |
| | | for (var j in selectedRows) { |
| | | if (this.data[i].Id == selectedRows[j].Id) { |
| | | this.data[i]["check"] = true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | let cloneData = this.data; |
| | | for (var i in cloneData) { |
| | | cloneData[i]["Name"] = cloneData[i].Name__c; |
| | |
| | | }); |
| | | } |
| | | |
| | | handleLoad() { |
| | | console.log('handleLoad') |
| | | try { |
| | | const style = document.createElement('style'); |
| | | style.innerText = '.slds-button__icon {display: none;}'; |
| | | this.template.querySelector('.hideHelpText').appendChild(style); |
| | | } catch (error) { |
| | | console.log(error); |
| | | } |
| | | } |
| | | |
| | | handleLoad2() { |
| | | console.log('handleLoad2') |
| | | try { |
| | | const style = document.createElement('style'); |
| | | style.innerText = '.slds-button__icon {display: none;}'; |
| | | this.template.querySelector('.hideHelpText').appendChild(style); |
| | | |
| | | const style2 = document.createElement('style'); |
| | | style2.innerText = '.hehe-layoutItem .slds-form-element__label {padding : 0px}'; |
| | | this.template.querySelector('.hideHelpText').appendChild(style2); |
| | | } catch (error) { |
| | | console.log(error); |
| | | } |
| | | } |
| | | //编辑出库单 |
| | | EditConsumable() { |
| | | let url = "/lexsummonscreat?ESetid=" + this.ESetid + "&KeyWords=Redirect"; |
| | |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | //显示上传附件 |
| | | uploadOrder(event) { |
| | | this.showAttPop = true; |
| | | } |
| | | |
| | | //附件change事件 |
| | | attChange(event) { |
| | | if (event.target.files.length > 0) { |
| | | this.filesUploaded = event.target.files; |
| | | this.fileName = event.target.files[0].name; |
| | | console.log('this.fileName:' + this.fileName); |
| | | } |
| | | } |
| | | |
| | | //是否显示附件移除 |
| | | get attDelBtn() { |
| | | if (this.fileName != '' && this.fileName != null && this.fileName != '请选择一个文件上传') { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //关闭附件弹窗 |
| | | closePop() { |
| | | this.showAttPop = false; |
| | | this.filesUploaded = []; |
| | | this.fileName = null; |
| | | } |
| | | |
| | | //移除附件 |
| | | removeAtt() { |
| | | this.filesUploaded = []; |
| | | this.fileName = ''; |
| | | } |
| | | |
| | | ClearJs() { |
| | | this.consumableName = ''; |
| | | this.Category3 = ''; |
| | | this.Category4 = ''; |
| | | this.Category5 = ''; |
| | | this.searchProductJs(); |
| | | } |
| | | } |