From 43fdbff49764d55c7b3a19a1d6e7d8aeb62072ef Mon Sep 17 00:00:00 2001 From: buli <137736985@qq.com> Date: 星期五, 21 四月 2023 11:17:35 +0800 Subject: [PATCH] backup0421 --- force-app/main/default/lwc/lexConsumable/lexConsumable.js | 67 ++++++++++++++++++++++++++++----- 1 files changed, 57 insertions(+), 10 deletions(-) diff --git a/force-app/main/default/lwc/lexConsumable/lexConsumable.js b/force-app/main/default/lwc/lexConsumable/lexConsumable.js index b41661e..c190ba2 100644 --- a/force-app/main/default/lwc/lexConsumable/lexConsumable.js +++ b/force-app/main/default/lwc/lexConsumable/lexConsumable.js @@ -42,6 +42,7 @@ @track category4Option = []; @track category5Option = []; @track consumableorderdetailsRecordsview = []; + @track consumableorderdetailsRecordForDT = []; @track attachmentRecoeds = []; @track contactDealer = []; @track proLimitAndDate = []; @@ -117,6 +118,38 @@ {label:'鍏佽鎶ヤ环鏈熼棿(缁撴潫鏃�)',fieldName:'Contract_Decide_End_Date__c',initialWidth:200,hideDefaultActions: true} ]; + //娑堣�楀搧鏁版嵁col + get cols(){ + var cols = []; + cols.push({label:'娑堣�楀搧鍚嶇О',fieldName:'prodName',wrapText:true,hideDefaultActions: true}); + cols.push({label:'瑙勬牸',fieldName:'packing_list',hideDefaultActions: true}); + cols.push({label:'CFDA鐘舵��',fieldName:'prodSFDAStatus',hideDefaultActions: true}); + cols.push({label:'娉ㄥ唽璇佺紪鐮佸彿',fieldName:'approbation_No',hideDefaultActions: true}); + cols.push({label:'娉ㄥ唽璇佹晥鏈�',fieldName:'expiration_Date',hideDefaultActions: true}); + cols.push({label:'绗�3鍒嗙被',fieldName:'prodCategory3',hideDefaultActions: true}); + cols.push({label:'绗�4鍒嗙被',fieldName:'prodCategory4',hideDefaultActions: true}); + cols.push({label:'绗�5鍒嗙被',fieldName:'prodCategory5',hideDefaultActions: true}); + if(this.cansee){ + cols.push({label:'鏍囧噯鍗曚环',fieldName:'prodIntraTradeList',hideDefaultActions: true}); + } + if(this.editAble){ + cols.push( + {label:'閲囪喘鏁伴噺', + type: "customTableInput",typeAttributes: { + recordId: { fieldName: "recordId" }, + inputValue: { fieldName: "consumableCount" }, + }, + hideDefaultActions: true}); + }else{ + cols.push({label:'閲囪喘鏁伴噺',fieldName:'consumableCount',hideDefaultActions: true}); + } + cols.push({label:'鍦ㄥ簱鏁颁笅闄�',fieldName:'lowerlimit',hideDefaultActions: true}); + cols.push({label:'鍦ㄥ簱鏁颁笂闄�',fieldName:'upperlimit',hideDefaultActions: true}); + cols.push({label:'鏈夋晥鏈熷簱瀛�(鐩�)',fieldName:'allnumber',hideDefaultActions: true}); + cols.push({label:'鏈夋晥鏈熷簱瀛�(涓�)',fieldName:'allnumber_piece',hideDefaultActions: true}); + return cols;l + } + @wire(CurrentPageReference) getStateParameters(currentPageReference) { console.log('CurrentPageReference'); @@ -147,11 +180,11 @@ this.contractName = result.contractName; this.contractLabel = '缁忛攢鍟嗘湁鏁堝悎鍚�'; this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview; + // this.consumableorderdetailsRecordForDT = result.consumableorderdetailsRecordsview; + this.getTableData(); this.attachmentRecoeds = result.attachmentRecoeds; this.errorMsgs = result.errorMsgList; this.warningMsgs = result.warningMsgList; - // this.hasError = result.hasError; - // this.hasWarning = result.hasWarning; this.userWorkLocation = result.userWorkLocation; this.accountName = result.accountName; this.accountid = result.accountid; @@ -202,20 +235,30 @@ } this.showSpinner = false; this.showPage = true; - // this.warningMsgs.push('warning1'); - // this.warningMsgs.push('warning2'); - // this.warningMsgs.push('warning3'); - // this.warningMsgs.push('warning4'); - // this.errorMsgs.push('error1'); - // this.errorMsgs.push('error2'); - // this.errorMsgs.push('error3'); - // this.errorMsgs.push('error4'); }else{ this.showSpinner = false; console.log("Error:"+result.errorMsg); this.showMyToast('鍒濆鍖栭〉闈㈠け璐�',result.errorMsg,'error'); } }) + } + + getTableData(){ + for(var i in this.consumableorderdetailsRecordForDT){ + if(!this.consumableorderdetailsRecordForDT[i].oldCheck){ + this.consumableorderdetailsRecordForDT[i]["prodName"] = this.consumableorderdetailsRecordForDT[i].Prod.Name__c; + }else{ + this.consumableorderdetailsRecordForDT[i]["prodName"] = this.consumableorderdetailsRecordForDT[i].esd.Consumable_Product__r.Name__c; + } + this.consumableorderdetailsRecordForDT[i]["prodSFDAStatus"] = this.consumableorderdetailsRecordForDT[i].Prod.SFDA_Status__c; + this.consumableorderdetailsRecordForDT[i]["prodCategory3"] = this.consumableorderdetailsRecordForDT[i].Prod.Category3__c; + this.consumableorderdetailsRecordForDT[i]["prodCategory4"] = this.consumableorderdetailsRecordForDT[i].Prod.Category4__c; + this.consumableorderdetailsRecordForDT[i]["prodCategory5"] = this.consumableorderdetailsRecordForDT[i].Prod.Category5__c; + this.consumableorderdetailsRecordForDT[i]["prodIntraTradeList"] = this.consumableorderdetailsRecordForDT[i].Prod.Intra_Trade_List_RMB__c; + this.consumableorderdetailsRecordForDT[i]["consumableCount"] = this.consumableorderdetailsRecordForDT[i].esd.Consumable_count__c; + } + console.log("ProdName1:"+this.consumableorderdetailsRecordForDT[0].prodName); + console.log("ProdName2:"+this.consumableorderdetailsRecordsview[0].prodName); } get hasWarning(){ @@ -304,6 +347,7 @@ .then(result=>{ if(result.result == 'Success'){ this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview; + this.getTableData(); this.showSpinner = false; this.errorMsgs = result.errorMsgList; this.warningMsgs = result.warningMsgList; @@ -351,6 +395,7 @@ }).then(result=>{ if(result.result == 'Success'){ this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview; + this.getTableData(); this.showSpinner = false; this.showMyToast('鎼滅储鎴愬姛',result.errorMsg,'success'); }else{ @@ -786,6 +831,7 @@ }).then(result=>{ if(result.result == 'Success'){ this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview; + this.getTableData(); this.showMyToast('鎼滅储鎴愬姛',result.errorMsg,'success'); }else{ console.log("Error:"+result.errorMsg); @@ -901,6 +947,7 @@ }).then(result=>{ if(result.result == 'Success'){ this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview; + this.getTableData(); this.showMyToast('鎼滅储鎴愬姛',result.errorMsg,'success'); }else{ console.log("Error:"+result.errorMsg); -- Gitblit v1.9.1