buli
2023-07-13 a046b3fe914e46147334d33bbdcb21e2759a3c43
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
@@ -1,19 +1,19 @@
import { LightningElement, wire, api, track } from "lwc";
import oninit from "@salesforce/apex/LexInventoryViewController.init";
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import searchOrder from "@salesforce/apex/LexInventoryViewController.searchConsumableorderdetails";
import categoryAllload from "@salesforce/apex/LexInventoryViewController.categoryAllload";
import { NavigationMixin } from "lightning/navigation";
import { LightningElement, wire, api, track } from 'lwc';
import oninit from '@salesforce/apex/LexInventoryViewController.init';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import searchOrder from '@salesforce/apex/LexInventoryViewController.searchConsumableorderdetails';
import categoryAllload from '@salesforce/apex/LexInventoryViewController.categoryAllload';
import { NavigationMixin } from 'lightning/navigation';
//table css
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
import { loadStyle } from 'lightning/platformResourceLoader';
import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
export default class LexinventoryViewLWC extends NavigationMixin(
  LightningElement
) {
  //分页start
  @track sortBy = "";
    @track sortBy = '';
  //@track sortDirection = "asc";
  @track pageSize = 10;
  error;
@@ -31,7 +31,7 @@
  //end
  @track data = [];
  @track message = "";
    @track message = '';
  @track Name;
  @track CategoryThree;
@@ -44,7 +44,7 @@
  @track accountName;
  @track agencyProType;
  @track userWorkLocation;
  @track value = "";
    @track value = '';
  @track showTable = false;
  @track hidecheckboxcolumn = true;
  @track check = false;
@@ -59,37 +59,37 @@
  @track columns = [
    {
      label: "消耗品名称",
      fieldName: "Name__c",
      type: "Name",
            label: '消耗品名称',
            fieldName: 'Name__c',
            type: 'Name',
      sortable: true,
      hideDefaultActions: true,
      // initialWidth: 200,
      wrapText: true,
      cellAttributes: { alignment: "left" }
            cellAttributes: { alignment: 'left' }
    },
    {
      label: "第三分类",
      fieldName: "Category3__c",
            label: '第三分类',
            fieldName: 'Category3__c',
      initialWidth: 102,
      cellAttributes: { alignment: "left" },
            cellAttributes: { alignment: 'left' },
      hideDefaultActions: true,
      sortable: true,
      wrapText: true
    },
    {
      label: "第四分类",
      fieldName: "Category4__c",
      cellAttributes: { alignment: "left" },
            label: '第四分类',
            fieldName: 'Category4__c',
            cellAttributes: { alignment: 'left' },
      initialWidth: 102,
      hideDefaultActions: true,
      wrapText: true,
      sortable: true
    },
    {
      label: "第五分类",
      fieldName: "Category5__c",
      cellAttributes: { alignment: "left" },
            label: '第五分类',
            fieldName: 'Category5__c',
            cellAttributes: { alignment: 'left' },
      initialWidth: 102,
      hideDefaultActions: true,
      wrapText: true,
@@ -97,89 +97,89 @@
    },
    {
      label: "规格",
      fieldName: "packing_list",
      cellAttributes: { alignment: "right" },
            label: '规格',
            fieldName: 'packing_list',
            cellAttributes: { alignment: 'right' },
      initialWidth: 50,
      wrapText: true,
      hideDefaultActions: true
    },
    {
      label: "单位",
      fieldName: "BoxPiece",
      cellAttributes: { alignment: "left" },
            label: '单位',
            fieldName: 'BoxPiece',
            cellAttributes: { alignment: 'left' },
      initialWidth: 50,
      wrapText: true,
      hideDefaultActions: true
    },
    {
      label: "注册证编码号",
      fieldName: "approbation_No",
      cellAttributes: { alignment: "left" },
            label: '注册证编码号',
            fieldName: 'approbation_No',
            cellAttributes: { alignment: 'left' },
      wrapText: true,
      initialWidth: 104,
      hideDefaultActions: true
    },
    {
      label: "注册有效期",
      fieldName: "expiration_Date",
      cellAttributes: { alignment: "left" },
            label: '注册有效期',
            fieldName: 'expiration_Date',
            cellAttributes: { alignment: 'left' },
      wrapText: true,
      hideDefaultActions: true,
      initialWidth: 95
    },
    {
      label: "CFDA状态",
      fieldName: "SFDA_Status__c",
      cellAttributes: { alignment: "left" },
            label: 'CFDA状态',
            fieldName: 'SFDA_Status__c',
            cellAttributes: { alignment: 'left' },
      initialWidth: 84,
      wrapText: true,
      hideDefaultActions: true
    },
    {
      label: "使用期限",
      fieldName: "guaranteeperiod",
      cellAttributes: { alignment: "left" },
            label: '使用期限',
            fieldName: 'guaranteeperiod',
            cellAttributes: { alignment: 'left' },
      hideDefaultActions: true,
      initialWidth: 95
    },
    {
      label: "有效期内库存",
      type: "customInventoryColor",
      fieldName: "limitCount",
            label: '有效期内库存',
            type: 'customInventoryColor',
            fieldName: 'limitCount',
      sortable: true,
      cellAttributes: { alignment: "right" },
            cellAttributes: { alignment: 'right' },
      typeAttributes: {
        value: { fieldName: "limitCount" },
        upperlimit: { fieldName: "upperlimit" },
        lowerlimit: { fieldName: "lowerlimit" },
        boxPrice: { fieldName: "BoxPiece" }
                value: { fieldName: 'limitCount' },
                upperlimit: { fieldName: 'upperlimit' },
                lowerlimit: { fieldName: 'lowerlimit' },
                boxPrice: { fieldName: 'BoxPiece' }
      },
      hideDefaultActions: true,
      initialWidth: 110
    },
    {
      label: "过期库存",
      fieldName: "overlimitCount",
            label: '过期库存',
            fieldName: 'overlimitCount',
      hideDefaultActions: true,
      cellAttributes: { alignment: "right" },
            cellAttributes: { alignment: 'right' },
      initialWidth: 78
    }
  ];
  defaultSortDirection = "asc";
  sortDirection = "asc";
    defaultSortDirection = 'asc';
    sortDirection = 'asc';
  sortedBy;
  renderedCallback() {
    if (!this.stylesLoaded) {
      Promise.all([loadStyle(this, WrappedHeaderTable)])
        .then(() => {
          console.log("Custom styles loaded");
                    console.log('Custom styles loaded');
          this.stylesLoaded = true;
        })
        .catch((error) => {
          console.error("Error loading custom styles");
                    console.error('Error loading custom styles');
        });
    }
  }
@@ -200,41 +200,55 @@
      .then((result) => {
        result = JSON.parse(JSON.stringify(result));
        console.log(
          "result.pageRecords = " + JSON.stringify(result.entity.pageRecords)
                    'result.pageRecords = ' +
                        JSON.stringify(result.entity.pageRecords)
        );
        console.log(
          "result.consumableorderdetailsRecords = " +
            JSON.stringify(result.entity.consumableorderdetailsRecords)
                    'result.consumableorderdetailsRecords = ' +
                        JSON.stringify(
                            result.entity.consumableorderdetailsRecords
                        )
        );
        console.log("result.status = " + result.status);
        console.log("result = " + JSON.stringify(result));
        console.log("result 1= " + JSON.stringify(result.entity));
        console.log("result 2= " + JSON.stringify(result.entity.pageRecords));
        if (result.status == "Success") {
                console.log('result.status = ' + result.status);
                console.log('result = ' + JSON.stringify(result));
                console.log('result 1= ' + JSON.stringify(result.entity));
          console.log(
            "result.entity.paginatedAccounts = " +
                    'result 2= ' + JSON.stringify(result.entity.pageRecords)
                );
                if (result.status == 'Success') {
                    console.log(
                        'result.entity.paginatedAccounts = ' +
              JSON.stringify(result.entity.paginatedAccounts)
          );
          this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
          this.totalRecords = result.entity.paginatedAccounts.totalRecords;
          this.recordStart = result.entity.paginatedAccounts.recordStart;
                    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
                        result.entity.paginatedAccounts.totalRecords /
                            this.pageSize
          );
          console.log("this.totalPages = " + this.totalPages);
          this.paginationVisibility = this.totalPages > 1 ? true : false;
                    console.log('this.totalPages = ' + this.totalPages);
                    this.paginationVisibility =
                        this.totalPages > 1 ? true : false;
          this.loader = false;
          this.data = result.entity.pageRecords;
          this.productkucun = result.entity.productkucun;
          for (var i in this.data) {
            this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
            this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c;
            this.data[i]["Category4__c"] = this.data[i].Prod.Category4__c;
            this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c;
            this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c;
                        this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
                        this.data[i]['Category3__c'] =
                            this.data[i].Prod.Category3__c;
                        this.data[i]['Category4__c'] =
                            this.data[i].Prod.Category4__c;
                        this.data[i]['Category5__c'] =
                            this.data[i].Prod.Category5__c;
                        this.data[i]['SFDA_Status__c'] =
                            this.data[i].Prod.SFDA_Status__c;
          }
          this.showTable = true;
          this.orderDetZaikuList = result.entity.orderDetZaikuList;
@@ -244,56 +258,61 @@
          let option1ValueTemp = [];
          for (var key in result.entity.categoryOptionMap) {
            let object = {};
            object["label"] = result.entity.categoryOptionMap[key];
            object["value"] = key;
                        object['label'] = result.entity.categoryOptionMap[key];
                        object['value'] = key;
            option1ValueTemp.push(object);
          }
          this.category3Options = option1ValueTemp;
          console.log(
            " this.optionscatone===>" + JSON.stringify(this.optionscatone)
                        ' this.optionscatone===>' +
                            JSON.stringify(this.optionscatone)
          );
          let option2ValueTemp = [];
          for (var key in result.entity.category4OptionMap) {
            let object = {};
            object["label"] = result.entity.category4OptionMap[key];
            object["value"] = key;
                        object['label'] = result.entity.category4OptionMap[key];
                        object['value'] = key;
            option2ValueTemp.push(object);
          }
          this.category4Options = option2ValueTemp;
          let option3ValueTemp = [];
          for (var key in result.entity.category5OptionMap) {
            let object = {};
            object["label"] = result.entity.category5OptionMap[key];
            object["value"] = key;
                        object['label'] = result.entity.category5OptionMap[key];
                        object['value'] = key;
            option3ValueTemp.push(object);
          }
          this.category5Options = option3ValueTemp;
          this.hasHos = result.entity.hasHos;
          console.log("this.hasHos" + this.hasHos);
                    console.log('this.hasHos' + this.hasHos);
          //颜色标记
          //hasHos = true 医院特价
          if (this.hasHos) {
            let object1 = {
              label: "医院特价",
              fieldName: "hospitalSpecialOffer__c",
                            label: '医院特价',
                            fieldName: 'hospitalSpecialOffer__c',
              hideDefaultActions: true,
              type: "boolean",
              cellAttributes: { alignment: "left" },
                            type: 'boolean',
                            cellAttributes: { alignment: 'left' },
              initialWidth: 80
            };
            this.columns.push(object1);
            console.log(" this.columns" + this.columns);
                        console.log(' this.columns' + this.columns);
            for (var j in this.data) {
              this.data[j]["Name__c"] = this.data[j].Prod.Name__c;
              this.data[j]["Category3__c"] = this.data[j].Prod.Category3__c;
              this.data[j]["Category4__c"] = this.data[j].Prod.Category4__c;
              this.data[j]["Category5__c"] = this.data[j].Prod.Category5__c;
              this.data[j]["SFDA_Status__c"] = this.data[j].Prod.SFDA_Status__c;
              this.data[j]["hospitalSpecialOffer__c"] =
                            this.data[j]['Name__c'] = this.data[j].Prod.Name__c;
                            this.data[j]['Category3__c'] =
                                this.data[j].Prod.Category3__c;
                            this.data[j]['Category4__c'] =
                                this.data[j].Prod.Category4__c;
                            this.data[j]['Category5__c'] =
                                this.data[j].Prod.Category5__c;
                            this.data[j]['SFDA_Status__c'] =
                                this.data[j].Prod.SFDA_Status__c;
                            this.data[j]['hospitalSpecialOffer__c'] =
                this.data[j].hospitalSpecialOffer;
              console.log(
                "this.data[j].hospitalSpecialOffer__c" +
                                'this.data[j].hospitalSpecialOffer__c' +
                  this.data[j].hospitalSpecialOffer
              );
            }
@@ -301,64 +320,64 @@
          this.showSpinner = false;
        } else {
          // this.showToast("Error",'Error', result.msg);
          this.showMyToast("初始化失败", result.msg, "error");
                    this.showMyToast('初始化失败', result.msg, 'error');
        }
      })
      .catch((error) => {
        this.loader = false;
        this.showSpinner = false;
        console.log("error = " + JSON.stringify(error));
                console.log('error = ' + JSON.stringify(error));
      });
  }
  handleChange(event) {
    let fieldName = event.target.getAttribute("data-field");
        let fieldName = event.target.getAttribute('data-field');
    let value = event.detail.value;
    console.log("======>fieldName" + fieldName);
    console.log("======>value" + value);
        console.log('======>fieldName' + fieldName);
        console.log('======>value' + value);
    switch (fieldName) {
      case "Name":
            case 'Name':
        this.Name = value;
        break;
      case "CategoryThree":
            case 'CategoryThree':
        this.CategoryThree = value;
        break;
      case "CategoryFour":
            case 'CategoryFour':
        this.CategoryFour = value;
        break;
      case "CategoryFive":
            case 'CategoryFive':
        this.CategoryFive = value;
        break;
      default:
        console.log("no data");
                console.log('no data');
    }
  }
  dataChange(event) {
    let fieldName = event.target.getAttribute("data-field");
        let fieldName = event.target.getAttribute('data-field');
    let value = event.detail.value;
    console.log("fieldName = " + fieldName + " value = " + value);
        console.log('fieldName = ' + fieldName + ' value = ' + value);
    switch (fieldName) {
      case "Name":
            case 'Name':
        this.Name = value;
        break;
      case "CategoryThree":
            case 'CategoryThree':
        this.CategoryThree = value;
        //调用后台显示第四五分类
        this.showAllCate();
        if (this.CategoryThree == "") {
          this.CategoryFour = "";
          this.CategoryFive = "";
                if (this.CategoryThree == '') {
                    this.CategoryFour = '';
                    this.CategoryFive = '';
        }
        break;
      case "CategoryFour":
            case 'CategoryFour':
        this.CategoryFour = value;
        //调用后台显示第五分类
        this.showCate();
        if (this.CategoryFour == "") {
          this.CategoryFive = "";
                if (this.CategoryFour == '') {
                    this.CategoryFive = '';
        }
        break;
      case "CategoryFive":
            case 'CategoryFive':
        this.CategoryFive = value;
        break;
    }
@@ -371,34 +390,35 @@
    })
      .then((result) => {
        result = JSON.parse(JSON.stringify(result));
        console.log("result = " + JSON.stringify(result));
        if (result.status == "Success") {
                console.log('result = ' + JSON.stringify(result));
                if (result.status == 'Success') {
          this.category4Options = [];
          this.category5Options = [];
          //第4分类
          for (var key in result.entity.category4OptionMap) {
            let object = {};
            object["label"] = result.entity.category4OptionMap[key];
            object["value"] = key;
                        object['label'] = result.entity.category4OptionMap[key];
                        object['value'] = key;
            this.category4Options.push(object);
          }
          console.log(
            "this.category4Options = " + JSON.stringify(this.category4Options)
                        'this.category4Options = ' +
                            JSON.stringify(this.category4Options)
          );
          //第5分类
          for (var key in result.entity.category5OptionMap) {
            let object = {};
            object["label"] = result.entity.category5OptionMap[key];
            object["value"] = key;
                        object['label'] = result.entity.category5OptionMap[key];
                        object['value'] = key;
            this.category5Options.push(object);
          }
        } else {
          console.log("result = " + JSON.stringify(result));
          this.showMyToast(result.msg, "", "error");
                    console.log('result = ' + JSON.stringify(result));
                    this.showMyToast(result.msg, '', 'error');
        }
      })
      .catch((error) => {
        console.log("error" + JSON.stringify(error));
                console.log('error' + JSON.stringify(error));
      });
  }
@@ -423,37 +443,47 @@
    })
      .then((result) => {
        result = JSON.parse(JSON.stringify(result));
        if (result.status == "Success") {
          this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
          this.totalRecords = result.entity.paginatedAccounts.totalRecords;
          this.recordStart = result.entity.paginatedAccounts.recordStart;
                if (result.status == 'Success') {
                    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
                        result.entity.paginatedAccounts.totalRecords /
                            this.pageSize
          );
          console.log(
            "result.entity.paginatedAccounts = " +
                        'result.entity.paginatedAccounts = ' +
              JSON.stringify(result.entity.paginatedAccounts)
          );
          console.log("this.totalPages = " + this.totalPages);
          this.paginationVisibility = this.totalPages > 1 ? true : false;
          console.log("this.sortDirection = " + this.sortDirection);
                    console.log('this.totalPages = ' + this.totalPages);
                    this.paginationVisibility =
                        this.totalPages > 1 ? true : false;
                    console.log('this.sortDirection = ' + this.sortDirection);
          // this.showToast("Success",'搜索成功', result.msg);
          // this.showMyToast('搜索成功',result.msg,'success');
          this.data = result.entity.pageRecords;
          console.log("搜索Data==>" + JSON.stringify(this.data));
                    console.log('搜索Data==>' + JSON.stringify(this.data));
          for (var i in this.data) {
            this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
            this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c;
            this.data[i]["Category4__c"] = this.data[i].Prod.Category4__c;
            this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c;
            this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c;
            this.data[i]["hospitalSpecialOffer__c"] =
                        this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
                        this.data[i]['Category3__c'] =
                            this.data[i].Prod.Category3__c;
                        this.data[i]['Category4__c'] =
                            this.data[i].Prod.Category4__c;
                        this.data[i]['Category5__c'] =
                            this.data[i].Prod.Category5__c;
                        this.data[i]['SFDA_Status__c'] =
                            this.data[i].Prod.SFDA_Status__c;
                        this.data[i]['hospitalSpecialOffer__c'] =
              this.data[i].hospitalSpecialOffer;
            this.data[i]["guaranteeperiod"] = this.data[i].guaranteeperiod;
                        this.data[i]['guaranteeperiod'] =
                            this.data[i].guaranteeperiod;
          }
          this.data = [...this.data];
          console.log("this.data = " + JSON.stringify(this.data));
                    console.log('this.data = ' + JSON.stringify(this.data));
          this.showTable = true;
          this.showSpinner = false;
        } else {
@@ -469,41 +499,41 @@
        }
      })
      .catch((error) => {
        console.log("error = " + JSON.stringify(error));
                console.log('error = ' + JSON.stringify(error));
        this.showSpinner = false;
      });
  }
  inventoryCount() {
    this[NavigationMixin.Navigate]({
      type: "standard__webPage",
            type: 'standard__webPage',
      attributes: {
        url: "/lexinventory"
                url: '/lexinventory'
      }
    });
  }
  handleExpired() {
    console.log("过期库存呢销存");
        console.log('过期库存呢销存');
    this[NavigationMixin.Navigate]({
      type: "standard__webPage",
            type: 'standard__webPage',
      attributes: {
        url: "/lexoverduestock"
                url: '/lexoverduestock'
      }
    });
  }
  removeBox() {
    this[NavigationMixin.Navigate]({
      type: "standard__webPage",
            type: 'standard__webPage',
      attributes: {
        url: "/lexremovebox"
                url: '/lexremovebox'
      }
    });
  }
  cancelremoveBox() {
    this[NavigationMixin.Navigate]({
      type: "standard__webPage",
            type: 'standard__webPage',
      attributes: {
        url: "/lexcancelremovebox"
                url: '/lexcancelremovebox'
      }
    });
  }
@@ -511,15 +541,15 @@
  clearAll() {
    this.showSpinner = true;
    this.showTable = false;
    this.Name = "";
    this.CategoryThree = "";
    this.CategoryFour = "";
    this.CategoryFive = "";
    this.template.querySelectorAll("lightning-combobox").forEach((each) => {
        this.Name = '';
        this.CategoryThree = '';
        this.CategoryFour = '';
        this.CategoryFive = '';
        this.template.querySelectorAll('lightning-combobox').forEach((each) => {
      each.value = null;
    });
    console.log(" this.CategoryThree" + this.CategoryThree);
    console.log("数据列表" + this.data);
        console.log(' this.CategoryThree' + this.CategoryThree);
        console.log('数据列表' + this.data);
    searchOrder({
      category1: this.Name,
      Category3: this.CategoryThree,
@@ -534,28 +564,38 @@
      productkucunLWC: this.productkucun
    })
      .then((result) => {
        console.log("result搜索 = " + JSON.stringify(result));
                console.log('result搜索 = ' + JSON.stringify(result));
        result = JSON.parse(JSON.stringify(result));
        if (result.status == "Success") {
          this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
          this.totalRecords = result.entity.paginatedAccounts.totalRecords;
          this.recordStart = result.entity.paginatedAccounts.recordStart;
                if (result.status == 'Success') {
                    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
                        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);
                    console.log('this.totalPages = ' + this.totalPages);
                    this.paginationVisibility =
                        this.totalPages > 1 ? true : false;
                    console.log('this.sortDirection = ' + this.sortDirection);
          this.data = result.entity.pageRecords;
          for (var i in this.data) {
            this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
            this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c;
            this.data[i]["Category4__c"] = this.data[i].Prod.Category4__c;
            this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c;
            this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c;
            this.data[i]["guaranteeperiod"] = this.data[i].guaranteeperiod;
                        this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
                        this.data[i]['Category3__c'] =
                            this.data[i].Prod.Category3__c;
                        this.data[i]['Category4__c'] =
                            this.data[i].Prod.Category4__c;
                        this.data[i]['Category5__c'] =
                            this.data[i].Prod.Category5__c;
                        this.data[i]['SFDA_Status__c'] =
                            this.data[i].Prod.SFDA_Status__c;
                        this.data[i]['guaranteeperiod'] =
                            this.data[i].guaranteeperiod;
          }
          this.showSpinner = false;
          this.showTable = true;
@@ -568,7 +608,7 @@
        }
      })
      .catch((error) => {
        console.log("error = " + JSON.stringify(error));
                console.log('error = ' + JSON.stringify(error));
        this.showSpinner = false;
      });
  }
@@ -590,12 +630,12 @@
  }
  onHandleSort(event) {
    console.log("Sort");
        console.log('Sort');
    this.sortBy = event.detail.fieldName;
    this.sortDirection = event.detail.sortDirection;
    this.currentPageToken = 0;
    console.log("this.sortBy = " + this.sortBy);
    console.log("this.sortDirection = " + this.sortDirection);
        console.log('this.sortBy = ' + this.sortBy);
        console.log('this.sortDirection = ' + this.sortDirection);
    // if('limitCount' != this.sortBy)
    //    this.searchOrderDetail();
    // else{
@@ -609,7 +649,7 @@
    const { fieldName: sortedBy, sortDirection } = event.detail;
    const cloneData = [...this.data];
    cloneData.sort(
      this.sortByMethod(sortedBy, sortDirection === "asc" ? 1 : -1)
            this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1)
    );
    this.data = cloneData;
    this.sortDirection = sortDirection;
@@ -661,22 +701,26 @@
    return this.nextPageToken === undefined;
  }
  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 != "") {
        if (message != '') {
      content =
        "<h2><strong>" + title + "<strong/></h2><h5>" + message + "</h5>";
                '<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")
            .querySelector('c-common-toast')
      .showToast(variant, content, iconName, 10000);
  }
}