From 07390e2fcb4adf27c928335bf27ae7939c5a80ad Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期二, 23 五月 2023 11:28:12 +0800
Subject: [PATCH] bakcup20230523

---
 force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js |  279 ++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 163 insertions(+), 116 deletions(-)

diff --git a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js
index 940976c..e0962cd 100644
--- a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js
+++ b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js
@@ -6,6 +6,9 @@
 import searchProduct from '@salesforce/apex/LexArriveGoodsController.searchProduct';
 import arriveGoodsConfim from '@salesforce/apex/LexArriveGoodsController.arriveGoodsConfim';
 import updateGoodsOfReturn from '@salesforce/apex/LexArriveGoodsController.updateGoodsOfReturn';
+//table css 
+import { loadStyle } from "lightning/platformResourceLoader";
+import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
 
 export default class LexArriveGoods extends NavigationMixin(LightningElement) {
     //椤甸潰鍙橀噺
@@ -15,36 +18,9 @@
     @track saveFLGbln = false;
     @track barcode;
     @track arrController;
-    // @track accountId;
-    // @track accountName;
-    // @track userProType;
-    // @track userProTypestr;
-    // @track productType;
-    // @track engFlag = false;
-    // @track etFlag = false;
-    // @track userWorkLocation;
-    // @track inventoryOrderId;
-    // @track returnOrderId;
-    // @track arriveId;
-    // @track productList;
-    // @track orderProductCunMap;
-    // @track orderProductArrivedCunMap;
-    // @track orderWantArriveCunMap;
-    // @track overOrderCunMap;
-    // @track overOrderBARcodeCunMap;
+    stylesLoaded = false;
     @track showSpinner = true;
     @track showPage = false;
-    //
-    // @track consumableorderdetailsRecordsUse;
-    // @track consumableInventoryUse;
-    // @track consumableorderdetails2Cancle;
-    // @track orderdetails2trMap;
-    // @track consumableorderdetails2Insert;
-    // @track consumableorderdetails2Nobox;
-    // @track consumableorderdetailsRecordsdummy;
-    // @track existIdMap;
-    // @track errorIdMap;
-    // @track allMap;
     //娑堣�楀搧璁㈠崟
     @track coc;
     @track cocId;
@@ -55,6 +31,7 @@
     @track consumableorderdetailsRecordsview = [];
     //杩斿搧鏄庣粏
     @track showGoodsofReturnList = [];
+    @track showGoodsofReturnListView = [];
     //鍏ュ簱鏄庣粏
     @track consumableInventory = [];
     //閿欒鏄庣粏
@@ -62,6 +39,8 @@
     //鎶ラ敊鎻愰啋
     @track errorMsgs = [];
     @track warningMsgs = [];
+    //鏄惁涓�鐩存樉绀烘彁绀�
+    @track isNoteStay = true;
 
     //鏄惁鏈夎鍛�
     get hasWarning(){
@@ -85,33 +64,33 @@
 
     //鏈鍒拌揣浜у搧姹囨�籧ols
     @track currentArrProdCols = [
-        {label:'浜у搧鍨嬪彿' , fieldName:'assetModelNo', hideDefaultActions: true},
-        {label:'浜у搧鍚嶇О' , fieldName:'prodName', hideDefaultActions: true},
-        {label:'鍒拌揣鏁伴噺' , fieldName:'arrivedCount', hideDefaultActions: true},
-        {label:'鍒拌揣閲戦' , fieldName:'arriveAmount', hideDefaultActions: true}
+        {label:'浜у搧鍨嬪彿' , fieldName:'assetModelNo', hideDefaultActions: true,wrapText:true,initialWidth:220},
+        {label:'浜у搧鍚嶇О' , fieldName:'prodName', hideDefaultActions: true,wrapText:true},
+        {label:'鍒拌揣鏁伴噺' , fieldName:'arrivedCount', hideDefaultActions: true,wrapText:true,initialWidth:220,cellAttributes: { alignment: "right" }},
+        {label:'鍒拌揣閲戦' ,type:'number',typeAttributes:{minimumFractionDigits: 2}, fieldName:'arriveAmount', hideDefaultActions: true,wrapText:true,initialWidth:220,cellAttributes: { alignment: "right" }}
     ];
     //鍒拌揣鏄庣粏cols
     @track arrDetailCols = [
-        {label:'娑堣�楀搧鍚嶇О' , fieldName:'prodName', hideDefaultActions: true},
-        {label:'瑙勬牸' , fieldName:'productPackingListManual', hideDefaultActions: true},
-        {label:'CFDA鐘舵��' , fieldName:'status', hideDefaultActions: true},
-        {label:'娉ㄥ唽璇佺紪鐮佸彿' , fieldName:'reportProductApprobation', hideDefaultActions: true},
-        {label:'娉ㄥ唽璇佹晥鏈�' , fieldName:'ReportProductExpirationDate', hideDefaultActions: true},
-        {label:'BarCode' , fieldName:'barCode', hideDefaultActions: true}
+        {label:'娑堣�楀搧鍚嶇О' , fieldName:'prodName', hideDefaultActions: true,wrapText:true},
+        {label:'瑙勬牸' , fieldName:'productPackingListManual', hideDefaultActions: true,wrapText:true,initialWidth:120,cellAttributes: { alignment: "right" }},
+        {label:'CFDA鐘舵��' , fieldName:'status', hideDefaultActions: true,wrapText:true,initialWidth:120},
+        {label:'娉ㄥ唽璇佺紪鐮佸彿' , fieldName:'reportProductApprobation', hideDefaultActions: true,wrapText:true,initialWidth:180},
+        {label:'娉ㄥ唽璇佹晥鏈�' , fieldName:'ReportProductExpirationDate', hideDefaultActions: true,wrapText:true,initialWidth:100},
+        {label:'BarCode' , fieldName:'barCode', hideDefaultActions: true,wrap:true,initialWidth:400}
     ];
     //杩斿搧鏄庣粏cols
     get returnDetailCols(){
         var cols = [];
-        cols.push({label:'鍑哄簱鍗�',fieldName:'orderUrl',type:'url',typeAttributes:{label:{fieldName:'orderNo'},target: "_blank"},hideDefaultActions: true});
+        cols.push({label:'鍑哄簱鍗�',fieldName:'orderUrl',type:'url',typeAttributes:{label:{fieldName:'orderNo'},target: "_blank"},hideDefaultActions: true,wrapText:true});
         // cols.push({label:'鍑哄簱鍗�' , fieldName:'orderNo', hideDefaultActions: true});
-        cols.push({label:'鍑哄簱鏃�' , fieldName:'prodOutDate', hideDefaultActions: true});
-        cols.push({label:'娑堣�楀搧鍚嶇О' , fieldName:'prodName', hideDefaultActions: true});
-        cols.push({label:'鍑哄簱鐩殑' , fieldName:'summonsForDirctionDet', hideDefaultActions: true});
-        cols.push({label:'瀹㈡埛鍚�' , fieldName:'hospitalName', hideDefaultActions: true});
-        cols.push({label:'缁忛攢鍟�' , fieldName:'orderDealer', hideDefaultActions: true});
-        cols.push({label:'BarCode' , fieldName:'barCode', hideDefaultActions: true});
-        cols.push({label:'浣跨敤鏈熼檺' , fieldName:'sterilizationLimit', hideDefaultActions: true});
-        cols.push({label:'鍗曚綅' , fieldName:'boxPiece', hideDefaultActions: true});
+        cols.push({label:'鍑哄簱鏃�' , fieldName:'prodOutDate',wrapText:true, hideDefaultActions: true,initialWidth:95});
+        cols.push({label:'娑堣�楀搧鍚嶇О' , fieldName:'prodName',wrapText:true, hideDefaultActions: true,wrapText:true,initialWidth:190});
+        cols.push({label:'鍑哄簱鐩殑' , fieldName:'summonsForDirctionDet',wrapText:true, hideDefaultActions: true,initialWidth:130});
+        cols.push({label:'瀹㈡埛鍚�' , fieldName:'hospitalName', hideDefaultActions: true,wrapText:true,initialWidth:130});
+        cols.push({label:'缁忛攢鍟�' , fieldName:'orderDealer', hideDefaultActions: true,wrapText:true,initialWidth:100});
+        cols.push({label:'BarCode' , fieldName:'barCode', hideDefaultActions: true,wrap:true,initialWidth:190});
+        cols.push({label:'浣跨敤鏈熼檺' , fieldName:'sterilizationLimit', hideDefaultActions: true,wrapText:true,initialWidth:95});
+        cols.push({label:'鍗曚綅' , fieldName:'boxPiece', hideDefaultActions: true,wrapText:true,initialWidth:50});
         cols.push({
             label:'杩斿搧鏁伴噺',
             type: "customReturnGoodInput",
@@ -120,7 +99,7 @@
                 boxPrice: { fieldName: "boxPiece" },
                 recordId: { fieldName: "recordId" }
             },
-            hideDefaultActions: true});
+            hideDefaultActions: true,wrapText:true,initialWidth:70});
         cols.push({
             label:'杩斿搧鍘熷洜',
             type: "customTableInput",
@@ -129,31 +108,32 @@
                     inputValue: { fieldName: "returnReason" },
                     valueType: 'Text'
                 },
-            hideDefaultActions: true,initialWidth:70});
+            hideDefaultActions: true,wrapText:true,initialWidth:100});
             // cols.push({label:'杩斿搧鍘熷洜' , fieldName:'returnReason', hideDefaultActions: true});
         return cols;
     }
     //鍏ュ簱鏄庣粏cols
     get inDetailCols(){
         var cols = [];
-        cols.push({label:'娑堣�楀搧鍚嶇О' , fieldName:'prodName', hideDefaultActions: true});
-        cols.push({label:'BarCode' , fieldName:'barCodeNo', hideDefaultActions: true});
-        cols.push({label:'浣跨敤鏈熼檺' , fieldName:'sterilizationlimitDate', hideDefaultActions: true});
-        cols.push({label:'serialNoorLotNo' , fieldName:'serialNoorLotNo', hideDefaultActions: true});
-        cols.push({label:'tracingCode' , fieldName:'tracingCodeNo', hideDefaultActions: true});
+        cols.push({label:'娑堣�楀搧鍚嶇О' , fieldName:'prodName', hideDefaultActions: true,wrapText:true});
+        cols.push({label:'BarCode' , fieldName:'barCodeNo', hideDefaultActions: true,wrapText:true,initialWidth:400});
+        cols.push({label:'浣跨敤鏈熼檺' , fieldName:'sterilizationlimitDate', hideDefaultActions: true,wrapText:true,initialWidth:100});
+        cols.push({label:'serialNoorLotNo' , fieldName:'serialNoorLotNo', hideDefaultActions: true,wrapText:true,initialWidth:140});
+        cols.push({label:'tracingCode' , fieldName:'tracingCodeNo', hideDefaultActions: true,wrapText:true,initialWidth:140});
         if(this.returnFLGbln){
-            cols.push({label:'杩斿搧鍘熷洜' , fieldName:'ReturnReason', hideDefaultActions: true});
+            cols.push({label:'杩斿搧鍘熷洜' , fieldName:'ReturnReason', hideDefaultActions: true,wrapText:true,initialWidth:150});
         }
         return cols;
     }
     //閿欒鏄庣粏cols
     @track errorDetailCols = [
-        {label:'娑堣�楀搧璁㈠崟' , fieldName:'consumableOrderMinor', hideDefaultActions: true},
-        {label:'娑堣�楀搧鍚嶇О' , fieldName:'prodName', hideDefaultActions: true},
-        {label:'BarCode' , fieldName:'barCode', hideDefaultActions: true},
-        {label:'鍗曚綅' , fieldName:'boxPiece', hideDefaultActions: true},
-        {label:'鏁伴噺' , fieldName:'intMark', hideDefaultActions: true},
-        {label:'閿欒鍘熷洜' , fieldName:'ErrorReason', hideDefaultActions: true}
+        // {label:'娑堣�楀搧璁㈠崟' , fieldName:'consumableOrderMinor', hideDefaultActions: true,wrapText:true},
+        {label:'娑堣�楀搧璁㈠崟',fieldName:'consumableOrderUrl',type:'url',typeAttributes:{label:{fieldName:'consumableOrderMinorName'},target: "_blank"},hideDefaultActions: true,wrapText:true,initialWidth:180},
+        {label:'娑堣�楀搧鍚嶇О' , fieldName:'prodName', hideDefaultActions: true,wrapText:true},
+        {label:'BarCode' , fieldName:'barCode', hideDefaultActions: true,wrapText:true,initialWidth:400},
+        {label:'鍗曚綅' , fieldName:'boxPiece', hideDefaultActions: true,wrapText:true,initialWidth:60},
+        {label:'鏁伴噺' , fieldName:'intMark', hideDefaultActions: true,wrapText:true,initialWidth:100,cellAttributes: { alignment: "right" }},
+        {label:'閿欒鍘熷洜' , fieldName:'ErrorReason', hideDefaultActions: true,initialWidth:280,wrapText:true}
     ];
 
     // 鑾峰彇鍙傛暟
@@ -174,10 +154,24 @@
         }
     }
 
+    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({arrType:this.arrType, eSetId:this.eSetId})
         .then(result=>{
+            this.isNoteStay = result.isNoteStay;
             this.arrController = result.arrGoodCon;
             console.log("this.arrController:"+this.arrController);
             if(result.result == 'Success'){
@@ -201,8 +195,8 @@
         .catch(error=>{
             this.showSpinner = false;
             this.showPage = true;
-            console.log("error:"+error);
-            this.showMyToast('鍒濆鍖栭〉闈㈠け璐�',error,'error');
+            console.log("error:"+JSON.stringify(error));
+            this.showMyToast('鍒濆鍖栭〉闈㈠け璐�',JSON.stringify(error),'error');
         })
     }
 
@@ -214,6 +208,13 @@
     //鏍规嵁barcode鎼滅储
     barcodeEntrys(){
         this.showSpinner = true;
+        this.detailsSummary = [];
+        this.consumableorderdetailsRecords = [];
+        this.consumableorderdetailsRecordsview = [];
+        this.showGoodsofReturnList = [];
+        this.showGoodsofReturnListView = [];
+        this.consumableInventory = [];
+        this.consumableorderdetailsRecordserror = [];
         searchProduct({
             barcode : this.barcode,
             arrControllerStr : this.arrController
@@ -226,64 +227,85 @@
                 this.coc = result.coc;
                 this.warningMsgs = result.warningMsgList;
                 this.errorMsgs = result.errorMsgList;
+                this.consumableInventory = result.consumableInventory;
                 this.detailsSummary = result.detailsSummary;
                 for(var i in this.detailsSummary){
                     if(this.detailsSummary[i].Prod != null){
                         this.detailsSummary[i]['recordId'] = this.detailsSummary[i].Prod.Id;
                         this.detailsSummary[i]['assetModelNo'] = this.detailsSummary[i].Prod.Asset_Model_No__c;
                         this.detailsSummary[i]['prodName'] = this.detailsSummary[i].Prod.Name__c;
-                        console.log('this.detailsSummary:'+this.detailsSummary[i]['recordId']+'---'+this.detailsSummary[i]['prodName']);
                     }
                 }
                 console.log('this.detailsSummary:'+JSON.stringify(this.detailsSummary));
                 this.consumableorderdetailsRecords = result.consumableorderdetailsRecords;
+                var consumableorderdetailsRecordsview = [];
                 for(var i in this.consumableorderdetailsRecords){
-                    if(this.consumableorderdetailsRecords[i].Prod != null){
-                        this.consumableorderdetailsRecords[i]['recordId'] = this.consumableorderdetailsRecords[i].Prod.Id;
-                        this.consumableorderdetailsRecords[i]['prodName'] = this.consumableorderdetailsRecords[i].Prod.Name__c;
-                    }
-                    if(this.consumableorderdetailsRecords[i].esd != null){
-                        this.consumableorderdetailsRecords[i]['productPackingListManual'] = this.consumableorderdetailsRecords[i].esd.ProductPacking_list_manual__c;
-                        this.consumableorderdetailsRecords[i]['status'] = this.consumableorderdetailsRecords[i].esd.CFDA_Status__c;
-                        this.consumableorderdetailsRecords[i]['reportProductApprobation'] = this.consumableorderdetailsRecords[i].esd.Report_Product_Approbation__c;
-                        this.consumableorderdetailsRecords[i]['barCode'] = this.consumableorderdetailsRecords[i].esd.Bar_Code__c;
-                    }
+                    consumableorderdetailsRecordsview.push(this.consumableorderdetailsRecords[i]);
                 }
-                console.log('this.consumableorderdetailsRecords:'+JSON.stringify(this.consumableorderdetailsRecords));
-                this.showGoodsofReturnList = result.showGoodsofReturnList;
-                for(var i in this.showGoodsofReturnList){
-                    if(this.showGoodsofReturnList[i].Prod != null){
-                        this.showGoodsofReturnList[i]['recordId'] = this.showGoodsofReturnList[i].Prod.Id;
-                        this.showGoodsofReturnList[i]['prodName'] = this.showGoodsofReturnList[i].Prod.Name__c;
-                    }
-                    if(this.showGoodsofReturnList[i].esd != null){
-                        if(this.showGoodsofReturnList[i].esd.Consumable_Shipment_order__c == '' || this.showGoodsofReturnList[i].esd.Consumable_Shipment_order__c == null){
-                            this.showGoodsofReturnList[i]['orderUrl'] = '/lexsummonscreat?ESetid='+this.showGoodsofReturnList[i].esd.Consumable_Sale_order__c;
-                            this.showGoodsofReturnList[i]['orderNo'] = this.showGoodsofReturnList[i].esd.Consumable_Sale_order__r.Name;
-                        }else{
-                            this.showGoodsofReturnList[i]['orderUrl'] = '/lexsummonscreat?ESetid='+this.showGoodsofReturnList[i].esd.Consumable_Shipment_order__c;
-                            this.showGoodsofReturnList[i]['orderNo'] = this.showGoodsofReturnList[i].esd.Consumable_Shipment_order__r.Name;
-                        }
-                        this.showGoodsofReturnList[i]['prodOutDate'] = this.showGoodsofReturnList[i].esd.Product_OutDate__c;
-                        this.showGoodsofReturnList[i]['summonsForDirctionDet'] = this.showGoodsofReturnList[i].esd.SummonsForDirction_det__c;
-                        this.showGoodsofReturnList[i]['hospitalName'] = this.showGoodsofReturnList[i].esd.HospItal_Name__c;
-                        this.showGoodsofReturnList[i]['orderDealer'] = this.showGoodsofReturnList[i].esd.Order_Dealer_Info__c;
-                        this.showGoodsofReturnList[i]['barCode'] = this.showGoodsofReturnList[i].esd.Bar_Code__c;
-                        this.showGoodsofReturnList[i]['sterilizationLimit'] = this.showGoodsofReturnList[i].esd.Sterilization_limit__c;
-                        this.showGoodsofReturnList[i]['boxPiece'] = this.showGoodsofReturnList[i].esd.Box_Piece__c;
-                        this.showGoodsofReturnList[i]['returnCount'] = this.showGoodsofReturnList[i].esd.Rrturn_count__c;
-                        console.log('returnCount:'+this.showGoodsofReturnList[i].esd.Rrturn_count__c);
-                        this.showGoodsofReturnList[i]['returnReason'] = this.showGoodsofReturnList[i].esd.Return_reason__c;
-                    }
-                }
-                console.log('this.showGoodsofReturnList:'+JSON.stringify(this.showGoodsofReturnList));
-                this.consumableInventory = result.consumableInventory;
                 for(var i in this.consumableInventory){
-                    if(this.consumableInventory[i].Prod != null){
-                        this.consumableInventory[i]['recordId'] = this.consumableInventory[i].Prod.Id;
-                        this.consumableInventory[i]['prodName'] = this.consumableInventory[i].Prod.Name__c;
+                    consumableorderdetailsRecordsview.push(this.consumableInventory[i]);
+                }
+                this.consumableorderdetailsRecordsview = consumableorderdetailsRecordsview;
+                for(var i in this.consumableorderdetailsRecordsview){
+                    if(this.consumableorderdetailsRecordsview[i].Prod != null){
+                        this.consumableorderdetailsRecordsview[i]['recordId'] = this.consumableorderdetailsRecordsview[i].Prod.Id;
+                        this.consumableorderdetailsRecordsview[i]['prodName'] = this.consumableorderdetailsRecordsview[i].Prod.Name__c;
+                    }
+                    if(this.consumableorderdetailsRecordsview[i].esd != null){
+                        this.consumableorderdetailsRecordsview[i]['productPackingListManual'] = this.consumableorderdetailsRecordsview[i].esd.ProductPacking_list_manual__c;
+                        this.consumableorderdetailsRecordsview[i]['status'] = this.consumableorderdetailsRecordsview[i].esd.CFDA_Status__c;
+                        this.consumableorderdetailsRecordsview[i]['reportProductApprobation'] = this.consumableorderdetailsRecordsview[i].esd.Report_Product_Approbation__c;
+                        this.consumableorderdetailsRecordsview[i]['barCode'] = this.consumableorderdetailsRecordsview[i].esd.Bar_Code__c;
                     }
                 }
+                console.log('len1:'+this.consumableorderdetailsRecords.length);
+                console.log('len2:'+this.consumableorderdetailsRecordsview.length);
+                console.log('this.consumableorderdetailsRecordsview:'+JSON.stringify(this.consumableorderdetailsRecordsview));
+                this.showGoodsofReturnList = result.showGoodsofReturnList;
+                var showGoodsofReturnListView = [];
+                for(var i in this.showGoodsofReturnList){
+                    showGoodsofReturnListView.push(this.showGoodsofReturnList[i]);
+                }
+                for(var i in this.consumableInventory){
+                    showGoodsofReturnListView.push(this.consumableInventory[i]);
+                }
+                this.showGoodsofReturnListView = showGoodsofReturnListView;
+                for(var i in this.showGoodsofReturnListView){
+                    if(this.showGoodsofReturnListView[i].Prod != null){
+                        this.showGoodsofReturnListView[i]['prodName'] = this.showGoodsofReturnListView[i].Prod.Name__c;
+                    }
+                    if(this.showGoodsofReturnListView[i].esd != null){
+                        if(this.showGoodsofReturnListView[i].esd.Consumable_Shipment_order__c != '' && this.showGoodsofReturnListView[i].esd.Consumable_Shipment_order__c != null){
+                            this.showGoodsofReturnListView[i]['recordId'] = this.showGoodsofReturnListView[i].esd.Consumable_Shipment_order__c;
+                            this.showGoodsofReturnListView[i]['orderUrl'] = '/lexsummonscreat?ESetid='+this.showGoodsofReturnListView[i].esd.Consumable_Shipment_order__c;
+                            this.showGoodsofReturnListView[i]['orderNo'] = this.showGoodsofReturnListView[i].esd.Consumable_Shipment_order__r.Name;
+                        }else if(this.showGoodsofReturnListView[i].esd.Consumable_Sale_order__c != '' && this.showGoodsofReturnListView[i].esd.Consumable_Sale_order__c != null){
+                            this.showGoodsofReturnListView[i]['recordId'] = this.showGoodsofReturnListView[i].esd.Consumable_Sale_order__c;
+                            this.showGoodsofReturnListView[i]['orderUrl'] = '/lexsummonscreat?ESetid='+this.showGoodsofReturnListView[i].esd.Consumable_Sale_order__c;
+                            this.showGoodsofReturnListView[i]['orderNo'] = this.showGoodsofReturnListView[i].esd.Consumable_Sale_order__r.Name;
+                        }
+                        this.showGoodsofReturnListView[i]['prodOutDate'] = this.showGoodsofReturnListView[i].esd.Product_OutDate__c;
+                        this.showGoodsofReturnListView[i]['summonsForDirctionDet'] = this.showGoodsofReturnListView[i].esd.SummonsForDirction_det__c;
+                        this.showGoodsofReturnListView[i]['hospitalName'] = this.showGoodsofReturnListView[i].esd.HospItal_Name__c;
+                        this.showGoodsofReturnListView[i]['orderDealer'] = this.showGoodsofReturnListView[i].esd.Order_Dealer_Info__c;
+                        this.showGoodsofReturnListView[i]['barCode'] = this.showGoodsofReturnListView[i].esd.Bar_Code__c;
+                        this.showGoodsofReturnListView[i]['sterilizationLimit'] = this.showGoodsofReturnListView[i].esd.Sterilization_limit__c;
+                        this.showGoodsofReturnListView[i]['boxPiece'] = this.showGoodsofReturnListView[i].esd.Box_Piece__c;
+                        this.showGoodsofReturnListView[i]['returnCount'] = this.showGoodsofReturnListView[i].esd.Rrturn_count__c;
+                        console.log('returnCount:'+this.showGoodsofReturnListView[i].esd.Rrturn_count__c);
+                        this.showGoodsofReturnListView[i]['returnReason'] = this.showGoodsofReturnListView[i].esd.Return_reason__c;
+                    }
+                }
+                console.log('len1:'+this.showGoodsofReturnList.length);
+                console.log('len2:'+this.showGoodsofReturnListView.length);
+                console.log('this.showGoodsofReturnListView:'+JSON.stringify(this.showGoodsofReturnListView));
+                // this.consumableInventory = result.consumableInventory;
+                // for(var i in this.consumableInventory){
+                //     if(this.consumableInventory[i].Prod != null){
+                //         this.consumableInventory[i]['recordId'] = this.consumableInventory[i].Prod.Id;
+                //         this.consumableInventory[i]['prodName'] = this.consumableInventory[i].Prod.Name__c;
+                //     }
+                // }
                 console.log('this.consumableInventory:'+JSON.stringify(this.consumableInventory));
                 this.consumableorderdetailsRecordserror = result.consumableorderdetailsRecordserror;
                 for(var i in this.consumableorderdetailsRecordserror){
@@ -293,6 +315,10 @@
                     }
                     if(this.consumableorderdetailsRecordserror[i].esd != null){
                         this.consumableorderdetailsRecordserror[i]['consumableOrderMinor'] = this.consumableorderdetailsRecordserror[i].esd.Consumable_order_minor__c;
+                        if(this.consumableorderdetailsRecordserror[i].esd.Consumable_order_minor__c != null){
+                            this.consumableorderdetailsRecordserror[i]['consumableOrderMinorName'] = this.consumableorderdetailsRecordserror[i].esd.Consumable_order_minor__r.Name;
+                            this.consumableorderdetailsRecordserror[i]['consumableOrderUrl'] = "/s/detail/"+this.consumableorderdetailsRecordserror[i].esd.Consumable_order_minor__c;
+                        }
                         this.consumableorderdetailsRecordserror[i]['barCode'] = this.consumableorderdetailsRecordserror[i].esd.Bar_Code__c;
                         this.consumableorderdetailsRecordserror[i]['boxPiece'] = this.consumableorderdetailsRecordserror[i].esd.Box_Piece__c;
                     }
@@ -311,7 +337,7 @@
         .catch(error=>{
             this.showSpinner = false;
             console.log("error:"+error);
-            this.showMyToast('鎼滅储澶辫触',error,'error');
+            this.showMyToast('鑾峰彇澶辫触',error,'error');
         })
     }
 
@@ -321,7 +347,6 @@
         var boxPrice = event.detail.data.boxPrice;
         var recordId = event.detail.data.recordId;
         console.log("杩斿搧鏁伴噺:"+value+boxPrice+"---"+recordId);
-        var showGood;
         for(var i in this.showGoodsofReturnList){
             if(this.showGoodsofReturnList[i]['recordId'] == recordId){
                 if(this.showGoodsofReturnList[i].canEdit){
@@ -414,12 +439,34 @@
         })
     }
 
-    showMyToast(title,message,variant){
-        const evt = new ShowToastEvent({
-           title : title,
-           message: message,
-           variant: variant
-        });
-        this.dispatchEvent(evt);
-    }
+    showMyToast(title, message, variant) {
+        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);
+     }
 }
\ No newline at end of file

--
Gitblit v1.9.1