From 3b96b51ff6a671445bbeeb0ec155d9b5d85f2998 Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期三, 10 四月 2024 16:00:43 +0800
Subject: [PATCH] 1

---
 force-app/main/default/lwc/tEnquiry/tEnquiry.js |   96 +++++++++++++++++-------------------------------
 1 files changed, 34 insertions(+), 62 deletions(-)

diff --git a/force-app/main/default/lwc/tEnquiry/tEnquiry.js b/force-app/main/default/lwc/tEnquiry/tEnquiry.js
index 768845f..b0fd93d 100644
--- a/force-app/main/default/lwc/tEnquiry/tEnquiry.js
+++ b/force-app/main/default/lwc/tEnquiry/tEnquiry.js
@@ -34,33 +34,7 @@
     IsLeftStyle = "" //鎻愮ず妗嗙殑鏍峰紡
     BgColorStyle = "" 
     toastTime = null;
-    isSuccess = false;
-    message;
-    visible;
-    closeAction(){
-        this.visible = false;
-    }
-    showToast(msg,type) {
-        try {
-            if(type == 'success'){
-                this.isSuccess = true;
-            }else{
-                this.isSuccess = false;
-            }
-            this.message = msg;
-            this.visible = true;
-            let delay = 5000;
-            console.log(this.message);
-            console.log('1');
-            // setTimeout(() => {
-            //     this.visible = false;
-            // }, delay ); 
-        } catch (error) {
-            console.log(error);
-        }
-
-        
-    }
+    IsLeftStyle = "width: 100%;top: 14%;display: flex;justify-content: center;"
     Alert(content,error = false,left = false){
         this.Tongzhishow = false
         clearTimeout(this.toastTime)
@@ -69,17 +43,16 @@
         
         if (error) {
             this.TongzhiIcon = "utility:error";
-            this.BgColorStyle = "background-color:#ba0517 !important;padding: 9px 9px 9px 18px;";
+            this.BgColorStyle = "background-color:#ba0517 !important;padding:0.65rem 0.75rem 0.65rem 1.25rem;";
         }else{
             this.TongzhiIcon = "utility:success";
-            this.BgColorStyle = "background-color:rgb(46, 132, 74)!important;padding: 9px 9px 9px 18px;";
-            toastTime = setTimeout(() => {
-               this.Tongzhishow = false
-            },3000)
+            this.BgColorStyle = "background-color:rgb(46, 132, 74)!important;padding:0.65rem 0.75rem 0.65rem 1.25rem;";
+            // this.toastTime = setTimeout(() => {
+            //    this.Tongzhishow = false
+            // },3000)
         }
         // if (left) {
         //     // this.IsLeftStyle = "left: 0.25rem;"
-            this.IsLeftStyle = "width: 100%;top: 14%;display: flex;justify-content: center;"
         // }else{
         //     this.IsLeftStyle = "color:#fff"
         // }
@@ -94,7 +67,7 @@
         }
         
     }
-
+    inputValue = "";
     //==================鑾峰彇鎷涙姇鏍囬」鐩甶d================
     ParamIdStr = ''; // url 鍙傛暟Id
     getQueryVariable(variable)
@@ -159,7 +132,7 @@
 
 
             this.departmentId = Datas[0].department__c;
-            // this.yyId = Datas[0].Hospital__c;
+            this.yyId = Datas[0].Hospital__c;
 
             // 20210914 鎴樼暐绉戝淇敼
             this.depart_sels = Datas[0].department_selection__c;
@@ -181,8 +154,7 @@
                 if (isloading == 2) {
                     this.OnLoading(false);
                     if (flag) {
-                        // this.Alert("淇濆瓨鎴愬姛",false);
-                        this.showToast('淇濆瓨鎴愬姛','success');
+                        this.Alert("淇濆瓨鎴愬姛",false);
                     }
                 }
             })
@@ -202,8 +174,7 @@
                 if (isloading == 2) {
                     this.OnLoading(false);
                     if (flag) {
-                        // this.Alert("淇濆瓨鎴愬姛",false);
-                        this.showToast('淇濆瓨鎴愬姛','success');
+                        this.Alert("淇濆瓨鎴愬姛",false);
                     }
                 }
                
@@ -300,23 +271,26 @@
 
     SearchFn(event){
         debugger;
+        console.log(this.inputValue,'鎼滅储鍐呭')
         if (this.yyId != undefined && this.yyId != '') {
             this.YYSelectedId = this.yyId;
         }
 
-        if ((this.XJBMValue == '' || this.XJBMValue == ' ') && (this.YYSelectedId == '' || this.YYSelectedId == ' ')) {
-            this.OnLoading(true);
-            GetNormalProductDataSearch({noStr:undefined,IdStr:this.ParamIdStr,hospital:this.YYSelectedId,hospitalArr:this.hisotryData,departments:this.depart_sels}).then(response=>{
-                var datas = JSON.parse(response);
-                this.notselectdata = datas;
-                this.template.querySelector('[data-parent-id="table1"]').refreshdata(this.selectdata,this.notselectdata);
-                this.OnLoading(false);
-            })
-            return ;
-        }
+        // if ((this.XJBMValue == '' || this.XJBMValue == ' ')
+        // //  && (this.YYSelectedId == '' || this.YYSelectedId == ' ')
+        // ) {
+        //     this.OnLoading(true);
+        //     GetNormalProductDataSearch({noStr:undefined,inputText:this.inputValue,IdStr:this.ParamIdStr,hospital:this.YYSelectedId,hospitalArr:this.hisotryData,departments:this.depart_sels}).then(response=>{
+        //         var datas = JSON.parse(response);
+        //         this.notselectdata = datas;
+        //         this.template.querySelector('[data-parent-id="table1"]').refreshdata(this.selectdata,this.notselectdata);
+        //         this.OnLoading(false);
+        //     })
+        //     return ;
+        // }
         this.OnLoading(true);
         
-        GetNormalProductDataSearch({noStr:this.XJBMValue,IdStr:this.ParamIdStr,hospital:this.YYSelectedId,hospitalArr:this.hisotryData,departments:this.depart_sels}).then(response=>{
+        GetNormalProductDataSearch({noStr:this.XJBMValue,IdStr:this.ParamIdStr,inputText:this.inputValue,hospital:this.YYSelectedId,hospitalArr:this.hisotryData,departments:this.depart_sels}).then(response=>{
             
             var datas = JSON.parse(response);
             this.notselectdata = datas;
@@ -343,12 +317,11 @@
             isloading ++;
             if (isloading == 2) {
                 this.OnLoading(false);
-                // this.Alert("淇濆瓨鎴愬姛",false);
-                this.showToast('淇濆瓨鎴愬姛','success');
+                this.Alert("淇濆瓨鎴愬姛",false);
             }
         })
         
-        GetNormalProductDataSearch({noStr:this.XJBMValue,IdStr:this.ParamIdStr,hospital:this.YYSelectedId,hospitalArr:this.hisotryData,departments:this.depart_sels}).then(response=>{
+        GetNormalProductDataSearch({noStr:this.XJBMValue,IdStr:this.ParamIdStr,inputText:this.inputValue,hospital:this.YYSelectedId,hospitalArr:this.hisotryData,departments:this.depart_sels}).then(response=>{
             
             var datas = JSON.parse(response);
             this.notselectdata = datas;
@@ -356,8 +329,7 @@
             isloading ++;
             if (isloading == 2) {
                 this.OnLoading(false);
-                // this.Alert("淇濆瓨鎴愬姛",false);
-                this.showToast('淇濆瓨鎴愬姛','success');
+                this.Alert("淇濆瓨鎴愬姛",false);
             }
         })
     }
@@ -371,8 +343,7 @@
         var flag =  this.compareSelected();
         if (flag == false) {
             this.OnLoading(false);
-            // this.Alert("鍖婚櫌涓嶅尮閰嶏紝淇濆瓨澶辫触锛�",true);
-            this.showToast('鍖婚櫌涓嶅尮閰嶏紝淇濆瓨澶辫触锛�','error');
+            this.Alert("鍖婚櫌涓嶅尮閰嶏紝淇濆瓨澶辫触锛�",true);
             return;
         }
         debugger;
@@ -389,12 +360,10 @@
                 this.UpdateDatas(this.notselected);
                 window.location.hash = "Refresh"+"=="+this.ParamIdStr;
                 this.OnLoading(false);
-                // this.Alert('淇濆瓨鎴愬姛',false);
-                this.showToast('淇濆瓨鎴愬姛','success');
+                this.Alert('淇濆瓨鎴愬姛',false);
             }else{
                 this.OnLoading(false);
-                // this.Alert(response,true);
-                this.showToast(response,'error');
+                this.Alert(response,true);
             }
      
         });
@@ -527,7 +496,10 @@
         this.YYSelectedId = event.detail.value;
      
      }
-
+    onsearchchange2(e){
+        this.inputValue = e.target.value
+        console.log(e,e.target.value,'xAAA')
+    }
     //鍏宠仈鍖婚櫌
 
   

--
Gitblit v1.9.1