19626
2023-10-23 1727a4f4d02e429475608e60f142a63bc24127bc
force-app/main/default/lwc/tEnquiryNoBidding/tEnquiryNoBidding.js
@@ -1,13 +1,14 @@
import { LightningElement, track } from 'lwc';
import { LightningElement,api, track } from 'lwc';
import GetInspectById from '@salesforce/apex/EnquiryNoBiddingController.GetInspectById';
import SaveDataYB from '@salesforce/apex/EnquiryNoBiddingController.SaveDataYB';
import ChangeDataYB from '@salesforce/apex/EnquiryNoBiddingController.ChangeDataYB';
import GetIrresponsibleReason from '@salesforce/apex/EnquiryNoBiddingController.GetIrresponsibleReason';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import CheckOwnerRequest from '@salesforce/apex/EnquiryNoBiddingController.CheckOwner';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
import GetTenderInformationById from '@salesforce/apex/EnquiryNoBiddingController.GetTenderInformationById';
import { CloseActionScreenEvent } from 'lightning/actions';
import GetDataById from '@salesforce/apex/EnquiryNoBiddingController.GetDataById';
@@ -30,6 +31,25 @@
TongzhiIcon = 'standard:account'  //提示显示的标签
IsLeftStyle = ""  //提示显示的样式
BgColorStyle = ""
showToast(msg,type) {
    if(type == 'success'){
      const event = new ShowToastEvent({
        title: '',
        message: msg,
        variant: type
      });
      this.dispatchEvent(event);
    }else{
      const event = new ShowToastEvent({
        title: '',
        message: msg,
        variant: type,
        mode: 'sticky'
    });
    this.dispatchEvent(event);
    }
}
Alert(content,error = false,left = false){
    this.SaveShowText = content;
    this.Tongzhishow = true;
@@ -72,23 +92,28 @@
        }
        return(false);
    }
    ParamIdStr = '' //不应标申请iD
    ParamOIdStr = '' //询价ID
    ParamPIdStr = '' //招投标ID
    @api ParamIdStr = ''; //不应标申请iD
    @api ParamOIdStr = '';//询价ID
    @api ParamPIdStr = ''; //招投标ID
    
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        console.log('123456');
        console.log(this.ParamOIdStr);
        this.OnLoading(true);
        
        var paramId =  this.getQueryVariable('id');
        var paramOId =  this.getQueryVariable('oid');
        var paramTId =  this.getQueryVariable('tid');
        // var paramId =  this.getQueryVariable('id');
        // var paramOId =  this.getQueryVariable('oid');
        // var paramTId =  this.getQueryVariable('tid');
        // paramId = 'a4Y1m0000000dhGEAQ';
        // paramOId = '0061000000QL9M4AAL';
        this.ParamIdStr= paramId;
        this.ParamOIdStr = paramOId;
        this.ParamPIdStr = paramTId;
        // this.ParamIdStr= paramId;
        // this.ParamOIdStr = paramOId;
        // this.ParamPIdStr = paramTId;
     
        debugger;
@@ -96,7 +121,7 @@
       
        // Opp_Bid__c | Bidding_Project_Name_BidId__c
        if(this.ParamOIdStr !=undefined && this.ParamOIdStr!=false)
        if(this.ParamOIdStr !='' && this.ParamOIdStr!=false)
        {
            GetDataById({Id:this.ParamOIdStr}).then(response=>{
                var data = JSON.parse(response);
@@ -109,7 +134,10 @@
                setTimeout(()=>{
                    this.OnLoading(false);
                },1500);
            })
            }).catch(error=>{
                console.log('error');
                console.log(error);
            });
        }
    }
@@ -237,7 +265,7 @@
    //数据保存方法
    saveFn(event,temp){
        if(!this.IsCheck){return;}
        this.IsLoading = true;
        this.IsCheck = false;
        
        debugger;
@@ -262,18 +290,27 @@
            debugger;
            var IsInsert = this.InspectData.Id==undefined?"是":"否";
            const closeEvent = new CustomEvent('closeaction', {
                bubbles: true, // 允许事件冒泡至父组件
                composed: true, // 允许事件穿越 Shadow DOM 界限
            });
            if (temp == 1) {
                ChangeDataYB({JsonData:JSON.stringify(this.InspectData),Id:this.ParamOIdStr,IsInsert:IsInsert}).then((response)=>{
                    if (response.indexOf("成功") != -1) {
                        this.Alert("提交成功");
                        // this.Alert("提交成功");
                        this.showToast("提交成功","success");
                        this.DisabledSet();
                        this.IsLoading = false;
                        this.IsCheck = true;
                        window.location.hash = "Refresh"+"=="+this.ParamOIdStr;
                        setTimeout(() => {
                            window.location = '/' + this.ParamOIdStr;
                        }, 2000);
                        this.dispatchEvent(closeEvent);
                        // window.location.hash = "Refresh"+"=="+this.ParamOIdStr;
                    }else{
                        this.Alert(response,true);
                        this.showToast(response,"error");
                        this.IsLoading = false;
                        // this.Alert(response,true);
                        this.IsCheck = true;
                    }
                });
@@ -281,11 +318,19 @@
            {
                SaveDataYB({JsonData:JSON.stringify(this.InspectData),Id:this.ParamOIdStr,IsInsert:IsInsert}).then((response)=>{
                    if (response=="成功") {
                        this.Alert("保存成功",false,true);
                        window.location.hash = "Refresh"+"=="+this.ParamOIdStr;
                        // this.Alert("保存成功",false,true);
                        this.showToast("保存成功","success");
                        this.IsLoading = false;
                        // window.location.hash = "Refresh"+"=="+this.ParamOIdStr;
                        setTimeout(() => {
                            window.location = '/' + this.ParamOIdStr;
                        }, 2000);
                        this.dispatchEvent(closeEvent);
                        this.IsCheck = true;
                    }else{
                        this.Alert(response,true);
                        // this.Alert(response,true);
                        this.showToast(response,"error");
                        this.IsLoading = false;
                        this.IsCheck = true;
                    }
                });