From cb95755fe8496d8af6d40b05c4bbd4b6df2e77ab Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期一, 05 六月 2023 14:39:34 +0800
Subject: [PATCH] LEX Community Report&Dashboard

---
 force-app/main/default/lwc/lexConsumable/lexConsumable.js |   84 ++++++++++++++++++++++++++++-------------
 1 files changed, 57 insertions(+), 27 deletions(-)

diff --git a/force-app/main/default/lwc/lexConsumable/lexConsumable.js b/force-app/main/default/lwc/lexConsumable/lexConsumable.js
index 3c88359..1bc8cee 100644
--- a/force-app/main/default/lwc/lexConsumable/lexConsumable.js
+++ b/force-app/main/default/lwc/lexConsumable/lexConsumable.js
@@ -52,6 +52,8 @@
    @track contactDealer = [];
    @track proLimitAndDate = [];
    @track agencyProType;
+   @track agencyProType1;
+   @track OSHFLG = false;
    @track bargainPrice;
    @track showOrderDate = false;
    @track showAttUploadDate = false;
@@ -113,10 +115,10 @@
    @track tempidHp;
    @track hosCols = [
       // {label:'鍖婚櫌鍚嶇О',fieldName:'Name',type:'button',typeAttributes:{label:{fieldName:'Name'},variant:'base'}},
-      {label:'',type:'button',typeAttributes:{label:'閫夋嫨'},initialWidth:80,hideDefaultActions: true},
+      {label:'',type:'button',typeAttributes:{label:'閫夋嫨'},initialWidth:90,hideDefaultActions: true,wrapText:true},
       {label:'鍖婚櫌鍚嶇О',fieldName:'Name',initialWidth:380,wrapText:true,hideDefaultActions: true},
-      {label:'鐪佷唤',fieldName:'StateMaster',initialWidth:80,hideDefaultActions: true},
-      {label:'鍦板潃',fieldName:'Address__c',hideDefaultActions: true}
+      {label:'鐪佷唤',fieldName:'StateMaster',initialWidth:80,hideDefaultActions: true,wrapText:true},
+      {label:'鍦板潃',fieldName:'Address__c',hideDefaultActions: true,wrapText:true}
    ];
    //鍚堝悓鎼滅储
    @track contractLabel;
@@ -129,27 +131,27 @@
    @track contractName;
    @track tempidPp;
    @track conCols = [
-      {label:'',type:'button',typeAttributes:{label:'閫夋嫨'},initialWidth:80,hideDefaultActions: true},
+      {label:'',type:'button',typeAttributes:{label:'閫夋嫨'},initialWidth:90,hideDefaultActions: true,wrapText:true},
       {label:'鍚堝悓鍚嶇О',fieldName:'Name',wrapText:true,hideDefaultActions: true},
-      {label:'鐪佷唤',fieldName:'StateMaster',initialWidth:80,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}
+      {label:'鐪佷唤',fieldName:'StateMaster',initialWidth:80,hideDefaultActions: true,wrapText:true},
+      {label:'鐢宠閿�鍞',fieldName:'Sales_Section__c',initialWidth:160,hideDefaultActions: true,wrapText:true},
+      {label:'鍏佽鎶ヤ环鏈熼棿(寮�濮嬫棩)',fieldName:'Contract_Decide_Start_Date__c',initialWidth:175,hideDefaultActions: true,wrapText:true},
+      {label:'鍏佽鎶ヤ环鏈熼棿(缁撴潫鏃�)',fieldName:'Contract_Decide_End_Date__c',initialWidth:175,hideDefaultActions: true,wrapText:true}
    ];
 
    //娑堣�楀搧鏁版嵁col
    get cols(){
       var cols = [];
       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,sortable: true});
-      cols.push({label:'绗�4鍒嗙被',fieldName:'prodCategory4',wrapText:true,hideDefaultActions: true,initialWidth:90,sortable: true});
+      cols.push({label:'瑙勬牸',fieldName:'packing_list',wrapText:true,hideDefaultActions: true,initialWidth:50,cellAttributes: { alignment: "right" }});
+      cols.push({label:'CFDA鐘舵��',fieldName:'prodSFDAStatus',wrapText:true,hideDefaultActions: true,initialWidth:97});
+      cols.push({label:'娉ㄥ唽璇佺紪鐮佸彿',fieldName:'approbation_No',wrapText:true,hideDefaultActions: true,initialWidth:120});
+      cols.push({label:'娉ㄥ唽璇佹晥鏈�',fieldName:'expiration_Date',wrapText:true,hideDefaultActions: true,initialWidth:105});
+      cols.push({label:'绗�3鍒嗙被',fieldName:'prodCategory3',wrapText:true,hideDefaultActions: true,initialWidth:78,sortable: true});
+      cols.push({label:'绗�4鍒嗙被',fieldName:'prodCategory4',wrapText:true,hideDefaultActions: true,initialWidth:107,sortable: true});
       cols.push({label:'绗�5鍒嗙被',fieldName:'prodCategory5',wrapText:true,hideDefaultActions: true,initialWidth:80,sortable: true});
       if(this.cansee){
-         cols.push({label:'鏍囧噯鍗曚环',type:'number',typeAttributes:{minimumFractionDigits: 2},fieldName:'prodIntraTradeList',hideDefaultActions: true,initialWidth:60});
+         cols.push({label:'鏍囧噯鍗曚环',type:'number',typeAttributes:{minimumFractionDigits: 2},fieldName:'prodIntraTradeList',hideDefaultActions: true,initialWidth:80});
       }
       if(this.editAble){
          cols.push(
@@ -162,12 +164,12 @@
                allnumber: { fieldName: "allnumber" },
                valueType: 'Number'
             },
-            hideDefaultActions: true,initialWidth:70});
+            hideDefaultActions: true,initialWidth:80});
       }else{
-         cols.push({label:'閲囪喘鏁伴噺',fieldName:'consumableCount',hideDefaultActions: true,initialWidth:70,cellAttributes: { alignment: "right" }});
+         cols.push({label:'閲囪喘鏁伴噺',fieldName:'consumableCount',hideDefaultActions: true,initialWidth:80,cellAttributes: { alignment: "right" }});
       }
-      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:'lowerlimit',hideDefaultActions: true,initialWidth:100,cellAttributes: { alignment: "right" }});
+      cols.push({label:'鍦ㄥ簱鏁颁笂闄�',fieldName:'upperlimit',hideDefaultActions: true,initialWidth:100,cellAttributes: { alignment: "right" }});
       // cols.push({label:'鏈夋晥鏈熷簱瀛�(鐩�)',fieldName:'allnumber',hideDefaultActions: true,initialWidth:105,sortable: true});
       cols.push(
          {label:'鏈夋晥鏈熷簱瀛�(鐩�)',
@@ -178,8 +180,8 @@
             lowerlimit: { fieldName: "lowerlimit" },
             boxPrice: '鐩�'
          },
-         hideDefaultActions: true,initialWidth:105});
-      cols.push({label:'鏈夋晥鏈熷簱瀛�(涓�)',fieldName:'allnumber_piece',hideDefaultActions: true,initialWidth:105,cellAttributes: { alignment: "right" }});
+         hideDefaultActions: true,initialWidth:126});
+      cols.push({label:'鏈夋晥鏈熷簱瀛�(涓�)',fieldName:'allnumber_piece',hideDefaultActions: true,initialWidth:126,cellAttributes: { alignment: "right" }});
       return cols;
    }
 
@@ -314,6 +316,8 @@
                this.category4Option = result.category4Option;
                this.category5Option = result.category5Option;
                this.agencyProType = result.agencyProType;
+               this.agencyProType1 = result.agencyProType1;
+               this.OSHFLG = result.OSHFLG;
                this.hospitalName = result.hospitalName;
                this.contractName = result.contractName;
                this.contractLabel = '缁忛攢鍟嗘湁鏁堝悎鍚�';
@@ -674,7 +678,10 @@
          contactDealerStr:JSON.stringify(this.contactDealer),
          methodTypeStr:this.pageType,
          eSetIdStr:this.esetId,
-         hospitalIdStr : this.hospitalId
+         hospitalIdStr : this.hospitalId,
+         contractIdStr : this.contractId,
+         agencyProType1Str : this.agencyProType1,
+         OSHFLGStr : this.OSHFLG
       }).then(result=>{
          this.showSpinner = false;
          if(result.result == 'Success'){
@@ -705,7 +712,10 @@
          consumableorderdetailsRecordsviewStr:JSON.stringify(this.consumableorderdetailsRecordsview),
          contactDealerStr:JSON.stringify(this.contactDealer),
          methodTypeStr:this.pageType,
-         hospitalIdStr:this.hospitalId
+         hospitalIdStr:this.hospitalId,
+         contractIdStr : this.contractId,
+         agencyProType1Str : this.agencyProType1,
+         OSHFLGStr : this.OSHFLG
       }).then(result=>{
          this.showSpinner = false;
          if(result.result == 'Success'){
@@ -1040,6 +1050,14 @@
    //    this.chooseHospitalId = hosid;
    // }
 
+   changeHos(event){
+      this.hospitalName = event.detail.value;
+   }
+
+   changeCon(event){
+      this.contractName = event.detail.value;
+   }
+
    chooseHos(event){
       const row = event.detail.row;
       this.chooseHospitalId = row.Id;
@@ -1104,7 +1122,7 @@
 
    //鎵撳紑鍚堝悓妫�绱㈠脊绐楀苟鍒濆鍖�
    showSearchCon(){
-      initContract({ctype:this.agencyProType})
+      initContract({ctype:this.agencyProType1})
       .then(result=>{
          if(result.result == 'Success'){
             this.showConPop = true;
@@ -1127,7 +1145,7 @@
 
    //妫�绱㈠悎鍚�
    searchCon(){
-      searchContract({searchName:this.searchNameCon, accountId:this.accountid, ctype:this.agencyProType})
+      searchContract({searchName:this.searchNameCon, accountId:this.accountid, ctype:this.agencyProType1,OSHFLGStr : this.OSHFLG})
       .then(result=>{
          if(result.result == 'Success'){
             this.contractList = result.attList;
@@ -1222,9 +1240,21 @@
    }
 
    showMyToast(title, message, variant) {
-      console.log('show custom message')
+      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('success','<strong>'+message+'<strong/>','utility:warning',1000);
+      showToast(variant,content,iconName,10000);
       // var mode;
       // if(this.isNoteStay){
       //     mode ='sticky';

--
Gitblit v1.9.1