buli
2023-06-05 d324588faa5120c95321425a06de683e8aae445b
force-app/main/default/lwc/lexInventory/lexInventory.js
@@ -393,10 +393,10 @@
         }
      }
      if(this.barcode == ''||this.barcode == null){
         this.showMyToast('获取失败','请输入BarCode号','error');
      // if(this.barcode == ''||this.barcode == null){
      //    this.showMyToast('获取失败','请输入BarCode号','error');
      }
      // }
      console.log('this.data--->'+JSON.stringify(this.data));
      console.log('this.currentPageToken'+this.currentPageToken);
      this.selectedRows = [];
@@ -450,7 +450,7 @@
                  }
                  this.iSinventory = result.entity.iSinventory;
                  this.pandiandetailsMap = result.entity.pandiandetailsMap;
                  this.reSet = result.entity.reSet;
                  this.reSet = result.entity.reSet1;
                  console.log("iSinventory:" + this.iSinventory);
                  this.showTable = true;
                  this.showbutton = true;
@@ -518,19 +518,19 @@
      this.barcode = value;
   }
   // getSelectedRows(event) {
   //       let selectedRowsEvent = event.detail.selectedRows;
   //        this.selectedRows = [];
   //        for (var i in selectedRowsEvent) {
   //            this.selectedRows.push(selectedRowsEvent[i].ProdId+this.data[i]["boxPiece"]);
   //        }
   //    const selectedRows = event.detail.selectedRows;
   //    console.log("this.selectedRows = " + JSON.stringify(selectedRows));
   //    for (var i in selectedRows) {
   //       this.selectedRows.push(selectedRows[i].ProdId+this.data[i]["boxPiece"]);
   //    }
   getSelectedRows(event) {
         let selectedRowsEvent = event.detail.selectedRows;
          this.selectedRows = [];
          for (var i in selectedRowsEvent) {
              this.selectedRows.push(selectedRowsEvent[i].ProdId+this.data[i]["boxPiece"]);
          }
      const selectedRows = event.detail.selectedRows;
      console.log("this.selectedRows = " + JSON.stringify(selectedRows));
      for (var i in selectedRows) {
         this.selectedRows.push(selectedRows[i].ProdId+this.data[i]["boxPiece"]);
      }
   // }
   }
   //导出为csv
   exportData() {
@@ -593,13 +593,34 @@
      console.log('reSet' + this.reSet);
      this.showSpinner = true;
      console.log('pandiandetailsMap' + this.pandiandetailsMap);
      var el = this.template.querySelector("c-lex-custom-lightning-datatable");
      var selected = el.getSelectedRows();
      this.selectedData = selected;
      console.log("选中数据" + JSON.stringify(this.selectedData));
      //查询有哪些选择了的然后check
      const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
      console.log('selectedRows========> ' + JSON.stringify(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].ProdId+this.data[i]["boxPiece"] == selectedRows[j].ProdId+ selectedRows[j]["boxPiece"]) {
               this.data[i]["check"] = true;
            }
            // console.log('this.data[i].ProdId+this.data[i]["boxPiece"]'+this.data[i].ProdId+this.data[i]["boxPiece"]);
            console.log('selectedRows[j].ProdId+this.data[i]["boxPiece"]'+selectedRows[j].ProdId+selectedRows[j]["boxPiece"]);
         }
      }
      // var el = this.template.querySelector("c-lex-custom-lightning-datatable");
      // var selected = el.getSelectedRows();
      // this.selectedData = selected;
      // console.log("选中数据" + JSON.stringify(this.selectedData));
      // console.log("reset" + JSON.stringify(this.reSet));
      // console.log("reset1" + JSON.stringify(this.reSet1));
      // console.log("r" + JSON.stringify(this.reSet1));
      save({
         iSinventory: this.iSinventory,
         consumableorderdetailsRecordsLWC: JSON.stringify(this.selectedData),
         consumableorderdetailsRecordsLWC:JSON.stringify(this.data),
         accountid: this.accountid,
         agencyProType: this.agencyProType,
         reSet: this.reSet,
@@ -611,7 +632,7 @@
            console.log("111111");
            if (result.status == "Success") {
               let url = "/lexInventory?ESetid=" + result.entity.eSetId;
               let url = "/lexinventory?ESetid=" + result.entity.eSetId;
               this[NavigationMixin.Navigate]({
                  type: "standard__webPage",
                  attributes: {