123
chenjingwu
2024-04-11 df4601a9026b57f78c0b1b6619e366525d13f9fc
force-app/main/default/lwc/lexComplete/lexComplete.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-04-07 09:02:03
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-04-11 09:06:48
 * @LastEditTime: 2023-04-11 11:21:30
 */
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -46,14 +46,11 @@
                this.status = result.status;
                this.profileId = result.profileId;
                this.complete();
                this.dispatchEvent(new CloseActionScreenEvent());
                //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Report__c/" + this.recordId + "/view");
            }
        }).catch(error => {
            console.log("error");
            console.log(error);
        }).finally(() => {
        });   
        //this.updateRecordView(this.recordId);
    }
@@ -76,19 +73,24 @@
    complete () {
        // 陆胜,胡迪安,系统管理员以外没有权限
        if (UserInfo_Owner.Id != "00510000004reg2" && UserInfo_Owner.Id != "00510000000gWAE" && this.profileId != "00e10000000Y3o5") {
            ShowToastEvent("你没有权限","error");
            this.showToast("你没有权限","error");
            return;
        }
        if (this.status == "完毕") {
            ShowToastEvent("已经完毕!","error");
            this.showToast("已经完毕!","error");
            return;
        }
        updateForCompleteButton({
            recordId: this.recordId
        }).then(result =>{
            if(result){
                this.showToast(result,"error");
            }else{
                this.updateRecordView(this.recordId);
                this.showToast("完毕成功!","success");
            }
            this.IsLoading = false;
            this.updateRecordView(this.recordId);
            this.showToast("完毕成功!","success");
            this.dispatchEvent(new CloseActionScreenEvent());
        });
    }
}