From d29f75b84fccd06917fb8e2c2ee70e9d76f868cd Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期四, 11 四月 2024 20:15:54 +0800
Subject: [PATCH] 123

---
 force-app/main/default/lwc/tEnquiry/tEnquiry.js |  101 ++++++++++++++++++++++++++++++--------------------
 1 files changed, 60 insertions(+), 41 deletions(-)

diff --git a/force-app/main/default/lwc/tEnquiry/tEnquiry.js b/force-app/main/default/lwc/tEnquiry/tEnquiry.js
index 5b368af..b0fd93d 100644
--- a/force-app/main/default/lwc/tEnquiry/tEnquiry.js
+++ b/force-app/main/default/lwc/tEnquiry/tEnquiry.js
@@ -17,8 +17,8 @@
 
 import SearchAccountById from '@salesforce/apex/InspectCheckController.SearchAccountById';
 
-
-
+import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
+import {loadStyle} from 'lightning/platformResourceLoader'
 import GetInspectById from '@salesforce/apex/InspectCheckController.GetInspectById';
 export default class test02 extends LightningElement {
 
@@ -33,22 +33,29 @@
     TongzhiIcon = 'standard:account' //鎻愮ず妗嗙殑鍥炬爣
     IsLeftStyle = "" //鎻愮ず妗嗙殑鏍峰紡
     BgColorStyle = "" 
+    toastTime = null;
+    IsLeftStyle = "width: 100%;top: 14%;display: flex;justify-content: center;"
     Alert(content,error = false,left = false){
+        this.Tongzhishow = false
+        clearTimeout(this.toastTime)
         this.SaveShowText = content;
         this.Tongzhishow = true;
         
         if (error) {
-            this.TongzhiIcon = "standard:first_non_empty";
-            this.BgColorStyle = "background-color:#f88568";
+            this.TongzhiIcon = "utility:error";
+            this.BgColorStyle = "background-color:#ba0517 !important;padding:0.65rem 0.75rem 0.65rem 1.25rem;";
         }else{
-            this.TongzhiIcon = "standard:account";
-            this.BgColorStyle = "background-color:#69e669";
+            this.TongzhiIcon = "utility:success";
+            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;"
-        }else{
-            this.IsLeftStyle = ""
-        }
+        // if (left) {
+        //     // this.IsLeftStyle = "left: 0.25rem;"
+        // }else{
+        //     this.IsLeftStyle = "color:#fff"
+        // }
     }
     CloseAlert()
     {
@@ -60,7 +67,7 @@
         }
         
     }
-
+    inputValue = "";
     //==================鑾峰彇鎷涙姇鏍囬」鐩甶d================
     ParamIdStr = ''; // url 鍙傛暟Id
     getQueryVariable(variable)
@@ -74,7 +81,9 @@
         return(false);
     }
     connectedCallback(){
-              
+        Promise.all([
+            loadStyle(this, lwcCSS)
+        ]);
        var paramId =  this.getQueryVariable('id');
        if (paramId == null || paramId == '') {
            return ;
@@ -123,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;
@@ -145,7 +154,7 @@
                 if (isloading == 2) {
                     this.OnLoading(false);
                     if (flag) {
-                        this.Alert("淇濆瓨鎴愬姛",false,true);
+                        this.Alert("淇濆瓨鎴愬姛",false);
                     }
                 }
             })
@@ -165,7 +174,7 @@
                 if (isloading == 2) {
                     this.OnLoading(false);
                     if (flag) {
-                        this.Alert("淇濆瓨鎴愬姛",false,true);
+                        this.Alert("淇濆瓨鎴愬姛",false);
                     }
                 }
                
@@ -178,6 +187,11 @@
     //table 鍒楄〃鐨勬暟鎹�
     @track  optionsdata=[
         {
+            label:"鐘舵��1",
+            props:"StageName__c",
+            Type:"text",
+        },
+        {
             label:"璇环鍚嶇О",
             props:"Name",
             url:"Id",
@@ -187,12 +201,6 @@
             label:"璇环缂栫爜",
             props:"Opportunity_No__c",
             Type:"text",
-        },
-        {
-            label:"瀹㈡埛鍚�",
-            props:"Account_Name_F__c",
-            url:"Id",
-            Type:"url",
         },
         {
             label:"璇环闃舵",
@@ -205,10 +213,14 @@
             Type:"text",
         },
         {
-            label:"鐘舵��1",
-            props:"StageName__c",
-            Type:"text",
+            label:"瀹㈡埛鍚�",
+            props:"Account_Name_F__c",
+            url:"Id",
+            Type:"url",
         },
+        
+        
+        
        
     ]
 
@@ -259,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;
@@ -302,11 +317,11 @@
             isloading ++;
             if (isloading == 2) {
                 this.OnLoading(false);
-                this.Alert("淇濆瓨鎴愬姛",false,true);
+                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;
@@ -314,7 +329,7 @@
             isloading ++;
             if (isloading == 2) {
                 this.OnLoading(false);
-                this.Alert("淇濆瓨鎴愬姛",false,true);
+                this.Alert("淇濆瓨鎴愬姛",false);
             }
         })
     }
@@ -345,9 +360,10 @@
                 this.UpdateDatas(this.notselected);
                 window.location.hash = "Refresh"+"=="+this.ParamIdStr;
                 this.OnLoading(false);
+                this.Alert('淇濆瓨鎴愬姛',false);
             }else{
                 this.OnLoading(false);
-                this.Alert(response,true,false);
+                this.Alert(response,true);
             }
      
         });
@@ -480,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