123
chenjingwu
2024-04-11 d29f75b84fccd06917fb8e2c2ee70e9d76f868cd
force-app/main/default/lwc/lexStockApply/lexStockApply.js
@@ -2,9 +2,17 @@
 * @Description: 
 * @version: 
 * @Author: chen jing wu
 * @Date: 2023-09-09 13:27:59
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-10-11 17:59:10
 */
/*
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-04-14 13:04:53
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-11 16:58:40
 * @LastEditTime: 2023-10-10 17:41:57
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -17,6 +25,8 @@
import connection from '@salesforce/resourceUrl/connection20';
import submitProcess  from '@salesforce/apex/OpportunityLightingButtonController.submitProcess';
import LightningConfirm from 'lightning/confirm';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexStockApply extends LightningElement {
    @api recordId;
    stockApplyStatus;
@@ -101,6 +111,9 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
@@ -126,16 +139,24 @@
        this.handleConfirmClick("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?");
    }
   
      showToast(msg,type) {
        const event = new ShowToastEvent({
            title: ' ',
            message: msg,
            variant: type,
            mode: 'sticky'
        });
        this.dispatchEvent(event);
        this.dispatchEvent(new CloseActionScreenEvent);
      }
    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());
        }
    }
      updateRecordView(recordId) {
        updateRecord({fields: { Id: recordId }});
      }