buli
2023-07-05 af7b716a60d889acea95560abba0e46eee008b8f
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js
@@ -1,11 +1,11 @@
import { LightningElement,wire,track } from 'lwc';
import { CurrentPageReference } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
import init from '@salesforce/apex/LexArriveGoodsController.init';
import searchProduct from '@salesforce/apex/LexArriveGoodsController.searchProduct';
import arriveGoodsConfim from '@salesforce/apex/LexArriveGoodsController.arriveGoodsConfim';
import updateGoodsOfReturn from '@salesforce/apex/LexArriveGoodsController.updateGoodsOfReturn';
import { LightningElement, wire, track } from "lwc";
import { CurrentPageReference } from "lightning/navigation";
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import { NavigationMixin } from "lightning/navigation";
import init from "@salesforce/apex/LexArriveGoodsController.init";
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";
@@ -64,82 +64,287 @@
    //本次到货产品汇总cols
    @track currentArrProdCols = [
        {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" }}
    {
      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,wrapText:true},
        {label:'规格' , fieldName:'productPackingListManual', hideDefaultActions: true,wrapText:true,initialWidth:55,cellAttributes: { alignment: "right" }},
        {label:'CFDA状态' , fieldName:'status', hideDefaultActions: true,wrapText:true,initialWidth:120},
        {label:'注册证编码号' , fieldName:'reportProductApprobation', hideDefaultActions: true,wrapText:true,initialWidth:190},
        {label:'注册证效期' , fieldName:'ReportProductExpirationDate', hideDefaultActions: true,wrapText:true,initialWidth:110},
        {label:'BarCode' , fieldName:'barCode', hideDefaultActions: true,wrapText:true,initialWidth:400}
    {
      label: "消耗品名称",
      fieldName: "prodName",
      hideDefaultActions: true,
      wrapText: true
    },
    {
      label: "规格",
      fieldName: "productPackingListManual",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 55,
      cellAttributes: { alignment: "right" }
    },
    {
      label: "CFDA状态",
      fieldName: "status",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 120
    },
    {
      label: "注册证编码号",
      fieldName: "reportProductApprobation",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 190
    },
    {
      label: "注册证效期",
      fieldName: "ReportProductExpirationDate",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 110
    },
    {
      label: "BarCode",
      fieldName: "barCode",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 400
    }
    ];
    //返品明细cols
    get returnDetailCols(){
        var cols = [];
        cols.push({label:'出库单',fieldName:'orderUrl',type:'url',typeAttributes:{label:{fieldName:'orderNo'},target: "_blank"},hideDefaultActions: true,wrapText:true,initialWidth:180});
        // cols.push({label:'出库单' , fieldName:'orderNo', hideDefaultActions: true});
        cols.push({label:'出库日' , fieldName:'prodOutDate',wrapText:true, hideDefaultActions: true,initialWidth:110});
        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,wrapText:true,initialWidth:230});
        cols.push({label:'使用期限' , fieldName:'sterilizationLimit', hideDefaultActions: true,wrapText:true,initialWidth:110});
        cols.push({label:'单位' , fieldName:'boxPiece', hideDefaultActions: true,wrapText:true,initialWidth:50});
        cols.push({
            label:'返品数量',
      label: "出库单",
      fieldName: "orderUrl",
      type: "url",
      typeAttributes: {
        label: { fieldName: "orderNo" },
        target: "_blank"
      },
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 180
    });
    // cols.push({label:'出库单' , fieldName:'orderNo', hideDefaultActions: true});
    cols.push({
      label: "出库日",
      fieldName: "prodOutDate",
      wrapText: true,
      hideDefaultActions: true,
      initialWidth: 110
    });
    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,
      wrapText: true,
      initialWidth: 230
    });
    cols.push({
      label: "使用期限",
      fieldName: "sterilizationLimit",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 110
    });
    cols.push({
      label: "单位",
      fieldName: "boxPiece",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 50
    });
    cols.push({
      label: "返品数量",
            type: "customReturnGoodInput",
            typeAttributes: {
                inputValue: { fieldName: "returnCount" },
                boxPrice: { fieldName: "boxPiece" },
                recordId: { fieldName: "recordId" }
            },
            hideDefaultActions: true,wrapText:true,initialWidth:100});
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 100
    });
        cols.push({
            label:'返品原因',
      label: "返品原因",
            type: "customTableInput",
            typeAttributes: {
                    recordId: { fieldName: "recordId" },
                    inputValue: { fieldName: "returnReason" },
                    valueType: 'Text'
        valueType: "Text"
                },
            hideDefaultActions: true,wrapText:true,initialWidth:150});
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 150
    });
            // cols.push({label:'返品原因' , fieldName:'returnReason', hideDefaultActions: true});
        return cols;
    }
    //入库明细cols
    get inDetailCols(){
        var cols = [];
        cols.push({label:'消耗品名称' , fieldName:'prodName', hideDefaultActions: true,wrapText:true});
        cols.push({label:'BarCode' , fieldName:'barCodeNo', hideDefaultActions: true,wrapText:true,initialWidth:500});
        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});
    cols.push({
      label: "消耗品名称",
      fieldName: "prodName",
      hideDefaultActions: true,
      wrapText: true
    });
    cols.push({
      label: "BarCode",
      fieldName: "barCodeNo",
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 500
    });
    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,wrapText:true,initialWidth:150});
      cols.push({
        label: "返品原因",
        fieldName: "ReturnReason",
        hideDefaultActions: true,
        wrapText: true,
        initialWidth: 150
      });
        }
        return cols;
    }
    //错误明细cols
    @track errorDetailCols = [
        // {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}
    {
      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
    }
    ];
    // 获取参数
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
        console.log('CurrentPageReference');
    console.log("CurrentPageReference");
        if (currentPageReference) {
            this.arrType = currentPageReference.state?.ArrType;
            this.eSetId = currentPageReference.state?.ESetId;
@@ -147,7 +352,7 @@
    }
    get showOrderDetail(){
        if(this.eSetId != '' && this.eSetId != null){
    if (this.eSetId != "" && this.eSetId != null) {
            return true;
        }else{
            return false;
@@ -170,11 +375,11 @@
    //初始化
    connectedCallback(){
        init({arrType:this.arrType, eSetId:this.eSetId})
        .then(result=>{
      .then((result) => {
            this.isNoteStay = result.isNoteStay;
            this.arrController = result.arrGoodCon;
            console.log("this.arrController:"+this.arrController);
            if(result.result == 'Success'){
        if (result.result == "Success") {
                this.saveFLGbln = result.saveFLGbln;
                this.returnFLGbln = result.returnFLGbln;
                this.coc = result.coc;
@@ -189,15 +394,15 @@
                this.showSpinner = false;
                this.showPage = true;
                console.log("error:"+result.errorMsg);
                this.showMyToast('初始化页面失败',result.errorMsg,'error');
          this.showMyToast("初始化页面失败", result.errorMsg, "error");
            }
        })
        .catch(error=>{
      .catch((error) => {
            this.showSpinner = false;
            this.showPage = true;
            console.log("error:"+JSON.stringify(error));
            this.showMyToast('初始化页面失败',JSON.stringify(error),'error');
        })
        this.showMyToast("初始化页面失败", JSON.stringify(error), "error");
      });
    }
    //barcode change
@@ -212,9 +417,9 @@
            barcode : this.barcode,
            arrControllerStr : this.arrController
        })
        .then(result=>{
      .then((result) => {
            this.arrController = result.arrGoodCon;
            if(result.result == 'Success'){
        if (result.result == "Success") {
                this.saveFLGbln = result.saveFLGbln;
                this.returnFLGbln = result.returnFLGbln;
                this.coc = result.coc;
@@ -224,86 +429,162 @@
                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;
              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:'+JSON.stringify(this.detailsSummary));
                this.consumableorderdetailsRecords = result.consumableorderdetailsRecords;
          console.log(
            "this.detailsSummary:" + JSON.stringify(this.detailsSummary)
          );
          this.consumableorderdetailsRecords =
            result.consumableorderdetailsRecords;
                var consumableorderdetailsRecordsview = [];
                for(var i in this.consumableorderdetailsRecords){
                    this.consumableorderdetailsRecords[i]['dataType'] = 'DataileRecords';
                    consumableorderdetailsRecordsview.push(this.consumableorderdetailsRecords[i]);
            this.consumableorderdetailsRecords[i]["dataType"] =
              "DataileRecords";
            consumableorderdetailsRecordsview.push(
              this.consumableorderdetailsRecords[i]
            );
                }
                for(var i in this.consumableInventory){
                    this.consumableInventory[i]['dataType'] = 'Inventory';
            this.consumableInventory[i]["dataType"] = "Inventory";
                    consumableorderdetailsRecordsview.push(this.consumableInventory[i]);
                }
                this.consumableorderdetailsRecordsview = consumableorderdetailsRecordsview;
          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;
              this.consumableorderdetailsRecordsview[i]["recordId"] =
                this.consumableorderdetailsRecordsview[i].Prod.Id;
              this.consumableorderdetailsRecordsview[i]["prodName"] =
                this.consumableorderdetailsRecordsview[i].Prod.Name__c;
                    }
                    if(this.consumableorderdetailsRecordsview[i]['dataType'] == 'Inventory'){
                        this.consumableorderdetailsRecordsview[i]['barCode'] = this.consumableorderdetailsRecordsview[i].barCodeNo;
            if (
              this.consumableorderdetailsRecordsview[i]["dataType"] ==
              "Inventory"
            ) {
              this.consumableorderdetailsRecordsview[i]["barCode"] =
                this.consumableorderdetailsRecordsview[i].barCodeNo;
                    }else if(this.consumableorderdetailsRecordsview[i].esd != null){
                        this.consumableorderdetailsRecordsview[i]['barCode'] = this.consumableorderdetailsRecordsview[i].esd.Bar_Code__c;
              this.consumableorderdetailsRecordsview[i]["barCode"] =
                this.consumableorderdetailsRecordsview[i].esd.Bar_Code__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][
                "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;
                    }
                }
                console.log('len1:'+this.consumableorderdetailsRecords.length);
                console.log('len2:'+this.consumableorderdetailsRecordsview.length);
                console.log('this.consumableorderdetailsRecordsview:'+JSON.stringify(this.consumableorderdetailsRecordsview));
          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){
                    this.showGoodsofReturnList[i]['dataType'] = 'GoodsoOfReturn';
            this.showGoodsofReturnList[i]["dataType"] = "GoodsoOfReturn";
                    showGoodsofReturnListView.push(this.showGoodsofReturnList[i]);
                }
                for(var i in this.consumableInventory){
                    this.consumableInventory[i]['dataType'] = 'Inventory';
            this.consumableInventory[i]["dataType"] = "Inventory";
                    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;
              this.showGoodsofReturnListView[i]["prodName"] =
                this.showGoodsofReturnListView[i].Prod.Name__c;
                    }
                    if(this.showGoodsofReturnListView[i]['dataType'] == 'Inventory'){
                        this.showGoodsofReturnListView[i]['barCode'] = this.showGoodsofReturnListView[i].barCodeNo;
            if (this.showGoodsofReturnListView[i]["dataType"] == "Inventory") {
              this.showGoodsofReturnListView[i]["barCode"] =
                this.showGoodsofReturnListView[i].barCodeNo;
                    }else if(this.showGoodsofReturnListView[i].esd != null){
                        this.showGoodsofReturnListView[i]['barCode'] = this.showGoodsofReturnListView[i].esd.Bar_Code__c;
              this.showGoodsofReturnListView[i]["barCode"] =
                this.showGoodsofReturnListView[i].esd.Bar_Code__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;
              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]['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;
              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]["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));
          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){
@@ -311,41 +592,70 @@
                //         this.consumableInventory[i]['prodName'] = this.consumableInventory[i].Prod.Name__c;
                //     }
                // }
                console.log('this.consumableInventory:'+JSON.stringify(this.consumableInventory));
                this.consumableorderdetailsRecordserror = result.consumableorderdetailsRecordserror;
          console.log(
            "this.consumableInventory:" +
              JSON.stringify(this.consumableInventory)
          );
          this.consumableorderdetailsRecordserror =
            result.consumableorderdetailsRecordserror;
                for(var i in this.consumableorderdetailsRecordserror){
                    if(this.consumableorderdetailsRecordserror[i].Prod != null){
                        this.consumableorderdetailsRecordserror[i]['recordId'] = this.consumableorderdetailsRecordserror[i].Prod.Id;
                        this.consumableorderdetailsRecordserror[i]['prodName'] = this.consumableorderdetailsRecordserror[i].Prod.Name__c;
              this.consumableorderdetailsRecordserror[i]["recordId"] =
                this.consumableorderdetailsRecordserror[i].Prod.Id;
              this.consumableorderdetailsRecordserror[i]["prodName"] =
                this.consumableorderdetailsRecordserror[i].Prod.Name__c;
                    }
                    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][
                "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;
              this.consumableorderdetailsRecordserror[i]["barCode"] =
                this.consumableorderdetailsRecordserror[i].esd.Bar_Code__c;
              this.consumableorderdetailsRecordserror[i]["boxPiece"] =
                this.consumableorderdetailsRecordserror[i].esd.Box_Piece__c;
                    }
                }
                console.log('this.consumableorderdetailsRecordserror:'+JSON.stringify(this.consumableorderdetailsRecordserror));
          console.log(
            "this.consumableorderdetailsRecordserror:" +
              JSON.stringify(this.consumableorderdetailsRecordserror)
          );
                this.showSpinner = false;
                if(this.errorMsgs.length < 1){
                    this.showMyToast('获取成功','','success');
            this.showMyToast("获取成功", "", "success");
                }
            }else {
                this.showSpinner = false;
                this.warningMsgs = result.warningMsgList;
                this.errorMsgs = result.errorMsgList;
                console.log("error:"+result.errorMsg);
                this.showMyToast('获取失败',result.errorMsg,'error');
          this.showMyToast("获取失败", result.errorMsg, "error");
            }
        })
        .catch(error=>{
      .catch((error) => {
            this.showSpinner = false;
            console.log("error:"+error);
            this.showMyToast('获取失败',error,'error');
        })
        this.showMyToast("获取失败", error, "error");
      });
    }
    //返品数量change
@@ -355,13 +665,15 @@
        var recordId = event.detail.data.recordId;
        console.log("返品数量:"+value+boxPrice+"---"+recordId);
        for(var i in this.showGoodsofReturnList){
            if(this.showGoodsofReturnList[i]['recordId'] == recordId){
      if (this.showGoodsofReturnList[i]["recordId"] == recordId) {
                if(this.showGoodsofReturnList[i].canEdit){
                    this.showGoodsofReturnList[i].esd.Rrturn_count__c = 1;
                    this.showGoodsofReturnList[i]['returnCount'] = this.showGoodsofReturnList[i].esd.Rrturn_count__c;
          this.showGoodsofReturnList[i]["returnCount"] =
            this.showGoodsofReturnList[i].esd.Rrturn_count__c;
                }else{
                    this.showGoodsofReturnList[i].esd.Rrturn_count__c = value;
                    this.showGoodsofReturnList[i]['returnCount'] = this.showGoodsofReturnList[i].esd.Rrturn_count__c;
          this.showGoodsofReturnList[i]["returnCount"] =
            this.showGoodsofReturnList[i].esd.Rrturn_count__c;
                }
            }
        }
@@ -373,9 +685,10 @@
        var value = event.detail.data.value;
        console.log("返品原因:"+value+"---"+recordId);
        for(var i in this.showGoodsofReturnList){
            if(this.showGoodsofReturnList[i]['recordId'] == recordId){
      if (this.showGoodsofReturnList[i]["recordId"] == recordId) {
                this.showGoodsofReturnList[i].esd.Return_reason__c = value;
                this.showGoodsofReturnList[i]['returnReason'] = this.showGoodsofReturnList[i].esd.Return_reason__c;
        this.showGoodsofReturnList[i]["returnReason"] =
          this.showGoodsofReturnList[i].esd.Return_reason__c;
            }
        }
    }
@@ -384,15 +697,15 @@
    arriveGoodsConfim(){
        this.showSpinner = true;
        arriveGoodsConfim({arrControllerStr : this.arrController})
        .then(result=>{
      .then((result) => {
            this.arrController = result.arrGoodCon;
            if(result.result == 'Success'){
        if (result.result == "Success") {
                this.showSpinner = false;
                this.warningMsgs = result.warningMsgList;
                this.errorMsgs = result.errorMsgList;
                var url = result.url;
                const config = {
                    type: 'standard__webPage',
            type: "standard__webPage",
                    attributes: {
                       url: url
                    }
@@ -403,29 +716,32 @@
                this.warningMsgs = result.warningMsgList;
                this.errorMsgs = result.errorMsgList;
                console.log("error1:"+result.errorMsg);
                this.showMyToast('到货确认失败',result.errorMsg,'error');
          this.showMyToast("到货确认失败", result.errorMsg, "error");
            }
        })
        .catch(error=>{
      .catch((error) => {
            this.showSpinner = false;
            console.log("error2:"+error);
            this.showMyToast('到货确认失败',error,'error');
        })
        this.showMyToast("到货确认失败", error, "error");
      });
    }
    // 登录返品
    updateGoodsOfReturn(){
        this.showSpinner = true;
        updateGoodsOfReturn({arrControllerStr : this.arrController,showGoodsofReturnListStr : JSON.stringify(this.showGoodsofReturnList)})
        .then(result=>{
    updateGoodsOfReturn({
      arrControllerStr: this.arrController,
      showGoodsofReturnListStr: JSON.stringify(this.showGoodsofReturnList)
    })
      .then((result) => {
            this.showSpinner = false;
            this.arrController = result.arrGoodCon;
            if(result.result == 'Success'){
        if (result.result == "Success") {
                this.warningMsgs = result.warningMsgList;
                this.errorMsgs = result.errorMsgList;
                var url = result.url;
                const config = {
                    type: 'standard__webPage',
            type: "standard__webPage",
                    attributes: {
                       url: url
                    }
@@ -436,35 +752,37 @@
                this.showSpinner = false;
                this.warningMsgs = result.warningMsgList;
                this.errorMsgs = result.errorMsgList;
                if(result.errorMsg.includes('无法保存此记录')){
                    result.errorMsg = '无法保存记录';
          if (result.errorMsg.includes("无法保存此记录")) {
            result.errorMsg = "无法保存记录";
                }
                this.showMyToast('登录返品失败',result.errorMsg,'error');
          this.showMyToast("登录返品失败", result.errorMsg, "error");
            }
        })
        .catch(error=>{
      .catch((error) => {
            this.showSpinner = false;
            console.log("error2:"+JSON.stringify(error));
            this.showMyToast('登录返品失败',error,'error');
        })
        this.showMyToast("登录返品失败", error, "error");
      });
    }
    showMyToast(title, message, variant) {
        console.log('show custom message');
        var iconName = '';
        var content = '';
        if(variant == 'success'){
           iconName = 'utility:check';
    console.log("show custom message");
    var iconName = "";
    var content = "";
    if (variant == "success") {
      iconName = "utility:check";
        }else{
           iconName = 'utility:error';
      iconName = "utility:error";
        }
        if(message != ''){
           content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
    if (message != "") {
      content =
        "<h2><strong>" + title + "<strong/></h2><h5>" + message + "</h5>";
        }else{
           content = '<h2><strong>'+title+'<strong/></h2>';
      content = "<h2><strong>" + title + "<strong/></h2>";
        }
        this.template.querySelector('c-common-toast').
        showToast(variant,content,iconName,10000);
    this.template
      .querySelector("c-common-toast")
      .showToast(variant, content, iconName, 10000);
        // var mode;
        // if(this.isNoteStay){
        //     mode ='sticky';