Subversion Repositories SmartDukaan

Rev

Rev 33577 | Rev 33630 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33577 Rev 33578
Line 477... Line 477...
477
    document.getElementById('confirmSign').addEventListener('click', function () {
477
    document.getElementById('confirmSign').addEventListener('click', function () {
478
        let loiId = $(this).val();
478
        let loiId = $(this).val();
479
        let otp = validateOTP();
479
        let otp = validateOTP();
480
        console.log("loiId-", loiId, ",otp-", otp);
480
        console.log("loiId-", loiId, ",otp-", otp);
481
        let validateOtpUrl = `${context}/validateLoiOtp?loiId=${loiId}&provideOtp=${otp}`;
481
        let validateOtpUrl = `${context}/validateLoiOtp?loiId=${loiId}&provideOtp=${otp}`;
-
 
482
        if (otp != undefined) {
-
 
483
 
482
        doPutAjaxRequestHandler(validateOtpUrl, function (response) {
484
            doPutAjaxRequestHandler(validateOtpUrl, function (response) {
483
            if (response) {
485
                if (response) {
484
                const element = document.getElementById('content');
486
                    const element = document.getElementById('content');
485
                console.log("element- ", element);
487
                    console.log("element- ", element);
486
                const opt = {
488
                    const opt = {
487
                    margin: 0.5,
489
                        margin: 0.5,
488
                    filename: 'document.pdf',
490
                        filename: 'document.pdf',
489
                    image: {type: 'jpeg', quality: 0.98},
491
                        image: {type: 'jpeg', quality: 0.98},
490
                    html2canvas: {scale: 2, logging: true, useCORS: true},
492
                        html2canvas: {scale: 2, logging: true, useCORS: true},
491
                    jsPDF: {unit: 'in', format: 'letter', orientation: 'portrait'}
493
                        jsPDF: {unit: 'in', format: 'letter', orientation: 'portrait'}
492
                };
494
                    };
493
                html2pdf().from(element).set(opt).outputPdf("arraybuffer").then(function (pdf) {
495
                    html2pdf().from(element).set(opt).outputPdf("arraybuffer").then(function (pdf) {
494
                    console.log("pdf- ", pdf);
496
                        console.log("pdf- ", pdf);
495
                    const file = new Blob([pdf], {type: 'application/pdf'});
497
                        const file = new Blob([pdf], {type: 'application/pdf'});
496
                    uploadDocument(file, function (documentId) {
498
                        uploadDocument(file, function (documentId) {
497
                        console.log("documentIdddd-", documentId);
499
                            console.log("documentIdddd-", documentId);
498
                        saveLoiDoc(loiId, documentId);
500
                            saveLoiDoc(loiId, documentId);
499
                        doGetAjaxRequestHandler(`${context}/pendingOnboardingForm`,
501
                            doGetAjaxRequestHandler(`${context}/pendingOnboardingForm`,
500
                                function (response) {
502
                                    function (response) {
501
                                    $('#' + 'main-content').html(response);
503
                                        $('#' + 'main-content').html(response);
502
                                });
504
                                    });
-
 
505
                        });
503
                    });
506
                    });
504
                });
-
 
505
                alert("OTP verified successfully ");
507
                    alert("OTP verified successfully ");
506
            } else {
508
                } else {
507
                alert("OTP not verified,Please try again");
509
                    alert("OTP not verified,Please try again");
-
 
510
                }
508
            }
511
            });
509
        });
512
        }
510
    });
513
    });
511
 
514
 
512
    function saveLoiDoc(loiId, documentId) {
515
    function saveLoiDoc(loiId, documentId) {
513
        let saveLoiDocUrl = `${context}/saveLoiDoc?loiId=` + loiId + `&loiDocId=` + documentId
516
        let saveLoiDocUrl = `${context}/saveLoiDoc?loiId=` + loiId + `&loiDocId=` + documentId
514
        doPostAjaxRequestHandler(saveLoiDocUrl, function (response) {
517
        doPostAjaxRequestHandler(saveLoiDocUrl, function (response) {