buli
2023-07-14 744f42c5496e656a1f9927740a3b37c0b97a6cba
force-app/main/default/lwc/lexTopPage/lexTopPage.js
@@ -1,19 +1,19 @@
import { LightningElement, wire, api, track } from "lwc";
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import { NavigationMixin } from "lightning/navigation";
import initPage from "@salesforce/apex/LexTopPageController.initPage";
import initTotalNum from "@salesforce/apex/LexConsumableGoodsInfo.initTotalNum";
import initArrDet from "@salesforce/apex/LexConsumableGoodsInfo.initArrDet";
import initArrDetAll from "@salesforce/apex/LexConsumableGoodsInfo.initArrDetAll";
import initDeliveryDet from "@salesforce/apex/LexConsumableGoodsInfo.initDeliveryDet";
import initDeliveryDetAll from "@salesforce/apex/LexConsumableGoodsInfo.initDeliveryDetAll";
import initNotArrDet from "@salesforce/apex/LexConsumableGoodsInfo.initNotArrDet";
import initNotArrDetAll from "@salesforce/apex/LexConsumableGoodsInfo.initNotArrDetAll";
import initMoreThan7 from "@salesforce/apex/LexConsumableGoodsInfo.initMoreThan7";
import initMoreThan7All from "@salesforce/apex/LexConsumableGoodsInfo.initMoreThan7All";
import { LightningElement, wire, api, track } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
import initPage from '@salesforce/apex/LexTopPageController.initPage';
import initTotalNum from '@salesforce/apex/LexConsumableGoodsInfo.initTotalNum';
import initArrDet from '@salesforce/apex/LexConsumableGoodsInfo.initArrDet';
import initArrDetAll from '@salesforce/apex/LexConsumableGoodsInfo.initArrDetAll';
import initDeliveryDet from '@salesforce/apex/LexConsumableGoodsInfo.initDeliveryDet';
import initDeliveryDetAll from '@salesforce/apex/LexConsumableGoodsInfo.initDeliveryDetAll';
import initNotArrDet from '@salesforce/apex/LexConsumableGoodsInfo.initNotArrDet';
import initNotArrDetAll from '@salesforce/apex/LexConsumableGoodsInfo.initNotArrDetAll';
import initMoreThan7 from '@salesforce/apex/LexConsumableGoodsInfo.initMoreThan7';
import initMoreThan7All from '@salesforce/apex/LexConsumableGoodsInfo.initMoreThan7All';
//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 LexTopPage extends NavigationMixin(LightningElement) {
  @track title = [];
@@ -30,7 +30,7 @@
  @track over_view = false;
  @track overlimit = false;
  @track hasHos = false;
  @track activeSections = ["A", "B", "C"];
    @track activeSections = ['A', 'B', 'C'];
  @track isRender = false;
  @track consumableorderdetailsRecordsview;
  @track showSpinner = true;
@@ -48,12 +48,12 @@
  @track showTable = false;
  @track hidecheckboxcolumn = true;
  //排序
  defaultSortDirection = "asc";
  sortDirection = "asc";
    defaultSortDirection = 'asc';
    sortDirection = 'asc';
  sortedBy;
  //分页start
  @track sortBy = "";
    @track sortBy = '';
  @track pageSize = 10;
  error;
  records;
@@ -75,244 +75,244 @@
  //未全部发货订单明细col
  @track colms = [
    {
      label: "消耗品订单名称",
      type: "customOutputGood",
            label: '消耗品订单名称',
            type: 'customOutputGood',
      typeAttributes: {
        outputValue: { fieldName: "Name" },
        type: "Title",
        recordId: { fieldName: "Id" }
                outputValue: { fieldName: 'Name' },
                type: 'Title',
                recordId: { fieldName: 'Id' }
      },
      hideDefaultActions: true,
      // initialWidth: 200,
      wrapText: true
    },
    {
      label: "SAP合同号",
      fieldName: "ContractNo__c",
            label: 'SAP合同号',
            fieldName: 'ContractNo__c',
      hideDefaultActions: true,
      wrapText: true,
      initialWidth: 180
    },
    {
      label: "订单总数",
      type: "customOutputGood",
            label: '订单总数',
            type: 'customOutputGood',
      typeAttributes: {
        outputValue: { fieldName: "Total_num__c" },
        type: "TotalNum",
        recordId: { fieldName: "Id" }
                outputValue: { fieldName: 'Total_num__c' },
                type: 'TotalNum',
                recordId: { fieldName: 'Id' }
      },
      hideDefaultActions: true,
      initialWidth: 100
    },
    {
      label: "已到货数量",
      type: "customOutputGood",
            label: '已到货数量',
            type: 'customOutputGood',
      typeAttributes: {
        outputValue: { fieldName: "OrderNumber_arrived__c" },
        type: "ArrDet",
        recordId: { fieldName: "Id" }
                outputValue: { fieldName: 'OrderNumber_arrived__c' },
                type: 'ArrDet',
                recordId: { fieldName: 'Id' }
      },
      hideDefaultActions: true,
      initialWidth: 100
    },
    {
      label: "待系统操作入库数量",
      type: "customOutputGood",
            label: '待系统操作入库数量',
            type: 'customOutputGood',
      typeAttributes: {
        outputValue: { fieldName: "Delivery_detail_count__c" },
        type: "DeliveryDet",
        recordId: { fieldName: "Id" }
                outputValue: { fieldName: 'Delivery_detail_count__c' },
                type: 'DeliveryDet',
                recordId: { fieldName: 'Id' }
      },
      hideDefaultActions: true,
      initialWidth: 150
    },
    {
      label: "还没发货数量",
      type: "customOutputGood",
            label: '还没发货数量',
            type: 'customOutputGood',
      typeAttributes: {
        outputValue: { fieldName: "OrderNumber_notarrive__c" },
        type: "NotArrDet",
        recordId: { fieldName: "Id" }
                outputValue: { fieldName: 'OrderNumber_notarrive__c' },
                type: 'NotArrDet',
                recordId: { fieldName: 'Id' }
      },
      hideDefaultActions: true,
      initialWidth: 120
    },
    {
      label: "发货七天还未到货数",
      type: "customOutputGood",
            label: '发货七天还未到货数',
            type: 'customOutputGood',
      typeAttributes: {
        outputValue: { fieldName: "More_than_seven_days__c" },
        type: "MoreThan7",
        recordId: { fieldName: "Id" }
                outputValue: { fieldName: 'More_than_seven_days__c' },
                type: 'MoreThan7',
                recordId: { fieldName: 'Id' }
      },
      hideDefaultActions: true,
      initialWidth: 150
    },
    {
      label: "最新发货日期",
      fieldName: "Shipment_date__c",
            label: '最新发货日期',
            fieldName: 'Shipment_date__c',
      hideDefaultActions: true,
      initialWidth: 105
    },
    {
      label: "首次发货日期",
      fieldName: "First_Delivery__c",
            label: '首次发货日期',
            fieldName: 'First_Delivery__c',
      hideDefaultActions: true,
      initialWidth: 105
    }
  ];
  @track colms2 = [
    { label: "产品型号", fieldName: "prodModel", hideDefaultActions: true },
        { label: '产品型号', fieldName: 'prodModel', hideDefaultActions: true },
    {
      label: "数量",
      fieldName: "recordCount",
            label: '数量',
            fieldName: 'recordCount',
      hideDefaultActions: true,
      initialWidth: 60,
      cellAttributes: { alignment: "center" }
            cellAttributes: { alignment: 'center' }
    }
  ];
  //使用期限小于一年的产品col
  @track colm3 = [
    { label: "产品型号", fieldName: "prodName", hideDefaultActions: true },
        { label: '产品型号', fieldName: 'prodName', hideDefaultActions: true },
    {
      label: "数量",
      fieldName: "countid",
            label: '数量',
            fieldName: 'countid',
      hideDefaultActions: true,
      cellAttributes: { alignment: "left" }
            cellAttributes: { alignment: 'left' }
    },
    {
      label: "单位",
      fieldName: "BoxPiece",
            label: '单位',
            fieldName: 'BoxPiece',
      hideDefaultActions: true,
      cellAttributes: { alignment: "left" }
            cellAttributes: { alignment: 'left' }
    }
  ];
  //经销商库存上下限col
  @track colm4 = [
    { label: "产品型号", fieldName: "prodName", hideDefaultActions: true },
        { label: '产品型号', fieldName: 'prodName', hideDefaultActions: true },
    {
      label: "库存下限",
      fieldName: "limitLow",
            label: '库存下限',
            fieldName: 'limitLow',
      hideDefaultActions: true,
      cellAttributes: { alignment: "left" }
            cellAttributes: { alignment: 'left' }
    },
    {
      label: "库存上限",
      fieldName: "limitUp",
            label: '库存上限',
            fieldName: 'limitUp',
      hideDefaultActions: true,
      cellAttributes: { alignment: "left" }
            cellAttributes: { alignment: 'left' }
    }
  ];
  @track columns = [
    {
      label: "消耗品名称",
      fieldName: "Name__c",
      type: "Name",
            label: '消耗品名称',
            fieldName: 'Name__c',
            type: 'Name',
      sortable: true,
      hideDefaultActions: true,
      wrapText: true,
      cellAttributes: { alignment: "left" }
            cellAttributes: { alignment: 'left' }
    },
    {
      label: "规格",
      fieldName: "packing_list",
      cellAttributes: { alignment: "right" },
            label: '规格',
            fieldName: 'packing_list',
            cellAttributes: { alignment: 'right' },
      initialWidth: 50,
      wrapText: true,
      hideDefaultActions: true
    },
    {
      label: "第三分类",
      fieldName: "Category3__c",
            label: '第三分类',
            fieldName: 'Category3__c',
      initialWidth: 85,
      cellAttributes: { alignment: "left" },
            cellAttributes: { alignment: 'left' },
      hideDefaultActions: true,
      wrapText: true
    },
    {
      label: "第四分类",
      fieldName: "Category4__c",
      cellAttributes: { alignment: "left" },
            label: '第四分类',
            fieldName: 'Category4__c',
            cellAttributes: { alignment: 'left' },
      initialWidth: 85,
      hideDefaultActions: true,
      wrapText: true
    },
    {
      label: "第五分类",
      fieldName: "Category5__c",
      cellAttributes: { alignment: "left" },
            label: '第五分类',
            fieldName: 'Category5__c',
            cellAttributes: { alignment: 'left' },
      initialWidth: 85,
      hideDefaultActions: true,
      wrapText: true,
      sortable: true
    },
    {
      label: "CFDA状态",
      fieldName: "SFDA_Status__c",
      cellAttributes: { alignment: "left" },
            label: 'CFDA状态',
            fieldName: 'SFDA_Status__c',
            cellAttributes: { alignment: 'left' },
      initialWidth: 80,
      hideDefaultActions: true
    },
    {
      label: "注册证编码号",
      fieldName: "approbation_No",
      cellAttributes: { alignment: "left" },
            label: '注册证编码号',
            fieldName: 'approbation_No',
            cellAttributes: { alignment: 'left' },
      wrapText: true,
      initialWidth: 155,
      hideDefaultActions: true
    },
    {
      label: "注册证效期",
      fieldName: "expiration_Date",
      cellAttributes: { alignment: "left" },
            label: '注册证效期',
            fieldName: 'expiration_Date',
            cellAttributes: { alignment: 'left' },
      wrapText: true,
      hideDefaultActions: true,
      initialWidth: 100
    },
    {
      label: "产品数量下限",
      fieldName: "lowerlimit",
      cellAttributes: { alignment: "right" },
            label: '产品数量下限',
            fieldName: 'lowerlimit',
            cellAttributes: { alignment: 'right' },
      wrapText: true,
      hideDefaultActions: true,
      initialWidth: 100
    },
    {
      label: "使用期限",
      fieldName: "guaranteeperiod",
      cellAttributes: { alignment: "left" },
            label: '使用期限',
            fieldName: 'guaranteeperiod',
            cellAttributes: { alignment: 'left' },
      hideDefaultActions: true,
      initialWidth: 95
    },
    {
      label: "有效期内库存",
      type: "customInventoryColor",
      cellAttributes: { alignment: "right" },
            label: '有效期内库存',
            type: 'customInventoryColor',
            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: 95
    },
    {
      label: "过期库存",
      fieldName: "overlimitCount",
            label: '过期库存',
            fieldName: 'overlimitCount',
      hideDefaultActions: true,
      cellAttributes: { alignment: "right" },
            cellAttributes: { alignment: 'right' },
      initialWidth: 75
    },
    {
      label: "单位",
      fieldName: "BoxPiece",
      cellAttributes: { alignment: "left" },
            label: '单位',
            fieldName: 'BoxPiece',
            cellAttributes: { alignment: 'left' },
      initialWidth: 50,
      wrapText: true,
      hideDefaultActions: true
@@ -323,11 +323,11 @@
    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');
        });
    }
  }
@@ -344,8 +344,8 @@
    })
      .then((result) => {
        this.isNoteStay = result.isNoteStay;
        console.log("isNoteStay:" + result.isNoteStay);
        if (result.result == "Success") {
                console.log('isNoteStay:' + result.isNoteStay);
                if (result.result == 'Success') {
          //分页start
          this.nextPageToken = result.paginatedAccounts.nextPageToken;
          this.totalRecords = result.paginatedAccounts.totalRecords;
@@ -354,9 +354,10 @@
          this.totalPages = Math.ceil(
            result.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.loader = false;
          //分页end
          this.title = result.title;
@@ -367,8 +368,8 @@
          this.moreThanSevenDays = result.moreThanSevenDays;
          this.raesList = result.raesList;
          this.raesList.push({
            Id: "1",
            Name: "待操作入库订单汇总",
                        Id: '1',
                        Name: '待操作入库订单汇总',
            Total_num__c: this.totalNum,
            OrderNumber_arrived__c: this.orderNumberArrived,
            Delivery_detail_count__c: this.deliveryDetailCount,
@@ -379,86 +380,103 @@
          this.accountInfo = result.accountInfo;
          this.accountId = result.accountInfo.Id;
          this.pageRecords = result.pageRecords;
          this.overlimitdateorderdetails = result.overlimitdateorderdetails;
                    this.overlimitdateorderdetails =
                        result.overlimitdateorderdetails;
          this.over_view = result.over_view;
          this.overlimit = result.overlimit;
          this.hasHos = result.hasHos;
          this.product_Limit = result.product_Limit;
          console.log("result==>" + JSON.stringify(result));
                    console.log('result==>' + JSON.stringify(result));
          for (var i in this.pageRecords) {
            this.pageRecords[i]["Name__c"] = this.pageRecords[i].Prod.Name__c;
            this.pageRecords[i]["Category3__c"] =
                        this.pageRecords[i]['Name__c'] =
                            this.pageRecords[i].Prod.Name__c;
                        this.pageRecords[i]['Category3__c'] =
              this.pageRecords[i].Prod.Category3__c;
            this.pageRecords[i]["Category4__c"] =
                        this.pageRecords[i]['Category4__c'] =
              this.pageRecords[i].Prod.Category3__c;
            this.pageRecords[i]["Category5__c"] =
                        this.pageRecords[i]['Category5__c'] =
              this.pageRecords[i].Prod.Category3__c;
            this.pageRecords[i]["SFDA_Status__c"] =
                        this.pageRecords[i]['SFDA_Status__c'] =
              this.pageRecords[i].Prod.SFDA_Status__c;
          }
          //hasHos = true 医院特价
          if (this.hasHos) {
            let object1 = {
              label: "医院特价",
              fieldName: "hospitalSpecialOffer",
                            label: '医院特价',
                            fieldName: 'hospitalSpecialOffer',
              hideDefaultActions: true,
              type: "boolean",
              cellAttributes: { alignment: "left" },
                            type: 'boolean',
                            cellAttributes: { alignment: 'left' },
              initialWidth: 75
            };
            this.columns.push(object1);
            console.log(" this.columns" + this.columns);
                        console.log(' this.columns' + this.columns);
            for (var j in this.pageRecords) {
              this.pageRecords[j]["Name__c"] = this.pageRecords[j].Prod.Name__c;
              this.pageRecords[j]["Category3__c"] =
                            this.pageRecords[j]['Name__c'] =
                                this.pageRecords[j].Prod.Name__c;
                            this.pageRecords[j]['Category3__c'] =
                this.pageRecords[j].Prod.Category3__c;
              this.pageRecords[j]["Category4__c"] =
                            this.pageRecords[j]['Category4__c'] =
                this.pageRecords[j].Prod.Category3__c;
              this.pageRecords[j]["Category5__c"] =
                            this.pageRecords[j]['Category5__c'] =
                this.pageRecords[j].Prod.Category3__c;
              this.pageRecords[j]["SFDA_Status__c"] =
                            this.pageRecords[j]['SFDA_Status__c'] =
                this.pageRecords[j].Prod.SFDA_Status__c;
              this.pageRecords[j]["hospitalSpecialOffer__c"] =
                            this.pageRecords[j]['hospitalSpecialOffer__c'] =
                this.pageRecords[j].hospitalSpecialOffer;
            }
          }
          this.showTable = true;
          if (this.product_Limit != null && this.product_Limit != "") {
            var records = this.product_Limit.split(",");
                    if (
                        this.product_Limit != null &&
                        this.product_Limit != ''
                    ) {
                        var records = this.product_Limit.split(',');
            for (var i in records) {
              var parms = records[i].split("|");
                            var parms = records[i].split('|');
              var record = new Object();
              record["prodName"] = parms[0];
              record["limitLow"] = parms[1];
              record["limitUp"] = parms[2];
                            record['prodName'] = parms[0];
                            record['limitLow'] = parms[1];
                            record['limitUp'] = parms[2];
              this.productLimitRecords.push(record);
            }
          }
          // this.productLimitRecords = records;
          console.log(
            "productLimitRecords:" + JSON.stringify(this.productLimitRecords)
                        'productLimitRecords:' +
                            JSON.stringify(this.productLimitRecords)
          );
          console.log("product_Limit:" + this.product_Limit);
                    console.log('product_Limit:' + this.product_Limit);
          this.consumableorderdetailsRecordsview =
            result.consumableorderdetailsRecordsview;
          //add by WangXueqin 2023/05/05
          this.userPro_Type = result.userPro_Type;
          console.log("this.accountId:" + this.accountId);
          console.log("this.accountInfo:" + JSON.stringify(this.accountInfo));
                    console.log('this.accountId:' + this.accountId);
                    console.log(
                        'this.accountInfo:' + JSON.stringify(this.accountInfo)
                    );
          this.showSpinner = false;
          this.showPage = true;
          // this.showMyToast('初始化页面成功', '', 'success');
        } else {
          this.showPage = true;
          this.showSpinner = false;
          console.log("Error:" + result.errorMsg);
          this.showMyToast("初始化页面失败", result.errorMsg, "error");
                    console.log('Error:' + result.errorMsg);
                    this.showMyToast(
                        '初始化页面失败',
                        result.errorMsg,
                        'error'
                    );
        }
      })
      .catch((error) => {
        this.showSpinner = false;
        console.log("Error:" + error);
        this.showMyToast("初始化页面失败", JSON.stringify(error), "error");
                console.log('Error:' + error);
                this.showMyToast(
                    '初始化页面失败',
                    JSON.stringify(error),
                    'error'
                );
      });
  }
@@ -467,154 +485,156 @@
    var outputValue = event.detail.data.value;
    var outputType = event.detail.data.type;
    var recordId = event.detail.data.recordId;
    console.log("click:" + outputValue + "---" + outputType + "---" + recordId);
    if (outputType == "Title") {
        console.log(
            'click:' + outputValue + '---' + outputType + '---' + recordId
        );
        if (outputType == 'Title') {
      const config = {
        type: "standard__webPage",
                type: 'standard__webPage',
        attributes: {
          url: "/lexarrivegoods?ESetId=" + recordId
                    url: '/lexarrivegoods?ESetId=' + recordId
        }
      };
      this[NavigationMixin.Navigate](config);
    } else if (outputType == "TotalNum") {
      this.popTitle = "所有产品一览";
      initTotalNum({ ordId: recordId, type: "" }).then((result) => {
        if (result.result == "Success") {
        } else if (outputType == 'TotalNum') {
            this.popTitle = '所有产品一览';
            initTotalNum({ ordId: recordId, type: '' }).then((result) => {
                if (result.result == 'Success') {
          this.recordList = result.recordList;
          console.log("data:" + JSON.stringify(this.recordList));
                    console.log('data:' + JSON.stringify(this.recordList));
          this.showPop = true;
        } else {
          this.showMyToast(
            "加载所有产品一览页面失败",
                        '加载所有产品一览页面失败',
            result.errorMsg,
            "error"
                        'error'
          );
        }
      });
    } else if (outputType == "ArrDet") {
      if (recordId == "1") {
        this.popTitle = "所有已到货产品一览";
        initArrDetAll({ type: "" }).then((result) => {
          if (result.result == "Success") {
        } else if (outputType == 'ArrDet') {
            if (recordId == '1') {
                this.popTitle = '所有已到货产品一览';
                initArrDetAll({ type: '' }).then((result) => {
                    if (result.result == 'Success') {
            this.recordList = result.recordList;
            console.log("data:" + JSON.stringify(this.recordList));
                        console.log('data:' + JSON.stringify(this.recordList));
            this.showPop = true;
          } else {
            this.showMyToast(
              "加载所有已到货产品一览页面失败",
                            '加载所有已到货产品一览页面失败',
              result.errorMsg,
              "error"
                            'error'
            );
          }
        });
      } else {
        this.popTitle = "已到货产品一览";
                this.popTitle = '已到货产品一览';
        initArrDet({ orderId: recordId }).then((result) => {
          if (result.result == "Success") {
                    if (result.result == 'Success') {
            this.recordList = result.recordList;
            console.log("data:" + JSON.stringify(this.recordList));
                        console.log('data:' + JSON.stringify(this.recordList));
            this.showPop = true;
          } else {
            this.showMyToast(
              "加载已到货产品一览页面失败",
                            '加载已到货产品一览页面失败',
              result.errorMsg,
              "error"
                            'error'
            );
          }
        });
      }
    } else if (outputType == "DeliveryDet") {
      if (recordId == "1") {
        this.popTitle = "所有已发货还没到货产品一览";
        initDeliveryDetAll({ type: "" }).then((result) => {
          if (result.result == "Success") {
        } else if (outputType == 'DeliveryDet') {
            if (recordId == '1') {
                this.popTitle = '所有已发货还没到货产品一览';
                initDeliveryDetAll({ type: '' }).then((result) => {
                    if (result.result == 'Success') {
            this.recordList = result.recordList;
            console.log("data:" + JSON.stringify(this.recordList));
                        console.log('data:' + JSON.stringify(this.recordList));
            this.showPop = true;
          } else {
            this.showMyToast(
              "加载所有已发货还没到货产品一览页面失败",
                            '加载所有已发货还没到货产品一览页面失败',
              result.errorMsg,
              "error"
                            'error'
            );
          }
        });
      } else {
        this.popTitle = "未到货产品一览";
                this.popTitle = '未到货产品一览';
        initDeliveryDet({ orderId: recordId }).then((result) => {
          if (result.result == "Success") {
                    if (result.result == 'Success') {
            this.recordList = result.recordList;
            console.log("data:" + JSON.stringify(this.recordList));
                        console.log('data:' + JSON.stringify(this.recordList));
            this.showPop = true;
          } else {
            this.showMyToast(
              "加载未到货产品一览页面失败",
                            '加载未到货产品一览页面失败',
              result.errorMsg,
              "error"
                            'error'
            );
          }
        });
      }
    } else if (outputType == "NotArrDet") {
      if (recordId == "1") {
        this.popTitle = "所有还没发货产品一览";
        initNotArrDetAll({ type: "" }).then((result) => {
          if (result.result == "Success") {
        } else if (outputType == 'NotArrDet') {
            if (recordId == '1') {
                this.popTitle = '所有还没发货产品一览';
                initNotArrDetAll({ type: '' }).then((result) => {
                    if (result.result == 'Success') {
            this.recordList = result.recordList;
            console.log("data:" + JSON.stringify(this.recordList));
                        console.log('data:' + JSON.stringify(this.recordList));
            this.showPop = true;
          } else {
            this.showMyToast(
              "加载所有还没发货产品一览页面失败",
                            '加载所有还没发货产品一览页面失败',
              result.errorMsg,
              "error"
                            'error'
            );
          }
        });
      } else {
        this.popTitle = "还没发货数量";
                this.popTitle = '还没发货数量';
        initNotArrDet({ orderId: recordId }).then((result) => {
          if (result.result == "Success") {
                    if (result.result == 'Success') {
            this.recordList = result.recordList;
            console.log("data:" + JSON.stringify(this.recordList));
                        console.log('data:' + JSON.stringify(this.recordList));
            this.showPop = true;
          } else {
            this.showMyToast(
              "加载还没发货数量页面失败",
                            '加载还没发货数量页面失败',
              result.errorMsg,
              "error"
                            'error'
            );
          }
        });
      }
    } else if (outputType == "MoreThan7") {
      if (recordId == "1") {
        this.popTitle = "所有发货七天还未到货数";
        initMoreThan7All({ type: "" }).then((result) => {
          if (result.result == "Success") {
        } else if (outputType == 'MoreThan7') {
            if (recordId == '1') {
                this.popTitle = '所有发货七天还未到货数';
                initMoreThan7All({ type: '' }).then((result) => {
                    if (result.result == 'Success') {
            this.recordList = result.recordList;
            console.log("data:" + JSON.stringify(this.recordList));
                        console.log('data:' + JSON.stringify(this.recordList));
            this.showPop = true;
          } else {
            this.showMyToast(
              "加载所有发货七天还未到货数页面失败",
                            '加载所有发货七天还未到货数页面失败',
              result.errorMsg,
              "error"
                            'error'
            );
          }
        });
      } else {
        this.popTitle = "发货七天还未到货数";
                this.popTitle = '发货七天还未到货数';
        initMoreThan7({ orderId: recordId }).then((result) => {
          if (result.result == "Success") {
                    if (result.result == 'Success') {
            this.recordList = result.recordList;
            console.log("data:" + JSON.stringify(this.recordList));
                        console.log('data:' + JSON.stringify(this.recordList));
            this.showPop = true;
          } else {
            this.showMyToast(
              "加载发货七天还未到货数页面失败",
                            '加载发货七天还未到货数页面失败',
              result.errorMsg,
              "error"
                            'error'
            );
          }
        });
@@ -634,13 +654,9 @@
    // this.accountId +
    // '&userPro_Type=' +
    // this.userPro_Type;
    let url =
      "/lexproductlimitedit?accountid=" +
      this.accountId +
      "&userPro_Type=" +
      this.userPro_Type;
        let url = "/lexproductlimitedit?accountid=" + this.accountId + "&userPro_Type=" + this.userPro_Type;
    const config = {
      type: "standard__webPage",
            type: 'standard__webPage',
      attributes: {
        url: url
      }
@@ -651,10 +667,10 @@
  //新建消耗品订单
  newOrder() {
    this[NavigationMixin.Navigate]({
      type: "standard__objectPage",
            type: 'standard__objectPage',
      attributes: {
        objectApiName: "Consumable_order__c",
        actionName: "new"
                objectApiName: 'Consumable_order__c',
                actionName: 'new'
      },
      state: {
        useRecordTypeCheck: 1
@@ -663,22 +679,26 @@
  }
  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);
    // var mode;
    // if(this.isNoteStay){
@@ -713,16 +733,16 @@
  }
  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);
    const { fieldName: sortedBy, sortDirection } = event.detail;
    const cloneData = [...this.pageRecords];
    cloneData.sort(
      this.sortByMethod(sortedBy, sortDirection === "asc" ? 1 : -1)
            this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1)
    );
    this.pageRecords = cloneData;
    this.sortDirection = sortDirection;