19626
2023-10-23 1727a4f4d02e429475608e60f142a63bc24127bc
force-app/main/default/lwc/lexStockCancel/lexStockCancel.js
@@ -6,6 +6,8 @@
import init from '@salesforce/apex/LexStockCancelController.init';
import updateOppotunity from '@salesforce/apex/LexStockCancelController.updateOppotunity';
import submitApprovalRequest from '@salesforce/apex/LexStockCancelController.submitApprovalRequest';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class lexStockCancel extends LightningElement {
   @api recordId;
    IsLoading=true;
@@ -28,6 +30,10 @@
   connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
        ]);
      console.log(this.recordId);
      init({recordId:this.recordId}).then(result=>{
         console.log(result);
@@ -52,8 +58,10 @@
      let reason = this.data.Stock_cancel_reason__c;
      if (reason == null || reason == '') {
         const event = new ShowToastEvent({
               title: '提示信息',
               message:'必须填写撤销备货理由。'
               title: '',
               message:'必须填写撤销备货理由。',
               variant: 'warning',
               mode: 'sticky'
           });
           this.dispatchEvent(event);
         return;
@@ -63,8 +71,10 @@
      let stage = this.data.Whether_Upload_Question_Document__c;
      if (stage == '0') {
         const event = new ShowToastEvent({
               title: "提示信息",
               message:'请上传质疑函。'
               title: "",
               message:'请上传质疑函。',
               variant: 'warning',
               mode: 'sticky'
           });
           this.dispatchEvent(event);
         return;
@@ -72,8 +82,8 @@
      // CHAN-BCS8T5 LHJ 20190604 End
      const resul = await LightningConfirm.open({
            message: "一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?",
            variant: 'headerless',
            label: '提示信息',
            variant: '',
            label: '',
            // setting theme would have no effect
        });
        if (resul==false) {
@@ -87,8 +97,10 @@
            flag=false;
            messages=res.errors[0];
            const event = new ShowToastEvent({
                  title: '提示信息',
                  message:"操作失败,提示信息:"+messages
                  title: '',
                  message:""+messages,
                  variant: 'error',
                  mode: 'sticky'
              });
              this.dispatchEvent(event);
            return;
@@ -132,8 +144,10 @@
               flag=false;
               messages=res.errors[0];
               const event = new ShowToastEvent({
                     title: '提示信息',
                     message:"操作失败,提示信息:"+messages,
                     title: '',
                     message:""+messages,
                     variant: 'warning',
                     mode: 'sticky'
                 });      
                 this.dispatchEvent(event);
                 return;
@@ -141,11 +155,11 @@
         });
         if(flag==false)return;
         const event = new ShowToastEvent({
               title: '提示信息',
               message:ress
               title: '',
               message:ress,
             mode: 'sticky'
           });
           this.dispatchEvent(event);
         return;
      }
      // window.location.reload();
   };