• Dynamic Crm 365 实现弹出Web资源html,实现驳回填写意见的功能


    前端JS:弹出Html界面

    assignCustReviewReturn: function () {
    
            var parameters = {};
            parameters.roles = custReviewRibbonEvent.getRolesByAuditcate();
    
            var pageInput = {
                pageType: "webresource",
                webresourceName: "scc_/html/custreview/operationReturn.html",
                data: JSON.stringify(parameters)
            };
            var navigationOptions = {
                target: 2, // 2 is for opening the page as a dialog.
                 350, // default is px. can be specified in % as well.
                height: 260, // default is px. can be specified in % as well.
                position: 1 // Specify 1 to open the dialog in center; 2 to open the dialog on the side. Default is 1 (center).
            };
            Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
                function success(a) {
                    console.log('调用成功 返回值:' + a.returnValue.reason);
                    if (a.returnValue != null) {
                        if (!a.returnValue.reason) {
                            alert("请输入驳回原因。");
                            return;
                        }
                        
                    }
                },
                function error(e) {
                    console.log(e);
                    // Handle errors
                }
            );
        },

    Html界面:

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <title>驳回</title>
        <script src="/WebResources/ClientGlobalContext.js.aspx"></script> 
        <link rel="stylesheet" type="text/css" href="/_common/styles/fonts.css.aspx?lcid=2052&amp;ver=-1505408476" id="/_common/styles/fonts.css.aspx?lcid=2052&amp;ver=-1505408476">
        <link rel="stylesheet" type="text/css" href="/_common/styles/global.css.aspx?lcid=2052&amp;ver=-1505408476" id="/_common/styles/global.css.aspx?lcid=2052&amp;ver=-1505408476">
        <link rel="stylesheet" type="text/css" href="/_common/styles/select.css.aspx?lcid=2052&amp;ver=-1505408476" id="/_common/styles/select.css.aspx?lcid=2052&amp;ver=-1505408476">
        <link rel="stylesheet" type="text/css" href="/_common/styles/dialogs.css.aspx?lcid=2052&amp;ver=-1505408476" id="/_common/styles/dialogs.css.aspx?lcid=2052&amp;ver=-1505408476">
        <script type="text/javascript">
            var _dialogArg;
            var _arList; 
        </script>
    </head>
    <body scroll="no" class="">
        <div id="crmDialogForm">
            <div tabindex="0" id="AccessibilityTitleDiv">
                <div class="ms-crm-div-NotVisible"></div>
            </div>
            <div id="dialogContainer" style="height: 100%">
                <div>
                    <div id="DlgHdBodyContainer">
                        <br />
                        <div id="tab0" isviewporttab="0" style="height:90%">
                            <table cellspacing="0" cellpadding="0" id="tab1">
                                <colgroup><col "90%"></colgroup>
                                <tbody>
                                    <tr>
                                        <td valign="top">
                                            <div>
                                                <table isviewportsection="0" columns="1" style="table-layout:fixed;" height="1%" valign="top" cellspacing="0" cellpadding="3">
                                                    <tbody>
                                                        <tr>
                                                            <td style="text-align: right;">
                                                                <div style="width :80px"><label for="description_id">说明:</label></div>
                                                            </td>
                                                            <td>
                                                                <textarea class="ms-crm-InlineInput" id="reason" style=" 250px; height: 80px; line-height: 18px;" aria-multiline="true" maxlength="100"></textarea>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                    </tr>
                                    <tr></tr>
                                    <tr></tr>
                                </tbody>
                            </table>
                        </div>
                        <div id="tdDialogFooter" cellspacing="0" cellpadding="5" style="table-layout: fixed; " columns="2" class="ms-crm-RefreshDialog-Footer-MDD">
                            <button id="ok_id" onclick="okay()" tabindex="0" type="button" class="ms-crm-RefreshDialog-Button" style="margin-left:10px">确定</button>
                            <button id="cancel_id" onclick="cancel()" tabindex="0" type="button" class="ms-crm-RefreshDialog-Button" style="margin-left:10px">取消</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <span id="__Page_crmEventManager"></span>
    
        <script>
            var createPageManager = "crmCreate(Mscrm.PageManager, { \"id\": \"crmPageManager\", \"mode\": \"iframe\", \"executeDeferredActionsOnDemand\": false, \"deferredActionList\": [], \"deferredActionParameters\": [], \"pageOnLoadScriptList\": [], \"rootElement\": \"\" }, null, { \"eventManager\": \"__Page_crmEventManager\" }, null)";
            var createEventManager = "crmCreate(Mscrm.EventManager, { \"eventSubscribers\": [], \"childEventManagerIds\": null, \"parentEventManagerId\": \"\", \"id\": \"__Page_crmEventManager\" }, null, {}, null)";
        </script>
        <div id="vakata-contextmenu"></div>
    </body>
    </html>
    
    <script type="text/javascript">
        function okay() {
            var context = document.getElementById("reason").value;
            if (context) {
                console.log(context);
                window.returnValue = { reason: context };
                window.close();
            } else {
                alert(" 请填写驳回原因。");
            }
        }
        function cancel() {
            console.log("取消")
            window.close();
        }
    </script>
  • 相关阅读:
    [Swift]LeetCode472. 连接词 | Concatenated Words
    [Swift]LeetCode470. 用 Rand7() 实现 Rand10() | Implement Rand10() Using Rand7()
    [Swift通天遁地]七、数据与安全-(19)使用Swift实现原生的SHA1加密
    [Swift通天遁地]七、数据与安全-(18)使用Swift实现原生的MD5加密
    [Swift通天遁地]七、数据与安全-(17)使用Swift实现原生的3DES加密和解密
    poj 1265 Area(pick 定理)
    Visual C++文件后缀名释义
    Linux 设备文件的创建和mdev
    37、ifconfig命令
    iOS开发- 生成/解析.vcf文件
  • 原文地址:https://www.cnblogs.com/parkerchen/p/16007274.html
Copyright © 2020-2023  润新知