黄千龙
2023-05-08 2975df582adffdcc8cd7a5a179ff844d029655dd
20230508补充QIS按钮相关
2个文件已修改
8个文件已添加
207 ■■■■■ 已修改文件
force-app/main/default/lwc/lexOSHRecieved/lexOSHRecieved.css 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOSHRecieved/lexOSHRecieved.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOSHRecieved/lexOSHRecieved.js 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOSHRecieved/lexOSHRecieved.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexQISIntakeuniversalcode/lexQISIntakeuniversalcode.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexQisUniversalFailureCode/lexQisUniversalFailureCode.css 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexQisUniversalFailureCode/lexQisUniversalFailureCode.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexQisUniversalFailureCode/lexQisUniversalFailureCode.js 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexQisUniversalFailureCode/lexQisUniversalFailureCode.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOSHRecieved/lexOSHRecieved.css
New file
@@ -0,0 +1,10 @@
.VOCSubmitHolder{
    position: relative;
    display: inline-block;
    width: 80px;
    height: 80px;
    text-align: center;
}
.container .uiContainerManager{
    display: none !important;
}/* sample css file */
force-app/main/default/lwc/lexOSHRecieved/lexOSHRecieved.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="VOCSubmitHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexOSHRecieved/lexOSHRecieved.js
New file
@@ -0,0 +1,84 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { NavigationMixin } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { updateRecord } from 'lightning/uiRecordApi';
import init  from '@salesforce/apex/QISReportController.initForOSHRecievedButton';
import updateQis  from '@salesforce/apex/QISReportController.updateQis';
export default class lexOSHRecieved extends LightningElement {
    @api recordId;
    IsLoading = true;
    qisReportId;
    qisStatus;
     @wire(CurrentPageReference)
     getStateParameters(currentPageReference) {
             console.log(111);
             console.log(currentPageReference);
         if (currentPageReference) {
           const urlValue = currentPageReference.state.recordId;
           if (urlValue) {
             let str = `${urlValue}`;
             console.log("str");
             console.log(str);
             this.recordId = str;
           }
         }
     }
     connectedCallback () {
        init({
            recordId: this.recordId
        }).then(result => {
            this.IsLoading = false;
            this.qisReportId = result.Id;
            this.qisStatus = result.qIStatus;
            console.log('this.qisStatus='+this.qisStatus);
             if (this.qisStatus!='OSH检测申请' && this.qisStatus!='完毕') {
                const evt = new ShowToastEvent({
                        title : 'OSH已经收到实物',
                        message: '',
                        variant: 'error'
                    });
                this.dispatchEvent(evt);
                this.dispatchEvent(new CloseActionScreenEvent());
                return;
             }else{
                 this.updateQisSubmit();
             }
        }).catch(error => {
            console.log('error='+error);
        }).finally(() => {
        });
    }
    updateRecordView(recordId) {
        updateRecord({fields: { Id: recordId }});
    }
    updateQisSubmit(){
            updateQis({
                 recordId: this.recordId
                }).then(result =>{
                    console.log('result'+result);
                    if (result!='成功') {
                        const evt = new ShowToastEvent({
                            title : '更新失败',
                            message: result,
                            variant: 'error'
                        });
                        this.dispatchEvent(evt);
                    }
                this.dispatchEvent(new CloseActionScreenEvent());
                this.updateRecordView(this.recordId);
                }).catch(error => {
            console.log('error='+error);
        }).finally(() => {
        });
        }
}
force-app/main/default/lwc/lexOSHRecieved/lexOSHRecieved.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexOSHRecieved">
      <apiVersion>54.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
        <target>lightning__AppPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>
force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js
@@ -44,7 +44,7 @@
            console.log('this.qisStatus='+this.qisStatus);
            console.log('this.OSHstaff='+this.OSHstaff);
            console.log('this.OSHstaffEmail='+this.OSHstaffEmail);
             if (this.qisStatus=='OSH检测申请' && this.qisStatus=='完毕') {
             if (this.qisStatus=='OSH检测申请' || this.qisStatus=='完毕') {
                const evt = new ShowToastEvent({
                            title : '需要先点击[OSH检查受理]',
                            message: '',
force-app/main/default/lwc/lexQISIntakeuniversalcode/lexQISIntakeuniversalcode.js
@@ -41,11 +41,11 @@
                    qisReportId: this.qisReportId
                    }).then(result => {
                    if (result!=null) {
                        this.paeId = result.PAEid;
                        console.log('result='+this.paeId);
                        this.paeId = result.pAEid;
                        console.log('result2='+this.paeId);
                    }   
                    var url = '';
                    if (result!=null&&result.length>0){
                    if (result!=null){
                        url = "/apex/PAEDecisionRecord?Id="+this.paeId+"&QISReportId="+this.qisReportId +"&RecordTypeIds="+RecordTypeId ;
                    } else {
                        url = "/apex/PAEDecisionRecord?QISReportId="+this.qisReportId +"&RecordTypeIds="+RecordTypeId;
force-app/main/default/lwc/lexQisUniversalFailureCode/lexQisUniversalFailureCode.css
New file
@@ -0,0 +1,10 @@
.exampleHolder{
    position: relative;
    display: inline-block;
    width: 80px;
    height: 80px;
    text-align: center;
}
.container .uiContainerManager{
    display: none !important;
}/* sample css file */
force-app/main/default/lwc/lexQisUniversalFailureCode/lexQisUniversalFailureCode.html
New file
@@ -0,0 +1,5 @@
<template>
 <div class="exampleHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexQisUniversalFailureCode/lexQisUniversalFailureCode.js
New file
@@ -0,0 +1,63 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { NavigationMixin } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init  from '@salesforce/apex/QISReportController.initForQisUniversalFailureCodeButton';
import sqlForPAE  from '@salesforce/apex/QISReportController.sqlForPAE';
export default class lexQisUniversalFailureCode extends LightningElement {
    @api recordId;
    IsLoading = true;
    qisReportId;
    paeId;
     @wire(CurrentPageReference)
     getStateParameters(currentPageReference) {
             console.log(111);
             console.log(currentPageReference);
         if (currentPageReference) {
           const urlValue = currentPageReference.state.recordId;
           if (urlValue) {
             let str = `${urlValue}`;
             console.log("str");
             console.log(str);
             this.recordId = str;
           }
         }
     }
    connectedCallback () {
        init({
            recordId: this.recordId
        }).then(result => {
            console.log(result);
            if (result != null) {
                this.IsLoading = false;
                this.qisReportId = result.Id;
                var RecordTypeId = "ASACDecision";
                sqlForPAE({
                    qisReportId: this.qisReportId
                    }).then(result => {
                    if (result!=null) {
                        this.paeId = result.pAEid;
                        console.log('result='+this.paeId);
                    }
                    var url = '';
                    if (result!=null){
                        url = "/apex/PAEDecisionRecord?Id="+this.paeId+"&QISReportId="+this.qisReportId +"&RecordTypeIds="+RecordTypeId ;
                    } else {
                        url = "/apex/PAEDecisionRecord?QISReportId="+this.qisReportId +"&RecordTypeIds="+RecordTypeId;
                    }
                    console.log('url='+url);
                    // window.open(url,'_self');
                    window.location.replace(url);
                });
            }
        }).catch(error => {
            console.log('error='+error);
        }).finally(() => {
        });
    }
}
force-app/main/default/lwc/lexQisUniversalFailureCode/lexQisUniversalFailureCode.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexQisUniversalFailureCode">
   <apiVersion>54.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
        <target>lightning__AppPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>