buli
2022-05-14 ead4df22dca33a867279471821ca675f91dec760
force-app/main/default/pages/SWOFileUploadPage.page
@@ -1,5 +1,5 @@
<!-- 该页面用于Lead对象上传PDF,未来如果要添加其他对象的上传PDF功能,复制该页面,将**standardController**修改为其他对象API名称即可 -->
<apex:page standardController="SWO__c" extensions="FileUploadController" id="page" lightningStyleSheets="true">
<apex:page standardController="SWO__c" showHeader="false" sidebar="false" extensions="FileUploadController" id="page" lightningStyleSheets="true">
    <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
    <script>
        var staticResources = JSON.parse('{!staticResource}');
@@ -56,16 +56,22 @@
        }
        function confirmTrans(transId, isSuccess) {
            
            AWSService.post(staticResources.updateUrl, JSON.stringify({
                "txId":transId,
                "sfRecordId":"",
                "isSuccess":isSuccess
            }), function(result){
            fetch(staticResources.updateUrl, {
                method: 'POST',
                body: JSON.stringify({ 'txId': transId, "isSuccess": isSuccess }),
                headers: {
                    'Content-Type': 'application/json',
                    'pi-token': staticResources.token
                }
            }).then((data) => {
                return data.json();
            }).then(data => {
                console.log("confirmTrans-" + JSON.stringify(data));
                document.getElementById("file").files[0].name = '';
                enableButtonStatus();
                refreshFiles();
            }, staticResources.token);
                refreshFiles();
                return data.status;
            })
            
        }
        function calculateFileSize(fileObject) {