zhangzhengmei
2023-04-17 fdef1f682351a5311fe96c5f0f1770a9623b985f
调拨申请->受理批量更新,取消,提交待审批 按钮修改
11个文件已添加
309 ■■■■■ 已修改文件
force-app/main/default/lwc/lexCancelApply/lexCancelApply.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCancelApply/lexCancelApply.js 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCancelApply/lexCancelApply.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexDetailBulkUpdate/lexDetailBulkUpdate.css 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexDetailBulkUpdate/lexDetailBulkUpdate.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexDetailBulkUpdate/lexDetailBulkUpdate.js 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexDetailBulkUpdate/lexDetailBulkUpdate.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitApprovalProcess/lexSubmitApprovalProcess.css 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitApprovalProcess/lexSubmitApprovalProcess.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitApprovalProcess/lexSubmitApprovalProcess.js 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitApprovalProcess/lexSubmitApprovalProcess.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCancelApply/lexCancelApply.html
New file
@@ -0,0 +1,4 @@
<template>
</template>
force-app/main/default/lwc/lexCancelApply/lexCancelApply.js
New file
@@ -0,0 +1,100 @@
import { LightningElement, track, wire, api } from 'lwc';
import LightningConfirm from 'lightning/confirm';
import {CurrentPageReference,NavigationMixin} from 'lightning/navigation';
import { CloseActionScreenEvent } from 'lightning/actions';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import cancelApply from '@salesforce/apex/TransferApplyWebService.cancelApply';
export default class lexCancelApply extends LightningElement {
     @api recordId;
     IsLoading=true;
     cancelResult;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference){
        console.log("进入页面");
        console.log(currentPageReference);
        if(currentPageReference){
            const urvalue=currentPageReference.state.recordId;
            if(urvalue){
                let str=`${urvalue}`;
                console.log('str');
                console.log(str);
                this.recordId=str;
            }
        }
    }
    connectedCallback() {
        console.log('this.raeSetId:' + this.recordId);
        LightningConfirm.open({
            message: '确定取消?',
            variant: 'headerless',
            label: 'this is the aria-label value',
        }).then(cancel=>{
      //       this.IsLoading=false;
            // this.dispatchEvent(new CloseActionScreenEvent());
            if(cancel) {
                cancelApply({
                    taId : this.recordId
                }).then(result => {
                    this.cancelResult = result;
                    this.cancelSubmit().then(res=>{
                        this.IsLoading=false;
                        this.dispatchEvent(new CloseActionScreenEvent());
                    });
                }).catch( error =>{
                    console.log(error);
                }).finally(()=>{
                });
            }
        });
    }
    async cancelSubmit(){
        if(this.cancelResult == '1') {
            await this.showToast("",'取消成功',"success");
            window.location.href = window.location;
        } else {
            console.log("result:",this.cancelResult);
            await this.showToast("",this.cancelResult,"warning");
        }
    }
    showToast(_title,_message,_variant) {
        const event = new ShowToastEvent({
            title: _title,
            message:_message,
            variant: _variant,
        });
        this.dispatchEvent(event);
    }
}
//old js
// {!REQUIRESCRIPT('/soap/ajax/51.0/connection.js')}
// {!REQUIRESCRIPT('/soap/ajax/51.0/apex.js')}
// if (confirm("确定取消?")) {
// var rs = sforce.apex.execute("TransferApplyWebService","cancelApply",{taId:'{!TransferApply__c.Id}'});
// if(rs == '1'){
// alert('取消成功');
// window.location.href = window.location;
// }
// else{
// alert(rs);
// }
// }
force-app/main/default/lwc/lexCancelApply/lexCancelApply.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="lexCancelApply">
    <apiVersion>51.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>
force-app/main/default/lwc/lexDetailBulkUpdate/lexDetailBulkUpdate.css
New file
@@ -0,0 +1,11 @@
.Holder{
    position: relative;
    display: inline-block;
    width: 80px;
    height: 80px;
    text-align: center;
}
.container .uiContainerManager{
    display : none !important;
}
force-app/main/default/lwc/lexDetailBulkUpdate/lexDetailBulkUpdate.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="Holder" if:true={IsLoading}>
          <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
      </div>
</template>
force-app/main/default/lwc/lexDetailBulkUpdate/lexDetailBulkUpdate.js
New file
@@ -0,0 +1,39 @@
import { LightningElement, track, wire, api } from 'lwc';
import {CurrentPageReference} from 'lightning/navigation';
import { CloseActionScreenEvent } from 'lightning/actions';
export default class lexDetailBulkUpdate extends LightningElement {
    @api recordId;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference){
        console.log("进入页面");
        console.log(currentPageReference);
        if(currentPageReference){
            const urvalue=currentPageReference.state.recordId;
            if(urvalue){
                let str=`${urvalue}`;
                console.log('str');
                console.log(str);
                this.recordId=str;
            }
        }
    }
    connectedCallback(){
        this.cancelSubmit().then(res=>{
            this.IsLoading=false;
            this.dispatchEvent(new CloseActionScreenEvent());
        });
    }
    async cancelSubmit(){
        window.open('/apex/TransferApplySelectDetailSub?id='+this.recordId,'DetailBulkUpdateLWC', 'width=600,height=200');
    }
    //old js
    // window.open("/apex/TransferApplySelectDetailSub?Id={!URLENCODE(TransferApply__c.Id)}");
}
force-app/main/default/lwc/lexDetailBulkUpdate/lexDetailBulkUpdate.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="lexDetailBulkUpdate">
    <apiVersion>51.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>
force-app/main/default/lwc/lexSubmitApprovalProcess/lexSubmitApprovalProcess.css
New file
@@ -0,0 +1,11 @@
.Holder{
    position: relative;
    display: inline-block;
    width: 80px;
    height: 80px;
    text-align: center;
}
.container .uiContainerManager{
    display : none !important;
}
force-app/main/default/lwc/lexSubmitApprovalProcess/lexSubmitApprovalProcess.html
New file
@@ -0,0 +1,5 @@
<template>
    <!-- <div class="Holder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div> -->
</template>
force-app/main/default/lwc/lexSubmitApprovalProcess/lexSubmitApprovalProcess.js
New file
@@ -0,0 +1,101 @@
import { LightningElement, track, wire,api } from 'lwc';
import {CurrentPageReference,NavigationMixin} from 'lightning/navigation';
import { CloseActionScreenEvent } from 'lightning/actions';
import LightningConfirm from 'lightning/confirm';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import applyPermission from '@salesforce/apex/TransferApplyController.applyPermission';
import submitApply from '@salesforce/apex/TransferApplyWebService.submitApply';
export default class lexSubmitApprovalProcess extends LightningElement {
    @api recordId;
    transferApplyPermission;
    IsLoading=true;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
        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() {
        console.log('this.transferApplyId:' + this.recordId);
        applyPermission().then(result => {
            console.log(result);
            this.transferApplyPermission = result;
            this.cancelSubmit();
        }).catch( error =>{
            console.log(error);
        });
    }
    cancelSubmit(){
        if (this.transferApplyPermission == false) {
            this.showToast('','没有提交申请的权限','warning');
        } else{
            LightningConfirm.open({
                message: '一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?',
                variant: 'headerless',
            }).then(cancel=>{
                if(cancel) {
                    submitApply({taId:this.recordId}).then(submitRes=>{
                        if(submitRes == '1'){
                            this.showToast('','提交成功','success');
                            window.location.href = window.location;
                        }else{
                            this.showToast("",submitRes,"warning");
                        }
                        this.IsLoading=false;
                        this.dispatchEvent(new CloseActionScreenEvent());
                    });
                }
            });
        }
    }
    showToast(_title,_message,_variant) {
        const event = new ShowToastEvent({
            title: _title,
            message:_message,
            variant: _variant,
        });
        this.dispatchEvent(event);
    }
}
//old js
/*
{!REQUIRESCRIPT('/soap/ajax/51.0/connection.js')}
{!REQUIRESCRIPT('/soap/ajax/51.0/apex.js')}
var result = sforce.connection.describeSObject('TransferApply__c');
if (result.createable == 'false') {
    alert('没有提交申请的权限');
}
else{
    if (confirm("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) {
        var rs = sforce.apex.execute("TransferApplyWebService","submitApply",{taId:'{!TransferApply__c.Id}'});
        if(rs == '1'){
            alert('提交成功');
            window.location.href = window.location;
        }
        else{
            alert(rs);
        }
    }
}
*/
force-app/main/default/lwc/lexSubmitApprovalProcess/lexSubmitApprovalProcess.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="lexSubmitApprovalProcess">
    <apiVersion>51.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
        <target>lightning__AppPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>