buli
2023-05-23 07390e2fcb4adf27c928335bf27ae7939c5a80ad
force-app/main/default/lwc/lexInventory/lexInventory.js
@@ -1,11 +1,15 @@
import { LightningElement, wire, api, track } from "lwc";
import oninit from "@salesforce/apex/LexInventoryController.init";
// import sheetjs from '@salesforce/resourceUrl/sheetjs';
import barcodeEntry from "@salesforce/apex/LexInventoryController.searchConsumableorderdetails";
// import saveConfirm from '@salesforce/apex/LexInventoryController.saveConfirm';
import save from "@salesforce/apex/LexInventoryController.save";
import datainit from "@salesforce/apex/LexInventoryListController.init";
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import { NavigationMixin } from "lightning/navigation";
//table css
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
//库存盘点主页面数据
const columns = [
@@ -14,64 +18,90 @@
      fieldName: "iscount",
      hideDefaultActions: true,
      initialWidth: 80,
      cellAttributes: { alignment: "left" },
   },
   {
      label: "消耗品名称",
      fieldName: "Name__c",
      hideDefaultActions: true,
      initialWidth: 250,
      cellAttributes: { alignment: "left" },
      // initialWidth: 400,
      wrapText:true
   },
   {
      label: "规格",
      initialWidth: 50,
      fieldName: "Packing_list_manual__c",
      cellAttributes: { alignment: "right" },
      hideDefaultActions: true,
   },
   {
      label: "单位",
      fieldName: "boxPiece",
      initialWidth: 50,
      hideDefaultActions: true,
   },
   {
      label: "有效期内库存",
      fieldName: "limitCount",
      initialWidth: 120,
      hideDefaultActions: true,
      cellAttributes: { alignment: "right" },
   },
   {
      label: "过期库存",
      initialWidth: 100,
      fieldName: "overlimitCount",
      hideDefaultActions: true,
      initialWidth: 100,
      cellAttributes: { alignment: "right" },
   },
   {
      label: "盘点",
      initialWidth: 50,
      fieldName: "Pandian",
      hideDefaultActions: true,
      initialWidth: 100,
      cellAttributes: { alignment: "right" },
   },
   {
      label: "丢失",
      initialWidth: 50,
      fieldName: "Diff",
      hideDefaultActions: true,
      initialWidth: 100,
      cellAttributes: { alignment: "right" },
   },
   {
      label: "寻回   ",
      label: "寻回",
      initialWidth: 50,
      fieldName: "refind",
      hideDefaultActions: true,
      initialWidth: 150,
      cellAttributes: { alignment: "right" },
   },
   {
      label: "差异原因",
      // fieldName: "DiffReason",
      initialWidth: 200,
      hideDefaultActions: true,
      type: "customDiffReason",
      typeAttributes: {
         DiffReason: { fieldName: "DiffReason" },
         ProdId: { fieldName: "ProdId" },
         boxPiece: { fieldName: "boxPiece" }
      },
   },
];
@@ -80,24 +110,29 @@
   {
      label: "消耗品名称",
      fieldName: "Name__c",
      wrapText: true,
      hideDefaultActions: true,
      cellAttributes: { alignment: "left" },
   },
   {
      label: "单位",
      fieldName: "Box_Piece__c",
      hideDefaultActions: true,
      initialWidth: 50,
   },
   {
      label: "BarCode",
      fieldName: "Bar_Code__c",
      hideDefaultActions: true,
      // initialWidth: 150,
      wrapText: true,
       initialWidth: 500,
   },
   {
      label: "调整原因",
      fieldName: "DiffReason",
      hideDefaultActions: true,
      wrapText: true,
   },
];
//盘点明细
@@ -106,36 +141,48 @@
      label: "消耗品名称",
      fieldName: "Name__c",
      hideDefaultActions: true,
      initialWidth: 250,
      // initialWidth: 250,
      wrapText: true,
      cellAttributes: { alignment: "left" },
   },
   {
      label: "库存",
      fieldName: "Count_Sum__c",
      hideDefaultActions: true,
      initialWidth: 100,
      cellAttributes: { alignment: "right" },
   },
   {
      label: "盘点",
      fieldName: "inventory_sum__c",
      hideDefaultActions: true,
      initialWidth: 150,
      initialWidth: 100,
      cellAttributes: { alignment: "right" },
   },
   {
      label: "丢失",
      fieldName: "Diff__c",
      hideDefaultActions: true,
      initialWidth: 100,
      cellAttributes: { alignment: "right" },
   },
   {
      label: "寻回",
      fieldName: "Product_Refind__c",
      hideDefaultActions: true,
      initialWidth: 100,
      cellAttributes: { alignment: "right" },
   },
   {
      label: "差异原因",
      fieldName: "Lose_reason__c",
      hideDefaultActions: true,
   },
];
@@ -145,24 +192,28 @@
      label: "消耗品名称",
      fieldName: "Name__c",
      wrapText: true,
      cellAttributes: { alignment: "left" },
      hideDefaultActions: true,
   },
   {
      label: "产品型号",
      fieldName: "Asset_Model_No__c",
      hideDefaultActions: true,
   },
   {
      label: "差异原因",
      fieldName: "Lose_reason__c",
      hideDefaultActions: true,
      initialWidth: 150,
   },
   {
      label: "是否丢失",
      type: "boolean",
      fieldName: "Lose_Flag__c",
      hideDefaultActions: true,
   },
];
@@ -195,7 +246,7 @@
   //分页start
   @track sortBy = "";
   @track sortDirection = "asc";
   @track pageSize = 5;
   @track pageSize = 10;
   error;
   records;
   currentPageToken = 0;
@@ -205,7 +256,7 @@
   @track pageNumber = 1;
   @track paginationVisibility = false;
   @track totalPages = 1;
   pageSizeOptions = [5, 10, 25, 50, 75, 100];
   pageSizeOptions = [10, 25, 50, 100];
   @track recordStart = 0;
   @track recordEnd = 0;
   //end
@@ -229,6 +280,11 @@
   @track conId;
   @track detailData = [];
   @track adjustdata = [];
   @track detalipan = [];
   //导出csv
   xlsDataHeader = ['消耗品名称', '单位', 'barCode', '调整原因'];
   //获取链接参数
   getQueryString(name) {
@@ -240,10 +296,23 @@
      }
      return null;
   }
   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() {
      console.log("===>初始化");
      //获取ESetid
      this.eSetId = this.getQueryString("eSetId");
      this.eSetId = this.eSetId == null ? "" : this.eSetId;
@@ -256,52 +325,49 @@
         this.showcount = false;
         this.EditAble = true;
      }
   }
   init(){
   init() {
      this.showSpinner = true;
      oninit()
      .then((result) => {
         console.log("1112" + JSON.stringify(result));
         result = JSON.parse(JSON.stringify(result));
         console.log("result.status = " + result.status);
         console.log("ConsumableorderdetailsRecordsview= " + result.entity.ConsumableorderdetailsRecordsview);
         this.ConsumableorderdetailsRecordsview = JSON.parse(result.entity.ConsumableorderdetailsRecordsview);
         this.consumableorderdetailsRecords = result.entity.consumableorderdetailsRecords;
         console.log("consumableorderdetailsRecords= " + result.entity.consumableorderdetailsRecords);
         console.log("传参类型", typeof this.consumableorderdetailsRecords);
         if (result.status == "Success") {
            this.data = [];
            this.data = this.ConsumableorderdetailsRecordsview[0];
            console.log("this.data ==>" + JSON.stringify(this.data));
            for (let i in this.data) {
               this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
               this.data[i]["Packing_list_manual__c"] = this.data[i].Prod.Packing_list_manual__c;
         .then((result) => {
            console.log("1112" + JSON.stringify(result));
            result = JSON.parse(JSON.stringify(result));
            console.log("result.status = " + result.status);
            console.log("ConsumableorderdetailsRecordsview= " + result.entity.ConsumableorderdetailsRecordsview);
            this.ConsumableorderdetailsRecordsview = JSON.parse(result.entity.ConsumableorderdetailsRecordsview);
            this.consumableorderdetailsRecords = result.entity.consumableorderdetailsRecords;
            console.log("consumableorderdetailsRecords= " + result.entity.consumableorderdetailsRecords);
            console.log("传参类型", typeof this.consumableorderdetailsRecords);
            if (result.status == "Success") {
               this.data = [];
               this.data = this.ConsumableorderdetailsRecordsview[0];
               console.log("this.data ==>" + JSON.stringify(this.data));
               for (let i in this.data) {
                  this.data[i]["key"] = this.data[i]["ProdId"] + this.data[i]["boxPiece"];
                  this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
                  this.data[i]["Packing_list_manual__c"] = this.data[i].Prod.Packing_list_manual__c;
               }
               this.accountName = result.entity.accountName;
               this.agencyProType = result.entity.agencyProType;
               this.userWorkLocation = result.entity.userWorkLocation;
               this.showSpinner = false;
               this.accountid = result.entity.accountid;
               this.showTable = true;
            } else {
               this.showMyToast('初始化失败',result.msg,'error');
               this.showSpinner = false;
            }
            this.accountName = result.entity.accountName;
            this.agencyProType = result.entity.agencyProType;
            this.userWorkLocation = result.entity.userWorkLocation;
         })
         .catch((error) => {
            console.log("error = " + JSON.stringify(error));
            this.showSpinner = false;
            this.accountid = result.entity.accountid;
            this.showTable = true;
         } else {
            console.log("Error:" + result.errorMsg);
            const evt = new ShowToastEvent({
               title: "解析失败",
               message: result.errorMsg,
               variant: "error",
            });
            this.dispatchEvent(evt);
         }
      })
      .catch((error) => {
         console.log("error = " + JSON.stringify(error));
      });
   //默认展开栏
   this.activeSections = ["dataExpand"];
   this.showTable = false;
   this.showbutton = false;
         });
      //默认展开栏
      this.activeSections = ["dataExpand"];
      this.showTable = false;
      this.showbutton = false;
   }
   //录入barcode
@@ -310,20 +376,30 @@
      this.showTable = false;
      this.showbutton = false;
      this.showSpinner = true;
      this.selectedRows = [];
        //查询有哪些选择了的然后check
        const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
        console.log('selectedRows========> ' + JSON.stringify(selectedRows));
        for (var i in this.data) {
      //查询有哪些选择了的然后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 == selectedRows[j].ProdId) {
            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"]);
         }
      }
      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 = [];
      barcodeEntry({
         accountName: this.accountName,
         agencyProType: this.agencyProType,
@@ -340,36 +416,46 @@
            result = JSON.parse(JSON.stringify(result));
            console.log("result ===>" + JSON.stringify(result));
            if (result.status == "Success1") {
               console.log('test');
               this.codPageRecords = JSON.parse(result.entity.codPageRecords);
               for (var i in this.codPageRecords) {
                  this.codPageRecords[i]["Name__c"] = this.codPageRecords[i].Prod.Name__c;
                  this.codPageRecords[i]["Box_Piece__c"] = this.codPageRecords[i].orderdetails2.Box_Piece__c;
                  this.codPageRecords[i]["Bar_Code__c"] = this.codPageRecords[i].orderdetails2.Bar_Code__c;
               }
               this.data = JSON.parse(result.entity.consumableorderdetailsRecords);
               for (var i in this.data) {
                  this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
                  this.data[i]["Packing_list_manual__c"] = this.data[i].Prod.Packing_list_manual__c;
               }
               for (var i in this.data) {
                  if (this.data[i]["check"]) {
                     this.selectedRows.push(this.data[i].ProdId);
                     console.log("selectedRows:" + this.selectedRows);
                  //分页start
                  this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
                  this.totalRecords = result.entity.paginatedAccounts.totalRecords;
                  this.recordStart = result.entity.paginatedAccounts.recordStart;
                  this.recordEnd = result.entity.paginatedAccounts.recordEnd;
                  this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize);
                  console.log('this.totalPages = ' + this.totalPages);
                  this.paginationVisibility = this.totalPages > 1 ? true : false;
                  console.log('this.sortDirection = ' + this.sortDirection);
                  //分页end
                  this.codPageRecords = JSON.parse(result.entity.codPageRecords);
                  for (var i in this.codPageRecords) {
                     this.codPageRecords[i]["Name__c"] = this.codPageRecords[i].Prod.Name__c;
                     this.codPageRecords[i]["Box_Piece__c"] = this.codPageRecords[i].orderdetails2.Box_Piece__c;
                     this.codPageRecords[i]["Bar_Code__c"] = this.codPageRecords[i].orderdetails2.Bar_Code__c;
                  }
               }
               this.iSinventory = result.entity.iSinventory;
               this.pandiandetailsMap = result.entity.pandiandetailsMap;
               this.reSet1 = result.entity.reSet1;
               console.log("iSinventory:" + this.iSinventory);
               this.showTable = true;
               this.showbutton = true;
               this.showSpinner = false;
               console.log('status2');
               console.log('pandiandetailsMap' + this.pandiandetailsMap);
               console.log("this.codPageRecords=11111 " + result.entity.codPageRecords);
               console.log("result录入= " + JSON.stringify(result));
               console.log("result主页数据= " + result.entity.consumableorderdetailsRecords);
                  this.pageCodeRecords = result.entity.pageCodeRecords;
                  for (var i in this.pageCodeRecords) {
                     this.pageCodeRecords[i]["Name__c"] = this.pageCodeRecords[i].Prod.Name__c;
                     this.pageCodeRecords[i]["Box_Piece__c"] = this.pageCodeRecords[i].orderdetails2.Box_Piece__c;
                     this.pageCodeRecords[i]["Bar_Code__c"] = this.pageCodeRecords[i].orderdetails2.Bar_Code__c;
                  }
                  this.data = JSON.parse(result.entity.consumableorderdetailsRecords);
                  for (var i in this.data) {
                     this.data[i]["key"] = this.data[i]["ProdId"] + this.data[i]["boxPiece"];
                     this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
                     this.data[i]["Packing_list_manual__c"] = this.data[i].Prod.Packing_list_manual__c;
                     if (this.data[i]["check"]) {
                        this.selectedRows.push(this.data[i].ProdId + this.data[i]["boxPiece"]);
                        console.log("selectedRows:" + this.selectedRows);
                     }
                  }
                  this.iSinventory = result.entity.iSinventory;
                  this.pandiandetailsMap = result.entity.pandiandetailsMap;
                  this.reSet = result.entity.reSet;
                  console.log("iSinventory:" + this.iSinventory);
                  this.showTable = true;
                  this.showbutton = true;
                  this.showSpinner = false;
                  console.log("result录入= " + JSON.stringify(result));
            }
            else {
               if (result.status == "Sucess") {
@@ -383,26 +469,25 @@
                  this.paginationVisibility = this.totalPages > 1 ? true : false;
                  console.log('this.sortDirection = ' + this.sortDirection);
                  //分页end
                  // this.codPageRecords = JSON.parse(result.entity.codPageRecords);
                  this.codPageRecords = JSON.parse(result.entity.codPageRecords);
                  for (var i in this.codPageRecords) {
                     this.codPageRecords[i]["Name__c"] = this.codPageRecords[i].Prod.Name__c;
                     this.codPageRecords[i]["Box_Piece__c"] = this.codPageRecords[i].orderdetails2.Box_Piece__c;
                     this.codPageRecords[i]["Bar_Code__c"] = this.codPageRecords[i].orderdetails2.Bar_Code__c;
                  }
                  this.pageCodeRecords = result.entity.pageCodeRecords;
                  for (var i in this.pageCodeRecords) {
                     this.pageCodeRecords[i]["Name__c"] = this.pageCodeRecords[i].Prod.Name__c;
                     this.pageCodeRecords[i]["Box_Piece__c"] = this.pageCodeRecords[i].orderdetails2.Box_Piece__c;
                     this.pageCodeRecords[i]["Bar_Code__c"] = this.pageCodeRecords[i].orderdetails2.Bar_Code__c;
                  }
                  // for (var i in this.codPageRecords) {
                  //    this.codPageRecords[i]["Name__c"] = this.codPageRecords[i].Prod.Name__c;
                  //    this.codPageRecords[i]["Box_Piece__c"] = this.codPageRecords[i].orderdetails2.Box_Piece__c;
                  //    this.codPageRecords[i]["Bar_Code__c"] = this.codPageRecords[i].orderdetails2.Bar_Code__c;
                  // }
                  this.data = JSON.parse(result.entity.consumableorderdetailsRecords);
                  for (var i in this.data) {
                     this.data[i]["key"] = this.data[i]["ProdId"] + this.data[i]["boxPiece"];
                     this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
                     this.data[i]["Packing_list_manual__c"] = this.data[i].Prod.Packing_list_manual__c;
                  }
                  for (var i in this.data) {
                     if (this.data[i]["check"]) {
                        this.selectedRows.push(this.data[i].ProdId);
                        this.selectedRows.push(this.data[i].ProdId + this.data[i]["boxPiece"]);
                        console.log("selectedRows:" + this.selectedRows);
                     }
                  }
@@ -416,12 +501,7 @@
                  console.log("result录入= " + JSON.stringify(result));
               } else {
                  console.log('Error:' + result.msg);
                  const evt = new ShowToastEvent({
                     title: '',
                     message: result.msg,
                     variant: 'error'
                  });
                  this.dispatchEvent(evt);
                  this.showMyToast(result.msg,'','error');
                  this.showSpinner = false;
                  this.showTable = true;
               }
@@ -438,57 +518,58 @@
      this.barcode = value;
   }
   getSelectedRows(event) {
      let selectedRowsEvent = event.detail.selectedRows;
        this.selectedRows = [];
        for (var i in selectedRowsEvent) {
            this.selectedRows.push(selectedRowsEvent[i].ProdId)
        }
      // const selectedRows = event.detail.selectedRows;
      // console.log("this.selectedRows = " + JSON.stringify(selectedRows));
      // for (var i in selectedRows) {
      //    this.selectedRows.push(selectedRows[i].ProdId);
      // }
   // 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() {
      console.log("导出");
      // Prepare a html table
      let doc = "<table>";
      let doc = '<table>';
      // Add styles for the table
      doc += "<style>";
      doc += "table, th, td {";
      doc += "    border: 1px solid black;";
      doc += "    border-collapse: collapse;";
      doc += "}";
      doc += "</style>";
      doc += '<style>';
      doc += 'table, th, td {';
      doc += '    border: 1px solid black;';
      doc += '    border-collapse: collapse;';
      doc += '}';
      doc += '</style>';
      // Add all the Table Headers
      doc += "<tr>";
      this.columnHeader.forEach((element) => {
         doc += "<th>" + element + "</th>";
      doc += '<tr>';
      this.columnHeader.forEach(element => {
         doc += '<th>' + element + '</th>'
      });
      doc += "</tr>";
      doc += '</tr>';
      // Add the data rows
      this.codPageRecords.forEach((record) => {
         doc += "<tr>";
         doc += "<th>" + record.Name__c + "</th>";
         doc += "<th>" + record.Box_Piece__c + "</th>";
         doc += "<th>" + record.Bar_Code__c + "</th>";
         doc += "<th>" + record.DiffReason + "</th>";
         doc += "</tr>";
      this.codPageRecords.forEach(record => {
         doc += '<tr>';
         doc += '<th>' + record.Name__c + '</th>';
         doc += '<th>' + record.Box_Piece__c + '</th>';
         doc += '<th>' + record.Bar_Code__c + '</th>';
         doc += '<th>' + record.DiffReason + '</th>';
         doc += '</tr>';
      });
      doc += "</table>";
      var element = "data:application/vnd.ms-excel," + encodeURIComponent(doc);
      let downloadElement = document.createElement("a");
      doc += '</table>';
      console.log('doc' + doc);
      var element = 'data:application/vnd.ms-excel,' + encodeURIComponent(doc);
      let downloadElement = document.createElement('a');
      downloadElement.href = element;
      downloadElement.target = "_self";
      downloadElement.target = '_self';
      // use .csv as extension on below line if you want to export data as csv
      downloadElement.download = "库存变化明细.xls";
      downloadElement.download = '在库调整一览.xls';
      document.body.appendChild(downloadElement);
      downloadElement.click();
   }
   //自定义dataType
@@ -497,7 +578,10 @@
      // this.numberDetail = numberDetail;
      console.log("numberDetail" + JSON.stringify(numberDetail));
      for (var i in this.data) {
         if (this.data[i]["ProId"] == numberDetail.data.ProId) {
         console.log('this.data[i]["key"]' + this.data[i]["key"]);
         console.log('numberDetail.data.ProdId+numberDetail.data.boxPiece' + numberDetail.data.ProdId + numberDetail.data.boxPiece);
         if (this.data[i]["key"] == numberDetail.data.ProdId + numberDetail.data.boxPiece) {
            this.data[i]["DiffReason"] = numberDetail.data.DiffReason;
         }
      }
@@ -539,35 +623,30 @@
               // this.EditAble = true;
               // this.showcount = false;
            } else {
               console.log("result.msg = " + result.msg);
               const evt = new ShowToastEvent({
                  title: "失败",
                  message: result.msg,
                  variant: "error",
               });
               this.dispatchEvent(evt);
               this.showMyToast('盘点失败',result.msg,'error');
               this.showSpinner = false;
            }
         })
         .catch((error) => {
            console.log("error = " + JSON.stringify(error));
            this.showSpinner = false;
         });
   }
   inits() {
      this.showSpinner = true
      datainit({
         eSetId: this.eSetId,
      })
         .then((result) => {
            result = JSON.parse(JSON.stringify(result));
            console.log('盘点一览===>' + JSON.stringify(result));
            for (var i in result.entity.qs) {
               this.conId = result.entity.qs[i].Id;
            }
            console.log("this.conId" + typeof this.conId);
            this.detailData = JSON.parse(
               result.entity.consumableorderdetailsRecords
            );
            this.detailData = JSON.parse(result.entity.consumableorderdetailsRecords);
            if (result.entity.ConsumableorderdetailsRecordsError != null) {
               this.adjustdata = JSON.parse(
                  result.entity.ConsumableorderdetailsRecordsError
@@ -587,11 +666,13 @@
                  this.adjustdata[i].Lose_Flag__c = this.adjustdata[i].orderdetails2.Lose_Flag__c;
               }
            }
            this.showSpinner = false;
            console.log("result盘点Id" + JSON.stringify(this.conId));
            console.log("调整明细" + JSON.stringify(this.adjustdata));
         })
         .catch((error) => {
            console.log("error = " + JSON.stringify(error));
            this.showSpinner = false;
         });
   }
   //分页
@@ -628,4 +709,31 @@
   get nextButtonDisabled() {
      return this.nextPageToken === undefined;
   }
   handleLoad2() {
        console.log('handleLoad2')
        try {
            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);
        }
    }
   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);
   }
}