buli
2023-05-22 71b93327e8f3fb3bffffc7c033c1f782e7b6ab32
force-app/main/default/lwc/lexConsumable/lexConsumable.js
@@ -18,6 +18,10 @@
import searchHospital from '@salesforce/apex/LexSearchHospitalController.searchHospital';
import initContract from '@salesforce/apex/LexSearchContractController.init';
import searchContract from '@salesforce/apex/LexSearchContractController.searchContract';
import deleteAtt from '@salesforce/apex/LexConsumableController.deleteAtt';
//table css
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
export default class LexConsumable extends NavigationMixin(LightningElement) {
   
@@ -42,6 +46,7 @@
   @track category4Option = [];
   @track category5Option = [];
   @track consumableorderdetailsRecordsview = [];
   @track currentRecord = [];//分页
   @track selectRows = [];
   @track attachmentRecoeds = [];
   @track contactDealer = [];
@@ -71,6 +76,19 @@
   @track cansee = false;
   @track showSpinner = true;
   @track showPopSpinner = false;
   stylesLoaded = false;
   //是否一直显示提示
   @track isNoteStay = true;
   //排序相关
   @track sortDirection = 'asc';
   @track sortedBy;
   //分页
   @track currentPage = 1;
   @track pageSize = 10;
   // @track totalPage = 0;
   @track pageSizeOptions = [10, 25, 50, 100];
   @track recordStart = 0;
   @track recordEnd = 0;
   //报错提醒
   // @track hasError = false;
   @track errorMsgs = [];
@@ -114,24 +132,24 @@
      {label:'',type:'button',typeAttributes:{label:'选择'},initialWidth:80,hideDefaultActions: true},
      {label:'合同名称',fieldName:'Name',wrapText:true,hideDefaultActions: true},
      {label:'省份',fieldName:'StateMaster',initialWidth:80,hideDefaultActions: true},
      {label:'申请销售课',fieldName:'Sales_Section__c',initialWidth:200,hideDefaultActions: true},
      {label:'允许报价期间(开始日)',fieldName:'Contract_Decide_Start_Date__c',initialWidth:200,hideDefaultActions: true},
      {label:'允许报价期间(结束日)',fieldName:'Contract_Decide_End_Date__c',initialWidth:200,hideDefaultActions: true}
      {label:'申请销售课',fieldName:'Sales_Section__c',initialWidth:160,hideDefaultActions: true},
      {label:'允许报价期间(开始日)',fieldName:'Contract_Decide_Start_Date__c',initialWidth:160,hideDefaultActions: true},
      {label:'允许报价期间(结束日)',fieldName:'Contract_Decide_End_Date__c',initialWidth:160,hideDefaultActions: true}
   ];
   //消耗品数据col
   get cols(){
      var cols = [];
      cols.push({label:'消耗品名称',fieldName:'prodName',wrapText:true,hideDefaultActions: true});
      cols.push({label:'规格',fieldName:'packing_list',hideDefaultActions: true,initialWidth:40});
      cols.push({label:'消耗品名称',fieldName:'prodName',wrapText:true,hideDefaultActions: true,sortable: true});
      cols.push({label:'规格',fieldName:'packing_list',hideDefaultActions: true,initialWidth:40,cellAttributes: { alignment: "right" }});
      cols.push({label:'CFDA状态',fieldName:'prodSFDAStatus',hideDefaultActions: true,initialWidth:78});
      cols.push({label:'注册证编码号',fieldName:'approbation_No',wrapText:true,hideDefaultActions: true,initialWidth:153});
      cols.push({label:'注册证效期',fieldName:'expiration_Date',hideDefaultActions: true,initialWidth:100});
      cols.push({label:'第3分类',fieldName:'prodCategory3',wrapText:true,hideDefaultActions: true,initialWidth:95});
      cols.push({label:'第4分类',fieldName:'prodCategory4',wrapText:true,hideDefaultActions: true,initialWidth:80});
      cols.push({label:'第5分类',fieldName:'prodCategory5',wrapText:true,hideDefaultActions: true,initialWidth:90});
      cols.push({label:'第3分类',fieldName:'prodCategory3',wrapText:true,hideDefaultActions: true,initialWidth:95,sortable: true});
      cols.push({label:'第4分类',fieldName:'prodCategory4',wrapText:true,hideDefaultActions: true,initialWidth:90,sortable: true});
      cols.push({label:'第5分类',fieldName:'prodCategory5',wrapText:true,hideDefaultActions: true,initialWidth:80,sortable: true});
      if(this.cansee){
         cols.push({label:'标准单价',fieldName:'prodIntraTradeList',hideDefaultActions: true,initialWidth:60});
         cols.push({label:'标准单价',type:'number',typeAttributes:{minimumFractionDigits: 2},fieldName:'prodIntraTradeList',hideDefaultActions: true,initialWidth:60});
      }
      if(this.editAble){
         cols.push(
@@ -139,32 +157,46 @@
            type: "customTableInput",typeAttributes: {
               recordId: { fieldName: "recordId" },
               inputValue: { fieldName: "consumableCount" },
               upperLimit: { fieldName: "upperlimit" },
               lowerLimit: { fieldName: "lowerlimit" },
               allnumber: { fieldName: "allnumber" },
               valueType: 'Number'
            },
            hideDefaultActions: true,initialWidth:70});
      }else{
         cols.push({label:'采购数量',fieldName:'consumableCount',hideDefaultActions: true,initialWidth:70});
         cols.push({label:'采购数量',fieldName:'consumableCount',hideDefaultActions: true,initialWidth:70,cellAttributes: { alignment: "right" }});
      }
      cols.push({label:'在库数下限',fieldName:'lowerlimit',hideDefaultActions: true,initialWidth:85});
      cols.push({label:'在库数上限',fieldName:'upperlimit',hideDefaultActions: true,initialWidth:85});
      cols.push({label:'有效期库存(盒)',fieldName:'allnumber',hideDefaultActions: true,initialWidth:105});
      cols.push({label:'有效期库存(个)',fieldName:'allnumber_piece',hideDefaultActions: true,initialWidth:105});
      return cols;l
      cols.push({label:'在库数下限',fieldName:'lowerlimit',hideDefaultActions: true,initialWidth:85,cellAttributes: { alignment: "right" }});
      cols.push({label:'在库数上限',fieldName:'upperlimit',hideDefaultActions: true,initialWidth:85,cellAttributes: { alignment: "right" }});
      // cols.push({label:'有效期库存(盒)',fieldName:'allnumber',hideDefaultActions: true,initialWidth:105,sortable: true});
      cols.push(
         {label:'有效期库存(盒)',
         type: "customInventoryColor",
         typeAttributes: {
            value: { fieldName: "allnumber" },
            upperlimit: { fieldName: "upperlimit" },
            lowerlimit: { fieldName: "lowerlimit" },
            boxPrice: '盒'
         },
         hideDefaultActions: true,initialWidth:105});
      cols.push({label:'有效期库存(个)',fieldName:'allnumber_piece',hideDefaultActions: true,initialWidth:105,cellAttributes: { alignment: "right" }});
      return cols;
   }
   //附件cols
   @track attCols = [
      {label:'标题',fieldName:'attUrl',type:'url',typeAttributes:{label:{fieldName:'fileName'},target: "_blank"},hideDefaultActions: true},
      {label:'创建人',fieldName:'ownerUrl',type:'url',typeAttributes:{label:{fieldName:'ownerName'},target: "_blank"},hideDefaultActions: true},
      {label:'上传日期',fieldName:'updateDate',hideDefaultActions: true}
      {label:'上传日期',fieldName:'updateDate',hideDefaultActions: true},
      {label:'',type:'tableCellIcon',typeAttributes:{iconName:'utility:delete',recordId:{fieldName : 'recordId'}},initialWidth:50,hideDefaultActions: true}
   ];
   //取得所有被勾选的产品id
   getAllChecked(){
      this.selectRows = [];
      for(var i in this.consumableorderdetailsRecordsview){
         if(this.consumableorderdetailsRecordsview[i].check){
            this.selectRows.push(this.consumableorderdetailsRecordsview[i].recordId);
      for(var i in this.currentRecord){
         if(this.currentRecord[i].check){
            this.selectRows.push(this.currentRecord[i].recordId);
         }
      }
   }
@@ -190,6 +222,11 @@
      }
      for(var i in this.selectRows){
         console.log("checkId1:"+this.selectRows[i]);
         for(var i in this.currentRecord){
            if(this.currentRecord[i].recordId == this.selectRows[i]){
               console.log("currentRecord:"+this.selectRows[i]);
            }
         }
      }
   }
@@ -210,6 +247,30 @@
         }
      }
      this.getAllChecked();
      for(var i in this.currentRecord){
         if(this.currentRecord[i].recordId == recordId){
            console.log("currentRecord1:"+this.currentRecord[i].esd.Consumable_count__c);
         }
      }
   }
   //采购数量失焦
   conCountBlur(event){
      var conCount = event.detail.data.value;
      var allnumber = event.detail.data.allnumber;
      var upperLimit = event.detail.data.upperLimit;
      var lowerLimit = event.detail.data.lowerLimit;
      console.log('limit:'+conCount+'---'+ allnumber+'---'+lowerLimit+'---'+allnumber);
      if(upperLimit != null && lowerLimit != null && conCount != null && allnumber != null){
         if(parseInt(allnumber) + parseInt(conCount) > upperLimit){
            // window.alert("该产品订购数量超出库存上限!");
            this.showMyToast('该产品订购数量超出库存上限!','','error');
         }
         if(parseInt(allnumber) + parseInt(conCount) < lowerLimit){
            // window.alert("该产品订购数量低于库存下限!");
            this.showMyToast('该产品订购数量低于库存下限!','','error');
         }
      }
   }
   @wire(CurrentPageReference)
@@ -225,11 +286,25 @@
      }
   }
   
   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(){
      this.showSpinner = true;
      initPage({type:this.pageType, esetId:this.esetId, keywordStr:this.keyWords})
         .then(result=>{
            this.isNoteStay = result.isNoteStay;
            if(result.result == 'Success'){
               this.editAble = result.editAble;
               this.edoffersPrice = result.edoffersPrice;
@@ -243,14 +318,29 @@
               this.contractName = result.contractName;
               this.contractLabel = '经销商有效合同';
               this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview;
               this.currentPage = 1;
               this.showCurrentReocrd();
               this.getAllChecked();
               this.attachmentRecoeds = result.attachmentRecoeds;
               console.log("attSize:"+this.attachmentRecoeds.length);
               for(var i in this.attachmentRecoeds){
                  this.attachmentRecoeds[i]['recordId'] = this.attachmentRecoeds[i].Concc.Id;
                  this.attachmentRecoeds[i]['fileName'] = this.attachmentRecoeds[i].Concc.Title;
                  this.attachmentRecoeds[i]['documentId'] = this.attachmentRecoeds[i].Concc.ContentDocumentId;
                  this.attachmentRecoeds[i]['fileFullName'] = this.attachmentRecoeds[i].Concc.Title;
                  var contractionName = this.attachmentRecoeds[i].Concc.Title;
                  // var contractionName = '长文件长文件长文件长文件';
                  if(contractionName.length > 25){
                     contractionName = contractionName.substr(0,21) + "...";
                  }
                  this.attachmentRecoeds[i]['fileName'] = contractionName;
                  this.attachmentRecoeds[i]['ownerName'] = this.attachmentRecoeds[i].Concc.Owner.Name;
                  this.attachmentRecoeds[i]['updateDate'] = this.attachmentRecoeds[i].Concc.CreatedDate;
                  this.attachmentRecoeds[i]['downloadUrl'] = '/sfc/servlet.shepherd/document/download/'+this.attachmentRecoeds[i].Concc.ContentDocumentId+'?operationContext=S1';
                  // var date = this.attachmentRecoeds[i].Concc.CreatedDate;
                  // var year = date.getFullYear();
                  // var month = date.getMonth();
                  // var day = date.getDay();
                  // console.log(year+'-'+month+'-'+day);
                  this.attachmentRecoeds[i]['updateDate'] = new Date(Date.parse(this.attachmentRecoeds[i].Concc.CreatedDate)).toLocaleString();
                  this.attachmentRecoeds[i]['attUrl'] = '/'+this.attachmentRecoeds[i].Concc.Id;
                  this.attachmentRecoeds[i]['ownerUrl'] = '/'+this.attachmentRecoeds[i].Concc.OwnerId;
               }
@@ -267,6 +357,7 @@
               this.contactDealer = result.contactDealer;
               this.pageType = result.methodType;
               this.proLimitAndDate = result.proLimitAndDate;
               console.log("proLimitAndDate:"+JSON.stringify(this.proLimitAndDate));
               this.coc = result.coc;
               this.cocId = this.coc.Id;
               if(this.pageType == 'hospitalorder' && this.agencyProType != 'ET'){
@@ -317,6 +408,60 @@
            console.log("error:"+error);
            this.showMyToast('初始化页面失败',error,'error');
         })
   }
   //排序
   onHandleSort(event){
      //将已经选好了的放到前面,不进行排序
      console.log('sort');
      if(this.editAble){
         const { fieldName: sortedBy, sortDirection } = event.detail;
         const cloneData = [...this.currentRecord];
         cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1));
         let index = 0;
         let selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
         let selectedRowsIds = [];
         for(var i in selectedRows){
            selectedRowsIds.push(selectedRows[i].recordId);
         }
         console.log('selectedRowsIds = ' + JSON.stringify(selectedRowsIds));
         for(var i = 0;i < cloneData.length ; i++){
            if(selectedRowsIds.indexOf(cloneData[i].recordId) != -1){
               if(i != 0){
                  let temp = cloneData[index];
                  cloneData[index] = cloneData[i];
                  cloneData[i] = temp;
               }
               index++;
            }
         }
         this.currentRecord = cloneData;
         this.sortDirection = sortDirection;
         this.sortedBy = sortedBy;
      }else{
         const { fieldName: sortedBy, sortDirection } = event.detail;
         const cloneData = [...this.currentRecord];
         cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1));
         this.currentRecord = cloneData;
         this.sortDirection = sortDirection;
         this.sortedBy = sortedBy;
      }
   }
   sortBy(field, reverse, primer) {
      const key = primer
          ? function (x) {
                return primer(x[field]);
            }
          : function (x) {
                return x[field];
            };
      return function (a, b) {
          a = key(a);
          b = key(b);
          return reverse * ((a > b) - (b > a));
      };
   }
   
   //是否有警告
@@ -411,10 +556,15 @@
         dealerProductIdStr:JSON.stringify(this.dealerProductId), 
         methodTypeStr:this.pageType,
         editAbleStr:this.editAble,
         consumableorderdetailsRecordsviewStr:JSON.stringify(this.consumableorderdetailsRecordsview)})
         consumableorderdetailsRecordsviewStr:JSON.stringify(this.consumableorderdetailsRecordsview),
         proLimitAndDateList : this.proLimitAndDate
      })
            .then(result=>{
               if(result.result == 'Success'){
                  this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview;
                  this.currentPage = 1;
                  this.currentRecord = [];
                  this.showCurrentReocrd();
                  this.getAllChecked();
                  this.showSpinner = false;
                  this.errorMsgs = result.errorMsgList;
@@ -460,10 +610,14 @@
         dealerProductIdStr:JSON.stringify(this.dealerProductId), 
         methodTypeStr:this.pageType,
         editAbleStr:this.editAble,
         consumableorderdetailsRecordsviewStr:JSON.stringify(this.consumableorderdetailsRecordsview)
         consumableorderdetailsRecordsviewStr:JSON.stringify(this.consumableorderdetailsRecordsview),
         proLimitAndDateList : this.proLimitAndDate
      }).then(result=>{
            if(result.result == 'Success'){
               this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview;
               this.currentPage = 1;
               this.currentRecord = [];
               this.showCurrentReocrd();
               this.getAllChecked();
               this.showSpinner = false;
               this.showMyToast('搜索成功',result.errorMsg,'success');
@@ -477,33 +631,6 @@
               }
            }
         })
   }
   //附件详情
   attClick1(event){
      var id = event.currentTarget.dataset.name;
      console.log('id:'+id);
      const config = {
         type: 'standard__webPage',
         attributes: {
             url: '/detail/'+id,
         }
     };
     this[NavigationMixin.Navigate](config);
   }
   //附件创建人详情
   attClick2(event){
      var id = event.currentTarget.dataset.name;
      var site = window.location.origin;
      console.log('id:'+id);
      const config = {
         type: 'standard__webPage',
         attributes: {
             url: site+'/consumable/servlet/servlet.FileDownload?file='+id,
         }
     };
     this[NavigationMixin.Navigate](config);
   }
   //选择所有
@@ -520,19 +647,19 @@
   }
   //采购数量change事件
   consumableCountChange(event){
      let index = event.target.getAttribute("data-index");
      var value = event.target.value;
      this.consumableorderdetailsRecordsview[index].esd.Consumable_count__c = value;
      if(isNaN(value)){
         value=0.00;
      }
      if(value != null && value !=0 && value!=''){
         this.consumableorderdetailsRecordsview[index].check = true;
      }else{
         this.consumableorderdetailsRecordsview[index].check = false;
      }
   }
   // consumableCountChange(event){
   //    let index = event.target.getAttribute("data-index");
   //    var value = event.target.value;
   //    this.consumableorderdetailsRecordsview[index].esd.Consumable_count__c = value;
   //    if(isNaN(value)){
   //       value=0.00;
   //    }
   //    if(value != null && value !=0 && value!=''){
   //       this.consumableorderdetailsRecordsview[index].check = true;
   //    }else{
   //       this.consumableorderdetailsRecordsview[index].check = false;
   //    }
   // }
   //保存订单
   saveOrder(event){
@@ -768,10 +895,8 @@
   //上传附件
   uploadAtt(event){
      if(this.filesUploaded.length > 0) {
         this.showPopSpinner = true;
         this.file = this.filesUploaded[0];
         if (this.file.size > this.MAX_FILE_SIZE) {
            this.showPopSpinner = false;
            window.console.log('文件过大');
            return ;
         }
@@ -789,17 +914,15 @@
      else {
         this.fileName = '请选择一个文件上传';
      }
      this.showPopSpinner = false;
   }
   //调用上传附件后台方法
   saveToFile() {
      // this.showSpinner = true;
      this.showPopSpinner = true;
      filesUpload({pId:this.esetId, fileName: this.file.name, base64Data: encodeURIComponent(this.fileContents)})
         .then(result => {
            this.showPopSpinner = false;
            if(result.result == 'Success'){
               // this.showMyToast('上传成功','','success');
               this.closePop();
               window.location.reload();
            }else{
@@ -810,6 +933,44 @@
         .catch(error => {
            this.showPopSpinner = false;
            this.showMyToast('上传失败',error,'error');
         });
   }
   //删除附件
   deleteAtt(event){
      this.showSpinner = true;
      var recordId = event.target.getAttribute("data-fileid");
      console.log('attid:'+recordId);
      deleteAtt({contentVersionId : recordId})
      .then(result=>{
         this.showSpinner = false;
         if(result.result == 'Success'){
            window.location.reload();
         }else{
            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');
      })
   }
   //预览附件
   previweAtt(event){
      var recordId = event.target.getAttribute("data-fileid");
      console.log(recordId);
      this[NavigationMixin.Navigate]({
         type:'standard__namedPage',
         attributes:{
            pageName:'filePreview'
         },
         state:{
            recordIds: recordId,
            selectedRecordId: recordId
         }
         });
   }
@@ -916,6 +1077,9 @@
            }).then(result=>{
               if(result.result == 'Success'){
                  this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview;
                  this.currentPage = 1;
                  this.currentRecord = [];
                  this.showCurrentReocrd();
                  this.getAllChecked();
                  this.showMyToast('搜索成功',result.errorMsg,'success');
               }else{
@@ -1032,6 +1196,10 @@
            }).then(result=>{
               if(result.result == 'Success'){
                  this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview;
                  this.currentPage = 1;
                  this.currentRecord = [];
                  this.showCurrentReocrd();
                  this.getAllChecked();
                  this.showMyToast('搜索成功',result.errorMsg,'success');
               }else{
                  console.log("Error:"+result.errorMsg);
@@ -1054,11 +1222,137 @@
   }
   showMyToast(title,message,variant){
      const evt = new ShowToastEvent({
         title : title,
         message: message,
         variant: variant
      });
      this.dispatchEvent(evt);
      console.log('show custom message')
      this.template.querySelector('c-common-toast').
      showToast('success','<strong>'+message+'<strong/>','utility:warning',1000);
      // var mode;
      // if(this.isNoteStay){
      //     mode ='sticky';
      // }else{
      //     mode = 'dismissable';
      // }
      // const evt = new ShowToastEvent({
      //     title: title,
      //     message: message,
      //     variant: variant,
      //     mode: mode
      // });
      // this.dispatchEvent(evt);
   }
   //分页
   showCurrentReocrd(){
      var startIndex = 0;
      var endIndex = 0;
      console.log('len:'+this.consumableorderdetailsRecordsview.length);
      if(this.consumableorderdetailsRecordsview != null && this.consumableorderdetailsRecordsview.length > 0){
         var currentRecord = [];
         var currentCount = 0;
         var mu = this.consumableorderdetailsRecordsview.length % this.pageSize;
         if(this.currentPage == this.totalPage){
            if(mu != 0){
               currentCount = mu;
            }else{
               currentCount = this.pageSize;
            }
         }else{
            currentCount = this.pageSize;
         }
         console.log('this.totalPage:'+this.totalPage);
         console.log('this.pageSize:'+this.pageSize);
         console.log('mu:'+mu);
         console.log('currentCount:'+currentCount);
         startIndex = (this.currentPage - 1) * this.pageSize;
         endIndex = parseInt(startIndex) + parseInt(currentCount) - 1;
         console.log('startIndex:'+startIndex);
         console.log('endIndex:'+endIndex);
         if(this.editAble){
            for(var i in this.currentRecord){
               if(this.currentRecord[i].check){
                  currentRecord.push(this.currentRecord[i]);
               }
            }
         }
         for(var i = startIndex; i <= endIndex; i++){
            var count  = 0;
            for(var j in this.currentRecord){
               if(this.consumableorderdetailsRecordsview[i].recordId == this.currentRecord[j].recordId){
                  count++;
               }
            }
            if(count == 0){
               currentRecord.push(this.consumableorderdetailsRecordsview[i]);
            }
         }
         this.recordStart = startIndex + 1;
         this.recordEnd = endIndex + 1;
         this.currentRecord = currentRecord;
      }else{
         this.currentPage = 0;
         this.currentRecord = [];
      }
   }
   get prePage(){
      return this.currentPage - 1;
   }
   get nextPage(){
      return this.currentPage + 1;
   }
   get totalPage(){
      if(this.consumableorderdetailsRecordsview.length % this.pageSize == 0){
         return Math.trunc(this.consumableorderdetailsRecordsview.length / this.pageSize);
      }else{
         return Math.trunc(this.consumableorderdetailsRecordsview.length / this.pageSize) + 1;
      }
   }
   get totalRecords(){
      return this.consumableorderdetailsRecordsview.length;
   }
   //第一页
   goFirstPage(){
      this.currentPage = 1;
      this.showCurrentReocrd();
   }
   //最后一页
   goLastPage(){
      this.currentPage = this.totalPage;
      this.showCurrentReocrd();
   }
   //上一页
   prePageClick(){
      this.currentPage = this.currentPage - 1;
      this.showCurrentReocrd();
   }
   //下一页
   nextPageClick(){
      this.currentPage = this.currentPage + 1;
      this.showCurrentReocrd();
   }
   //page size change
   pageSizeChange(event){
      console.log('pagesize:'+event.detail);
      this.pageSize = event.detail;
      this.currentPage = 1;
      this.currentRecord = [];
      this.showCurrentReocrd();
   }
   //上一页按钮是否disable
   get previousButtonDisabled() {
      return this.currentPage == 1 || this.currentPage == 0;
   }
   //下一页按钮是否disable
   get nextButtonDisabled() {
      return this.currentPage == this.totalPage;
   }
}