19626
2023-10-31 fd9df05c48c09b4d7f39a3b401882bda226dedea
force-app/main/default/lwc/tBidding/tBidding.js
@@ -1,14 +1,16 @@
import { LightningElement, track } from 'lwc';
import { LightningElement, track,api } from 'lwc';
import GetInspectById from '@salesforce/apex/InspectCheckController.GetInspectById';
import SaveDataYB from '@salesforce/apex/InspectCheckController.SaveDataYB';
import ChangeDataYB from '@salesforce/apex/InspectCheckController.ChangeDataYB';
import GetIrresponsibleReason from '@salesforce/apex/InspectCheckController.GetIrresponsibleReason';
import GetproInvolvedManual from '@salesforce/apex/InspectCheckController.GetproInvolvedManual';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { CloseActionScreenEvent } from 'lightning/actions';
import CheckOwnerRequest from '@salesforce/apex/InspectCheckController.CheckOwner';
import tnederDeletePageCss from '@salesforce/resourceUrl/tnederDeletePageCss';
import {loadStyle} from 'lightning/platformResourceLoader'
export default class Yb extends LightningElement {
@api recordid;
//提示
Tongzhishow=false;  //提示显示的标识
SaveShowText="操作成功";  //提示显示的文本
@@ -59,7 +61,10 @@
    }
    ParamIdStr = ''
    connectedCallback(){
        var paramId =  this.getQueryVariable('id');
        Promise.all([
            loadStyle(this, tnederDeletePageCss)
        ]);
        var paramId =  this.recordid;
        if (paramId == null || paramId == '') {
            return ;
        }
@@ -129,7 +134,7 @@
    @track InspectData = {}; //数据
    IsSQZ = false; //申请中的标识
    IsSQZ = true; //申请中的标识
    IsSQZButton = false;
    GetInspectByIdFn(Id)
    {
@@ -213,14 +218,19 @@
                //20220914 you SWAG-CJ3DS5 end
                debugger;
                if (tempData.NotBidApprovalStatus__c == '申请中') {
                    setTimeout(()=>{
                    // setTimeout(()=>{
                        this.IsSQZ = true;
                        this.IsSQZButton = true;
                        this.IsBC = true;
                        this.IsYSJE = true;
                        this.IsSJCP = true;
                    },1000)
                    // },1000)
                }else{
                    this.IsSQZ = false;
                    this.IsSQZButton = false;
                    this.IsBC = false;
                    this.IsYSJE = false;
                    this.IsSJCP = false;
                }
                this.InspectData =tempData;
@@ -326,7 +336,7 @@
    }
  //输入框 未输入展示的值
    BCIsShow = false;
    IsBC = false;
    IsBC = true;
    handleBCSMFn(event)
    {
        var value = event.target.value;
@@ -351,7 +361,7 @@
    //
    SJCPIsShow = false;
    SJCPIsContent = '';
    IsSJCP = false;
    IsSJCP = true;
    handleSJCPFN(event)
    {
        var value = event.target.value;
@@ -397,30 +407,55 @@
            if (temp == 1) {
                ChangeDataYB({JsonData:JSON.stringify(this.InspectData)}).then((response)=>{
                    if (response=="成功") {
                        this.Alert("提交成功");
                        this.showToast("提交成功",'success');
                        this.IsSQZ = true;
                        this.IsSQZButton = true;
                        this.IsBC = true;
                        this.IsYSJE = true;
                        window.location.hash = "Refresh"+"=="+this.ParamIdStr;
                        // window.open("/"+this.recordid)
                        setTimeout(() => {
                            window.location.href = '/'+this.recordid
                        },1000)
                        // window.location.hash = "Refresh"+"=="+this.ParamIdStr;
                    }else{
                        this.Alert(response,true);
                        this.showToast(response,'error');
                    }
                });
            }else
            {
                SaveDataYB({JsonData:JSON.stringify(this.InspectData)}).then((response)=>{
                    if (response=="成功") {
                        this.Alert("保存成功",false,true);
                        window.location.hash = "Refresh"+"=="+this.ParamIdStr;
                        this.showToast("保存成功",'success');
                        window.open("/"+this.recordid)
                        setTimeout(() => {
                            window.location.href = '/'+this.recordid
                        },1000)
                        // window.location.hash = "Refresh"+"=="+this.ParamIdStr;
                    }else{
                        this.Alert(response,true);
                        // this.showToast(response,'error');
                    }
                });
            }
        }
    }
    showToast(msg,type) {
        if(type == "success"){
            const event = new ShowToastEvent({
                message: msg,
                variant: type
            });
            this.dispatchEvent(event);
            this.dispatchEvent(new CloseActionScreenEvent());
        }else{
            const event = new ShowToastEvent({
                message: msg,
                variant: type,
                mode:"sticky"
            });
            this.dispatchEvent(event);
            this.dispatchEvent(new CloseActionScreenEvent());
        }
    }
    CheckFn()
    {
        this.saveFn(null,1);